Rewrite naturalWidth-naturalHeight tests to allow its subtests to be repeated with different conditions
Categories
(Core :: Layout: Images, Video, and HTML Frames, task)
Tracking
()
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(2 files, 1 obsolete file)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr140+
|
Details | Review |
These WPTs...
https://searchfox.org/mozilla-central/source/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/naturalWidth-naturalHeight.html
https://searchfox.org/mozilla-central/source/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/naturalWidth-naturalHeight-unavailable.tentative.html
...are currently written with hardcoded <img> elements, where we test their naturalWidth and naturalHeight.
It would be useful to restructure the test so that we can use the same data to test more conditions and more exposed data. For example:
- It'd be nice to be able to repeat the test with
srcset="... 2x"(which should cut the naturalWidth/naturalHeight in half) - It'd be nice to be able to repeat the test and check
img.widthandimg.height(which in many cases are derived from the naturalWidth / naturalHeight).
I'm filing this bug on simply restructuring the test to abstract the actual img elements away into "bundles of data" which then get used to generate img elements, so that later patches can extend the test to generate additional not-quite-duplicate img elements to make these additional checks without having to copypaste all of the source data.
| Assignee | ||
Comment 1•7 months ago
|
||
This patch doesn't fundamentally change the behavior or expectations of this
test.
This patch simply moves all of the img elements to a <template> (which is not
rendered), and then appends a clone of those elements to a container within
the body; and then those cloned img elements are what get tested.
This sets the stage for later patches to append additional modified copies of
these img elements, with small modifications (e.g. using 'srcset' rather than
'src').
| Assignee | ||
Comment 2•7 months ago
|
||
This patch doesn't fundamentally change the behavior or expectations of this
test.
This patch simply moves all of the img elements to a <template> (which is not
rendered), and then appends a clone of those elements to a container within
the body; and then those cloned img elements are what get tested.
This sets the stage for later patches to append additional modified copies of
these img elements, with small modifications (e.g. using 'srcset' rather than
'src').
Updated•7 months ago
|
| Assignee | ||
Comment 3•7 months ago
|
||
While iterating further down in my patch stack, I decided to stop attempting to update/evolve naturalWidth-naturalHeight.html in-place while preserving its faithfulness to the existing and soon-to-be-replaced spec text here.
So I'm abandoning the patch that adjust that test and just keeping the patch that touches the other test (which I intend to expand into the canonical test that tests the new spec text). Sorry for the churn!
Updated•7 months ago
|
| Assignee | ||
Comment 4•7 months ago
|
||
(I've decided we should just delete naturalWidth-naturalHeight.html once the spec change is complete, since it'll be obsoleted by the other test which will test the same things [and more] with new expectations; given that, it ended up feeling silly to land these patches to cosmetically adjust it.)
Comment 7•7 months ago
|
||
Backed out for causing wpt failures at security.pattern.fillStyle.sub.html
| Assignee | ||
Comment 8•7 months ago
|
||
(In reply to Cristina Horotan [:chorotan] from comment #7)
Backed out for causing wpt failures at security.pattern.fillStyle.sub.html
(almost certainly unrelated; sheriffs are looking into it. I'll re-land later on.)
Comment 10•7 months ago
|
||
| bugherder | ||
Comment 11•7 months ago
|
||
| bugherder | ||
Updated•6 months ago
|
| Assignee | ||
Comment 13•3 months ago
|
||
This patch doesn't fundamentally change the behavior or expectations of this
test.
This patch simply moves all of the img elements to a <template> (which is not
rendered), and then appends a clone of those elements to a container within
the body; and then those cloned img elements are what get tested.
This sets the stage for later patches to append additional modified copies of
these img elements, with small modifications (e.g. using 'srcset' rather than
'src').
Original Revision: https://phabricator.services.mozilla.com/D251659
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Updated•3 months ago
|
Comment 14•3 months ago
|
||
| uplift | ||
Description
•