[css-marker] Avoid DCHECK failure when devtools inspect nested ::marker
When inspecting a ::marker originated by a ::before or ::after pseudo elements, the devtools use InspectorCSSAgent::getMatchedStylesForNode to retrieve the styles of the ::marker. This ends up calling MatchSlottedRules, which gets the AssignedSlot() of the originating ::before or ::after. But pseudo-elements can't have an assigned slot, so a DCHECK fails. This patch avoids this problem by aborting PseudoCSSRulesForElement in case that we have a pseudo-element. This also fixes the issue that devtools used to say that a *::marker selector would match a nested ::before::marker or ::after::marker. BUG=457718 TEST=http/tests/devtools/elements/styles-2/nested-pseudo-elements.js TEST=inspector-protocol/css/nested-pseudo-element-matching-selectors.js Change-Id: I78a1efe708dc1668934025141231b2cc87f34136 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2138413 Commit-Queue: Oriol Brufau <obrufau@igalia.com> Reviewed-by:Andrey Kosyakov <caseq@chromium.org> Reviewed-by:
Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#757617}
Showing
Please register or sign in to comment