Perform kNotInsideLink-related adjustments in ElementRuleCollector
The link_match_type stored on the MatchedProperties object is only relevant and correct if we're inside a link, hence we need to override the effective link_match_type at some point. Previously, we would do this apply-time, and not as part of the rule- collection. This CL instead proposes that ElementRuleCollector take the link-status into account, and perform the adjustment before storing the link_match_type on MatchedProperties, such that no further adjustments are required later. This fixes a bug in the CSSCascade path, where we would incorrectly not apply anything for selectors such as *:not(:link):not(:visited), even for elements that are not inside links. (See AddLinkFilter in cascade_expansion.cc. We would switch on the value 0, and then enter the default case, causing a filter to be added on kProperty, which causes all properties to be rejected. This is correct for elements that are inside links, but not for elements that aren't). Bug: 1055715 Change-Id: I2b63de41753fb0fa7b637a4be5bd009c2f165fcf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2072223Reviewed-by:Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#744631}
Showing
Please register or sign in to comment