[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

tonyg at chromium.org tonyg at chromium.org
Fri Jan 21 15:11:56 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 9bf73bcafd58f7574b86ae3757ed89df6e37ec6b
Author: tonyg at chromium.org <tonyg at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Jan 9 01:31:10 2011 +0000

    2011-01-08  Tony Gentilcore  <tonyg at chromium.org>
    
            Reviewed by Eric Seidel.
    
            HTML5 Conformance Test failure: approved/xhtml5/html_style_in_comment.xhtml
            https://bugs.webkit.org/show_bug.cgi?id=48593
    
            * fast/parser/html-html-comment-in-style-block-expected.txt: Added.
            * fast/parser/html-html-comment-in-style-block.html: Added.
            * fast/parser/xhtml-html-comment-in-style-block-expected.txt: Added.
            * fast/parser/xhtml-html-comment-in-style-block.xhtml: Added.
    2011-01-08  Tony Gentilcore  <tonyg at chromium.org>
    
            Reviewed by Eric Seidel.
    
            HTML5 Conformance Test failure: approved/xhtml5/html_style_in_comment.xhtml
            https://bugs.webkit.org/show_bug.cgi?id=48593
    
            XHTML <style> blocks, unlike HTML <style> blocks, should respect HTML
            comments.
    
            Test: fast/parser/xhtml-html-comment-in-style-block.xhtml
    
            * dom/StyleElement.cpp:
            (WebCore::isValidStyleChild): Remove the COMMENT_NODE check as the HTML parser doesn't add COMMENT_NODEs as children of style blocks.
            (WebCore::StyleElement::process): Factored out a condition that must remain in sync.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75338 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9cb1e4f..09b906f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-08  Tony Gentilcore  <tonyg at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        HTML5 Conformance Test failure: approved/xhtml5/html_style_in_comment.xhtml
+        https://bugs.webkit.org/show_bug.cgi?id=48593
+
+        * fast/parser/html-html-comment-in-style-block-expected.txt: Added.
+        * fast/parser/html-html-comment-in-style-block.html: Added.
+        * fast/parser/xhtml-html-comment-in-style-block-expected.txt: Added.
+        * fast/parser/xhtml-html-comment-in-style-block.xhtml: Added.
+
 2011-01-08  Charlie Reis  <creis at chromium.org>
 
         Reviewed by Mihai Parparita.
diff --git a/LayoutTests/fast/parser/html-html-comment-in-style-block-expected.txt b/LayoutTests/fast/parser/html-html-comment-in-style-block-expected.txt
new file mode 100644
index 0000000..69c75d0
--- /dev/null
+++ b/LayoutTests/fast/parser/html-html-comment-in-style-block-expected.txt
@@ -0,0 +1,3 @@
+This page tests that style written inside an HTML comment is applied.
+
+PASS
diff --git a/LayoutTests/fast/parser/html-html-comment-in-style-block.html b/LayoutTests/fast/parser/html-html-comment-in-style-block.html
new file mode 100644
index 0000000..6782850
--- /dev/null
+++ b/LayoutTests/fast/parser/html-html-comment-in-style-block.html
@@ -0,0 +1,22 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+</script>
+<style type="text/css">
+.pass {display: none}
+.fail {display: block}
+<!--
+.pass {display: block}
+.fail {display: none}
+-->
+</style>
+</head>
+<body>
+<p>This page tests that style written inside an HTML comment is applied.
+</p>
+<span class="pass">PASS</span>
+<span class="fail">FAIL</span>
+</body>
+</html>
diff --git a/LayoutTests/fast/parser/xhtml-html-comment-in-style-block-expected.txt b/LayoutTests/fast/parser/xhtml-html-comment-in-style-block-expected.txt
new file mode 100644
index 0000000..9b643c3
--- /dev/null
+++ b/LayoutTests/fast/parser/xhtml-html-comment-in-style-block-expected.txt
@@ -0,0 +1,3 @@
+This page tests that style written inside an HTML comment is not applied. See: http://test.w3.org/html/tests/approved/xhtml5/html_style_in_comment.xhtml
+
+PASS
diff --git a/LayoutTests/fast/parser/xhtml-html-comment-in-style-block.xhtml b/LayoutTests/fast/parser/xhtml-html-comment-in-style-block.xhtml
new file mode 100644
index 0000000..39697e8
--- /dev/null
+++ b/LayoutTests/fast/parser/xhtml-html-comment-in-style-block.xhtml
@@ -0,0 +1,23 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+</script>
+<style type="text/css">
+.pass {display: block}
+.fail {display: none}
+<!--
+.pass {display: none}
+.fail {display: block}
+-->
+</style>
+</head>
+<body>
+<p>This page tests that style written inside an HTML comment is not applied. See:
+http://test.w3.org/html/tests/approved/xhtml5/html_style_in_comment.xhtml
+</p>
+<span class="pass">PASS</span>
+<span class="fail">FAIL</span>
+</body>
+</html>
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 0d7e1e1..5d69faa 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2011-01-08  Tony Gentilcore  <tonyg at chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        HTML5 Conformance Test failure: approved/xhtml5/html_style_in_comment.xhtml
+        https://bugs.webkit.org/show_bug.cgi?id=48593
+
+        XHTML <style> blocks, unlike HTML <style> blocks, should respect HTML
+        comments.
+
+        Test: fast/parser/xhtml-html-comment-in-style-block.xhtml
+
+        * dom/StyleElement.cpp:
+        (WebCore::isValidStyleChild): Remove the COMMENT_NODE check as the HTML parser doesn't add COMMENT_NODEs as children of style blocks.
+        (WebCore::StyleElement::process): Factored out a condition that must remain in sync.
+
 2011-01-08  Benjamin Poulain  <benjamin.poulain at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/Source/WebCore/dom/StyleElement.cpp b/Source/WebCore/dom/StyleElement.cpp
index 157e8f9..31c0947 100644
--- a/Source/WebCore/dom/StyleElement.cpp
+++ b/Source/WebCore/dom/StyleElement.cpp
@@ -30,6 +30,13 @@
 
 namespace WebCore {
 
+static bool isValidStyleChild(Node* node)
+{
+    ASSERT(node);
+    Node::NodeType nodeType = node->nodeType();
+    return nodeType == Node::TEXT_NODE || nodeType == Node::CDATA_SECTION_NODE;
+}
+    
 StyleElement::StyleElement(Document* document, bool createdByParser)
     : m_createdByParser(createdByParser)
     , m_loading(false)
@@ -94,8 +101,7 @@ void StyleElement::process(Element* e)
 
     unsigned resultLength = 0;
     for (Node* c = e->firstChild(); c; c = c->nextSibling()) {
-        Node::NodeType nodeType = c->nodeType();
-        if (nodeType == Node::TEXT_NODE || nodeType == Node::CDATA_SECTION_NODE || nodeType == Node::COMMENT_NODE)
+        if (isValidStyleChild(c))
             resultLength += c->nodeValue().length();
     }
     UChar* text;
@@ -103,8 +109,7 @@ void StyleElement::process(Element* e)
 
     UChar* p = text;
     for (Node* c = e->firstChild(); c; c = c->nextSibling()) {
-        Node::NodeType nodeType = c->nodeType();
-        if (nodeType == Node::TEXT_NODE || nodeType == Node::CDATA_SECTION_NODE || nodeType == Node::COMMENT_NODE) {
+        if (isValidStyleChild(c)) {
             String nodeValue = c->nodeValue();
             unsigned nodeLength = nodeValue.length();
             memcpy(p, nodeValue.characters(), nodeLength * sizeof(UChar));

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list