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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 LayoutUnit LayoutSVGRoot::computeReplacedLogicalWidth(ShouldComputePreferred sho
uldComputePreferred) const | 116 LayoutUnit LayoutSVGRoot::computeReplacedLogicalWidth(ShouldComputePreferred sho
uldComputePreferred) const |
117 { | 117 { |
118 // When we're embedded through SVGImage (border-image/background-image/<html
:img>/...) we're forced to resize to a specific size. | 118 // When we're embedded through SVGImage (border-image/background-image/<html
:img>/...) we're forced to resize to a specific size. |
119 if (!m_containerSize.isEmpty()) | 119 if (!m_containerSize.isEmpty()) |
120 return m_containerSize.width(); | 120 return m_containerSize.width(); |
121 | 121 |
122 if (isEmbeddedThroughFrameContainingSVGDocument()) | 122 if (isEmbeddedThroughFrameContainingSVGDocument()) |
123 return containingBlock()->availableLogicalWidth(); | 123 return containingBlock()->availableLogicalWidth(); |
124 | 124 |
125 if (style()->logicalWidth().isSpecified() || style()->logicalMaxWidth().isSp
ecified()) | |
126 return LayoutReplaced::computeReplacedLogicalWidth(shouldComputePreferre
d); | |
127 | |
128 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SV
G. | |
129 return LayoutReplaced::computeReplacedLogicalWidth(shouldComputePreferred); | 125 return LayoutReplaced::computeReplacedLogicalWidth(shouldComputePreferred); |
130 } | 126 } |
131 | 127 |
132 LayoutUnit LayoutSVGRoot::computeReplacedLogicalHeight() const | 128 LayoutUnit LayoutSVGRoot::computeReplacedLogicalHeight() const |
133 { | 129 { |
134 // When we're embedded through SVGImage (border-image/background-image/<html
:img>/...) we're forced to resize to a specific size. | 130 // When we're embedded through SVGImage (border-image/background-image/<html
:img>/...) we're forced to resize to a specific size. |
135 if (!m_containerSize.isEmpty()) | 131 if (!m_containerSize.isEmpty()) |
136 return m_containerSize.height(); | 132 return m_containerSize.height(); |
137 | 133 |
138 if (isEmbeddedThroughFrameContainingSVGDocument()) | 134 if (isEmbeddedThroughFrameContainingSVGDocument()) |
139 return containingBlock()->availableLogicalHeight(IncludeMarginBorderPadd
ing); | 135 return containingBlock()->availableLogicalHeight(IncludeMarginBorderPadd
ing); |
140 | 136 |
141 if (style()->logicalHeight().isSpecified() || style()->logicalMaxHeight().is
Specified()) | |
142 return LayoutReplaced::computeReplacedLogicalHeight(); | |
143 | |
144 // SVG embedded via SVGImage (background-image/border-image/etc) / Inline SV
G. | |
145 return LayoutReplaced::computeReplacedLogicalHeight(); | 137 return LayoutReplaced::computeReplacedLogicalHeight(); |
146 } | 138 } |
147 | 139 |
148 void LayoutSVGRoot::layout() | 140 void LayoutSVGRoot::layout() |
149 { | 141 { |
150 ASSERT(needsLayout()); | 142 ASSERT(needsLayout()); |
151 LayoutAnalyzer::Scope analyzer(*this); | 143 LayoutAnalyzer::Scope analyzer(*this); |
152 | 144 |
153 bool needsLayout = selfNeedsLayout(); | 145 bool needsLayout = selfNeedsLayout(); |
154 | 146 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 updateHitTestResult(result, pointInBorderBox); | 401 updateHitTestResult(result, pointInBorderBox); |
410 if (!result.addNodeToListBasedTestResult(node(), locationInContainer
, boundsRect)) | 402 if (!result.addNodeToListBasedTestResult(node(), locationInContainer
, boundsRect)) |
411 return true; | 403 return true; |
412 } | 404 } |
413 } | 405 } |
414 | 406 |
415 return false; | 407 return false; |
416 } | 408 } |
417 | 409 |
418 } | 410 } |
OLD | NEW |