Index: chrome/test/data/password/between_parsing_and_rendering.html |
diff --git a/chrome/test/data/password/between_parsing_and_rendering.html b/chrome/test/data/password/between_parsing_and_rendering.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0be8473802e196f4e1b8d30d14f81eb03668ff48 |
--- /dev/null |
+++ b/chrome/test/data/password/between_parsing_and_rendering.html |
@@ -0,0 +1,93 @@ |
+<!-- |
+This page enables to simulate the following scenario: |
+Once a page body, but not the entire frame, is loaded, a |
+password form is dynamically created and added to the page |
+body. |
+ |
+Three main points to note: |
+1. The form only gets created after the body loads. Therefore |
+ the form is not registered during form parsing stage |
+ (as in PasswordManager::OnPasswordFormsParsed). |
+2. The form gets created before the rendering stage, so it gets |
+ registered during PasswordManager::OnPasswordFormsRendered. |
+3. The form gets created before the main frame loads. Therefore |
+ the form is not registered during OnDynamicFormsSeen. |
+ |
+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.
|
+contains a strange stylesheet, distilled from a much bigger stylesheet |
+included in the current live.com website (that's where |
+http://crbug.com/367768 was demonstrated). The style uses |
+some webkit-only rules for background properties. |
+--> |
+<html> |
+ <head> |
+ <script> |
+function createForm() { |
+ var form = document.createElement('form'); |
+ form.setAttribute('action', 'done.html'); |
+ |
+ var username_label = document.createElement('label'); |
+ username_label.setAttribute('for', 'username'); |
+ username_label.innerText = 'Username: '; |
+ var username = document.createElement('input'); |
+ username.type = 'text'; |
+ username.name = 'username'; |
+ username.id = 'username'; |
+ |
+ var password_label = document.createElement('label'); |
+ password_label.innerText = 'Password: '; |
+ password_label.setAttribute('for', 'password'); |
+ var password = document.createElement('input'); |
+ password.type = 'password'; |
+ password.name = 'password'; |
+ password.id = 'password'; |
+ |
+ var submit = document.createElement('input'); |
+ submit.type = 'submit'; |
+ submit.id = 'submit-button'; |
+ submit.value = 'Submit'; |
+ |
+ form.appendChild(username_label); |
+ form.appendChild(username); |
+ form.appendChild(password_label); |
+ form.appendChild(password); |
+ form.appendChild(submit); |
+ |
+ return form; |
+} |
+ |
+function addForm(form) { |
+ document.getElementsByTagName('body')[0].appendChild(form); |
+} |
+ |
+function onLoadHandler() { |
+ addForm(createForm()); |
+} |
+ </script> |
+ <style> |
+::-webkit-scrollbar{ |
+ background-color:#abc; |
+} |
+::-webkit-scrollbar:disabled{ |
+ background-color:#abc |
+} |
+::-webkit-scrollbar-button{ |
+ background-color:#abc; |
+ background-image:url(nonexistent_image.png); |
+} |
+::-webkit-scrollbar-button:hover{ |
+ background-color:#abc |
+} |
+::-webkit-scrollbar-button:active{ |
+ background-color:#abc |
+} |
+::-webkit-scrollbar-button:disabled{ |
+ background-color:#abc |
+} |
+ </style> |
+ <title>Test dynamically created password form</title> |
+ </head> |
+ <body onload="onLoadHandler();"> |
+This page is not empty. |
+ </body> |
+</html> |