[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

adele at apple.com adele at apple.com
Thu Feb 4 21:25:01 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 92677d15c5be394ace11a431d7cb0ae8c0e3377e
Author: adele at apple.com <adele at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 22 20:06:46 2010 +0000

    An element that doesn't validate and an invalid element shouldn't share style
    https://bugs.webkit.org/show_bug.cgi?id=34010
    
    Reviewed by Dan Bernstein.
    
    Test: fast/css/pseudo-invalid-novalidate-001.html
    
    * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::canShareStyleWithElement):
      Separate the check for willValidate from the check for isValidFormControlElement.
    * html/HTMLFormControlElement.h: The validity method doesn't need to be virtual.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53709 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/fast/css/pseudo-invalid-novalidate-001-expected.txt b/LayoutTests/fast/css/pseudo-invalid-novalidate-001-expected.txt
new file mode 100644
index 0000000..b746a98
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-invalid-novalidate-001-expected.txt
@@ -0,0 +1,12 @@
+This test checks that an input element that doesn't validate and an invalid input don't share style.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+ 
+PASS document.defaultView.getComputedStyle(v[0], null).getPropertyValue('background-color') is 'rgb(0, 0, 255)'
+PASS document.defaultView.getComputedStyle(v[1], null).getPropertyValue('background-color') is 'rgb(0, 255, 0)'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/pseudo-invalid-novalidate-001.html b/LayoutTests/fast/css/pseudo-invalid-novalidate-001.html
new file mode 100644
index 0000000..e3aa518
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-invalid-novalidate-001.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+<style>
+ :invalid { background: lime; }
+ :valid { background: red; }
+ input { background: blue; }
+</style>
+</head>
+<body>
+<p id="description"></p>
+<form method="get">
+<input type="text" required/>
+<input name="victim" type="text" value="Loremipsum" pattern="Lorem ipsum"/>
+</form>
+<div id="console"></div>
+<script>
+description("This test checks that an input element that doesn't validate and an invalid input don't share style.");
+
+v = document.getElementsByTagName("input");
+
+shouldBe("document.defaultView.getComputedStyle(v[0], null).getPropertyValue('background-color')", "'rgb(0, 0, 255)'");
+shouldBe("document.defaultView.getComputedStyle(v[1], null).getPropertyValue('background-color')", "'rgb(0, 255, 0)'");
+
+var successfullyParsed = true;
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 27fd89a..225cda5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-22  Adele Peterson  <adele at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        An element that doesn't validate and an invalid element shouldn't share style
+        https://bugs.webkit.org/show_bug.cgi?id=34010
+
+        Test: fast/css/pseudo-invalid-novalidate-001.html
+
+        * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::canShareStyleWithElement): 
+          Separate the check for willValidate from the check for isValidFormControlElement.
+        * html/HTMLFormControlElement.h: The validity method doesn't need to be virtual.
+
 2010-01-22  Steve Falkenburg  <sfalken at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 6c8f854..017b425 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -1001,9 +1001,12 @@ bool CSSStyleSelector::canShareStyleWithElement(Node* n)
 
                 if (s->isDefaultButtonForForm() != m_element->isDefaultButtonForForm())
                     return false;
-
-                if ((s->willValidate() && s->isValidFormControlElement()) !=
-                    (m_element->willValidate() && m_element->isValidFormControlElement()))
+                
+                bool willValidate = s->willValidate();
+                if (willValidate != m_element->willValidate())
+                    return false;
+                
+                if (willValidate && (s->isValidFormControlElement() != m_element->isValidFormControlElement()))
                     return false;
             }
 
diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h
index 01a7684..358546b 100644
--- a/WebCore/html/HTMLFormControlElement.h
+++ b/WebCore/html/HTMLFormControlElement.h
@@ -43,7 +43,7 @@ public:
     virtual int tagPriority() const { return 1; }
 
     HTMLFormElement* form() const { return m_form; }
-    virtual ValidityState* validity();
+    ValidityState* validity();
 
     bool formNoValidate() const;
     void setFormNoValidate(bool);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list