Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: Source/core/layout/svg/LayoutSVGForeignObject.cpp

Issue 963733002: [svg2] Make 'width' and 'height' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline some EX tests [Mac Win] Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.cpp ('k') | Source/core/layout/svg/LayoutSVGImage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 if (m_needsTransformUpdate) { 86 if (m_needsTransformUpdate) {
87 m_localTransform = foreign->calculateAnimatedLocalTransform(); 87 m_localTransform = foreign->calculateAnimatedLocalTransform();
88 m_needsTransformUpdate = false; 88 m_needsTransformUpdate = false;
89 updateCachedBoundariesInParents = true; 89 updateCachedBoundariesInParents = true;
90 } 90 }
91 91
92 FloatRect oldViewport = m_viewport; 92 FloatRect oldViewport = m_viewport;
93 93
94 // Cache viewport boundaries 94 // Cache viewport boundaries
95 SVGLengthContext lengthContext(foreign); 95 SVGLengthContext lengthContext(foreign);
96 FloatPoint viewportLocation(foreign->x()->currentValue()->value(lengthContex t), foreign->y()->currentValue()->value(lengthContext)); 96 FloatPoint viewportLocation(
97 m_viewport = FloatRect(viewportLocation, FloatSize(foreign->width()->current Value()->value(lengthContext), foreign->height()->currentValue()->value(lengthCo ntext))); 97 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), SVGL engthMode::Width),
98 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), SVGL engthMode::Height));
99 m_viewport = FloatRect(viewportLocation, FloatSize(
100 lengthContext.valueForLength(styleRef().width(), styleRef(), SVGLengthMo de::Width),
101 lengthContext.valueForLength(styleRef().height(), styleRef(), SVGLengthM ode::Height)));
98 if (!updateCachedBoundariesInParents) 102 if (!updateCachedBoundariesInParents)
99 updateCachedBoundariesInParents = oldViewport != m_viewport; 103 updateCachedBoundariesInParents = oldViewport != m_viewport;
100 104
101 // Set box origin to the foreignObject x/y translation, so positioned object s in XHTML content get correct 105 // Set box origin to the foreignObject x/y translation, so positioned object s in XHTML content get correct
102 // positions. A regular LayoutBoxModelObject would pull this information fro m LayoutStyle - in SVG those 106 // positions. A regular LayoutBoxModelObject would pull this information fro m LayoutStyle - in SVG those
103 // properties are ignored for non <svg> elements, so we mimic what happens w hen specifying them through CSS. 107 // properties are ignored for non <svg> elements, so we mimic what happens w hen specifying them through CSS.
104 108
105 // FIXME: Investigate in location rounding issues - only affects LayoutSVGFo reignObject & LayoutSVGText 109 // FIXME: Investigate in location rounding issues - only affects LayoutSVGFo reignObject & LayoutSVGText
106 setLocation(roundedIntPoint(viewportLocation)); 110 setLocation(roundedIntPoint(viewportLocation));
107 111
(...skipping 27 matching lines...) Expand all
135 return false; 139 return false;
136 140
137 // FOs establish a stacking context, so we need to hit-test all layers. 141 // FOs establish a stacking context, so we need to hit-test all layers.
138 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint)); 142 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint));
139 return LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestForeground) 143 return LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestForeground)
140 || LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestFloat) 144 || LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestFloat)
141 || LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestChildBlockBackgrounds); 145 || LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestChildBlockBackgrounds);
142 } 146 }
143 147
144 } 148 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.cpp ('k') | Source/core/layout/svg/LayoutSVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698