OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007, 2008, 2009 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. | 5 * Copyright (C) 2009 Google, Inc. |
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 bool RenderSVGRoot::isEmbeddedThroughSVGImage() const | 112 bool RenderSVGRoot::isEmbeddedThroughSVGImage() const |
113 { | 113 { |
114 return SVGImage::isInSVGImage(toSVGSVGElement(node())); | 114 return SVGImage::isInSVGImage(toSVGSVGElement(node())); |
115 } | 115 } |
116 | 116 |
117 bool RenderSVGRoot::isEmbeddedThroughFrameContainingSVGDocument() const | 117 bool RenderSVGRoot::isEmbeddedThroughFrameContainingSVGDocument() const |
118 { | 118 { |
119 if (!node()) | 119 if (!node()) |
120 return false; | 120 return false; |
121 | 121 |
122 Frame* frame = node()->document()->frame(); | 122 Frame* frame = node()->document().frame(); |
123 if (!frame) | 123 if (!frame) |
124 return false; | 124 return false; |
125 | 125 |
126 // If our frame has an owner renderer, we're embedded through eg. object/emb
ed/iframe, | 126 // If our frame has an owner renderer, we're embedded through eg. object/emb
ed/iframe, |
127 // but we only negotiate if we're in an SVG document. | 127 // but we only negotiate if we're in an SVG document. |
128 if (!frame->ownerRenderer()) | 128 if (!frame->ownerRenderer()) |
129 return false; | 129 return false; |
130 return frame->document()->isSVGDocument(); | 130 return frame->document()->isSVGDocument(); |
131 } | 131 } |
132 | 132 |
(...skipping 12 matching lines...) Expand all Loading... |
145 return m_containerSize.width(); | 145 return m_containerSize.width(); |
146 | 146 |
147 if (style()->logicalWidth().isSpecified() || style()->logicalMaxWidth().isSp
ecified()) | 147 if (style()->logicalWidth().isSpecified() || style()->logicalMaxWidth().isSp
ecified()) |
148 return RenderReplaced::computeReplacedLogicalWidth(shouldComputePreferre
d); | 148 return RenderReplaced::computeReplacedLogicalWidth(shouldComputePreferre
d); |
149 | 149 |
150 if (svg->widthAttributeEstablishesViewport()) | 150 if (svg->widthAttributeEstablishesViewport()) |
151 return resolveLengthAttributeForSVG(svg->intrinsicWidth(SVGSVGElement::I
gnoreCSSProperties), style()->effectiveZoom(), containingBlock()->availableLogic
alWidth(), view()); | 151 return resolveLengthAttributeForSVG(svg->intrinsicWidth(SVGSVGElement::I
gnoreCSSProperties), style()->effectiveZoom(), containingBlock()->availableLogic
alWidth(), view()); |
152 | 152 |
153 // SVG embedded through object/embed/iframe. | 153 // SVG embedded through object/embed/iframe. |
154 if (isEmbeddedThroughFrameContainingSVGDocument()) | 154 if (isEmbeddedThroughFrameContainingSVGDocument()) |
155 return document()->frame()->ownerRenderer()->availableLogicalWidth(); | 155 return document().frame()->ownerRenderer()->availableLogicalWidth(); |
156 | 156 |
157 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SV
G. | 157 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SV
G. |
158 return RenderReplaced::computeReplacedLogicalWidth(shouldComputePreferred); | 158 return RenderReplaced::computeReplacedLogicalWidth(shouldComputePreferred); |
159 } | 159 } |
160 | 160 |
161 LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight() const | 161 LayoutUnit RenderSVGRoot::computeReplacedLogicalHeight() const |
162 { | 162 { |
163 SVGSVGElement* svg = toSVGSVGElement(node()); | 163 SVGSVGElement* svg = toSVGSVGElement(node()); |
164 ASSERT(svg); | 164 ASSERT(svg); |
165 | 165 |
(...skipping 14 matching lines...) Expand all Loading... |
180 cb->addPercentHeightDescendant(const_cast<RenderSVGRoot*>(this))
; | 180 cb->addPercentHeightDescendant(const_cast<RenderSVGRoot*>(this))
; |
181 } | 181 } |
182 } else | 182 } else |
183 RenderBlock::removePercentHeightDescendant(const_cast<RenderSVGRoot*
>(this)); | 183 RenderBlock::removePercentHeightDescendant(const_cast<RenderSVGRoot*
>(this)); |
184 | 184 |
185 return resolveLengthAttributeForSVG(height, style()->effectiveZoom(), co
ntainingBlock()->availableLogicalHeight(IncludeMarginBorderPadding), view()); | 185 return resolveLengthAttributeForSVG(height, style()->effectiveZoom(), co
ntainingBlock()->availableLogicalHeight(IncludeMarginBorderPadding), view()); |
186 } | 186 } |
187 | 187 |
188 // SVG embedded through object/embed/iframe. | 188 // SVG embedded through object/embed/iframe. |
189 if (isEmbeddedThroughFrameContainingSVGDocument()) | 189 if (isEmbeddedThroughFrameContainingSVGDocument()) |
190 return document()->frame()->ownerRenderer()->availableLogicalHeight(Incl
udeMarginBorderPadding); | 190 return document().frame()->ownerRenderer()->availableLogicalHeight(Inclu
deMarginBorderPadding); |
191 | 191 |
192 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SV
G. | 192 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SV
G. |
193 return RenderReplaced::computeReplacedLogicalHeight(); | 193 return RenderReplaced::computeReplacedLogicalHeight(); |
194 } | 194 } |
195 | 195 |
196 void RenderSVGRoot::layout() | 196 void RenderSVGRoot::layout() |
197 { | 197 { |
198 ASSERT(needsLayout()); | 198 ASSERT(needsLayout()); |
199 | 199 |
200 m_resourcesNeedingToInvalidateClients.clear(); | 200 m_resourcesNeedingToInvalidateClients.clear(); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 { | 479 { |
480 RenderObject* svgRoot = resource->parent(); | 480 RenderObject* svgRoot = resource->parent(); |
481 while (svgRoot && !svgRoot->isSVGRoot()) | 481 while (svgRoot && !svgRoot->isSVGRoot()) |
482 svgRoot = svgRoot->parent(); | 482 svgRoot = svgRoot->parent(); |
483 if (!svgRoot) | 483 if (!svgRoot) |
484 return; | 484 return; |
485 toRenderSVGRoot(svgRoot)->m_resourcesNeedingToInvalidateClients.add(resource
); | 485 toRenderSVGRoot(svgRoot)->m_resourcesNeedingToInvalidateClients.add(resource
); |
486 } | 486 } |
487 | 487 |
488 } | 488 } |
OLD | NEW |