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

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

Issue 1491023003: Refactor SVGAnimatedLength negative values mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace SVGLengthNegativeValuesMode enum with bool Created 5 years 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
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 13 matching lines...) Expand all
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/layout/svg/LayoutSVGForeignObject.h" 26 #include "core/layout/svg/LayoutSVGForeignObject.h"
27 #include "core/svg/SVGLength.h" 27 #include "core/svg/SVGLength.h"
28 #include "wtf/Assertions.h" 28 #include "wtf/Assertions.h"
29 29
30 namespace blink { 30 namespace blink {
31 31
32 inline SVGForeignObjectElement::SVGForeignObjectElement(Document& document) 32 inline SVGForeignObjectElement::SVGForeignObjectElement(Document& document)
33 : SVGGraphicsElement(SVGNames::foreignObjectTag, document) 33 : SVGGraphicsElement(SVGNames::foreignObjectTag, document)
34 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(SVG LengthMode::Width), AllowNegativeLengths)) 34 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(SVG LengthMode::Width)))
35 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(SVG LengthMode::Height), AllowNegativeLengths)) 35 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(SVG LengthMode::Height)))
36 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr eate(SVGLengthMode::Width), ForbidNegativeLengths)) 36 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr eate(SVGLengthMode::Width)))
37 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength:: create(SVGLengthMode::Height), ForbidNegativeLengths)) 37 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength:: create(SVGLengthMode::Height)))
38 { 38 {
39 addToPropertyMap(m_x); 39 addToPropertyMap(m_x);
40 addToPropertyMap(m_y); 40 addToPropertyMap(m_y);
41 addToPropertyMap(m_width); 41 addToPropertyMap(m_width);
42 addToPropertyMap(m_height); 42 addToPropertyMap(m_height);
43 43
44 UseCounter::count(document, UseCounter::SVGForeignObjectElement); 44 UseCounter::count(document, UseCounter::SVGForeignObjectElement);
45 } 45 }
46 46
47 DEFINE_TRACE(SVGForeignObjectElement) 47 DEFINE_TRACE(SVGForeignObjectElement)
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 bool SVGForeignObjectElement::selfHasRelativeLengths() const 135 bool SVGForeignObjectElement::selfHasRelativeLengths() const
136 { 136 {
137 return m_x->currentValue()->isRelative() 137 return m_x->currentValue()->isRelative()
138 || m_y->currentValue()->isRelative() 138 || m_y->currentValue()->isRelative()
139 || m_width->currentValue()->isRelative() 139 || m_width->currentValue()->isRelative()
140 || m_height->currentValue()->isRelative(); 140 || m_height->currentValue()->isRelative();
141 } 141 }
142 142
143 } // namespace blink 143 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698