Changeset 241947 in webkit
- Timestamp:
- Feb 22, 2019 8:31:17 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r241945 r241947 1 2019-02-22 Rob Buis <rbuis@igalia.com> 2 3 Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp 4 https://bugs.webkit.org/show_bug.cgi?id=160172 5 6 Reviewed by Frédéric Wang. 7 8 Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces 9 from HTTPParsers instead. 10 11 No new tests, already covered by MathML tests. 12 13 * mathml/MathMLElement.cpp: 14 (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted. 15 * mathml/MathMLElement.h: 16 * mathml/MathMLPresentationElement.cpp: 17 (WebCore::MathMLPresentationElement::parseMathMLLength): 18 * mathml/MathMLTokenElement.cpp: 19 (WebCore::MathMLTokenElement::convertToSingleCodePoint): 20 1 21 2019-02-22 Eric Carlson <eric.carlson@apple.com> 2 22 -
trunk/Source/WebCore/mathml/MathMLElement.cpp
r241942 r241947 220 220 } 221 221 222 StringView MathMLElement::stripLeadingAndTrailingWhitespace(const StringView& stringView)223 {224 unsigned start = 0, stringLength = stringView.length();225 while (stringLength > 0 && isHTMLSpace(stringView[start])) {226 start++;227 stringLength--;228 }229 while (stringLength > 0 && isHTMLSpace(stringView[start + stringLength - 1]))230 stringLength--;231 return stringView.substring(start, stringLength);232 }233 234 222 } 235 223 -
trunk/Source/WebCore/mathml/MathMLElement.h
r239427 r241947 94 94 MathMLElement(const QualifiedName& tagName, Document&); 95 95 96 static StringView stripLeadingAndTrailingWhitespace(const StringView&);97 98 96 void parseAttribute(const QualifiedName&, const AtomicString&) override; 99 97 bool childShouldCreateRenderer(const Node&) const override; -
trunk/Source/WebCore/mathml/MathMLPresentationElement.cpp
r239427 r241947 36 36 #include "HTMLNames.h" 37 37 #include "HTMLParserIdioms.h" 38 #include "HTTPParsers.h" 38 39 #include "MathMLMathElement.h" 39 40 #include "MathMLNames.h" … … 295 296 296 297 // We first skip whitespace from both ends of the string. 297 StringView stringView = stripLeadingAndTrailingWhitespace(string); 298 299 if (stringView.isEmpty()) 298 StringView stringView = string; 299 StringView strippedLength = stripLeadingAndTrailingHTTPSpaces(stringView); 300 301 if (strippedLength.isEmpty()) 300 302 return Length(); 301 303 302 304 // We consider the most typical case: a number followed by an optional unit. 303 UChar firstChar = stri ngView[0];305 UChar firstChar = strippedLength[0]; 304 306 if (isASCIIDigit(firstChar) || firstChar == '-' || firstChar == '.') 305 return parseNumberAndUnit(stri ngView);307 return parseNumberAndUnit(strippedLength); 306 308 307 309 // Otherwise, we try and parse a named space. 308 return parseNamedSpace(stri ngView);310 return parseNamedSpace(strippedLength); 309 311 } 310 312 -
trunk/Source/WebCore/mathml/MathMLTokenElement.cpp
r239427 r241947 31 31 #if ENABLE(MATHML) 32 32 33 #include "HTTPParsers.h" 33 34 #include "MathMLNames.h" 34 35 #include "RenderMathMLToken.h" … … 83 84 Optional<UChar32> MathMLTokenElement::convertToSingleCodePoint(StringView string) 84 85 { 85 auto codePoints = stripLeadingAndTrailing Whitespace(string).codePoints();86 auto codePoints = stripLeadingAndTrailingHTTPSpaces(string).codePoints(); 86 87 auto iterator = codePoints.begin(); 87 88 if (iterator == codePoints.end())
Note: See TracChangeset
for help on using the changeset viewer.