Closed Bug 1969000 Opened 7 months ago Closed 7 months ago

Rewrite naturalWidth-naturalHeight tests to allow its subtests to be repeated with different conditions

Categories

(Core :: Layout: Images, Video, and HTML Frames, task)

task

Tracking

()

RESOLVED FIXED
141 Branch
Tracking Status
firefox-esr140 --- fixed
firefox141 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(2 files, 1 obsolete file)

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.width and img.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: nobody → dholbert
Depends on: 1964818

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').

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').

Blocks: 1965560
Blocks: 1969478
Blocks: 1969487
No longer blocks: 1969478
Attachment #9491417 - Attachment description: Bug 1969000 part 2: Change WPT naturalWidth-naturalHeight-unavailable.tentative.html to append its img elements dynamically with JS. r?#layout → Bug 1969000: Change WPT naturalWidth-naturalHeight-unavailable.tentative.html to append its img elements dynamically with JS. r?#layout

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!

Attachment #9491416 - Attachment is obsolete: true

(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.)

Pushed by dholbert@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e49384f2c0e0 https://hg.mozilla.org/integration/autoland/rev/f4c23966e101 Change WPT naturalWidth-naturalHeight-unavailable.tentative.html to append its img elements dynamically with JS. r=TYLin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/52880 for changes under testing/web-platform/tests

Backed out for causing wpt failures at security.pattern.fillStyle.sub.html

Backout link

Push with failures

Failure log

(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.)

Pushed by dholbert@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/160097462ef3 https://hg.mozilla.org/integration/autoland/rev/15b8d5a979af Change WPT naturalWidth-naturalHeight-unavailable.tentative.html to append its img elements dynamically with JS. r=TYLin
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
Upstream PR merged by moz-wptsync-bot
QA Whiteboard: [qa-triage-done-c142/b141]

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

Attachment #9517631 - Flags: approval-mozilla-esr140?
Flags: in-testsuite+
Attachment #9517631 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: