gecko-dev/layout
Emilio Cobos Álvarez 2dd6a71b3e Bug 1531333 - Fix <svg:use> cycle detection. r=longsonr
With the current code we'll eventually detect the cycle, but will take much
more, creating many shadow trees unnecessarily. Take for example the following:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="133" height="232774">
    <style>
      symbol { display: block }
    </style>
    <symbol id="svg-sprite" viewBox="0 0 133 230866">
        <title>svg-sprite</title>
        <symbol id="svg-sprite" viewBox="0 0 133 230866">
            <title>svg-sprite</title>
            <use xlink:href="#svg-sprite" width="500" height="500" />
        </symbol>
        <use xlink:href="#svg-sprite" y="1601" width="133" height="228958" />
    </symbol>
    <use xlink:href="#svg-sprite" y="1601" width="133" height="230866" />
</svg>

Before this patch, we'd create an svg use element subtree for #svg-sprite. That
subtree will contain two other <use> elements, one under the <symbol>, one not
under it.

Both point to #svg-sprite, but we fail to detect we're an ancestor since the
element #svg-sprite we're looking at is the clone of the #svg-sprite element.

Thus we need to take a look at mOriginal instead (which is the <use> element
under #svg-sprite) rather than at the clone.

Yeah, I had to draw the trees, it's messy :)

Blink and WebKit do something slightly different (they check the element id
directly[1]). That's not 100% correct, since you can have multiple elements with
the same ID.

[1]: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/svg/svg_use_element.cc?l=560&rcl=861855dcb8c39ba8d42497247d433277858df79b

Differential Revision: https://phabricator.services.mozilla.com/D24565

--HG--
extra : moz-landing-system : lando
2019-03-22 22:26:53 +00:00
..
base Bug 1489295 Part 3 - Implement column-span:all for <button>. r=dbaron 2019-03-22 02:50:34 +00:00
build Bug 1535537 - Maintain information about focused TabParent on chrome main thread independently of APZ. r=nika 2019-03-19 13:37:14 +00:00
doc Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
forms Bug 1534914 - Improve blocked cursor behavior to fall back to next image. r=smaug 2019-03-13 18:38:09 +00:00
generic Bug 1441308 - Core renderroot splitting changes r=kats,sotaro 2019-03-22 18:28:42 +00:00
inspector Bug 1533201 - Make cssPropertySupportsType take an enum. r=heycam,rcaliman 2019-03-18 16:38:48 +00:00
ipc Bug 1532725 - Rename PRemoteFrame to PBrowserBridge. r=nika 2019-03-04 20:15:58 -06:00
mathml Bug 1533963 - Use a single RestyleHint representation. r=heycam 2019-03-14 11:47:50 +00:00
media
painting Bug 1441308 - Core renderroot splitting changes r=kats,sotaro 2019-03-22 18:28:42 +00:00
printing Bug 1528914 - Tidy the relationship between the doc shell and the pres context. r=qdot 2019-02-19 22:53:40 +00:00
reftests Bug 1535040 - Exclude some SVG frames from DL building fast-path r=jwatt 2019-03-21 14:48:54 +00:00
style Bug 1537708 - Clean up NS_STATE_IS_OUTER_SVG flag in favor of IsSVGOuterSVGFrame r=longsonr 2019-03-22 02:23:35 +00:00
svg Bug 1531333 - Fix <svg:use> cycle detection. r=longsonr 2019-03-22 22:26:53 +00:00
tables Bug 1533963 - Use a single RestyleHint representation. r=heycam 2019-03-14 11:47:50 +00:00
tools Bug 1529238 - Avoid TypeError in 'mach test <reftest> --verify'; r=bc 2019-03-22 19:52:07 +00:00
xul Bug 1441308 - Core renderroot splitting changes r=kats,sotaro 2019-03-22 18:28:42 +00:00
moz.build Bug 1521673 - Go through layout/tools/layout-debug even when tests are disabled. r=dmajor 2019-01-22 14:30:39 +00:00