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

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

Issue 1548933002: Don't give 'pathLength' semantic errors special treatment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop feConvolveMatrix[order] change. Created 4 years, 11 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 | « third_party/WebKit/LayoutTests/svg/dom/svgpath-negative-pathLength-expected.txt ('k') | no next file » | 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) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@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 "core/svg/SVGPathElement.h" 21 #include "core/svg/SVGPathElement.h"
22 22
23 #include "core/layout/svg/LayoutSVGPath.h" 23 #include "core/layout/svg/LayoutSVGPath.h"
24 #include "core/svg/SVGDocumentExtensions.h"
25 #include "core/svg/SVGMPathElement.h" 24 #include "core/svg/SVGMPathElement.h"
26 #include "core/svg/SVGPathQuery.h" 25 #include "core/svg/SVGPathQuery.h"
27 #include "core/svg/SVGPathUtilities.h" 26 #include "core/svg/SVGPathUtilities.h"
28 #include "core/svg/SVGPointTearOff.h" 27 #include "core/svg/SVGPointTearOff.h"
29 28
30 namespace blink { 29 namespace blink {
31 30
32 class SVGAnimatedPathLength final : public SVGAnimatedNumber { 31 class SVGAnimatedPathLength final : public SVGAnimatedNumber {
33 public: 32 public:
34 static PassRefPtrWillBeRawPtr<SVGAnimatedPathLength> create(SVGPathElement* contextElement) 33 static PassRefPtrWillBeRawPtr<SVGAnimatedPathLength> create(SVGPathElement* contextElement)
35 { 34 {
36 return adoptRefWillBeNoop(new SVGAnimatedPathLength(contextElement)); 35 return adoptRefWillBeNoop(new SVGAnimatedPathLength(contextElement));
37 } 36 }
38 37
39 SVGParsingError setBaseValueAsString(const String& value) override 38 SVGParsingError setBaseValueAsString(const String& value) override
40 { 39 {
41 SVGParsingError parseStatus = SVGAnimatedNumber::setBaseValueAsString(va lue); 40 SVGParsingError parseStatus = SVGAnimatedNumber::setBaseValueAsString(va lue);
42
43 ASSERT(contextElement());
44 if (parseStatus == NoError && baseValue()->value() < 0) 41 if (parseStatus == NoError && baseValue()->value() < 0)
45 contextElement()->document().accessSVGExtensions().reportError("A ne gative value for path attribute <pathLength> is not allowed"); 42 parseStatus = NegativeValueForbiddenError;
46 return parseStatus; 43 return parseStatus;
47 } 44 }
48 45
49 private: 46 private:
50 explicit SVGAnimatedPathLength(SVGPathElement* contextElement) 47 explicit SVGAnimatedPathLength(SVGPathElement* contextElement)
51 : SVGAnimatedNumber(contextElement, SVGNames::pathLengthAttr, SVGNumber: :create()) 48 : SVGAnimatedNumber(contextElement, SVGNames::pathLengthAttr, SVGNumber: :create())
52 { 49 {
53 } 50 }
54 }; 51 };
55 52
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 return InsertionDone; 177 return InsertionDone;
181 } 178 }
182 179
183 void SVGPathElement::removedFrom(ContainerNode* rootParent) 180 void SVGPathElement::removedFrom(ContainerNode* rootParent)
184 { 181 {
185 SVGGeometryElement::removedFrom(rootParent); 182 SVGGeometryElement::removedFrom(rootParent);
186 invalidateMPathDependencies(); 183 invalidateMPathDependencies();
187 } 184 }
188 185
189 } // namespace blink 186 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/dom/svgpath-negative-pathLength-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698