Closed Bug 1969478 Opened 7 months ago Closed 7 months ago

Extend naturalWidth-naturalHeight tests to test more scenarios

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

(8 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Filing this bug for some patches to test more variants in these WPTs -- building on bug 1969000, in service of having good test coverage for the changes in bug 1965560.

Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Depends on: 1969487
No longer depends on: 1969000

I originally created this test as a placeholder to test some edge cases where
the naturalWidth and naturalHeight might be unavailable (hence "unavailable" in
the name), with the intent of ultimately merging it back into
naturalWidth-naturalHeight.html once
https://github.com/whatwg/html/issues/11287 was resolved.

However, I'm now planning for this test to just be the canonical test
for the img.{naturalWidth,naturalHeight,width,height} attributes, for a variety
of scenarios (not just ones where the natural width/height might be
unavailable). Then we can remove the naturalWidth-naturalHeight.html test
entirely (obsoleted by this test) when the spec change is complete.

This patch is the first part of this -- just renaming the test and updating
the title to reflect its new broader purpose.

This lets us encode updated expectations for these scenarios (based on more
web=compatible soon-to-be-proposed spec text[1]) right now in
naturalWidth-naturalHeight-width-height.tentative.html, while letting
naturalWidth-naturalHeight.html continue to encode the expectations of current
spec text for the time being.

(Note that some of the scenarios in the older test are already tested in the
newer test and hence don't need to be copied over.)

[1] https://github.com/whatwg/html/issues/11287

When the image isn't rendered, the values returned by img.width and img.height
are supposed to be different in many cases, and that's what we're testing for
here.

Relevant spec text on these differences is here:
https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-width
"if the image is being rendered; or else ..."

(though that spec text needs some nuance added per
https://github.com/whatwg/html/issues/11287#issuecomment-2923467541 )

Firefox Nightly fails a bunch of the new tests added here, and those failures
will be fixed in bug 1965560 as noted in the .ini file.

Keywords: leave-open
Pushed by dholbert@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/40835b1dc257 https://hg.mozilla.org/integration/autoland/rev/6c5811bf505a part 1: Rename naturalWidth-naturalHeight-unavailable.tentative.html to naturalWidth-naturalHeight-width-height.tentative.html. r=jwatt https://github.com/mozilla-firefox/firefox/commit/0b9e29147f63 https://hg.mozilla.org/integration/autoland/rev/3222d1f57198 part 2: Copy subtests from naturalWidth-naturalHeight.html to naturalWidth-naturalHeight-width-height.tentative.html. r=jwatt https://github.com/mozilla-firefox/firefox/commit/7b95c0ee47be https://hg.mozilla.org/integration/autoland/rev/5ee05ea4fef5 part 3: Extend WPT naturalWidth-naturalHeight-width-height.tentative.html to test img with srcset and different density values. r=jwatt
Failed to create upstream wpt PR due to merge conflicts. This requires fixup from a wpt sync admin.
Flags: needinfo?(james)
Flags: needinfo?(aborovova)

(In reply to Web Platform Test Sync Bot [:wpt-sync] (Matrix: #interop:mozilla.org) from comment #6)

Failed to create upstream wpt PR due to merge conflicts. This requires fixup
from a wpt sync admin.

I'm guessing this maybe was due to the fact that this patch stack is based on bug 1969487 which adjusts a test that gets renamed-and-further-adjusted over here.

So I suspect we should be able to create an upstream PR without any merge conflicts if our merge-point is after https://github.com/web-platform-tests/wpt/pull/52881 (bug 1969487) is merged.

Pushed by dholbert@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/63907019aa42 https://hg.mozilla.org/integration/autoland/rev/93d633f7ce3e part 4: Extend WPT naturalWidth-naturalHeight-width-height.tentative.html to repeat each test with 'display:none' on the image. r=layout-reviewers,emilio
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/52894 for changes under testing/web-platform/tests
Flags: needinfo?(james)
Flags: needinfo?(aborovova)
Upstream PR merged by moz-wptsync-bot
Upstream PR merged by moz-wptsync-bot
Assignee: dholbert → nobody
QA Whiteboard: [qa-triage-done-c142/b141]
Assignee: nobody → dholbert

I originally created this test as a placeholder to test some edge cases where
the naturalWidth and naturalHeight might be unavailable (hence "unavailable" in
the name), with the intent of ultimately merging it back into
naturalWidth-naturalHeight.html once
https://github.com/whatwg/html/issues/11287 was resolved.

However, I'm now planning for this test to just be the canonical test
for the img.{naturalWidth,naturalHeight,width,height} attributes, for a variety
of scenarios (not just ones where the natural width/height might be
unavailable). Then we can remove the naturalWidth-naturalHeight.html test
entirely (obsoleted by this test) when the spec change is complete.

This patch is the first part of this -- just renaming the test and updating
the title to reflect its new broader purpose.

Original Revision: https://phabricator.services.mozilla.com/D251969

Attachment #9517633 - Flags: approval-mozilla-esr140?

This lets us encode updated expectations for these scenarios (based on more
web=compatible soon-to-be-proposed spec text[1]) right now in
naturalWidth-naturalHeight-width-height.tentative.html, while letting
naturalWidth-naturalHeight.html continue to encode the expectations of current
spec text for the time being.

(Note that some of the scenarios in the older test are already tested in the
newer test and hence don't need to be copied over.)

[1] https://github.com/whatwg/html/issues/11287

Original Revision: https://phabricator.services.mozilla.com/D251970

Attachment #9517634 - Flags: approval-mozilla-esr140?
Attachment #9517635 - Flags: approval-mozilla-esr140?

firefox-esr140 Uplift Approval Request

  • User impact if declined: This is just some supporting test changes that we'll need in order to uplift bug 1969753 (which gets us some webcompat improvements).
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: test-only changes
  • String changes made/needed: Test-only change; no user-facing changes.
  • Is Android affected?: yes
Attachment #9517636 - Flags: approval-mozilla-esr140?

When the image isn't rendered, the values returned by img.width and img.height
are supposed to be different in many cases, and that's what we're testing for
here.

Relevant spec text on these differences is here:
https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-width
"if the image is being rendered; or else ..."

(though that spec text needs some nuance added per
https://github.com/whatwg/html/issues/11287#issuecomment-2923467541 )

Firefox Nightly fails a bunch of the new tests added here, and those failures
will be fixed in bug 1965560 as noted in the .ini file.

Original Revision: https://phabricator.services.mozilla.com/D251972

Flags: in-testsuite+
Attachment #9517633 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
Attachment #9517634 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
Attachment #9517635 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
Attachment #9517636 - 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: