Title: [156387] trunk
Revision
156387
Author
[email protected]
Date
2013-09-25 05:21:41 -0700 (Wed, 25 Sep 2013)

Log Message

:read-write pseudo-class should not be applied on <input type="text" disabled>
https://bugs.webkit.org/show_bug.cgi?id=118236

Patch by Gurpreet Kaur <[email protected]> on 2013-09-25
Reviewed by Darin Adler.

Source/WebCore:

The :read-write pseudo-class must match any element falling into one
of the following categories i.e
input elements to which the readonly attribute applies, and that are mutable
(i.e. that do not have the readonly attribute specified and that are not disabled)
textarea elements that do not have a readonly attribute, and that are not disabled
elements that are editing hosts or editable and are neither input elements nor
textarea elements.

Test: fast/css/readwrite-pseudoclass-input.html

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::matchesReadWritePseudoClass):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::matchesReadWritePseudoClass):
Checking for both readonly and disabled attribute on input ane textarea element.

LayoutTests:

* fast/css/readwrite-pseudoclass-input-expected.txt: Added.
* fast/css/readwrite-pseudoclass-input.html: Added.
Added test case to verify that :read-write pseudo-class properties are
are not applied to disabled input and textarea elements.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (156386 => 156387)


--- trunk/LayoutTests/ChangeLog	2013-09-25 11:02:23 UTC (rev 156386)
+++ trunk/LayoutTests/ChangeLog	2013-09-25 12:21:41 UTC (rev 156387)
@@ -1,3 +1,15 @@
+2013-09-25  Gurpreet Kaur  <[email protected]>
+
+        :read-write pseudo-class should not be applied on <input type="text" disabled>
+        https://bugs.webkit.org/show_bug.cgi?id=118236
+
+        Reviewed by Darin Adler.
+
+        * fast/css/readwrite-pseudoclass-input-expected.txt: Added.
+        * fast/css/readwrite-pseudoclass-input.html: Added.
+        Added test case to verify that :read-write pseudo-class properties are
+        are not applied to disabled input and textarea elements.
+
 2013-09-25  Krzysztof Czech  <[email protected]>
 
         [EFL] accessibility/loading-iframe-sends-notification.html is failing

Added: trunk/LayoutTests/fast/css/readwrite-pseudoclass-input-expected.txt (0 => 156387)


--- trunk/LayoutTests/fast/css/readwrite-pseudoclass-input-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readwrite-pseudoclass-input-expected.txt	2013-09-25 12:21:41 UTC (rev 156387)
@@ -0,0 +1,11 @@
+Tests read-write pseudo-class properties are not applied to disabled input and textarea elements
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.getComputedStyle(document.getElementById('inputdisabled'),null).getPropertyValue('background-color') is not "rgb(255, 0, 0)"
+PASS window.getComputedStyle(document.getElementById('textareadisabled'),null).getPropertyValue('background-color') is not "rgb(255, 0, 0)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+         
Property changes on: trunk/LayoutTests/fast/css/readwrite-pseudoclass-input-expected.txt
___________________________________________________________________

Added: svn:executable

Added: trunk/LayoutTests/fast/css/readwrite-pseudoclass-input.html (0 => 156387)


--- trunk/LayoutTests/fast/css/readwrite-pseudoclass-input.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/readwrite-pseudoclass-input.html	2013-09-25 12:21:41 UTC (rev 156387)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <script src=""
+        <script>
+            function runTest() {
+                description('Tests read-write pseudo-class properties are not applied to disabled input and textarea elements');
+
+                shouldNotBeEqualToString("window.getComputedStyle(document.getElementById('inputdisabled'),null).getPropertyValue('background-color')","rgb(255, 0, 0)");
+                shouldNotBeEqualToString("window.getComputedStyle(document.getElementById('textareadisabled'),null).getPropertyValue('background-color')","rgb(255, 0, 0)");
+                isSuccessfullyParsed();
+            }
+        </script>
+        <style>
+            :read-write {
+                background-color: red;
+            }
+        </style>
+    </head>
+    <body _onload_="runTest()">
+        <input type="text"/>
+        <input type="text" readonly />
+        <input type="text" disabled id="inputdisabled"/>
+
+        <textarea></textarea>
+        <textarea readonly></textarea>
+        <textarea disabled id="textareadisabled"></textarea>
+    </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/fast/css/readwrite-pseudoclass-input.html
___________________________________________________________________

Added: svn:executable

Modified: trunk/Source/WebCore/ChangeLog (156386 => 156387)


--- trunk/Source/WebCore/ChangeLog	2013-09-25 11:02:23 UTC (rev 156386)
+++ trunk/Source/WebCore/ChangeLog	2013-09-25 12:21:41 UTC (rev 156387)
@@ -1,3 +1,26 @@
+2013-09-25  Gurpreet Kaur  <[email protected]>
+
+        :read-write pseudo-class should not be applied on <input type="text" disabled>
+        https://bugs.webkit.org/show_bug.cgi?id=118236
+
+        Reviewed by Darin Adler.
+
+        The :read-write pseudo-class must match any element falling into one
+        of the following categories i.e
+        input elements to which the readonly attribute applies, and that are mutable
+        (i.e. that do not have the readonly attribute specified and that are not disabled)
+        textarea elements that do not have a readonly attribute, and that are not disabled
+        elements that are editing hosts or editable and are neither input elements nor
+        textarea elements.
+
+        Test: fast/css/readwrite-pseudoclass-input.html
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::matchesReadWritePseudoClass):
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::matchesReadWritePseudoClass):
+        Checking for both readonly and disabled attribute on input ane textarea element.
+
 2013-09-25  Krzysztof Czech  <[email protected]>
 
         [EFL] accessibility/loading-iframe-sends-notification.html is failing

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (156386 => 156387)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2013-09-25 11:02:23 UTC (rev 156386)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2013-09-25 12:21:41 UTC (rev 156387)
@@ -1463,7 +1463,7 @@
 
 bool HTMLInputElement::matchesReadWritePseudoClass() const
 {
-    return m_inputType->supportsReadOnly() && !isReadOnly();
+    return m_inputType->supportsReadOnly() && !isDisabledOrReadOnly();
 }
 
 void HTMLInputElement::addSearchResult()

Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (156386 => 156387)


--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp	2013-09-25 11:02:23 UTC (rev 156386)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp	2013-09-25 12:21:41 UTC (rev 156387)
@@ -523,7 +523,7 @@
 
 bool HTMLTextAreaElement::matchesReadWritePseudoClass() const
 {
-    return !isReadOnly();
+    return !isDisabledOrReadOnly();
 }
 
 void HTMLTextAreaElement::updatePlaceholderText()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to