servo/moz.build
author Emilio Cobos Álvarez <emilio@crisal.io>
Fri, 22 Mar 2019 22:26:53 +0000
changeset 465793 88b6e96d82153bf333e1a309f5ae384906168883
parent 449247 f038d9fa2026c01bc7a76ba799c9a1fcc16e67ae
child 466890 dbaaaa587dfe2be8ad2df5019e7eb62936cbdef9
permissions -rw-r--r--
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

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

with Files("**"):
    BUG_COMPONENT = ("Firefox", "General")

with Files("components/style/**"):
    BUG_COMPONENT = ("Core", "CSS Parsing and Computation")

with Files("components/style_derive/**"):
    BUG_COMPONENT = ("Core", "CSS Parsing and Computation")

with Files("components/style_traits/**"):
    BUG_COMPONENT = ("Core", "CSS Parsing and Computation")

with Files("components/selectors/**"):
    BUG_COMPONENT = ("Core", "CSS Parsing and Computation")

with Files("ports/geckolib/**"):
    BUG_COMPONENT = ("Core", "CSS Parsing and Computation")

with Files("tests/unit/style/**"):
    BUG_COMPONENT = ("Core", "CSS Parsing and Computation")