Title: [123598] trunk
Revision
123598
Author
[email protected]
Date
2012-07-25 03:09:16 -0700 (Wed, 25 Jul 2012)

Log Message

A validation bubble should not be modifiable.
https://bugs.webkit.org/show_bug.cgi?id=92217

Reviewed by Kent Tamura.

Source/WebCore:

A user can set -webkit-user-modify: read-write to validation message elements.
This might cause a undesired crash like Bug 65738. They should be unmodifiable.

Test: fast/forms/validation-user-modify.html

* css/html.css:
Added -webkit-user-modify: read-only !important; for these elements so that they won't be
changed by a user.
(::-webkit-validation-bubble):
(::-webkit-validation-bubble-message):
(::-webkit-validation-bubble-text-block):
(::-webkit-validation-bubble-heading):
(::-webkit-validation-bubble-arrow):
(::-webkit-validation-bubble-arrow-clipper):

LayoutTests:

* fast/forms/validation-message-user-modify-expected.txt: Added.
* fast/forms/validation-message-user-modify.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (123597 => 123598)


--- trunk/LayoutTests/ChangeLog	2012-07-25 10:00:48 UTC (rev 123597)
+++ trunk/LayoutTests/ChangeLog	2012-07-25 10:09:16 UTC (rev 123598)
@@ -1,3 +1,13 @@
+2012-07-25  Shinya Kawanaka  <[email protected]>
+
+        A validation bubble should not be modifiable.
+        https://bugs.webkit.org/show_bug.cgi?id=92217
+
+        Reviewed by Kent Tamura.
+
+        * fast/forms/validation-message-user-modify-expected.txt: Added.
+        * fast/forms/validation-message-user-modify.html: Added.
+
 2012-07-25  Csaba Osztrogonác  <[email protected]>
 
         [Qt] Unreviewed gardening, update Qt5 specific test results.

Added: trunk/LayoutTests/fast/forms/validation-message-user-modify-expected.txt (0 => 123598)


--- trunk/LayoutTests/fast/forms/validation-message-user-modify-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/validation-message-user-modify-expected.txt	2012-07-25 10:09:16 UTC (rev 123598)
@@ -0,0 +1,8 @@
+The inner element of validation should not be modifiable.
+
+  
+PASS renderTreeAfterEditing is renderTreeBeforeEditing
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/forms/validation-message-user-modify.html (0 => 123598)


--- trunk/LayoutTests/fast/forms/validation-message-user-modify.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/validation-message-user-modify.html	2012-07-25 10:09:16 UTC (rev 123598)
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+::-webkit-validation-bubble,
+::-webkit-validation-bubble-message,
+::-webkit-validation-bubble-text-block,
+::-webkit-validation-bubble-heading,
+::-webkit-validation-bubble-arrow,
+::-webkit-validation-bubble-arrow-clipper
+{
+    -webkit-user-modify: read-write;
+}
+</style>
+</head>
+<body>
+<script src=""
+
+<p>The inner element of validation should not be modifiable.</p>
+
+<div id="container">
+    <form action=""
+        <input type="checkbox" id="checkbox" required>
+        <input type="submit" id="submit">
+    </form>
+</div>
+<pre id="console"></pre>
+
+<script>
+jsTestIsAsync = true;
+
+submit.click();
+
+var renderTreeBeforeEditing;
+var renderTreeAfterEditing;
+
+setTimeout(function() {
+    renderTreeBeforeEditing = internals.elementRenderTreeAsText(document.documentElement);
+
+    for (var i = -20; i < 50; i += 10) {
+        eventSender.mouseMoveTo(checkbox.offsetLeft + 20, checkbox.offsetTop + checkbox.offsetHeight + i);
+        eventSender.mouseDown();
+        eventSender.mouseUp();
+        eventSender.keyDown('delete');
+    }
+
+    renderTreeAfterEditing = internals.elementRenderTreeAsText(document.documentElement);
+    shouldBe("renderTreeAfterEditing", "renderTreeBeforeEditing");
+
+    finishJSTest();                          
+}, 0);
+
+var successfullyParsed = true;
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (123597 => 123598)


--- trunk/Source/WebCore/ChangeLog	2012-07-25 10:00:48 UTC (rev 123597)
+++ trunk/Source/WebCore/ChangeLog	2012-07-25 10:09:16 UTC (rev 123598)
@@ -1,3 +1,25 @@
+2012-07-25  Shinya Kawanaka  <[email protected]>
+
+        A validation bubble should not be modifiable.
+        https://bugs.webkit.org/show_bug.cgi?id=92217
+
+        Reviewed by Kent Tamura.
+
+        A user can set -webkit-user-modify: read-write to validation message elements.
+        This might cause a undesired crash like Bug 65738. They should be unmodifiable.
+
+        Test: fast/forms/validation-user-modify.html
+
+        * css/html.css:
+        Added -webkit-user-modify: read-only !important; for these elements so that they won't be
+        changed by a user.
+        (::-webkit-validation-bubble):
+        (::-webkit-validation-bubble-message):
+        (::-webkit-validation-bubble-text-block):
+        (::-webkit-validation-bubble-heading):
+        (::-webkit-validation-bubble-arrow):
+        (::-webkit-validation-bubble-arrow-clipper):
+
 2012-07-25  Zeno Albisser  <[email protected]>
 
         [Qt][WK2] Disable CopyToTexture for GraphicsSurfaceMac.

Modified: trunk/Source/WebCore/css/html.css (123597 => 123598)


--- trunk/Source/WebCore/css/html.css	2012-07-25 10:00:48 UTC (rev 123597)
+++ trunk/Source/WebCore/css/html.css	2012-07-25 10:09:16 UTC (rev 123598)
@@ -745,6 +745,7 @@
     margin: 0;
     -webkit-text-security: none;
     -webkit-transition: opacity 05.5s ease;
+    -webkit-user-modify: read-only !important;
 }
 
 ::-webkit-validation-bubble-message {
@@ -762,6 +763,7 @@
     -webkit-box-shadow: 4px 4px 4px rgba(100,100,100,0.6),
         inset -2px -2px 1px #d0c4c4,
         inset 2px 2px 1px white;
+    -webkit-user-modify: read-only !important;
     line-height: normal;
     white-space: normal;
     z-index: 2147483644;
@@ -769,10 +771,12 @@
 
 ::-webkit-validation-bubble-text-block {
     -webkit-box-flex: 1;
+    -webkit-user-modify: read-only !important;
 }
 
 ::-webkit-validation-bubble-heading {
     font-weight: bold;
+    -webkit-user-modify: read-only !important;
 }
 
 ::-webkit-validation-bubble-arrow {
@@ -788,6 +792,7 @@
     box-shadow: inset 2px 2px 1px white;
     -webkit-transform-origin: 0 0;
     -webkit-transform: rotate(45deg);
+    -webkit-user-modify: read-only !important;
     z-index: 2147483645;
 }
 
@@ -795,6 +800,7 @@
     display: block;
     overflow: hidden;
     height: 16px;
+    -webkit-user-modify: read-only !important;
 }
 
 #if defined(ENABLE_METER_ELEMENT) && ENABLE_METER_ELEMENT
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to