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 } | 87 } |
88 | 88 |
89 FloatRect oldViewport = m_viewport; | 89 FloatRect oldViewport = m_viewport; |
90 | 90 |
91 // Cache viewport boundaries | 91 // Cache viewport boundaries |
92 SVGLengthContext lengthContext(foreign); | 92 SVGLengthContext lengthContext(foreign); |
93 FloatPoint viewportLocation( | 93 FloatPoint viewportLocation( |
94 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), SVGL engthMode::Width), | 94 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), SVGL engthMode::Width), |
95 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), SVGL engthMode::Height)); | 95 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), SVGL engthMode::Height)); |
96 m_viewport = FloatRect(viewportLocation, FloatSize( | 96 m_viewport = FloatRect(viewportLocation, FloatSize( |
97 lengthContext.valueForLength(styleRef().width(), styleRef(), SVGLengthMo de::Width), | 97 styleRef().width().isAuto() ? foreign->width()->currentValue()->value(le ngthContext) : lengthContext.valueForLength(styleRef().width(), styleRef(), SVGL engthMode::Width), |
fs
2016/08/10 18:01:34
I guess 'auto' here would mean some form of shrink
Shanmuga Pandi
2016/08/11 05:54:20
Acknowledged.
| |
98 lengthContext.valueForLength(styleRef().height(), styleRef(), SVGLengthM ode::Height))); | 98 styleRef().height().isAuto() ? foreign->height()->currentValue()->value( lengthContext) : lengthContext.valueForLength(styleRef().height(), styleRef(), S VGLengthMode::Height))); |
99 if (!updateCachedBoundariesInParents) | 99 if (!updateCachedBoundariesInParents) |
100 updateCachedBoundariesInParents = oldViewport != m_viewport; | 100 updateCachedBoundariesInParents = oldViewport != m_viewport; |
101 | 101 |
102 // Set box origin to the foreignObject x/y translation, so positioned object s in XHTML content get correct | 102 // Set box origin to the foreignObject x/y translation, so positioned object s in XHTML content get correct |
103 // positions. A regular LayoutBoxModelObject would pull this information fro m ComputedStyle - in SVG those | 103 // positions. A regular LayoutBoxModelObject would pull this information fro m ComputedStyle - in SVG those |
104 // properties are ignored for non <svg> elements, so we mimic what happens w hen specifying them through CSS. | 104 // properties are ignored for non <svg> elements, so we mimic what happens w hen specifying them through CSS. |
105 | 105 |
106 // FIXME: Investigate in location rounding issues - only affects LayoutSVGFo reignObject & LayoutSVGText | 106 // FIXME: Investigate in location rounding issues - only affects LayoutSVGFo reignObject & LayoutSVGText |
107 setLocation(roundedIntPoint(viewportLocation)); | 107 setLocation(roundedIntPoint(viewportLocation)); |
108 | 108 |
(...skipping 27 matching lines...) Expand all Loading... | |
136 return false; | 136 return false; |
137 | 137 |
138 // FOs establish a stacking context, so we need to hit-test all layers. | 138 // FOs establish a stacking context, so we need to hit-test all layers. |
139 HitTestLocation hitTestLocation(localPoint); | 139 HitTestLocation hitTestLocation(localPoint); |
140 return LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), HitT estForeground) | 140 return LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), HitT estForeground) |
141 || LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), HitT estFloat) | 141 || LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), HitT estFloat) |
142 || LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), HitT estChildBlockBackgrounds); | 142 || LayoutBlock::nodeAtPoint(result, hitTestLocation, LayoutPoint(), HitT estChildBlockBackgrounds); |
143 } | 143 } |
144 | 144 |
145 } // namespace blink | 145 } // namespace blink |
OLD | NEW |