Title: [222166] trunk/Source/WebCore
- Revision
- 222166
- Author
- [email protected]
- Date
- 2017-09-18 11:21:17 -0700 (Mon, 18 Sep 2017)
Log Message
Rolling out the previous to land again with a test.
* dom/Document.cpp:
(WebCore::Document::setFocusedElement):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didBlur):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (222165 => 222166)
--- trunk/Source/WebCore/ChangeLog 2017-09-18 18:17:18 UTC (rev 222165)
+++ trunk/Source/WebCore/ChangeLog 2017-09-18 18:21:17 UTC (rev 222166)
@@ -1,5 +1,14 @@
2017-09-18 Antti Koivisto <[email protected]>
+ Rolling out the previous to land again with a test.
+
+ * dom/Document.cpp:
+ (WebCore::Document::setFocusedElement):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::didBlur):
+
+2017-09-18 Antti Koivisto <[email protected]>
+
Avoid style resolution when clearing focused element.
https://bugs.webkit.org/show_bug.cgi?id=176224
<rdar://problem/34206409>
Modified: trunk/Source/WebCore/dom/Document.cpp (222165 => 222166)
--- trunk/Source/WebCore/dom/Document.cpp 2017-09-18 18:17:18 UTC (rev 222165)
+++ trunk/Source/WebCore/dom/Document.cpp 2017-09-18 18:21:17 UTC (rev 222166)
@@ -3840,14 +3840,8 @@
view()->setFocus(false);
}
- if (is<HTMLInputElement>(oldFocusedElement.get())) {
- // HTMLInputElement::didBlur just scrolls text fields back to the beginning.
- // FIXME: This could be done asynchronusly.
- // Updating style may dispatch events due to PostResolutionCallback
- if (eventsMode == FocusRemovalEventsMode::Dispatch)
- updateStyleIfNeeded();
+ if (is<HTMLInputElement>(oldFocusedElement.get()))
downcast<HTMLInputElement>(*oldFocusedElement).didBlur();
- }
}
if (newFocusedElement && newFocusedElement->isFocusable()) {
@@ -3921,10 +3915,7 @@
page()->chrome().focusedElementChanged(m_focusedElement.get());
SetFocusedNodeDone:
- // Updating style may dispatch events due to PostResolutionCallback
- // FIXME: Why is synchronous style update needed here at all?
- if (eventsMode == FocusRemovalEventsMode::Dispatch)
- updateStyleIfNeeded();
+ updateStyleIfNeeded();
return !focusChangeBlocked;
}
Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (222165 => 222166)
--- trunk/Source/WebCore/html/HTMLInputElement.cpp 2017-09-18 18:17:18 UTC (rev 222165)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp 2017-09-18 18:21:17 UTC (rev 222166)
@@ -1122,6 +1122,9 @@
void HTMLInputElement::didBlur()
{
+ // We need to update style here, rather than in InputType itself, since style recomputation may fire events
+ // that could change the input's type.
+ document().updateStyleIfNeeded();
m_inputType->elementDidBlur();
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes