Closed Bug 1856706 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 42083 - Optimize several things about DOM Parts [1/2]

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

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

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

Mason Freed <masonf@chromium.org> wrote:

Optimize several things about DOM Parts [1/2]

See [1] for details. This CL makes these changes:

  • Stop maintaining “live” parts lists across DOM mutations. This is
    controlled by a new feature flag, DOMPartsAPIActivePartTracking,
    that when disabled, short-circuits all of the part list maintenance
    code during DOM mutations. This means that if DOM nodes that are
    connected to parts are moved around in the DOM, including being
    removed from the document, the cached parts list does not change.
  • Update ToV8HelperSequence to work directly with Deques, and get
    rid of getParts() code to convert to a HeapVector.
  • Optimize ToV8HelperSequence to use iterators instead of array
    indexing, which should also speed up all sequence bindings. (TBD)
  • Change from FrozenArray\<Part> to sequence\<Part>. This eliminated
    the overhead of Object::SetIntegrityLevel(), which was ~29% of the
    total getParts() time.
  • Add a fast path for PartRoot.replaceChildren when all children
    are being removed.
  • Inline IsValid().
  • Call InsertBefore() instead of before() to avoid some extra
    validity checks. This required making ConvertNodeUnionsIntoNode
    public.
  • Add PartRoot.getPartNode(n), which allows direct access to a
    single Part's Node, to avoid wrapping up the entire parts list.

[1] https://docs.google.com/document/d/1wSbBV6tS-KLlHWxaK_FmEJFOwkY-pb8_YDoFJgDrbMg/edit

Bug: 1453291
Change-Id: I3df15b2a552fe9c2793a7f7f2095d632bcea8326
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4878048
Reviewed-by: Joey Arhar \<jarhar@chromium.org>
Commit-Queue: Mason Freed \<masonf@chromium.org>
Auto-Submit: Mason Freed \<masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1204772}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

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

Total 6 tests and 1 subtests

Status Summary

Firefox

OK : 6
FAIL: 38

Chrome

OK : 6
PASS: 30
FAIL: 8

Safari

OK : 6
FAIL: 38

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /dom/parts/basic-dom-part-declarative-brace-syntax.tentative.html [wpt.fyi]
    • Basic declarative DOM Parts (Main Document): FAIL (Chrome: PASS, Safari: FAIL)
    • Basic declarative DOM Parts (Template): FAIL (Chrome: PASS, Safari: FAIL)
    • Basic declarative DOM Parts (Clone): FAIL (Chrome: PASS, Safari: FAIL)
    • Basic declarative DOM Parts (PartClone): FAIL (Chrome: PASS, Safari: FAIL)
    • Post-parsing structure of child parts, and stickiness: FAIL (Chrome: PASS, Safari: FAIL)
    • Parser only behavior - adding parseparts does nothing: FAIL (Chrome: PASS, Safari: FAIL)
    • Just parts, no text before: FAIL (Chrome: FAIL, Safari: FAIL)
    • Self closing elements can't use parseparts: FAIL (Chrome: PASS, Safari: FAIL)
    • Second head element can't use parseparts: FAIL (Chrome: PASS, Safari: FAIL)
    • Foreign content should support Parts: FAIL (Chrome: FAIL, Safari: FAIL)
    • Not quite parts syntax - none should become parts, and nothing should crash: FAIL (Chrome: PASS, Safari: FAIL)
  • /dom/parts/basic-dom-part-declarative-pi-syntax.tentative.html [wpt.fyi]
    • Basic declarative DOM Parts (Main Document): FAIL (Chrome: PASS, Safari: FAIL)
    • Basic declarative DOM Parts (Template): FAIL (Chrome: PASS, Safari: FAIL)
    • Basic declarative DOM Parts (Clone): FAIL (Chrome: PASS, Safari: FAIL)
    • Basic declarative DOM Parts (PartClone): FAIL (Chrome: PASS, Safari: FAIL)
  • /dom/parts/basic-dom-part-objects.tentative.html [wpt.fyi]
    • Basic imperative DOM Parts object construction (Document): FAIL (Chrome: FAIL, Safari: FAIL)
    • Cloning (Document): FAIL (Chrome: FAIL, Safari: FAIL)
    • Cloning Element (Document): FAIL (Chrome: PASS, Safari: FAIL)
    • Cloning Text (Document): FAIL (Chrome: PASS, Safari: FAIL)
    • Cloning Comment (Document): FAIL (Chrome: PASS, Safari: FAIL)
    • Cloning CDATASection (Document): FAIL (Chrome: PASS, Safari: FAIL)
    • Cloning ProcessingInstruction (Document): FAIL (Chrome: PASS, Safari: FAIL)
    • DOM mutations are not tracked (Document): FAIL (Chrome: FAIL, Safari: FAIL)
    • ChildNodePart children manipulation (Document): FAIL (Chrome: PASS, Safari: FAIL)
    • Corner case ChildNodePart construction and cloning (Document): FAIL (Chrome: PASS, Safari: FAIL)
    • Basic imperative DOM Parts object construction (DocumentFragment): FAIL (Chrome: FAIL, Safari: FAIL)
    • Cloning (DocumentFragment): FAIL (Chrome: FAIL, Safari: FAIL)
    • Cloning Element (DocumentFragment): FAIL (Chrome: PASS, Safari: FAIL)
    • Cloning Text (DocumentFragment): FAIL (Chrome: PASS, Safari: FAIL)
    • Cloning Comment (DocumentFragment): FAIL (Chrome: PASS, Safari: FAIL)
    • Cloning CDATASection (DocumentFragment): FAIL (Chrome: PASS, Safari: FAIL)
    • Cloning ProcessingInstruction (DocumentFragment): FAIL (Chrome: PASS, Safari: FAIL)
    • DOM mutations are not tracked (DocumentFragment): FAIL (Chrome: FAIL, Safari: FAIL)
    • ChildNodePart children manipulation (DocumentFragment): FAIL (Chrome: PASS, Safari: FAIL)
    • Corner case ChildNodePart construction and cloning (DocumentFragment): FAIL (Chrome: PASS, Safari: FAIL)
  • /dom/parts/dom-parts-parseparts-on-body.tentative.html [wpt.fyi]
    • It is possible to put parseparts on the body element: FAIL (Chrome: PASS, Safari: FAIL)
  • /dom/parts/dom-parts-parseparts-on-head.tentative.html [wpt.fyi]
    • It is not possible to put parseparts on the head element: FAIL (Chrome: PASS, Safari: FAIL)
  • /dom/parts/dom-parts-parseparts-on-root.tentative.html [wpt.fyi]
    • It is not possible to put parseparts on the root element: FAIL (Chrome: PASS, Safari: FAIL)
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/400f295c93eb [wpt PR 42083] - Optimize several things about DOM Parts [1/2], a=testonly https://hg.mozilla.org/integration/autoland/rev/c42ec0043832 [wpt PR 42083] - Update wpt metadata, a=testonly
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/autoland/rev/b6f096d131ad [wpt PR 42083] - Optimize several things about DOM Parts [1/2], a=testonly https://hg.mozilla.org/integration/autoland/rev/69c72dcf4acf [wpt PR 42083] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
You need to log in before you can comment on or make changes to this bug.