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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 void LayoutSVGForeignObject::computeLogicalHeight( | 87 void LayoutSVGForeignObject::computeLogicalHeight( |
88 LayoutUnit, | 88 LayoutUnit, |
89 LayoutUnit logicalTop, | 89 LayoutUnit logicalTop, |
90 LogicalExtentComputedValues& computedValues) const { | 90 LogicalExtentComputedValues& computedValues) const { |
91 computedValues.m_extent = | 91 computedValues.m_extent = |
92 styleRef().isHorizontalWritingMode() ? elementHeight() : elementWidth(); | 92 styleRef().isHorizontalWritingMode() ? elementHeight() : elementWidth(); |
93 computedValues.m_position = logicalTop; | 93 computedValues.m_position = logicalTop; |
94 } | 94 } |
95 | 95 |
96 void LayoutSVGForeignObject::layout() { | 96 void LayoutSVGForeignObject::layout() { |
97 ASSERT(needsLayout()); | 97 DCHECK(needsLayout()); |
98 | 98 |
99 SVGForeignObjectElement* foreign = toSVGForeignObjectElement(node()); | 99 SVGForeignObjectElement* foreign = toSVGForeignObjectElement(node()); |
100 | 100 |
101 bool updateCachedBoundariesInParents = false; | 101 bool updateCachedBoundariesInParents = false; |
102 if (m_needsTransformUpdate) { | 102 if (m_needsTransformUpdate) { |
103 m_localTransform = | 103 m_localTransform = |
104 foreign->calculateTransform(SVGElement::IncludeMotionTransform); | 104 foreign->calculateTransform(SVGElement::IncludeMotionTransform); |
105 m_needsTransformUpdate = false; | 105 m_needsTransformUpdate = false; |
106 updateCachedBoundariesInParents = true; | 106 updateCachedBoundariesInParents = true; |
107 } | 107 } |
108 | 108 |
109 LayoutRect oldViewport = frameRect(); | 109 LayoutRect oldViewport = frameRect(); |
110 | 110 |
111 // Set box origin to the foreignObject x/y translation, so positioned objects | 111 // Set box origin to the foreignObject x/y translation, so positioned objects |
112 // in XHTML content get correct positions. A regular LayoutBoxModelObject | 112 // in XHTML content get correct positions. A regular LayoutBoxModelObject |
113 // would pull this information from ComputedStyle - in SVG those properties | 113 // would pull this information from ComputedStyle - in SVG those properties |
114 // are ignored for non <svg> elements, so we mimic what happens when | 114 // are ignored for non <svg> elements, so we mimic what happens when |
115 // specifying them through CSS. | 115 // specifying them through CSS. |
116 setX(elementX()); | 116 setX(elementX()); |
117 setY(elementY()); | 117 setY(elementY()); |
118 | 118 |
119 bool layoutChanged = everHadLayout() && selfNeedsLayout(); | 119 bool layoutChanged = everHadLayout() && selfNeedsLayout(); |
120 LayoutBlock::layout(); | 120 LayoutBlock::layout(); |
121 ASSERT(!needsLayout()); | 121 DCHECK(!needsLayout()); |
122 | 122 |
123 // If our bounds changed, notify the parents. | 123 // If our bounds changed, notify the parents. |
124 if (!updateCachedBoundariesInParents) | 124 if (!updateCachedBoundariesInParents) |
125 updateCachedBoundariesInParents = oldViewport != frameRect(); | 125 updateCachedBoundariesInParents = oldViewport != frameRect(); |
126 if (updateCachedBoundariesInParents) | 126 if (updateCachedBoundariesInParents) |
127 LayoutSVGBlock::setNeedsBoundariesUpdate(); | 127 LayoutSVGBlock::setNeedsBoundariesUpdate(); |
128 | 128 |
129 // Invalidate all resources of this client if our layout changed. | 129 // Invalidate all resources of this client if our layout changed. |
130 if (layoutChanged) | 130 if (layoutChanged) |
131 SVGResourcesCache::clientLayoutChanged(this); | 131 SVGResourcesCache::clientLayoutChanged(this); |
(...skipping 21 matching lines...) Expand all Loading... |
153 HitTestLocation hitTestLocation(localPoint); | 153 HitTestLocation hitTestLocation(localPoint); |
154 return LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), | 154 return LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), |
155 HitTestForeground) || | 155 HitTestForeground) || |
156 LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), | 156 LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), |
157 HitTestFloat) || | 157 HitTestFloat) || |
158 LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), | 158 LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), |
159 HitTestChildBlockBackgrounds); | 159 HitTestChildBlockBackgrounds); |
160 } | 160 } |
161 | 161 |
162 } // namespace blink | 162 } // namespace blink |
OLD | NEW |