More cleanup of dead code now that we don't have frame-level scrolling.

No change in behavior. The overflowchanged event was never fired.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/687783003
diff --git a/sky/engine/core/dom/Document.cpp b/sky/engine/core/dom/Document.cpp
index 3ca8aba..61e5680 100644
--- a/sky/engine/core/dom/Document.cpp
+++ b/sky/engine/core/dom/Document.cpp
@@ -2303,10 +2303,7 @@
 
 void Document::addListenerTypeIfNeeded(const AtomicString& eventType)
 {
-    if (eventType == EventTypeNames::overflowchanged) {
-        UseCounter::countDeprecation(*this, UseCounter::OverflowChangedEvent);
-        addListenerType(OVERFLOWCHANGED_LISTENER);
-    } else if (eventType == EventTypeNames::webkitAnimationStart || (RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && eventType == EventTypeNames::animationstart)) {
+    if (eventType == EventTypeNames::webkitAnimationStart || (RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && eventType == EventTypeNames::animationstart)) {
         addListenerType(ANIMATIONSTART_LISTENER);
     } else if (eventType == EventTypeNames::webkitAnimationEnd || (RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && eventType == EventTypeNames::animationend)) {
         addListenerType(ANIMATIONEND_LISTENER);
@@ -2595,12 +2592,6 @@
 
     if (RefPtr<LocalFrame> f = frame()) {
         checkCompleted();
-
-        // Check if the scrollbars are really needed for the content.
-        // If not, remove them, relayout, and repaint.
-        if (m_frame->view())
-            m_frame->view()->restoreScrollbar();
-
         TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "MarkDOMContent", "data", InspectorMarkLoadEvent::data(f.get()));
     }
 
diff --git a/sky/engine/core/dom/Document.h b/sky/engine/core/dom/Document.h
index d500c0a..eee1e67 100644
--- a/sky/engine/core/dom/Document.h
+++ b/sky/engine/core/dom/Document.h
@@ -430,13 +430,11 @@
         DOMNODEREMOVEDFROMDOCUMENT_LISTENER  = 1 << 3,
         DOMNODEINSERTEDINTODOCUMENT_LISTENER = 1 << 4,
         DOMCHARACTERDATAMODIFIED_LISTENER    = 1 << 5,
-        OVERFLOWCHANGED_LISTENER             = 1 << 6,
-        ANIMATIONEND_LISTENER                = 1 << 7,
-        ANIMATIONSTART_LISTENER              = 1 << 8,
-        ANIMATIONITERATION_LISTENER          = 1 << 9,
-        TRANSITIONEND_LISTENER               = 1 << 10,
-        SCROLL_LISTENER                      = 1 << 12
-        // 4 bits remaining
+        ANIMATIONEND_LISTENER                = 1 << 6,
+        ANIMATIONSTART_LISTENER              = 1 << 7,
+        ANIMATIONITERATION_LISTENER          = 1 << 8,
+        TRANSITIONEND_LISTENER               = 1 << 9,
+        SCROLL_LISTENER                      = 1 << 10,
     };
 
     bool hasListenerType(ListenerType listenerType) const { return (m_listenerTypes & listenerType); }
diff --git a/sky/engine/core/frame/FrameView.cpp b/sky/engine/core/frame/FrameView.cpp
index a688b25..b6ae44b 100644
--- a/sky/engine/core/frame/FrameView.cpp
+++ b/sky/engine/core/frame/FrameView.cpp
@@ -72,7 +72,6 @@
 
 FrameView::FrameView(LocalFrame* frame)
     : m_frame(frame)
-    , m_canHaveScrollbars(true)
     , m_hasPendingLayout(false)
     , m_layoutSubtreeRoot(0)
     , m_inSynchronousPostLayout(false)
@@ -158,11 +157,6 @@
     // FIXME(sky): Remove
 }
 
-void FrameView::recalculateScrollbarOverlayStyle()
-{
-    // FIXME(sky): Remove.
-}
-
 void FrameView::clear()
 {
     reset();
@@ -221,72 +215,6 @@
     return clampedOffset;
 }
 
-void FrameView::applyOverflowToViewportAndSetRenderer(RenderObject* o, ScrollbarMode& hMode, ScrollbarMode& vMode)
-{
-    // Handle the overflow:hidden/scroll case for the body/html elements.  WinIE treats
-    // overflow:hidden and overflow:scroll on <body> as applying to the document's
-    // scrollbars.  The CSS2.1 draft states that HTML UAs should use the <html> or <body> element and XML/XHTML UAs should
-    // use the root element.
-
-    EOverflow overflowX = o->style()->overflowX();
-    EOverflow overflowY = o->style()->overflowY();
-
-    switch (overflowX) {
-        case OHIDDEN:
-            hMode = ScrollbarAlwaysOff;
-            break;
-        case OSCROLL:
-            hMode = ScrollbarAlwaysOn;
-            break;
-        case OAUTO:
-            hMode = ScrollbarAuto;
-            break;
-        default:
-            // Don't set it at all.
-            ;
-    }
-
-     switch (overflowY) {
-        case OHIDDEN:
-            vMode = ScrollbarAlwaysOff;
-            break;
-        case OSCROLL:
-            vMode = ScrollbarAlwaysOn;
-            break;
-        case OAUTO:
-            vMode = ScrollbarAuto;
-            break;
-        default:
-            // Don't set it at all.
-            ;
-    }
-
-    m_viewportRenderer = o;
-}
-
-void FrameView::calculateScrollbarModesForLayoutAndSetViewportRenderer(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy strategy)
-{
-    m_viewportRenderer = 0;
-
-    if (m_canHaveScrollbars || strategy == RulesFromWebContentOnly) {
-        hMode = ScrollbarAuto;
-        vMode = ScrollbarAuto;
-    } else {
-        hMode = ScrollbarAlwaysOff;
-        vMode = ScrollbarAlwaysOff;
-    }
-
-    if (!isSubtreeLayout()) {
-        Document* document = m_frame->document();
-        if (Element* viewportElement = document->viewportDefiningElement()) {
-            if (RenderObject* viewportRenderer = viewportElement->renderer()) {
-                if (viewportRenderer->style())
-                    applyOverflowToViewportAndSetRenderer(viewportRenderer, hMode, vMode);
-            }
-        }
-    }
-}
-
 void FrameView::updateAcceleratedCompositingSettings()
 {
     if (RenderView* renderView = this->renderView())
@@ -547,11 +475,6 @@
 
     ASSERT(!rootForThisLayout->needsLayout());
 
-    if (document->hasListenerType(Document::OVERFLOWCHANGED_LISTENER)) {
-        updateOverflowStatus(layoutSize().width() < width(),
-            layoutSize().height() < height());
-    }
-
     scheduleOrPerformPostLayoutTasks();
 
     TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Layout", "endData", InspectorLayoutEvent::endData(rootForThisLayout));
@@ -660,43 +583,12 @@
     return false;
 }
 
-IntPoint FrameView::lastKnownMousePosition() const
-{
-    return m_frame->eventHandler().lastKnownMousePosition();
-}
-
 bool FrameView::shouldSetCursor() const
 {
     Page* page = frame().page();
     return page && page->visibilityState() != PageVisibilityStateHidden && page->focusController().isActive() && page->settings().deviceSupportsMouse();
 }
 
-void FrameView::scrollContentsIfNeededRecursive()
-{
-    // FIXME(sky): Remove
-}
-
-void FrameView::scrollContentsIfNeeded()
-{
-    // FIXME(sky): Remove
-}
-
-bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta)
-{
-    // FIXME(sky): Remove
-    return false;
-}
-
-void FrameView::scrollContentsSlowPath(const IntRect& updateRect)
-{
-    // FIXME(sky): Remove
-}
-
-void FrameView::restoreScrollbar()
-{
-    // FIXME(sky): Remove
-}
-
 // FIXME(sky): remove
 IntSize FrameView::layoutSize(IncludeScrollbarsInRect) const
 {
@@ -790,19 +682,6 @@
     setNeedsLayout();
 }
 
-void FrameView::scrollbarExistenceDidChange()
-{
-    // We check to make sure the view is attached to a frame() as this method can
-    // be triggered before the view is attached by LocalFrame::createView(...) setting
-    // various values such as setScrollBarModes(...) for example.  An ASSERT is
-    // triggered when a view is layout before being attached to a frame().
-    if (!frame().view())
-        return;
-
-    if (renderView() && renderView()->usesCompositing())
-        renderView()->compositor()->frameViewScrollbarsExistenceDidChange();
-}
-
 void FrameView::scheduleRelayout()
 {
     ASSERT(m_frame->view() == this);
@@ -946,7 +825,6 @@
         if (compositedLayerMapping->mainGraphicsLayer())
             compositedLayerMapping->mainGraphicsLayer()->setNeedsDisplay();
     }
-    recalculateScrollbarOverlayStyle();
 }
 
 void FrameView::updateBackgroundRecursively(const Color& backgroundColor, bool transparent)
@@ -1030,19 +908,6 @@
     performPostLayoutTasks();
 }
 
-void FrameView::updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow)
-{
-    if (!m_viewportRenderer)
-        return;
-
-    if (m_overflowStatusDirty) {
-        m_horizontalOverflow = horizontalOverflow;
-        m_verticalOverflow = verticalOverflow;
-        m_overflowStatusDirty = false;
-        return;
-    }
-}
-
 IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) const
 {
     ASSERT(m_frame->view() == this);
@@ -1061,11 +926,6 @@
     return page && page->focusController().isActive();
 }
 
-void FrameView::invalidateScrollbarRect(Scrollbar*, const IntRect&)
-{
-    // FIXME(sky): remove
-}
-
 void FrameView::getTickmarks(Vector<IntRect>& tickmarks) const
 {
     if (!m_tickmarks.isEmpty())
@@ -1103,12 +963,6 @@
     return frameRect();
 }
 
-bool FrameView::isScrollable()
-{
-    // FIXME(sky): Remove
-    return false;
-}
-
 bool FrameView::scrollAnimatorEnabled() const
 {
     return m_frame->settings() && m_frame->settings()->scrollAnimatorEnabled();
@@ -1261,7 +1115,6 @@
         invalidateTreeIfNeededRecursive();
     }
 
-    scrollContentsIfNeededRecursive();
     ASSERT(lifecycle().state() == DocumentLifecycle::PaintInvalidationClean);
 }
 
diff --git a/sky/engine/core/frame/FrameView.h b/sky/engine/core/frame/FrameView.h
index ecb10d4..30868b8 100644
--- a/sky/engine/core/frame/FrameView.h
+++ b/sky/engine/core/frame/FrameView.h
@@ -93,6 +93,7 @@
     void setNeedsLayout();
 
     // Methods for getting/setting the size Blink should use to layout the contents.
+    // FIXME(sky): Remove the scrollbars argument now that FrameView doesn't scroll.
     IntSize layoutSize(IncludeScrollbarsInRect = ExcludeScrollbars) const;
     void setLayoutSize(const IntSize&);
 
@@ -110,7 +111,6 @@
     bool isEnclosedInCompositingLayer() const;
 
     void prepareForDetach();
-    virtual void recalculateScrollbarOverlayStyle();
 
     void clear();
 
@@ -136,8 +136,6 @@
     AtomicString mediaType() const;
     void setMediaType(const AtomicString&);
 
-    void restoreScrollbar();
-
     void postLayoutTimerFired(Timer<FrameView>*);
 
     bool wasScrolledByUser() const;
@@ -161,21 +159,12 @@
 
     void forceLayout(bool allowSubtree = false);
 
-    void scrollContentsIfNeededRecursive();
-
     // Methods to convert points and rects between the coordinate space of the renderer, and this view.
     IntRect convertFromRenderer(const RenderObject&, const IntRect&) const;
     IntRect convertToRenderer(const RenderObject&, const IntRect&) const;
     IntPoint convertFromRenderer(const RenderObject&, const IntPoint&) const;
     IntPoint convertToRenderer(const RenderObject&, const IntPoint&) const;
 
-    bool isScrollable();
-
-    enum ScrollbarModesCalculationStrategy { RulesFromWebContentOnly, AnyRule };
-    void calculateScrollbarModesForLayoutAndSetViewportRenderer(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy = AnyRule);
-
-    // FIXME(sky): Maybe remove now that we're not a ScrollView?
-    IntPoint lastKnownMousePosition() const;
     bool shouldSetCursor() const;
 
     void setCursor(const Cursor&);
@@ -227,7 +216,6 @@
 
     // ScrollableArea interface
     // FIXME(sky): Remove
-    void invalidateScrollbarRect(Scrollbar*, const IntRect&);
     void getTickmarks(Vector<IntRect>&) const;
     IntRect scrollableAreaBoundingBox() const;
     bool scrollAnimatorEnabled() const;
@@ -260,10 +248,6 @@
     bool clipsPaintInvalidations() const { return true; }
 
 protected:
-    virtual void scrollContentsIfNeeded();
-    bool scrollContentsFastPath(const IntSize& scrollDelta);
-    void scrollContentsSlowPath(const IntRect& updateRect);
-
     bool isVerticalDocument() const;
     bool isFlippedDocument() const;
 
@@ -277,9 +261,6 @@
 
     bool contentsInCompositedLayer() const;
 
-    void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMode, ScrollbarMode& vMode);
-    void updateOverflowStatus(bool horizontalOverflow, bool verticalOverflow);
-
     void forceLayoutParentViewIfNeeded();
     void performPreLayoutTasks();
     void performLayout(RenderObject* rootForThisLayout, bool inSubtreeLayout);
@@ -295,7 +276,6 @@
     // FIXME(sky): Remove now that we're not a ScrollView?
     void contentRectangleForPaintInvalidation(const IntRect&);
     void contentsResized();
-    void scrollbarExistenceDidChange();
 
     // Override ScrollView methods to do point conversion via renderers, in order to
     // take transforms into account.
@@ -328,9 +308,6 @@
 
     bool m_doFullPaintInvalidation;
 
-    // FIXME(sky): Remove
-    bool m_canHaveScrollbars;
-
     bool m_hasPendingLayout;
     RenderObject* m_layoutSubtreeRoot;
 
diff --git a/sky/engine/core/frame/UseCounter.cpp b/sky/engine/core/frame/UseCounter.cpp
index 4e8721e..080e0d9 100644
--- a/sky/engine/core/frame/UseCounter.cpp
+++ b/sky/engine/core/frame/UseCounter.cpp
@@ -229,9 +229,6 @@
     case RangeDetach:
         return "'Range.detach' is now a no-op, as per DOM (http://dom.spec.whatwg.org/#dom-range-detach).";
 
-    case OverflowChangedEvent:
-        return "The 'overflowchanged' event is deprecated and may be removed. Please do not use it.";
-
     case HTMLHeadElementProfile:
         return "'HTMLHeadElement.profile' is deprecated. The reflected attribute has no effect.";
 
diff --git a/sky/engine/core/frame/UseCounter.h b/sky/engine/core/frame/UseCounter.h
index 2aab8ca..492ea10 100644
--- a/sky/engine/core/frame/UseCounter.h
+++ b/sky/engine/core/frame/UseCounter.h
@@ -188,7 +188,6 @@
         SVGLocatableNearestViewportElement = 204,
         SVGLocatableFarthestViewportElement = 205,
         HTMLHeadElementProfile = 207,
-        OverflowChangedEvent = 208,
         SVGPointMatrixTransform = 209,
         DOMFocusInOutEvent = 211,
         FileGetLastModifiedDate = 212,
diff --git a/sky/engine/core/loader/FrameLoader.cpp b/sky/engine/core/loader/FrameLoader.cpp
index 8309e7b..6327100 100644
--- a/sky/engine/core/loader/FrameLoader.cpp
+++ b/sky/engine/core/loader/FrameLoader.cpp
@@ -130,13 +130,7 @@
     // because doing so will cause us to re-enter the destructor when protector goes out of scope.
     // Null-checking the FrameView indicates whether or not we're in the destructor.
     RefPtr<LocalFrame> protector = m_frame->view() ? m_frame : 0;
-
     m_frame->document()->checkCompleted();
-
-    // Check if the scrollbars are really needed for the content.
-    // If not, remove them, relayout, and repaint.
-    if (m_frame->view())
-        m_frame->view()->restoreScrollbar();
 }
 
 void FrameLoader::reportLocalLoadFailed(LocalFrame* frame, const String& url)
diff --git a/sky/engine/core/page/scrolling/ScrollingCoordinator.cpp b/sky/engine/core/page/scrolling/ScrollingCoordinator.cpp
index d29dc71..f8e3761 100644
--- a/sky/engine/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/sky/engine/core/page/scrolling/ScrollingCoordinator.cpp
@@ -85,7 +85,6 @@
     , m_scrollGestureRegionIsDirty(false)
     , m_touchEventTargetRectsAreDirty(false)
     , m_shouldScrollOnMainThreadDirty(false)
-    , m_wasFrameScrollable(false)
 {
 }
 
@@ -137,11 +136,9 @@
         m_touchEventTargetRectsAreDirty = false;
     }
 
-    FrameView* frameView = m_page->mainFrame()->view();
-    m_wasFrameScrollable = frameView && frameView->isScrollable();
-
     // The mainFrame view doesn't get included in the FrameTree below, so we
     // update its size separately.
+    FrameView* frameView = m_page->mainFrame()->view();
     if (WebLayer* scrollingWebLayer = frameView ? toWebLayer(frameView->layerForScrolling()) : 0) {
         scrollingWebLayer->setBounds(frameView->size());
     }
@@ -419,7 +416,6 @@
     m_horizontalScrollbars.clear();
     m_verticalScrollbars.clear();
     m_layersWithTouchRects.clear();
-    m_wasFrameScrollable = false;
 }
 
 // Note that in principle this could be called more often than computeTouchEventTargetRects, for
diff --git a/sky/engine/core/page/scrolling/ScrollingCoordinator.h b/sky/engine/core/page/scrolling/ScrollingCoordinator.h
index 389c131..f221825 100644
--- a/sky/engine/core/page/scrolling/ScrollingCoordinator.h
+++ b/sky/engine/core/page/scrolling/ScrollingCoordinator.h
@@ -116,7 +116,6 @@
     ScrollbarMap m_horizontalScrollbars;
     ScrollbarMap m_verticalScrollbars;
     HashSet<const RenderLayer*> m_layersWithTouchRects;
-    bool m_wasFrameScrollable;
 };
 
 } // namespace blink
diff --git a/sky/engine/core/rendering/RenderBox.cpp b/sky/engine/core/rendering/RenderBox.cpp
index 23feac4..69fb76d 100644
--- a/sky/engine/core/rendering/RenderBox.cpp
+++ b/sky/engine/core/rendering/RenderBox.cpp
@@ -183,9 +183,6 @@
         }
     }
 
-    if (isDocumentElement())
-        document().view()->recalculateScrollbarOverlayStyle();
-
     updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle);
     updateGridPositionAfterStyleChange(oldStyle);
 }
@@ -589,13 +586,9 @@
     return frame() && frame()->page() && frame()->page()->autoscrollController().autoscrollInProgress(this);
 }
 
-// There are two kinds of renderer that can autoscroll.
+// FIXME(sky): Replace with canBeScrolledAndHasScrollableArea.
 bool RenderBox::canAutoscroll() const
 {
-    if (node() && node()->isDocumentNode())
-        return view()->frameView()->isScrollable();
-
-    // Check for a box that can be scrolled in its own right.
     return canBeScrolledAndHasScrollableArea();
 }
 
diff --git a/sky/engine/core/rendering/compositing/RenderLayerCompositor.cpp b/sky/engine/core/rendering/compositing/RenderLayerCompositor.cpp
index 154448a..d21aac2 100644
--- a/sky/engine/core/rendering/compositing/RenderLayerCompositor.cpp
+++ b/sky/engine/core/rendering/compositing/RenderLayerCompositor.cpp
@@ -398,12 +398,6 @@
         AcceleratedFixedRootBackgroundHistogramMax);
 }
 
-void RenderLayerCompositor::frameViewScrollbarsExistenceDidChange()
-{
-    if (m_containerLayer)
-        updateOverflowControlsLayers();
-}
-
 void RenderLayerCompositor::rootFixedBackgroundsChanged()
 {
     if (!supportsFixedRootBackgroundCompositing())
diff --git a/sky/engine/core/rendering/compositing/RenderLayerCompositor.h b/sky/engine/core/rendering/compositing/RenderLayerCompositor.h
index 23174f0..a95c7ff 100644
--- a/sky/engine/core/rendering/compositing/RenderLayerCompositor.h
+++ b/sky/engine/core/rendering/compositing/RenderLayerCompositor.h
@@ -136,7 +136,6 @@
     void frameViewDidChangeLocation(const IntPoint& contentsOffset);
     void frameViewDidChangeSize();
     void frameViewDidScroll();
-    void frameViewScrollbarsExistenceDidChange();
     void rootFixedBackgroundsChanged();
 
     bool scrollingLayerDidChange(RenderLayer*);