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

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

Issue 2748103015: Replace ASSERT with DCHECK in core/layout/<sub dirs> (Closed)
Patch Set: Rebase with latest Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 20 matching lines...) Expand all
31 : m_positionCalculator(path), m_pathLength(path.length()) {} 31 : m_positionCalculator(path), m_pathLength(path.length()) {}
32 32
33 PathPositionMapper::PositionType PathPositionMapper::pointAndNormalAtLength( 33 PathPositionMapper::PositionType PathPositionMapper::pointAndNormalAtLength(
34 float length, 34 float length,
35 FloatPoint& point, 35 FloatPoint& point,
36 float& angle) { 36 float& angle) {
37 if (length < 0) 37 if (length < 0)
38 return BeforePath; 38 return BeforePath;
39 if (length > m_pathLength) 39 if (length > m_pathLength)
40 return AfterPath; 40 return AfterPath;
41 ASSERT(length >= 0 && length <= m_pathLength); 41 DCHECK_GE(length, 0);
42 DCHECK_LE(length, m_pathLength);
42 m_positionCalculator.pointAndNormalAtLength(length, point, angle); 43 m_positionCalculator.pointAndNormalAtLength(length, point, angle);
43 return OnPath; 44 return OnPath;
44 } 45 }
45 46
46 LayoutSVGTextPath::LayoutSVGTextPath(Element* element) 47 LayoutSVGTextPath::LayoutSVGTextPath(Element* element)
47 : LayoutSVGInline(element) {} 48 : LayoutSVGInline(element) {}
48 49
49 bool LayoutSVGTextPath::isChildAllowed(LayoutObject* child, 50 bool LayoutSVGTextPath::isChildAllowed(LayoutObject* child,
50 const ComputedStyle&) const { 51 const ComputedStyle&) const {
51 if (child->isText()) 52 if (child->isText())
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 *toSVGTextPathElement(node())->startOffset()->currentValue(); 84 *toSVGTextPathElement(node())->startOffset()->currentValue();
84 float textPathStartOffset = startOffset.valueAsPercentage(); 85 float textPathStartOffset = startOffset.valueAsPercentage();
85 if (startOffset.typeWithCalcResolved() == 86 if (startOffset.typeWithCalcResolved() ==
86 CSSPrimitiveValue::UnitType::Percentage) 87 CSSPrimitiveValue::UnitType::Percentage)
87 textPathStartOffset *= pathLength; 88 textPathStartOffset *= pathLength;
88 89
89 return textPathStartOffset; 90 return textPathStartOffset;
90 } 91 }
91 92
92 } // namespace blink 93 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698