[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
tkent at chromium.org
tkent at chromium.org
Wed Jan 6 00:02:45 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 0de5564e355dca9c0ced0e0b9afc724c312eb0b6
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Dec 26 05:26:59 2009 +0000
2009-12-25 Kent Tamura <tkent at chromium.org>
Reviewed by Darin Adler.
Implement HTML5 section element.
https://bugs.webkit.org/show_bug.cgi?id=32936
<section> should behave the same as <nav>.
Test: fast/html/section-element.html
* css/html.css: Add section as a block element.
* editing/htmlediting.cpp:
(WebCore::validBlockTag): Add sectionTag.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::tagPriority): Returns 5 for sectionTag.
(WebCore::blockTagList): Add sectionTag.
* html/HTMLParser.cpp:
(WebCore::HTMLParser::getNode): Add sectionTag.
* html/HTMLTagNames.in: Add section.
2009-12-25 Kent Tamura <tkent at chromium.org>
Reviewed by Darin Adler.
Implement HTML5 section element.
https://bugs.webkit.org/show_bug.cgi?id=32936
The new test file tests:
- <p> closing,
- Residual style, and
- FormatBlock.
* fast/html/script-tests/TEMPLATE.html: Added.
* fast/html/script-tests/section-element.js: Added.
* fast/html/section-element-expected.txt: Added.
* fast/html/section-element.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 8c642f1..169449c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2009-12-25 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Implement HTML5 section element.
+ https://bugs.webkit.org/show_bug.cgi?id=32936
+
+ The new test file tests:
+ - <p> closing,
+ - Residual style, and
+ - FormatBlock.
+
+ * fast/html/script-tests/TEMPLATE.html: Added.
+ * fast/html/script-tests/section-element.js: Added.
+ * fast/html/section-element-expected.txt: Added.
+ * fast/html/section-element.html: Added.
+
2009-12-25 Csaba Osztrogonác <ossy at webkit.org>
Rubber-stamped by Simon Hausmann.
diff --git a/LayoutTests/editing/execCommand/script-tests/TEMPLATE.html b/LayoutTests/fast/html/script-tests/TEMPLATE.html
similarity index 100%
copy from LayoutTests/editing/execCommand/script-tests/TEMPLATE.html
copy to LayoutTests/fast/html/script-tests/TEMPLATE.html
diff --git a/LayoutTests/fast/html/script-tests/section-element.js b/LayoutTests/fast/html/script-tests/section-element.js
new file mode 100644
index 0000000..b6f141f
--- /dev/null
+++ b/LayoutTests/fast/html/script-tests/section-element.js
@@ -0,0 +1,43 @@
+description('Various tests for the section element.');
+
+var testParent = document.createElement('div');
+document.body.appendChild(testParent);
+
+debug('<section> closes <p>:');
+testParent.innerHTML = '<p>Test that <section id="section1">a section element</nav> closes <p>.</p>';
+var section1 = document.getElementById('section1');
+shouldBeFalse('section1.parentNode.nodeName == "p"');
+
+debug('<p> does not close <section>:');
+testParent.innerHTML = '<section>Test that <p id="p1">a p element</p> does not close a section element.</section>';
+var p1 = document.getElementById('p1');
+shouldBe('p1.parentNode.nodeName', '"SECTION"');
+
+debug('<section> can be nested inside <section>:');
+testParent.innerHTML = '<section id="section2">Test that <section id="section3">a section element</section> can be nested inside another.</section>';
+var section3 = document.getElementById('section3');
+shouldBe('section3.parentNode.id', '"section2"');
+
+debug('Residual style:');
+testParent.innerHTML = '<b><section id="section4">This text should be bold.</section> <span id="span1">This is also bold.</span></b>';
+function getWeight(id) {
+ return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue('font-weight');
+}
+shouldBe('getWeight("section4")', '"bold"');
+shouldBe('getWeight("span1")', '"bold"');
+document.body.removeChild(testParent);
+
+debug('FormatBlock:');
+var editable = document.createElement('div');
+editable.innerHTML = '[<span id="span2">The text will be a child of <section>.</span>]';
+document.body.appendChild(editable);
+editable.contentEditable = true;
+var selection = window.getSelection();
+selection.selectAllChildren(editable);
+document.execCommand('FormatBlock', false, 'section');
+selection.collapse();
+shouldBe('document.getElementById("span2").parentNode.nodeName', '"SECTION"');
+document.body.removeChild(editable);
+
+var successfullyParsed = true;
+
diff --git a/LayoutTests/fast/html/section-element-expected.txt b/LayoutTests/fast/html/section-element-expected.txt
new file mode 100644
index 0000000..c637cf1
--- /dev/null
+++ b/LayoutTests/fast/html/section-element-expected.txt
@@ -0,0 +1,20 @@
+Various tests for the section element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+<section> closes <p>:
+PASS section1.parentNode.nodeName == "p" is false
+<p> does not close <section>:
+PASS p1.parentNode.nodeName is "SECTION"
+<section> can be nested inside <section>:
+PASS section3.parentNode.id is "section2"
+Residual style:
+PASS getWeight("section4") is "bold"
+PASS getWeight("span1") is "bold"
+FormatBlock:
+PASS document.getElementById("span2").parentNode.nodeName is "SECTION"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/html/section-element.html b/LayoutTests/fast/html/section-element.html
new file mode 100644
index 0000000..7b55a22
--- /dev/null
+++ b/LayoutTests/fast/html/section-element.html
@@ -0,0 +1,13 @@
+<!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>
+<script src="script-tests/section-element.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5dda417..cb5d619 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2009-12-25 Kent Tamura <tkent at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Implement HTML5 section element.
+ https://bugs.webkit.org/show_bug.cgi?id=32936
+
+ <section> should behave the same as <nav>.
+
+ Test: fast/html/section-element.html
+
+ * css/html.css: Add section as a block element.
+ * editing/htmlediting.cpp:
+ (WebCore::validBlockTag): Add sectionTag.
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::tagPriority): Returns 5 for sectionTag.
+ (WebCore::blockTagList): Add sectionTag.
+ * html/HTMLParser.cpp:
+ (WebCore::HTMLParser::getNode): Add sectionTag.
+ * html/HTMLTagNames.in: Add section.
+
2009-12-25 Daniel Bates <dbates at webkit.org>
Reviewed by Adam Barth.
diff --git a/WebCore/css/html.css b/WebCore/css/html.css
index c0e75ca..101af2b 100644
--- a/WebCore/css/html.css
+++ b/WebCore/css/html.css
@@ -72,7 +72,7 @@ layer {
display: block
}
-nav {
+nav, section {
display: block
}
diff --git a/WebCore/editing/htmlediting.cpp b/WebCore/editing/htmlediting.cpp
index 9cd2a8e..36f8fa0 100644
--- a/WebCore/editing/htmlediting.cpp
+++ b/WebCore/editing/htmlediting.cpp
@@ -488,6 +488,7 @@ bool validBlockTag(const AtomicString& blockTag)
blockTags.add(navTag.localName());
blockTags.add(pTag.localName());
blockTags.add(preTag.localName());
+ blockTags.add(sectionTag.localName());
}
return blockTags.contains(blockTag);
}
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index f8ba820..3fc4448 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -88,8 +88,8 @@ int HTMLElement::tagPriority() const
return 0;
if (hasLocalName(addressTag) || hasLocalName(ddTag) || hasLocalName(dtTag) || hasLocalName(noscriptTag) || hasLocalName(rpTag) || hasLocalName(rtTag))
return 3;
- if (hasLocalName(centerTag) || hasLocalName(nobrTag) || hasLocalName(rubyTag) || hasLocalName(navTag))
- return 5;
+ if (hasLocalName(centerTag) || hasLocalName(nobrTag) || hasLocalName(rubyTag) || hasLocalName(navTag) || hasLocalName(sectionTag))
+ return 5; // Same as <div>.
if (hasLocalName(noembedTag) || hasLocalName(noframesTag))
return 10;
@@ -895,6 +895,7 @@ static HashSet<AtomicStringImpl*>* blockTagList()
tagList.add(pTag.localName().impl());
tagList.add(plaintextTag.localName().impl());
tagList.add(preTag.localName().impl());
+ tagList.add(sectionTag.localName().impl());
tagList.add(tableTag.localName().impl());
tagList.add(ulTag.localName().impl());
tagList.add(xmpTag.localName().impl());
diff --git a/WebCore/html/HTMLParser.cpp b/WebCore/html/HTMLParser.cpp
index b64ca7f..f472e8f 100644
--- a/WebCore/html/HTMLParser.cpp
+++ b/WebCore/html/HTMLParser.cpp
@@ -951,6 +951,7 @@ PassRefPtr<Node> HTMLParser::getNode(Token* t)
gFunctionMap.set(rpTag.localName().impl(), &HTMLParser::rpCreateErrorCheck);
gFunctionMap.set(rtTag.localName().impl(), &HTMLParser::rtCreateErrorCheck);
gFunctionMap.set(sTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck);
+ gFunctionMap.set(sectionTag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
gFunctionMap.set(selectTag.localName().impl(), &HTMLParser::selectCreateErrorCheck);
gFunctionMap.set(smallTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck);
gFunctionMap.set(strikeTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck);
diff --git a/WebCore/html/HTMLTagNames.in b/WebCore/html/HTMLTagNames.in
index 8842b23..58f159b 100644
--- a/WebCore/html/HTMLTagNames.in
+++ b/WebCore/html/HTMLTagNames.in
@@ -92,6 +92,7 @@ ruby interfaceName=HTMLElement
s interfaceName=HTMLElement
samp interfaceName=HTMLElement
script constructorNeedsCreatedByParser, createWithNew
+section interfaceName=HTMLElement
select constructorNeedsFormElement, createWithNew
small interfaceName=HTMLElement
source wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, createWithNew
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list