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

Side by Side Diff: LayoutTests/editing/pasteboard/input-with-display-none-div.html

Issue 222023002: focus() behaviour differs depending on how value is set (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding fix for LayoutTest that are failing Created 6 years, 8 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <style type="text/css"> 4 <style type="text/css">
5 div { display: none; } 5 div { display: none; }
6 </style> 6 </style>
7 </head> 7 </head>
8 <body> 8 <body>
9 <p>This tests pasting (InsertHTML) into an input element with a CSS rule div { d isplay: none}. 9 <p>This tests pasting (InsertHTML) into an input element with a CSS rule div { d isplay: none}.
10 You should see PASS below.</p> 10 You should see PASS below.</p>
11 <input type="text" value="FAIL"> 11 <input type="text" value="FAIL">
12 <p><script> 12 <p><script>
13 13
14 if (window.testRunner) 14 if (window.testRunner)
15 testRunner.dumpAsText(); 15 testRunner.dumpAsText();
16 16
17 var input = document.querySelector('input'); 17 var input = document.querySelector('input');
18 input.focus(); 18 input.select();
tkent 2014/04/11 06:27:17 Why does the test work? We need focus() to make t
harpreet.sk 2014/04/11 07:33:02 Added focus().
tkent 2014/04/11 07:40:20 What's the answer of the question? Why it worked?
harpreet.sk 2014/04/11 08:09:14 For the given layout tests it worked because focus
tkent 2014/04/11 08:19:41 I'm asking if execCommand('InsertHTML', ...) works
harpreet.sk 2014/04/11 08:37:56 Yes it works without focus() and using select() al
tkent 2014/04/11 08:42:14 Thanks. Hmm, it sounds a bug. Anyway, we may proc
19 document.execCommand('InsertHTML', false, 'PASS'); 19 document.execCommand('InsertHTML', false, 'PASS');
20 20
21 document.write(input.value); 21 document.write(input.value);
22 22
23 </script></p> 23 </script></p>
24 </body> 24 </body>
25 </html> 25 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698