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

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

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle Created 5 years, 8 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 | Annotate | Revision Log
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 24 matching lines...) Expand all
35 LayoutSVGForeignObject::LayoutSVGForeignObject(SVGForeignObjectElement* node) 35 LayoutSVGForeignObject::LayoutSVGForeignObject(SVGForeignObjectElement* node)
36 : LayoutSVGBlock(node) 36 : LayoutSVGBlock(node)
37 , m_needsTransformUpdate(true) 37 , m_needsTransformUpdate(true)
38 { 38 {
39 } 39 }
40 40
41 LayoutSVGForeignObject::~LayoutSVGForeignObject() 41 LayoutSVGForeignObject::~LayoutSVGForeignObject()
42 { 42 {
43 } 43 }
44 44
45 bool LayoutSVGForeignObject::isChildAllowed(LayoutObject* child, const LayoutSty le& style) const 45 bool LayoutSVGForeignObject::isChildAllowed(LayoutObject* child, const ComputedS tyle& style) const
46 { 46 {
47 // Disallow arbitary SVG content. Only allow proper <svg xmlns="svgNS"> subd ocuments. 47 // Disallow arbitary SVG content. Only allow proper <svg xmlns="svgNS"> subd ocuments.
48 return !child->isSVG() || child->isSVGRoot(); 48 return !child->isSVG() || child->isSVGRoot();
49 } 49 }
50 50
51 void LayoutSVGForeignObject::paint(const PaintInfo& paintInfo, const LayoutPoint &) 51 void LayoutSVGForeignObject::paint(const PaintInfo& paintInfo, const LayoutPoint &)
52 { 52 {
53 SVGForeignObjectPainter(*this).paint(paintInfo); 53 SVGForeignObjectPainter(*this).paint(paintInfo);
54 } 54 }
55 55
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 FloatPoint viewportLocation( 96 FloatPoint viewportLocation(
97 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), SVGL engthMode::Width), 97 lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(), SVGL engthMode::Width),
98 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), SVGL engthMode::Height)); 98 lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(), SVGL engthMode::Height));
99 m_viewport = FloatRect(viewportLocation, FloatSize( 99 m_viewport = FloatRect(viewportLocation, FloatSize(
100 lengthContext.valueForLength(styleRef().width(), styleRef(), SVGLengthMo de::Width), 100 lengthContext.valueForLength(styleRef().width(), styleRef(), SVGLengthMo de::Width),
101 lengthContext.valueForLength(styleRef().height(), styleRef(), SVGLengthM ode::Height))); 101 lengthContext.valueForLength(styleRef().height(), styleRef(), SVGLengthM ode::Height)));
102 if (!updateCachedBoundariesInParents) 102 if (!updateCachedBoundariesInParents)
103 updateCachedBoundariesInParents = oldViewport != m_viewport; 103 updateCachedBoundariesInParents = oldViewport != m_viewport;
104 104
105 // 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
106 // 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 ComputedStyle - in SVG those
107 // 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.
108 108
109 // FIXME: Investigate in location rounding issues - only affects LayoutSVGFo reignObject & LayoutSVGText 109 // FIXME: Investigate in location rounding issues - only affects LayoutSVGFo reignObject & LayoutSVGText
110 setLocation(roundedIntPoint(viewportLocation)); 110 setLocation(roundedIntPoint(viewportLocation));
111 111
112 bool layoutChanged = everHadLayout() && selfNeedsLayout(); 112 bool layoutChanged = everHadLayout() && selfNeedsLayout();
113 LayoutBlock::layout(); 113 LayoutBlock::layout();
114 ASSERT(!needsLayout()); 114 ASSERT(!needsLayout());
115 115
116 // If our bounds changed, notify the parents. 116 // If our bounds changed, notify the parents.
(...skipping 22 matching lines...) Expand all
139 return false; 139 return false;
140 140
141 // 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.
142 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint)); 142 HitTestLocation hitTestLocation(roundedLayoutPoint(localPoint));
143 return LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestForeground) 143 return LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestForeground)
144 || LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestFloat) 144 || LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestFloat)
145 || LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestChildBlockBackgrounds); 145 || LayoutBlock::nodeAtPoint(request, result, hitTestLocation, LayoutPoin t(), HitTestChildBlockBackgrounds);
146 } 146 }
147 147
148 } 148 }
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGForeignObject.h ('k') | Source/core/layout/svg/LayoutSVGGradientStop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698