Title: [197260] trunk
Revision
197260
Author
[email protected]
Date
2016-02-27 16:35:18 -0800 (Sat, 27 Feb 2016)

Log Message

Align HTMLMarqueeElement.scrollAmount / scrollDelay with the specification
https://bugs.webkit.org/show_bug.cgi?id=154781

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/reflection-obsolete-expected.txt:

Source/WebCore:

Align HTMLMarqueeElement.scrollAmount / scrollDelay with the
specification:
- https://www.w3.org/TR/html5/obsolete.html#the-marquee-element-0

In particular:
- The attributes should have unsigned long type
- We should not throw for negative values
- Values should be in the range [0, 2147483647] as per:
- https://html.spec.whatwg.org/multipage/infrastructure.html#reflect

No new tests, already covered by existing tests.

* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::scrollAmount):
(WebCore::HTMLMarqueeElement::setScrollAmount):
(WebCore::HTMLMarqueeElement::scrollDelay):
(WebCore::HTMLMarqueeElement::setScrollDelay):
(WebCore::HTMLMarqueeElement::loop): Deleted.
* html/HTMLMarqueeElement.h:
* html/HTMLMarqueeElement.idl:

LayoutTests:

Update existing test to reflect the behavior changes.

* fast/html/marquee-element-expected.txt:
* fast/html/marquee-element.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (197259 => 197260)


--- trunk/LayoutTests/ChangeLog	2016-02-27 21:05:24 UTC (rev 197259)
+++ trunk/LayoutTests/ChangeLog	2016-02-28 00:35:18 UTC (rev 197260)
@@ -1,3 +1,15 @@
+2016-02-27  Chris Dumez  <[email protected]>
+
+        Align HTMLMarqueeElement.scrollAmount / scrollDelay with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=154781
+
+        Reviewed by Darin Adler.
+
+        Update existing test to reflect the behavior changes.
+
+        * fast/html/marquee-element-expected.txt:
+        * fast/html/marquee-element.html:
+
 2016-02-27  Alexey Proskuryakov  <[email protected]>
 
         Mark failing reftests as such, now that we detect reftest failures.

Modified: trunk/LayoutTests/fast/html/marquee-element-expected.txt (197259 => 197260)


--- trunk/LayoutTests/fast/html/marquee-element-expected.txt	2016-02-27 21:05:24 UTC (rev 197259)
+++ trunk/LayoutTests/fast/html/marquee-element-expected.txt	2016-02-28 00:35:18 UTC (rev 197260)
@@ -67,10 +67,12 @@
 PASS marquee.scrollAmount is 5
 "scrollAmount" can contain trailing non-numeric values:
 PASS marquee.scrollAmount is 5
-Setting "scrollAmount" to a negative value raises an exception:
-PASS document.getElementById("marquee").scrollAmount = -1; threw exception Error: IndexSizeError: DOM Exception 1.
-Setting "scrollAmount" to a value that is too large raises an exception:
-PASS document.getElementById("marquee").scrollAmount = 2147483648; threw exception Error: IndexSizeError: DOM Exception 1.
+Setting "scrollAmount" to a negative value should set to the default value:
+PASS marquee.scrollAmount = -1; did not throw exception.
+PASS marquee.scrollAmount is 6
+Setting "scrollAmount" to a value that is too large should set to the default value:
+PASS marquee.scrollAmount = 2147483648; did not throw exception.
+PASS marquee.scrollAmount is 6
 Default "scrollDelay" value is 85:
 PASS marquee.scrollDelay is 85
 "scrollDelay" uses default value when content attribute is not a number:
@@ -87,10 +89,12 @@
 PASS marquee.scrollDelay is 5
 "scrollDelay" can contain trailing non-numeric values:
 PASS marquee.scrollDelay is 5
-Setting "scrollDelay" to a negative value raises an exception:
-PASS document.getElementById("marquee").scrollDelay = -1; threw exception Error: IndexSizeError: DOM Exception 1.
-Setting "scrollDelay" to a value that is too large raises an exception:
-PASS document.getElementById("marquee").scrollDelay = 2147483648; threw exception Error: IndexSizeError: DOM Exception 1.
+Setting "scrollDelay" to a negative value should set to the default value:
+PASS marquee.scrollDelay = -1; did not throw exception.
+PASS marquee.scrollDelay is 85
+Setting "scrollDelay" to a value that is too large should set to the default value:
+PASS marquee.scrollDelay = 2147483648; did not throw exception.
+PASS marquee.scrollDelay is 85
 Default "loop" value is -1:
 PASS marquee.loop is -1
 "loop" uses default value when content attribute is not a number:
@@ -112,7 +116,7 @@
 Setting "loop" to 0 raises an exception:
 PASS document.getElementById("marquee").loop = 0; threw exception Error: IndexSizeError: DOM Exception 1.
 Setting "loop" to a negative value raises an exception:
-PASS document.getElementById("marquee").scrollDelay = -5; threw exception Error: IndexSizeError: DOM Exception 1.
+PASS document.getElementById("marquee").loop = -5; threw exception Error: IndexSizeError: DOM Exception 1.
 "loop" can be set to -1 by script:
 PASS marquee.loop is -1
 PASS successfullyParsed is true

Modified: trunk/LayoutTests/fast/html/marquee-element.html (197259 => 197260)


--- trunk/LayoutTests/fast/html/marquee-element.html	2016-02-27 21:05:24 UTC (rev 197259)
+++ trunk/LayoutTests/fast/html/marquee-element.html	2016-02-28 00:35:18 UTC (rev 197260)
@@ -181,13 +181,17 @@
 marquee = document.getElementById('marquee');
 shouldBe('marquee.scrollAmount', '5');
 
-debug('Setting "scrollAmount" to a negative value raises an exception:');
+debug('Setting "scrollAmount" to a negative value should set to the default value:');
 testParent.innerHTML = '<marquee id="marquee">test</marquee>';
-shouldThrow('document.getElementById("marquee").scrollAmount = -1;');
+marquee = document.getElementById('marquee');
+shouldNotThrow('marquee.scrollAmount = -1;');
+shouldBe('marquee.scrollAmount', '6');
 
-debug('Setting "scrollAmount" to a value that is too large raises an exception:');
+debug('Setting "scrollAmount" to a value that is too large should set to the default value:');
 testParent.innerHTML = '<marquee id="marquee">test</marquee>';
-shouldThrow('document.getElementById("marquee").scrollAmount = 2147483648;');
+marquee = document.getElementById('marquee');
+shouldNotThrow('marquee.scrollAmount = 2147483648;');
+shouldBe('marquee.scrollAmount', '6');
 
 debug('Default "scrollDelay" value is 85:');
 testParent.innerHTML = '<marquee id="marquee">test</marquee>';
@@ -229,13 +233,17 @@
 marquee = document.getElementById('marquee');
 shouldBe('marquee.scrollDelay', '5');
 
-debug('Setting "scrollDelay" to a negative value raises an exception:');
+debug('Setting "scrollDelay" to a negative value should set to the default value:');
 testParent.innerHTML = '<marquee id="marquee">test</marquee>';
-shouldThrow('document.getElementById("marquee").scrollDelay = -1;');
+marquee = document.getElementById('marquee');
+shouldNotThrow('marquee.scrollDelay = -1;');
+shouldBe('marquee.scrollDelay', '85');
 
-debug('Setting "scrollDelay" to a value that is too large raises an exception:');
+debug('Setting "scrollDelay" to a value that is too large should set to the default value:');
 testParent.innerHTML = '<marquee id="marquee">test</marquee>';
-shouldThrow('document.getElementById("marquee").scrollDelay = 2147483648;');
+marquee = document.getElementById('marquee');
+shouldNotThrow('marquee.scrollDelay = 2147483648;');
+shouldBe('marquee.scrollDelay', '85');
 
 debug('Default "loop" value is -1:');
 testParent.innerHTML = '<marquee id="marquee">test</marquee>';
@@ -288,7 +296,7 @@
 
 debug('Setting "loop" to a negative value raises an exception:');
 testParent.innerHTML = '<marquee id="marquee">test</marquee>';
-shouldThrow('document.getElementById("marquee").scrollDelay = -5;');
+shouldThrow('document.getElementById("marquee").loop = -5;');
 
 debug('"loop" can be set to -1 by script:');
 testParent.innerHTML = '<marquee id="marquee" loop="5">test</marquee>';

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (197259 => 197260)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-02-27 21:05:24 UTC (rev 197259)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-02-28 00:35:18 UTC (rev 197260)
@@ -1,3 +1,14 @@
+2016-02-27  Chris Dumez  <[email protected]>
+
+        Align HTMLMarqueeElement.scrollAmount / scrollDelay with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=154781
+
+        Reviewed by Darin Adler.
+
+        Rebaseline now that more checks are passing.
+
+        * web-platform-tests/html/dom/reflection-obsolete-expected.txt:
+
 2016-02-26  Chris Dumez  <[email protected]>
 
         Fix the behavior of reflecting IDL attributes of type unsigned long

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-obsolete-expected.txt (197259 => 197260)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-obsolete-expected.txt	2016-02-27 21:05:24 UTC (rev 197259)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/reflection-obsolete-expected.txt	2016-02-28 00:35:18 UTC (rev 197260)
@@ -2813,7 +2813,7 @@
 PASS marquee.scrollAmount: setAttribute() to "\t7" followed by getAttribute() 
 PASS marquee.scrollAmount: setAttribute() to "\t7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to "\v7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to "\v7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to "\v7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to "\f7" followed by getAttribute() 
 PASS marquee.scrollAmount: setAttribute() to "\f7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
@@ -2827,39 +2827,39 @@
 PASS marquee.scrollAmount: setAttribute() to "\r7" followed by getAttribute() 
 PASS marquee.scrollAmount: setAttribute() to "\r7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to "
7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to "
7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to "
7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to "
7" followed by getAttribute() 
 PASS marquee.scrollAmount: setAttribute() to "
7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to "᠎7" followed by getAttribute() 
 PASS marquee.scrollAmount: setAttribute() to "᠎7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollAmount: setAttribute() to " 7" followed by IDL get assert_equals: expected 6 but got 7
+PASS marquee.scrollAmount: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by getAttribute() 
 PASS marquee.scrollAmount: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by IDL get 
 PASS marquee.scrollAmount: setAttribute() to undefined followed by getAttribute() 
@@ -2899,8 +2899,12 @@
 PASS marquee.scrollAmount: IDL set to "-0" should not throw 
 PASS marquee.scrollAmount: IDL set to "-0" followed by getAttribute() 
 PASS marquee.scrollAmount: IDL set to "-0" followed by IDL get 
-FAIL marquee.scrollAmount: IDL set to 2147483648 should not throw IndexSizeError: DOM Exception 1
-FAIL marquee.scrollAmount: IDL set to 4294967295 should not throw IndexSizeError: DOM Exception 1
+PASS marquee.scrollAmount: IDL set to 2147483648 should not throw 
+PASS marquee.scrollAmount: IDL set to 2147483648 followed by getAttribute() 
+PASS marquee.scrollAmount: IDL set to 2147483648 followed by IDL get 
+PASS marquee.scrollAmount: IDL set to 4294967295 should not throw 
+PASS marquee.scrollAmount: IDL set to 4294967295 followed by getAttribute() 
+PASS marquee.scrollAmount: IDL set to 4294967295 followed by IDL get 
 PASS marquee.scrollDelay: typeof IDL attribute 
 PASS marquee.scrollDelay: IDL get with DOM attribute unset 
 PASS marquee.scrollDelay: setAttribute() to -2147483649 followed by getAttribute() 
@@ -2938,7 +2942,7 @@
 PASS marquee.scrollDelay: setAttribute() to "\t7" followed by getAttribute() 
 PASS marquee.scrollDelay: setAttribute() to "\t7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to "\v7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to "\v7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to "\v7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to "\f7" followed by getAttribute() 
 PASS marquee.scrollDelay: setAttribute() to "\f7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
@@ -2952,39 +2956,39 @@
 PASS marquee.scrollDelay: setAttribute() to "\r7" followed by getAttribute() 
 PASS marquee.scrollDelay: setAttribute() to "\r7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to "
7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to "
7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to "
7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to "
7" followed by getAttribute() 
 PASS marquee.scrollDelay: setAttribute() to "
7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to "᠎7" followed by getAttribute() 
 PASS marquee.scrollDelay: setAttribute() to "᠎7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " 7" followed by getAttribute() 
-FAIL marquee.scrollDelay: setAttribute() to " 7" followed by IDL get assert_equals: expected 85 but got 7
+PASS marquee.scrollDelay: setAttribute() to " 7" followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by getAttribute() 
 PASS marquee.scrollDelay: setAttribute() to " \0\x01\x02\x03\x04\x05\x06\x07 \b\t\n\v\f\r\x0e\x0f \x10\x11\x12\x13\x14\x15\x16\x17 \x18\x19\x1a\x1b\x1c\x1d\x1e\x1f  foo " followed by IDL get 
 PASS marquee.scrollDelay: setAttribute() to undefined followed by getAttribute() 
@@ -3024,8 +3028,12 @@
 PASS marquee.scrollDelay: IDL set to "-0" should not throw 
 PASS marquee.scrollDelay: IDL set to "-0" followed by getAttribute() 
 PASS marquee.scrollDelay: IDL set to "-0" followed by IDL get 
-FAIL marquee.scrollDelay: IDL set to 2147483648 should not throw IndexSizeError: DOM Exception 1
-FAIL marquee.scrollDelay: IDL set to 4294967295 should not throw IndexSizeError: DOM Exception 1
+PASS marquee.scrollDelay: IDL set to 2147483648 should not throw 
+PASS marquee.scrollDelay: IDL set to 2147483648 followed by getAttribute() 
+PASS marquee.scrollDelay: IDL set to 2147483648 followed by IDL get 
+PASS marquee.scrollDelay: IDL set to 4294967295 should not throw 
+PASS marquee.scrollDelay: IDL set to 4294967295 followed by getAttribute() 
+PASS marquee.scrollDelay: IDL set to 4294967295 followed by IDL get 
 PASS marquee.trueSpeed: typeof IDL attribute 
 PASS marquee.trueSpeed: IDL get with DOM attribute unset 
 PASS marquee.trueSpeed: setAttribute() to "" followed by getAttribute() 

Modified: trunk/Source/WebCore/ChangeLog (197259 => 197260)


--- trunk/Source/WebCore/ChangeLog	2016-02-27 21:05:24 UTC (rev 197259)
+++ trunk/Source/WebCore/ChangeLog	2016-02-28 00:35:18 UTC (rev 197260)
@@ -1,3 +1,31 @@
+2016-02-27  Chris Dumez  <[email protected]>
+
+        Align HTMLMarqueeElement.scrollAmount / scrollDelay with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=154781
+
+        Reviewed by Darin Adler.
+
+        Align HTMLMarqueeElement.scrollAmount / scrollDelay with the
+        specification:
+        - https://www.w3.org/TR/html5/obsolete.html#the-marquee-element-0
+
+        In particular:
+        - The attributes should have unsigned long type
+        - We should not throw for negative values
+        - Values should be in the range [0, 2147483647] as per:
+        - https://html.spec.whatwg.org/multipage/infrastructure.html#reflect
+
+        No new tests, already covered by existing tests.
+
+        * html/HTMLMarqueeElement.cpp:
+        (WebCore::HTMLMarqueeElement::scrollAmount):
+        (WebCore::HTMLMarqueeElement::setScrollAmount):
+        (WebCore::HTMLMarqueeElement::scrollDelay):
+        (WebCore::HTMLMarqueeElement::setScrollDelay):
+        (WebCore::HTMLMarqueeElement::loop): Deleted.
+        * html/HTMLMarqueeElement.h:
+        * html/HTMLMarqueeElement.idl:
+
 2016-02-27  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r197204, r197207, r197211, r197217,

Modified: trunk/Source/WebCore/html/HTMLMarqueeElement.cpp (197259 => 197260)


--- trunk/Source/WebCore/html/HTMLMarqueeElement.cpp	2016-02-27 21:05:24 UTC (rev 197259)
+++ trunk/Source/WebCore/html/HTMLMarqueeElement.cpp	2016-02-28 00:35:18 UTC (rev 197260)
@@ -28,6 +28,7 @@
 #include "CSSValueKeywords.h"
 #include "ExceptionCode.h"
 #include "HTMLNames.h"
+#include "HTMLParserIdioms.h"
 #include "RenderLayer.h"
 #include "RenderMarquee.h"
 
@@ -121,34 +122,24 @@
         marqueeRenderer->stop();
 }
 
-int HTMLMarqueeElement::scrollAmount() const
+unsigned HTMLMarqueeElement::scrollAmount() const
 {
-    bool ok;
-    int scrollAmount = fastGetAttribute(scrollamountAttr).toInt(&ok);
-    return ok && scrollAmount >= 0 ? scrollAmount : RenderStyle::initialMarqueeIncrement().intValue();
+    return limitToOnlyHTMLNonNegative(fastGetAttribute(scrollamountAttr), RenderStyle::initialMarqueeIncrement().intValue());
 }
     
-void HTMLMarqueeElement::setScrollAmount(int scrollAmount, ExceptionCode& ec)
+void HTMLMarqueeElement::setScrollAmount(unsigned scrollAmount)
 {
-    if (scrollAmount < 0)
-        ec = INDEX_SIZE_ERR;
-    else
-        setIntegralAttribute(scrollamountAttr, scrollAmount);
+    setUnsignedIntegralAttribute(scrollamountAttr, limitToOnlyHTMLNonNegative(scrollAmount, RenderStyle::initialMarqueeIncrement().intValue()));
 }
     
-int HTMLMarqueeElement::scrollDelay() const
+unsigned HTMLMarqueeElement::scrollDelay() const
 {
-    bool ok;
-    int scrollDelay = fastGetAttribute(scrolldelayAttr).toInt(&ok);
-    return ok && scrollDelay >= 0 ? scrollDelay : RenderStyle::initialMarqueeSpeed();
+    return limitToOnlyHTMLNonNegative(fastGetAttribute(scrolldelayAttr), RenderStyle::initialMarqueeSpeed());
 }
 
-void HTMLMarqueeElement::setScrollDelay(int scrollDelay, ExceptionCode& ec)
+void HTMLMarqueeElement::setScrollDelay(unsigned scrollDelay)
 {
-    if (scrollDelay < 0)
-        ec = INDEX_SIZE_ERR;
-    else
-        setIntegralAttribute(scrolldelayAttr, scrollDelay);
+    setUnsignedIntegralAttribute(scrolldelayAttr, limitToOnlyHTMLNonNegative(scrollDelay, RenderStyle::initialMarqueeSpeed()));
 }
     
 int HTMLMarqueeElement::loop() const

Modified: trunk/Source/WebCore/html/HTMLMarqueeElement.h (197259 => 197260)


--- trunk/Source/WebCore/html/HTMLMarqueeElement.h	2016-02-27 21:05:24 UTC (rev 197259)
+++ trunk/Source/WebCore/html/HTMLMarqueeElement.h	2016-02-28 00:35:18 UTC (rev 197260)
@@ -41,11 +41,11 @@
     void start();
     virtual void stop() override;
     
-    int scrollAmount() const;
-    void setScrollAmount(int, ExceptionCode&);
+    unsigned scrollAmount() const;
+    void setScrollAmount(unsigned);
     
-    int scrollDelay() const;
-    void setScrollDelay(int, ExceptionCode&);
+    unsigned scrollDelay() const;
+    void setScrollDelay(unsigned);
     
     int loop() const;
     void setLoop(int, ExceptionCode&);

Modified: trunk/Source/WebCore/html/HTMLMarqueeElement.idl (197259 => 197260)


--- trunk/Source/WebCore/html/HTMLMarqueeElement.idl	2016-02-27 21:05:24 UTC (rev 197259)
+++ trunk/Source/WebCore/html/HTMLMarqueeElement.idl	2016-02-28 00:35:18 UTC (rev 197260)
@@ -27,8 +27,8 @@
     [Reflect] attribute DOMString height;
     [Reflect] attribute unsigned long hspace;
     [SetterRaisesException] attribute long loop;
-    [SetterRaisesException] attribute long scrollAmount;
-    [SetterRaisesException] attribute long scrollDelay;
+    attribute unsigned long scrollAmount;
+    attribute unsigned long scrollDelay;
     [Reflect] attribute boolean trueSpeed;
     [Reflect] attribute unsigned long vspace;
     [Reflect] attribute DOMString width;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to