Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp b/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp |
| index 8fbbbcade8507a67a2784665b489e5ebeb50e85a..faccc70cf41f9f6e3e27d0ad1666380d2a04a5b4 100644 |
| --- a/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp |
| +++ b/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp |
| @@ -46,6 +46,7 @@ |
| #include "core/layout/svg/SVGLayoutSupport.h" |
| #include "core/layout/svg/line/SVGInlineTextBox.h" |
| #include "core/layout/svg/line/SVGRootInlineBox.h" |
| +#include "core/paint/PaintLayer.h" |
| #include "core/svg/LinearGradientAttributes.h" |
| #include "core/svg/PatternAttributes.h" |
| #include "core/svg/RadialGradientAttributes.h" |
| @@ -583,6 +584,18 @@ void writeSVGContainer(TextStream& ts, const LayoutObject& container, int indent |
| void write(TextStream& ts, const LayoutSVGRoot& root, int indent) |
| { |
| + if (!root.hasFilterInducingProperty()) { |
| + writeStandardPrefix(ts, root, indent); |
| + ts << root << "\n"; |
| + writeChildren(ts, root, indent); |
| + return; |
| + } |
| + |
| + // An svg root element with a filter + reflect style can cause |
| + // a compositing state query assert while dumping the tree, so |
| + // quash it for now. FIXME: why is this so, why the assert? |
|
pdr.
2016/06/15 09:50:32
Nit: TODO(fs) instead of FIXME
I've been using FI
fs
2016/06/15 11:02:43
I think I inherited this one from noel =). Fixed.
|
| + |
| + DisableCompositingQueryAsserts disabler; |
| writeStandardPrefix(ts, root, indent); |
| ts << root << "\n"; |
| writeChildren(ts, root, indent); |
| @@ -659,14 +672,22 @@ void writeResources(TextStream& ts, const LayoutObject& object, int indent) |
| ts << " " << clipper->resourceBoundingBox(&layoutObject) << "\n"; |
| } |
| } |
| - if (!svgStyle.filterResource().isEmpty()) { |
| - if (LayoutSVGResourceFilter* filter = getLayoutSVGResourceById<LayoutSVGResourceFilter>(object.document(), svgStyle.filterResource())) { |
| - writeIndent(ts, indent); |
| - ts << " "; |
| - writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); |
| - ts << " "; |
| - writeStandardPrefix(ts, *filter, 0); |
| - ts << " " << filter->resourceBoundingBox(&layoutObject) << "\n"; |
| + if (style.hasFilter()) { |
| + const FilterOperations& filterOperations = style.filter(); |
| + if (filterOperations.size() == 1) { |
| + const FilterOperation& filterOperation = *filterOperations.at(0); |
| + if (filterOperation.type() == FilterOperation::REFERENCE) { |
| + const auto& referenceFilterOperation = toReferenceFilterOperation(filterOperation); |
| + AtomicString id = SVGURIReference::fragmentIdentifierFromIRIString(referenceFilterOperation.url(), object.document()); |
| + if (LayoutSVGResourceFilter* filter = getLayoutSVGResourceById<LayoutSVGResourceFilter>(object.document(), id)) { |
| + writeIndent(ts, indent); |
| + ts << " "; |
| + writeNameAndQuotedValue(ts, "filter", id); |
| + ts << " "; |
| + writeStandardPrefix(ts, *filter, 0); |
| + ts << " " << filter->resourceBoundingBox(&layoutObject) << "\n"; |
| + } |
| + } |
| } |
| } |
| } |