- Revision
- 173523
- Author
- [email protected]
- Date
- 2014-09-11 11:48:21 -0700 (Thu, 11 Sep 2014)
Log Message
Support rubber-banding in sub-frames
https://bugs.webkit.org/show_bug.cgi?id=136726
-and corresponding-
rdar://problem/10011924
Reviewed by Tim Horton.
Source/WebCore:
Set the appropriate scroll elasticity for all frames! As long as its enabled, sub-
frames want an elasticity of ScrollElasticityAutomatic, which will allow for
latching.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
Account for rubber-banding in sub-frames.
(WebCore::FrameView::isScrollableOrRubberbandable):
(WebCore::FrameView::hasScrollableOrRubberbandableAncestor):
This patch also re-names rubberBandingForOverflowScrollEnabled to
rubberBandingForSubScrollableRegionsEnabled
* page/Settings.in:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::overhangAmount):
(WebCore::RenderLayer::setHasHorizontalScrollbar):
(WebCore::RenderLayer::setHasVerticalScrollbar):
Source/WebKit/mac:
rubberBandingForOverflowScrollEnabled is re-named to
rubberBandingForSubScrollableRegionsEnabled
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
LayoutTests:
* platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt:
* platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (173522 => 173523)
--- trunk/LayoutTests/ChangeLog 2014-09-11 18:35:36 UTC (rev 173522)
+++ trunk/LayoutTests/ChangeLog 2014-09-11 18:48:21 UTC (rev 173523)
@@ -1,3 +1,15 @@
+2014-09-11 Beth Dakin <[email protected]>
+
+ Support rubber-banding in sub-frames
+ https://bugs.webkit.org/show_bug.cgi?id=136726
+ -and corresponding-
+ rdar://problem/10011924
+
+ Reviewed by Tim Horton.
+
+ * platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt:
+ * platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt:
+
2014-09-11 Jer Noble <[email protected]>
[EME] REGRESSION(??): test media/encrypted-media/encrypted-media-v2-syntax.html is failing
Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt (173522 => 173523)
--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt 2014-09-11 18:35:36 UTC (rev 173522)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt 2014-09-11 18:48:21 UTC (rev 173523)
@@ -11,7 +11,7 @@
IFrame display height = 500
Mouse moved to (28, 566)
Page before: 0, IFrame before: 416
-Page after: 0, IFrame after: 496
+Page after: 0, IFrame after: 486
PASS Page did not receive wheel events.
(GraphicsLayer
(anchor 0.00 0.00)
Modified: trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt (173522 => 173523)
--- trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt 2014-09-11 18:35:36 UTC (rev 173522)
+++ trunk/LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt 2014-09-11 18:48:21 UTC (rev 173523)
@@ -11,9 +11,9 @@
IFrame display height = 500
Mouse moved to (28, 566)
Page before: 0, IFrame before: 416
-Page after: 0, IFrame after: 496
+Page after: 0, IFrame after: 486
PASS Page did not receive wheel events.
-Document was initial target for 2 of the wheel events.
+Document was initial target for 0 of the wheel events.
(GraphicsLayer
(anchor 0.00 0.00)
(bounds 785.00 2341.00)
Modified: trunk/Source/WebCore/ChangeLog (173522 => 173523)
--- trunk/Source/WebCore/ChangeLog 2014-09-11 18:35:36 UTC (rev 173522)
+++ trunk/Source/WebCore/ChangeLog 2014-09-11 18:48:21 UTC (rev 173523)
@@ -1,3 +1,30 @@
+2014-09-11 Beth Dakin <[email protected]>
+
+ Support rubber-banding in sub-frames
+ https://bugs.webkit.org/show_bug.cgi?id=136726
+ -and corresponding-
+ rdar://problem/10011924
+
+ Reviewed by Tim Horton.
+
+ Set the appropriate scroll elasticity for all frames! As long as its enabled, sub-
+ frames want an elasticity of ScrollElasticityAutomatic, which will allow for
+ latching.
+ * page/FrameView.cpp:
+ (WebCore::FrameView::FrameView):
+
+ Account for rubber-banding in sub-frames.
+ (WebCore::FrameView::isScrollableOrRubberbandable):
+ (WebCore::FrameView::hasScrollableOrRubberbandableAncestor):
+
+ This patch also re-names rubberBandingForOverflowScrollEnabled to
+ rubberBandingForSubScrollableRegionsEnabled
+ * page/Settings.in:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::overhangAmount):
+ (WebCore::RenderLayer::setHasHorizontalScrollbar):
+ (WebCore::RenderLayer::setHasVerticalScrollbar):
+
2014-09-11 Myles C. Maxfield <[email protected]> <[email protected]>
Initial implementation of SVG to OTF font converter
Modified: trunk/Source/WebCore/page/FrameView.cpp (173522 => 173523)
--- trunk/Source/WebCore/page/FrameView.cpp 2014-09-11 18:35:36 UTC (rev 173522)
+++ trunk/Source/WebCore/page/FrameView.cpp 2014-09-11 18:48:21 UTC (rev 173523)
@@ -200,10 +200,20 @@
{
init();
- if (frame.isMainFrame()) {
- ScrollableArea::setVerticalScrollElasticity(m_frame->page() ? m_frame->page()->verticalScrollElasticity() : ScrollElasticityAllowed);
- ScrollableArea::setHorizontalScrollElasticity(m_frame->page() ? m_frame->page()->horizontalScrollElasticity() : ScrollElasticityAllowed);
+#if ENABLE(RUBBER_BANDING)
+ ScrollElasticity verticalElasticity = ScrollElasticityNone;
+ ScrollElasticity horizontalElasticity = ScrollElasticityNone;
+ if (m_frame->isMainFrame()) {
+ verticalElasticity = m_frame->page() ? m_frame->page()->verticalScrollElasticity() : ScrollElasticityAllowed;
+ horizontalElasticity = m_frame->page() ? m_frame->page()->horizontalScrollElasticity() : ScrollElasticityAllowed;
+ } else if (m_frame->settings().rubberBandingForSubScrollableRegionsEnabled()) {
+ verticalElasticity = ScrollElasticityAutomatic;
+ horizontalElasticity = ScrollElasticityAutomatic;
}
+
+ ScrollableArea::setVerticalScrollElasticity(verticalElasticity);
+ ScrollableArea::setHorizontalScrollElasticity(horizontalElasticity);
+#endif
}
PassRefPtr<FrameView> FrameView::create(Frame& frame)
@@ -3348,24 +3358,21 @@
bool FrameView::isScrollableOrRubberbandable()
{
- return frame().isMainFrame() ? isScrollable(Scrollability::ScrollableOrRubberbandable) : isScrollable(Scrollability::Scrollable);
+ return isScrollable(Scrollability::ScrollableOrRubberbandable);
}
bool FrameView::hasScrollableOrRubberbandableAncestor()
{
if (frame().isMainFrame())
- return isScrollable(Scrollability::ScrollableOrRubberbandable);
+ return isScrollableOrRubberbandable();
- FrameView* parentFrameView = this->parentFrameView();
- if (!parentFrameView)
- return false;
+ for (FrameView* parent = this->parentFrameView(); parent; parent = parent->parentFrameView()) {
+ Scrollability frameScrollability = parent->frame().isMainFrame() ? Scrollability::ScrollableOrRubberbandable : Scrollability::Scrollable;
+ if (parent->isScrollable(frameScrollability))
+ return true;
+ }
- RenderView* parentRenderView = parentFrameView->renderView();
- if (!parentRenderView)
- return false;
-
- RenderLayer* enclosingLayer = parentRenderView->enclosingLayer();
- return enclosingLayer && enclosingLayer->hasScrollableOrRubberbandableAncestor();
+ return false;
}
void FrameView::updateScrollableAreaSet()
Modified: trunk/Source/WebCore/page/Settings.in (173522 => 173523)
--- trunk/Source/WebCore/page/Settings.in 2014-09-11 18:35:36 UTC (rev 173522)
+++ trunk/Source/WebCore/page/Settings.in 2014-09-11 18:48:21 UTC (rev 173523)
@@ -94,7 +94,7 @@
unsafePluginPastingEnabled initial=true
acceleratedCompositingForFixedPositionEnabled initial=defaultAcceleratedCompositingForFixedPositionEnabled
acceleratedCompositingForOverflowScrollEnabled initial=false
-rubberBandingForOverflowScrollEnabled initial=true, conditional=RUBBER_BANDING
+rubberBandingForSubScrollableRegionsEnabled initial=true, conditional=RUBBER_BANDING
experimentalNotificationsEnabled initial=false
webGLEnabled initial=false
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (173522 => 173523)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2014-09-11 18:35:36 UTC (rev 173522)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2014-09-11 18:48:21 UTC (rev 173523)
@@ -2650,7 +2650,7 @@
IntSize RenderLayer::overhangAmount() const
{
#if ENABLE(RUBBER_BANDING)
- if (!renderer().frame().settings().rubberBandingForOverflowScrollEnabled())
+ if (!renderer().frame().settings().rubberBandingForSubScrollableRegionsEnabled())
return IntSize();
IntSize stretch;
@@ -3005,7 +3005,7 @@
if (hasScrollbar) {
m_hBar = createScrollbar(HorizontalScrollbar);
#if ENABLE(RUBBER_BANDING)
- ScrollElasticity elasticity = scrollsOverflow() && renderer().frame().settings().rubberBandingForOverflowScrollEnabled() ? ScrollElasticityAutomatic : ScrollElasticityNone;
+ ScrollElasticity elasticity = scrollsOverflow() && renderer().frame().settings().rubberBandingForSubScrollableRegionsEnabled() ? ScrollElasticityAutomatic : ScrollElasticityNone;
ScrollableArea::setHorizontalScrollElasticity(elasticity);
#endif
} else {
@@ -3036,7 +3036,7 @@
if (hasScrollbar) {
m_vBar = createScrollbar(VerticalScrollbar);
#if ENABLE(RUBBER_BANDING)
- ScrollElasticity elasticity = scrollsOverflow() && renderer().frame().settings().rubberBandingForOverflowScrollEnabled() ? ScrollElasticityAutomatic : ScrollElasticityNone;
+ ScrollElasticity elasticity = scrollsOverflow() && renderer().frame().settings().rubberBandingForSubScrollableRegionsEnabled() ? ScrollElasticityAutomatic : ScrollElasticityNone;
ScrollableArea::setVerticalScrollElasticity(elasticity);
#endif
} else {
Modified: trunk/Source/WebKit/mac/ChangeLog (173522 => 173523)
--- trunk/Source/WebKit/mac/ChangeLog 2014-09-11 18:35:36 UTC (rev 173522)
+++ trunk/Source/WebKit/mac/ChangeLog 2014-09-11 18:48:21 UTC (rev 173523)
@@ -1,3 +1,17 @@
+2014-09-11 Beth Dakin <[email protected]>
+
+ Support rubber-banding in sub-frames
+ https://bugs.webkit.org/show_bug.cgi?id=136726
+ -and corresponding-
+ rdar://problem/10011924
+
+ Reviewed by Tim Horton.
+
+ rubberBandingForOverflowScrollEnabled is re-named to
+ rubberBandingForSubScrollableRegionsEnabled
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChanged:]):
+
2014-09-09 Benjamin Poulain <[email protected]>
Disable the "unreachable-code" warning
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (173522 => 173523)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2014-09-11 18:35:36 UTC (rev 173522)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2014-09-11 18:48:21 UTC (rev 173523)
@@ -2284,7 +2284,7 @@
#if ENABLE(RUBBER_BANDING)
// FIXME: https://bugs.webkit.org/show_bug.cgi?id=136131
- settings.setRubberBandingForOverflowScrollEnabled(false);
+ settings.setRubberBandingForSubScrollableRegionsEnabled(false);
#endif
#if PLATFORM(IOS)