Closed Bug 1820675 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 38837 - Revert "Add :visited duplicate rules to regular buckets"

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox112 fixed)

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Devlin Cronin <rdevlin.cronin@chromium.org> wrote:

Revert "Add :visited duplicate rules to regular buckets"

This reverts commit dc5c40463c0b59bea1ed85c27f9b9d95a234ed9a.

Reason for revert: Suspecting this caused the test
EasySelectorCheckerTest.IsEasy to fail:

https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20Tests%20(dbg)(1)/111829/overview

Original change's description:

Add :visited duplicate rules to regular buckets

During RuleSet::AddRule, when adding a rule which depends on visited
link status, we add a duplicate rule (but with different a
LinkMatchType) to a special bucket for visited rules. However, this
approach does not quite work, since we depend on certain rules being
present in specific buckets in some situations. In particular, rules
which contain ::part() must be in the part bucket, because we don't
provide the relevant part names when when matching rules from other
buckets.

This CL drops the special 'visited_dependent_rules_' and instead
adds the duplicate rules via FindBestRuleSetAndAdd. Calling
FindBestRuleSetAndAdd on the duplicate RuleData could incorrectly
mark the selector as "covered by bucketing", so a BucketCoverage
parameter is added to suppress this behavior.

Note that the function StyleResolver::StyleRulesForElement (only
used for Editing) now needs to suppress :visited styles (see
SerializationTest.Link and crbug.com/938590), because we try to match
the visited-dependent rules regardless of the value of
ElementRuleCollector::inside_link_.

Fixed: 1413904
Change-Id: Id360bef4f1b977107f109c4520db08f6e602a034
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4295376
Auto-Submit: Anders Hartvoll Ruud \<andruud@chromium.org>
Reviewed-by: Rune Lillesveen \<futhark@chromium.org>
Commit-Queue: Rune Lillesveen \<futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1113519}

Change-Id: I8072cdb5a9d196c821b66e22dabd5500550f4bd7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4313026
Commit-Queue: Rubber Stamper \<rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Devlin Cronin \<rdevlin.cronin@chromium.org>
Bot-Commit: Rubber Stamper \<rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Devlin Cronin \<rdevlin.cronin@chromium.org>
Commit-Queue: Devlin Cronin \<rdevlin.cronin@chromium.org>
Reviewed-by: Devlin Cronin \<rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1113661}

PR 38837 applied with additional changes from upstream: af59415df8af0d0e85a21dcf78b8878a41e4ae2d
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6a1e19faa665 [wpt PR 38837] - Revert "Add :visited duplicate rules to regular buckets", a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
You need to log in before you can comment on or make changes to this bug.