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 To make sure the frame loads after the form creation, this page | |
Garrett Casto
2014/06/19 00:05:40
I think that this comment isn't quite accurate. I
vabr (Chromium)
2014/06/20 07:55:07
Agreed. I tried to amend the comment.
| |
17 contains a strange stylesheet, distilled from a much bigger stylesheet | |
18 included in the current live.com website (that's where | |
19 http://crbug.com/367768 was demonstrated). The style uses | |
20 some webkit-only rules for background properties. | |
21 --> | |
22 <html> | |
23 <head> | |
24 <script> | |
25 function createForm() { | |
26 var form = document.createElement('form'); | |
27 form.setAttribute('action', 'done.html'); | |
28 | |
29 var username_label = document.createElement('label'); | |
30 username_label.setAttribute('for', 'username'); | |
31 username_label.innerText = 'Username: '; | |
32 var username = document.createElement('input'); | |
33 username.type = 'text'; | |
34 username.name = 'username'; | |
35 username.id = 'username'; | |
36 | |
37 var password_label = document.createElement('label'); | |
38 password_label.innerText = 'Password: '; | |
39 password_label.setAttribute('for', 'password'); | |
40 var password = document.createElement('input'); | |
41 password.type = 'password'; | |
42 password.name = 'password'; | |
43 password.id = 'password'; | |
44 | |
45 var submit = document.createElement('input'); | |
46 submit.type = 'submit'; | |
47 submit.id = 'submit-button'; | |
48 submit.value = 'Submit'; | |
49 | |
50 form.appendChild(username_label); | |
51 form.appendChild(username); | |
52 form.appendChild(password_label); | |
53 form.appendChild(password); | |
54 form.appendChild(submit); | |
55 | |
56 return form; | |
57 } | |
58 | |
59 function addForm(form) { | |
60 document.getElementsByTagName('body')[0].appendChild(form); | |
61 } | |
62 | |
63 function onLoadHandler() { | |
64 addForm(createForm()); | |
65 } | |
66 </script> | |
67 <style> | |
68 ::-webkit-scrollbar{ | |
69 background-color:#abc; | |
70 } | |
71 ::-webkit-scrollbar:disabled{ | |
72 background-color:#abc | |
73 } | |
74 ::-webkit-scrollbar-button{ | |
75 background-color:#abc; | |
76 background-image:url(nonexistent_image.png); | |
77 } | |
78 ::-webkit-scrollbar-button:hover{ | |
79 background-color:#abc | |
80 } | |
81 ::-webkit-scrollbar-button:active{ | |
82 background-color:#abc | |
83 } | |
84 ::-webkit-scrollbar-button:disabled{ | |
85 background-color:#abc | |
86 } | |
87 </style> | |
88 <title>Test dynamically created password form</title> | |
89 </head> | |
90 <body onload="onLoadHandler();"> | |
91 This page is not empty. | |
92 </body> | |
93 </html> | |
OLD | NEW |