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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGBlock.h

Issue 2767343003: Revert: "Let SVGForeignObject's local SVG coordinates mean what it should" (Closed)
Patch Set: Rebaseline test Created 3 years, 9 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) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details. 12 * Library General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU Library General Public License 14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to 15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA. 17 * Boston, MA 02110-1301, USA.
18 */ 18 */
19 19
20 #ifndef LayoutSVGBlock_h 20 #ifndef LayoutSVGBlock_h
21 #define LayoutSVGBlock_h 21 #define LayoutSVGBlock_h
22 22
23 #include "core/layout/LayoutBlockFlow.h" 23 #include "core/layout/LayoutBlockFlow.h"
24 24
25 namespace blink { 25 namespace blink {
26 26
27 class SVGElement; 27 class SVGElement;
28 28
29 // A common class of SVG objects that delegate layout, paint, etc. tasks to
30 // LayoutBlockFlow. It has two coordinate spaces:
31 // - local SVG coordinate space: similar to LayoutSVGModelObject, the space
32 // that localSVGTransform() applies.
33 // - local HTML coordinate space: defined by frameRect() as if the local SVG
34 // coordinate space created a containing block. Like other LayoutBlockFlow
35 // objects, LayoutSVGBlock's frameRect() is also in physical coordinates with
36 // flipped blocks direction in the "containing block".
37 class LayoutSVGBlock : public LayoutBlockFlow { 29 class LayoutSVGBlock : public LayoutBlockFlow {
38 public: 30 public:
39 explicit LayoutSVGBlock(SVGElement*); 31 explicit LayoutSVGBlock(SVGElement*);
40 32
41 // These mapping functions map coordinates in HTML spaces.
42 void mapLocalToAncestor(const LayoutBoxModelObject* ancestor, 33 void mapLocalToAncestor(const LayoutBoxModelObject* ancestor,
43 TransformState&, 34 TransformState&,
44 MapCoordinatesFlags = ApplyContainerFlip) const final; 35 MapCoordinatesFlags = ApplyContainerFlip) const final;
45 void mapAncestorToLocal(const LayoutBoxModelObject* ancestor, 36 void mapAncestorToLocal(const LayoutBoxModelObject* ancestor,
46 TransformState&, 37 TransformState&,
47 MapCoordinatesFlags = ApplyContainerFlip) const final; 38 MapCoordinatesFlags = ApplyContainerFlip) const final;
48 const LayoutObject* pushMappingToContainer( 39 const LayoutObject* pushMappingToContainer(
49 const LayoutBoxModelObject* ancestorToStopAt, 40 const LayoutBoxModelObject* ancestorToStopAt,
50 LayoutGeometryMap&) const final; 41 LayoutGeometryMap&) const final;
51 bool mapToVisualRectInAncestorSpaceInternal(
52 const LayoutBoxModelObject* ancestor,
53 TransformState&,
54 VisualRectFlags = DefaultVisualRectFlags) const final;
55 42
56 AffineTransform localSVGTransform() const final { return m_localTransform; } 43 AffineTransform localSVGTransform() const final { return m_localTransform; }
57 44
58 PaintLayerType layerTypeRequired() const final { return NoPaintLayer; } 45 PaintLayerType layerTypeRequired() const final { return NoPaintLayer; }
59 46
60 protected: 47 protected:
61 void willBeDestroyed() override; 48 void willBeDestroyed() override;
49 bool mapToVisualRectInAncestorSpaceInternal(
50 const LayoutBoxModelObject* ancestor,
51 TransformState&,
52 VisualRectFlags = DefaultVisualRectFlags) const final;
62 53
63 AffineTransform m_localTransform; 54 AffineTransform m_localTransform;
64 55
65 bool isOfType(LayoutObjectType type) const override { 56 bool isOfType(LayoutObjectType type) const override {
66 return type == LayoutObjectSVG || LayoutBlockFlow::isOfType(type); 57 return type == LayoutObjectSVG || LayoutBlockFlow::isOfType(type);
67 } 58 }
68 59
69 private: 60 private:
70 LayoutRect absoluteVisualRect() const final; 61 LayoutRect absoluteVisualRect() const final;
71 62
(...skipping 11 matching lines...) Expand all
83 HitTestAction) override; 74 HitTestAction) override;
84 75
85 // The inherited version doesn't check for SVG effects. 76 // The inherited version doesn't check for SVG effects.
86 bool paintedOutputOfObjectHasNoEffectRegardlessOfSize() const override { 77 bool paintedOutputOfObjectHasNoEffectRegardlessOfSize() const override {
87 return false; 78 return false;
88 } 79 }
89 }; 80 };
90 81
91 } // namespace blink 82 } // namespace blink
92 #endif // LayoutSVGBlock_h 83 #endif // LayoutSVGBlock_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/svg/LayoutSVGBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698