<!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>[196769] 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/196769">196769</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-02-18 12:14:13 -0800 (Thu, 18 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix behavior of reflecting unsigned long IDL attributes that are limited to only non-negative numbers greater than zero
https://bugs.webkit.org/show_bug.cgi?id=154398
Reviewed by Ryosuke Niwa.
LayoutTests/imported/w3c:
Rebaseline now that more checks are passing.
* web-platform-tests/html/dom/reflection-forms-expected.txt:
* web-platform-tests/html/dom/reflection-tabular-expected.txt:
Source/WebCore:
Fix behavior of reflecting unsigned long IDL attributes that are limited
to only non-negative numbers greater than zero to comply with:
- https://html.spec.whatwg.org/#limited-to-only-non-negative-numbers-greater-than-zero
This patch updates the following IDL attributes:
- colgroup.span
- col.span
- input.size
- textarea.cols
- textareal.rows
All of them now:
- Have "unsigned long" type on IDL size and "unsigned" type on native
side.
- On getting, return the value if it is in the range [1; 2147483647],
otherwise return the default value.
- On setting, set to the input value if it is in the range
[1; 2147483647], otherwise, set to the default value.
Note that as per the specification, we are supposed to throw an
IndexSizeError exception when trying to set those attributes to zero.
However, we instead use the default value to match other browsers.
It would be risky to be the only browser to throw in this case.
No new tests, already covered by existing test.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::setSize):
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::parseAttribute):
(WebCore::HTMLTableColElement::setSpan):
* html/HTMLTableColElement.h:
* html/HTMLTableColElement.idl:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::parseAttribute):
(WebCore::HTMLTextAreaElement::setCols):
(WebCore::HTMLTextAreaElement::setRows):
(WebCore::HTMLTextAreaElement::shouldUseInputMethod): Deleted.
* html/HTMLTextAreaElement.h:
* html/HTMLTextAreaElement.idl:
* html/parser/HTMLParserIdioms.h:
(WebCore::limitToOnlyNonNegativeNumbersGreaterThanZero):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldomreflectiontabularexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-tabular-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLInputElementcpp">trunk/Source/WebCore/html/HTMLInputElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTableColElementcpp">trunk/Source/WebCore/html/HTMLTableColElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTableColElementh">trunk/Source/WebCore/html/HTMLTableColElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTableColElementidl">trunk/Source/WebCore/html/HTMLTableColElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementcpp">trunk/Source/WebCore/html/HTMLTextAreaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementh">trunk/Source/WebCore/html/HTMLTextAreaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementidl">trunk/Source/WebCore/html/HTMLTextAreaElement.idl</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLParserIdiomsh">trunk/Source/WebCore/html/parser/HTMLParserIdioms.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-02-18 Chris Dumez <cdumez@apple.com>
+
+ Fix behavior of reflecting unsigned long IDL attributes that are limited to only non-negative numbers greater than zero
+ https://bugs.webkit.org/show_bug.cgi?id=154398
+
+ Reviewed by Ryosuke Niwa.
+
+ Rebaseline now that more checks are passing.
+
+ * web-platform-tests/html/dom/reflection-forms-expected.txt:
+ * web-platform-tests/html/dom/reflection-tabular-expected.txt:
+
</ins><span class="cx"> 2016-02-17 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Regression(r196648): http://w3c-test.org/html/dom/interfaces.html redirects at the end of the test
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldomreflectionformsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -6951,10 +6951,10 @@
</span><span class="cx"> PASS input.size: IDL set to 2147483647 followed by getAttribute()
</span><span class="cx"> PASS input.size: IDL set to 2147483647 followed by IDL get
</span><span class="cx"> PASS input.size: IDL set to 2147483648 should not throw
</span><del>-FAIL input.size: IDL set to 2147483648 followed by getAttribute() assert_equals: expected "20" but got "2147483648"
</del><ins>+PASS input.size: IDL set to 2147483648 followed by getAttribute()
</ins><span class="cx"> PASS input.size: IDL set to 2147483648 followed by IDL get
</span><span class="cx"> PASS input.size: IDL set to 4294967295 should not throw
</span><del>-FAIL input.size: IDL set to 4294967295 followed by getAttribute() assert_equals: expected "20" but got "4294967295"
</del><ins>+PASS input.size: IDL set to 4294967295 followed by getAttribute()
</ins><span class="cx"> PASS input.size: IDL set to 4294967295 followed by IDL get
</span><span class="cx"> PASS input.src: typeof IDL attribute
</span><span class="cx"> PASS input.src: IDL get with DOM attribute unset
</span><span class="lines">@@ -14624,10 +14624,10 @@
</span><span class="cx"> PASS textarea.cols: IDL set to 2147483647 followed by getAttribute()
</span><span class="cx"> PASS textarea.cols: IDL set to 2147483647 followed by IDL get
</span><span class="cx"> PASS textarea.cols: IDL set to 2147483648 should not throw
</span><del>-FAIL textarea.cols: IDL set to 2147483648 followed by getAttribute() assert_equals: expected "20" but got "-2147483648"
</del><ins>+PASS textarea.cols: IDL set to 2147483648 followed by getAttribute()
</ins><span class="cx"> PASS textarea.cols: IDL set to 2147483648 followed by IDL get
</span><span class="cx"> PASS textarea.cols: IDL set to 4294967295 should not throw
</span><del>-FAIL textarea.cols: IDL set to 4294967295 followed by getAttribute() assert_equals: expected "20" but got "-1"
</del><ins>+PASS textarea.cols: IDL set to 4294967295 followed by getAttribute()
</ins><span class="cx"> PASS textarea.cols: IDL set to 4294967295 followed by IDL get
</span><span class="cx"> PASS textarea.dirName: typeof IDL attribute
</span><span class="cx"> PASS textarea.dirName: IDL get with DOM attribute unset
</span><span class="lines">@@ -15683,10 +15683,10 @@
</span><span class="cx"> PASS textarea.rows: IDL set to 2147483647 followed by getAttribute()
</span><span class="cx"> PASS textarea.rows: IDL set to 2147483647 followed by IDL get
</span><span class="cx"> PASS textarea.rows: IDL set to 2147483648 should not throw
</span><del>-FAIL textarea.rows: IDL set to 2147483648 followed by getAttribute() assert_equals: expected "2" but got "-2147483648"
</del><ins>+PASS textarea.rows: IDL set to 2147483648 followed by getAttribute()
</ins><span class="cx"> PASS textarea.rows: IDL set to 2147483648 followed by IDL get
</span><span class="cx"> PASS textarea.rows: IDL set to 4294967295 should not throw
</span><del>-FAIL textarea.rows: IDL set to 4294967295 followed by getAttribute() assert_equals: expected "2" but got "-1"
</del><ins>+PASS textarea.rows: IDL set to 4294967295 followed by getAttribute()
</ins><span class="cx"> PASS textarea.rows: IDL set to 4294967295 followed by IDL get
</span><span class="cx"> PASS textarea.wrap: typeof IDL attribute
</span><span class="cx"> PASS textarea.wrap: IDL get with DOM attribute unset
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldomreflectiontabularexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-tabular-expected.txt (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-tabular-expected.txt        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-tabular-expected.txt        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -2974,11 +2974,11 @@
</span><span class="cx"> PASS colgroup.span: setAttribute() to -2147483649 followed by getAttribute()
</span><span class="cx"> PASS colgroup.span: setAttribute() to -2147483649 followed by IDL get
</span><span class="cx"> PASS colgroup.span: setAttribute() to -2147483648 followed by getAttribute()
</span><del>-FAIL colgroup.span: setAttribute() to -2147483648 followed by IDL get assert_equals: expected 1 but got -2147483648
</del><ins>+PASS colgroup.span: setAttribute() to -2147483648 followed by IDL get
</ins><span class="cx"> PASS colgroup.span: setAttribute() to -36 followed by getAttribute()
</span><del>-FAIL colgroup.span: setAttribute() to -36 followed by IDL get assert_equals: expected 1 but got -36
</del><ins>+PASS colgroup.span: setAttribute() to -36 followed by IDL get
</ins><span class="cx"> PASS colgroup.span: setAttribute() to -1 followed by getAttribute()
</span><del>-FAIL colgroup.span: setAttribute() to -1 followed by IDL get assert_equals: expected 1 but got -1
</del><ins>+PASS colgroup.span: setAttribute() to -1 followed by IDL get
</ins><span class="cx"> PASS colgroup.span: setAttribute() to 0 followed by getAttribute()
</span><span class="cx"> PASS colgroup.span: setAttribute() to 0 followed by IDL get
</span><span class="cx"> PASS colgroup.span: setAttribute() to 1 followed by getAttribute()
</span><span class="lines">@@ -2994,7 +2994,7 @@
</span><span class="cx"> PASS colgroup.span: setAttribute() to "" followed by getAttribute()
</span><span class="cx"> PASS colgroup.span: setAttribute() to "" followed by IDL get
</span><span class="cx"> PASS colgroup.span: setAttribute() to "-1" followed by getAttribute()
</span><del>-FAIL colgroup.span: setAttribute() to "-1" followed by IDL get assert_equals: expected 1 but got -1
</del><ins>+PASS colgroup.span: setAttribute() to "-1" followed by IDL get
</ins><span class="cx"> PASS colgroup.span: setAttribute() to "-0" followed by getAttribute()
</span><span class="cx"> PASS colgroup.span: setAttribute() to "-0" followed by IDL get
</span><span class="cx"> PASS colgroup.span: setAttribute() to "0" followed by getAttribute()
</span><span class="lines">@@ -3084,11 +3084,11 @@
</span><span class="cx"> PASS colgroup.span: IDL set to 2147483647 followed by getAttribute()
</span><span class="cx"> PASS colgroup.span: IDL set to 2147483647 followed by IDL get
</span><span class="cx"> PASS colgroup.span: IDL set to 2147483648 should not throw
</span><del>-FAIL colgroup.span: IDL set to 2147483648 followed by getAttribute() assert_equals: expected "1" but got "-2147483648"
-FAIL colgroup.span: IDL set to 2147483648 followed by IDL get assert_equals: expected 1 but got -2147483648
</del><ins>+PASS colgroup.span: IDL set to 2147483648 followed by getAttribute()
+PASS colgroup.span: IDL set to 2147483648 followed by IDL get
</ins><span class="cx"> PASS colgroup.span: IDL set to 4294967295 should not throw
</span><del>-FAIL colgroup.span: IDL set to 4294967295 followed by getAttribute() assert_equals: expected "1" but got "-1"
-FAIL colgroup.span: IDL set to 4294967295 followed by IDL get assert_equals: expected 1 but got -1
</del><ins>+PASS colgroup.span: IDL set to 4294967295 followed by getAttribute()
+PASS colgroup.span: IDL set to 4294967295 followed by IDL get
</ins><span class="cx"> PASS colgroup.align: typeof IDL attribute
</span><span class="cx"> PASS colgroup.align: IDL get with DOM attribute unset
</span><span class="cx"> PASS colgroup.align: setAttribute() to "" followed by getAttribute()
</span><span class="lines">@@ -4241,11 +4241,11 @@
</span><span class="cx"> PASS col.span: setAttribute() to -2147483649 followed by getAttribute()
</span><span class="cx"> PASS col.span: setAttribute() to -2147483649 followed by IDL get
</span><span class="cx"> PASS col.span: setAttribute() to -2147483648 followed by getAttribute()
</span><del>-FAIL col.span: setAttribute() to -2147483648 followed by IDL get assert_equals: expected 1 but got -2147483648
</del><ins>+PASS col.span: setAttribute() to -2147483648 followed by IDL get
</ins><span class="cx"> PASS col.span: setAttribute() to -36 followed by getAttribute()
</span><del>-FAIL col.span: setAttribute() to -36 followed by IDL get assert_equals: expected 1 but got -36
</del><ins>+PASS col.span: setAttribute() to -36 followed by IDL get
</ins><span class="cx"> PASS col.span: setAttribute() to -1 followed by getAttribute()
</span><del>-FAIL col.span: setAttribute() to -1 followed by IDL get assert_equals: expected 1 but got -1
</del><ins>+PASS col.span: setAttribute() to -1 followed by IDL get
</ins><span class="cx"> PASS col.span: setAttribute() to 0 followed by getAttribute()
</span><span class="cx"> PASS col.span: setAttribute() to 0 followed by IDL get
</span><span class="cx"> PASS col.span: setAttribute() to 1 followed by getAttribute()
</span><span class="lines">@@ -4261,7 +4261,7 @@
</span><span class="cx"> PASS col.span: setAttribute() to "" followed by getAttribute()
</span><span class="cx"> PASS col.span: setAttribute() to "" followed by IDL get
</span><span class="cx"> PASS col.span: setAttribute() to "-1" followed by getAttribute()
</span><del>-FAIL col.span: setAttribute() to "-1" followed by IDL get assert_equals: expected 1 but got -1
</del><ins>+PASS col.span: setAttribute() to "-1" followed by IDL get
</ins><span class="cx"> PASS col.span: setAttribute() to "-0" followed by getAttribute()
</span><span class="cx"> PASS col.span: setAttribute() to "-0" followed by IDL get
</span><span class="cx"> PASS col.span: setAttribute() to "0" followed by getAttribute()
</span><span class="lines">@@ -4351,11 +4351,11 @@
</span><span class="cx"> PASS col.span: IDL set to 2147483647 followed by getAttribute()
</span><span class="cx"> PASS col.span: IDL set to 2147483647 followed by IDL get
</span><span class="cx"> PASS col.span: IDL set to 2147483648 should not throw
</span><del>-FAIL col.span: IDL set to 2147483648 followed by getAttribute() assert_equals: expected "1" but got "-2147483648"
-FAIL col.span: IDL set to 2147483648 followed by IDL get assert_equals: expected 1 but got -2147483648
</del><ins>+PASS col.span: IDL set to 2147483648 followed by getAttribute()
+PASS col.span: IDL set to 2147483648 followed by IDL get
</ins><span class="cx"> PASS col.span: IDL set to 4294967295 should not throw
</span><del>-FAIL col.span: IDL set to 4294967295 followed by getAttribute() assert_equals: expected "1" but got "-1"
-FAIL col.span: IDL set to 4294967295 followed by IDL get assert_equals: expected 1 but got -1
</del><ins>+PASS col.span: IDL set to 4294967295 followed by getAttribute()
+PASS col.span: IDL set to 4294967295 followed by IDL get
</ins><span class="cx"> PASS col.align: typeof IDL attribute
</span><span class="cx"> PASS col.align: IDL get with DOM attribute unset
</span><span class="cx"> PASS col.align: setAttribute() to "" followed by getAttribute()
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/Source/WebCore/ChangeLog        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2016-02-18 Chris Dumez <cdumez@apple.com>
+
+ Fix behavior of reflecting unsigned long IDL attributes that are limited to only non-negative numbers greater than zero
+ https://bugs.webkit.org/show_bug.cgi?id=154398
+
+ Reviewed by Ryosuke Niwa.
+
+ Fix behavior of reflecting unsigned long IDL attributes that are limited
+ to only non-negative numbers greater than zero to comply with:
+ - https://html.spec.whatwg.org/#limited-to-only-non-negative-numbers-greater-than-zero
+
+ This patch updates the following IDL attributes:
+ - colgroup.span
+ - col.span
+ - input.size
+ - textarea.cols
+ - textareal.rows
+
+ All of them now:
+ - Have "unsigned long" type on IDL size and "unsigned" type on native
+ side.
+ - On getting, return the value if it is in the range [1; 2147483647],
+ otherwise return the default value.
+ - On setting, set to the input value if it is in the range
+ [1; 2147483647], otherwise, set to the default value.
+
+ Note that as per the specification, we are supposed to throw an
+ IndexSizeError exception when trying to set those attributes to zero.
+ However, we instead use the default value to match other browsers.
+ It would be risky to be the only browser to throw in this case.
+
+ No new tests, already covered by existing test.
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::parseAttribute):
+ (WebCore::HTMLInputElement::setSize):
+ * html/HTMLTableColElement.cpp:
+ (WebCore::HTMLTableColElement::parseAttribute):
+ (WebCore::HTMLTableColElement::setSpan):
+ * html/HTMLTableColElement.h:
+ * html/HTMLTableColElement.idl:
+ * html/HTMLTextAreaElement.cpp:
+ (WebCore::HTMLTextAreaElement::parseAttribute):
+ (WebCore::HTMLTextAreaElement::setCols):
+ (WebCore::HTMLTextAreaElement::setRows):
+ (WebCore::HTMLTextAreaElement::shouldUseInputMethod): Deleted.
+ * html/HTMLTextAreaElement.h:
+ * html/HTMLTextAreaElement.idl:
+ * html/parser/HTMLParserIdioms.h:
+ (WebCore::limitToOnlyNonNegativeNumbersGreaterThanZero):
+
</ins><span class="cx"> 2016-02-18 David Kilzer <ddkilzer@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove redundant ASSERT_WITH_MESSAGE_UNUSED() from SOFT_LINK_FRAMEWORK_FOR_SOURCE() macro
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLInputElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLInputElement.cpp        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -685,8 +685,7 @@
</span><span class="cx"> parseMaxLengthAttribute(value);
</span><span class="cx"> else if (name == sizeAttr) {
</span><span class="cx"> int oldSize = m_size;
</span><del>- int valueAsInteger = value.toInt();
- m_size = valueAsInteger > 0 ? valueAsInteger : defaultSize;
</del><ins>+ m_size = limitToOnlyNonNegativeNumbersGreaterThanZero(value.string().toUInt(), defaultSize);
</ins><span class="cx"> if (m_size != oldSize && renderer())
</span><span class="cx"> renderer()->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx"> } else if (name == altAttr)
</span><span class="lines">@@ -1275,7 +1274,7 @@
</span><span class="cx">
</span><span class="cx"> void HTMLInputElement::setSize(unsigned size)
</span><span class="cx"> {
</span><del>- setUnsignedIntegralAttribute(sizeAttr, size);
</del><ins>+ setUnsignedIntegralAttribute(sizeAttr, limitToOnlyNonNegativeNumbersGreaterThanZero(size, defaultSize));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLInputElement::setSize(unsigned size, ExceptionCode& ec)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTableColElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTableColElement.cpp (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTableColElement.cpp        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/Source/WebCore/html/HTMLTableColElement.cpp        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx">
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><ins>+#include "HTMLParserIdioms.h"
</ins><span class="cx"> #include "HTMLTableElement.h"
</span><span class="cx"> #include "RenderTableCol.h"
</span><span class="cx"> #include "Text.h"
</span><span class="lines">@@ -64,8 +65,7 @@
</span><span class="cx"> void HTMLTableColElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
</span><span class="cx"> {
</span><span class="cx"> if (name == spanAttr) {
</span><del>- int newSpan = value.toInt();
- m_span = newSpan ? newSpan : 1;
</del><ins>+ m_span = limitToOnlyNonNegativeNumbersGreaterThanZero(value.string().toUInt());
</ins><span class="cx"> if (is<RenderTableCol>(renderer()))
</span><span class="cx"> downcast<RenderTableCol>(*renderer()).updateFromElement();
</span><span class="cx"> } else if (name == widthAttr) {
</span><span class="lines">@@ -90,9 +90,9 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLTableColElement::setSpan(int n)
</del><ins>+void HTMLTableColElement::setSpan(unsigned n)
</ins><span class="cx"> {
</span><del>- setIntegralAttribute(spanAttr, n);
</del><ins>+ setUnsignedIntegralAttribute(spanAttr, limitToOnlyNonNegativeNumbersGreaterThanZero(n));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String HTMLTableColElement::width() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTableColElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTableColElement.h (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTableColElement.h        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/Source/WebCore/html/HTMLTableColElement.h        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -34,8 +34,8 @@
</span><span class="cx"> public:
</span><span class="cx"> static Ref<HTMLTableColElement> create(const QualifiedName& tagName, Document&);
</span><span class="cx">
</span><del>- int span() const { return m_span; }
- void setSpan(int);
</del><ins>+ unsigned span() const { return m_span; }
+ void setSpan(unsigned);
</ins><span class="cx">
</span><span class="cx"> String width() const;
</span><span class="cx">
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx"> virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override;
</span><span class="cx"> virtual const StyleProperties* additionalPresentationAttributeStyle() override;
</span><span class="cx">
</span><del>- int m_span;
</del><ins>+ unsigned m_span;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } //namespace
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTableColElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTableColElement.idl (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTableColElement.idl        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/Source/WebCore/html/HTMLTableColElement.idl        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -22,7 +22,11 @@
</span><span class="cx"> [Reflect] attribute DOMString align;
</span><span class="cx"> [Reflect=char] attribute DOMString ch;
</span><span class="cx"> [Reflect=charoff] attribute DOMString chOff;
</span><ins>+#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
+ attribute unsigned long span;
+#else
</ins><span class="cx"> attribute long span;
</span><ins>+#endif
</ins><span class="cx"> [Reflect] attribute DOMString vAlign;
</span><span class="cx"> [Reflect] attribute DOMString width;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameSelection.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><ins>+#include "HTMLParserIdioms.h"
</ins><span class="cx"> #include "LocalizedStrings.h"
</span><span class="cx"> #include "RenderTextControlMultiLine.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="lines">@@ -169,18 +170,14 @@
</span><span class="cx"> void HTMLTextAreaElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
</span><span class="cx"> {
</span><span class="cx"> if (name == rowsAttr) {
</span><del>- int rows = value.toInt();
- if (rows <= 0)
- rows = defaultRows;
</del><ins>+ unsigned rows = limitToOnlyNonNegativeNumbersGreaterThanZero(value.string().toUInt(), defaultRows);
</ins><span class="cx"> if (m_rows != rows) {
</span><span class="cx"> m_rows = rows;
</span><span class="cx"> if (renderer())
</span><span class="cx"> renderer()->setNeedsLayoutAndPrefWidthsRecalc();
</span><span class="cx"> }
</span><span class="cx"> } else if (name == colsAttr) {
</span><del>- int cols = value.toInt();
- if (cols <= 0)
- cols = defaultCols;
</del><ins>+ unsigned cols = limitToOnlyNonNegativeNumbersGreaterThanZero(value.string().toUInt(), defaultCols);
</ins><span class="cx"> if (m_cols != cols) {
</span><span class="cx"> m_cols = cols;
</span><span class="cx"> if (renderer())
</span><span class="lines">@@ -492,14 +489,14 @@
</span><span class="cx"> focus();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLTextAreaElement::setCols(int cols)
</del><ins>+void HTMLTextAreaElement::setCols(unsigned cols)
</ins><span class="cx"> {
</span><del>- setIntegralAttribute(colsAttr, cols);
</del><ins>+ setUnsignedIntegralAttribute(colsAttr, limitToOnlyNonNegativeNumbersGreaterThanZero(cols, defaultCols));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLTextAreaElement::setRows(int rows)
</del><ins>+void HTMLTextAreaElement::setRows(unsigned rows)
</ins><span class="cx"> {
</span><del>- setIntegralAttribute(rowsAttr, rows);
</del><ins>+ setUnsignedIntegralAttribute(rowsAttr, limitToOnlyNonNegativeNumbersGreaterThanZero(rows, defaultRows));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool HTMLTextAreaElement::shouldUseInputMethod()
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.h (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.h        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.h        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -35,8 +35,8 @@
</span><span class="cx"> public:
</span><span class="cx"> static Ref<HTMLTextAreaElement> create(const QualifiedName&, Document&, HTMLFormElement*);
</span><span class="cx">
</span><del>- int cols() const { return m_cols; }
- int rows() const { return m_rows; }
</del><ins>+ unsigned cols() const { return m_cols; }
+ unsigned rows() const { return m_rows; }
</ins><span class="cx">
</span><span class="cx"> bool shouldWrapText() const { return m_wrap != NoWrap; }
</span><span class="cx">
</span><span class="lines">@@ -57,8 +57,8 @@
</span><span class="cx">
</span><span class="cx"> void rendererWillBeDestroyed();
</span><span class="cx">
</span><del>- void setCols(int);
- void setRows(int);
</del><ins>+ void setCols(unsigned);
+ void setRows(unsigned);
</ins><span class="cx">
</span><span class="cx"> virtual bool willRespondToMouseClickEvents() override;
</span><span class="cx">
</span><span class="lines">@@ -118,8 +118,8 @@
</span><span class="cx"> bool valueMissing(const String& value) const { return isRequiredFormControl() && !isDisabledOrReadOnly() && value.isEmpty(); }
</span><span class="cx"> bool tooLong(const String&, NeedsToCheckDirtyFlag) const;
</span><span class="cx">
</span><del>- int m_rows;
- int m_cols;
</del><ins>+ unsigned m_rows;
+ unsigned m_cols;
</ins><span class="cx"> WrapMethod m_wrap;
</span><span class="cx"> HTMLElement* m_placeholder;
</span><span class="cx"> mutable String m_value;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.idl (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.idl        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.idl        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -21,7 +21,6 @@
</span><span class="cx">
</span><span class="cx"> interface HTMLTextAreaElement : HTMLElement {
</span><span class="cx"> [Reflect] attribute boolean autofocus;
</span><del>- attribute long cols;
</del><span class="cx"> [Reflect] attribute DOMString dirName;
</span><span class="cx"> [Reflect] attribute boolean disabled;
</span><span class="cx"> readonly attribute HTMLFormElement form;
</span><span class="lines">@@ -30,7 +29,13 @@
</span><span class="cx"> [Reflect] attribute DOMString placeholder;
</span><span class="cx"> [Reflect] attribute boolean readOnly;
</span><span class="cx"> [Reflect] attribute boolean required;
</span><ins>+#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
</ins><span class="cx"> attribute long rows;
</span><ins>+ attribute long cols;
+#else
+ attribute unsigned long rows;
+ attribute unsigned long cols;
+#endif
</ins><span class="cx"> [Reflect] attribute DOMString wrap;
</span><span class="cx">
</span><span class="cx"> readonly attribute DOMString type;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLParserIdiomsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.h (196768 => 196769)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.h        2016-02-18 20:07:54 UTC (rev 196768)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.h        2016-02-18 20:14:13 UTC (rev 196769)
</span><span class="lines">@@ -106,6 +106,12 @@
</span><span class="cx"> return isHTMLSpace(character) && !isHTMLLineBreak(character);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+// https://html.spec.whatwg.org/multipage/infrastructure.html#limited-to-only-non-negative-numbers-greater-than-zero
+inline unsigned limitToOnlyNonNegativeNumbersGreaterThanZero(unsigned value, unsigned defaultValue = 1)
+{
+ return (value > 0 && value <= 2147483647) ? value : defaultValue;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+}
+
</ins><span class="cx"> #endif
</span></span></pre>
</div>
</div>
</body>
</html>