[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
aestes at apple.com
aestes at apple.com
Wed Dec 22 17:55:51 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 5f887d4225288e0256c79874ba41ab36bec29bc8
Author: aestes at apple.com <aestes at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Dec 2 21:14:08 2010 +0000
Implement (non-EventListener) marquee IDL attributes from HTML5.
https://bugs.webkit.org/show_bug.cgi?id=49786
Reviewed by Darin Adler.
WebCore:
Test: fast/html/marquee-element.html
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::scrollAmount): If the content attribute
can be converted to a signed integer and is >= 0, return it.
Otherwise, return the default scrollAmount value.
(WebCore::HTMLMarqueeElement::setScrollAmount): Update the content
attribute if it is >= 0. Otherwise, raise INDEX_SIZE_ERR.
(WebCore::HTMLMarqueeElement::scrollDelay): Same as scrollAmount.
(WebCore::HTMLMarqueeElement::setScrollDelay): Same as setScrollAmount.
(WebCore::HTMLMarqueeElement::loop): If the content attribute can be
converted to a signed integer and is greater than 0 or equal to -1,
return it. Otherwise, return the default loop value.
(WebCore::HTMLMarqueeElement::setLoop): Update the content attribute if
it is greater than 0 or equal to -1. Otherwise, raise INDEX_SIZE_ERR.
* html/HTMLMarqueeElement.h:
* html/HTMLMarqueeElement.idl: Update the IDL to match what is in HTML5.
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::initialMarqueeSpeed):
LayoutTests:
* fast/html/marquee-element-expected.txt: Added.
* fast/html/marquee-element.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 499a77e..2499043 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-12-02 Andy Estes <aestes at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Implement (non-EventListener) marquee IDL attributes from HTML5.
+ https://bugs.webkit.org/show_bug.cgi?id=49786
+
+ * fast/html/marquee-element-expected.txt: Added.
+ * fast/html/marquee-element.html: Added.
+
2010-12-02 Xiaomei Ji <xji at chromium.org>
Unreviewed.
diff --git a/LayoutTests/fast/html/marquee-element-expected.txt b/LayoutTests/fast/html/marquee-element-expected.txt
new file mode 100644
index 0000000..5fb2950
--- /dev/null
+++ b/LayoutTests/fast/html/marquee-element-expected.txt
@@ -0,0 +1,113 @@
+Various tests for the marquee element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+"behavior" IDL attribute reflects content attribute:
+PASS marquee.behavior is "slide"
+"behavior" IDL attribute can be modified:
+PASS marquee.behavior is "alternate"
+"bgColor" IDL attribute reflects content attribute:
+PASS marquee.bgColor is "red"
+"bgColor" IDL attribute can be modified:
+PASS marquee.bgColor is "blue"
+"direction" IDL attribute reflects content attribute:
+PASS marquee.direction is "right"
+"direction" IDL attribute can be modified:
+PASS marquee.direction is "left"
+"height" IDL attribute reflects content attribute:
+PASS marquee.height is "100px"
+"height" IDL attribute can be modified:
+PASS marquee.height is "200px"
+"hspace" IDL attribute reflects content attribute:
+PASS marquee.hspace is 10
+"hspace" IDL attribute can be modified:
+PASS marquee.hspace is 20
+"loop" IDL attribute reflects content attribute:
+PASS marquee.loop is 3
+"loop" IDL attribute can be modified:
+PASS marquee.loop is 4
+"scrollAmount" IDL attribute reflects content attribute:
+PASS marquee.scrollAmount is 5
+"scrollAmount" IDL attribute can be modified:
+PASS marquee.scrollAmount is 6
+"scrollDelay" IDL attribute reflects content attribute:
+PASS marquee.scrollDelay is 50
+"scrollDelay" IDL attribute can be modified:
+PASS marquee.scrollDelay is 60
+"trueSpeed" IDL attribute reflects content attribute:
+PASS marquee.trueSpeed is true
+"trueSpeed" IDL attribute can be modified:
+PASS marquee.trueSpeed is false
+"vspace" IDL attribute reflects content attribute:
+PASS marquee.vspace is 10
+"vspace" IDL attribute can be modified:
+PASS marquee.vspace is 20
+Default "scrollAmount" value is 6:
+PASS marquee.scrollAmount is 6
+"scrollAmount" uses default value when content attribute is not a number:
+PASS marquee.scrollAmount is 6
+"scrollAmount" uses default value when content attribute is too large:
+PASS marquee.scrollAmount is 6
+"scrollAmount" uses default value when content attribute is negative:
+PASS marquee.scrollAmount is 6
+"scrollAmount" can be set to 0:
+PASS marquee.scrollAmount is 0
+"scrollAmount" can be set to 2^31-1:
+PASS marquee.scrollAmount is 2147483647
+"scrollAmount" can contain whitespace:
+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: INDEX_SIZE_ERR: DOM Exception 1.
+Setting "scrollAmount" to a value that is too large raises an exception:
+PASS document.getElementById("marquee").scrollAmount = 2147483648; threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+Default "scrollDelay" value is 85:
+PASS marquee.scrollDelay is 85
+"scrollDelay" uses default value when content attribute is not a number:
+PASS marquee.scrollDelay is 85
+"scrollDelay" uses default value when content attribute is too large:
+PASS marquee.scrollDelay is 85
+"scrollDelay" uses default value when content attribute is negative:
+PASS marquee.scrollDelay is 85
+"scrollDelay" can be set to 0:
+PASS marquee.scrollDelay is 0
+"scrollDelay" can be set to 2^31-1:
+PASS marquee.scrollDelay is 2147483647
+"scrollDelay" can contain whitespace:
+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: INDEX_SIZE_ERR: DOM Exception 1.
+Setting "scrollDelay" to a value that is too large raises an exception:
+PASS document.getElementById("marquee").scrollDelay = 2147483648; threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+Default "loop" value is -1:
+PASS marquee.loop is -1
+"loop" uses default value when content attribute is not a number:
+PASS marquee.loop is -1
+"loop" uses default value when content attribute is too large:
+PASS marquee.loop is -1
+"loop" uses default value when content attribute is negative:
+PASS marquee.loop is -1
+"loop" uses default value when set to 0:
+PASS marquee.loop is -1
+"loop" can be set to 1:
+PASS marquee.loop is 1
+"loop" can be set to 2^31-1:
+PASS marquee.loop is 2147483647
+"loop" can contain whitespace:
+PASS marquee.loop is 5
+"loop" can contain trailing non-numeric values:
+PASS marquee.loop is 5
+Setting "loop" to 0 raises an exception:
+PASS document.getElementById("marquee").loop = 0; threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+Setting "loop" to a negative value raises an exception:
+PASS document.getElementById("marquee").scrollDelay = -5; threw exception Error: INDEX_SIZE_ERR: DOM Exception 1.
+"loop" can be set to -1 by script:
+PASS marquee.loop is -1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/html/marquee-element.html b/LayoutTests/fast/html/marquee-element.html
new file mode 100644
index 0000000..83f3a5f
--- /dev/null
+++ b/LayoutTests/fast/html/marquee-element.html
@@ -0,0 +1,286 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<div id="testParent" style="visibility:hidden"></div>
+<script>
+description('Various tests for the marquee element.');
+
+var marquee;
+var testParent = document.getElementById("testParent");
+
+debug('"behavior" IDL attribute reflects content attribute:');
+testParent.innerHTML = '<marquee id="marquee" behavior="slide">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.behavior', '"slide"');
+
+debug('"behavior" IDL attribute can be modified:');
+testParent.innerHTML = '<marquee id="marquee" behavior="slide">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.behavior="alternate";
+shouldBe('marquee.behavior', '"alternate"');
+
+debug('"bgColor" IDL attribute reflects content attribute:');
+testParent.innerHTML = '<marquee id="marquee" bgcolor="red">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.bgColor', '"red"');
+
+debug('"bgColor" IDL attribute can be modified:');
+testParent.innerHTML = '<marquee id="marquee" bgcolor="red">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.bgColor="blue";
+shouldBe('marquee.bgColor', '"blue"');
+
+debug('"direction" IDL attribute reflects content attribute:');
+testParent.innerHTML = '<marquee id="marquee" direction="right">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.direction', '"right"');
+
+debug('"direction" IDL attribute can be modified:');
+testParent.innerHTML = '<marquee id="marquee" direction="right">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.direction="left";
+shouldBe('marquee.direction', '"left"');
+
+debug('"height" IDL attribute reflects content attribute:');
+testParent.innerHTML = '<marquee id="marquee" height="100px">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.height', '"100px"');
+
+debug('"height" IDL attribute can be modified:');
+testParent.innerHTML = '<marquee id="marquee" height="100px">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.height="200px";
+shouldBe('marquee.height', '"200px"');
+
+debug('"hspace" IDL attribute reflects content attribute:');
+testParent.innerHTML = '<marquee id="marquee" hspace="10">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.hspace', '10');
+
+debug('"hspace" IDL attribute can be modified:');
+testParent.innerHTML = '<marquee id="marquee" hspace="10">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.hspace=20;
+shouldBe('marquee.hspace', '20');
+
+debug('"loop" IDL attribute reflects content attribute:');
+testParent.innerHTML = '<marquee id="marquee" loop="3">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.loop', '3');
+
+debug('"loop" IDL attribute can be modified:');
+testParent.innerHTML = '<marquee id="marquee" loop="3">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.loop=4;
+shouldBe('marquee.loop', '4');
+
+debug('"scrollAmount" IDL attribute reflects content attribute:');
+testParent.innerHTML = '<marquee id="marquee" scrollamount="5">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollAmount', '5');
+
+debug('"scrollAmount" IDL attribute can be modified:');
+testParent.innerHTML = '<marquee id="marquee" scrollamount="5">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.scrollAmount=6;
+shouldBe('marquee.scrollAmount', '6');
+
+debug('"scrollDelay" IDL attribute reflects content attribute:');
+testParent.innerHTML = '<marquee id="marquee" scrolldelay="50">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollDelay', '50');
+
+debug('"scrollDelay" IDL attribute can be modified:');
+testParent.innerHTML = '<marquee id="marquee" scrolldelay="50">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.scrollDelay=60;
+shouldBe('marquee.scrollDelay', '60');
+
+debug('"trueSpeed" IDL attribute reflects content attribute:');
+testParent.innerHTML = '<marquee id="marquee" truespeed="true">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBeTrue('marquee.trueSpeed');
+
+debug('"trueSpeed" IDL attribute can be modified:');
+testParent.innerHTML = '<marquee id="marquee" truespeed="true">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.trueSpeed=false;
+shouldBe('marquee.trueSpeed', 'false');
+
+debug('"vspace" IDL attribute reflects content attribute:');
+testParent.innerHTML = '<marquee id="marquee" vspace="10">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.vspace', '10');
+
+debug('"vspace" IDL attribute can be modified:');
+testParent.innerHTML = '<marquee id="marquee" vspace="10">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.vspace=20;
+shouldBe('marquee.vspace', '20');
+
+debug('Default "scrollAmount" value is 6:');
+testParent.innerHTML = '<marquee id="marquee">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollAmount', '6');
+
+debug('"scrollAmount" uses default value when content attribute is not a number:');
+testParent.innerHTML = '<marquee id="marquee" scrollamount="a1">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollAmount', '6');
+
+debug('"scrollAmount" uses default value when content attribute is too large:');
+testParent.innerHTML = '<marquee id="marquee" scrollamount="2147483648">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollAmount', '6');
+
+debug('"scrollAmount" uses default value when content attribute is negative:');
+testParent.innerHTML = '<marquee id="marquee" scrollamount="-1">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollAmount', '6');
+
+debug('"scrollAmount" can be set to 0:');
+testParent.innerHTML = '<marquee id="marquee" scrollamount="0">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollAmount', '0');
+
+debug('"scrollAmount" can be set to 2^31-1:');
+testParent.innerHTML = '<marquee id="marquee" scrollamount="2147483647">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollAmount', '2147483647');
+
+debug('"scrollAmount" can contain whitespace:');
+testParent.innerHTML = '<marquee id="marquee" scrollamount=" 5 ">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollAmount', '5');
+
+debug('"scrollAmount" can contain trailing non-numeric values:');
+testParent.innerHTML = '<marquee id="marquee" scrollamount="5a">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollAmount', '5');
+
+debug('Setting "scrollAmount" to a negative value raises an exception:');
+testParent.innerHTML = '<marquee id="marquee">test</marquee>';
+shouldThrow('document.getElementById("marquee").scrollAmount = -1;');
+
+debug('Setting "scrollAmount" to a value that is too large raises an exception:');
+testParent.innerHTML = '<marquee id="marquee">test</marquee>';
+shouldThrow('document.getElementById("marquee").scrollAmount = 2147483648;');
+
+debug('Default "scrollDelay" value is 85:');
+testParent.innerHTML = '<marquee id="marquee">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollDelay', '85');
+
+debug('"scrollDelay" uses default value when content attribute is not a number:');
+testParent.innerHTML = '<marquee id="marquee" scrolldelay="a1">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollDelay', '85');
+
+debug('"scrollDelay" uses default value when content attribute is too large:');
+testParent.innerHTML = '<marquee id="marquee" scrolldelay="2147483648">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollDelay', '85');
+
+debug('"scrollDelay" uses default value when content attribute is negative:');
+testParent.innerHTML = '<marquee id="marquee" scrolldelay="-1">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollDelay', '85');
+
+debug('"scrollDelay" can be set to 0:');
+testParent.innerHTML = '<marquee id="marquee" scrolldelay="0">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollDelay', '0');
+
+debug('"scrollDelay" can be set to 2^31-1:');
+testParent.innerHTML = '<marquee id="marquee" scrolldelay="2147483647">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollDelay', '2147483647');
+
+debug('"scrollDelay" can contain whitespace:');
+testParent.innerHTML = '<marquee id="marquee" scrolldelay=" 5 ">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollDelay', '5');
+
+debug('"scrollDelay" can contain trailing non-numeric values:');
+testParent.innerHTML = '<marquee id="marquee" scrolldelay="5a">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.scrollDelay', '5');
+
+debug('Setting "scrollDelay" to a negative value raises an exception:');
+testParent.innerHTML = '<marquee id="marquee">test</marquee>';
+shouldThrow('document.getElementById("marquee").scrollDelay = -1;');
+
+debug('Setting "scrollDelay" to a value that is too large raises an exception:');
+testParent.innerHTML = '<marquee id="marquee">test</marquee>';
+shouldThrow('document.getElementById("marquee").scrollDelay = 2147483648;');
+
+debug('Default "loop" value is -1:');
+testParent.innerHTML = '<marquee id="marquee">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.loop', '-1');
+
+debug('"loop" uses default value when content attribute is not a number:');
+testParent.innerHTML = '<marquee id="marquee" loop="a1">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.loop', '-1');
+
+debug('"loop" uses default value when content attribute is too large:');
+testParent.innerHTML = '<marquee id="marquee" loop="2147483648">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.loop', '-1');
+
+debug('"loop" uses default value when content attribute is negative:');
+testParent.innerHTML = '<marquee id="marquee" loop="-5">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.loop', '-1');
+
+debug('"loop" uses default value when set to 0:');
+testParent.innerHTML = '<marquee id="marquee" loop="0">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.loop', '-1');
+
+debug('"loop" can be set to 1:');
+testParent.innerHTML = '<marquee id="marquee" loop="1">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.loop', '1');
+
+debug('"loop" can be set to 2^31-1:');
+testParent.innerHTML = '<marquee id="marquee" loop="2147483647">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.loop', '2147483647');
+
+debug('"loop" can contain whitespace:');
+testParent.innerHTML = '<marquee id="marquee" loop=" 5 ">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.loop', '5');
+
+debug('"loop" can contain trailing non-numeric values:');
+testParent.innerHTML = '<marquee id="marquee" loop="5a">test</marquee>';
+marquee = document.getElementById('marquee');
+shouldBe('marquee.loop', '5');
+
+debug('Setting "loop" to 0 raises an exception:');
+testParent.innerHTML = '<marquee id="marquee">test</marquee>';
+shouldThrow('document.getElementById("marquee").loop = 0;');
+
+debug('Setting "loop" to a negative value raises an exception:');
+testParent.innerHTML = '<marquee id="marquee">test</marquee>';
+shouldThrow('document.getElementById("marquee").scrollDelay = -5;');
+
+debug('"loop" can be set to -1 by script:');
+testParent.innerHTML = '<marquee id="marquee" loop="5">test</marquee>';
+marquee = document.getElementById('marquee');
+marquee.loop = -1;
+shouldBe('marquee.loop', '-1');
+
+var successfullyParsed = true;
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8235c95..138f7f4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2010-12-02 Andy Estes <aestes at apple.com>
+
+ Reviewed by Darin Adler.
+
+ Implement (non-EventListener) marquee IDL attributes from HTML5.
+ https://bugs.webkit.org/show_bug.cgi?id=49786
+
+ Test: fast/html/marquee-element.html
+
+ * html/HTMLMarqueeElement.cpp:
+ (WebCore::HTMLMarqueeElement::scrollAmount): If the content attribute
+ can be converted to a signed integer and is >= 0, return it.
+ Otherwise, return the default scrollAmount value.
+ (WebCore::HTMLMarqueeElement::setScrollAmount): Update the content
+ attribute if it is >= 0. Otherwise, raise INDEX_SIZE_ERR.
+ (WebCore::HTMLMarqueeElement::scrollDelay): Same as scrollAmount.
+ (WebCore::HTMLMarqueeElement::setScrollDelay): Same as setScrollAmount.
+ (WebCore::HTMLMarqueeElement::loop): If the content attribute can be
+ converted to a signed integer and is greater than 0 or equal to -1,
+ return it. Otherwise, return the default loop value.
+ (WebCore::HTMLMarqueeElement::setLoop): Update the content attribute if
+ it is greater than 0 or equal to -1. Otherwise, raise INDEX_SIZE_ERR.
+ * html/HTMLMarqueeElement.h:
+ * html/HTMLMarqueeElement.idl: Update the IDL to match what is in HTML5.
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::initialMarqueeSpeed):
+
2010-12-02 Patrick Gansterer <paroga at webkit.org>
Reviewed by Andreas Kling.
diff --git a/WebCore/html/HTMLMarqueeElement.cpp b/WebCore/html/HTMLMarqueeElement.cpp
index 8128188..e2dd640 100644
--- a/WebCore/html/HTMLMarqueeElement.cpp
+++ b/WebCore/html/HTMLMarqueeElement.cpp
@@ -127,6 +127,51 @@ void HTMLMarqueeElement::stop()
marqueeRenderer->stop();
}
+int HTMLMarqueeElement::scrollAmount() const
+{
+ bool ok;
+ int scrollAmount = fastGetAttribute(scrollamountAttr).toInt(&ok);
+ return ok && scrollAmount >= 0 ? scrollAmount : RenderStyle::initialMarqueeIncrement().value();
+}
+
+void HTMLMarqueeElement::setScrollAmount(int scrollAmount, ExceptionCode& ec)
+{
+ if (scrollAmount < 0)
+ ec = INDEX_SIZE_ERR;
+ else
+ setIntegralAttribute(scrollamountAttr, scrollAmount);
+}
+
+int HTMLMarqueeElement::scrollDelay() const
+{
+ bool ok;
+ int scrollDelay = fastGetAttribute(scrolldelayAttr).toInt(&ok);
+ return ok && scrollDelay >= 0 ? scrollDelay : RenderStyle::initialMarqueeSpeed();
+}
+
+void HTMLMarqueeElement::setScrollDelay(int scrollDelay, ExceptionCode& ec)
+{
+ if (scrollDelay < 0)
+ ec = INDEX_SIZE_ERR;
+ else
+ setIntegralAttribute(scrolldelayAttr, scrollDelay);
+}
+
+int HTMLMarqueeElement::loop() const
+{
+ bool ok;
+ int loopValue = fastGetAttribute(loopAttr).toInt(&ok);
+ return ok && loopValue > 0 ? loopValue : -1;
+}
+
+void HTMLMarqueeElement::setLoop(int loop, ExceptionCode& ec)
+{
+ if (loop <= 0 && loop != -1)
+ ec = INDEX_SIZE_ERR;
+ else
+ setIntegralAttribute(loopAttr, loop);
+}
+
bool HTMLMarqueeElement::canSuspend() const
{
return true;
diff --git a/WebCore/html/HTMLMarqueeElement.h b/WebCore/html/HTMLMarqueeElement.h
index a4825fc..586aa6f 100644
--- a/WebCore/html/HTMLMarqueeElement.h
+++ b/WebCore/html/HTMLMarqueeElement.h
@@ -41,6 +41,15 @@ public:
void start();
void stop();
+ int scrollAmount() const;
+ void setScrollAmount(int, ExceptionCode&);
+
+ int scrollDelay() const;
+ void setScrollDelay(int, ExceptionCode&);
+
+ int loop() const;
+ void setLoop(int, ExceptionCode&);
+
private:
HTMLMarqueeElement(const QualifiedName&, Document*);
diff --git a/WebCore/html/HTMLMarqueeElement.idl b/WebCore/html/HTMLMarqueeElement.idl
index 3659f81..3174fac 100644
--- a/WebCore/html/HTMLMarqueeElement.idl
+++ b/WebCore/html/HTMLMarqueeElement.idl
@@ -22,8 +22,23 @@ module html {
interface HTMLMarqueeElement : HTMLElement {
void start();
void stop();
+
+ attribute [Reflect] DOMString behavior;
+ attribute [Reflect] DOMString bgColor;
+ attribute [Reflect] DOMString direction;
+ attribute [Reflect] DOMString height;
+ attribute [Reflect] unsigned long hspace;
+ attribute long loop setter raises(DOMException);
+ attribute long scrollAmount setter raises(DOMException);
+ attribute long scrollDelay setter raises(DOMException);
+ attribute [Reflect] boolean trueSpeed;
+ attribute [Reflect] unsigned long vspace;
+ attribute [Reflect] DOMString width;
- // FIXME: Find out what WinIE exposes as attributes.
+ // FIXME: Implement the following event handler attributes
+ // https://bugs.webkit.org/show_bug.cgi?id=49788
+ // attribute EventListener onbounce;
+ // attribute EventListener onfinish;
+ // attribute EventListener onstart;
};
-
}
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 62c4548..aa5622a 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -1238,7 +1238,7 @@ public:
static EBoxSizing initialBoxSizing() { return CONTENT_BOX; }
static StyleReflection* initialBoxReflect() { return 0; }
static int initialMarqueeLoopCount() { return -1; }
- static int initialMarqueeSpeed() { return 85; }
+ static unsigned initialMarqueeSpeed() { return 85; }
static Length initialMarqueeIncrement() { return Length(6, Fixed); }
static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; }
static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list