Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp

Issue 2065593002: Unprefix the CSS 'filter' property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
3 * (C) 2005 Rob Buis <buis@kde.org> 3 * (C) 2005 Rob Buis <buis@kde.org>
4 * (C) 2006 Alexander Kellett <lypanov@kde.org> 4 * (C) 2006 Alexander Kellett <lypanov@kde.org>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 28 matching lines...) Expand all
39 #include "core/layout/svg/LayoutSVGResourceMarker.h" 39 #include "core/layout/svg/LayoutSVGResourceMarker.h"
40 #include "core/layout/svg/LayoutSVGResourceMasker.h" 40 #include "core/layout/svg/LayoutSVGResourceMasker.h"
41 #include "core/layout/svg/LayoutSVGResourcePattern.h" 41 #include "core/layout/svg/LayoutSVGResourcePattern.h"
42 #include "core/layout/svg/LayoutSVGResourceRadialGradient.h" 42 #include "core/layout/svg/LayoutSVGResourceRadialGradient.h"
43 #include "core/layout/svg/LayoutSVGRoot.h" 43 #include "core/layout/svg/LayoutSVGRoot.h"
44 #include "core/layout/svg/LayoutSVGShape.h" 44 #include "core/layout/svg/LayoutSVGShape.h"
45 #include "core/layout/svg/LayoutSVGText.h" 45 #include "core/layout/svg/LayoutSVGText.h"
46 #include "core/layout/svg/SVGLayoutSupport.h" 46 #include "core/layout/svg/SVGLayoutSupport.h"
47 #include "core/layout/svg/line/SVGInlineTextBox.h" 47 #include "core/layout/svg/line/SVGInlineTextBox.h"
48 #include "core/layout/svg/line/SVGRootInlineBox.h" 48 #include "core/layout/svg/line/SVGRootInlineBox.h"
49 #include "core/paint/PaintLayer.h"
49 #include "core/svg/LinearGradientAttributes.h" 50 #include "core/svg/LinearGradientAttributes.h"
50 #include "core/svg/PatternAttributes.h" 51 #include "core/svg/PatternAttributes.h"
51 #include "core/svg/RadialGradientAttributes.h" 52 #include "core/svg/RadialGradientAttributes.h"
52 #include "core/svg/SVGCircleElement.h" 53 #include "core/svg/SVGCircleElement.h"
53 #include "core/svg/SVGEllipseElement.h" 54 #include "core/svg/SVGEllipseElement.h"
54 #include "core/svg/SVGLineElement.h" 55 #include "core/svg/SVGLineElement.h"
55 #include "core/svg/SVGLinearGradientElement.h" 56 #include "core/svg/SVGLinearGradientElement.h"
56 #include "core/svg/SVGPathElement.h" 57 #include "core/svg/SVGPathElement.h"
57 #include "core/svg/SVGPatternElement.h" 58 #include "core/svg/SVGPatternElement.h"
58 #include "core/svg/SVGPointList.h" 59 #include "core/svg/SVGPointList.h"
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 return; 577 return;
577 writeStandardPrefix(ts, container, indent); 578 writeStandardPrefix(ts, container, indent);
578 writePositionAndStyle(ts, container); 579 writePositionAndStyle(ts, container);
579 ts << "\n"; 580 ts << "\n";
580 writeResources(ts, container, indent); 581 writeResources(ts, container, indent);
581 writeChildren(ts, container, indent); 582 writeChildren(ts, container, indent);
582 } 583 }
583 584
584 void write(TextStream& ts, const LayoutSVGRoot& root, int indent) 585 void write(TextStream& ts, const LayoutSVGRoot& root, int indent)
585 { 586 {
587 if (!root.hasFilterInducingProperty()) {
588 writeStandardPrefix(ts, root, indent);
589 ts << root << "\n";
590 writeChildren(ts, root, indent);
591 return;
592 }
593
594 // An svg root element with a filter + reflect style can cause
595 // a compositing state query assert while dumping the tree, so
596 // 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.
597
598 DisableCompositingQueryAsserts disabler;
586 writeStandardPrefix(ts, root, indent); 599 writeStandardPrefix(ts, root, indent);
587 ts << root << "\n"; 600 ts << root << "\n";
588 writeChildren(ts, root, indent); 601 writeChildren(ts, root, indent);
589 } 602 }
590 603
591 void writeSVGText(TextStream& ts, const LayoutSVGText& text, int indent) 604 void writeSVGText(TextStream& ts, const LayoutSVGText& text, int indent)
592 { 605 {
593 writeStandardPrefix(ts, text, indent); 606 writeStandardPrefix(ts, text, indent);
594 writeLayoutSVGTextBox(ts, text); 607 writeLayoutSVGTextBox(ts, text);
595 ts << "\n"; 608 ts << "\n";
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 if (!svgStyle.clipperResource().isEmpty()) { 665 if (!svgStyle.clipperResource().isEmpty()) {
653 if (LayoutSVGResourceClipper* clipper = getLayoutSVGResourceById<LayoutS VGResourceClipper>(object.document(), svgStyle.clipperResource())) { 666 if (LayoutSVGResourceClipper* clipper = getLayoutSVGResourceById<LayoutS VGResourceClipper>(object.document(), svgStyle.clipperResource())) {
654 writeIndent(ts, indent); 667 writeIndent(ts, indent);
655 ts << " "; 668 ts << " ";
656 writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource()); 669 writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource());
657 ts << " "; 670 ts << " ";
658 writeStandardPrefix(ts, *clipper, 0); 671 writeStandardPrefix(ts, *clipper, 0);
659 ts << " " << clipper->resourceBoundingBox(&layoutObject) << "\n"; 672 ts << " " << clipper->resourceBoundingBox(&layoutObject) << "\n";
660 } 673 }
661 } 674 }
662 if (!svgStyle.filterResource().isEmpty()) { 675 if (style.hasFilter()) {
663 if (LayoutSVGResourceFilter* filter = getLayoutSVGResourceById<LayoutSVG ResourceFilter>(object.document(), svgStyle.filterResource())) { 676 const FilterOperations& filterOperations = style.filter();
664 writeIndent(ts, indent); 677 if (filterOperations.size() == 1) {
665 ts << " "; 678 const FilterOperation& filterOperation = *filterOperations.at(0);
666 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); 679 if (filterOperation.type() == FilterOperation::REFERENCE) {
667 ts << " "; 680 const auto& referenceFilterOperation = toReferenceFilterOperatio n(filterOperation);
668 writeStandardPrefix(ts, *filter, 0); 681 AtomicString id = SVGURIReference::fragmentIdentifierFromIRIStri ng(referenceFilterOperation.url(), object.document());
669 ts << " " << filter->resourceBoundingBox(&layoutObject) << "\n"; 682 if (LayoutSVGResourceFilter* filter = getLayoutSVGResourceById<L ayoutSVGResourceFilter>(object.document(), id)) {
683 writeIndent(ts, indent);
684 ts << " ";
685 writeNameAndQuotedValue(ts, "filter", id);
686 ts << " ";
687 writeStandardPrefix(ts, *filter, 0);
688 ts << " " << filter->resourceBoundingBox(&layoutObject) << " \n";
689 }
690 }
670 } 691 }
671 } 692 }
672 } 693 }
673 694
674 } // namespace blink 695 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698