[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
mjs at apple.com
mjs at apple.com
Wed Dec 22 18:07:49 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit af4a5b06f37e655f9b1ed7510b7c6c187fd22392
Author: mjs at apple.com <mjs at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Dec 7 22:01:58 2010 +0000
2010-12-07 Maciej Stachowiak <mjs at apple.com>
Reviewed by Kent Tamura.
Implement HTML5 hidden attribute
https://bugs.webkit.org/show_bug.cgi?id=40511
* fast/forms/caret-rtl.html: Fixed a non-closed comment which added an "hidden" attribute.
* fast/html/hidden-attr-expected.txt: Added.
* fast/html/hidden-attr.html: Added. Test static and dynamic cases of hidden attribute.
2010-12-07 Maciej Stachowiak <mjs at apple.com>
Reviewed by Kent Tamura.
Implement HTML5 hidden attribute
https://bugs.webkit.org/show_bug.cgi?id=40511
Test: fast/html/hidden-attr.html
* html/HTMLElement.cpp:
(WebCore::HTMLElement::mapToEntry): Pick up hidden as a global mapped attribute.
(WebCore::HTMLElement::parseMappedAttribute): Map hidden attribute to display: none.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a059b26..47b674e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-12-07 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by Kent Tamura.
+
+ Implement HTML5 hidden attribute
+ https://bugs.webkit.org/show_bug.cgi?id=40511
+
+ * fast/forms/caret-rtl.html: Fixed a non-closed comment which added an "hidden" attribute.
+ * fast/html/hidden-attr-expected.txt: Added.
+ * fast/html/hidden-attr.html: Added. Test static and dynamic cases of hidden attribute.
+
2010-12-07 Philippe Normand <pnormand at igalia.com>
Reviewed by Gustavo Noronha Silva.
diff --git a/LayoutTests/fast/forms/caret-rtl.html b/LayoutTests/fast/forms/caret-rtl.html
index e523dc9..8bb4e85 100644
--- a/LayoutTests/fast/forms/caret-rtl.html
+++ b/LayoutTests/fast/forms/caret-rtl.html
@@ -18,7 +18,7 @@ This tests that clicking in a contenteditable div will set the caret in the righ
<p>
Click in the div, the caret should be on the right edge of the div.
</p>
-<div CONTENTEDITABLE id="test" style="direction: rtl; width:200px; font-size:2000%"; outline: solid thin; overflow: hidden></div>
+<div CONTENTEDITABLE id="test" style="direction: rtl; width:200px; font-size:2000%; outline: solid thin"></div>
</body>
<script> runTest(); </script>
</html>
diff --git a/LayoutTests/fast/html/hidden-attr-expected.txt b/LayoutTests/fast/html/hidden-attr-expected.txt
new file mode 100644
index 0000000..d6d12b5
--- /dev/null
+++ b/LayoutTests/fast/html/hidden-attr-expected.txt
@@ -0,0 +1,27 @@
+Various tests for the hidden attribute.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Tests that hidden in markup works:
+
+
+Tests that dynamically adding/removing hidden works:
+PASS - this line should appear
+
+Dynamic changing of hidden and effects on style:
+PASS getComputedStyle(test3, false).display is "none"
+test3.removeAttribute("hidden")
+PASS getComputedStyle(test3, false).display is "block"
+PASS getComputedStyle(test4, false).display is "block"
+test4.setAttribute("hidden", "")
+PASS getComputedStyle(test4, false).display is "none"
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
+
+a
diff --git a/LayoutTests/fast/html/hidden-attr.html b/LayoutTests/fast/html/hidden-attr.html
new file mode 100644
index 0000000..7f9af11
--- /dev/null
+++ b/LayoutTests/fast/html/hidden-attr.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<meta charset=utf8>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+
+<p id="description"></p>
+<div id="console">
+Tests that hidden in markup works:
+<div hidden><span class=fail>FAIL</span> - this line should not appear</div><div hidden=hidden><span class=fail>FAIL</span> - this line should not appear</div><div hidden=false><span class=fail>FAIL</span> - this line should not appear</div><p hidden><span class=fail>FAIL</span> - this line should not appear</p><span hidden><span class=fail>FAIL</span> - this line should not appear</span><img width=400px alt="FAIL - this should not appear" src="resources/xxx-missing.jpeg" hidden>
+
+Tests that dynamically adding/removing hidden works:
+<div hidden id=test1><span class=pass>PASS</span> - this line should appear<div id=test2><span class=fail>FAIL</span> - this line should not appear</div>
+</div>
+<script>
+description('Various tests for the hidden attribute.');
+
+document.getElementById("test1").removeAttribute("hidden");
+document.getElementById("test2").setAttribute("hidden", "");
+
+var testParent = document.createElement('div');
+document.body.appendChild(testParent);
+
+debug('Dynamic changing of hidden and effects on style:');
+testParent.innerHTML="<div id=test3 hidden>a</div><div id=test4>b</div>"
+var test3 = document.getElementById("test3");
+var test4 = document.getElementById("test4");
+
+shouldBe('getComputedStyle(test3, false).display', '"none"');
+test3.removeAttribute("hidden");
+debug('test3.removeAttribute("hidden")');
+shouldBe('getComputedStyle(test3, false).display', '"block"');
+
+shouldBe('getComputedStyle(test4, false).display', '"block"');
+test4.setAttribute("hidden", "");
+debug('test4.setAttribute("hidden", "")');
+shouldBe('getComputedStyle(test4, false).display', '"none"');
+
+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 fb95eb2..db93665 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-07 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by Kent Tamura.
+
+ Implement HTML5 hidden attribute
+ https://bugs.webkit.org/show_bug.cgi?id=40511
+
+ Test: fast/html/hidden-attr.html
+
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::mapToEntry): Pick up hidden as a global mapped attribute.
+ (WebCore::HTMLElement::parseMappedAttribute): Map hidden attribute to display: none.
+
2010-12-07 Kenneth Russell <kbr at google.com>
Reviewed by David Levin.
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index 4dcf998..d01a240 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -116,8 +116,9 @@ bool HTMLElement::ieForbidsInsertHTML() const
bool HTMLElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
{
- if (attrName == alignAttr ||
- attrName == contenteditableAttr) {
+ if (attrName == alignAttr
+ || attrName == contenteditableAttr
+ || attrName == hiddenAttr) {
result = eUniversal;
return false;
}
@@ -142,6 +143,8 @@ void HTMLElement::parseMappedAttribute(Attribute* attr)
addCSSProperty(attr, CSSPropertyTextAlign, attr->value());
} else if (attr->name() == contenteditableAttr) {
setContentEditable(attr);
+ } else if (attr->name() == hiddenAttr) {
+ addCSSProperty(attr, CSSPropertyDisplay, CSSValueNone);
} else if (attr->name() == tabindexAttr) {
indexstring = getAttribute(tabindexAttr);
int tabindex = 0;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list