Commit 69545c95 authored by Anders Hartvoll Ruud's avatar Anders Hartvoll Ruud Committed by Commit Bot

[:is/:where] Add features to nested complex selectors

This adds (basic) support for adding features to nested complex
selectors.

Bug: 568705
Change-Id: I1f0512ac148bc1f5810787e68777b2d14bd94089
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2435225
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812275}
parent 2b00a7dd
...@@ -874,8 +874,8 @@ void RuleFeatureSet::AddFeaturesToInvalidationSetsForSelectorList( ...@@ -874,8 +874,8 @@ void RuleFeatureSet::AddFeaturesToInvalidationSetsForSelectorList(
sub_selector; sub_selector = CSSSelectorList::Next(*sub_selector)) { sub_selector; sub_selector = CSSSelectorList::Next(*sub_selector)) {
descendant_features.has_features_for_rule_set_invalidation = false; descendant_features.has_features_for_rule_set_invalidation = false;
AddFeaturesToInvalidationSetsForCompoundSelector( AddFeaturesToInvalidationSets(*sub_selector, sibling_features,
*sub_selector, sibling_features, descendant_features); descendant_features);
if (!descendant_features.has_features_for_rule_set_invalidation) if (!descendant_features.has_features_for_rule_set_invalidation)
selector_list_contains_universal = true; selector_list_contains_universal = true;
......
...@@ -1516,6 +1516,14 @@ RefTestData ref_equal_test_data[] = { ...@@ -1516,6 +1516,14 @@ RefTestData ref_equal_test_data[] = {
// selector in the ref. // selector in the ref.
{".a :is(.b, .c:nth-child(1))", {".a :is(.b, .c:nth-child(1))",
".a .b, .a .c:nth-child(1), .b:nth-child(1)"}, ".a .b, .a .c:nth-child(1), .b:nth-child(1)"},
{":is(.a) .b", ".a .b"},
{":is(.a, .b) .c", ".a .c, .b .c"},
{":is(.a .b, .c .d) .e", ".a .b .e, .c .d .e"},
{":is(:is(.a .b, .c) :is(.d, .e .f), .g) .h",
".a .b .h, .c .h, .d .h, .e .f .h, .g .h"},
{":is(.a, .b) :is(.c, .d)", ".a .c, .a .d, .b .c, .b .d"},
{":is(.a .b, .c .d) :is(.e .f, .g .h)",
".a .b .f, .a .b .h, .c .d .f, .c .d .h, .e .f, .g .h"},
// clang-format on // clang-format on
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment