Closed Bug 2079777 Opened 1 month ago Closed 1 month ago

[wpt-sync] Sync PR 63389 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=322973

Categories

(Core :: SVG, task, P4)

task

Tracking

()

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 63389 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/63389
Details from upstream follow.

Karl Dubost <karlcow@apple.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=322973

WebKit export from bug: Changing a list attribute detaches the SVGNumber, SVGLength and SVGPoint objects a script is holding instead of updating them

<pre>
Changing a list attribute detaches the SVGNumber, SVGLength and SVGPoint objects a script is holding instead of updating them

  1. A script reads an item from the rotate, x or points list.

  2. The script changes the attribute.

  3. The item still has its old value.

  4. Writing to the item no longer changes the element.

    let n = text.rotate.baseVal.getItem(0);
    text.setAttribute('rotate', '40 50 60');
    n.value; // 10, expected 40

SVG 2 defines what happens when the attribute changes:

  1. If the new list is shorter, the extra items at the end are detached.

  2. Every other item gets its new value.

    If length > new length, then:
    Detach each object in the list at an index greater than or
    equal to new length.
    ...
    Set item's value to v.

<a href="https://w3c.github.io/svgwg/svg2-draft/types.html#TermSynchronizeList">https://w3c.github.io/svgwg/svg2-draft/types.html#TermSynchronizeList</a>

Before, SVGNumberList::parse(), SVGLengthList::parse() and
SVGPointList::parse():

  1. Emptied the list, detaching every item.
  2. Parsed the new values into new items.

Now they:

  1. Parse the new values.
  2. Add or remove items at the end if the count changed.
  3. Write each value into the item at its index.

SVGTransformList already works this way.

Two WebKit tests expected the old behaviour:

  • SVGLengthList-xml-dom-modifications.xhtml now expects the held items
    to take the new values. The pixel test no longer makes sense and is
    removed.
  • SVGPointList-basics.xhtml puts its own point in the list, so the next
    setAttribute() changes that point. The test now checks this and resets
    the point before reusing it.

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=322973">https://bugs.webkit.org/show_bug.cgi?id=322973</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/323046@main">https://commits.webkit.org/323046@main</a>
</pre>

Component: web-platform-tests → SVG
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 95 tests and 16 subtests

Status Summary

Firefox

OK : 1[GitHub] 94[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 1[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 59[GitHub] 1012[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 10

Chrome

OK : 1
PASS: 23
FAIL: 36

Safari

OK : 1
PASS: 38
FAIL: 21

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
You need to log in before you can comment on or make changes to this bug.