OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * Copyright (C) 2009 Google, Inc. | 3 * Copyright (C) 2009 Google, Inc. |
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // FIXME: Investigate in size rounding issues | 108 // FIXME: Investigate in size rounding issues |
109 // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/
63656 | 109 // FIXME: Remove unnecessary rounding when layout is off ints: webkit.org/b/
63656 |
110 // FIXME: Is this correct for vertical writing mode? | 110 // FIXME: Is this correct for vertical writing mode? |
111 computedValues.m_extent = static_cast<int>(roundf(m_viewport.height())); | 111 computedValues.m_extent = static_cast<int>(roundf(m_viewport.height())); |
112 computedValues.m_position = logicalTop; | 112 computedValues.m_position = logicalTop; |
113 } | 113 } |
114 | 114 |
115 void RenderSVGForeignObject::layout() | 115 void RenderSVGForeignObject::layout() |
116 { | 116 { |
117 ASSERT(needsLayout()); | 117 ASSERT(needsLayout()); |
| 118 ASSERT(!view()->layoutStateCachedOffsetsEnabled()); // RenderSVGRoot disable
s layoutState for the SVG rendering tree. |
118 | 119 |
119 SVGForeignObjectElement* foreign = toSVGForeignObjectElement(node()); | 120 SVGForeignObjectElement* foreign = toSVGForeignObjectElement(node()); |
120 | 121 |
121 bool updateCachedBoundariesInParents = false; | 122 bool updateCachedBoundariesInParents = false; |
122 if (m_needsTransformUpdate) { | 123 if (m_needsTransformUpdate) { |
123 m_localTransform = foreign->animatedLocalTransform(); | 124 m_localTransform = foreign->animatedLocalTransform(); |
124 m_needsTransformUpdate = false; | 125 m_needsTransformUpdate = false; |
125 updateCachedBoundariesInParents = true; | 126 updateCachedBoundariesInParents = true; |
126 } | 127 } |
127 | 128 |
(...skipping 20 matching lines...) Expand all Loading... |
148 // If our bounds changed, notify the parents. | 149 // If our bounds changed, notify the parents. |
149 if (updateCachedBoundariesInParents) | 150 if (updateCachedBoundariesInParents) |
150 RenderSVGBlock::setNeedsBoundariesUpdate(); | 151 RenderSVGBlock::setNeedsBoundariesUpdate(); |
151 | 152 |
152 // Invalidate all resources of this client if our layout changed. | 153 // Invalidate all resources of this client if our layout changed. |
153 if (layoutChanged) | 154 if (layoutChanged) |
154 SVGResourcesCache::clientLayoutChanged(this); | 155 SVGResourcesCache::clientLayoutChanged(this); |
155 } | 156 } |
156 | 157 |
157 void RenderSVGForeignObject::mapRectToPaintInvalidationBacking(const RenderLayer
ModelObject* paintInvalidationContainer, | 158 void RenderSVGForeignObject::mapRectToPaintInvalidationBacking(const RenderLayer
ModelObject* paintInvalidationContainer, |
158 LayoutRect& rect, bool fixed, const PaintInvalidationState* paintInvalidatio
nState) const | 159 LayoutRect& rect, bool fixed) const |
159 { | 160 { |
160 FloatRect r(rect); | 161 FloatRect r(rect); |
161 SVGRenderSupport::computeFloatRectForRepaint(this, paintInvalidationContaine
r, r, fixed, paintInvalidationState); | 162 SVGRenderSupport::computeFloatRectForRepaint(this, paintInvalidationContaine
r, r, fixed); |
162 rect = enclosingLayoutRect(r); | 163 rect = enclosingLayoutRect(r); |
163 } | 164 } |
164 | 165 |
165 bool RenderSVGForeignObject::nodeAtFloatPoint(const HitTestRequest& request, Hit
TestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction
) | 166 bool RenderSVGForeignObject::nodeAtFloatPoint(const HitTestRequest& request, Hit
TestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction
) |
166 { | 167 { |
167 // Embedded content is drawn in the foreground phase. | 168 // Embedded content is drawn in the foreground phase. |
168 if (hitTestAction != HitTestForeground) | 169 if (hitTestAction != HitTestForeground) |
169 return false; | 170 return false; |
170 | 171 |
171 FloatPoint localPoint = localTransform().inverse().mapPoint(pointInParent); | 172 FloatPoint localPoint = localTransform().inverse().mapPoint(pointInParent); |
172 | 173 |
173 // Early exit if local point is not contained in clipped viewport area | 174 // Early exit if local point is not contained in clipped viewport area |
174 if (SVGRenderSupport::isOverflowHidden(this) && !m_viewport.contains(localPo
int)) | 175 if (SVGRenderSupport::isOverflowHidden(this) && !m_viewport.contains(localPo
int)) |
175 return false; | 176 return false; |
176 | 177 |
177 // FOs establish a stacking context, so we need to hit-test all layers. | 178 // FOs establish a stacking context, so we need to hit-test all layers. |
178 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint)); | 179 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint)); |
179 return RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestForeground) | 180 return RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestForeground) |
180 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestFloat) | 181 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestFloat) |
181 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestChildBlockBackgrounds); | 182 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestChildBlockBackgrounds); |
182 } | 183 } |
183 | 184 |
184 } | 185 } |
OLD | NEW |