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

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

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 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 : DescendantIsolationNeedsUpdate); 92 : DescendantIsolationNeedsUpdate);
93 } 93 }
94 94
95 LayoutBlock::styleDidChange(diff, oldStyle); 95 LayoutBlock::styleDidChange(diff, oldStyle);
96 SVGResourcesCache::clientStyleChanged(this, diff, styleRef()); 96 SVGResourcesCache::clientStyleChanged(this, diff, styleRef());
97 } 97 }
98 98
99 void LayoutSVGBlock::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, 99 void LayoutSVGBlock::mapLocalToAncestor(const LayoutBoxModelObject* ancestor,
100 TransformState& transformState, 100 TransformState& transformState,
101 MapCoordinatesFlags flags) const { 101 MapCoordinatesFlags flags) const {
102 // Convert from local HTML coordinates to local SVG coordinates.
103 transformState.move(locationOffset());
104 // Apply other mappings on local SVG coordinates.
105 SVGLayoutSupport::mapLocalToAncestor(this, ancestor, transformState, flags); 102 SVGLayoutSupport::mapLocalToAncestor(this, ancestor, transformState, flags);
106 } 103 }
107 104
108 void LayoutSVGBlock::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, 105 void LayoutSVGBlock::mapAncestorToLocal(const LayoutBoxModelObject* ancestor,
109 TransformState& transformState, 106 TransformState& transformState,
110 MapCoordinatesFlags flags) const { 107 MapCoordinatesFlags flags) const {
111 if (this == ancestor) 108 if (this == ancestor)
112 return; 109 return;
113 110
114 // Map to local SVG coordinates.
115 SVGLayoutSupport::mapAncestorToLocal(*this, ancestor, transformState, flags); 111 SVGLayoutSupport::mapAncestorToLocal(*this, ancestor, transformState, flags);
116 // Convert from local SVG coordinates to local HTML coordinates.
117 transformState.move(-locationOffset());
118 } 112 }
119 113
120 const LayoutObject* LayoutSVGBlock::pushMappingToContainer( 114 const LayoutObject* LayoutSVGBlock::pushMappingToContainer(
121 const LayoutBoxModelObject* ancestorToStopAt, 115 const LayoutBoxModelObject* ancestorToStopAt,
122 LayoutGeometryMap& geometryMap) const { 116 LayoutGeometryMap& geometryMap) const {
123 // Convert from local HTML coordinates to local SVG coordinates.
124 geometryMap.push(this, locationOffset());
125 // Apply other mappings on local SVG coordinates.
126 return SVGLayoutSupport::pushMappingToContainer(this, ancestorToStopAt, 117 return SVGLayoutSupport::pushMappingToContainer(this, ancestorToStopAt,
127 geometryMap); 118 geometryMap);
128 } 119 }
129 120
130 LayoutRect LayoutSVGBlock::absoluteVisualRect() const { 121 LayoutRect LayoutSVGBlock::absoluteVisualRect() const {
131 return SVGLayoutSupport::visualRectInAncestorSpace(*this, *view()); 122 return SVGLayoutSupport::visualRectInAncestorSpace(*this, *view());
132 } 123 }
133 124
134 bool LayoutSVGBlock::mapToVisualRectInAncestorSpaceInternal( 125 bool LayoutSVGBlock::mapToVisualRectInAncestorSpaceInternal(
135 const LayoutBoxModelObject* ancestor, 126 const LayoutBoxModelObject* ancestor,
136 TransformState& transformState, 127 TransformState& transformState,
137 VisualRectFlags) const { 128 VisualRectFlags) const {
138 transformState.flatten(); 129 transformState.flatten();
139 LayoutRect rect(transformState.lastPlanarQuad().boundingBox()); 130 LayoutRect rect(transformState.lastPlanarQuad().boundingBox());
140 // Convert from local HTML coordinates to local SVG coordinates.
141 rect.moveBy(location());
142 // Apply other mappings on local SVG coordinates.
143 bool retval = SVGLayoutSupport::mapToVisualRectInAncestorSpace( 131 bool retval = SVGLayoutSupport::mapToVisualRectInAncestorSpace(
144 *this, ancestor, FloatRect(rect), rect); 132 *this, ancestor, FloatRect(rect), rect);
145 transformState.setQuad(FloatQuad(FloatRect(rect))); 133 transformState.setQuad(FloatQuad(FloatRect(rect)));
146 return retval; 134 return retval;
147 } 135 }
148 136
149 bool LayoutSVGBlock::nodeAtPoint(HitTestResult&, 137 bool LayoutSVGBlock::nodeAtPoint(HitTestResult&,
150 const HitTestLocation&, 138 const HitTestLocation&,
151 const LayoutPoint&, 139 const LayoutPoint&,
152 HitTestAction) { 140 HitTestAction) {
153 ASSERT_NOT_REACHED(); 141 ASSERT_NOT_REACHED();
154 return false; 142 return false;
155 } 143 }
156 144
157 } // namespace blink 145 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698