Title: [227006] trunk/Source/WebCore
- Revision
- 227006
- Author
- [email protected]
- Date
- 2018-01-16 15:06:54 -0800 (Tue, 16 Jan 2018)
Log Message
AX: Do not trigger layout in updateBackingStore() unless it is safe to do so
https://bugs.webkit.org/show_bug.cgi?id=181703
<rdar://problem/36365706>
Reviewed by Ryosuke Niwa.
Document::isSafeToUpdateStyleOrLayout() can tell whether it is safe to run layout.
Unable to create test with WebInspector involved.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore):
* dom/Document.cpp:
(WebCore::Document::isSafeToUpdateStyleOrLayout const):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayout):
(WebCore::isSafeToUpdateStyleOrLayout): Deleted.
* dom/Document.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (227005 => 227006)
--- trunk/Source/WebCore/ChangeLog 2018-01-16 22:52:47 UTC (rev 227005)
+++ trunk/Source/WebCore/ChangeLog 2018-01-16 23:06:54 UTC (rev 227006)
@@ -1,3 +1,24 @@
+2018-01-16 Zalan Bujtas <[email protected]>
+
+ AX: Do not trigger layout in updateBackingStore() unless it is safe to do so
+ https://bugs.webkit.org/show_bug.cgi?id=181703
+ <rdar://problem/36365706>
+
+ Reviewed by Ryosuke Niwa.
+
+ Document::isSafeToUpdateStyleOrLayout() can tell whether it is safe to run layout.
+
+ Unable to create test with WebInspector involved.
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::AccessibilityObject::updateBackingStore):
+ * dom/Document.cpp:
+ (WebCore::Document::isSafeToUpdateStyleOrLayout const):
+ (WebCore::Document::updateStyleIfNeeded):
+ (WebCore::Document::updateLayout):
+ (WebCore::isSafeToUpdateStyleOrLayout): Deleted.
+ * dom/Document.h:
+
2018-01-16 Ryan Haddad <[email protected]>
Unreviewed, rolling out r226962.
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (227005 => 227006)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2018-01-16 22:52:47 UTC (rev 227005)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2018-01-16 23:06:54 UTC (rev 227006)
@@ -1768,12 +1768,10 @@
{
// Updating the layout may delete this object.
RefPtr<AccessibilityObject> protectedThis(this);
-
- if (Document* document = this->document()) {
- if (!document->view()->layoutContext().isInRenderTreeLayout() && !document->inRenderTreeUpdate())
+ if (auto* document = this->document()) {
+ if (!document->view()->layoutContext().isInRenderTreeLayout() && !document->inRenderTreeUpdate() && document->isSafeToUpdateStyleOrLayout())
document->updateLayoutIgnorePendingStylesheets();
}
-
updateChildrenIfNecessary();
}
#endif
Modified: trunk/Source/WebCore/dom/Document.cpp (227005 => 227006)
--- trunk/Source/WebCore/dom/Document.cpp 2018-01-16 22:52:47 UTC (rev 227005)
+++ trunk/Source/WebCore/dom/Document.cpp 2018-01-16 23:06:54 UTC (rev 227006)
@@ -1936,10 +1936,10 @@
return false;
}
-inline bool static isSafeToUpdateStyleOrLayout(FrameView* frameView)
+bool Document::isSafeToUpdateStyleOrLayout() const
{
bool isSafeToExecuteScript = ScriptDisallowedScope::InMainThread::isScriptAllowed();
- bool isInFrameFlattening = frameView && frameView->isInChildFrameWithFrameFlattening();
+ bool isInFrameFlattening = view() && view()->isInChildFrameWithFrameFlattening();
return isSafeToExecuteScript || isInFrameFlattening || !isInWebProcess();
}
@@ -1961,7 +1961,7 @@
}
// The early exit above for !needsStyleRecalc() is needed when updateWidgetPositions() is called in runOrScheduleAsynchronousTasks().
- RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(isSafeToUpdateStyleOrLayout(frameView.get()));
+ RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(isSafeToUpdateStyleOrLayout());
resolveStyle();
return true;
@@ -1977,7 +1977,7 @@
ASSERT_NOT_REACHED();
return;
}
- RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(isSafeToUpdateStyleOrLayout(frameView.get()));
+ RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(isSafeToUpdateStyleOrLayout());
RenderView::RepaintRegionAccumulator repaintRegionAccumulator(renderView());
Modified: trunk/Source/WebCore/dom/Document.h (227005 => 227006)
--- trunk/Source/WebCore/dom/Document.h 2018-01-16 22:52:47 UTC (rev 227005)
+++ trunk/Source/WebCore/dom/Document.h 2018-01-16 23:06:54 UTC (rev 227006)
@@ -1251,6 +1251,7 @@
bool inStyleRecalc() const { return m_inStyleRecalc; }
bool inRenderTreeUpdate() const { return m_inRenderTreeUpdate; }
+ bool isSafeToUpdateStyleOrLayout() const;
void updateTextRenderer(Text&, unsigned offsetOfReplacedText, unsigned lengthOfReplacedText);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes