WebKit Bugzilla
Attachment 362719 Details for
Bug 160172
: Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-160172-20190222145041.patch (text/plain), 5.09 KB, created by
Rob Buis
on 2019-02-22 05:50:42 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2019-02-22 05:50:42 PST
Size:
5.09 KB
patch
obsolete
>Subversion Revision: 241939 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 78d8fb8094a829323f75ad6e061a944260ef372c..b474b35314db17505d28e740d248fc8e4f2c0fa7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2019-02-22 Rob Buis <rbuis@igalia.com> >+ >+ Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp >+ https://bugs.webkit.org/show_bug.cgi?id=160172 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces >+ from HTTPParsers instead. >+ >+ No new tests, already covered by MathML tests. >+ >+ * mathml/MathMLElement.cpp: >+ (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted. >+ * mathml/MathMLElement.h: >+ * mathml/MathMLPresentationElement.cpp: >+ (WebCore::MathMLPresentationElement::parseMathMLLength): >+ * mathml/MathMLTokenElement.cpp: >+ (WebCore::MathMLTokenElement::convertToSingleCodePoint): >+ > 2019-02-21 Simon Fraser <simon.fraser@apple.com> > > Hardcode Visual Viewports on everywhere except iOS WK1 >diff --git a/Source/WebCore/mathml/MathMLElement.cpp b/Source/WebCore/mathml/MathMLElement.cpp >index 5ffa23f241e00ad403fec6781d17638103628d7d..6e7aebe381705f887fac611f5ace6f6fd7f9c245 100644 >--- a/Source/WebCore/mathml/MathMLElement.cpp >+++ b/Source/WebCore/mathml/MathMLElement.cpp >@@ -210,18 +210,6 @@ int MathMLElement::tabIndex() const > return Element::tabIndex(); > } > >-StringView MathMLElement::stripLeadingAndTrailingWhitespace(const StringView& stringView) >-{ >- unsigned start = 0, stringLength = stringView.length(); >- while (stringLength > 0 && isHTMLSpace(stringView[start])) { >- start++; >- stringLength--; >- } >- while (stringLength > 0 && isHTMLSpace(stringView[start + stringLength - 1])) >- stringLength--; >- return stringView.substring(start, stringLength); >-} >- > } > > #endif // ENABLE(MATHML) >diff --git a/Source/WebCore/mathml/MathMLElement.h b/Source/WebCore/mathml/MathMLElement.h >index b35f0165c687ad429430c3e7ad60ab7e35e2ed74..0679f029e396aba0850dc687b1a31eab5b918a11 100644 >--- a/Source/WebCore/mathml/MathMLElement.h >+++ b/Source/WebCore/mathml/MathMLElement.h >@@ -93,8 +93,6 @@ public: > protected: > MathMLElement(const QualifiedName& tagName, Document&); > >- static StringView stripLeadingAndTrailingWhitespace(const StringView&); >- > void parseAttribute(const QualifiedName&, const AtomicString&) override; > bool childShouldCreateRenderer(const Node&) const override; > >diff --git a/Source/WebCore/mathml/MathMLPresentationElement.cpp b/Source/WebCore/mathml/MathMLPresentationElement.cpp >index 84b7d2088a3ac1d083c38afaf32b35490354cfb2..7bbbbfb6078decaf3a966bcc8957caee7dad6763 100644 >--- a/Source/WebCore/mathml/MathMLPresentationElement.cpp >+++ b/Source/WebCore/mathml/MathMLPresentationElement.cpp >@@ -35,6 +35,7 @@ > #include "HTMLMapElement.h" > #include "HTMLNames.h" > #include "HTMLParserIdioms.h" >+#include "HTTPParsers.h" > #include "MathMLMathElement.h" > #include "MathMLNames.h" > #include "RenderMathMLBlock.h" >@@ -294,18 +295,19 @@ MathMLElement::Length MathMLPresentationElement::parseMathMLLength(const String& > // Instead, we just use isHTMLSpace and toFloat to parse these parts. > > // We first skip whitespace from both ends of the string. >- StringView stringView = stripLeadingAndTrailingWhitespace(string); >+ StringView stringView = string; >+ StringView strippedLength = stripLeadingAndTrailingHTTPSpaces(stringView); > >- if (stringView.isEmpty()) >+ if (strippedLength.isEmpty()) > return Length(); > > // We consider the most typical case: a number followed by an optional unit. >- UChar firstChar = stringView[0]; >+ UChar firstChar = strippedLength[0]; > if (isASCIIDigit(firstChar) || firstChar == '-' || firstChar == '.') >- return parseNumberAndUnit(stringView); >+ return parseNumberAndUnit(strippedLength); > > // Otherwise, we try and parse a named space. >- return parseNamedSpace(stringView); >+ return parseNamedSpace(strippedLength); > } > > const MathMLElement::Length& MathMLPresentationElement::cachedMathMLLength(const QualifiedName& name, Optional<Length>& length) >diff --git a/Source/WebCore/mathml/MathMLTokenElement.cpp b/Source/WebCore/mathml/MathMLTokenElement.cpp >index 9352393665a814e060220e0f146eecd9b1cb2d73..db8d03735286c38ae7146b916930aeec10ab52fd 100644 >--- a/Source/WebCore/mathml/MathMLTokenElement.cpp >+++ b/Source/WebCore/mathml/MathMLTokenElement.cpp >@@ -30,6 +30,7 @@ > > #if ENABLE(MATHML) > >+#include "HTTPParsers.h" > #include "MathMLNames.h" > #include "RenderMathMLToken.h" > #include <wtf/IsoMallocInlines.h> >@@ -82,7 +83,7 @@ bool MathMLTokenElement::childShouldCreateRenderer(const Node& child) const > > Optional<UChar32> MathMLTokenElement::convertToSingleCodePoint(StringView string) > { >- auto codePoints = stripLeadingAndTrailingWhitespace(string).codePoints(); >+ auto codePoints = stripLeadingAndTrailingHTTPSpaces(string).codePoints(); > auto iterator = codePoints.begin(); > if (iterator == codePoints.end()) > return WTF::nullopt;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 160172
:
284544
|
284586
|
284589
|
284593
|
285527
|
362704
|
362713
|
362714
|
362716
|
362718
| 362719