<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181236] releases/WebKitGTK/webkit-2.8</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181236">181236</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-08 03:11:40 -0700 (Sun, 08 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/181105">r181105</a> - Regression(<a href="http://trac.webkit.org/projects/webkit/changeset/173761">r173761</a>): ASSERTION FAILED: !is8Bit() in StringImpl::characters16()
https://bugs.webkit.org/show_bug.cgi?id=142350

Patch by Chris Dumez &lt;cdumez@apple.com&gt; on 2015-03-05
Reviewed by Michael Saboff and Benjamin Poulain.

Source/JavaScriptCore:

Call WTFString::hasInfixStartingAt() / hasInfixEndingAt() now that these
methods have been renamed for clarity.

* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncStartsWith):
(JSC::stringProtoFuncEndsWith):

Source/WTF:

Fix ASSERTION FAILED: !is8Bit() in StringImpl::characters16() from
WTF::equalInner() after <a href="http://trac.webkit.org/projects/webkit/changeset/173761">r173761</a>. The code was incorrectly assuming that
if stringImpl is 16-bit, then matchString is 16-bit too, which is not
correct.

Also rename WTFString::startsWith() / endsWith() taking an offset to
hasInfixStartingAt() / hasInfixEndingAt() for clarity. It seems odd
to call it startsWith even though it won't technically *start* with
the pattern if the input offset is greater than zero.

Also drop the caseSensitive argument as it is never used (always true
at call sites.

* wtf/text/StringImpl.cpp:
(WTF::equalInner):
(WTF::StringImpl::hasInfixStartingAt):
(WTF::StringImpl::hasInfixEndingAt):
(WTF::StringImpl::startsWith): Deleted.
(WTF::StringImpl::endsWith): Deleted.
* wtf/text/StringImpl.h:
* wtf/text/WTFString.h:
(WTF::String::hasInfixStartingAt):
(WTF::String::hasInfixEndingAt):
(WTF::String::startsWith): Deleted.
(WTF::String::endsWith): Deleted.

Tools:

Add API test for WTFString::hasInfixStartingAt() to make sure it doesn't
crash if the string is 8-bit but the pattern is 16-bit (and vice-versa).

* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::TEST):

LayoutTests:

Update String.startsWith() / endsWith() test to cover cases where the
input string is 8-bit and the pattern is 16-bit, and vice-versa.

* js/script-tests/string-includes.js:
* js/string-includes-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsjsscripttestsstringincludesjs">releases/WebKitGTK/webkit-2.8/LayoutTests/js/script-tests/string-includes.js</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsjsstringincludesexpectedtxt">releases/WebKitGTK/webkit-2.8/LayoutTests/js/string-includes-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceJavaScriptCoreChangeLog">releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceJavaScriptCoreruntimeStringPrototypecpp">releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/StringPrototype.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFChangeLog">releases/WebKitGTK/webkit-2.8/Source/WTF/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFwtftextStringImplcpp">releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/StringImpl.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFwtftextStringImplh">releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/StringImpl.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWTFwtftextWTFStringh">releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/WTFString.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28ToolsChangeLog">releases/WebKitGTK/webkit-2.8/Tools/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28ToolsTestWebKitAPITestsWTFWTFStringcpp">releases/WebKitGTK/webkit-2.8/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit28LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-03-05  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Regression(r173761): ASSERTION FAILED: !is8Bit() in StringImpl::characters16()
+        https://bugs.webkit.org/show_bug.cgi?id=142350
+
+        Reviewed by Michael Saboff and Benjamin Poulain.
+
+        Update String.startsWith() / endsWith() test to cover cases where the
+        input string is 8-bit and the pattern is 16-bit, and vice-versa.
+
+        * js/script-tests/string-includes.js:
+        * js/string-includes-expected.txt:
+
</ins><span class="cx"> 2015-03-06  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Setting any of the &lt;object&gt; element plugin controlling attributes does not have any affect.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestsjsscripttestsstringincludesjs"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/js/script-tests/string-includes.js (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/js/script-tests/string-includes.js        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/js/script-tests/string-includes.js        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -54,6 +54,10 @@
</span><span class="cx"> shouldBe(&quot;'1e100 bar'.startsWith(1e100)&quot;, &quot;false&quot;);
</span><span class="cx"> shouldBe(&quot;'フーバー'.startsWith('フー')&quot;, &quot;true&quot;);
</span><span class="cx"> shouldBe(&quot;'フーバー'.startsWith('バー')&quot;, &quot;false&quot;);
</span><ins>+shouldBe(&quot;'フーバー'.startsWith('abc')&quot;, &quot;false&quot;);
+shouldBe(&quot;'フーバー'.startsWith('abc', 1)&quot;, &quot;false&quot;);
+shouldBe(&quot;'foo bar'.startsWith('フー')&quot;, &quot;false&quot;);
+shouldBe(&quot;'foo bar'.startsWith('フー', 1)&quot;, &quot;false&quot;);
</ins><span class="cx"> 
</span><span class="cx"> // Test endsWith
</span><span class="cx"> shouldBe(&quot;'foo bar'.endsWith('bar')&quot;, &quot;true&quot;);
</span><span class="lines">@@ -82,6 +86,10 @@
</span><span class="cx"> shouldBe(&quot;'foo 1e100'.endsWith(1e100)&quot;, &quot;false&quot;);
</span><span class="cx"> shouldBe(&quot;'フーバー'.endsWith('バー')&quot;, &quot;true&quot;);
</span><span class="cx"> shouldBe(&quot;'フーバー'.endsWith('フー')&quot;, &quot;false&quot;);
</span><ins>+shouldBe(&quot;'フーバー'.endsWith('abc')&quot;, &quot;false&quot;);
+shouldBe(&quot;'フーバー'.endsWith('abc')&quot;, &quot;false&quot;);
+shouldBe(&quot;'foo bar'.endsWith('フー')&quot;, &quot;false&quot;);
+shouldBe(&quot;'foo bar'.endsWith('フー', 3)&quot;, &quot;false&quot;);
</ins><span class="cx"> 
</span><span class="cx"> // Call functions with an environment record as 'this'.
</span><span class="cx"> shouldThrow(&quot;(function() { var f = String.prototype.startsWith; (function() { f('a'); })(); })()&quot;);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestsjsstringincludesexpectedtxt"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/js/string-includes-expected.txt (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/js/string-includes-expected.txt        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/js/string-includes-expected.txt        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -54,6 +54,10 @@
</span><span class="cx"> PASS '1e100 bar'.startsWith(1e100) is false
</span><span class="cx"> PASS 'フーバー'.startsWith('フー') is true
</span><span class="cx"> PASS 'フーバー'.startsWith('バー') is false
</span><ins>+PASS 'フーバー'.startsWith('abc') is false
+PASS 'フーバー'.startsWith('abc', 1) is false
+PASS 'foo bar'.startsWith('フー') is false
+PASS 'foo bar'.startsWith('フー', 1) is false
</ins><span class="cx"> PASS 'foo bar'.endsWith('bar') is true
</span><span class="cx"> PASS 'foo bar'.endsWith('ba', 6) is true
</span><span class="cx"> PASS 'foo bar'.endsWith(' ba', 6) is true
</span><span class="lines">@@ -80,6 +84,10 @@
</span><span class="cx"> PASS 'foo 1e100'.endsWith(1e100) is false
</span><span class="cx"> PASS 'フーバー'.endsWith('バー') is true
</span><span class="cx"> PASS 'フーバー'.endsWith('フー') is false
</span><ins>+PASS 'フーバー'.endsWith('abc') is false
+PASS 'フーバー'.endsWith('abc') is false
+PASS 'foo bar'.endsWith('フー') is false
+PASS 'foo bar'.endsWith('フー', 3) is false
</ins><span class="cx"> PASS (function() { var f = String.prototype.startsWith; (function() { f('a'); })(); })() threw exception TypeError: Type error.
</span><span class="cx"> PASS (function() { var f = String.prototype.endsWith; (function() { f('a'); })(); })() threw exception TypeError: Type error.
</span><span class="cx"> PASS (function() { var f = String.prototype.includes; (function() { f('a'); })(); })() threw exception TypeError: Type error.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-03-05  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Regression(r173761): ASSERTION FAILED: !is8Bit() in StringImpl::characters16()
+        https://bugs.webkit.org/show_bug.cgi?id=142350
+
+        Reviewed by Michael Saboff and Benjamin Poulain.
+
+        Call WTFString::hasInfixStartingAt() / hasInfixEndingAt() now that these
+        methods have been renamed for clarity.
+
+        * runtime/StringPrototype.cpp:
+        (JSC::stringProtoFuncStartsWith):
+        (JSC::stringProtoFuncEndsWith):
+
</ins><span class="cx"> 2015-03-04  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         GC should compute stack bounds and dump registers at the earliest opportunity.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceJavaScriptCoreruntimeStringPrototypecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/StringPrototype.cpp (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/StringPrototype.cpp        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/runtime/StringPrototype.cpp        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -1647,7 +1647,7 @@
</span><span class="cx">     if (exec-&gt;hadException())
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx"> 
</span><del>-    return JSValue::encode(jsBoolean(stringToSearchIn.startsWith(searchString, start, true)));
</del><ins>+    return JSValue::encode(jsBoolean(stringToSearchIn.hasInfixStartingAt(searchString, start)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL stringProtoFuncEndsWith(ExecState* exec)
</span><span class="lines">@@ -1675,7 +1675,7 @@
</span><span class="cx">         return JSValue::encode(jsUndefined());
</span><span class="cx">     unsigned end = std::min&lt;unsigned&gt;(std::max(pos, 0), length);
</span><span class="cx"> 
</span><del>-    return JSValue::encode(jsBoolean(stringToSearchIn.endsWith(searchString, end, true)));
</del><ins>+    return JSValue::encode(jsBoolean(stringToSearchIn.hasInfixEndingAt(searchString, end)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL stringProtoFuncIncludes(ExecState* exec)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WTF/ChangeLog (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/ChangeLog        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/ChangeLog        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2015-03-05  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Regression(r173761): ASSERTION FAILED: !is8Bit() in StringImpl::characters16()
+        https://bugs.webkit.org/show_bug.cgi?id=142350
+
+        Reviewed by Michael Saboff and Benjamin Poulain.
+
+        Fix ASSERTION FAILED: !is8Bit() in StringImpl::characters16() from
+        WTF::equalInner() after r173761. The code was incorrectly assuming that
+        if stringImpl is 16-bit, then matchString is 16-bit too, which is not
+        correct.
+
+        Also rename WTFString::startsWith() / endsWith() taking an offset to
+        hasInfixStartingAt() / hasInfixEndingAt() for clarity. It seems odd
+        to call it startsWith even though it won't technically *start* with
+        the pattern if the input offset is greater than zero.
+
+        Also drop the caseSensitive argument as it is never used (always true
+        at call sites.
+
+        * wtf/text/StringImpl.cpp:
+        (WTF::equalInner):
+        (WTF::StringImpl::hasInfixStartingAt):
+        (WTF::StringImpl::hasInfixEndingAt):
+        (WTF::StringImpl::startsWith): Deleted.
+        (WTF::StringImpl::endsWith): Deleted.
+        * wtf/text/StringImpl.h:
+        * wtf/text/WTFString.h:
+        (WTF::String::hasInfixStartingAt):
+        (WTF::String::hasInfixEndingAt):
+        (WTF::String::startsWith): Deleted.
+        (WTF::String::endsWith): Deleted.
+
</ins><span class="cx"> 2015-02-25  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Enable concurrent JIT on GTK
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFwtftextStringImplcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/StringImpl.cpp (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/StringImpl.cpp        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/StringImpl.cpp        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -1357,7 +1357,7 @@
</span><span class="cx">     return equalIgnoringCase(stringImpl-&gt;characters16() + startOffset, reinterpret_cast&lt;const LChar*&gt;(matchString), matchLength);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ALWAYS_INLINE static bool equalInner(StringImpl&amp; stringImpl, unsigned startOffset, StringImpl&amp; matchString, bool caseSensitive)
</del><ins>+ALWAYS_INLINE static bool equalInner(const StringImpl&amp; stringImpl, unsigned startOffset, const StringImpl&amp; matchString)
</ins><span class="cx"> {
</span><span class="cx">     if (startOffset &gt; stringImpl.length())
</span><span class="cx">         return false;
</span><span class="lines">@@ -1366,14 +1366,14 @@
</span><span class="cx">     if (matchString.length() + startOffset &gt; stringImpl.length())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (caseSensitive) {
-        if (stringImpl.is8Bit())
</del><ins>+    if (stringImpl.is8Bit()) {
+        if (matchString.is8Bit())
</ins><span class="cx">             return equal(stringImpl.characters8() + startOffset, matchString.characters8(), matchString.length());
</span><del>-        return equal(stringImpl.characters16() + startOffset, matchString.characters16(), matchString.length());
</del><ins>+        return equal(stringImpl.characters8() + startOffset, matchString.characters16(), matchString.length());
</ins><span class="cx">     }
</span><del>-    if (stringImpl.is8Bit())
-        return equalIgnoringCase(stringImpl.characters8() + startOffset, matchString.characters8(), matchString.length());
-    return equalIgnoringCase(stringImpl.characters16() + startOffset, matchString.characters16(), matchString.length());
</del><ins>+    if (matchString.is8Bit())
+        return equal(stringImpl.characters16() + startOffset, matchString.characters8(), matchString.length());
+    return equal(stringImpl.characters16() + startOffset, matchString.characters16(), matchString.length());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool StringImpl::startsWith(const StringImpl* str) const
</span><span class="lines">@@ -1407,9 +1407,9 @@
</span><span class="cx">     return equalInner(this, 0, matchString, matchLength, caseSensitive);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool StringImpl::startsWith(StringImpl&amp; matchString, unsigned startOffset, bool caseSensitive) const
</del><ins>+bool StringImpl::hasInfixStartingAt(const StringImpl&amp; matchString, unsigned startOffset) const
</ins><span class="cx"> {
</span><del>-    return equalInner(const_cast&lt;StringImpl&amp;&gt;(*this), startOffset, matchString, caseSensitive);
</del><ins>+    return equalInner(*this, startOffset, matchString);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool StringImpl::endsWith(StringImpl* matchString, bool caseSensitive)
</span><span class="lines">@@ -1436,11 +1436,11 @@
</span><span class="cx">     return equalInner(this, startOffset, matchString, matchLength, caseSensitive);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool StringImpl::endsWith(StringImpl&amp; matchString, unsigned endOffset, bool caseSensitive) const
</del><ins>+bool StringImpl::hasInfixEndingAt(const StringImpl&amp; matchString, unsigned endOffset) const
</ins><span class="cx"> {
</span><span class="cx">     if (endOffset &lt; matchString.length())
</span><span class="cx">         return false;
</span><del>-    return equalInner(const_cast&lt;StringImpl&amp;&gt;(*this), endOffset - matchString.length(), matchString, caseSensitive);
</del><ins>+    return equalInner(*this, endOffset - matchString.length(), matchString);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;StringImpl&gt; StringImpl::replace(UChar oldC, UChar newC)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFwtftextStringImplh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/StringImpl.h (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/StringImpl.h        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/StringImpl.h        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -674,14 +674,14 @@
</span><span class="cx">     WTF_EXPORT_STRING_API bool startsWith(const char*, unsigned matchLength, bool caseSensitive) const;
</span><span class="cx">     template&lt;unsigned matchLength&gt;
</span><span class="cx">     bool startsWith(const char (&amp;prefix)[matchLength], bool caseSensitive = true) const { return startsWith(prefix, matchLength - 1, caseSensitive); }
</span><del>-    WTF_EXPORT_STRING_API bool startsWith(StringImpl&amp;, unsigned startOffset, bool caseSensitive) const;
</del><ins>+    WTF_EXPORT_STRING_API bool hasInfixStartingAt(const StringImpl&amp;, unsigned startOffset) const;
</ins><span class="cx"> 
</span><span class="cx">     WTF_EXPORT_STRING_API bool endsWith(StringImpl*, bool caseSensitive = true);
</span><span class="cx">     WTF_EXPORT_STRING_API bool endsWith(UChar) const;
</span><span class="cx">     WTF_EXPORT_STRING_API bool endsWith(const char*, unsigned matchLength, bool caseSensitive) const;
</span><span class="cx">     template&lt;unsigned matchLength&gt;
</span><span class="cx">     bool endsWith(const char (&amp;prefix)[matchLength], bool caseSensitive = true) const { return endsWith(prefix, matchLength - 1, caseSensitive); }
</span><del>-    WTF_EXPORT_STRING_API bool endsWith(StringImpl&amp;, unsigned endOffset, bool caseSensitive) const;
</del><ins>+    WTF_EXPORT_STRING_API bool hasInfixEndingAt(const StringImpl&amp;, unsigned endOffset) const;
</ins><span class="cx"> 
</span><span class="cx">     WTF_EXPORT_STRING_API Ref&lt;StringImpl&gt; replace(UChar, UChar);
</span><span class="cx">     WTF_EXPORT_STRING_API Ref&lt;StringImpl&gt; replace(UChar, StringImpl*);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWTFwtftextWTFStringh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/WTFString.h (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/WTFString.h        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/Source/WTF/wtf/text/WTFString.h        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -270,8 +270,8 @@
</span><span class="cx">     template&lt;unsigned matchLength&gt;
</span><span class="cx">     bool startsWith(const char (&amp;prefix)[matchLength], bool caseSensitive = true) const
</span><span class="cx">         { return m_impl ? m_impl-&gt;startsWith&lt;matchLength&gt;(prefix, caseSensitive) : !matchLength; }
</span><del>-    bool startsWith(String&amp; prefix, unsigned startOffset, bool caseSensitive) const
-        { return m_impl &amp;&amp; prefix.impl() ? m_impl-&gt;startsWith(*prefix.impl(), startOffset, caseSensitive) : false; }
</del><ins>+    bool hasInfixStartingAt(const String&amp; prefix, unsigned startOffset) const
+        { return m_impl &amp;&amp; prefix.impl() ? m_impl-&gt;hasInfixStartingAt(*prefix.impl(), startOffset) : false; }
</ins><span class="cx"> 
</span><span class="cx">     bool endsWith(const String&amp; s, bool caseSensitive = true) const
</span><span class="cx">         { return m_impl ? m_impl-&gt;endsWith(s.impl(), caseSensitive) : s.isEmpty(); }
</span><span class="lines">@@ -281,8 +281,8 @@
</span><span class="cx">     template&lt;unsigned matchLength&gt;
</span><span class="cx">     bool endsWith(const char (&amp;prefix)[matchLength], bool caseSensitive = true) const
</span><span class="cx">         { return m_impl ? m_impl-&gt;endsWith&lt;matchLength&gt;(prefix, caseSensitive) : !matchLength; }
</span><del>-    bool endsWith(String&amp; suffix, unsigned endOffset, bool caseSensitive) const
-        { return m_impl &amp;&amp; suffix.impl() ? m_impl-&gt;endsWith(*suffix.impl(), endOffset, caseSensitive) : false; }
</del><ins>+    bool hasInfixEndingAt(const String&amp; suffix, unsigned endOffset) const
+        { return m_impl &amp;&amp; suffix.impl() ? m_impl-&gt;hasInfixEndingAt(*suffix.impl(), endOffset) : false; }
</ins><span class="cx"> 
</span><span class="cx">     WTF_EXPORT_STRING_API void append(const String&amp;);
</span><span class="cx">     WTF_EXPORT_STRING_API void append(LChar);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28ToolsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Tools/ChangeLog (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Tools/ChangeLog        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/Tools/ChangeLog        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-03-05  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Regression(r173761): ASSERTION FAILED: !is8Bit() in StringImpl::characters16()
+        https://bugs.webkit.org/show_bug.cgi?id=142350
+
+        Reviewed by Michael Saboff and Benjamin Poulain.
+
+        Add API test for WTFString::hasInfixStartingAt() to make sure it doesn't
+        crash if the string is 8-bit but the pattern is 16-bit (and vice-versa).
+
+        * TestWebKitAPI/Tests/WTF/WTFString.cpp:
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2015-03-05  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Fix /webkit2/WebKitWebResource/mime-type after r180927.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28ToolsTestWebKitAPITestsWTFWTFStringcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp (181235 => 181236)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp        2015-03-08 09:47:20 UTC (rev 181235)
+++ releases/WebKitGTK/webkit-2.8/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp        2015-03-08 10:11:40 UTC (rev 181236)
</span><span class="lines">@@ -260,4 +260,25 @@
</span><span class="cx">     EXPECT_FALSE(ok);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+TEST(WTF, StringhasInfixStartingAt)
+{
+    EXPECT_TRUE(String(&quot;Test&quot;).is8Bit());
+    EXPECT_TRUE(String(&quot;Te&quot;).is8Bit());
+    EXPECT_TRUE(String(&quot;st&quot;).is8Bit());
+    EXPECT_TRUE(String(&quot;Test&quot;).hasInfixStartingAt(String(&quot;Te&quot;), 0));
+    EXPECT_FALSE(String(&quot;Test&quot;).hasInfixStartingAt(String(&quot;Te&quot;), 2));
+    EXPECT_TRUE(String(&quot;Test&quot;).hasInfixStartingAt(String(&quot;st&quot;), 2));
+    EXPECT_FALSE(String(&quot;Test&quot;).hasInfixStartingAt(String(&quot;ST&quot;), 2));
+
+    EXPECT_FALSE(String::fromUTF8(&quot;中国&quot;).is8Bit());
+    EXPECT_FALSE(String::fromUTF8(&quot;中&quot;).is8Bit());
+    EXPECT_FALSE(String::fromUTF8(&quot;国&quot;).is8Bit());
+    EXPECT_TRUE(String::fromUTF8(&quot;中国&quot;).hasInfixStartingAt(String::fromUTF8(&quot;中&quot;), 0));
+    EXPECT_FALSE(String::fromUTF8(&quot;中国&quot;).hasInfixStartingAt(String::fromUTF8(&quot;中&quot;), 1));
+    EXPECT_TRUE(String::fromUTF8(&quot;中国&quot;).hasInfixStartingAt(String::fromUTF8(&quot;国&quot;), 1));
+
+    EXPECT_FALSE(String::fromUTF8(&quot;中国&quot;).hasInfixStartingAt(String(&quot;Te&quot;), 0));
+    EXPECT_FALSE(String(&quot;Test&quot;).hasInfixStartingAt(String::fromUTF8(&quot;中&quot;), 2));
+}
+
</ins><span class="cx"> } // namespace TestWebKitAPI
</span></span></pre>
</div>
</div>

</body>
</html>