OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 This page enables to simulate the following scenario: |
| 3 Once a page body, but not the entire frame, is loaded, a |
| 4 password form is dynamically created and added to the page |
| 5 body. |
| 6 |
| 7 Three main points to note: |
| 8 1. The form only gets created after the body loads. Therefore |
| 9 the form is not registered during form parsing stage |
| 10 (as in PasswordManager::OnPasswordFormsParsed). |
| 11 2. The form gets created before the rendering stage, so it gets |
| 12 registered during PasswordManager::OnPasswordFormsRendered. |
| 13 3. The form gets created before the main frame loads. Therefore |
| 14 the form is not registered during OnDynamicFormsSeen. |
| 15 |
| 16 The goal is to make sure that there is enough time between the form |
| 17 creation and the frame load, so that OnDynamicFormsSeen is not |
| 18 triggered for the created form after frame load. To achieve that, |
| 19 this page contains a strange stylesheet, distilled from a much bigger |
| 20 stylesheet included in the current live.com website (that's where |
| 21 http://crbug.com/367768 was demonstrated). The style uses |
| 22 some webkit-only rules for background properties. |
| 23 --> |
| 24 <html> |
| 25 <head> |
| 26 <script> |
| 27 function createForm() { |
| 28 var form = document.createElement('form'); |
| 29 form.setAttribute('action', 'done.html'); |
| 30 |
| 31 var username_label = document.createElement('label'); |
| 32 username_label.setAttribute('for', 'username'); |
| 33 username_label.innerText = 'Username: '; |
| 34 var username = document.createElement('input'); |
| 35 username.type = 'text'; |
| 36 username.name = 'username'; |
| 37 username.id = 'username'; |
| 38 |
| 39 var password_label = document.createElement('label'); |
| 40 password_label.innerText = 'Password: '; |
| 41 password_label.setAttribute('for', 'password'); |
| 42 var password = document.createElement('input'); |
| 43 password.type = 'password'; |
| 44 password.name = 'password'; |
| 45 password.id = 'password'; |
| 46 |
| 47 var submit = document.createElement('input'); |
| 48 submit.type = 'submit'; |
| 49 submit.id = 'submit-button'; |
| 50 submit.value = 'Submit'; |
| 51 |
| 52 form.appendChild(username_label); |
| 53 form.appendChild(username); |
| 54 form.appendChild(password_label); |
| 55 form.appendChild(password); |
| 56 form.appendChild(submit); |
| 57 |
| 58 return form; |
| 59 } |
| 60 |
| 61 function addForm(form) { |
| 62 document.getElementsByTagName('body')[0].appendChild(form); |
| 63 } |
| 64 |
| 65 function onLoadHandler() { |
| 66 addForm(createForm()); |
| 67 } |
| 68 </script> |
| 69 <style> |
| 70 ::-webkit-scrollbar{ |
| 71 background-color:#abc; |
| 72 } |
| 73 ::-webkit-scrollbar:disabled{ |
| 74 background-color:#abc |
| 75 } |
| 76 ::-webkit-scrollbar-button{ |
| 77 background-color:#abc; |
| 78 background-image:url(nonexistent_image.png); |
| 79 } |
| 80 ::-webkit-scrollbar-button:hover{ |
| 81 background-color:#abc |
| 82 } |
| 83 ::-webkit-scrollbar-button:active{ |
| 84 background-color:#abc |
| 85 } |
| 86 ::-webkit-scrollbar-button:disabled{ |
| 87 background-color:#abc |
| 88 } |
| 89 </style> |
| 90 <title>Test dynamically created password form</title> |
| 91 </head> |
| 92 <body onload="onLoadHandler();"> |
| 93 This page is not empty. |
| 94 </body> |
| 95 </html> |
OLD | NEW |