Closed Bug 1697714 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 27950 - Custom State Pseudo Class: Fix iterators of internals.states

Categories

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

task

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

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

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

b'Kent Tamura <tkent@chromium.org>' wrote:

Custom State Pseudo Class: Fix iterators of internals.states

internals.states.values() produced broken results if an item was
removed from internals.states after the iterator creation. Our
implementations used a collection class which did not support
modification while iteration.

This CL fixes it by updating the collection class from
LinkedHashSet\<String> to Vector\<String>. This makes operations of
internals.states O(N). However we expect people don't add huge
number of states to a single internals.states.

  • Move the CustomStateIterationSource definition to the top of
    custom_state_set.cc so that CustomStateSet::deleteForBinding()
    recognizes methods of CustomStateIterationSource.

  • CustomStateSet holds a set of CustomStateIterationSource because
    CustomStateSet should tell item deletion to
    CustomStateIterationSource instances.

Bug: 1184020
Change-Id: I20cd677b9ca3a10377daed1c0b51324b42b4771a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2744921
Auto-Submit: Kent Tamura \<tkent@chromium.org>
Commit-Queue: Kent Tamura \<tkent@chromium.org>
Reviewed-by: Mason Freed \<masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#861855}

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

CI Results

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

Total 1 tests and 4 subtests

Status Summary

Firefox

OK : 1
FAIL: 4

Chrome

OK : 1
PASS: 3
FAIL: 1

Safari

OK : 1
FAIL: 4

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/custom-elements/state/tentative/ElementInternals-states.html
CustomStateSet behavior of ElementInternals.states: Initial state: FAIL (Chrome: PASS, Safari: FAIL)
CustomStateSet behavior of ElementInternals.states: Exceptions: FAIL (Chrome: PASS, Safari: FAIL)
CustomStateSet behavior of ElementInternals.states: Modifications: FAIL (Chrome: PASS, Safari: FAIL)
Updating a CustomStateSet while iterating it should work: FAIL (Chrome: FAIL, Safari: FAIL)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a1246d296c09
[wpt PR 27950] - Custom State Pseudo Class: Fix iterators of internals.states, a=testonly
https://hg.mozilla.org/integration/autoland/rev/3b4b119e2182
[wpt PR 27950] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.