Closed Bug 1908991 Opened 1 year ago Closed 1 year ago

Minor cleanup to tests for dynamic removal of href from SVG image element

Categories

(Core :: SVG, task)

task

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(4 files)

Filing this for some tweaks that I'd like to make to the tests that landed in bug 1908625.

Blocks: 1908992

In particular, this patch...

  • Changes the geometry to use sizes of 2 & 4 instead of 1.5 & 3 (for brevity
    and since whole numbers are easier to reason about & work with).
  • Changes single-quotes to double-quotes in the <rect> for consistency.
  • Moves most <image> attributes to the start and insert some newlines before
    its href/xlink:href attributes for improved readability.
  • Removes the unnecessary/unused xmlns:xlink namespace declaration from the
    inner SVG document (inside the image) in the second test.
  • Makes the "test()" function wait for a paint before making the dynamic
    attribute-removal (and changes that function to use async/await for
    readability). This makes these tests more robust, to be sure they actually
    have something to invalidate in the first place.

This patch adds each new tests as a modified-copy (with 'hg cp' + edits) of the
correspondingly-numbered "image-remove-href-*" test.

The second test fails for some reason, though it seems to pass in Chrome, so
I'm adding it with an expected-failure annotation for now.

Note that one of the tests in part 3 fails; I've got it annotated as expected-fail for now. I plan to file a followup for that which I can include in the .ini file; toggling ni=me as a reminder. (Going AFK for a bit right now so I can't do it at the moment.)

Flags: needinfo?(dholbert)

The test() function is only really designed to run once, but it actually gets
invoked more than once as documented in the new comment. So this patch nerfs
any invocations after the first, to avoid any associated intermittent weirdness
that might result from repeated invocations.

Attachment #9413909 - Attachment description: Bug 1908991 part 3: Add WPTs to test modifications to a SVG image element's href and xlink:href attributes. r?longsonr → Bug 1908991 part 4: Add WPTs to test modifications to a SVG image element's href and xlink:href attributes. r?longsonr

(In reply to Daniel Holbert [:dholbert] from comment #4)

Note that one of the tests in part 3 fails; I've got it annotated as expected-fail for now. I plan to file a followup for that which I can include in the .ini file; toggling ni=me as a reminder. (Going AFK for a bit right now so I can't do it at the moment.)

I figured out what was going on that was causing that test^ to fail. There were two weird things going on there:
(A) the test was firing its test() function (and modifying/removing its attributes) multiple times, since it had multiple loads.
(B) With those unintentional repeated test() invocations, we happened to trigger a subtle interop difference where removeAttribute('href') does different things in Firefox vs. Chromium/WebKit, depending on whether xlink:href is present and whether it's been modified.

I've addressed (A) by nerfing repeated calls to the load-handler in the tests associated this bug that were susceptible to this (i.e. the tests where the <image> element's load-handler kicks off a new image load internally which results in another call to the load handler). This nerfing makes the test pass now.

I've filed Bug 1909028 to document & hopefully investigate the difference that I described as (B) here.

Flags: needinfo?(dholbert)
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e8e843b44635 part 1: Various tweaks to image-remove-href-* WPT tests. r=longsonr https://hg.mozilla.org/integration/autoland/rev/9878deb3fb06 part 2: Add a test that removes xlink:href (rather than href) from an SVG image element. r=longsonr https://hg.mozilla.org/integration/autoland/rev/5dbc434f54bb part 3: Avoid repeated calls to test() in image-remove-href-2.svg. r=longsonr https://hg.mozilla.org/integration/autoland/rev/89d7e0466160 part 4: Add WPTs to test modifications to a SVG image element's href and xlink:href attributes. r=longsonr
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/47215 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: