OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <style> | |
3 input { | |
4 height: 26px; | |
5 line-height: 29px; | |
6 padding: 0 5px; | |
7 border: none; | |
8 border-bottom: 1px solid #888; | |
9 outline: none; | |
10 } | |
11 </style> | |
12 <div>Both inputs should be of the same size and the placeholder should be at the same place.</div> | |
13 <div id="console"></div> | |
14 <input type="text" placeholder="placholder" data-offset-y="8"> | |
mstensho (USE GERRIT)
2015/12/04 12:55:54
Who is Plach, and why is he older?
Julien - ping for review
2015/12/04 14:45:42
http://theinfosphere.org/Claw-Plach !!!
| |
15 <input type="text" placeholder="placholder" data-offset-y="8"> | |
16 <script src="../../resources/check-layout.js"></script> | |
mstensho (USE GERRIT)
2015/12/04 12:55:54
There are attributes in this document that check-l
Julien - ping for review
2015/12/04 14:45:42
Doh', you're right. I tried to make it a checkLayo
| |
17 <script> | |
18 if (window.testRunner) { | |
19 testRunner.dumpAsText(); | |
20 testRunner.waitUntilDone(); | |
21 } | |
22 | |
23 var console = document.getElementById("console"); | |
24 var inputs = document.getElementsByTagName("input"); | |
25 | |
26 function log(msg) | |
27 { | |
28 console.appendChild(document.createTextNode(msg)); | |
29 console.appendChild(document.createElement("br")); | |
30 } | |
31 | |
32 function checkInputs() | |
33 { | |
34 var rect0 = inputs[0].getBoundingClientRect(); | |
35 var rect1 = inputs[1].getBoundingClientRect(); | |
36 if (rect0.top === rect1.top) { | |
37 log("PASSED, same top"); | |
mstensho (USE GERRIT)
2015/12/04 12:55:54
Couldn't you just use the shouldBe() thing in js-t
Julien - ping for review
2015/12/04 14:45:42
Done!
| |
38 } else { | |
39 log("FAILED top: got " + rect0.top + " and " + rect1.top); | |
40 } | |
41 | |
42 if (rect0.height === rect1.height) { | |
43 log("PASSED, same height"); | |
44 } else { | |
45 log("FAILED height: got " + rect0.height + " and " + rect1.height); | |
46 } | |
47 | |
48 if (window.testRunner) | |
49 testRunner.notifyDone(); | |
50 } | |
51 | |
52 inputs[1].focus(); | |
53 // Forcing a layout in this frame makes the issue disappear. | |
mstensho (USE GERRIT)
2015/12/04 12:55:54
Scary. But I guess there's no need to explain this
Julien - ping for review
2015/12/04 14:45:42
It's more of a warning to reviewer. I still think
mstensho (USE GERRIT)
2015/12/04 14:57:35
Absolutely. Sorry about being unclear. What I didn
| |
54 window.requestAnimationFrame(checkInputs); | |
55 </script> | |
OLD | NEW |