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

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

Issue 669153002: Relocate markForLayoutAndParentResourceInvalidation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Drop boundsChanged. Created 6 years, 2 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,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 */ 19 */
20 20
21 #include "config.h" 21 #include "config.h"
22 #include "core/svg/SVGForeignObjectElement.h" 22 #include "core/svg/SVGForeignObjectElement.h"
23 23
24 #include "core/XLinkNames.h" 24 #include "core/XLinkNames.h"
25 #include "core/frame/UseCounter.h" 25 #include "core/frame/UseCounter.h"
26 #include "core/rendering/svg/RenderSVGForeignObject.h" 26 #include "core/rendering/svg/RenderSVGForeignObject.h"
27 #include "core/rendering/svg/RenderSVGResource.h"
28 #include "core/svg/SVGLength.h" 27 #include "core/svg/SVGLength.h"
29 #include "wtf/Assertions.h" 28 #include "wtf/Assertions.h"
30 29
31 namespace blink { 30 namespace blink {
32 31
33 inline SVGForeignObjectElement::SVGForeignObjectElement(Document& document) 32 inline SVGForeignObjectElement::SVGForeignObjectElement(Document& document)
34 : SVGGraphicsElement(SVGNames::foreignObjectTag, document) 33 : SVGGraphicsElement(SVGNames::foreignObjectTag, document)
35 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len gthModeWidth), AllowNegativeLengths)) 34 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len gthModeWidth), AllowNegativeLengths))
36 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len gthModeHeight), AllowNegativeLengths)) 35 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len gthModeHeight), AllowNegativeLengths))
37 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr eate(LengthModeWidth), ForbidNegativeLengths)) 36 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr eate(LengthModeWidth), ForbidNegativeLengths))
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::SVGContainerSizeChange)); 99 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::SVGContainerSizeChange));
101 } 100 }
102 101
103 SVGElement::InvalidationGuard invalidationGuard(this); 102 SVGElement::InvalidationGuard invalidationGuard(this);
104 103
105 bool isLengthAttribute = attrName == SVGNames::xAttr 104 bool isLengthAttribute = attrName == SVGNames::xAttr
106 || attrName == SVGNames::yAttr 105 || attrName == SVGNames::yAttr
107 || attrName == SVGNames::widthAttr 106 || attrName == SVGNames::widthAttr
108 || attrName == SVGNames::heightAttr; 107 || attrName == SVGNames::heightAttr;
109 108
110 if (isLengthAttribute) 109 if (isLengthAttribute) {
111 updateRelativeLengthsInformation(); 110 updateRelativeLengthsInformation();
112 111 if (RenderObject* renderer = this->renderer())
113 if (RenderObject* renderer = this->renderer()) 112 markForLayoutAndParentResourceInvalidation(renderer);
114 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); 113 }
115 } 114 }
116 115
117 RenderObject* SVGForeignObjectElement::createRenderer(RenderStyle*) 116 RenderObject* SVGForeignObjectElement::createRenderer(RenderStyle*)
118 { 117 {
119 return new RenderSVGForeignObject(this); 118 return new RenderSVGForeignObject(this);
120 } 119 }
121 120
122 bool SVGForeignObjectElement::rendererIsNeeded(const RenderStyle& style) 121 bool SVGForeignObjectElement::rendererIsNeeded(const RenderStyle& style)
123 { 122 {
124 // Suppress foreignObject renderers in SVG hidden containers. 123 // Suppress foreignObject renderers in SVG hidden containers.
(...skipping 14 matching lines...) Expand all
139 138
140 bool SVGForeignObjectElement::selfHasRelativeLengths() const 139 bool SVGForeignObjectElement::selfHasRelativeLengths() const
141 { 140 {
142 return m_x->currentValue()->isRelative() 141 return m_x->currentValue()->isRelative()
143 || m_y->currentValue()->isRelative() 142 || m_y->currentValue()->isRelative()
144 || m_width->currentValue()->isRelative() 143 || m_width->currentValue()->isRelative()
145 || m_height->currentValue()->isRelative(); 144 || m_height->currentValue()->isRelative();
146 } 145 }
147 146
148 } // namespace blink 147 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp ('k') | Source/core/svg/SVGGraphicsElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698