Commit a8014bf1 authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

[PE] Invalidate <use> instances even when mutating from the parser

When a layout is triggered when the parser is interrupted, an instance
tree can be built for a <use> that references a subtree that contains
the insertion point of the parser. This <use> instance (or instances)
would then not be invalidated when the parsing resumed.

Invalidate instances of an element when its children changes even when
the mutation originates from the parser. (This condition was added in
3c2310f2 without further explanation
"Only invalidate SVGElementInstances when !changedByParser is set.". Due
to the lazyness of the shadow tree/instance rebuilding this will
hopefully not regress performance.)

Bug: 794594
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I58f3a74ef9812503c0111d3564dad8ee3527d27b
Reviewed-on: https://chromium-review.googlesource.com/832386Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#524726}
parent fd1fa7e7
<!DOCTYPE html>
<div style="width: 100px; height: 100px; background-color: green"></div>
<!DOCTYPE html>
<svg>
<rect width="100" height="100" fill="red"/>
<use href="#foo"/>
<defs>
<g id="foo">
<rect width="50" height="100" fill="green"/>
<script>
// Force a layout so that the shadow tree is instantiated.
document.documentElement.offsetTop;
</script>
<rect x="50" width="50" height="100" fill="green"/>
</g>
</defs>
</svg>
...@@ -444,8 +444,7 @@ void SVGElement::ChildrenChanged(const ChildrenChange& change) { ...@@ -444,8 +444,7 @@ void SVGElement::ChildrenChanged(const ChildrenChange& change) {
Element::ChildrenChanged(change); Element::ChildrenChanged(change);
// Invalidate all instances associated with us. // Invalidate all instances associated with us.
if (!change.by_parser) InvalidateInstances();
InvalidateInstances();
} }
CSSPropertyID SVGElement::CssPropertyIdForSVGAttributeName( CSSPropertyID SVGElement::CssPropertyIdForSVGAttributeName(
......
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