Chromium Code Reviews| 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..68b63df96101d5675c986b7523f98e5e9a8e9c2f | 
| --- /dev/null | 
| +++ b/LayoutTests/fast/css/disabled-form-control-elements-should-not-be-active.html | 
| @@ -0,0 +1,41 @@ | 
| +<!DOCTYPE html> | 
| +<style> | 
| +#outbox { | 
| + background-color: #00ff00; | 
| + width: 100px; | 
| + height: 100px; | 
| +} | 
| +#outbox:active { | 
| + background-color: #ff0000; | 
| +} | 
| +</style> | 
| + | 
| +<div id="outbox"> | 
| + <button disabled>Click Me!</button> | 
| +</div> | 
| +<pre id="description"></pre> | 
| 
 
tkent
2014/06/18 23:53:36
This element is unnecessary.  js-test.js generates
 
spartha
2014/06/19 07:57:18
Done.
 
 | 
| +<pre id="console"></pre> | 
| 
 
tkent
2014/06/18 23:53:37
Ditto.
 
spartha
2014/06/19 07:57:18
Done.
 
 | 
| + | 
| +<script src="../../resources/js-test.js"></script> | 
| +<script> | 
| + function shouldHaveBackground(element, bg) { | 
| 
 
tkent
2014/06/18 23:53:37
Do not indent the top-level code.
<script>
functi
 
spartha
2014/06/19 07:57:18
Done.
 
 | 
| + background = getComputedStyle(element, null).getPropertyValue("background-color"); | 
| + shouldBeEqualToString('background', bg); | 
| + } | 
| + | 
| + description("Style :active should not be applied for disabled Form Control elements"); | 
| 
 
tkent
2014/06/18 23:53:37
Inconsistent quotes.  Other code use single-quotes
 
spartha
2014/06/19 07:57:18
Done.
 
 | 
| + | 
| + 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> |