Commit d6df8288 authored by ecobos's avatar ecobos Committed by Commit bot

Don't unconditionally generate a layout object for SVG <stop> elements.

This is (really!) the last overload missed in
https://crrev.com/28ec0e0c2425d480693e8d40510b8093cef1f89f

BUG=691205

Review-Url: https://codereview.chromium.org/2689083004
Cr-Commit-Position: refs/heads/master@{#449942}
parent 7f580245
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div></div>
<script>
test(function() {
document.querySelector('div').appendChild(
document.createElementNS('http://www.w3.org/2000/svg', 'marker'));
document.body.offsetTop;
}, "Doesn't crash");
</script>
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div></div>
<script>
const SVGElements = [
'a', 'altGlyph', 'altGlyphDef', 'altGlyphItem', 'animate', 'animateColor',
'animateMotion', 'animateTransform', 'audio', 'canvas', 'circle',
'clipPath', 'color-profile', 'cursor', 'defs', 'desc', 'discard',
'ellipse', 'feBlend', 'feColorMatrix', 'feComponentTransfer',
'feComposite', 'feConvolveMatrix', 'feDiffuseLighting',
'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood',
'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage',
'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight',
'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence', 'filter',
'font', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src',
'font-face-uri', 'foreignObject', 'g', 'glyph', 'glyphRef', 'hatch',
'hatchpath', 'hkern', 'iframe', 'image', 'line', 'linearGradient',
'marker', 'mask', 'mesh', 'meshgradient', 'meshpatch', 'meshrow',
'metadata', 'missing-glyph', 'mpath', 'path', 'pattern', 'polygon',
'polyline', 'radialGradient', 'rect', 'script', 'set', 'solidcolor',
'stop', 'style', 'svg', 'switch', 'symbol', 'text', 'textPath', 'title',
'tref', 'tspan', 'unknown', 'use', 'video', 'view', 'vkern'
];
for (const tag of SVGElements) {
test(function() {
document.querySelector('div').appendChild(
document.createElementNS('http://www.w3.org/2000/svg', tag));
document.body.offsetTop;
}, "svg:" + tag + " in HTML doesn't crash");
}
</script>
...@@ -56,7 +56,7 @@ LayoutObject* SVGStopElement::createLayoutObject(const ComputedStyle&) { ...@@ -56,7 +56,7 @@ LayoutObject* SVGStopElement::createLayoutObject(const ComputedStyle&) {
} }
bool SVGStopElement::layoutObjectIsNeeded(const ComputedStyle&) { bool SVGStopElement::layoutObjectIsNeeded(const ComputedStyle&) {
return true; return isValid() && hasSVGParent();
} }
Color SVGStopElement::stopColorIncludingOpacity() const { Color SVGStopElement::stopColorIncludingOpacity() const {
......
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