Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: LayoutTests/fast/css/disabled-form-control-elements-should-not-be-active.html

Issue 340143002: Disabled form control elements should not be active (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review Comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css/disabled-form-control-elements-should-not-be-active-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/disabled-form-control-elements-should-not-be-active.html
diff --git a/LayoutTests/fast/css/disabled-form-control-elements-should-not-be-active.html b/LayoutTests/fast/css/disabled-form-control-elements-should-not-be-active.html
new file mode 100644
index 0000000000000000000000000000000000000000..87b9e3f4f4a8f6cbba89344011be002a3510c5a3
--- /dev/null
+++ b/LayoutTests/fast/css/disabled-form-control-elements-should-not-be-active.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<style>
+#outbox {
+ background-color: #00ff00;
+ width: 100px;
+ height: 100px;
+}
+#outbox:active {
+ background-color: #ff0000;
+}
+</style>
+<script src='../../resources/js-test.js'></script>
+<div id='outbox'>
+ <button disabled>Click Me!</button>
+</div>
+
+<script>
+function shouldHaveBackground(element, bg) {
+ background = getComputedStyle(element, null).getPropertyValue('background-color');
+ shouldBeEqualToString('background', bg);
+}
+description('Style :active should not be applied for disabled Form Control elements');
+if (window.testRunner) {
+ var box = document.getElementById('outbox');
+
+ eventSender.dragMode = false;
+
+ var button = document.querySelector('button');
+ var buttonRect = button.getBoundingClientRect();
+ // Click the button.
+ eventSender.mouseMoveTo(buttonRect.left + 5, buttonRect.top + 5);
+ eventSender.mouseDown();
+ shouldHaveBackground(box, 'rgb(0, 255, 0)');
+ eventSender.mouseUp();
+}
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/disabled-form-control-elements-should-not-be-active-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698