Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 1896793002: Rename (updateLayout/updateStyle).*.() to updateStyleAndLayout.*.() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index c8e19ff67dd7b76877a042ace84c8aa926ef0f41..f2db37214d4ddd36ac9c5b792313a3d928358dc7 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -638,7 +638,7 @@ Element* Document::rootScroller()
RootScroller* rootScroller = host->rootScroller();
DCHECK(rootScroller);
- updateLayoutIgnorePendingStylesheets();
+ updateStyleAndLayoutIgnorePendingStylesheets();
return rootScroller->get();
}
@@ -1158,7 +1158,7 @@ Element* Document::scrollingElement()
{
if (RuntimeEnabledFeatures::scrollTopLeftInteropEnabled()) {
if (inQuirksMode()) {
- updateLayoutTree();
+ updateStyleAndLayoutTree();
HTMLBodyElement* body = firstBodyElement();
if (body && body->layoutObject() && body->layoutObject()->hasOverflowClip())
return nullptr;
@@ -1694,7 +1694,7 @@ static void assertLayoutTreeUpdated(Node& root)
}
#endif
-void Document::updateLayoutTree()
+void Document::updateStyleAndLayoutTree()
{
DCHECK(isMainThread());
@@ -1729,8 +1729,8 @@ void Document::updateLayoutTree()
// someone managed to get into here in states not allowing tree mutations.
RELEASE_ASSERT(lifecycle().stateAllowsTreeMutations());
- TRACE_EVENT_BEGIN1("blink,devtools.timeline", "UpdateLayoutTree", "beginData", InspectorRecalculateStylesEvent::data(frame()));
- TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "UpdateLayoutTree");
+ TRACE_EVENT_BEGIN1("blink,devtools.timeline", "UpdateStyleAndLayoutTree", "beginData", InspectorRecalculateStylesEvent::data(frame()));
+ TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "UpdateStyleAndLayoutTree");
unsigned startElementCount = styleEngine().styleForElementCount();
@@ -1767,7 +1767,7 @@ void Document::updateLayoutTree()
unsigned elementCount = styleEngine().styleForElementCount() - startElementCount;
- TRACE_EVENT_END1("blink,devtools.timeline", "UpdateLayoutTree", "elementCount", elementCount);
+ TRACE_EVENT_END1("blink,devtools.timeline", "UpdateStyleAndLayoutTree", "elementCount", elementCount);
#if DCHECK_IS_ON()
assertLayoutTreeUpdated(*this);
@@ -1873,23 +1873,23 @@ bool Document::needsLayoutTreeUpdateForNode(const Node& node) const
return false;
}
-void Document::updateLayoutTreeForNode(const Node* node)
+void Document::updateStyleAndLayoutTreeForNode(const Node* node)
{
DCHECK(node);
if (!needsLayoutTreeUpdateForNode(*node))
return;
- updateLayoutTree();
+ updateStyleAndLayoutTree();
}
-void Document::updateLayoutIgnorePendingStylesheetsForNode(Node* node)
+void Document::updateStyleAndLayoutIgnorePendingStylesheetsForNode(Node* node)
{
DCHECK(node);
if (!node->inActiveDocument())
return;
- updateLayoutIgnorePendingStylesheets();
+ updateStyleAndLayoutIgnorePendingStylesheets();
}
-void Document::updateLayout()
+void Document::updateStyleAndLayout()
{
DCHECK(isMainThread());
@@ -1903,9 +1903,9 @@ void Document::updateLayout()
}
if (HTMLFrameOwnerElement* owner = ownerElement())
- owner->document().updateLayout();
+ owner->document().updateStyleAndLayout();
- updateLayoutTree();
+ updateStyleAndLayoutTree();
if (!isActive())
return;
@@ -1959,7 +1959,7 @@ void Document::clearFocusedElementSoon()
void Document::clearFocusedElementTimerFired(Timer<Document>*)
{
- updateLayoutTree();
+ updateStyleAndLayoutTree();
m_clearFocusedElementTimer.stop();
if (m_focusedElement && !m_focusedElement->isFocusable())
@@ -1972,7 +1972,7 @@ void Document::clearFocusedElementTimerFired(Timer<Document>*)
// stylesheets are loaded. Doing a layout ignoring the pending stylesheets
// lets us get reasonable answers. The long term solution to this problem is
// to instead suspend JavaScript execution.
-void Document::updateLayoutTreeIgnorePendingStylesheets()
+void Document::updateStyleAndLayoutTreeIgnorePendingStylesheets()
{
StyleEngine::IgnoringPendingStylesheet ignoring(styleEngine());
@@ -1995,13 +1995,13 @@ void Document::updateLayoutTreeIgnorePendingStylesheets()
setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CleanupPlaceholderStyles));
}
}
- updateLayoutTree();
+ updateStyleAndLayoutTree();
}
-void Document::updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks runPostLayoutTasks)
+void Document::updateStyleAndLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks runPostLayoutTasks)
{
- updateLayoutTreeIgnorePendingStylesheets();
- updateLayout();
+ updateStyleAndLayoutTreeIgnorePendingStylesheets();
+ updateStyleAndLayout();
if (runPostLayoutTasks == RunPostLayoutTasksSynchronously && view())
view()->flushAnyPendingPostLayoutTasks();
@@ -2670,7 +2670,7 @@ void Document::implicitClose()
// necessary and can in fact be actively harmful if pages are loading at a rate of > 60fps
// (if your platform is syncing flushes and limiting them to 60fps).
if (!ownerElement() || (ownerElement()->layoutObject() && !ownerElement()->layoutObject()->needsLayout())) {
- updateLayoutTree();
+ updateStyleAndLayoutTree();
// Always do a layout after loading if needed.
if (view() && layoutView() && (!layoutView()->firstChild() || layoutView()->needsLayout()))
@@ -3606,7 +3606,7 @@ bool Document::setFocusedElement(Element* prpNewFocusedElement, const FocusParam
}
if (newFocusedElement)
- updateLayoutTreeForNode(newFocusedElement);
+ updateStyleAndLayoutTreeForNode(newFocusedElement);
if (newFocusedElement && newFocusedElement->isFocusable()) {
if (newFocusedElement->isRootEditableElement() && !acceptsEditingFocus(*newFocusedElement)) {
// delegate blocks focus change
@@ -3667,7 +3667,7 @@ bool Document::setFocusedElement(Element* prpNewFocusedElement, const FocusParam
// Make sure a widget has the right size before giving it focus.
// Otherwise, we are testing edge cases of the Widget code.
// Specifically, in WebCore this does not work well for text fields.
- updateLayout();
+ updateStyleAndLayout();
// Re-get the widget in case updating the layout changed things.
focusWidget = widgetForElement(*m_focusedElement);
}
@@ -3688,7 +3688,7 @@ bool Document::setFocusedElement(Element* prpNewFocusedElement, const FocusParam
frameHost()->chromeClient().focusedNodeChanged(oldFocusedElement, m_focusedElement.get());
SetFocusedElementDone:
- updateLayoutTree();
+ updateStyleAndLayoutTree();
if (LocalFrame* frame = this->frame())
frame->selection().didChangeFocus();
return !focusChangeBlocked;
@@ -4475,7 +4475,7 @@ static Editor::Command command(Document* document, const String& commandName)
if (!frame || frame->document() != document)
return Editor::Command();
- document->updateLayoutTree();
+ document->updateStyleAndLayoutTree();
return frame->editor().createCommand(commandName, CommandFromDOM);
}
@@ -4794,7 +4794,7 @@ void Document::finishedParsing()
// we force the styles to be up to date before calling FrameLoader::finishedParsing().
// See https://bugs.webkit.org/show_bug.cgi?id=36864 starting around comment 35.
if (mainResourceWasAlreadyRequested)
- updateLayoutTree();
+ updateStyleAndLayoutTree();
beginLifecycleUpdatesIfRenderingReady();
@@ -5125,7 +5125,7 @@ void Document::updateFocusAppearanceTimerFired(Timer<Document>*)
Element* element = focusedElement();
if (!element)
return;
- updateLayout();
+ updateStyleAndLayout();
if (element->isFocusable())
element->updateFocusAppearance(m_updateFocusAppearanceSelectionBahavior);
}
@@ -5374,7 +5374,7 @@ void Document::loadPluginsSoon()
void Document::pluginLoadingTimerFired(Timer<Document>*)
{
- updateLayout();
+ updateStyleAndLayout();
}
ScriptedAnimationController& Document::ensureScriptedAnimationController()

Powered by Google App Engine
This is Rietveld 408576698