<!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>[212235] trunk</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/212235">212235</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2017-02-13 11:07:43 -0800 (Mon, 13 Feb 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Update custom line breaking iterators to the latest version of Unicode
https://bugs.webkit.org/show_bug.cgi?id=168182
Reviewed by Zalan Bujtas.
Source/WebCore:
Clean up our breaking code to be more descriptive about the difference between
line-break: auto vs line-break: loose | normal | strict. The only difference is
that we have some hardcoded tables to speed up character iteration for
line-break: auto.
Tests: TestWebKitAPI WebKit2.LineBreaking
* rendering/BreakLines.h:
(WebCore::nextBreakablePosition):
(WebCore::nextBreakablePositionIgnoringNBSP):
(WebCore::nextBreakablePositionWithoutShortcut):
(WebCore::nextBreakablePositionIgnoringNBSPWithoutShortcut):
(WebCore::isBreakable):
(WebCore::nextBreakablePositionNonLoosely): Deleted.
(WebCore::nextBreakablePositionLoosely): Deleted.
(WebCore::nextBreakablePositionLoose): Deleted.
(WebCore::nextBreakablePositionIgnoringNBSPLoose): Deleted.
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::nextBreakablePositionInSegment):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
(WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
Source/WTF:
ICU 55.1 supports loose / normal / strict line breaking rules. The oldest platform we ship
on has a version of ICU >= that one. Therefore, we don't need to compile our own rules;
we can just use ICU's rules.
* wtf/text/LineBreakIteratorPoolICU.h:
(WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword):
(WTF::LineBreakIteratorPool::take):
* wtf/text/TextBreakIterator.cpp:
(WTF::acquireLineBreakIterator):
(WTF::openLineBreakIterator):
(WTF::mapLineIteratorModeToRules): Deleted.
(WTF::isCJKLocale): Deleted.
* wtf/text/TextBreakIterator.h:
(WTF::LazyLineBreakIterator::LazyLineBreakIterator):
(WTF::LazyLineBreakIterator::mode):
(WTF::LazyLineBreakIterator::get):
(WTF::LazyLineBreakIterator::resetStringAndReleaseIterator):
(WTF::LazyLineBreakIterator::isLooseCJKMode): Deleted.
Tools:
Treat the system's ICU as the source of truth to compare breaking positions against.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/LineBreaking.mm: Added.
(generateJavaScriptForTest):
(breakingLocationsFromICU):
(testAFewStrings):
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/AllAhem.svg: Renamed from LayoutTests/css3/line-break/resources/AllAhem.svg.
* TestWebKitAPI/Tests/WebKit2Cocoa/LineBreaking.html: Added.
LayoutTests:
Migrated to TestWebKitAPI.
* css3/line-break/line-break-auto-centered-2-expected.html: Removed.
* css3/line-break/line-break-auto-centered-2.html: Removed.
* css3/line-break/line-break-auto-centered-expected.html: Removed.
* css3/line-break/line-break-auto-centered.html: Removed.
* css3/line-break/line-break-auto-half-kana-2-expected.html: Removed.
* css3/line-break/line-break-auto-half-kana-2.html: Removed.
* css3/line-break/line-break-auto-half-kana-3-expected.html: Removed.
* css3/line-break/line-break-auto-half-kana-3.html: Removed.
* css3/line-break/line-break-auto-half-kana-4-expected.html: Removed.
* css3/line-break/line-break-auto-half-kana-4.html: Removed.
* css3/line-break/line-break-auto-half-kana-5-expected.html: Removed.
* css3/line-break/line-break-auto-half-kana-5.html: Removed.
* css3/line-break/line-break-auto-half-kana-expected.html: Removed.
* css3/line-break/line-break-auto-half-kana.html: Removed.
* css3/line-break/line-break-auto-hyphens-expected.html: Removed.
* css3/line-break/line-break-auto-hyphens.html: Removed.
* css3/line-break/line-break-auto-inseparables-expected.html: Removed.
* css3/line-break/line-break-auto-inseparables.html: Removed.
* css3/line-break/line-break-auto-iteration-marks-expected.html: Removed.
* css3/line-break/line-break-auto-iteration-marks.html: Removed.
* css3/line-break/line-break-auto-postfixes-expected.html: Removed.
* css3/line-break/line-break-auto-postfixes.html: Removed.
* css3/line-break/line-break-auto-prefixes-expected.html: Removed.
* css3/line-break/line-break-auto-prefixes.html: Removed.
* css3/line-break/line-break-auto-sound-marks-expected.html: Removed.
* css3/line-break/line-break-auto-sound-marks.html: Removed.
* css3/line-break/line-break-loose-centered-2-expected.html: Removed.
* css3/line-break/line-break-loose-centered-2.html: Removed.
* css3/line-break/line-break-loose-centered-expected.html: Removed.
* css3/line-break/line-break-loose-centered.html: Removed.
* css3/line-break/line-break-loose-half-kana-2-expected.html: Removed.
* css3/line-break/line-break-loose-half-kana-2.html: Removed.
* css3/line-break/line-break-loose-half-kana-3-expected.html: Removed.
* css3/line-break/line-break-loose-half-kana-3.html: Removed.
* css3/line-break/line-break-loose-half-kana-4-expected.html: Removed.
* css3/line-break/line-break-loose-half-kana-4.html: Removed.
* css3/line-break/line-break-loose-half-kana-5-expected.html: Removed.
* css3/line-break/line-break-loose-half-kana-5.html: Removed.
* css3/line-break/line-break-loose-half-kana-expected.html: Removed.
* css3/line-break/line-break-loose-half-kana.html: Removed.
* css3/line-break/line-break-loose-hyphens-expected.html: Removed.
* css3/line-break/line-break-loose-hyphens.html: Removed.
* css3/line-break/line-break-loose-inseparables-expected.html: Removed.
* css3/line-break/line-break-loose-inseparables.html: Removed.
* css3/line-break/line-break-loose-iteration-marks-expected.html: Removed.
* css3/line-break/line-break-loose-iteration-marks.html: Removed.
* css3/line-break/line-break-loose-postfixes-expected.html: Removed.
* css3/line-break/line-break-loose-postfixes.html: Removed.
* css3/line-break/line-break-loose-prefixes-expected.html: Removed.
* css3/line-break/line-break-loose-prefixes.html: Removed.
* css3/line-break/line-break-loose-sound-marks-expected.html: Removed.
* css3/line-break/line-break-loose-sound-marks.html: Removed.
* css3/line-break/line-break-normal-centered-2-expected.html: Removed.
* css3/line-break/line-break-normal-centered-2.html: Removed.
* css3/line-break/line-break-normal-centered-expected.html: Removed.
* css3/line-break/line-break-normal-centered.html: Removed.
* css3/line-break/line-break-normal-half-kana-2-expected.html: Removed.
* css3/line-break/line-break-normal-half-kana-2.html: Removed.
* css3/line-break/line-break-normal-half-kana-3-expected.html: Removed.
* css3/line-break/line-break-normal-half-kana-3.html: Removed.
* css3/line-break/line-break-normal-half-kana-4-expected.html: Removed.
* css3/line-break/line-break-normal-half-kana-4.html: Removed.
* css3/line-break/line-break-normal-half-kana-5-expected.html: Removed.
* css3/line-break/line-break-normal-half-kana-5.html: Removed.
* css3/line-break/line-break-normal-half-kana-expected.html: Removed.
* css3/line-break/line-break-normal-half-kana.html: Removed.
* css3/line-break/line-break-normal-hyphens-expected.html: Removed.
* css3/line-break/line-break-normal-hyphens.html: Removed.
* css3/line-break/line-break-normal-inseparables-expected.html: Removed.
* css3/line-break/line-break-normal-inseparables.html: Removed.
* css3/line-break/line-break-normal-iteration-marks-expected.html: Removed.
* css3/line-break/line-break-normal-iteration-marks.html: Removed.
* css3/line-break/line-break-normal-postfixes-expected.html: Removed.
* css3/line-break/line-break-normal-postfixes.html: Removed.
* css3/line-break/line-break-normal-prefixes-expected.html: Removed.
* css3/line-break/line-break-normal-prefixes.html: Removed.
* css3/line-break/line-break-normal-sound-marks-expected.html: Removed.
* css3/line-break/line-break-normal-sound-marks.html: Removed.
* css3/line-break/line-break-strict-centered-2-expected.html: Removed.
* css3/line-break/line-break-strict-centered-2.html: Removed.
* css3/line-break/line-break-strict-centered-expected.html: Removed.
* css3/line-break/line-break-strict-centered.html: Removed.
* css3/line-break/line-break-strict-half-kana-2-expected.html: Removed.
* css3/line-break/line-break-strict-half-kana-2.html: Removed.
* css3/line-break/line-break-strict-half-kana-3-expected.html: Removed.
* css3/line-break/line-break-strict-half-kana-3.html: Removed.
* css3/line-break/line-break-strict-half-kana-4-expected.html: Removed.
* css3/line-break/line-break-strict-half-kana-4.html: Removed.
* css3/line-break/line-break-strict-half-kana-5-expected.html: Removed.
* css3/line-break/line-break-strict-half-kana-5.html: Removed.
* css3/line-break/line-break-strict-half-kana-expected.html: Removed.
* css3/line-break/line-break-strict-half-kana.html: Removed.
* css3/line-break/line-break-strict-hyphens-expected.html: Removed.
* css3/line-break/line-break-strict-hyphens.html: Removed.
* css3/line-break/line-break-strict-inseparables-expected.html: Removed.
* css3/line-break/line-break-strict-inseparables.html: Removed.
* css3/line-break/line-break-strict-iteration-marks-expected.html: Removed.
* css3/line-break/line-break-strict-iteration-marks.html: Removed.
* css3/line-break/line-break-strict-postfixes-expected.html: Removed.
* css3/line-break/line-break-strict-postfixes.html: Removed.
* css3/line-break/line-break-strict-prefixes-expected.html: Removed.
* css3/line-break/line-break-strict-prefixes.html: Removed.
* css3/line-break/line-break-strict-sound-marks-expected.html: Removed.
* css3/line-break/line-break-strict-sound-marks.html: Removed.
* platform/ios-simulator-wk1/TestExpectations:
* platform/ios-simulator/TestExpectations:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk1TestExpectations">trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtftextLineBreakIteratorPoolICUh">trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h</a></li>
<li><a href="#trunkSourceWTFwtftextTextBreakIteratorcpp">trunk/Source/WTF/wtf/text/TextBreakIterator.cpp</a></li>
<li><a href="#trunkSourceWTFwtftextTextBreakIteratorh">trunk/Source/WTF/wtf/text/TextBreakIterator.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingBreakLinesh">trunk/Source/WebCore/rendering/BreakLines.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextcpp">trunk/Source/WebCore/rendering/RenderText.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorcpp">trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderinglineBreakingContexth">trunk/Source/WebCore/rendering/line/BreakingContext.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreLineBreakingmm">trunk/Tools/TestWebKitAPI/Tests/WebCore/LineBreaking.mm</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaAllAhemsvg">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AllAhem.svg</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2CocoaLineBreakinghtml">trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LineBreaking.html</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li>trunk/LayoutTests/css3/line-break/</li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/LayoutTests/ChangeLog        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -1,3 +1,119 @@
</span><ins>+2017-02-13 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Update custom line breaking iterators to the latest version of Unicode
+ https://bugs.webkit.org/show_bug.cgi?id=168182
+
+ Reviewed by Zalan Bujtas.
+
+ Migrated to TestWebKitAPI.
+
+ * css3/line-break/line-break-auto-centered-2-expected.html: Removed.
+ * css3/line-break/line-break-auto-centered-2.html: Removed.
+ * css3/line-break/line-break-auto-centered-expected.html: Removed.
+ * css3/line-break/line-break-auto-centered.html: Removed.
+ * css3/line-break/line-break-auto-half-kana-2-expected.html: Removed.
+ * css3/line-break/line-break-auto-half-kana-2.html: Removed.
+ * css3/line-break/line-break-auto-half-kana-3-expected.html: Removed.
+ * css3/line-break/line-break-auto-half-kana-3.html: Removed.
+ * css3/line-break/line-break-auto-half-kana-4-expected.html: Removed.
+ * css3/line-break/line-break-auto-half-kana-4.html: Removed.
+ * css3/line-break/line-break-auto-half-kana-5-expected.html: Removed.
+ * css3/line-break/line-break-auto-half-kana-5.html: Removed.
+ * css3/line-break/line-break-auto-half-kana-expected.html: Removed.
+ * css3/line-break/line-break-auto-half-kana.html: Removed.
+ * css3/line-break/line-break-auto-hyphens-expected.html: Removed.
+ * css3/line-break/line-break-auto-hyphens.html: Removed.
+ * css3/line-break/line-break-auto-inseparables-expected.html: Removed.
+ * css3/line-break/line-break-auto-inseparables.html: Removed.
+ * css3/line-break/line-break-auto-iteration-marks-expected.html: Removed.
+ * css3/line-break/line-break-auto-iteration-marks.html: Removed.
+ * css3/line-break/line-break-auto-postfixes-expected.html: Removed.
+ * css3/line-break/line-break-auto-postfixes.html: Removed.
+ * css3/line-break/line-break-auto-prefixes-expected.html: Removed.
+ * css3/line-break/line-break-auto-prefixes.html: Removed.
+ * css3/line-break/line-break-auto-sound-marks-expected.html: Removed.
+ * css3/line-break/line-break-auto-sound-marks.html: Removed.
+ * css3/line-break/line-break-loose-centered-2-expected.html: Removed.
+ * css3/line-break/line-break-loose-centered-2.html: Removed.
+ * css3/line-break/line-break-loose-centered-expected.html: Removed.
+ * css3/line-break/line-break-loose-centered.html: Removed.
+ * css3/line-break/line-break-loose-half-kana-2-expected.html: Removed.
+ * css3/line-break/line-break-loose-half-kana-2.html: Removed.
+ * css3/line-break/line-break-loose-half-kana-3-expected.html: Removed.
+ * css3/line-break/line-break-loose-half-kana-3.html: Removed.
+ * css3/line-break/line-break-loose-half-kana-4-expected.html: Removed.
+ * css3/line-break/line-break-loose-half-kana-4.html: Removed.
+ * css3/line-break/line-break-loose-half-kana-5-expected.html: Removed.
+ * css3/line-break/line-break-loose-half-kana-5.html: Removed.
+ * css3/line-break/line-break-loose-half-kana-expected.html: Removed.
+ * css3/line-break/line-break-loose-half-kana.html: Removed.
+ * css3/line-break/line-break-loose-hyphens-expected.html: Removed.
+ * css3/line-break/line-break-loose-hyphens.html: Removed.
+ * css3/line-break/line-break-loose-inseparables-expected.html: Removed.
+ * css3/line-break/line-break-loose-inseparables.html: Removed.
+ * css3/line-break/line-break-loose-iteration-marks-expected.html: Removed.
+ * css3/line-break/line-break-loose-iteration-marks.html: Removed.
+ * css3/line-break/line-break-loose-postfixes-expected.html: Removed.
+ * css3/line-break/line-break-loose-postfixes.html: Removed.
+ * css3/line-break/line-break-loose-prefixes-expected.html: Removed.
+ * css3/line-break/line-break-loose-prefixes.html: Removed.
+ * css3/line-break/line-break-loose-sound-marks-expected.html: Removed.
+ * css3/line-break/line-break-loose-sound-marks.html: Removed.
+ * css3/line-break/line-break-normal-centered-2-expected.html: Removed.
+ * css3/line-break/line-break-normal-centered-2.html: Removed.
+ * css3/line-break/line-break-normal-centered-expected.html: Removed.
+ * css3/line-break/line-break-normal-centered.html: Removed.
+ * css3/line-break/line-break-normal-half-kana-2-expected.html: Removed.
+ * css3/line-break/line-break-normal-half-kana-2.html: Removed.
+ * css3/line-break/line-break-normal-half-kana-3-expected.html: Removed.
+ * css3/line-break/line-break-normal-half-kana-3.html: Removed.
+ * css3/line-break/line-break-normal-half-kana-4-expected.html: Removed.
+ * css3/line-break/line-break-normal-half-kana-4.html: Removed.
+ * css3/line-break/line-break-normal-half-kana-5-expected.html: Removed.
+ * css3/line-break/line-break-normal-half-kana-5.html: Removed.
+ * css3/line-break/line-break-normal-half-kana-expected.html: Removed.
+ * css3/line-break/line-break-normal-half-kana.html: Removed.
+ * css3/line-break/line-break-normal-hyphens-expected.html: Removed.
+ * css3/line-break/line-break-normal-hyphens.html: Removed.
+ * css3/line-break/line-break-normal-inseparables-expected.html: Removed.
+ * css3/line-break/line-break-normal-inseparables.html: Removed.
+ * css3/line-break/line-break-normal-iteration-marks-expected.html: Removed.
+ * css3/line-break/line-break-normal-iteration-marks.html: Removed.
+ * css3/line-break/line-break-normal-postfixes-expected.html: Removed.
+ * css3/line-break/line-break-normal-postfixes.html: Removed.
+ * css3/line-break/line-break-normal-prefixes-expected.html: Removed.
+ * css3/line-break/line-break-normal-prefixes.html: Removed.
+ * css3/line-break/line-break-normal-sound-marks-expected.html: Removed.
+ * css3/line-break/line-break-normal-sound-marks.html: Removed.
+ * css3/line-break/line-break-strict-centered-2-expected.html: Removed.
+ * css3/line-break/line-break-strict-centered-2.html: Removed.
+ * css3/line-break/line-break-strict-centered-expected.html: Removed.
+ * css3/line-break/line-break-strict-centered.html: Removed.
+ * css3/line-break/line-break-strict-half-kana-2-expected.html: Removed.
+ * css3/line-break/line-break-strict-half-kana-2.html: Removed.
+ * css3/line-break/line-break-strict-half-kana-3-expected.html: Removed.
+ * css3/line-break/line-break-strict-half-kana-3.html: Removed.
+ * css3/line-break/line-break-strict-half-kana-4-expected.html: Removed.
+ * css3/line-break/line-break-strict-half-kana-4.html: Removed.
+ * css3/line-break/line-break-strict-half-kana-5-expected.html: Removed.
+ * css3/line-break/line-break-strict-half-kana-5.html: Removed.
+ * css3/line-break/line-break-strict-half-kana-expected.html: Removed.
+ * css3/line-break/line-break-strict-half-kana.html: Removed.
+ * css3/line-break/line-break-strict-hyphens-expected.html: Removed.
+ * css3/line-break/line-break-strict-hyphens.html: Removed.
+ * css3/line-break/line-break-strict-inseparables-expected.html: Removed.
+ * css3/line-break/line-break-strict-inseparables.html: Removed.
+ * css3/line-break/line-break-strict-iteration-marks-expected.html: Removed.
+ * css3/line-break/line-break-strict-iteration-marks.html: Removed.
+ * css3/line-break/line-break-strict-postfixes-expected.html: Removed.
+ * css3/line-break/line-break-strict-postfixes.html: Removed.
+ * css3/line-break/line-break-strict-prefixes-expected.html: Removed.
+ * css3/line-break/line-break-strict-prefixes.html: Removed.
+ * css3/line-break/line-break-strict-sound-marks-expected.html: Removed.
+ * css3/line-break/line-break-strict-sound-marks.html: Removed.
+ * platform/ios-simulator-wk1/TestExpectations:
+ * platform/ios-simulator/TestExpectations:
+
</ins><span class="cx"> 2017-02-13 Ryan Haddad <ryanhaddad@apple.com>
</span><span class="cx">
</span><span class="cx"> TestExpectations gardening for imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click.html.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -2335,13 +2335,6 @@
</span><span class="cx"> webkit.org/b/148806 imported/w3c/css/css-multicol-1/multicol-span-all-block-sibling-003.xht [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/148806 imported/w3c/css/css-multicol-1/multicol-span-all-margin-nested-firstchild-001.xht [ ImageOnlyFailure ]
</span><span class="cx">
</span><del>-# Flaky tests ( these tests were affected by https://bugs.webkit.org/show_bug.cgi?id=149320 )
-
-css3/line-break/line-break-loose-centered.html [ ImageOnlyFailure Pass ]
-css3/line-break/line-break-loose-postfixes.html [ ImageOnlyFailure Pass ]
-css3/line-break/line-break-loose-sound-marks.html [ ImageOnlyFailure Pass ]
-css3/line-break/line-break-normal-sound-marks.html [ ImageOnlyFailure Pass ]
-
</del><span class="cx"> # Enable "aria-current" test for iOS
</span><span class="cx"> webkit.org/b/149297 accessibility/aria-current.html [ Pass ]
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -673,7 +673,6 @@
</span><span class="cx"> css3/filters/backdrop/backdrop-filter-with-border-radius-and-reflection.html [ ImageOnlyFailure ]
</span><span class="cx"> css3/filters/backdrop/backdrop-filter-with-clip-path.html [ ImageOnlyFailure ]
</span><span class="cx"> css3/flexbox/content-height-with-scrollbars.html [ ImageOnlyFailure ]
</span><del>-css3/line-break/line-break-auto-centered-2.html [ ImageOnlyFailure ]
</del><span class="cx"> css3/masking/mask-repeat-space-border.html [ ImageOnlyFailure ]
</span><span class="cx">
</span><span class="cx"> # CSS tests that pass:
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Source/WTF/ChangeLog        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2017-02-13 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Update custom line breaking iterators to the latest version of Unicode
+ https://bugs.webkit.org/show_bug.cgi?id=168182
+
+ Reviewed by Zalan Bujtas.
+
+ ICU 55.1 supports loose / normal / strict line breaking rules. The oldest platform we ship
+ on has a version of ICU >= that one. Therefore, we don't need to compile our own rules;
+ we can just use ICU's rules.
+
+ * wtf/text/LineBreakIteratorPoolICU.h:
+ (WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword):
+ (WTF::LineBreakIteratorPool::take):
+ * wtf/text/TextBreakIterator.cpp:
+ (WTF::acquireLineBreakIterator):
+ (WTF::openLineBreakIterator):
+ (WTF::mapLineIteratorModeToRules): Deleted.
+ (WTF::isCJKLocale): Deleted.
+ * wtf/text/TextBreakIterator.h:
+ (WTF::LazyLineBreakIterator::LazyLineBreakIterator):
+ (WTF::LazyLineBreakIterator::mode):
+ (WTF::LazyLineBreakIterator::get):
+ (WTF::LazyLineBreakIterator::resetStringAndReleaseIterator):
+ (WTF::LazyLineBreakIterator::isLooseCJKMode): Deleted.
+
</ins><span class="cx"> 2017-02-10 Dan Bernstein <mitz@apple.com>
</span><span class="cx">
</span><span class="cx"> [Xcode] WTF installs extra copies of two headers outside /usr/local/include/wtf
</span></span></pre></div>
<a id="trunkSourceWTFwtftextLineBreakIteratorPoolICUh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Source/WTF/wtf/text/LineBreakIteratorPoolICU.h        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx">
</span><span class="cx"> #include "TextBreakIterator.h"
</span><ins>+#include <unicode/uloc.h>
</ins><span class="cx"> #include <wtf/HashMap.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/ThreadSpecific.h>
</span><span class="lines">@@ -46,21 +47,46 @@
</span><span class="cx">
</span><span class="cx"> static AtomicString makeLocaleWithBreakKeyword(const AtomicString& locale, LineBreakIteratorMode mode)
</span><span class="cx"> {
</span><ins>+ // The uloc functions model locales as char*, so we have to downconvert our AtomicString.
+ auto utf8Locale = locale.string().utf8();
+ if (!utf8Locale.length())
+ return locale;
+ Vector<char> scratchBuffer(utf8Locale.length() + 11, 0);
+ memcpy(scratchBuffer.data(), utf8Locale.data(), utf8Locale.length());
+
+ const char* keywordValue = nullptr;
</ins><span class="cx"> switch (mode) {
</span><span class="cx"> case LineBreakIteratorMode::Default:
</span><del>- return locale;
</del><ins>+ // nullptr will cause any existing values to be removed.
+ break;
</ins><span class="cx"> case LineBreakIteratorMode::Loose:
</span><del>- return makeString(locale, "@break=loose");
</del><ins>+ keywordValue = "loose";
+ break;
</ins><span class="cx"> case LineBreakIteratorMode::Normal:
</span><del>- return makeString(locale, "@break=normal");
</del><ins>+ keywordValue = "normal";
+ break;
</ins><span class="cx"> case LineBreakIteratorMode::Strict:
</span><del>- return makeString(locale, "@break=strict");
</del><ins>+ keywordValue = "strict";
+ break;
</ins><span class="cx"> }
</span><del>- ASSERT_NOT_REACHED();
</del><ins>+
+ UErrorCode status = U_ZERO_ERROR;
+ int32_t lengthNeeded = uloc_setKeywordValue("lb", keywordValue, scratchBuffer.data(), scratchBuffer.size(), &status);
+ if (U_SUCCESS(status))
+ return AtomicString::fromUTF8(scratchBuffer.data(), lengthNeeded);
+ if (status == U_BUFFER_OVERFLOW_ERROR) {
+ scratchBuffer.grow(lengthNeeded + 1);
+ memset(scratchBuffer.data() + utf8Locale.length(), 0, scratchBuffer.size() - utf8Locale.length());
+ status = U_ZERO_ERROR;
+ int32_t lengthNeeded2 = uloc_setKeywordValue("lb", keywordValue, scratchBuffer.data(), scratchBuffer.size(), &status);
+ if (!U_SUCCESS(status) || lengthNeeded != lengthNeeded2)
+ return locale;
+ return AtomicString::fromUTF8(scratchBuffer.data(), lengthNeeded);
+ }
</ins><span class="cx"> return locale;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- UBreakIterator* take(const AtomicString& locale, LineBreakIteratorMode mode, bool isCJK)
</del><ins>+ UBreakIterator* take(const AtomicString& locale, LineBreakIteratorMode mode)
</ins><span class="cx"> {
</span><span class="cx"> auto localeWithOptionalBreakKeyword = makeLocaleWithBreakKeyword(locale, mode);
</span><span class="cx">
</span><span class="lines">@@ -74,7 +100,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!iterator) {
</span><del>- iterator = openLineBreakIterator(localeWithOptionalBreakKeyword, mode, isCJK);
</del><ins>+ iterator = openLineBreakIterator(localeWithOptionalBreakKeyword);
</ins><span class="cx"> if (!iterator)
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWTFwtftextTextBreakIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/TextBreakIterator.cpp (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/TextBreakIterator.cpp        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Source/WTF/wtf/text/TextBreakIterator.cpp        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -303,9 +303,9 @@
</span><span class="cx"> return setTextForIterator(*staticCursorMovementIterator, string);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-UBreakIterator* acquireLineBreakIterator(StringView string, const AtomicString& locale, const UChar* priorContext, unsigned priorContextLength, LineBreakIteratorMode mode, bool isCJK)
</del><ins>+UBreakIterator* acquireLineBreakIterator(StringView string, const AtomicString& locale, const UChar* priorContext, unsigned priorContextLength, LineBreakIteratorMode mode)
</ins><span class="cx"> {
</span><del>- UBreakIterator* iterator = LineBreakIteratorPool::sharedPool().take(locale, mode, isCJK);
</del><ins>+ UBreakIterator* iterator = LineBreakIteratorPool::sharedPool().take(locale, mode);
</ins><span class="cx"> if (!iterator)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="lines">@@ -319,479 +319,11 @@
</span><span class="cx"> LineBreakIteratorPool::sharedPool().put(iterator);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static const char* uax14Prologue =
- "!!chain;"
- "!!LBCMNoChain;"
- "!!lookAheadHardBreak;";
-
-static const char* uax14AssignmentsBefore =
- // explicitly enumerate $CJ since ICU versions prior to 49 don't support :LineBreak=Conditional_Japanese_Starter:
- "$CJ = ["
-#if (U_ICU_VERSION_MAJOR_NUM >= 4) && (U_ICU_VERSION_MINOR_NUM >= 9)
- ":LineBreak=Conditional_Japanese_Starter:"
-#else
- "\\u3041\\u3043\\u3045\\u3047\\u3049\\u3063\\u3083\\u3085\\u3087\\u308E\\u3095\\u3096\\u30A1\\u30A3\\u30A5\\u30A7"
- "\\u30A9\\u30C3\\u30E3\\u30E5\\u30E7\\u30EE\\u30F5\\u30F6\\u30FC"
- "\\u31F0\\u31F1\\u31F2\\u31F3\\u31F4\\u31F5\\u31F6\\u31F7\\u31F8\\u31F9\\u31FA\\u31FB\\u31FC\\u31FD\\u31FE\\u31FF"
- "\\uFF67\\uFF68\\uFF69\\uFF6A\\uFF6B\\uFF6C\\uFF6D\\uFF6E\\uFF6F\\uFF70"
-#endif
- "];";
-
-static const char* uax14AssignmentsCustomLooseCJK =
- "$BA_SUB = [\\u2010\\u2013];"
- "$EX_SUB = [\\u0021\\u003F\\uFF01\\uFF1F];"
- "$ID_SUB = '';"
- "$IN_SUB = [\\u2025\\u2026];"
- "$IS_SUB = [\\u003A\\u003B];"
- "$NS_SUB = [\\u203C\\u2047\\u2048\\u2049\\u3005\\u301C\\u303B\\u309D\\u309E\\u30A0\\u30FB\\u30FD\\u30FE\\uFF1A\\uFF1B\\uFF65];"
- "$PO_SUB = [\\u0025\\u00A2\\u00B0\\u2030\\u2032\\u2033\\u2103\\uFF05\\uFFE0];"
- "$PR_SUB = [\\u0024\\u00A3\\u00A5\\u20AC\\u2116\\uFF04\\uFFE1\\uFFE5];"
- "$ID_ADD = [$CJ $BA_SUB $EX_SUB $IN_SUB $IS_SUB $NS_SUB $PO_SUB $PR_SUB];"
- "$NS_ADD = '';";
-
-static const char* uax14AssignmentsCustomLooseNonCJK =
- "$BA_SUB = '';"
- "$EX_SUB = '';"
- "$ID_SUB = '';"
- "$IN_SUB = [\\u2025\\u2026];"
- "$IS_SUB = '';"
- "$NS_SUB = [\\u3005\\u303B\\u309D\\u309E\\u30FD\\u30FE];"
- "$PO_SUB = '';"
- "$PR_SUB = '';"
- "$ID_ADD = [$CJ $IN_SUB $NS_SUB];"
- "$NS_ADD = '';";
-
-static const char* uax14AssignmentsCustomNormalCJK =
- "$BA_SUB = [\\u2010\\u2013];"
- "$EX_SUB = '';"
- "$IN_SUB = '';"
- "$ID_SUB = '';"
- "$IS_SUB = '';"
- "$NS_SUB = [\\u301C\\u30A0];"
- "$PO_SUB = '';"
- "$PR_SUB = '';"
- "$ID_ADD = [$CJ $BA_SUB $NS_SUB];"
- "$NS_ADD = '';";
-
-static const char* uax14AssignmentsCustomNormalNonCJK =
- "$BA_SUB = '';"
- "$EX_SUB = '';"
- "$ID_SUB = '';"
- "$IN_SUB = '';"
- "$IS_SUB = '';"
- "$NS_SUB = '';"
- "$PO_SUB = '';"
- "$PR_SUB = '';"
- "$ID_ADD = [$CJ];"
- "$NS_ADD = '';";
-
-static const char* uax14AssignmentsCustomStrictCJK =
- "$BA_SUB = '';"
- "$EX_SUB = '';"
- "$ID_SUB = '';"
- "$IN_SUB = '';"
- "$IS_SUB = '';"
- "$NS_SUB = '';"
- "$PO_SUB = '';"
- "$PR_SUB = '';"
- "$ID_ADD = '';"
- "$NS_ADD = [$CJ];";
-
-#define uax14AssignmentsCustomStrictNonCJK uax14AssignmentsCustomStrictCJK
-#define uax14AssignmentsCustomDefaultCJK uax14AssignmentsCustomNormalCJK
-#define uax14AssignmentsCustomDefaultNonCJK uax14AssignmentsCustomStrictNonCJK
-
-static const char* uax14AssignmentsAfter =
- "$AI = [:LineBreak = Ambiguous:];"
- "$AL = [:LineBreak = Alphabetic:];"
- "$BA = [[:LineBreak = Break_After:] - $BA_SUB];"
- "$BB = [:LineBreak = Break_Before:];"
- "$BK = [:LineBreak = Mandatory_Break:];"
- "$B2 = [:LineBreak = Break_Both:];"
- "$CB = [:LineBreak = Contingent_Break:];"
- "$CL = [:LineBreak = Close_Punctuation:];"
- "$CM = [:LineBreak = Combining_Mark:];"
- "$CP = [:LineBreak = Close_Parenthesis:];"
- "$CR = [:LineBreak = Carriage_Return:];"
- "$EX = [[:LineBreak = Exclamation:] - $EX_SUB];"
- "$GL = [:LineBreak = Glue:];"
-#if (U_ICU_VERSION_MAJOR_NUM >= 4) && (U_ICU_VERSION_MINOR_NUM >= 9)
- "$HL = [:LineBreak = Hebrew_Letter:];"
-#else
- "$HL = [[:Hebrew:] & [:Letter:]];"
-#endif
- "$HY = [:LineBreak = Hyphen:];"
- "$H2 = [:LineBreak = H2:];"
- "$H3 = [:LineBreak = H3:];"
- "$ID = [[[[:LineBreak = Ideographic:] - $CJ] $ID_ADD] - $ID_SUB];"
- "$IN = [[:LineBreak = Inseparable:] - $IN_SUB];"
- "$IS = [[:LineBreak = Infix_Numeric:] - $IS_SUB];"
- "$JL = [:LineBreak = JL:];"
- "$JV = [:LineBreak = JV:];"
- "$JT = [:LineBreak = JT:];"
- "$LF = [:LineBreak = Line_Feed:];"
- "$NL = [:LineBreak = Next_Line:];"
- "$NS = [[[[:LineBreak = Nonstarter:] - $CJ] $NS_ADD] - $NS_SUB];"
- "$NU = [:LineBreak = Numeric:];"
- "$OP = [:LineBreak = Open_Punctuation:];"
- "$PO = [[:LineBreak = Postfix_Numeric:] - $PO_SUB];"
- "$PR = [[:LineBreak = Prefix_Numeric:] - $PR_SUB];"
- "$QU = [:LineBreak = Quotation:];"
- "$RI = [\\U0001F1E6-\\U0001F1FF];"
- "$SA = [:LineBreak = Complex_Context:];"
- "$SG = [:LineBreak = Surrogate:];"
- "$SP = [:LineBreak = Space:];"
- "$SY = [:LineBreak = Break_Symbols:];"
- "$WJ = [:LineBreak = Word_Joiner:];"
- "$XX = [:LineBreak = Unknown:];"
- "$ZW = [:LineBreak = ZWSpace:];"
- "$ZWJ = \\u200D;"
- "$EmojiVar = \\uFE0F;"
-#if ADDITIONAL_EMOJI_SUPPORT
- "$EmojiForSeqs = [\\u2640 \\u2642 \\u26F9 \\u2764 \\U0001F308 \\U0001F3C3-\\U0001F3C4 \\U0001F3CA-\\U0001F3CC \\U0001F3F3 \\U0001F441 \\U0001F466-\\U0001F469 \\U0001F46E-\\U0001F46F \\U0001F471 \\U0001F473 \\U0001F477 \\U0001F481-\\U0001F482 \\U0001F486-\\U0001F487 \\U0001F48B \\U0001F575 \\U0001F5E8 \\U0001F645-\\U0001F647 \\U0001F64B \\U0001F64D-\\U0001F64E \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\u2695-\\u2696 \\u2708 \\U0001F33E \\U0001F373 \\U0001F393 \\U0001F3A4 \\U0001F3A8 \\U0001F3EB \\U0001F3ED \\U0001F4BB-\\U0001F4BC \\U0001F527 \\U0001F52C \\U0001F680 \\U0001F692 \\U0001F926 \\U0001F937-\\U0001F939 \\U0001F93C-\\U0001F93E];" // Emoji that participate in ZWJ sequences
- "$EmojiForMods = [\\u261D \\u26F9 \\u270A-\\u270D \\U0001F385 \\U0001F3C3-\\U0001F3C4 \\U0001F3CA \\U0001F3CB \\U0001F442-\\U0001F443 \\U0001F446-\\U0001F450 \\U0001F466-\\U0001F478 \\U0001F47C \\U0001F481-\\U0001F483 \\U0001F485-\\U0001F487 \\U0001F4AA \\U0001F575 \\U0001F590 \\U0001F595 \\U0001F596 \\U0001F645-\\U0001F647 \\U0001F64B-\\U0001F64F \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\U0001F6C0 \\U0001F918 \\U0001F3C2 \\U0001F3C7 \\U0001F3CC \\U0001F574 \\U0001F57A \\U0001F6CC \\U0001F919-\\U0001F91E \\U0001F926 \\U0001F930 \\U0001F933-\\U0001F939 \\U0001F93C-\\U0001F93E] ;" // Emoji that take Fitzpatrick modifiers
-#else
- "$EmojiForSeqs = [\\u2764 \\U0001F466-\\U0001F469 \\U0001F48B];"
- "$EmojiForMods = [\\u261D \\u270A-\\u270C \\U0001F385 \\U0001F3C3-\\U0001F3C4 \\U0001F3C7 \\U0001F3CA \\U0001F442-\\U0001F443 \\U0001F446-\\U0001F450 \\U0001F466-\\U0001F469 \\U0001F46E-\\U0001F478 \\U0001F47C \\U0001F481-\\U0001F483 \\U0001F485-\\U0001F487 \\U0001F4AA \\U0001F596 \\U0001F645-\\U0001F647 \\U0001F64B-\\U0001F64F \\U0001F6A3 \\U0001F6B4-\\U0001F6B6 \\U0001F6C0] ;" // Emoji that take Fitzpatrick modifiers
-#endif
- "$EmojiMods = [\\U0001F3FB-\\U0001F3FF];"
- "$dictionary = [:LineBreak = Complex_Context:];"
- "$ALPlus = [$AL $AI $SA $SG $XX];"
- "$ALcm = $ALPlus $CM*;"
- "$BAcm = $BA $CM*;"
- "$BBcm = $BB $CM*;"
- "$B2cm = $B2 $CM*;"
- "$CLcm = $CL $CM*;"
- "$CPcm = $CP $CM*;"
- "$EXcm = $EX $CM*;"
- "$GLcm = $GL $CM*;"
- "$HLcm = $HL $CM*;"
- "$HYcm = $HY $CM*;"
- "$H2cm = $H2 $CM*;"
- "$H3cm = $H3 $CM*;"
- "$IDcm = $ID $CM*;"
- "$INcm = $IN $CM*;"
- "$IScm = $IS $CM*;"
- "$JLcm = $JL $CM*;"
- "$JVcm = $JV $CM*;"
- "$JTcm = $JT $CM*;"
- "$NScm = $NS $CM*;"
- "$NUcm = $NU $CM*;"
- "$OPcm = $OP $CM*;"
- "$POcm = $PO $CM*;"
- "$PRcm = $PR $CM*;"
- "$QUcm = $QU $CM*;"
- "$RIcm = $RI $CM*;"
- "$SYcm = $SY $CM*;"
- "$WJcm = $WJ $CM*;";
-
-static const char* uax14Forward =
- "!!forward;"
- "$CAN_CM = [^$SP $BK $CR $LF $NL $ZW $CM];"
- "$CANT_CM = [$SP $BK $CR $LF $NL $ZW $CM];"
- "$AL_FOLLOW_NOCM = [$BK $CR $LF $NL $ZW $SP];"
- "$AL_FOLLOW_CM = [$CL $CP $EX $HL $IS $SY $WJ $GL $OP $QU $BA $HY $NS $IN $NU $ALPlus];"
- "$AL_FOLLOW = [$AL_FOLLOW_NOCM $AL_FOLLOW_CM];"
- "$LB4Breaks = [$BK $CR $LF $NL];"
- "$LB4NonBreaks = [^$BK $CR $LF $NL];"
- "$LB8Breaks = [$LB4Breaks $ZW];"
- "$LB8NonBreaks = [[$LB4NonBreaks] - [$ZW]];"
- "$LB18NonBreaks = [$LB8NonBreaks - [$SP]];"
- "$LB18Breaks = [$LB8Breaks $SP];"
- "$LB20NonBreaks = [$LB18NonBreaks - $CB];"
- "$ALPlus $CM+;"
- "$BA $CM+;"
- "$BB $CM+;"
- "$B2 $CM+;"
- "$CL $CM+;"
- "$CP $CM+;"
- "$EX $CM+;"
- "$GL $CM+;"
- "$HL $CM+;"
- "$HY $CM+;"
- "$H2 $CM+;"
- "$H3 $CM+;"
- "$ID $CM+;"
- "$IN $CM+;"
- "$IS $CM+;"
- "$JL $CM+;"
- "$JV $CM+;"
- "$JT $CM+;"
- "$NS $CM+;"
- "$NU $CM+;"
- "$OP $CM+;"
- "$PO $CM+;"
- "$PR $CM+;"
- "$QU $CM+;"
- "$RI $CM+;"
- "$SY $CM+;"
- "$WJ $CM+;"
- "$CR $LF {100};"
- "$LB4NonBreaks? $LB4Breaks {100};"
- "$CAN_CM $CM* $LB4Breaks {100};"
- "$CM+ $LB4Breaks {100};"
- "$LB4NonBreaks [$SP $ZW];"
- "$CAN_CM $CM* [$SP $ZW];"
- "$CM+ [$SP $ZW];"
- "$EmojiForSeqs $EmojiVar? $EmojiMods? $ZWJ $EmojiForSeqs;"
- "$CAN_CM $CM+;"
- "$CM+;"
- "$CAN_CM $CM* $WJcm;"
- "$LB8NonBreaks $WJcm;"
- "$CM+ $WJcm;"
- "$WJcm $CANT_CM;"
- "$WJcm $CAN_CM $CM*;"
- "$GLcm $CAN_CM $CM*;"
- "$GLcm $CANT_CM;"
- "[[$LB8NonBreaks] - [$SP $BA $HY]] $CM* $GLcm;"
- "$CM+ GLcm;"
- "$LB8NonBreaks $CL;"
- "$CAN_CM $CM* $CL;"
- "$CM+ $CL;"
- "$LB8NonBreaks $CP;"
- "$CAN_CM $CM* $CP;"
- "$CM+ $CP;"
- "$LB8NonBreaks $EX;"
- "$CAN_CM $CM* $EX;"
- "$CM+ $EX;"
- "$LB8NonBreaks $IS;"
- "$CAN_CM $CM* $IS;"
- "$CM+ $IS;"
- "$LB8NonBreaks $SY;"
- "$CAN_CM $CM* $SY;"
- "$CM+ $SY;"
- "$OPcm $SP* $CAN_CM $CM*;"
- "$OPcm $SP* $CANT_CM;"
- "$OPcm $SP+ $CM+ $AL_FOLLOW?;"
- "$QUcm $SP* $OPcm;"
- "($CLcm | $CPcm) $SP* $NScm;"
- "$B2cm $SP* $B2cm;"
- "$LB18NonBreaks $CM* $QUcm;"
- "$CM+ $QUcm;"
- "$QUcm .?;"
- "$QUcm $LB18NonBreaks $CM*;"
- "$LB20NonBreaks $CM* ($BAcm | $HYcm | $NScm); "
- "$BBcm [^$CB];"
- "$BBcm $LB20NonBreaks $CM*;"
- "$HLcm ($HYcm | $BAcm) [^$CB]?;"
- "$SYcm $HLcm;"
- "($ALcm | $HLcm) $INcm;"
- "$CM+ $INcm;"
- "$EXcm $INcm;"
- "$IDcm $INcm;"
- "$INcm $INcm;"
- "$NUcm $INcm;"
- "$IDcm $POcm;"
- "$ALcm $NUcm;"
- "$HLcm $NUcm;"
- "$CM+ $NUcm;"
- "$NUcm $ALcm;"
- "$NUcm $HLcm;"
- "$PRcm $IDcm;"
- "$PRcm ($ALcm | $HLcm);"
- "$POcm ($ALcm | $HLcm);"
- "($PRcm | $POcm)? ($OPcm | $HYcm)? $NUcm ($NUcm | $SYcm | $IScm)* ($CLcm | $CPcm)? ($PRcm | $POcm)?;"
- "$JLcm ($JLcm | $JVcm | $H2cm | $H3cm);"
- "($JVcm | $H2cm) ($JVcm | $JTcm);"
- "($JTcm | $H3cm) $JTcm;"
- "($JLcm | $JVcm | $JTcm | $H2cm | $H3cm) $INcm;"
- "($JLcm | $JVcm | $JTcm | $H2cm | $H3cm) $POcm;"
- "$PRcm ($JLcm | $JVcm | $JTcm | $H2cm | $H3cm);"
- "($ALcm | $HLcm) ($ALcm | $HLcm);"
- "$CM+ ($ALcm | $HLcm);"
- "$IScm ($ALcm | $HLcm);"
- "($ALcm | $HLcm | $NUcm) $OPcm;"
- "$CM+ $OPcm;"
- "$CPcm ($ALcm | $HLcm | $NUcm);"
-#if ADDITIONAL_EMOJI_SUPPORT
- "$RIcm $RIcm;"
-#endif
- "$EmojiForMods $EmojiVar? $EmojiMods;";
-
-static const char* uax14Reverse =
- "!!reverse;"
- "$CM+ $ALPlus;"
- "$CM+ $BA;"
- "$CM+ $BB;"
- "$CM+ $B2;"
- "$CM+ $CL;"
- "$CM+ $CP;"
- "$CM+ $EX;"
- "$CM+ $GL;"
- "$CM+ $HL;"
- "$CM+ $HY;"
- "$CM+ $H2;"
- "$CM+ $H3;"
- "$CM+ $ID;"
- "$CM+ $IN;"
- "$CM+ $IS;"
- "$CM+ $JL;"
- "$CM+ $JV;"
- "$CM+ $JT;"
- "$CM+ $NS;"
- "$CM+ $NU;"
- "$CM+ $OP;"
- "$CM+ $PO;"
- "$CM+ $PR;"
- "$CM+ $QU;"
-#if ADDITIONAL_EMOJI_SUPPORT
- "$CM+ $RI;"
-#endif
- "$CM+ $SY;"
- "$CM+ $WJ;"
- "$CM+;"
- "$AL_FOLLOW $CM+ / ([$BK $CR $LF $NL $ZW {eof}] | $SP+ $CM+ $SP | $SP+ $CM* ([^$OP $CM $SP] | [$AL {eof}]));"
- "[$PR] / $CM+ [$BK $CR $LF $NL $ZW $SP {eof}];"
- "$LB4Breaks [$LB4NonBreaks-$CM];"
- "$LB4Breaks $CM+ $CAN_CM;"
- "$LF $CR;"
- "[$SP $ZW] [$LB4NonBreaks-$CM];"
- "[$SP $ZW] $CM+ $CAN_CM;"
- "$EmojiForSeqs $ZWJ $EmojiMods? $EmojiVar? $EmojiForSeqs;"
- "$CM+ $CAN_CM;"
- "$CM* $WJ $CM* $CAN_CM;"
- "$CM* $WJ [$LB8NonBreaks-$CM];"
- "$CANT_CM $CM* $WJ;"
- "$CM* $CAN_CM $CM* $WJ;"
- "$CM* $GL $CM* [$LB8NonBreaks-[$CM $SP $BA $HY]];"
- "$CANT_CM $CM* $GL;"
- "$CM* $CAN_CM $CM* $GL;"
- "$CL $CM+ $CAN_CM;"
- "$CP $CM+ $CAN_CM;"
- "$EX $CM+ $CAN_CM;"
- "$IS $CM+ $CAN_CM;"
- "$SY $CM+ $CAN_CM;"
- "$CL [$LB8NonBreaks-$CM];"
- "$CP [$LB8NonBreaks-$CM];"
- "$EX [$LB8NonBreaks-$CM];"
- "$IS [$LB8NonBreaks-$CM];"
- "$SY [$LB8NonBreaks-$CM];"
- "[$CL $CP $EX $IS $SY] $CM+ $SP+ $CM* $OP; "
- "$CM* $CAN_CM $SP* $CM* $OP;"
- "$CANT_CM $SP* $CM* $OP;"
- "$AL_FOLLOW? $CM+ $SP $SP* $CM* $OP;"
- "$AL_FOLLOW_NOCM $CM+ $SP+ $CM* $OP;"
- "$CM* $AL_FOLLOW_CM $CM+ $SP+ $CM* $OP;"
- "$SY $CM $SP+ $OP;"
- "$CM* $OP $SP* $CM* $QU;"
- "$CM* $NS $SP* $CM* ($CL | $CP);"
- "$CM* $B2 $SP* $CM* $B2;"
- "$CM* $QU $CM* $CAN_CM;"
- "$CM* $QU $LB18NonBreaks;"
- "$CM* $CAN_CM $CM* $QU;"
- "$CANT_CM $CM* $QU;"
- "$CM* ($BA | $HY | $NS) $CM* [$LB20NonBreaks-$CM];"
- "$CM* [$LB20NonBreaks-$CM] $CM* $BB;"
- "[^$CB] $CM* $BB;"
- "[^$CB] $CM* ($HY | $BA) $CM* $HL;"
- "$CM* $HL $CM* $SY;"
- "$CM* $IN $CM* ($ALPlus | $HL);"
- "$CM* $IN $CM* $EX;"
- "$CM* $IN $CM* $ID;"
- "$CM* $IN $CM* $IN;"
- "$CM* $IN $CM* $NU;"
- "$CM* $PO $CM* $ID;"
- "$CM* $NU $CM* ($ALPlus | $HL);"
- "$CM* ($ALPlus | $HL) $CM* $NU;"
- "$CM* $ID $CM* $PR;"
- "$CM* ($ALPlus | $HL) $CM* $PR;"
- "$CM* ($ALPlus | $HL) $CM* $PO;"
- "($CM* ($PR | $PO))? ($CM* ($CL | $CP))? ($CM* ($NU | $IS | $SY))* $CM* $NU ($CM* ($OP | $HY))? ($CM* ($PR | $PO))?;"
- "$CM* ($H3 | $H2 | $JV | $JL) $CM* $JL;"
- "$CM* ($JT | $JV) $CM* ($H2 | $JV);"
- "$CM* $JT $CM* ($H3 | $JT);"
- "$CM* $IN $CM* ($H3 | $H2 | $JT | $JV | $JL);"
- "$CM* $PO $CM* ($H3 | $H2 | $JT | $JV | $JL);"
- "$CM* ($H3 | $H2 | $JT | $JV | $JL) $CM* $PR;"
- "$CM* ($ALPlus | $HL) $CM* ($ALPlus | $HL);"
- "$CM* ($ALPlus | $HL) $CM* $IS;"
- "$CM* $OP $CM* ($ALPlus | $HL | $NU);"
- "$CM* ($ALPlus | $HL | $NU) $CM* $CP;"
-#if ADDITIONAL_EMOJI_SUPPORT
- "$CM* $RI $CM* $RI;"
-#endif
- "$EmojiMods $EmojiVar? $EmojiForMods;";
-
-static const char* uax14SafeForward =
- "!!safe_forward;"
- "[$CM $OP $QU $CL $CP $B2 $PR $HY $BA $SP $dictionary]+ [^$CM $OP $QU $CL $CP $B2 $PR $HY $BA $dictionary];"
- "$dictionary $dictionary;";
-
-static const char* uax14SafeReverse =
- "!!safe_reverse;"
- "$CM+ [^$CM $BK $CR $LF $NL $ZW $SP];"
- "$CM+ $SP / .;"
- "$SP+ $CM* $OP;"
- "$SP+ $CM* $QU;"
- "$SP+ $CM* ($CL | $CP);"
- "$SP+ $CM* $B2;"
- "$CM* ($HY | $BA) $CM* $HL;"
- "($CM* ($IS | $SY))+ $CM* $NU;"
- "($CL | $CP) $CM* ($NU | $IS | $SY);"
- "$dictionary $dictionary;";
-
-static String mapLineIteratorModeToRules(LineBreakIteratorMode mode, bool isCJK)
</del><ins>+UBreakIterator* openLineBreakIterator(const AtomicString& locale)
</ins><span class="cx"> {
</span><del>- StringBuilder rulesBuilder;
- rulesBuilder.append(uax14Prologue);
- rulesBuilder.append(uax14AssignmentsBefore);
- switch (mode) {
- case LineBreakIteratorMode::Default:
- rulesBuilder.append(isCJK ? uax14AssignmentsCustomDefaultCJK : uax14AssignmentsCustomDefaultNonCJK);
- break;
- case LineBreakIteratorMode::Loose:
- rulesBuilder.append(isCJK ? uax14AssignmentsCustomLooseCJK : uax14AssignmentsCustomLooseNonCJK);
- break;
- case LineBreakIteratorMode::Normal:
- rulesBuilder.append(isCJK ? uax14AssignmentsCustomNormalCJK : uax14AssignmentsCustomNormalNonCJK);
- break;
- case LineBreakIteratorMode::Strict:
- rulesBuilder.append(isCJK ? uax14AssignmentsCustomStrictCJK : uax14AssignmentsCustomStrictNonCJK);
- break;
- }
- rulesBuilder.append(uax14AssignmentsAfter);
- rulesBuilder.append(uax14Forward);
- rulesBuilder.append(uax14Reverse);
- rulesBuilder.append(uax14SafeForward);
- rulesBuilder.append(uax14SafeReverse);
- return rulesBuilder.toString();
-}
-
-// Recognize BCP47 compliant primary language values of 'zh', 'ja', 'ko'
-// (in any combination of case), optionally followed by subtags. Don't
-// recognize 3-letter variants 'chi'/'zho', 'jpn', or 'kor' since BCP47
-// requires use of shortest language tag.
-bool isCJKLocale(const AtomicString& locale)
-{
- size_t length = locale.length();
- if (length < 2)
- return false;
- auto c1 = locale[0];
- auto c2 = locale[1];
- auto c3 = length == 2 ? 0 : locale[2];
- if (!c3 || c3 == '-' || c3 == '_' || c3 == '@') {
- if (c1 == 'z' || c1 == 'Z')
- return c2 == 'h' || c2 == 'H';
- if (c1 == 'j' || c1 == 'J')
- return c2 == 'a' || c2 == 'A';
- if (c1 == 'k' || c1 == 'K')
- return c2 == 'o' || c2 == 'O';
- }
- return false;
-}
-
-UBreakIterator* openLineBreakIterator(const AtomicString& locale, LineBreakIteratorMode mode, bool isCJK)
-{
- UBreakIterator* ubrkIter;
</del><ins>+ bool localeIsEmpty = locale.isEmpty();
</ins><span class="cx"> UErrorCode openStatus = U_ZERO_ERROR;
</span><del>- bool localeIsEmpty = locale.isEmpty();
- if (mode == LineBreakIteratorMode::Default)
- ubrkIter = ubrk_open(UBRK_LINE, localeIsEmpty ? currentTextBreakLocaleID() : locale.string().utf8().data(), 0, 0, &openStatus);
- else {
- UParseError parseStatus;
- auto rules = mapLineIteratorModeToRules(mode, isCJK);
- ubrkIter = ubrk_openRules(StringView(rules).upconvertedCharacters(), rules.length(), 0, 0, &parseStatus, &openStatus);
- }
</del><ins>+ UBreakIterator* ubrkIter = ubrk_open(UBRK_LINE, localeIsEmpty ? currentTextBreakLocaleID() : locale.string().utf8().data(), 0, 0, &openStatus);
</ins><span class="cx"> // locale comes from a web page and it can be invalid, leading ICU
</span><span class="cx"> // to fail, in which case we fall back to the default locale.
</span><span class="cx"> if (!localeIsEmpty && U_FAILURE(openStatus)) {
</span></span></pre></div>
<a id="trunkSourceWTFwtftextTextBreakIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/TextBreakIterator.h (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/TextBreakIterator.h        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Source/WTF/wtf/text/TextBreakIterator.h        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -38,15 +38,13 @@
</span><span class="cx"> WTF_EXPORT_PRIVATE UBreakIterator* wordBreakIterator(StringView);
</span><span class="cx"> WTF_EXPORT_PRIVATE UBreakIterator* sentenceBreakIterator(StringView);
</span><span class="cx">
</span><del>-WTF_EXPORT_PRIVATE UBreakIterator* acquireLineBreakIterator(StringView, const AtomicString& locale, const UChar* priorContext, unsigned priorContextLength, LineBreakIteratorMode, bool isCJK);
</del><ins>+WTF_EXPORT_PRIVATE UBreakIterator* acquireLineBreakIterator(StringView, const AtomicString& locale, const UChar* priorContext, unsigned priorContextLength, LineBreakIteratorMode);
</ins><span class="cx"> WTF_EXPORT_PRIVATE void releaseLineBreakIterator(UBreakIterator*);
</span><del>-UBreakIterator* openLineBreakIterator(const AtomicString& locale, LineBreakIteratorMode, bool isCJK);
</del><ins>+UBreakIterator* openLineBreakIterator(const AtomicString& locale);
</ins><span class="cx"> void closeLineBreakIterator(UBreakIterator*&);
</span><span class="cx">
</span><span class="cx"> WTF_EXPORT_PRIVATE bool isWordTextBreak(UBreakIterator*);
</span><span class="cx">
</span><del>-WTF_EXPORT_PRIVATE bool isCJKLocale(const AtomicString&);
-
</del><span class="cx"> class LazyLineBreakIterator {
</span><span class="cx"> public:
</span><span class="cx"> LazyLineBreakIterator()
</span><span class="lines">@@ -58,7 +56,6 @@
</span><span class="cx"> : m_stringView(stringView)
</span><span class="cx"> , m_locale(locale)
</span><span class="cx"> , m_mode(mode)
</span><del>- , m_isCJK(isCJKLocale(locale))
</del><span class="cx"> {
</span><span class="cx"> resetPriorContext();
</span><span class="cx"> }
</span><span class="lines">@@ -70,7 +67,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> StringView stringView() const { return m_stringView; }
</span><del>- bool isLooseCJKMode() const { return m_isCJK && m_mode == LineBreakIteratorMode::Loose; }
</del><ins>+ LineBreakIteratorMode mode() const { return m_mode; }
</ins><span class="cx">
</span><span class="cx"> UChar lastCharacter() const
</span><span class="cx"> {
</span><span class="lines">@@ -125,7 +122,7 @@
</span><span class="cx"> ASSERT(priorContextLength <= priorContextCapacity);
</span><span class="cx"> const UChar* priorContext = priorContextLength ? &m_priorContext[priorContextCapacity - priorContextLength] : 0;
</span><span class="cx"> if (!m_iterator) {
</span><del>- m_iterator = acquireLineBreakIterator(m_stringView, m_locale, priorContext, priorContextLength, m_mode, m_isCJK);
</del><ins>+ m_iterator = acquireLineBreakIterator(m_stringView, m_locale, priorContext, priorContextLength, m_mode);
</ins><span class="cx"> m_cachedPriorContext = priorContext;
</span><span class="cx"> m_cachedPriorContextLength = priorContextLength;
</span><span class="cx"> } else if (priorContext != m_cachedPriorContext || priorContextLength != m_cachedPriorContextLength) {
</span><span class="lines">@@ -144,7 +141,6 @@
</span><span class="cx"> m_iterator = nullptr;
</span><span class="cx"> m_cachedPriorContext = nullptr;
</span><span class="cx"> m_mode = mode;
</span><del>- m_isCJK = isCJKLocale(locale);
</del><span class="cx"> m_cachedPriorContextLength = 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -157,7 +153,6 @@
</span><span class="cx"> LineBreakIteratorMode m_mode { LineBreakIteratorMode::Default };
</span><span class="cx"> unsigned m_cachedPriorContextLength { 0 };
</span><span class="cx"> UChar m_priorContext[priorContextCapacity];
</span><del>- bool m_isCJK { false };
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // Iterates over "extended grapheme clusters", as defined in UAX #29.
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Source/WebCore/ChangeLog        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2017-02-13 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Update custom line breaking iterators to the latest version of Unicode
+ https://bugs.webkit.org/show_bug.cgi?id=168182
+
+ Reviewed by Zalan Bujtas.
+
+ Clean up our breaking code to be more descriptive about the difference between
+ line-break: auto vs line-break: loose | normal | strict. The only difference is
+ that we have some hardcoded tables to speed up character iteration for
+ line-break: auto.
+
+ Tests: TestWebKitAPI WebKit2.LineBreaking
+
+ * rendering/BreakLines.h:
+ (WebCore::nextBreakablePosition):
+ (WebCore::nextBreakablePositionIgnoringNBSP):
+ (WebCore::nextBreakablePositionWithoutShortcut):
+ (WebCore::nextBreakablePositionIgnoringNBSPWithoutShortcut):
+ (WebCore::isBreakable):
+ (WebCore::nextBreakablePositionNonLoosely): Deleted.
+ (WebCore::nextBreakablePositionLoosely): Deleted.
+ (WebCore::nextBreakablePositionLoose): Deleted.
+ (WebCore::nextBreakablePositionIgnoringNBSPLoose): Deleted.
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::computePreferredLogicalWidths):
+ * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
+ (WebCore::SimpleLineLayout::nextBreakablePositionInSegment):
+ * rendering/line/BreakingContext.h:
+ (WebCore::BreakingContext::handleText):
+ (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
+
</ins><span class="cx"> 2017-02-13 Youenn Fablet <youenn@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove @getUserMedia identifier
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingBreakLinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/BreakLines.h (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/BreakLines.h        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Source/WebCore/rendering/BreakLines.h        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -40,6 +40,11 @@
</span><span class="cx"> TreatNonBreakingSpaceAsBreak,
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+enum class CanUseShortcut {
+ Yes,
+ No
+};
+
</ins><span class="cx"> template<NonBreakingSpaceBehavior nonBreakingSpaceBehavior>
</span><span class="cx"> static inline bool isBreakableSpace(UChar character)
</span><span class="cx"> {
</span><span class="lines">@@ -82,8 +87,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // When in non-loose mode, we can use the ASCII shortcut table.
</span><del>-template<typename CharacterType, NonBreakingSpaceBehavior nonBreakingSpaceBehavior>
-inline unsigned nextBreakablePositionNonLoosely(LazyLineBreakIterator& lazyBreakIterator, const CharacterType* string, unsigned length, unsigned startPosition)
</del><ins>+template<typename CharacterType, NonBreakingSpaceBehavior nonBreakingSpaceBehavior, CanUseShortcut canUseShortcut>
+inline unsigned nextBreakablePosition(LazyLineBreakIterator& lazyBreakIterator, const CharacterType* string, unsigned length, unsigned startPosition)
</ins><span class="cx"> {
</span><span class="cx"> std::optional<unsigned> nextBreak;
</span><span class="cx">
</span><span class="lines">@@ -93,12 +98,10 @@
</span><span class="cx"> for (unsigned i = startPosition; i < length; i++) {
</span><span class="cx"> CharacterType character = string[i];
</span><span class="cx">
</span><del>- // Non-loose mode, so use ASCII shortcut (shouldBreakAfter) if not breakable space.
- if (isBreakableSpace<nonBreakingSpaceBehavior>(character) || shouldBreakAfter(lastLastCharacter, lastCharacter, character))
</del><ins>+ if (isBreakableSpace<nonBreakingSpaceBehavior>(character) || (canUseShortcut == CanUseShortcut::Yes && shouldBreakAfter(lastLastCharacter, lastCharacter, character)))
</ins><span class="cx"> return i;
</span><span class="cx">
</span><del>- // Non-loose mode, so conditionally use break iterator.
- if (needsLineBreakIterator<nonBreakingSpaceBehavior>(character) || needsLineBreakIterator<nonBreakingSpaceBehavior>(lastCharacter)) {
</del><ins>+ if (canUseShortcut == CanUseShortcut::No || needsLineBreakIterator<nonBreakingSpaceBehavior>(character) || needsLineBreakIterator<nonBreakingSpaceBehavior>(lastCharacter)) {
</ins><span class="cx"> if (!nextBreak || nextBreak.value() < i) {
</span><span class="cx"> // Don't break if positioned at start of primary context and there is no prior context.
</span><span class="cx"> if (i || priorContextLength) {
</span><span class="lines">@@ -126,51 +129,7 @@
</span><span class="cx"> return length;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// When in loose mode, we can't use the ASCII shortcut table since loose mode allows "$100" to break after '$' in content marked as CJK.
-// N.B. It should be possible to combine the following with the non-loose version above by adding a LooseBehavior template parameter;
-// however, when doing this, a 10% performance regression appeared on chromium-win (https://bugs.webkit.org/show_bug.cgi?id=89235#c112).
</del><span class="cx"> template<typename CharacterType, NonBreakingSpaceBehavior nonBreakingSpaceBehavior>
</span><del>-static inline unsigned nextBreakablePositionLoosely(LazyLineBreakIterator& lazyBreakIterator, const CharacterType* string, unsigned length, unsigned startPosition)
-{
- std::optional<unsigned> nextBreak;
-
- CharacterType lastCharacter = startPosition > 0 ? string[startPosition - 1] : static_cast<CharacterType>(lazyBreakIterator.lastCharacter());
- unsigned priorContextLength = lazyBreakIterator.priorContextLength();
- for (unsigned i = startPosition; i < length; i++) {
- CharacterType character = string[i];
-
- // Always loose mode, so don't use ASCII shortcut (shouldBreakAfter).
- if (isBreakableSpace<nonBreakingSpaceBehavior>(character))
- return i;
-
- // Always use line break iterator in loose mode.
- if (!nextBreak || nextBreak.value() < i) {
- // Don't break if positioned at start of primary context and there is no prior context.
- if (i || priorContextLength) {
- UBreakIterator* breakIterator = lazyBreakIterator.get(priorContextLength);
- if (breakIterator) {
- ASSERT(i + priorContextLength >= 1);
- int candidate = ubrk_following(breakIterator, i + priorContextLength - 1);
- if (candidate == UBRK_DONE)
- nextBreak = std::nullopt;
- else {
- unsigned result = candidate;
- ASSERT(result > priorContextLength);
- nextBreak = result - priorContextLength;
- }
- }
- }
- }
- if (i == nextBreak && !isBreakableSpace<nonBreakingSpaceBehavior>(lastCharacter))
- return i;
-
- lastCharacter = character;
- }
-
- return length;
-}
-
-template<typename CharacterType, NonBreakingSpaceBehavior nonBreakingSpaceBehavior>
</del><span class="cx"> inline unsigned nextBreakablePositionKeepingAllWords(const CharacterType* string, unsigned length, unsigned startPosition)
</span><span class="cx"> {
</span><span class="cx"> for (unsigned i = startPosition; i < length; i++) {
</span><span class="lines">@@ -200,8 +159,8 @@
</span><span class="cx"> {
</span><span class="cx"> auto stringView = iterator.stringView();
</span><span class="cx"> if (stringView.is8Bit())
</span><del>- return nextBreakablePositionNonLoosely<LChar, NonBreakingSpaceBehavior::TreatNonBreakingSpaceAsBreak>(iterator, stringView.characters8(), stringView.length(), startPosition);
- return nextBreakablePositionNonLoosely<UChar, NonBreakingSpaceBehavior::TreatNonBreakingSpaceAsBreak>(iterator, stringView.characters16(), stringView.length(), startPosition);
</del><ins>+ return nextBreakablePosition<LChar, NonBreakingSpaceBehavior::TreatNonBreakingSpaceAsBreak, CanUseShortcut::Yes>(iterator, stringView.characters8(), stringView.length(), startPosition);
+ return nextBreakablePosition<UChar, NonBreakingSpaceBehavior::TreatNonBreakingSpaceAsBreak, CanUseShortcut::Yes>(iterator, stringView.characters16(), stringView.length(), startPosition);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline unsigned nextBreakablePositionIgnoringNBSP(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition)
</span><span class="lines">@@ -208,27 +167,27 @@
</span><span class="cx"> {
</span><span class="cx"> auto stringView = lazyBreakIterator.stringView();
</span><span class="cx"> if (stringView.is8Bit())
</span><del>- return nextBreakablePositionNonLoosely<LChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace>(lazyBreakIterator, stringView.characters8(), stringView.length(), startPosition);
- return nextBreakablePositionNonLoosely<UChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace>(lazyBreakIterator, stringView.characters16(), stringView.length(), startPosition);
</del><ins>+ return nextBreakablePosition<LChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace, CanUseShortcut::Yes>(lazyBreakIterator, stringView.characters8(), stringView.length(), startPosition);
+ return nextBreakablePosition<UChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace, CanUseShortcut::Yes>(lazyBreakIterator, stringView.characters16(), stringView.length(), startPosition);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-inline unsigned nextBreakablePositionLoose(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition)
</del><ins>+inline unsigned nextBreakablePositionWithoutShortcut(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition)
</ins><span class="cx"> {
</span><span class="cx"> auto stringView = lazyBreakIterator.stringView();
</span><span class="cx"> if (stringView.is8Bit())
</span><del>- return nextBreakablePositionLoosely<LChar, NonBreakingSpaceBehavior::TreatNonBreakingSpaceAsBreak>(lazyBreakIterator, stringView.characters8(), stringView.length(), startPosition);
- return nextBreakablePositionLoosely<UChar, NonBreakingSpaceBehavior::TreatNonBreakingSpaceAsBreak>(lazyBreakIterator, stringView.characters16(), stringView.length(), startPosition);
</del><ins>+ return nextBreakablePosition<LChar, NonBreakingSpaceBehavior::TreatNonBreakingSpaceAsBreak, CanUseShortcut::No>(lazyBreakIterator, stringView.characters8(), stringView.length(), startPosition);
+ return nextBreakablePosition<UChar, NonBreakingSpaceBehavior::TreatNonBreakingSpaceAsBreak, CanUseShortcut::No>(lazyBreakIterator, stringView.characters16(), stringView.length(), startPosition);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-inline unsigned nextBreakablePositionIgnoringNBSPLoose(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition)
</del><ins>+inline unsigned nextBreakablePositionIgnoringNBSPWithoutShortcut(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition)
</ins><span class="cx"> {
</span><span class="cx"> auto stringView = lazyBreakIterator.stringView();
</span><span class="cx"> if (stringView.is8Bit())
</span><del>- return nextBreakablePositionLoosely<LChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace>(lazyBreakIterator, stringView.characters8(), stringView.length(), startPosition);
- return nextBreakablePositionLoosely<UChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace>(lazyBreakIterator, stringView.characters16(), stringView.length(), startPosition);
</del><ins>+ return nextBreakablePosition<LChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace, CanUseShortcut::No>(lazyBreakIterator, stringView.characters8(), stringView.length(), startPosition);
+ return nextBreakablePosition<UChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace, CanUseShortcut::No>(lazyBreakIterator, stringView.characters16(), stringView.length(), startPosition);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-inline bool isBreakable(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition, std::optional<unsigned>& nextBreakable, bool breakNBSP, bool isLooseMode, bool keepAllWords)
</del><ins>+inline bool isBreakable(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition, std::optional<unsigned>& nextBreakable, bool breakNBSP, bool canUseShortcut, bool keepAllWords)
</ins><span class="cx"> {
</span><span class="cx"> if (nextBreakable && nextBreakable.value() >= startPosition)
</span><span class="cx"> return startPosition == nextBreakable;
</span><span class="lines">@@ -238,11 +197,11 @@
</span><span class="cx"> nextBreakable = nextBreakablePositionKeepingAllWords(lazyBreakIterator, startPosition);
</span><span class="cx"> else
</span><span class="cx"> nextBreakable = nextBreakablePositionKeepingAllWordsIgnoringNBSP(lazyBreakIterator, startPosition);
</span><del>- } else if (isLooseMode) {
</del><ins>+ } else if (!canUseShortcut) {
</ins><span class="cx"> if (breakNBSP)
</span><del>- nextBreakable = nextBreakablePositionLoose(lazyBreakIterator, startPosition);
</del><ins>+ nextBreakable = nextBreakablePositionWithoutShortcut(lazyBreakIterator, startPosition);
</ins><span class="cx"> else
</span><del>- nextBreakable = nextBreakablePositionIgnoringNBSPLoose(lazyBreakIterator, startPosition);
</del><ins>+ nextBreakable = nextBreakablePositionIgnoringNBSPWithoutShortcut(lazyBreakIterator, startPosition);
</ins><span class="cx"> } else {
</span><span class="cx"> if (breakNBSP)
</span><span class="cx"> nextBreakable = nextBreakablePosition(lazyBreakIterator, startPosition);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.cpp (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.cpp        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Source/WebCore/rendering/RenderText.cpp        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -797,7 +797,8 @@
</span><span class="cx"> const FontCascade& font = style.fontCascade(); // FIXME: This ignores first-line.
</span><span class="cx"> float wordSpacing = font.wordSpacing();
</span><span class="cx"> unsigned len = textLength();
</span><del>- LazyLineBreakIterator breakIterator(m_text, style.locale(), mapLineBreakToIteratorMode(style.lineBreak()));
</del><ins>+ auto iteratorMode = mapLineBreakToIteratorMode(style.lineBreak());
+ LazyLineBreakIterator breakIterator(m_text, style.locale(), iteratorMode);
</ins><span class="cx"> bool needsWordSpacing = false;
</span><span class="cx"> bool ignoringSpaces = false;
</span><span class="cx"> bool isSpace = false;
</span><span class="lines">@@ -834,7 +835,7 @@
</span><span class="cx"> // word-break, but we support it as though it means break-all.
</span><span class="cx"> bool breakAll = (style.wordBreak() == BreakAllWordBreak || style.wordBreak() == BreakWordBreak) && style.autoWrap();
</span><span class="cx"> bool keepAllWords = style.wordBreak() == KeepAllWordBreak;
</span><del>- bool isLooseCJKMode = breakIterator.isLooseCJKMode();
</del><ins>+ bool canUseLineBreakShortcut = iteratorMode == LineBreakIteratorMode::Default;
</ins><span class="cx">
</span><span class="cx"> for (unsigned i = 0; i < len; i++) {
</span><span class="cx"> UChar c = uncheckedCharacterAt(i);
</span><span class="lines">@@ -880,7 +881,7 @@
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- bool hasBreak = breakAll || isBreakable(breakIterator, i, nextBreakable, breakNBSP, isLooseCJKMode, keepAllWords);
</del><ins>+ bool hasBreak = breakAll || isBreakable(breakIterator, i, nextBreakable, breakNBSP, canUseLineBreakShortcut, keepAllWords);
</ins><span class="cx"> bool betweenWords = true;
</span><span class="cx"> unsigned j = i;
</span><span class="cx"> while (c != '\n' && !isSpaceAccordingToStyle(c, style) && c != '\t' && (c != softHyphen || style.hyphens() == HyphensNone)) {
</span><span class="lines">@@ -888,7 +889,7 @@
</span><span class="cx"> if (j == len)
</span><span class="cx"> break;
</span><span class="cx"> c = uncheckedCharacterAt(j);
</span><del>- if (isBreakable(breakIterator, j, nextBreakable, breakNBSP, isLooseCJKMode, keepAllWords) && characterAt(j - 1) != softHyphen)
</del><ins>+ if (isBreakable(breakIterator, j, nextBreakable, breakNBSP, canUseLineBreakShortcut, keepAllWords) && characterAt(j - 1) != softHyphen)
</ins><span class="cx"> break;
</span><span class="cx"> if (breakAll) {
</span><span class="cx"> betweenWords = false;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingSimpleLineLayoutTextFragmentIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -127,15 +127,15 @@
</span><span class="cx"> return nextBreakablePositionKeepingAllWordsIgnoringNBSP(lineBreakIterator, startPosition);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (lineBreakIterator.isLooseCJKMode()) {
</del><ins>+ if (lineBreakIterator.mode() == LineBreakIteratorMode::Default) {
</ins><span class="cx"> if (breakNBSP)
</span><del>- return nextBreakablePositionLoose(lineBreakIterator, startPosition);
- return nextBreakablePositionIgnoringNBSPLoose(lineBreakIterator, startPosition);
</del><ins>+ return WebCore::nextBreakablePosition(lineBreakIterator, startPosition);
+ return nextBreakablePositionIgnoringNBSP(lineBreakIterator, startPosition);
</ins><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> if (breakNBSP)
</span><del>- return WebCore::nextBreakablePosition(lineBreakIterator, startPosition);
- return nextBreakablePositionIgnoringNBSP(lineBreakIterator, startPosition);
</del><ins>+ return nextBreakablePositionWithoutShortcut(lineBreakIterator, startPosition);
+ return nextBreakablePositionIgnoringNBSPWithoutShortcut(lineBreakIterator, startPosition);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> unsigned TextFragmentIterator::nextBreakablePosition(const FlowContents::Segment& segment, unsigned startPosition)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderinglineBreakingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/line/BreakingContext.h (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/line/BreakingContext.h        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Source/WebCore/rendering/line/BreakingContext.h        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -804,7 +804,8 @@
</span><span class="cx"> bool breakAll = m_currentStyle->wordBreak() == BreakAllWordBreak && m_autoWrap;
</span><span class="cx"> bool keepAllWords = m_currentStyle->wordBreak() == KeepAllWordBreak;
</span><span class="cx"> float hyphenWidth = 0;
</span><del>- bool isLooseCJKMode = false;
</del><ins>+ auto iteratorMode = mapLineBreakToIteratorMode(m_blockStyle.lineBreak());
+ bool canUseLineBreakShortcut = iteratorMode == LineBreakIteratorMode::Default;
</ins><span class="cx"> bool isLineEmpty = m_lineInfo.isEmpty();
</span><span class="cx">
</span><span class="cx"> if (isSVGText) {
</span><span class="lines">@@ -817,8 +818,7 @@
</span><span class="cx"> m_renderTextInfo.text = &renderText;
</span><span class="cx"> m_renderTextInfo.font = &font;
</span><span class="cx"> m_renderTextInfo.layout = font.createLayout(renderText, m_width.currentWidth(), m_collapseWhiteSpace);
</span><del>- m_renderTextInfo.lineBreakIterator.resetStringAndReleaseIterator(renderText.text(), style.locale(), mapLineBreakToIteratorMode(m_blockStyle.lineBreak()));
- isLooseCJKMode = m_renderTextInfo.lineBreakIterator.isLooseCJKMode();
</del><ins>+ m_renderTextInfo.lineBreakIterator.resetStringAndReleaseIterator(renderText.text(), style.locale(), iteratorMode);
</ins><span class="cx"> } else if (m_renderTextInfo.layout && m_renderTextInfo.font != &font) {
</span><span class="cx"> m_renderTextInfo.font = &font;
</span><span class="cx"> m_renderTextInfo.layout = font.createLayout(renderText, m_width.currentWidth(), m_collapseWhiteSpace);
</span><span class="lines">@@ -869,7 +869,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::optional<unsigned> nextBreakablePosition = m_current.nextBreakablePosition();
</span><del>- bool betweenWords = c == '\n' || (m_currWS != PRE && !m_atStart && isBreakable(m_renderTextInfo.lineBreakIterator, m_current.offset(), nextBreakablePosition, breakNBSP, isLooseCJKMode, keepAllWords)
</del><ins>+ bool betweenWords = c == '\n' || (m_currWS != PRE && !m_atStart && isBreakable(m_renderTextInfo.lineBreakIterator, m_current.offset(), nextBreakablePosition, breakNBSP, canUseLineBreakShortcut, keepAllWords)
</ins><span class="cx"> && (style.hyphens() != HyphensNone || (m_current.previousInSameNode() != softHyphen)));
</span><span class="cx"> m_current.setNextBreakablePosition(nextBreakablePosition);
</span><span class="cx">
</span><span class="lines">@@ -1332,10 +1332,10 @@
</span><span class="cx"> // Don't even bother measuring if our remaining line has many characters
</span><span class="cx"> if (renderText.textLength() == lineBreak.offset() || renderText.textLength() - lineBreak.offset() > longTrailingWordLength)
</span><span class="cx"> return lineBreak;
</span><del>- bool isLooseCJKMode = m_renderTextInfo.text != &renderText && m_renderTextInfo.lineBreakIterator.isLooseCJKMode();
</del><ins>+ bool canUseLineBreakShortcut = m_renderTextInfo.lineBreakIterator.mode() == LineBreakIteratorMode::Default;
</ins><span class="cx"> bool breakNBSP = m_autoWrap && m_currentStyle->nbspMode() == SPACE;
</span><span class="cx"> std::optional<unsigned> nextBreakablePosition = lineBreak.nextBreakablePosition();
</span><del>- isBreakable(m_renderTextInfo.lineBreakIterator, lineBreak.offset() + 1, nextBreakablePosition, breakNBSP, isLooseCJKMode, m_currentStyle->wordBreak() == KeepAllWordBreak);
</del><ins>+ isBreakable(m_renderTextInfo.lineBreakIterator, lineBreak.offset() + 1, nextBreakablePosition, breakNBSP, canUseLineBreakShortcut, m_currentStyle->wordBreak() == KeepAllWordBreak);
</ins><span class="cx"> if (!nextBreakablePosition || nextBreakablePosition.value() != renderText.textLength())
</span><span class="cx"> return lineBreak;
</span><span class="cx"> const RenderStyle& style = lineStyle(renderText, m_lineInfo);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Tools/ChangeLog        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-02-13 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Update custom line breaking iterators to the latest version of Unicode
+ https://bugs.webkit.org/show_bug.cgi?id=168182
+
+ Reviewed by Zalan Bujtas.
+
+ Treat the system's ICU as the source of truth to compare breaking positions against.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebCore/LineBreaking.mm: Added.
+ (generateJavaScriptForTest):
+ (breakingLocationsFromICU):
+ (testAFewStrings):
+ (TEST):
+ * TestWebKitAPI/Tests/WebKit2Cocoa/AllAhem.svg: Renamed from LayoutTests/css3/line-break/resources/AllAhem.svg.
+ * TestWebKitAPI/Tests/WebKit2Cocoa/LineBreaking.html: Added.
+
</ins><span class="cx"> 2017-02-12 Michael Catanzaro <mcatanzaro@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Several failing WebViewEditor API tests
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (212234 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-02-13 18:58:32 UTC (rev 212234)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -506,6 +506,9 @@
</span><span class="cx">                 C0ADBE9612FCA79B00D2C129 /* simple-form.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C0ADBE8412FCA6B600D2C129 /* simple-form.html */; };
</span><span class="cx">                 C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */; };
</span><span class="cx">                 C0C5D3C61459912900A802A6 /* GetBackingScaleFactor_Bundle.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */; };
</span><ins>+                C25CCA061E51380B0026CB8A /* LineBreaking.mm in Sources */ = {isa = PBXBuildFile; fileRef = C25CCA051E51380B0026CB8A /* LineBreaking.mm */; };
+                C25CCA0B1E5140C10026CB8A /* LineBreaking.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C25CCA0A1E513F490026CB8A /* LineBreaking.html */; };
+                C25CCA0D1E5141840026CB8A /* AllAhem.svg in Copy Resources */ = {isa = PBXBuildFile; fileRef = C25CCA0C1E5140E50026CB8A /* AllAhem.svg */; };
</ins><span class="cx">                 C2CF975A16CEC7140054E99D /* JSContextBackForwardCache2.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C2CF975916CEC69E0054E99D /* JSContextBackForwardCache2.html */; };
</span><span class="cx">                 C2CF975B16CEC71B0054E99D /* JSContextBackForwardCache1.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C2CF975816CEC69E0054E99D /* JSContextBackForwardCache1.html */; };
</span><span class="cx">                 C5101C4F176B8D9200EE9B15 /* findRanges.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C5101C4E176B8BB900EE9B15 /* findRanges.html */; };
</span><span class="lines">@@ -625,6 +628,8 @@
</span><span class="cx">                         dstPath = TestWebKitAPI.resources;
</span><span class="cx">                         dstSubfolderSpec = 7;
</span><span class="cx">                         files = (
</span><ins>+                                C25CCA0D1E5141840026CB8A /* AllAhem.svg in Copy Resources */,
+                                C25CCA0B1E5140C10026CB8A /* LineBreaking.html in Copy Resources */,
</ins><span class="cx">                                 F47728991E4AE3C1007ABF6A /* full-page-contenteditable.html in Copy Resources */,
</span><span class="cx">                                 C99B675F1E39736F00FC6C80 /* no-autoplay-with-controls.html in Copy Resources */,
</span><span class="cx">                                 C99B675D1E39722000FC6C80 /* js-play-with-controls.html in Copy Resources */,
</span><span class="lines">@@ -1099,7 +1104,7 @@
</span><span class="cx">                 7C83E0261D0A5B8D00FEBCF3 /* TestWTF.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = TestWTF.xcconfig; sourceTree = "<group>"; };
</span><span class="cx">                 7C83E0271D0A5B8D00FEBCF3 /* TestWTFLibrary.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = TestWTFLibrary.xcconfig; sourceTree = "<group>"; };
</span><span class="cx">                 7C83E0291D0A5CDF00FEBCF3 /* libWTF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libWTF.a; path = ../../../../../Builds/Debug/libWTF.a; sourceTree = "<group>"; };
</span><del>-                7C83E0331D0A5F2700FEBCF3 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; };
</del><ins>+                7C83E0331D0A5F2700FEBCF3 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = SDKROOT; };
</ins><span class="cx">                 7C83E0361D0A5F7000FEBCF3 /* Utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utilities.h; sourceTree = "<group>"; };
</span><span class="cx">                 7C83E0391D0A602700FEBCF3 /* UtilitiesCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = UtilitiesCocoa.mm; path = cocoa/UtilitiesCocoa.mm; sourceTree = "<group>"; };
</span><span class="cx">                 7C882E031C80C624006BF731 /* UserContentWorld.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UserContentWorld.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -1293,6 +1298,9 @@
</span><span class="cx">                 C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly_Bundle.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 C0C5D3BC14598B6F00A802A6 /* GetBackingScaleFactor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GetBackingScaleFactor.mm; sourceTree = "<group>"; };
</span><span class="cx">                 C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GetBackingScaleFactor_Bundle.mm; sourceTree = "<group>"; };
</span><ins>+                C25CCA051E51380B0026CB8A /* LineBreaking.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LineBreaking.mm; path = ../WebCore/LineBreaking.mm; sourceTree = "<group>"; };
+                C25CCA0A1E513F490026CB8A /* LineBreaking.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = LineBreaking.html; sourceTree = "<group>"; };
+                C25CCA0C1E5140E50026CB8A /* AllAhem.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AllAhem.svg; sourceTree = "<group>"; };
</ins><span class="cx">                 C2CF975816CEC69E0054E99D /* JSContextBackForwardCache1.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = JSContextBackForwardCache1.html; sourceTree = "<group>"; };
</span><span class="cx">                 C2CF975916CEC69E0054E99D /* JSContextBackForwardCache2.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = JSContextBackForwardCache2.html; sourceTree = "<group>"; };
</span><span class="cx">                 C2EB2DD116CAC7AC009B52EE /* WebViewDidCreateJavaScriptContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebViewDidCreateJavaScriptContext.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -1414,6 +1422,7 @@
</span><span class="cx">                         isa = PBXFrameworksBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><ins>+                                7C83E03F1D0A61A000FEBCF3 /* libicucore.dylib in Frameworks */,
</ins><span class="cx">                                 7A010BCD1D877C0D00EDE72A /* QuartzCore.framework in Frameworks */,
</span><span class="cx">                                 7A010BCB1D877C0500EDE72A /* CoreGraphics.framework in Frameworks */,
</span><span class="cx">                         );
</span><span class="lines">@@ -1523,6 +1532,7 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 A16F66B81C40E9E100BD4D24 /* Resources */,
</span><ins>+                                C25CCA051E51380B0026CB8A /* LineBreaking.mm */,
</ins><span class="cx">                                 7CEFA9641AC0B9E200B910FD /* _WKUserContentExtensionStore.mm */,
</span><span class="cx">                                 A1DF74301C41B65800A2F4D0 /* AlwaysRevalidatedURLSchemes.mm */,
</span><span class="cx">                                 2DE71AFD1D49C0BD00904094 /* AnimatedResize.mm */,
</span><span class="lines">@@ -1762,6 +1772,8 @@
</span><span class="cx">                                 515BE16E1D4288FF00DD7C68 /* StoreBlobToBeDeleted.html */,
</span><span class="cx">                                 51714EB21CF8C761004723C4 /* WebProcessKillIDBCleanup-1.html */,
</span><span class="cx">                                 51714EB31CF8C761004723C4 /* WebProcessKillIDBCleanup-2.html */,
</span><ins>+                                C25CCA0A1E513F490026CB8A /* LineBreaking.html */,
+                                C25CCA0C1E5140E50026CB8A /* AllAhem.svg */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = Resources;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -2752,6 +2764,7 @@
</span><span class="cx">                                 7CCE7EDE1A411A9200447C4C /* URL.cpp in Sources */,
</span><span class="cx">                                 7CCE7EB01A411A4400447C4C /* URLExtras.mm in Sources */,
</span><span class="cx">                                 07492B3B1DF8B14C00633DE1 /* EnumerateMediaDevices.cpp in Sources */,
</span><ins>+                                C25CCA061E51380B0026CB8A /* LineBreaking.mm in Sources */,
</ins><span class="cx">                                 7A6A2C701DCCFA8C00C0D085 /* LocalStorageQuirkTest.mm in Sources */,
</span><span class="cx">                                 2DFF7B6D1DA487AF00814614 /* SnapshotStore.mm in Sources */,
</span><span class="cx">                                 5C6E65441D5CEFD400F7862E /* URLParser.cpp in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreLineBreakingmm"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebCore/LineBreaking.mm (0 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/LineBreaking.mm         (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/LineBreaking.mm        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -0,0 +1,338 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if WK_API_ENABLED
+
+#import "PlatformUtilities.h"
+#import "TestNavigationDelegate.h"
+#import <unicode/ubrk.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/Vector.h>
+#import <wtf/text/WTFString.h>
+
+NSString *generateJavaScriptForTest(NSString *testContent, NSString *localeString, NSString *lineBreakValue)
+{
+ return [NSString stringWithFormat:@"runTest('%@', '%@', '%@')", testContent, localeString, lineBreakValue];
+}
+
+Vector<unsigned> breakingLocationsFromICU(const Vector<UInt16>& testString, const String& locale, const String lineBreakValue)
+{
+ constexpr int bufferSize = 100;
+ char buffer[bufferSize];
+ memset(buffer, 0, bufferSize);
+ auto utf8Locale = locale.utf8();
+ ASSERT(utf8Locale.length() < bufferSize);
+ memcpy(buffer, utf8Locale.data(), utf8Locale.length());
+ CString icuValue;
+ if (lineBreakValue != "auto")
+ icuValue = lineBreakValue.utf8();
+ UErrorCode status = U_ZERO_ERROR;
+ uloc_setKeywordValue("lb", icuValue.data(), buffer, bufferSize, &status);
+ ASSERT(U_SUCCESS(status));
+
+ UBreakIterator* iterator = ubrk_open(UBRK_LINE, buffer, testString.data(), testString.size(), &status);
+ ASSERT(U_SUCCESS(status));
+ ASSERT(iterator);
+
+ Vector<unsigned> result;
+ int32_t position = 0;
+ for (; position != UBRK_DONE; position = ubrk_next(iterator)) {
+ if (position)
+ result.append(position);
+ }
+ ubrk_close(iterator);
+ return result;
+}
+
+static void testAFewStrings(Vector<Vector<UInt16>> testStrings)
+{
+ Vector<String> locales = { "en", "ja", "ko", "zh" };
+
+ Vector<String> lineBreakValues = { "auto", "loose", "normal", "strict" };
+
+ RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
+ RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
+
+ [webView loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"LineBreaking" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
+ [webView _test_waitForDidFinishNavigation];
+
+ for (auto& testCodePoints : testStrings) {
+ NSString *testString = [NSString stringWithCharacters:testCodePoints.data() length:testCodePoints.size()];
+ for (auto& locale : locales) {
+ for (auto& lineBreakValue : lineBreakValues) {
+ __block bool didEvaluateJavaScript = false;
+ __block Vector<unsigned> webkitLocations;
+ [webView evaluateJavaScript:generateJavaScriptForTest(testString, locale, lineBreakValue) completionHandler:^(id value, NSError *error) {
+ for (NSNumber *v in (NSArray *)value)
+ webkitLocations.append(floor([v floatValue] + 0.5));
+ didEvaluateJavaScript = true;
+ }];
+ TestWebKitAPI::Util::run(&didEvaluateJavaScript);
+
+ const auto& icuLocations = breakingLocationsFromICU(testCodePoints, locale, lineBreakValue);
+ EXPECT_EQ(icuLocations.size(), webkitLocations.size());
+ if (icuLocations.size() != webkitLocations.size())
+ break;
+ for (size_t i = 0; i < icuLocations.size(); ++i)
+ EXPECT_EQ(icuLocations[i], webkitLocations[i]);
+ }
+ }
+ }
+}
+
+// Split up the tests because they take too long otherwise and people start thinking their computer is hung.
+TEST(WebKit2, LineBreaking1)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x0024, 0x31, 0x32, 0x33},
+ {0x00a3, 0x31, 0x32, 0x33},
+ {0x00a5, 0x31, 0x32, 0x33},
+ {0x20ac, 0x31, 0x32, 0x33},
+ {0x2116, 0x31, 0x32, 0x33},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking2)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x2025, 0x2025},
+ {0x4e00, 0x2025, 0x2026},
+ {0x4e00, 0x2026, 0x2025},
+ {0x4e00, 0x2026, 0x2026},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x0021},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking3)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x0025},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x003a},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x003b},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x003f},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x00a2},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking4)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x00b0},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x2010},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x2013},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x2030},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x2032},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking5)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x2033},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x203c},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x2047},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x2048},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x2049},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking6)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x2103},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3005},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x301c},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x303b},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3041},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking7)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3043},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3045},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3047},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3049},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3063},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking8)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3083},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3085},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3087},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x308e},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3095},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking9)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x3096},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x309d},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x309e},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30a0},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30a1},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking10)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30a3},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30a5},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30a7},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30a9},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30c3},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking11)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30e3},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30e5},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30e7},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30ee},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30f5},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking12)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30f6},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30fb},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30fc},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30fd},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x30fe},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking13)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31f0},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31f1},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31f2},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31f3},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31f4},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking14)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31f5},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31f6},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31f7},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31f8},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31f9},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking15)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31fa},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31fb},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31fc},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31fd},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31fe},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking16)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0x31ff},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff01},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff05},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff1a},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff1b},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking17)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff1f},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff65},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff67},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff68},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff69},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking18)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff6a},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff6b},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff6c},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff6d},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff6e},
+ };
+ testAFewStrings(testStrings);
+}
+
+TEST(WebKit2, LineBreaking19)
+{
+ Vector<Vector<UInt16>> testStrings = {
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff6f},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xff70},
+ {0x4e00, 0x4e8c, 0x4e09, 0x56db, 0xffe0},
+ {0xff04, 0x31, 0x32, 0x33},
+ {0xffe1, 0x31, 0x32, 0x33},
+ {0xffe5, 0x31, 0x32, 0x33}
+ };
+ testAFewStrings(testStrings);
+}
+
+
+#endif
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaAllAhemsvgfromrev212234trunkLayoutTestscss3linebreakresourcesAllAhemsvg"></a>
<div class="copfile"><h4>Copied: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AllAhem.svg (from rev 212234, trunk/LayoutTests/css3/line-break/resources/AllAhem.svg) (0 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AllAhem.svg         (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AllAhem.svg        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="Litherum" horiz-adv-x="1024">
+<font-face units-per-em="1024" ascent="1024" descent="-1"/>
+<glyph unicode="1" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="2" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="3" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x0021;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x0024;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x0025;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x003a;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x003b;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x003f;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x00a2;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x00a3;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x00a5;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x00b0;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2010;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2013;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2025;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2026;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2030;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2032;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2033;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x203c;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2047;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2048;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2049;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x20ac;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2103;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x2116;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3005;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x301c;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x303b;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3041;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3043;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3045;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3047;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3049;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3063;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3083;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3085;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3087;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x308e;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3095;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x3096;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x309d;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x309e;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30a0;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30a1;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30a3;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30a5;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30a7;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30a9;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30c3;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30e3;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30e5;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30e7;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30ee;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30f5;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30f6;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30fb;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30fc;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30fd;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x30fe;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31f0;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31f1;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31f2;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31f3;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31f4;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31f5;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31f6;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31f7;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31f8;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31f9;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31fa;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31fb;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31fc;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31fd;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31fe;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x31ff;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x4e00;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x4e09;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x4e8c;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#x56db;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff01;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff04;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff05;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff1a;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff1b;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff1f;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff65;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff67;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff68;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff69;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff6a;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff6b;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff6c;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff6d;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff6e;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff6f;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xff70;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xffe0;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xffe1;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+<glyph unicode="&#xffe5;" horiz-adv-x="1024" d="M0 0V1024H1024V0z"/>
+</font>
+</defs>
+</svg>
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2CocoaLineBreakinghtml"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LineBreaking.html (0 => 212235)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LineBreaking.html         (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/LineBreaking.html        2017-02-13 19:07:43 UTC (rev 212235)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+@font-face {
+ font-family: "AllAhem";
+ src: url("AllAhem.svg") format("svg");
+}
+
+#test {
+ font: 20px "AllAhem";
+}
+</style>
+<script>
+function runTest(testContent, localeString, lineBreakValue) {
+ var container = document.getElementById("container");
+ var test = document.getElementById("test");
+
+ test.textContent = testContent;
+ container.lang = localeString;
+ container.style.webkitLineBreak = lineBreakValue;
+
+ var current = 0;
+ var breakpoints = [];
+ var clientRectsLength = 2;
+ for (var i = 1; clientRectsLength > 1; i += 5) {
+ container.style.width = "" + i + "px";
+ var width = test.getClientRects()[0].width;
+ if (current != width) {
+ current = width;
+ breakpoints.push(width / 20);
+ }
+ clientRectsLength = test.getClientRects().length;
+ }
+ return breakpoints;
+}
+</script>
+</head>
+<body>
+<div id="container" style="width: 99999999px;">
+ <span id="test">Hello World</span>
+</div>
+</body>
+</html>
</ins></span></pre>
</div>
</div>
</body>
</html>