| 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 e3c6e83a079b087481dbfc59f9e235e0f2f0aa05..d63bd795ed1268fad047421eec0bed262c89c7ad 100644
|
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| @@ -154,9 +154,9 @@ const int kA4PortraitPageHeight = 842;
|
|
|
| using namespace HTMLNames;
|
|
|
| -// The maximum number of updateWidgets iterations that should be done before
|
| -// returning.
|
| -static const unsigned maxUpdateWidgetsIterations = 2;
|
| +// The maximum number of updateFrameViewBases iterations that should be done
|
| +// before returning.
|
| +static const unsigned maxUpdateFrameViewBasesIterations = 2;
|
| static const double resourcePriorityUpdateDelayAfterScroll = 0.250;
|
|
|
| static bool s_initialTrackAllPaintInvalidations = false;
|
| @@ -171,10 +171,10 @@ FrameView::FrameView(LocalFrame& frame)
|
| TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame),
|
| this,
|
| &FrameView::postLayoutTimerFired),
|
| - m_updateWidgetsTimer(
|
| + m_updateFrameViewBasesTimer(
|
| TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame),
|
| this,
|
| - &FrameView::updateWidgetsTimerFired),
|
| + &FrameView::updateFrameViewBasesTimerFired),
|
| m_isTransparent(false),
|
| m_baseBackgroundColor(Color::white),
|
| m_mediaType(MediaTypeNames::screen),
|
| @@ -186,7 +186,7 @@ FrameView::FrameView(LocalFrame& frame)
|
| m_didScrollTimer(TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame),
|
| this,
|
| &FrameView::didScrollTimerFired),
|
| - m_needsUpdateWidgetGeometries(false),
|
| + m_needsUpdateGeometries(false),
|
| m_horizontalScrollbarMode(ScrollbarAuto),
|
| m_verticalScrollbarMode(ScrollbarAuto),
|
| m_horizontalScrollbarLock(false),
|
| @@ -261,7 +261,7 @@ void FrameView::reset() {
|
| m_layoutCount = 0;
|
| m_nestedLayoutCount = 0;
|
| m_postLayoutTasksTimer.stop();
|
| - m_updateWidgetsTimer.stop();
|
| + m_updateFrameViewBasesTimer.stop();
|
| m_firstLayout = true;
|
| m_safeToPropagateScrollToParent = true;
|
| m_lastViewportSize = IntSize();
|
| @@ -490,7 +490,7 @@ void FrameView::invalidateAllCustomScrollbarsOnActiveChanged() {
|
| bool usesWindowInactiveSelector =
|
| m_frame->document()->styleEngine().usesWindowInactiveSelector();
|
|
|
| - const ChildrenWidgetSet* viewChildren = children();
|
| + const ChildrenFrameViewBaseSet* viewChildren = children();
|
| for (const Member<FrameViewBase>& child : *viewChildren) {
|
| FrameViewBase* frameViewBase = child.get();
|
| if (frameViewBase->isFrameView()) {
|
| @@ -1463,7 +1463,7 @@ void FrameView::removePart(LayoutPart* object) {
|
| m_parts.erase(object);
|
| }
|
|
|
| -void FrameView::updateWidgetGeometries() {
|
| +void FrameView::updateGeometries() {
|
| Vector<RefPtr<LayoutPart>> parts;
|
| copyToVector(m_parts, parts);
|
|
|
| @@ -2002,7 +2002,7 @@ void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() {
|
| // change. Update FrameViewBase and layer positions after scrolling, but only
|
| // if we're not inside of layout.
|
| if (!m_nestedLayoutCount) {
|
| - updateWidgetGeometries();
|
| + updateGeometries();
|
| LayoutViewItem layoutViewItem = this->layoutViewItem();
|
| if (!layoutViewItem.isNull())
|
| layoutViewItem.layer()->setNeedsCompositingInputsUpdate();
|
| @@ -2409,11 +2409,11 @@ void FrameView::scrollToFragmentAnchor() {
|
| m_frame->document()->isLoadCompleted() ? nullptr : anchorNode;
|
| }
|
|
|
| -bool FrameView::updateWidgets() {
|
| - // This is always called from updateWidgetsTimerFired.
|
| - // m_updateWidgetsTimer should only be scheduled if we have FrameViewBases to
|
| - // update. Thus I believe we can stop checking isEmpty here, and just ASSERT
|
| - // isEmpty:
|
| +bool FrameView::updateFrameViewBases() {
|
| + // This is always called from updateFrameViewBasesTimerFired.
|
| + // m_updateFrameViewBasesTimer should only be scheduled if we have
|
| + // FrameViewBases to update. Thus I believe we can stop checking isEmpty here,
|
| + // and just ASSERT isEmpty:
|
| // FIXME: This assert has been temporarily removed due to
|
| // https://crbug.com/430344
|
| if (m_nestedLayoutCount > 1 || m_partUpdateSet.isEmpty())
|
| @@ -2449,10 +2449,10 @@ bool FrameView::updateWidgets() {
|
| return m_partUpdateSet.isEmpty();
|
| }
|
|
|
| -void FrameView::updateWidgetsTimerFired(TimerBase*) {
|
| +void FrameView::updateFrameViewBasesTimerFired(TimerBase*) {
|
| ASSERT(!isInPerformLayout());
|
| - for (unsigned i = 0; i < maxUpdateWidgetsIterations; ++i) {
|
| - if (updateWidgets())
|
| + for (unsigned i = 0; i < maxUpdateFrameViewBasesIterations; ++i) {
|
| + if (updateFrameViewBases())
|
| return;
|
| }
|
| }
|
| @@ -2461,17 +2461,17 @@ void FrameView::flushAnyPendingPostLayoutTasks() {
|
| ASSERT(!isInPerformLayout());
|
| if (m_postLayoutTasksTimer.isActive())
|
| performPostLayoutTasks();
|
| - if (m_updateWidgetsTimer.isActive()) {
|
| - m_updateWidgetsTimer.stop();
|
| - updateWidgetsTimerFired(nullptr);
|
| + if (m_updateFrameViewBasesTimer.isActive()) {
|
| + m_updateFrameViewBasesTimer.stop();
|
| + updateFrameViewBasesTimerFired(nullptr);
|
| }
|
| }
|
|
|
| -void FrameView::scheduleUpdateWidgetsIfNecessary() {
|
| +void FrameView::scheduleUpdateFrameViewBasesIfNecessary() {
|
| ASSERT(!isInPerformLayout());
|
| - if (m_updateWidgetsTimer.isActive() || m_partUpdateSet.isEmpty())
|
| + if (m_updateFrameViewBasesTimer.isActive() || m_partUpdateSet.isEmpty())
|
| return;
|
| - m_updateWidgetsTimer.startOneShot(0, BLINK_FROM_HERE);
|
| + m_updateFrameViewBasesTimer.startOneShot(0, BLINK_FROM_HERE);
|
| }
|
|
|
| void FrameView::performPostLayoutTasks() {
|
| @@ -2498,13 +2498,14 @@ void FrameView::performPostLayoutTasks() {
|
| // scheduling is moved from EventHandler to PageEventHandler.
|
| frame().localFrameRoot()->eventHandler().scheduleCursorUpdate();
|
|
|
| - updateWidgetGeometries();
|
| + updateGeometries();
|
|
|
| - // Plugins could have torn down the page inside updateWidgetGeometries().
|
| + // Plugins could have torn down the page inside
|
| + // updateGeometries().
|
| if (layoutViewItem().isNull())
|
| return;
|
|
|
| - scheduleUpdateWidgetsIfNecessary();
|
| + scheduleUpdateFrameViewBasesIfNecessary();
|
|
|
| if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
|
| scrollingCoordinator->notifyGeometryChanged();
|
| @@ -2856,13 +2857,13 @@ void FrameView::visualViewportScrollbarsChanged() {
|
| }
|
| }
|
|
|
| -void FrameView::updateWidgetGeometriesIfNeeded() {
|
| - if (!m_needsUpdateWidgetGeometries)
|
| +void FrameView::updateGeometriesIfNeeded() {
|
| + if (!m_needsUpdateGeometries)
|
| return;
|
|
|
| - m_needsUpdateWidgetGeometries = false;
|
| + m_needsUpdateGeometries = false;
|
|
|
| - updateWidgetGeometries();
|
| + updateGeometries();
|
| }
|
|
|
| GeometryMapper& FrameView::geometryMapper() {
|
| @@ -3307,7 +3308,7 @@ void FrameView::updateStyleAndLayoutIfNeededRecursiveInternal() {
|
| // TODO(leviw): This currently runs the entire lifecycle on plugin WebViews.
|
| // We should have a way to only run these other Documents to the same
|
| // lifecycle stage as this frame.
|
| - const ChildrenWidgetSet* viewChildren = children();
|
| + const ChildrenFrameViewBaseSet* viewChildren = children();
|
| for (const Member<FrameViewBase>& child : *viewChildren) {
|
| if ((*child).isPluginContainer())
|
| toPluginView(child.get())->updateAllLifecyclePhases();
|
| @@ -3335,7 +3336,7 @@ void FrameView::updateStyleAndLayoutIfNeededRecursiveInternal() {
|
| m_frame->document()->layoutView()->assertLaidOut();
|
| #endif
|
|
|
| - updateWidgetGeometriesIfNeeded();
|
| + updateGeometriesIfNeeded();
|
|
|
| if (lifecycle().state() < DocumentLifecycle::LayoutClean)
|
| lifecycle().advanceTo(DocumentLifecycle::LayoutClean);
|
|
|