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. | |
119 | 118 |
120 SVGForeignObjectElement* foreign = toSVGForeignObjectElement(node()); | 119 SVGForeignObjectElement* foreign = toSVGForeignObjectElement(node()); |
121 | 120 |
122 bool updateCachedBoundariesInParents = false; | 121 bool updateCachedBoundariesInParents = false; |
123 if (m_needsTransformUpdate) { | 122 if (m_needsTransformUpdate) { |
124 m_localTransform = foreign->animatedLocalTransform(); | 123 m_localTransform = foreign->animatedLocalTransform(); |
125 m_needsTransformUpdate = false; | 124 m_needsTransformUpdate = false; |
126 updateCachedBoundariesInParents = true; | 125 updateCachedBoundariesInParents = true; |
127 } | 126 } |
128 | 127 |
(...skipping 20 matching lines...) Expand all Loading... |
149 // If our bounds changed, notify the parents. | 148 // If our bounds changed, notify the parents. |
150 if (updateCachedBoundariesInParents) | 149 if (updateCachedBoundariesInParents) |
151 RenderSVGBlock::setNeedsBoundariesUpdate(); | 150 RenderSVGBlock::setNeedsBoundariesUpdate(); |
152 | 151 |
153 // Invalidate all resources of this client if our layout changed. | 152 // Invalidate all resources of this client if our layout changed. |
154 if (layoutChanged) | 153 if (layoutChanged) |
155 SVGResourcesCache::clientLayoutChanged(this); | 154 SVGResourcesCache::clientLayoutChanged(this); |
156 } | 155 } |
157 | 156 |
158 void RenderSVGForeignObject::mapRectToPaintInvalidationBacking(const RenderLayer
ModelObject* paintInvalidationContainer, | 157 void RenderSVGForeignObject::mapRectToPaintInvalidationBacking(const RenderLayer
ModelObject* paintInvalidationContainer, |
159 LayoutRect& rect, bool fixed) const | 158 LayoutRect& rect, bool fixed, const PaintInvalidationState* paintInvalidatio
nState) const |
160 { | 159 { |
161 FloatRect r(rect); | 160 FloatRect r(rect); |
162 SVGRenderSupport::computeFloatRectForRepaint(this, paintInvalidationContaine
r, r, fixed); | 161 SVGRenderSupport::computeFloatRectForRepaint(this, paintInvalidationContaine
r, r, fixed, paintInvalidationState); |
163 rect = enclosingLayoutRect(r); | 162 rect = enclosingLayoutRect(r); |
164 } | 163 } |
165 | 164 |
166 bool RenderSVGForeignObject::nodeAtFloatPoint(const HitTestRequest& request, Hit
TestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction
) | 165 bool RenderSVGForeignObject::nodeAtFloatPoint(const HitTestRequest& request, Hit
TestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction
) |
167 { | 166 { |
168 // Embedded content is drawn in the foreground phase. | 167 // Embedded content is drawn in the foreground phase. |
169 if (hitTestAction != HitTestForeground) | 168 if (hitTestAction != HitTestForeground) |
170 return false; | 169 return false; |
171 | 170 |
172 FloatPoint localPoint = localTransform().inverse().mapPoint(pointInParent); | 171 FloatPoint localPoint = localTransform().inverse().mapPoint(pointInParent); |
173 | 172 |
174 // Early exit if local point is not contained in clipped viewport area | 173 // Early exit if local point is not contained in clipped viewport area |
175 if (SVGRenderSupport::isOverflowHidden(this) && !m_viewport.contains(localPo
int)) | 174 if (SVGRenderSupport::isOverflowHidden(this) && !m_viewport.contains(localPo
int)) |
176 return false; | 175 return false; |
177 | 176 |
178 // FOs establish a stacking context, so we need to hit-test all layers. | 177 // FOs establish a stacking context, so we need to hit-test all layers. |
179 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint)); | 178 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint)); |
180 return RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestForeground) | 179 return RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestForeground) |
181 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestFloat) | 180 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestFloat) |
182 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestChildBlockBackgrounds); | 181 || RenderBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin
t(), HitTestChildBlockBackgrounds); |
183 } | 182 } |
184 | 183 |
185 } | 184 } |
OLD | NEW |