[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

tkent at chromium.org tkent at chromium.org
Thu Apr 8 00:51:02 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 410b3919e785c3597e918c0a09f87be70d443f78
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 28 13:48:53 2009 +0000

    2009-12-28  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Maciej Stachowiak.
    
            Implement HTML5 <article> element.
            https://bugs.webkit.org/show_bug.cgi?id=32942
    
            The new test file tests:
            - <p> closing,
            - Residual style, and
            - FormatBlock.
    
            * fast/html/article-element-expected.txt: Added.
            * fast/html/article-element.html: Added.
            * fast/html/script-tests/article-element.js: Added.
    
    2009-12-28  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Maciej Stachowiak.
    
            Implement HTML5 <article> element.
            https://bugs.webkit.org/show_bug.cgi?id=32936
    
            <article> should behave the same as <nav> and <section>.
    
            Test: fast/html/article-element.html
    
            * css/html.css: Add article as a block element.
            * editing/htmlediting.cpp:
            (WebCore::validBlockTag): Add articleTag.
            * html/HTMLElement.cpp:
            (WebCore::HTMLElement::tagPriority): Returns 5 for articleTag.
            (WebCore::blockTagList): Add articleTag.
            * html/HTMLParser.cpp:
            (WebCore::HTMLParser::getNode): Add articleTag.
            * html/HTMLTagNames.in: Add article.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52596 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2e9b888..d6641e0 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2009-12-28  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Maciej Stachowiak.
+
+        Implement HTML5 <article> element.
+        https://bugs.webkit.org/show_bug.cgi?id=32942
+
+        The new test file tests:
+        - <p> closing,
+        - Residual style, and
+        - FormatBlock.
+
+        * fast/html/article-element-expected.txt: Added.
+        * fast/html/article-element.html: Added.
+        * fast/html/script-tests/article-element.js: Added.
+
 2009-12-27  Maciej Stachowiak  <mjs at apple.com>
 
         Rubber stamped by Adam Barth.
diff --git a/LayoutTests/fast/html/article-element-expected.txt b/LayoutTests/fast/html/article-element-expected.txt
new file mode 100644
index 0000000..f60ac38
--- /dev/null
+++ b/LayoutTests/fast/html/article-element-expected.txt
@@ -0,0 +1,20 @@
+Various tests for the article element.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+<article> closes <p>:
+PASS article1.parentNode.nodeName == "p" is false
+<p> does not close <article>:
+PASS p1.parentNode.nodeName is "ARTICLE"
+<article> can be nested inside <article>:
+PASS article3.parentNode.id is "article2"
+Residual style:
+PASS getWeight("article4") is "bold"
+PASS getWeight("span1") is "bold"
+FormatBlock:
+PASS document.getElementById("span2").parentNode.nodeName is "ARTICLE"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/html/article-element.html b/LayoutTests/fast/html/article-element.html
new file mode 100644
index 0000000..c0f4547
--- /dev/null
+++ b/LayoutTests/fast/html/article-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/article-element.js"></script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/html/script-tests/article-element.js b/LayoutTests/fast/html/script-tests/article-element.js
new file mode 100644
index 0000000..3e10150
--- /dev/null
+++ b/LayoutTests/fast/html/script-tests/article-element.js
@@ -0,0 +1,43 @@
+description('Various tests for the article element.');
+
+var testParent = document.createElement('div');
+document.body.appendChild(testParent);
+
+debug('&lt;article> closes &lt;p>:');
+testParent.innerHTML = '<p>Test that <article id="article1">an article element</nav> closes &lt;p>.</p>';
+var article1 = document.getElementById('article1');
+shouldBeFalse('article1.parentNode.nodeName == "p"');
+
+debug('&lt;p> does not close &lt;article>:');
+testParent.innerHTML = '<article>Test that <p id="p1">a p element</p> does not close an article element.</article>';
+var p1 = document.getElementById('p1');
+shouldBe('p1.parentNode.nodeName', '"ARTICLE"');
+
+debug('&lt;article> can be nested inside &lt;article>:');
+testParent.innerHTML = '<article id="article2">Test that <article id="article3">an article element</article> can be nested inside another.</article>';
+var article3 = document.getElementById('article3');
+shouldBe('article3.parentNode.id', '"article2"');
+
+debug('Residual style:');
+testParent.innerHTML = '<b><article id="article4">This text should be bold.</article> <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("article4")', '"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 &lt;article>.</span>]';
+document.body.appendChild(editable);
+editable.contentEditable = true;
+var selection = window.getSelection();
+selection.selectAllChildren(editable);
+document.execCommand('FormatBlock', false, 'article');
+selection.collapse();
+shouldBe('document.getElementById("span2").parentNode.nodeName', '"ARTICLE"');
+document.body.removeChild(editable);
+
+var successfullyParsed = true;
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5858a4f..832790b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2009-12-28  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Maciej Stachowiak.
+
+        Implement HTML5 <article> element.
+        https://bugs.webkit.org/show_bug.cgi?id=32936
+
+        <article> should behave the same as <nav> and <section>.
+
+        Test: fast/html/article-element.html
+
+        * css/html.css: Add article as a block element.
+        * editing/htmlediting.cpp:
+        (WebCore::validBlockTag): Add articleTag.
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::tagPriority): Returns 5 for articleTag.
+        (WebCore::blockTagList): Add articleTag.
+        * html/HTMLParser.cpp:
+        (WebCore::HTMLParser::getNode): Add articleTag.
+        * html/HTMLTagNames.in: Add article.
+
 2009-12-27  Jakub Wieczorek  <faw217 at gmail.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/css/html.css b/WebCore/css/html.css
index 101af2b..7b17739 100644
--- a/WebCore/css/html.css
+++ b/WebCore/css/html.css
@@ -72,7 +72,7 @@ layer {
     display: block
 }
 
-nav, section {
+article, nav, section {
     display: block
 }
 
diff --git a/WebCore/editing/htmlediting.cpp b/WebCore/editing/htmlediting.cpp
index 36f8fa0..02c8010 100644
--- a/WebCore/editing/htmlediting.cpp
+++ b/WebCore/editing/htmlediting.cpp
@@ -474,6 +474,7 @@ bool validBlockTag(const AtomicString& blockTag)
     DEFINE_STATIC_LOCAL(HashSet<AtomicString>, blockTags, ());
     if (blockTags.isEmpty()) {
         blockTags.add(addressTag.localName());
+        blockTags.add(articleTag.localName());
         blockTags.add(blockquoteTag.localName());
         blockTags.add(ddTag.localName());
         blockTags.add(divTag.localName());
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index 3fc4448..53577e6 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -88,7 +88,7 @@ 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) || hasLocalName(sectionTag))
+    if (hasLocalName(articleTag) || hasLocalName(centerTag) || hasLocalName(nobrTag) || hasLocalName(rubyTag) || hasLocalName(navTag) || hasLocalName(sectionTag))
         return 5; // Same as <div>.
     if (hasLocalName(noembedTag) || hasLocalName(noframesTag))
         return 10;
@@ -864,6 +864,7 @@ static HashSet<AtomicStringImpl*>* blockTagList()
     DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, tagList, ());
     if (tagList.isEmpty()) {
         tagList.add(addressTag.localName().impl());
+        tagList.add(articleTag.localName().impl());
         tagList.add(blockquoteTag.localName().impl());
         tagList.add(centerTag.localName().impl());
         tagList.add(ddTag.localName().impl());
diff --git a/WebCore/html/HTMLParser.cpp b/WebCore/html/HTMLParser.cpp
index f472e8f..02cf4ad 100644
--- a/WebCore/html/HTMLParser.cpp
+++ b/WebCore/html/HTMLParser.cpp
@@ -908,6 +908,7 @@ PassRefPtr<Node> HTMLParser::getNode(Token* t)
     if (gFunctionMap.isEmpty()) {
         gFunctionMap.set(aTag.localName().impl(), &HTMLParser::nestedCreateErrorCheck);
         gFunctionMap.set(addressTag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
+        gFunctionMap.set(articleTag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
         gFunctionMap.set(bTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck);
         gFunctionMap.set(bigTag.localName().impl(), &HTMLParser::nestedStyleCreateErrorCheck);
         gFunctionMap.set(blockquoteTag.localName().impl(), &HTMLParser::pCloserCreateErrorCheck);
diff --git a/WebCore/html/HTMLTagNames.in b/WebCore/html/HTMLTagNames.in
index 58f159b..d1d2715 100644
--- a/WebCore/html/HTMLTagNames.in
+++ b/WebCore/html/HTMLTagNames.in
@@ -8,6 +8,7 @@ acronym interfaceName=HTMLElement
 address interfaceName=HTMLElement
 applet
 area
+article interfaceName=HTMLElement
 audio wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, createWithNew
 b interfaceName=HTMLElement
 base createWithNew

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list