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

Side by Side Diff: Source/core/svg/SVGForeignObjectElement.cpp

Issue 977113003: Rename renderer() to layoutObject(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 bool isWidthHeightAttribute = attrName == SVGNames::widthAttr 115 bool isWidthHeightAttribute = attrName == SVGNames::widthAttr
116 || attrName == SVGNames::heightAttr; 116 || attrName == SVGNames::heightAttr;
117 bool isXYAttribute = attrName == SVGNames::xAttr || attrName == SVGNames::yA ttr; 117 bool isXYAttribute = attrName == SVGNames::xAttr || attrName == SVGNames::yA ttr;
118 118
119 if (isXYAttribute || isWidthHeightAttribute) { 119 if (isXYAttribute || isWidthHeightAttribute) {
120 invalidateSVGPresentationAttributeStyle(); 120 invalidateSVGPresentationAttributeStyle();
121 setNeedsStyleRecalc(LocalStyleChange, 121 setNeedsStyleRecalc(LocalStyleChange,
122 isWidthHeightAttribute ? StyleChangeReasonForTracing::create(StyleCh angeReason::SVGContainerSizeChange) : StyleChangeReasonForTracing::fromAttribute (attrName)); 122 isWidthHeightAttribute ? StyleChangeReasonForTracing::create(StyleCh angeReason::SVGContainerSizeChange) : StyleChangeReasonForTracing::fromAttribute (attrName));
123 123
124 updateRelativeLengthsInformation(); 124 updateRelativeLengthsInformation();
125 if (LayoutObject* renderer = this->renderer()) 125 if (LayoutObject* renderer = this->layoutObject())
126 markForLayoutAndParentResourceInvalidation(renderer); 126 markForLayoutAndParentResourceInvalidation(renderer);
127 } 127 }
128 } 128 }
129 129
130 LayoutObject* SVGForeignObjectElement::createLayoutObject(const LayoutStyle&) 130 LayoutObject* SVGForeignObjectElement::createLayoutObject(const LayoutStyle&)
131 { 131 {
132 return new LayoutSVGForeignObject(this); 132 return new LayoutSVGForeignObject(this);
133 } 133 }
134 134
135 bool SVGForeignObjectElement::layoutObjectIsNeeded(const LayoutStyle& style) 135 bool SVGForeignObjectElement::layoutObjectIsNeeded(const LayoutStyle& style)
136 { 136 {
137 // Suppress foreignObject renderers in SVG hidden containers. 137 // Suppress foreignObject renderers in SVG hidden containers.
138 // (https://bugs.webkit.org/show_bug.cgi?id=87297) 138 // (https://bugs.webkit.org/show_bug.cgi?id=87297)
139 // Note that we currently do not support foreignObject instantiation via <us e>, hence it is safe 139 // Note that we currently do not support foreignObject instantiation via <us e>, hence it is safe
140 // to use parentElement() here. If that changes, this method should be updat ed to use 140 // to use parentElement() here. If that changes, this method should be updat ed to use
141 // parentOrShadowHostElement() instead. 141 // parentOrShadowHostElement() instead.
142 Element* ancestor = parentElement(); 142 Element* ancestor = parentElement();
143 while (ancestor && ancestor->isSVGElement()) { 143 while (ancestor && ancestor->isSVGElement()) {
144 if (ancestor->renderer() && ancestor->renderer()->isSVGHiddenContainer() ) 144 if (ancestor->layoutObject() && ancestor->layoutObject()->isSVGHiddenCon tainer())
145 return false; 145 return false;
146 146
147 ancestor = ancestor->parentElement(); 147 ancestor = ancestor->parentElement();
148 } 148 }
149 149
150 return SVGGraphicsElement::layoutObjectIsNeeded(style); 150 return SVGGraphicsElement::layoutObjectIsNeeded(style);
151 } 151 }
152 152
153 bool SVGForeignObjectElement::selfHasRelativeLengths() const 153 bool SVGForeignObjectElement::selfHasRelativeLengths() const
154 { 154 {
155 return m_x->currentValue()->isRelative() 155 return m_x->currentValue()->isRelative()
156 || m_y->currentValue()->isRelative() 156 || m_y->currentValue()->isRelative()
157 || m_width->currentValue()->isRelative() 157 || m_width->currentValue()->isRelative()
158 || m_height->currentValue()->isRelative(); 158 || m_height->currentValue()->isRelative();
159 } 159 }
160 160
161 } // namespace blink 161 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp ('k') | Source/core/svg/SVGGeometryElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698