Index: third_party/WebKit/Source/core/frame/FrameView.cpp |
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp |
index f3aa77d7bcacc121ca21abf985dc4b35e8b781d6..a5667355af8c283714214fa5230933528c284f5f 100644 |
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
@@ -132,7 +132,7 @@ FrameView::FrameView(LocalFrame* frame) |
, m_layoutSizeFixedToFrameSize(true) |
, m_didScrollTimer(this, &FrameView::didScrollTimerFired) |
, m_topControlsViewportAdjustment(0) |
- , m_needsUpdateWidgetPositions(false) |
+ , m_needsUpdateWidgetGeometries(false) |
, m_needsUpdateViewportIntersection(true) |
, m_needsUpdateViewportIntersectionInSubtree(true) |
#if ENABLE(ASSERT) |
@@ -1143,18 +1143,25 @@ void FrameView::removePart(LayoutPart* object) |
m_parts.remove(object); |
} |
-void FrameView::updateWidgetPositions() |
+void FrameView::updateWidgetGeometries() |
{ |
+ if (!layoutView()) |
+ return; |
+ |
Vector<RefPtr<LayoutPart>> parts; |
copyToVector(m_parts, parts); |
// Script or plugins could detach the frame so abort processing if that happens. |
+ Vector<bool> wasUpdated; |
+ wasUpdated.resize(parts.size()); |
wkorman
2015/12/12 06:54:55
Can we initialize it with the right size from the
|
- for (size_t i = 0; i < parts.size() && layoutView(); ++i) |
- parts[i]->updateWidgetPosition(); |
+ for (size_t i = 0; i < parts.size(); ++i) |
+ wasUpdated[i] = parts[i]->updateWidgetGeometry(); |
- for (size_t i = 0; i < parts.size() && layoutView(); ++i) |
- parts[i]->widgetPositionsUpdated(); |
+ for (size_t i = 0; i < parts.size(); ++i) { |
+ if (wasUpdated[i]) |
chrishtr
2015/12/12 05:08:54
This is the money line in this patch. The rest is
|
+ parts[i]->widgetGeometriesUpdated(); |
wkorman
2015/12/12 06:54:55
Re: the comment at line 1154, just double-checking
|
+ } |
} |
void FrameView::addPartToUpdate(LayoutEmbeddedObject& object) |
@@ -1569,7 +1576,7 @@ void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() |
// Update widget and layer positions after scrolling, but only if we're not inside of |
// layout. |
if (!m_nestedLayoutCount) { |
- updateWidgetPositions(); |
+ updateWidgetGeometries(); |
if (LayoutView* layoutView = this->layoutView()) |
layoutView->layer()->setNeedsCompositingInputsUpdate(); |
} |
@@ -1902,7 +1909,7 @@ bool FrameView::updateWidgets() |
if (element->needsWidgetUpdate()) |
element->updateWidget(); |
- object.updateWidgetPosition(); |
+ object.updateWidgetGeometry(); |
// Prevent plugins from causing infinite updates of themselves. |
// FIXME: Do we really need to prevent this? |
@@ -1964,9 +1971,9 @@ void FrameView::performPostLayoutTasks() |
// to PageEventHandler. |
frame().localFrameRoot()->eventHandler().scheduleCursorUpdate(); |
- updateWidgetPositions(); |
+ updateWidgetGeometries(); |
- // Plugins could have torn down the page inside updateWidgetPositions(). |
+ // Plugins could have torn down the page inside updateWidgetGeometries(). |
if (!layoutView()) |
return; |
@@ -2337,14 +2344,14 @@ void FrameView::setNodeToDraw(Node* node) |
m_nodeToDraw = node; |
} |
-void FrameView::updateWidgetPositionsIfNeeded() |
+void FrameView::updateWidgetGeometriesIfNeeded() |
{ |
- if (!m_needsUpdateWidgetPositions) |
+ if (!m_needsUpdateWidgetGeometries) |
return; |
- m_needsUpdateWidgetPositions = false; |
+ m_needsUpdateWidgetGeometries = false; |
- updateWidgetPositions(); |
+ updateWidgetGeometries(); |
} |
void FrameView::updateAllLifecyclePhases() |
@@ -2565,7 +2572,7 @@ void FrameView::updateStyleAndLayoutIfNeededRecursive() |
m_frame->document()->layoutView()->assertLaidOut(); |
#endif |
- updateWidgetPositionsIfNeeded(); |
+ updateWidgetGeometriesIfNeeded(); |
if (lifecycle().state() < DocumentLifecycle::LayoutClean) |
lifecycle().advanceTo(DocumentLifecycle::LayoutClean); |