WebKit Bugzilla
Attachment 348501 Details for
Bug 189154
: The width of an empty or nullptr TextRun should be zero
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189154-20180830090211.patch (text/plain), 3.63 KB, created by
Brent Fulgham
on 2018-08-30 09:02:11 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Brent Fulgham
Created:
2018-08-30 09:02:11 PDT
Size:
3.63 KB
patch
obsolete
>Subversion Revision: 235371 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index c2f1efa19fa58446b80d6244bdbd95aed91baca5..d8654b575f860120050dfd179ffbf4a53ea26128 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,22 @@ >+2018-08-30 Brent Fulgham <bfulgham@apple.com> >+ >+ Add nullptr check to String::is8Bit() >+ https://bugs.webkit.org/show_bug.cgi?id=189154 >+ <rdar://problem/43685926> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Most accessors in WTFString.cpp, such as isAllASCII(), hash(), etc., perform a nullptr check >+ before using m_impl, but is8Bit() does not. >+ >+ This patch adds a check in the is8Bit() implementation to be consistent with other methods, >+ and to address a small number of crashes observed in testing. >+ >+ Test: fast/text/null-string-textrun.html >+ >+ * wtf/text/WTFString.h: >+ (WTF::String::is8Bit const): >+ > 2018-08-25 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > Shrink size of XMLHttpRequest >diff --git a/Source/WTF/wtf/text/WTFString.h b/Source/WTF/wtf/text/WTFString.h >index b08be530af463f149aaa837e6fc0f72011beb344..fb18428a5eb3873278ef507808fa90b8e6904945 100644 >--- a/Source/WTF/wtf/text/WTFString.h >+++ b/Source/WTF/wtf/text/WTFString.h >@@ -154,7 +154,7 @@ public: > // Return characters8() or characters16() depending on CharacterType. > template<typename CharacterType> const CharacterType* characters() const; > >- bool is8Bit() const { return m_impl->is8Bit(); } >+ bool is8Bit() const { return !m_impl || m_impl->is8Bit(); } > > unsigned sizeInBytes() const { return m_impl ? m_impl->length() * (is8Bit() ? sizeof(LChar) : sizeof(UChar)) : 0; } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index cd12c8d77fabcb9d392c865c33ce6e3cac11d54c..451732e6ee6acfd8c74bc50743c8242c0d4d6628 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-08-30 Brent Fulgham <bfulgham@apple.com> >+ >+ Add nullptr check to String::is8Bit() >+ https://bugs.webkit.org/show_bug.cgi?id=189154 >+ <rdar://problem/43685926> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/text/null-string-textrun-expected.txt: Added. >+ * fast/text/null-string-textrun.html: Added. >+ > 2018-08-27 Per Arne Vollan <pvollan@apple.com> > > Layout Test fast/events/dblclick-event-getModifierState.html is failing >diff --git a/LayoutTests/fast/text/null-string-textrun-expected.txt b/LayoutTests/fast/text/null-string-textrun-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..99d8c8928ee37dbaadfa148b3dc7f111181b3bc4 >--- /dev/null >+++ b/LayoutTests/fast/text/null-string-textrun-expected.txt >@@ -0,0 +1,6 @@ >+This test confirms that a null text run doesn't trigger a crash. It passes if it loads without crashing. >+ >+ >+ >+ >+ >diff --git a/LayoutTests/fast/text/null-string-textrun.html b/LayoutTests/fast/text/null-string-textrun.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b145900dbfe85b5b77aff7171c8cb7cac79f1c41 >--- /dev/null >+++ b/LayoutTests/fast/text/null-string-textrun.html >@@ -0,0 +1,19 @@ >+<!doctype html> >+<head> >+<script> >+if (window.testRunner) >+ testRunner.dumpAsText(); >+</script> >+<head> >+<body> >+ <p>This test confirms that a null text run doesn't trigger a crash. It passes if it loads without crashing.</p> >+ <pre id="pre_tag" dir="RTL" > >+ <style onload="pre_tag.appendChild(meter_tag)"/></style> >+ <select multiple="multiple"> >+ <optgroup/> >+ </select> >+ </pre> >+ <label> >+ <meter id="meter_tag"> >+ </label> >+</body> >\ No newline at end of file
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 189154
:
348501
|
348509
|
348518
|
348655
|
348743
|
348825
|
348925