[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

rwlbuis at webkit.org rwlbuis at webkit.org
Wed Dec 22 11:16:58 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8b2a8b4736c959591337c6817151892ffe53ae28
Author: rwlbuis at webkit.org <rwlbuis at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 16 16:50:51 2010 +0000

    2010-07-15  Rob Buis  <rwlbuis at gmail.com>
    
            Reviewed by Darin Adler.
    
            An empty value for xml:lang isn't considered
            https://bugs.webkit.org/show_bug.cgi?id=42042
    
            Allow :lang selector to match empty values for xml:lang and
            lang attributes.
    
            Test: fast/css/lang-selector-empty-attribute.xhtml
    
            * css/CSSStyleSelector.cpp:
            (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63560 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index db44167..e762409 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-07-15  Rob Buis  <rwlbuis at gmail.com>
+
+        Reviewed by Darin Adler.
+
+        Add test for:
+        An empty value for xml:lang isn't considered
+        https://bugs.webkit.org/show_bug.cgi?id=42042
+
+        * fast/css/lang-selector-empty-attribute-expected.txt: Added.
+        * fast/css/lang-selector-empty-attribute.xhtml: Added.
+
 2010-07-15  Tony Gentilcore  <tonyg at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/LayoutTests/fast/css/lang-selector-empty-attribute-expected.txt b/LayoutTests/fast/css/lang-selector-empty-attribute-expected.txt
new file mode 100644
index 0000000..190e781
--- /dev/null
+++ b/LayoutTests/fast/css/lang-selector-empty-attribute-expected.txt
@@ -0,0 +1,3 @@
+Tests if empty language declarations are supported
+
+SUCCESS
diff --git a/LayoutTests/fast/css/lang-selector-empty-attribute.xhtml b/LayoutTests/fast/css/lang-selector-empty-attribute.xhtml
new file mode 100644
index 0000000..2f39e61
--- /dev/null
+++ b/LayoutTests/fast/css/lang-selector-empty-attribute.xhtml
@@ -0,0 +1,44 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <style type="text/css">
+      span {background: white;display:none}
+      span:lang(de) {background: red}
+    </style>
+    <script>
+      function log(message) {
+        document.getElementById("console").innerHTML += message;
+      }
+
+      function test() {
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+
+        var i = document.getElementById("emptyLang");
+        if (document.defaultView.getComputedStyle(i, null).getPropertyValue('background-color') != "rgb(255, 255, 255)") {
+            log("FAILURE");
+            return;
+        }
+        var i2 = document.getElementById("emptyXmlLang");
+        if (document.defaultView.getComputedStyle(i2, null).getPropertyValue('background-color') != "rgb(255, 255, 255)") {
+            log("FAILURE");
+            return;
+       }
+        var i3 = document.getElementById("noLang");
+        if (document.defaultView.getComputedStyle(i3, null).getPropertyValue('background-color') != "rgb(255, 0, 0)") {
+            log("FAILURE");
+            return;
+        }
+        log("SUCCESS");
+      }
+    </script>
+  </head>
+  <body onload="test()">
+    <p>Tests if empty language declarations are supported</p>
+    <p xml:lang="de">
+      <span lang="" id="emptyLang"/>
+      <span xml:lang="" id="emptyXmlLang"/>
+      <span id="noLang"/>
+    </p>
+    <div id="console"></div>
+  </body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7e02040..4558db6 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-07-15  Rob Buis  <rwlbuis at gmail.com>
+
+        Reviewed by Darin Adler.
+
+        An empty value for xml:lang isn't considered
+        https://bugs.webkit.org/show_bug.cgi?id=42042
+
+        Allow :lang selector to match empty values for xml:lang and
+        lang attributes.
+
+        Test: fast/css/lang-selector-empty-attribute.xhtml
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
+
 2010-07-16  Alexander Pavlov  <apavlov at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index cc4841d..0184d15 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -2600,11 +2600,11 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
                 AtomicString value;
                 // The language property is inherited, so we iterate over the parents
                 // to find the first language.
-                while (n && value.isEmpty()) {
+                while (n && value.isNull()) {
                     if (n->isElementNode()) {
                         // Spec: xml:lang takes precedence -- http://www.w3.org/TR/xhtml1/#C_7
                         value = static_cast<Element*>(n)->fastGetAttribute(XMLNames::langAttr);
-                        if (value.isEmpty())
+                        if (value.isNull())
                             value = static_cast<Element*>(n)->fastGetAttribute(langAttr);
                     } else if (n->isDocumentNode())
                         // checking the MIME content-language
@@ -2613,7 +2613,7 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
                     n = n->parent();
                 }
                 const AtomicString& argument = sel->argument();
-                if (value.isEmpty() || !value.startsWith(argument, false))
+                if (value.isNull() || !value.startsWith(argument, false))
                     break;
                 if (value.length() != argument.length() && value[argument.length()] != '-')
                     break;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list