<!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>[197225] 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/197225">197225</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-02-26 18:03:18 -0800 (Fri, 26 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger
https://bugs.webkit.org/show_bug.cgi?id=154714
Reviewed by Darin Adler.
Source/WebCore:
Export a couple more symbols for API testing.
* html/parser/HTMLParserIdioms.h:
Tools:
Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger as per:
- https://html.spec.whatwg.org/multipage/infrastructure.html#signed-integers
- https://html.spec.whatwg.org/multipage/infrastructure.html#non-negative-integers
* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp: Added.
(TestWebKitAPI::testParseHTMLInteger):
(TestWebKitAPI::parseHTMLIntegerFails):
(TestWebKitAPI::TEST):
(TestWebKitAPI::testParseHTMLNonNegativeInteger):
(TestWebKitAPI::parseHTMLNonNegativeIntegerFails):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLParserIdiomsh">trunk/Source/WebCore/html/parser/HTMLParserIdioms.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPIPlatformEflcmake">trunk/Tools/TestWebKitAPI/PlatformEfl.cmake</a></li>
<li><a href="#trunkToolsTestWebKitAPIPlatformGTKcmake">trunk/Tools/TestWebKitAPI/PlatformGTK.cmake</a></li>
<li><a href="#trunkToolsTestWebKitAPIPlatformWincmake">trunk/Tools/TestWebKitAPI/PlatformWin.cmake</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIvcxprojTestWebKitAPIvcxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIvcxprojTestWebKitAPIvcxprojfilters">trunk/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreHTMLParserIdiomscpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197224 => 197225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-27 01:47:37 UTC (rev 197224)
+++ trunk/Source/WebCore/ChangeLog        2016-02-27 02:03:18 UTC (rev 197225)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-02-26 Chris Dumez <cdumez@apple.com>
+
+ Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger
+ https://bugs.webkit.org/show_bug.cgi?id=154714
+
+ Reviewed by Darin Adler.
+
+ Export a couple more symbols for API testing.
+
+ * html/parser/HTMLParserIdioms.h:
+
</ins><span class="cx"> 2016-02-26 Beth Dakin <bdakin@apple.com>
</span><span class="cx">
</span><span class="cx"> 32-bit!!!
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLParserIdiomsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.h (197224 => 197225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.h        2016-02-27 01:47:37 UTC (rev 197224)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.h        2016-02-27 02:03:18 UTC (rev 197225)
</span><span class="lines">@@ -57,10 +57,10 @@
</span><span class="cx"> double parseToDoubleForNumberType(const String&, double fallbackValue);
</span><span class="cx">
</span><span class="cx"> // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers
</span><del>-bool parseHTMLInteger(const String&, int&);
</del><ins>+WEBCORE_EXPORT bool parseHTMLInteger(const String&, int&);
</ins><span class="cx">
</span><span class="cx"> // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-negative-integers
</span><del>-bool parseHTMLNonNegativeInteger(const String&, unsigned int&);
</del><ins>+WEBCORE_EXPORT bool parseHTMLNonNegativeInteger(const String&, unsigned&);
</ins><span class="cx">
</span><span class="cx"> // https://html.spec.whatwg.org/multipage/infrastructure.html#cors-settings-attribute
</span><span class="cx"> String parseCORSSettingsAttribute(const AtomicString&);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (197224 => 197225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-02-27 01:47:37 UTC (rev 197224)
+++ trunk/Tools/ChangeLog        2016-02-27 02:03:18 UTC (rev 197225)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-02-26 Chris Dumez <cdumez@apple.com>
+
+ Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger
+ https://bugs.webkit.org/show_bug.cgi?id=154714
+
+ Reviewed by Darin Adler.
+
+ Add API test coverage for parseHTMLInteger / parseHTMLNonNegativeInteger as per:
+ - https://html.spec.whatwg.org/multipage/infrastructure.html#signed-integers
+ - https://html.spec.whatwg.org/multipage/infrastructure.html#non-negative-integers
+
+ * TestWebKitAPI/PlatformEfl.cmake:
+ * TestWebKitAPI/PlatformGTK.cmake:
+ * TestWebKitAPI/PlatformWin.cmake:
+ * TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj:
+ * TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters:
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp: Added.
+ (TestWebKitAPI::testParseHTMLInteger):
+ (TestWebKitAPI::parseHTMLIntegerFails):
+ (TestWebKitAPI::TEST):
+ (TestWebKitAPI::testParseHTMLNonNegativeInteger):
+ (TestWebKitAPI::parseHTMLNonNegativeIntegerFails):
+
</ins><span class="cx"> 2016-02-26 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r197158.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIPlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/PlatformEfl.cmake (197224 => 197225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/PlatformEfl.cmake        2016-02-27 01:47:37 UTC (rev 197224)
+++ trunk/Tools/TestWebKitAPI/PlatformEfl.cmake        2016-02-27 02:03:18 UTC (rev 197225)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx">
</span><span class="cx"> set(test_webcore_BINARIES
</span><span class="cx"> CSSParser
</span><ins>+ HTMLParserIdioms
</ins><span class="cx"> LayoutUnit
</span><span class="cx"> URL
</span><span class="cx"> )
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/PlatformGTK.cmake (197224 => 197225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/PlatformGTK.cmake        2016-02-27 01:47:37 UTC (rev 197224)
+++ trunk/Tools/TestWebKitAPI/PlatformGTK.cmake        2016-02-27 02:03:18 UTC (rev 197225)
</span><span class="lines">@@ -145,6 +145,7 @@
</span><span class="cx"> ${test_main_SOURCES}
</span><span class="cx"> ${TestWebCoreGtk_SOURCES}
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/TestsController.cpp
</span><ins>+ ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
</ins><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIPlatformWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/PlatformWin.cmake (197224 => 197225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/PlatformWin.cmake        2016-02-27 01:47:37 UTC (rev 197224)
+++ trunk/Tools/TestWebKitAPI/PlatformWin.cmake        2016-02-27 02:03:18 UTC (rev 197225)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/TestsController.cpp
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WebCore/CalculationValue.cpp
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WebCore/CSSParser.cpp
</span><ins>+ ${TESTWEBKITAPI_DIR}/Tests/WebCore/HTMLParserIdioms.cpp
</ins><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WebCore/ParsedContentRange.cpp
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WebCore/TimeRanges.cpp
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIvcxprojTestWebKitAPIvcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj (197224 => 197225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj        2016-02-27 01:47:37 UTC (rev 197224)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj        2016-02-27 02:03:18 UTC (rev 197225)
</span><span class="lines">@@ -294,6 +294,7 @@
</span><span class="cx"> <ClCompile Include="..\TestsController.cpp" />
</span><span class="cx"> <ClCompile Include="..\Tests\WebCore\CalculationValue.cpp" />
</span><span class="cx"> <ClCompile Include="..\Tests\WebCore\CSSParser.cpp" />
</span><ins>+ <ClCompile Include="..\Tests\WebCore\HTMLParserIdioms.cpp" />
</ins><span class="cx"> <ClCompile Include="..\Tests\WebCore\LayoutUnit.cpp" />
</span><span class="cx"> <ClCompile Include="..\Tests\WebCore\ParsedContentRange.cpp" />
</span><span class="cx"> <ClCompile Include="..\Tests\WebCore\TimeRanges.cpp" />
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIvcxprojTestWebKitAPIvcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters (197224 => 197225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters        2016-02-27 01:47:37 UTC (rev 197224)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters        2016-02-27 02:03:18 UTC (rev 197225)
</span><span class="lines">@@ -51,6 +51,9 @@
</span><span class="cx"> <ClCompile Include="..\Tests\WebCore\win\BitmapImage.cpp">
</span><span class="cx"> <Filter>Tests\WebCore</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\Tests\WebCore\HTMLParserIdioms.cpp">
+ <Filter>Tests\WebCore</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\Tests\WebCore\LayoutUnit.cpp">
</span><span class="cx"> <Filter>Tests\WebCore</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -181,4 +184,4 @@
</span><span class="cx"> <None Include="TestWebKitAPIPostBuild.cmd" />
</span><span class="cx"> <None Include="TestWebKitAPIPreBuild.cmd" />
</span><span class="cx"> </ItemGroup>
</span><del>-</Project>
</del><span class="cx">\ No newline at end of file
</span><ins>+</Project>
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (197224 => 197225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-02-27 01:47:37 UTC (rev 197224)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-02-27 02:03:18 UTC (rev 197225)
</span><span class="lines">@@ -266,6 +266,7 @@
</span><span class="cx">                 7CCE7F4F1A411BA400447C4C /* RetainPtrHashing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0991C50143C7D68007998F2 /* RetainPtrHashing.cpp */; };
</span><span class="cx">                 7CEFA9661AC0B9E200B910FD /* _WKUserContentExtensionStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CEFA9641AC0B9E200B910FD /* _WKUserContentExtensionStore.mm */; };
</span><span class="cx">                 7CFBCAE51743238F00B2BFCF /* WillLoad_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CFBCAE31743238E00B2BFCF /* WillLoad_Bundle.cpp */; };
</span><ins>+                83B88A341C80056D00BB2418 /* HTMLParserIdioms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83B88A331C80056D00BB2418 /* HTMLParserIdioms.cpp */; };
</ins><span class="cx">                 83CF1C301C4F1B8B00688447 /* StringUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83CF1C2C1C4F19AE00688447 /* StringUtilities.mm */; };
</span><span class="cx">                 930AD402150698D00067970F /* lots-of-text.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 930AD401150698B30067970F /* lots-of-text.html */; };
</span><span class="cx">                 9361002914DC95A70061379D /* lots-of-iframes.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9361002814DC957B0061379D /* lots-of-iframes.html */; };
</span><span class="lines">@@ -647,6 +648,7 @@
</span><span class="cx">                 7CFBCADD1743234F00B2BFCF /* WillLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WillLoad.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 7CFBCAE31743238E00B2BFCF /* WillLoad_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WillLoad_Bundle.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 81B50192140F232300D9EB58 /* StringBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringBuilder.cpp; sourceTree = "<group>"; };
</span><ins>+                83B88A331C80056D00BB2418 /* HTMLParserIdioms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLParserIdioms.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 83CF1C2C1C4F19AE00688447 /* StringUtilities.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringUtilities.mm; sourceTree = "<group>"; };
</span><span class="cx">                 86BD19971A2DB05B006DCF0A /* RefCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RefCounter.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 8A2C750D16CED9550024F352 /* ResizeWindowAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResizeWindowAfterCrash.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -1012,6 +1014,7 @@
</span><span class="cx">                                 260BA57A1B1D2EE2004FA07C /* DFAHelpers.h */,
</span><span class="cx">                                 26F6E1EF1ADC749B00DE696B /* DFAMinimizer.cpp */,
</span><span class="cx">                                 41973B5A1AF2286A006C7B36 /* FileSystem.cpp */,
</span><ins>+                                83B88A331C80056D00BB2418 /* HTMLParserIdioms.cpp */,
</ins><span class="cx">                                 14464012167A8305000BD218 /* LayoutUnit.cpp */,
</span><span class="cx">                                 CD225C071C45A69200140761 /* ParsedContentRange.cpp */,
</span><span class="cx">                                 41973B5C1AF22875006C7B36 /* SharedBuffer.cpp */,
</span><span class="lines">@@ -1881,6 +1884,7 @@
</span><span class="cx">                                 2E7765CF16C4D81100BA2BB1 /* mainMac.mm in Sources */,
</span><span class="cx">                                 41973B5B1AF2286A006C7B36 /* FileSystem.cpp in Sources */,
</span><span class="cx">                                 CD89D03A1C4EDB2A00040A04 /* WebCoreNSURLSession.mm in Sources */,
</span><ins>+                                83B88A341C80056D00BB2418 /* HTMLParserIdioms.cpp in Sources */,
</ins><span class="cx">                                 A1C4FB6E1BACCE50003742D0 /* QuickLook.mm in Sources */,
</span><span class="cx">                                 7A5623111AD5AF3E0096B920 /* MenuTypesForMouseEvents.cpp in Sources */,
</span><span class="cx">                                 1AAD19F71C7CE20300831E47 /* Coding.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreHTMLParserIdiomscpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp (0 => 197225)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp         (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp        2016-02-27 02:03:18 UTC (rev 197225)
</span><span class="lines">@@ -0,0 +1,168 @@
</span><ins>+/*
+ * Copyright (C) 2016 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"
+
+#include "Test.h"
+#include <WebCore/HTMLParserIdioms.h>
+#include <wtf/text/WTFString.h>
+
+using namespace WebCore;
+
+namespace TestWebKitAPI {
+
+static int testParseHTMLInteger(const String& input)
+{
+ int result = 0;
+ bool success = parseHTMLInteger(input, result);
+ EXPECT_TRUE(success);
+ return result;
+}
+
+static bool parseHTMLIntegerFails(const String& input)
+{
+ int result = 0;
+ return !parseHTMLInteger(input, result);
+}
+
+TEST(WebCoreHTMLParserIdioms, parseHTMLInteger)
+{
+ EXPECT_EQ(0, testParseHTMLInteger("0"));
+ EXPECT_EQ(0, testParseHTMLInteger("-0"));
+ EXPECT_EQ(0, testParseHTMLInteger("+0"));
+ EXPECT_EQ(123, testParseHTMLInteger("123"));
+ EXPECT_EQ(123, testParseHTMLInteger("+123"));
+ EXPECT_EQ(-123, testParseHTMLInteger("-123"));
+ EXPECT_EQ(123, testParseHTMLInteger(" 123"));
+ EXPECT_EQ(123, testParseHTMLInteger("123 "));
+ EXPECT_EQ(123, testParseHTMLInteger(" 123 "));
+ EXPECT_EQ(123, testParseHTMLInteger("123abc"));
+ EXPECT_EQ(-123, testParseHTMLInteger("-123abc"));
+ EXPECT_EQ(123, testParseHTMLInteger(" +123"));
+ EXPECT_EQ(-123, testParseHTMLInteger(" -123"));
+ EXPECT_EQ(12, testParseHTMLInteger(" 12 3"));
+ EXPECT_EQ(1, testParseHTMLInteger("1.0"));
+ EXPECT_EQ(1, testParseHTMLInteger("1."));
+ EXPECT_EQ(1, testParseHTMLInteger("1e1"));
+
+ // All HTML whitespaces.
+ EXPECT_EQ(123, testParseHTMLInteger(" \t\r\n\f123"));
+
+ // Boundaries.
+ EXPECT_EQ(-2147483648, testParseHTMLInteger("-2147483648"));
+ EXPECT_EQ(2147483647, testParseHTMLInteger("2147483647"));
+
+ // Failure cases.
+ EXPECT_TRUE(parseHTMLIntegerFails("-2147483649"));
+ EXPECT_TRUE(parseHTMLIntegerFails("2147483648"));
+ EXPECT_TRUE(parseHTMLIntegerFails("111111111111111111"));
+ EXPECT_TRUE(parseHTMLIntegerFails(""));
+ EXPECT_TRUE(parseHTMLIntegerFails(" "));
+ EXPECT_TRUE(parseHTMLIntegerFails(" "));
+ EXPECT_TRUE(parseHTMLIntegerFails("+"));
+ EXPECT_TRUE(parseHTMLIntegerFails("+ 123"));
+ EXPECT_TRUE(parseHTMLIntegerFails("-"));
+ EXPECT_TRUE(parseHTMLIntegerFails("- 123"));
+ EXPECT_TRUE(parseHTMLIntegerFails("a"));
+ EXPECT_TRUE(parseHTMLIntegerFails("-a"));
+ EXPECT_TRUE(parseHTMLIntegerFails("+-123"));
+ EXPECT_TRUE(parseHTMLIntegerFails("-+123"));
+ EXPECT_TRUE(parseHTMLIntegerFails("++123"));
+ EXPECT_TRUE(parseHTMLIntegerFails("--123"));
+ EXPECT_TRUE(parseHTMLIntegerFails("\v123")); // '\v' is an ASCII space but not an HTML whitespace.
+ EXPECT_TRUE(parseHTMLIntegerFails("a123"));
+ EXPECT_TRUE(parseHTMLIntegerFails("+a123"));
+ EXPECT_TRUE(parseHTMLIntegerFails("-a123"));
+ EXPECT_TRUE(parseHTMLIntegerFails(".1"));
+ EXPECT_TRUE(parseHTMLIntegerFails("infinity"));
+}
+
+static unsigned testParseHTMLNonNegativeInteger(const String& input)
+{
+ unsigned result = 0;
+ bool success = parseHTMLNonNegativeInteger(input, result);
+ EXPECT_TRUE(success);
+ return result;
+}
+
+static bool parseHTMLNonNegativeIntegerFails(const String& input)
+{
+ unsigned result = 0;
+ return !parseHTMLNonNegativeInteger(input, result);
+}
+
+TEST(WebCoreHTMLParserIdioms, parseHTMLNonNegativeInteger)
+{
+ EXPECT_EQ(123u, testParseHTMLNonNegativeInteger("123"));
+ EXPECT_EQ(123u, testParseHTMLNonNegativeInteger("+123"));
+ EXPECT_EQ(123u, testParseHTMLNonNegativeInteger(" 123"));
+ EXPECT_EQ(123u, testParseHTMLNonNegativeInteger("123 "));
+ EXPECT_EQ(123u, testParseHTMLNonNegativeInteger(" 123 "));
+ EXPECT_EQ(123u, testParseHTMLNonNegativeInteger("123abc"));
+ EXPECT_EQ(123u, testParseHTMLNonNegativeInteger(" +123"));
+ EXPECT_EQ(12u, testParseHTMLNonNegativeInteger(" 12 3"));
+ EXPECT_EQ(1u, testParseHTMLNonNegativeInteger("1.0"));
+ EXPECT_EQ(1u, testParseHTMLNonNegativeInteger("1."));
+ EXPECT_EQ(1u, testParseHTMLNonNegativeInteger("1e1"));
+
+ // All HTML whitespaces.
+ EXPECT_EQ(123u, testParseHTMLNonNegativeInteger(" \t\r\n\f123"));
+
+ // Boundaries.
+ EXPECT_EQ(0u, testParseHTMLNonNegativeInteger("+0"));
+ EXPECT_EQ(0u, testParseHTMLNonNegativeInteger("0"));
+ // FIXME: This should pass.
+ // EXPECT_EQ(0u, testParseHTMLNonNegativeInteger("-0"));
+ EXPECT_EQ(4294967295u, testParseHTMLNonNegativeInteger("4294967295"));
+
+ // Failure cases.
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("-1"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("4294967296"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("111111111111111111"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails(" -123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("-123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("-123abc"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails(""));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails(" "));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails(" "));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("+"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("+ 123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("-"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("- 123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("a"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("-a"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("+-123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("-+123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("++123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("--123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("\v123")); // '\v' is an ASCII space but not an HTML whitespace.
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("a123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("+a123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("-a123"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails(".1"));
+ EXPECT_TRUE(parseHTMLNonNegativeIntegerFails("infinity"));
+}
+
+} // namespace TestWebKitAPI
</ins></span></pre>
</div>
</div>
</body>
</html>