Title: [227041] branches/safari-605-branch/Source/WebCore
- Revision
- 227041
- Author
- [email protected]
- Date
- 2018-01-16 21:05:02 -0800 (Tue, 16 Jan 2018)
Log Message
Cherry-pick r227006. rdar://problem/36567998
Modified Paths
Diff
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (227040 => 227041)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-17 05:04:59 UTC (rev 227040)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-17 05:05:02 UTC (rev 227041)
@@ -1,5 +1,30 @@
2018-01-16 Jason Marcell <[email protected]>
+ Cherry-pick r227006. rdar://problem/36567998
+
+ 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 Jason Marcell <[email protected]>
+
Cherry-pick r227000. rdar://problem/36567987
2018-01-16 Simon Fraser <[email protected]>
Modified: branches/safari-605-branch/Source/WebCore/accessibility/AccessibilityObject.cpp (227040 => 227041)
--- branches/safari-605-branch/Source/WebCore/accessibility/AccessibilityObject.cpp 2018-01-17 05:04:59 UTC (rev 227040)
+++ branches/safari-605-branch/Source/WebCore/accessibility/AccessibilityObject.cpp 2018-01-17 05:05:02 UTC (rev 227041)
@@ -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: branches/safari-605-branch/Source/WebCore/dom/Document.cpp (227040 => 227041)
--- branches/safari-605-branch/Source/WebCore/dom/Document.cpp 2018-01-17 05:04:59 UTC (rev 227040)
+++ branches/safari-605-branch/Source/WebCore/dom/Document.cpp 2018-01-17 05:05:02 UTC (rev 227041)
@@ -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: branches/safari-605-branch/Source/WebCore/dom/Document.h (227040 => 227041)
--- branches/safari-605-branch/Source/WebCore/dom/Document.h 2018-01-17 05:04:59 UTC (rev 227040)
+++ branches/safari-605-branch/Source/WebCore/dom/Document.h 2018-01-17 05:05:02 UTC (rev 227041)
@@ -1250,6 +1250,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