- Revision
- 223169
- Author
- [email protected]
- Date
- 2017-10-11 00:54:37 -0700 (Wed, 11 Oct 2017)
Log Message
[iOS] Do not flatten frames when async frame scrolling is enabled
https://bugs.webkit.org/show_bug.cgi?id=173704
Patch by Frederic Wang <[email protected]> on 2017-09-27
Reviewed by Simon Fraser.
Source/WebCore:
This patch disables frame flattening when async frame scrolling is enabled on iOS, as
otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
in the "Experimental WebKit Features" menu of Safari iOS.
Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
* page/FrameView.cpp:
(WebCore::FrameView::frameFlatteningEnabled): Use effectiveFrameFlattening()
* page/Settings.cpp:
(WebCore::Settings::effectiveFrameFlattening): New function to return frameFlattening() or do
some exceptions on iOS.
* page/Settings.h: Declare effectiveFrameFlattening.
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::flattenFrameSet): Use effectiveFrameFlattening()
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::flattenFrame): Ditto.
* rendering/RenderView.cpp:
(WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Ditto.
Source/WebKit:
This patch disables frame flattening when async frame scrolling is enabled on iOS, as
otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
in the "Experimental WebKit Features" menu of Safari iOS.
Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::contentsSizeChanged): Use effectiveFrameFlattening() introduced in
Source/WebCore.
LayoutTests:
Add an iOS test to verify that frame flattening is disabled when async frame scrolling is enabled.
* platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling-expected.txt: Added.
* platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (223168 => 223169)
--- trunk/LayoutTests/ChangeLog 2017-10-11 05:48:47 UTC (rev 223168)
+++ trunk/LayoutTests/ChangeLog 2017-10-11 07:54:37 UTC (rev 223169)
@@ -1,3 +1,15 @@
+2017-09-27 Frederic Wang <[email protected]>
+
+ [iOS] Do not flatten frames when async frame scrolling is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=173704
+
+ Reviewed by Simon Fraser.
+
+ Add an iOS test to verify that frame flattening is disabled when async frame scrolling is enabled.
+
+ * platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling-expected.txt: Added.
+ * platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html: Added.
+
2017-10-10 Ryosuke Niwa <[email protected]>
Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner
Added: trunk/LayoutTests/platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling-expected.txt (0 => 223169)
--- trunk/LayoutTests/platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling-expected.txt 2017-10-11 07:54:37 UTC (rev 223169)
@@ -0,0 +1,5 @@
+
+
+PASS simple iframe
+PASS fullscreen iframe
+
Property changes on: trunk/LayoutTests/platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling-expected.txt
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: trunk/LayoutTests/platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html (0 => 223169)
--- trunk/LayoutTests/platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html (rev 0)
+++ trunk/LayoutTests/platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html 2017-10-11 07:54:37 UTC (rev 223169)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>This tests frame flattening when async frame scrolling is enabled</title>
+ <meta charset="utf-8"/>
+ <script src=""
+ <script src=""
+ <script>
+ if (window.internals) {
+ window.internals.settings.setFrameFlattening("FullyEnabled");
+ window.internals.settings.setAsyncFrameScrollingEnabled(true);
+ }
+
+ setup({explicit_done: true});
+ function isUnflatten(id) {
+ var iframe = document.getElementById(id);
+ var iframeBox = iframe.getBoundingClientRect();
+ var innerDivBox = iframe.contentDocument.body.firstElementChild.getBoundingClientRect();
+ return iframeBox.width < innerDivBox.width && iframeBox.height < innerDivBox.height;
+ }
+ function start() {
+ test(function() { assert_true(isUnflatten("iframe_simple")); }, "simple iframe");
+ test(function() { assert_true(isUnflatten("iframe_fullscreen")); }, "fullscreen iframe");
+ done();
+ }
+ </script>
+ </head>
+ <body _onload_="start()">
+ <iframe id="iframe_simple" style="background: blue; width: 50px; height: 50px;" scrolling="yes" srcdoc="<div style='width: 1000px; height: 1000px;'></div>"></iframe>
+ <iframe id="iframe_fullscreen" style="background: cyan; position: absolute; width: 100vw; height: 100vh;" scrolling="yes" srcdoc="<div style='width: 1000px; height: 1000px;'></div>"></iframe>
+ </body>
+</html>
Property changes on: trunk/LayoutTests/platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Modified: trunk/Source/WebCore/ChangeLog (223168 => 223169)
--- trunk/Source/WebCore/ChangeLog 2017-10-11 05:48:47 UTC (rev 223168)
+++ trunk/Source/WebCore/ChangeLog 2017-10-11 07:54:37 UTC (rev 223169)
@@ -1,3 +1,30 @@
+2017-09-27 Frederic Wang <[email protected]>
+
+ [iOS] Do not flatten frames when async frame scrolling is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=173704
+
+ Reviewed by Simon Fraser.
+
+ This patch disables frame flattening when async frame scrolling is enabled on iOS, as
+ otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
+ developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
+ in the "Experimental WebKit Features" menu of Safari iOS.
+
+ Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::frameFlatteningEnabled): Use effectiveFrameFlattening()
+ * page/Settings.cpp:
+ (WebCore::Settings::effectiveFrameFlattening): New function to return frameFlattening() or do
+ some exceptions on iOS.
+ * page/Settings.h: Declare effectiveFrameFlattening.
+ * rendering/RenderFrameSet.cpp:
+ (WebCore::RenderFrameSet::flattenFrameSet): Use effectiveFrameFlattening()
+ * rendering/RenderIFrame.cpp:
+ (WebCore::RenderIFrame::flattenFrame): Ditto.
+ * rendering/RenderView.cpp:
+ (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Ditto.
+
2017-10-10 Xabier Rodriguez Calvar <[email protected]>
[GStreamer] Fix double seek requested by downloadbuffer GStreamer element in webkibwebsrc
Modified: trunk/Source/WebCore/page/FrameView.cpp (223168 => 223169)
--- trunk/Source/WebCore/page/FrameView.cpp 2017-10-11 05:48:47 UTC (rev 223168)
+++ trunk/Source/WebCore/page/FrameView.cpp 2017-10-11 07:54:37 UTC (rev 223169)
@@ -568,7 +568,7 @@
bool FrameView::frameFlatteningEnabled() const
{
- return frame().settings().frameFlattening() != FrameFlatteningDisabled;
+ return frame().settings().effectiveFrameFlattening() != FrameFlatteningDisabled;
}
bool FrameView::isFrameFlatteningValidForThisFrame() const
Modified: trunk/Source/WebCore/page/Settings.cpp (223168 => 223169)
--- trunk/Source/WebCore/page/Settings.cpp 2017-10-11 05:48:47 UTC (rev 223168)
+++ trunk/Source/WebCore/page/Settings.cpp 2017-10-11 07:54:37 UTC (rev 223169)
@@ -441,6 +441,18 @@
m_forcePendingWebGLPolicy = forced;
}
+FrameFlattening Settings::effectiveFrameFlattening()
+{
+#if PLATFORM(IOS)
+ // On iOS when async frame scrolling is enabled, it does not make sense to use full frame flattening.
+ // In that case, we just consider that frame flattening is disabled. This allows people to test
+ // frame scrolling on iOS by enabling "Async Frame Scrolling" via the Safari menu.
+ if (asyncFrameScrollingEnabled() && frameFlattening() == FrameFlatteningFullyEnabled)
+ return FrameFlatteningDisabled;
+#endif
+ return frameFlattening();
+}
+
void Settings::setPluginsEnabled(bool arePluginsEnabled)
{
if (m_arePluginsEnabled == arePluginsEnabled)
Modified: trunk/Source/WebCore/page/Settings.h (223168 => 223169)
--- trunk/Source/WebCore/page/Settings.h 2017-10-11 05:48:47 UTC (rev 223168)
+++ trunk/Source/WebCore/page/Settings.h 2017-10-11 07:54:37 UTC (rev 223169)
@@ -334,6 +334,8 @@
WEBCORE_EXPORT void setForcePendingWebGLPolicy(bool);
bool isForcePendingWebGLPolicy() const { return m_forcePendingWebGLPolicy; }
+ WEBCORE_EXPORT FrameFlattening effectiveFrameFlattening();
+
WEBCORE_EXPORT static void setAllowsAnySSLCertificate(bool);
static bool allowsAnySSLCertificate();
Modified: trunk/Source/WebCore/rendering/RenderFrameSet.cpp (223168 => 223169)
--- trunk/Source/WebCore/rendering/RenderFrameSet.cpp 2017-10-11 05:48:47 UTC (rev 223168)
+++ trunk/Source/WebCore/rendering/RenderFrameSet.cpp 2017-10-11 07:54:37 UTC (rev 223169)
@@ -651,7 +651,7 @@
bool RenderFrameSet::flattenFrameSet() const
{
- return settings().frameFlattening() != FrameFlatteningDisabled;
+ return settings().effectiveFrameFlattening() != FrameFlatteningDisabled;
}
void RenderFrameSet::startResizing(GridAxis& axis, int position)
Modified: trunk/Source/WebCore/rendering/RenderIFrame.cpp (223168 => 223169)
--- trunk/Source/WebCore/rendering/RenderIFrame.cpp 2017-10-11 05:48:47 UTC (rev 223168)
+++ trunk/Source/WebCore/rendering/RenderIFrame.cpp 2017-10-11 07:54:37 UTC (rev 223169)
@@ -78,7 +78,7 @@
bool RenderIFrame::flattenFrame() const
{
- if (settings().frameFlattening() == FrameFlatteningDisabled)
+ if (settings().effectiveFrameFlattening() == FrameFlatteningDisabled)
return false;
if (style().width().isFixed() && style().height().isFixed()) {
@@ -89,7 +89,7 @@
if (style().width().value() <= 0 || style().height().value() <= 0)
return false;
// Do not flatten "fullscreen" iframes or they could become larger than the viewport.
- if (settings().frameFlattening() <= FrameFlatteningEnabledForNonFullScreenIFrames && isFullScreenIFrame())
+ if (settings().effectiveFrameFlattening() <= FrameFlatteningEnabledForNonFullScreenIFrames && isFullScreenIFrame())
return false;
}
Modified: trunk/Source/WebCore/rendering/RenderView.cpp (223168 => 223169)
--- trunk/Source/WebCore/rendering/RenderView.cpp 2017-10-11 05:48:47 UTC (rev 223168)
+++ trunk/Source/WebCore/rendering/RenderView.cpp 2017-10-11 07:54:37 UTC (rev 223169)
@@ -59,7 +59,7 @@
struct FrameFlatteningLayoutDisallower {
FrameFlatteningLayoutDisallower(FrameView& frameView)
: m_frameView(frameView)
- , m_disallowLayout(frameView.frame().settings().frameFlattening() != FrameFlatteningDisabled)
+ , m_disallowLayout(frameView.frame().settings().effectiveFrameFlattening() != FrameFlatteningDisabled)
{
if (m_disallowLayout)
m_frameView.startDisallowingLayout();
Modified: trunk/Source/WebKit/ChangeLog (223168 => 223169)
--- trunk/Source/WebKit/ChangeLog 2017-10-11 05:48:47 UTC (rev 223168)
+++ trunk/Source/WebKit/ChangeLog 2017-10-11 07:54:37 UTC (rev 223169)
@@ -1,3 +1,21 @@
+2017-09-27 Frederic Wang <[email protected]>
+
+ [iOS] Do not flatten frames when async frame scrolling is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=173704
+
+ Reviewed by Simon Fraser.
+
+ This patch disables frame flattening when async frame scrolling is enabled on iOS, as
+ otherwise you can not scroll them. Once iframe scrolling is implemented in iOS (bug 149264),
+ developers and beta testers will be able to check it by enabling "Async Frame Scrolling"
+ in the "Experimental WebKit Features" menu of Safari iOS.
+
+ Test: platform/ios/fast/frames/flattening/iframe-flattening-with-async-frame-scrolling.html
+
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::contentsSizeChanged): Use effectiveFrameFlattening() introduced in
+ Source/WebCore.
+
2017-10-10 Ryosuke Niwa <[email protected]>
Enable custom pasteboard data in DumpRenderTree and WebKitTestRunner
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (223168 => 223169)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2017-10-11 05:48:47 UTC (rev 223168)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp 2017-10-11 07:54:37 UTC (rev 223169)
@@ -566,7 +566,7 @@
void WebChromeClient::contentsSizeChanged(Frame& frame, const IntSize& size) const
{
- if (m_page.corePage()->settings().frameFlattening() == FrameFlatteningDisabled) {
+ if (m_page.corePage()->settings().effectiveFrameFlattening() == FrameFlatteningDisabled) {
WebFrame* largestFrame = findLargestFrameInFrameSet(m_page);
if (largestFrame != m_cachedFrameSetLargestFrame.get()) {
m_cachedFrameSetLargestFrame = largestFrame;