Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
currentColor for highlight pseudos uses the correct originating element
Per the resolutions in [1], for a highlight pseudo with currentColor as its color, getComputedStyle(element, "::highlight(...)").color should return the color of the originating element (since this is the color that would be painted if that highlight were the only one applied). This is currently achieved by having Color::ApplyValue grab the color from the originating element for highlights using currentColor. This hits a problem when we do getComputedStyle(element, "::highlight(...)") on an element that doesn't directly match a highlight pseudo, but is a child of an element matching a highlight pseudo. In that case we end up reusing the computed style for the highlight that was built for the ancestor element. That highlight style still uses the color from the ancestor element, which is the wrong result. Here we fix this by having StyleAdjuster::AdjustComputedStyle adjust the style to use the color from the correct originating element. [1] w3c/csswg-drafts#6818 (comment) Bug: 1321540 Change-Id: Ibbc9126811fe52ecadb358713857df05c1143708
- Loading branch information