DescriptionFix crash when removing stylesheets from shadow tree.
The added sheets passed into StyleSheetInvalidationAnalysis may either be
added or removed. When they are removed style elements from a shadow tree,
the style element may no longer have a containingShadowRoot if the element
has already been removed. That caused a crash when the containingShadowRoot
was accessed without a nullptr check.
Instead of deducing the scope from the style element, pass the stylesheet
collection TreeScope to the analysis object. The m_scopingNodes, which is
probably a left-over from <style scoped> has been removed.
Now, the shadow tree root node, or outermost shadow host if ::content
rules makes that necessary, is always marked sub-tree dirty. The previous
code-path could trigger id/class invalidation of separate elements when
the stylesheet contents had multiple owner nodes, but that was most likely
wrong if it could ever happen.
BUG=522860
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201058
Patch Set 1 #
Total comments: 6
Patch Set 2 : Addressed review issues and added test. #
Messages
Total messages: 20 (9 generated)
|