Reviewed by Maciej.
Fix <rdar://problem/
5452112>
REGRESSION: Initially focused textfield on www.mac.com login page has no insertion point, and doesn't accept typed characters
Use updateLayoutIgnorePendingStylesheets() instead of updateLayout(). We need to have rendering to set input focus.
Test: fast/forms/focus-style-pending.html
* dom/Element.cpp:
(WebCore::Element::focus):
LayoutTests:
Reviewed by Maciej.
Test for <rdar://problem/
5452112>
REGRESSION: Initially focused textfield on www.mac.com login page has no insertion point, and doesn't accept typed characters
* fast/forms/focus-style-pending-expected.txt: Added.
* fast/forms/focus-style-pending.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25353
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-09-04 Antti Koivisto <antti@apple.com>
+
+ Reviewed by Maciej.
+
+ Test for <rdar://problem/5452112>
+ REGRESSION: Initially focused textfield on www.mac.com login page has no insertion point, and doesn't accept typed characters
+
+ * fast/forms/focus-style-pending-expected.txt: Added.
+ * fast/forms/focus-style-pending.html: Added.
+
2007-09-01 Darin Adler <darin@apple.com>
- rolled out the test case for 12988 until we re-fix it
--- /dev/null
+Test that focus() sets input focus correctly even when there are pending stylesheet loads.
+
+PASS
--- /dev/null
+<html>
+<link rel=stylesheet href="data:text/css,bogus{}">
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+</script>
+<body>
+Test that focus() sets input focus correctly even when there are pending stylesheet loads.<br>
+<input id=t>
+<script>
+var t = document.getElementById('t');
+t.focus();
+var s = window.getSelection();
+document.write('<br>' + (s.focusNode ? "<span style='color:green'>PASS</span>" : "<span style='color:red'>FAIL</span>"));
+</script>
+2007-09-04 Antti Koivisto <antti@apple.com>
+
+ Reviewed by Maciej.
+
+ Fix <rdar://problem/5452112>
+ REGRESSION: Initially focused textfield on www.mac.com login page has no insertion point, and doesn't accept typed characters
+
+ Use updateLayoutIgnorePendingStylesheets() instead of updateLayout(). We need to have rendering to set input focus.
+
+ Test: fast/forms/focus-style-pending.html
+
+ * dom/Element.cpp:
+ (WebCore::Element::focus):
+
2007-09-04 Girish Ramakrishnan <girish@trolltech.com>
Reviewed by Simon.
if (doc->focusedNode() == this)
return;
- doc->updateLayout();
+ doc->updateLayoutIgnorePendingStylesheets();
if (!supportsFocus())
return;