WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
WIP
bug-151598-20180306190646.patch (text/plain), 7.02 KB, created by
Yusuke Suzuki
on 2018-03-06 02:06:47 PST
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-03-06 02:06:47 PST
Size:
7.02 KB
patch
obsolete
>Subversion Revision: 229310 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 60c9650415b4fb9798fad7e0b5f752036f7a1c5a..77ca9707ef3ba2a6c90e7630d4fba2b0aacd56f0 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,17 @@ >+2018-03-06 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ HTML `pattern` attribute should set `u` flag for regular expressions >+ https://bugs.webkit.org/show_bug.cgi?id=151598 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * yarr/RegularExpression.cpp: >+ (JSC::Yarr::RegularExpression::Private::create): >+ (JSC::Yarr::RegularExpression::Private::Private): >+ (JSC::Yarr::RegularExpression::Private::compile): >+ (JSC::Yarr::RegularExpression::RegularExpression): >+ * yarr/RegularExpression.h: >+ > 2018-03-05 Yusuke Suzuki <utatane.tea@gmail.com> > > Fix std::make_unique / new[] using system malloc >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fd3e080cd23c28c440f0f558d47541e01cfc3083..6a8e20c490c3c3554c800464151e42037278aa7e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,15 @@ >+2018-03-06 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ HTML `pattern` attribute should set `u` flag for regular expressions >+ https://bugs.webkit.org/show_bug.cgi?id=151598 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * html/BaseTextInputType.cpp: >+ (WebCore::BaseTextInputType::patternMismatch const): >+ > 2018-03-06 Nan Wang <n_wang@apple.com> > > AX: AOM: More accessibility events support >diff --git a/Source/JavaScriptCore/yarr/RegularExpression.cpp b/Source/JavaScriptCore/yarr/RegularExpression.cpp >index c2c0470a94b1962bf48f4d695e170e9c41a967a4..d42a0b094238c8d203da13ed34397bce9f3927ec 100644 >--- a/Source/JavaScriptCore/yarr/RegularExpression.cpp >+++ b/Source/JavaScriptCore/yarr/RegularExpression.cpp >@@ -37,9 +37,9 @@ namespace JSC { namespace Yarr { > > class RegularExpression::Private : public RefCounted<RegularExpression::Private> { > public: >- static Ref<Private> create(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode) >+ static Ref<Private> create(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode, UnicodeCodePointMode unicodeCodePointMode) > { >- return adoptRef(*new Private(pattern, caseSensitivity, multilineMode)); >+ return adoptRef(*new Private(pattern, caseSensitivity, multilineMode, unicodeCodePointMode)); > } > > int lastMatchLength { -1 }; >@@ -48,12 +48,12 @@ class RegularExpression::Private : public RefCounted<RegularExpression::Private> > std::unique_ptr<JSC::Yarr::BytecodePattern> m_regExpByteCode; > > private: >- Private(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode) >- : m_regExpByteCode(compile(pattern, caseSensitivity, multilineMode)) >+ Private(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode, UnicodeCodePointMode unicodeCodePointMode) >+ : m_regExpByteCode(compile(pattern, caseSensitivity, multilineMode, unicodeCodePointMode)) > { > } > >- std::unique_ptr<JSC::Yarr::BytecodePattern> compile(const String& patternString, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode) >+ std::unique_ptr<JSC::Yarr::BytecodePattern> compile(const String& patternString, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode, UnicodeCodePointMode unicodeCodePointMode) > { > RegExpFlags flags = NoFlags; > >@@ -63,6 +63,9 @@ class RegularExpression::Private : public RefCounted<RegularExpression::Private> > if (multilineMode == MultilineEnabled) > flags = static_cast<RegExpFlags>(flags | FlagMultiline); > >+ if (unicodeCodePointMode == UnicodeCodePointAware) >+ flags = static_cast<RegExpFlags>(flags | FlagUnicode); >+ > JSC::Yarr::YarrPattern pattern(patternString, flags, m_constructionErrorCode); > if (JSC::Yarr::hasError(m_constructionErrorCode)) { > LOG_ERROR("RegularExpression: YARR compile failed with '%s'", JSC::Yarr::errorMessage(m_constructionErrorCode)); >@@ -78,8 +81,8 @@ class RegularExpression::Private : public RefCounted<RegularExpression::Private> > JSC::Yarr::ErrorCode m_constructionErrorCode { Yarr::ErrorCode::NoError }; > }; > >-RegularExpression::RegularExpression(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode) >- : d(Private::create(pattern, caseSensitivity, multilineMode)) >+RegularExpression::RegularExpression(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode, UnicodeCodePointMode unicodeCodePointMode) >+ : d(Private::create(pattern, caseSensitivity, multilineMode, unicodeCodePointMode)) > { > } > >diff --git a/Source/JavaScriptCore/yarr/RegularExpression.h b/Source/JavaScriptCore/yarr/RegularExpression.h >index 207390b5e9e71aa66a82ea451631b1ec4485cb0c..f285a056a8d28574f26f1c718d3216a86b0c1c91 100644 >--- a/Source/JavaScriptCore/yarr/RegularExpression.h >+++ b/Source/JavaScriptCore/yarr/RegularExpression.h >@@ -31,11 +31,12 @@ namespace JSC { namespace Yarr { > > enum MultilineMode { MultilineDisabled, MultilineEnabled }; > enum TextCaseSensitivity { TextCaseSensitive, TextCaseInsensitive }; >+enum UnicodeCodePointMode { UnicodeCodePointUnaware, UnicodeCodePointAware } > > class JS_EXPORT_PRIVATE RegularExpression { > WTF_MAKE_FAST_ALLOCATED; > public: >- explicit RegularExpression(const String&, TextCaseSensitivity = TextCaseSensitive, MultilineMode = MultilineDisabled); >+ explicit RegularExpression(const String&, TextCaseSensitivity = TextCaseSensitive, MultilineMode = MultilineDisabled, UnicodeCodePointMode = UnicodeCodePointUnaware); > ~RegularExpression(); > > RegularExpression(const RegularExpression&); >diff --git a/Source/WebCore/html/BaseTextInputType.cpp b/Source/WebCore/html/BaseTextInputType.cpp >index ff6d63a05f7b4bcfe0bba24195024162ac50ac6f..f085ac1011fef5a7847c2e2dc8e729f8eae430af 100644 >--- a/Source/WebCore/html/BaseTextInputType.cpp >+++ b/Source/WebCore/html/BaseTextInputType.cpp >@@ -40,12 +40,12 @@ bool BaseTextInputType::isTextType() const > bool BaseTextInputType::patternMismatch(const String& value) const > { > const AtomicString& rawPattern = element().attributeWithoutSynchronization(patternAttr); >- if (rawPattern.isNull() || value.isEmpty() || !JSC::Yarr::RegularExpression(rawPattern).isValid()) >+ if (rawPattern.isNull() || value.isEmpty() || !JSC::Yarr::RegularExpression(rawPattern, TextCaseSensitive, MultilineDisabled, UnicodeCodePointAware).isValid()) > return false; > String pattern = "^(?:" + rawPattern + ")$"; > int matchLength = 0; > int valueLength = value.length(); >- int matchOffset = JSC::Yarr::RegularExpression(pattern).match(value, 0, &matchLength); >+ int matchOffset = JSC::Yarr::RegularExpression(pattern, TextCaseSensitive, MultilineDisabled, UnicodeCodePointAware).match(value, 0, &matchLength); > return matchOffset || matchLength != valueLength; > } >
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 151598
:
335077
|
335078
|
335086
|
335092
|
335190