Diff
Modified: trunk/LayoutTests/ChangeLog (229474 => 229475)
--- trunk/LayoutTests/ChangeLog 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/LayoutTests/ChangeLog 2018-03-09 19:20:31 UTC (rev 229475)
@@ -1,3 +1,17 @@
+2018-03-09 Jer Noble <[email protected]>
+
+ Add new CSS env constants for use with fullscreen
+ https://bugs.webkit.org/show_bug.cgi?id=183498
+
+ Reviewed by Dean Jackson.
+
+ * fullscreen/full-screen-test.js:
+ (run):
+ * fullscreen/fullscreen-auto-hide-delay-expected.txt: Added.
+ * fullscreen/fullscreen-auto-hide-delay.html: Added.
+ * fullscreen/fullscreen-inset-top-expected.txt: Added.
+ * fullscreen/fullscreen-inset-top.html: Added.
+
2018-03-09 Zalan Bujtas <[email protected]>
RenderTreeBuilder::splitAnonymousBoxesAroundChild should take multicolumn spanners into account.
Modified: trunk/LayoutTests/fullscreen/full-screen-test.js (229474 => 229475)
--- trunk/LayoutTests/fullscreen/full-screen-test.js 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/LayoutTests/fullscreen/full-screen-test.js 2018-03-09 19:20:31 UTC (rev 229475)
@@ -93,6 +93,16 @@
logResult(success, msg);
}
+function run(testFuncString)
+{
+ consoleWrite("RUN(" + testFuncString + ")");
+ try {
+ eval(testFuncString);
+ } catch (ex) {
+ consoleWrite(ex);
+ }
+}
+
function waitForEventAndEnd(element, eventName, funcString)
{
waitForEvent(element, eventName, funcString, true)
Added: trunk/LayoutTests/fullscreen/fullscreen-auto-hide-delay-expected.txt (0 => 229475)
--- trunk/LayoutTests/fullscreen/fullscreen-auto-hide-delay-expected.txt (rev 0)
+++ trunk/LayoutTests/fullscreen/fullscreen-auto-hide-delay-expected.txt 2018-03-09 19:20:31 UTC (rev 229475)
@@ -0,0 +1,9 @@
+
+RUN(internals.setFullscreenAutoHideDelay(1))
+EXPECTED (window.getComputedStyle(target).transitionDuration == '1s') OK
+RUN(internals.setFullscreenAutoHideDelay(20))
+EXPECTED (window.getComputedStyle(target).transitionDuration == '20s') OK
+RUN(internals.setFullscreenAutoHideDelay(0))
+EXPECTED (window.getComputedStyle(target).transitionDuration == '0s') OK
+END OF TEST
+
Added: trunk/LayoutTests/fullscreen/fullscreen-auto-hide-delay.html (0 => 229475)
--- trunk/LayoutTests/fullscreen/fullscreen-auto-hide-delay.html (rev 0)
+++ trunk/LayoutTests/fullscreen/fullscreen-auto-hide-delay.html 2018-03-09 19:20:31 UTC (rev 229475)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script>
+ window.addEventListener('load', event => {
+ window.target = document.querySelector('#target');
+ run('internals.setFullscreenAutoHideDelay(1)');
+ testExpected('window.getComputedStyle(target).transitionDuration', '1s');
+ run('internals.setFullscreenAutoHideDelay(20)');
+ testExpected('window.getComputedStyle(target).transitionDuration', '20s');
+ run('internals.setFullscreenAutoHideDelay(0)');
+ testExpected('window.getComputedStyle(target).transitionDuration', '0s');
+ endTest();
+ });
+ </script>
+ <style>
+ #target {
+ position: relative;
+ transition-property: opacity;
+ transition-duration: env(fullscreen-auto-hide-delay);
+ }
+ </style>
+</head>
+<body>
+ <div id="target"> </div>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/fullscreen/fullscreen-inset-top-expected.txt (0 => 229475)
--- trunk/LayoutTests/fullscreen/fullscreen-inset-top-expected.txt (rev 0)
+++ trunk/LayoutTests/fullscreen/fullscreen-inset-top-expected.txt 2018-03-09 19:20:31 UTC (rev 229475)
@@ -0,0 +1,9 @@
+
+RUN(internals.setFullscreenInsetTop(1))
+EXPECTED (window.getComputedStyle(target).top == '1px') OK
+RUN(internals.setFullscreenInsetTop(20))
+EXPECTED (window.getComputedStyle(target).top == '20px') OK
+RUN(internals.setFullscreenInsetTop(0))
+EXPECTED (window.getComputedStyle(target).top == '0px') OK
+END OF TEST
+
Added: trunk/LayoutTests/fullscreen/fullscreen-inset-top.html (0 => 229475)
--- trunk/LayoutTests/fullscreen/fullscreen-inset-top.html (rev 0)
+++ trunk/LayoutTests/fullscreen/fullscreen-inset-top.html 2018-03-09 19:20:31 UTC (rev 229475)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script>
+ window.addEventListener('load', event => {
+ window.target = document.querySelector('#target');
+ run('internals.setFullscreenInsetTop(1)');
+ testExpected('window.getComputedStyle(target).top', '1px');
+ run('internals.setFullscreenInsetTop(20)');
+ testExpected('window.getComputedStyle(target).top', '20px');
+ run('internals.setFullscreenInsetTop(0)');
+ testExpected('window.getComputedStyle(target).top', '0px');
+ endTest();
+ });
+ </script>
+ <style>
+ #target {
+ position: relative;
+ top: env(fullscreen-inset-top);
+ }
+ </style>
+</head>
+<body>
+ <div id="target"> </div>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (229474 => 229475)
--- trunk/Source/WebCore/ChangeLog 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebCore/ChangeLog 2018-03-09 19:20:31 UTC (rev 229475)
@@ -1,3 +1,30 @@
+2018-03-09 Jer Noble <[email protected]>
+
+ Add new CSS env constants for use with fullscreen
+ https://bugs.webkit.org/show_bug.cgi?id=183498
+
+ Reviewed by Dean Jackson.
+
+ Tests: fullscreen/fullscreen-auto-hide-delay.html
+ fullscreen/fullscreen-inset-top.html
+
+ * dom/ConstantPropertyMap.cpp:
+ (WebCore::ConstantPropertyMap::nameForProperty const):
+ (WebCore::variableDataForPositiveDuration):
+ (WebCore::ConstantPropertyMap::setFullscreenInsetTop):
+ (WebCore::ConstantPropertyMap::setFullscreenAutoHideDelay):
+ * dom/ConstantPropertyMap.h:
+ * page/Page.cpp:
+ (WebCore::Page::setFullscreenInsetTop):
+ (WebCore::Page::setFullscreenAutoHideDelay):
+ * page/Page.h:
+ * testing/Internals.cpp:
+ (WebCore::Internals::resetToConsistentState):
+ (WebCore::Internals::setFullscreenInsetTop):
+ (WebCore::Internals::setFullscreenAutoHideDelay):
+ * testing/Internals.h:
+ * testing/Internals.idl:
+
2018-03-09 Zalan Bujtas <[email protected]>
RenderTreeBuilder::splitAnonymousBoxesAroundChild should take multicolumn spanners into account.
Modified: trunk/Source/WebCore/dom/ConstantPropertyMap.cpp (229474 => 229475)
--- trunk/Source/WebCore/dom/ConstantPropertyMap.cpp 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebCore/dom/ConstantPropertyMap.cpp 2018-03-09 19:20:31 UTC (rev 229475)
@@ -54,6 +54,8 @@
static NeverDestroyed<AtomicString> safeAreaInsetRightName("safe-area-inset-right", AtomicString::ConstructFromLiteral);
static NeverDestroyed<AtomicString> safeAreaInsetBottomName("safe-area-inset-bottom", AtomicString::ConstructFromLiteral);
static NeverDestroyed<AtomicString> safeAreaInsetLeftName("safe-area-inset-left", AtomicString::ConstructFromLiteral);
+ static NeverDestroyed<AtomicString> fullscreenInsetTopName("fullscreen-inset-top", AtomicString::ConstructFromLiteral);
+ static NeverDestroyed<AtomicString> fullscreenAutoHideDelayName("fullscreen-auto-hide-delay", AtomicString::ConstructFromLiteral);
switch (property) {
case ConstantProperty::SafeAreaInsetTop:
@@ -64,6 +66,10 @@
return safeAreaInsetBottomName;
case ConstantProperty::SafeAreaInsetLeft:
return safeAreaInsetLeftName;
+ case ConstantProperty::FullscreenInsetTop:
+ return fullscreenInsetTopName;
+ case ConstantProperty::FullscreenAutoHideDelay:
+ return fullscreenAutoHideDelayName;
}
return nullAtom();
@@ -97,6 +103,18 @@
return CSSVariableData::create(tokenRange, false);
}
+static Ref<CSSVariableData> variableDataForPositiveDuration(float durationInSeconds)
+{
+ ASSERT(durationInSeconds >= 0);
+
+ CSSParserToken token(NumberToken, durationInSeconds, NumberValueType, NoSign);
+ token.convertToDimensionWithUnit("s");
+
+ Vector<CSSParserToken> tokens { token };
+ CSSParserTokenRange tokenRange(tokens);
+ return CSSVariableData::create(tokenRange, false);
+}
+
void ConstantPropertyMap::updateConstantsForSafeAreaInsets()
{
FloatBoxExtent unobscuredSafeAreaInsets = m_document.page() ? m_document.page()->unobscuredSafeAreaInsets() : FloatBoxExtent();
@@ -112,4 +130,16 @@
m_document.invalidateMatchedPropertiesCacheAndForceStyleRecalc();
}
+void ConstantPropertyMap::setFullscreenInsetTop(double inset)
+{
+ setValueForProperty(ConstantProperty::FullscreenInsetTop, variableDataForPositivePixelLength(inset));
+ m_document.invalidateMatchedPropertiesCacheAndForceStyleRecalc();
}
+
+void ConstantPropertyMap::setFullscreenAutoHideDelay(double delay)
+{
+ setValueForProperty(ConstantProperty::FullscreenAutoHideDelay, variableDataForPositiveDuration(delay));
+ m_document.invalidateMatchedPropertiesCacheAndForceStyleRecalc();
+}
+
+}
Modified: trunk/Source/WebCore/dom/ConstantPropertyMap.h (229474 => 229475)
--- trunk/Source/WebCore/dom/ConstantPropertyMap.h 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebCore/dom/ConstantPropertyMap.h 2018-03-09 19:20:31 UTC (rev 229475)
@@ -42,6 +42,8 @@
SafeAreaInsetRight,
SafeAreaInsetBottom,
SafeAreaInsetLeft,
+ FullscreenInsetTop,
+ FullscreenAutoHideDelay,
};
class ConstantPropertyMap {
@@ -52,6 +54,8 @@
const Values& values() const;
void didChangeSafeAreaInsets();
+ void setFullscreenInsetTop(double);
+ void setFullscreenAutoHideDelay(double);
private:
void buildValues();
Modified: trunk/Source/WebCore/page/Page.cpp (229474 => 229475)
--- trunk/Source/WebCore/page/Page.cpp 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebCore/page/Page.cpp 2018-03-09 19:20:31 UTC (rev 229475)
@@ -2304,6 +2304,24 @@
}
}
+void Page::setFullscreenInsetTop(double inset)
+{
+ for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ if (!frame->document())
+ continue;
+ frame->document()->constantProperties().setFullscreenInsetTop(inset);
+ }
+}
+
+void Page::setFullscreenAutoHideDelay(double delay)
+{
+ for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ if (!frame->document())
+ continue;
+ frame->document()->constantProperties().setFullscreenAutoHideDelay(delay);
+ }
+}
+
#if ENABLE(DATA_INTERACTION)
bool Page::hasSelectionAtPosition(const FloatPoint& position) const
Modified: trunk/Source/WebCore/page/Page.h (229474 => 229475)
--- trunk/Source/WebCore/page/Page.h 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebCore/page/Page.h 2018-03-09 19:20:31 UTC (rev 229475)
@@ -332,6 +332,9 @@
float textAutosizingWidth() const { return m_textAutosizingWidth; }
void setTextAutosizingWidth(float textAutosizingWidth) { m_textAutosizingWidth = textAutosizingWidth; }
#endif
+
+ WEBCORE_EXPORT void setFullscreenInsetTop(double);
+ WEBCORE_EXPORT void setFullscreenAutoHideDelay(double);
bool shouldSuppressScrollbarAnimations() const { return m_suppressScrollbarAnimations; }
WEBCORE_EXPORT void setShouldSuppressScrollbarAnimations(bool suppressAnimations);
Modified: trunk/Source/WebCore/testing/Internals.cpp (229474 => 229475)
--- trunk/Source/WebCore/testing/Internals.cpp 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebCore/testing/Internals.cpp 2018-03-09 19:20:31 UTC (rev 229475)
@@ -491,6 +491,8 @@
#endif
page.settings().setStorageAccessAPIEnabled(false);
+ page.setFullscreenAutoHideDelay(0);
+ page.setFullscreenInsetTop(0);
}
Internals::Internals(Document& document)
@@ -2782,6 +2784,22 @@
#endif
+void Internals::setFullscreenInsetTop(double inset)
+{
+ Page* page = contextDocument()->frame()->page();
+ ASSERT(page);
+
+ page->setFullscreenInsetTop(inset);
+}
+
+void Internals::setFullscreenAutoHideDelay(double delay)
+{
+ Page* page = contextDocument()->frame()->page();
+ ASSERT(page);
+
+ page->setFullscreenAutoHideDelay(delay);
+}
+
void Internals::setApplicationCacheOriginQuota(unsigned long long quota)
{
Document* document = contextDocument();
Modified: trunk/Source/WebCore/testing/Internals.h (229474 => 229475)
--- trunk/Source/WebCore/testing/Internals.h 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebCore/testing/Internals.h 2018-03-09 19:20:31 UTC (rev 229475)
@@ -383,6 +383,9 @@
void webkitDidExitFullScreenForElement(Element&);
#endif
+ void setFullscreenInsetTop(double);
+ void setFullscreenAutoHideDelay(double);
+
WEBCORE_TESTSUPPORT_EXPORT void setApplicationCacheOriginQuota(unsigned long long);
void registerURLSchemeAsBypassingContentSecurityPolicy(const String& scheme);
Modified: trunk/Source/WebCore/testing/Internals.idl (229474 => 229475)
--- trunk/Source/WebCore/testing/Internals.idl 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebCore/testing/Internals.idl 2018-03-09 19:20:31 UTC (rev 229475)
@@ -348,6 +348,9 @@
[Conditional=FULLSCREEN_API] void webkitWillExitFullScreenForElement(Element element);
[Conditional=FULLSCREEN_API] void webkitDidExitFullScreenForElement(Element element);
+ void setFullscreenInsetTop(double inset);
+ void setFullscreenAutoHideDelay(double delay);
+
void setApplicationCacheOriginQuota(unsigned long long quota);
void registerURLSchemeAsBypassingContentSecurityPolicy(DOMString scheme);
Modified: trunk/Source/WebKit/ChangeLog (229474 => 229475)
--- trunk/Source/WebKit/ChangeLog 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebKit/ChangeLog 2018-03-09 19:20:31 UTC (rev 229475)
@@ -1,5 +1,26 @@
2018-03-09 Jer Noble <[email protected]>
+ Add new CSS env constants for use with fullscreen
+ https://bugs.webkit.org/show_bug.cgi?id=183498
+
+ Reviewed by Dean Jackson.
+
+ Pass the values given to WebFullScreenManagerProxy through the process boundary and
+ into WebCore.
+
+ * UIProcess/WebFullScreenManagerProxy.cpp:
+ (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop):
+ (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay):
+ * UIProcess/WebFullScreenManagerProxy.h:
+ * WebProcess/FullScreen/WebFullScreenManager.cpp:
+ (WebKit::WebFullScreenManager::didExitFullScreen):
+ (WebKit::WebFullScreenManager::setFullscreenInsetTop):
+ (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay):
+ * WebProcess/FullScreen/WebFullScreenManager.h:
+ * WebProcess/FullScreen/WebFullScreenManager.messages.in:
+
+2018-03-09 Jer Noble <[email protected]>
+
Add isPictureInPictureActive messaging across WebKit process boundary
https://bugs.webkit.org/show_bug.cgi?id=183499
Modified: trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp (229474 => 229475)
--- trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp 2018-03-09 19:20:31 UTC (rev 229475)
@@ -104,6 +104,16 @@
m_page->process().send(Messages::WebFullScreenManager::RestoreScrollPosition(), m_page->pageID());
}
+void WebFullScreenManagerProxy::setFullscreenInsetTop(double inset)
+{
+ m_page->process().send(Messages::WebFullScreenManager::SetFullscreenInsetTop(inset), m_page->pageID());
+}
+
+void WebFullScreenManagerProxy::setFullscreenAutoHideDelay(double delay)
+{
+ m_page->process().send(Messages::WebFullScreenManager::SetFullscreenAutoHideDelay(delay), m_page->pageID());
+}
+
void WebFullScreenManagerProxy::invalidate()
{
m_page->process().removeMessageReceiver(Messages::WebFullScreenManagerProxy::messageReceiverName(), m_page->pageID());
Modified: trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h (229474 => 229475)
--- trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h 2018-03-09 19:20:31 UTC (rev 229475)
@@ -69,6 +69,8 @@
void requestExitFullScreen();
void saveScrollPosition();
void restoreScrollPosition();
+ void setFullscreenInsetTop(double);
+ void setFullscreenAutoHideDelay(double);
private:
explicit WebFullScreenManagerProxy(WebPageProxy&, WebFullScreenManagerProxyClient&);
Modified: trunk/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp (229474 => 229475)
--- trunk/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp 2018-03-09 19:20:31 UTC (rev 229475)
@@ -153,6 +153,8 @@
void WebFullScreenManager::didExitFullScreen()
{
ASSERT(m_element);
+ setFullscreenInsetTop(0);
+ setFullscreenAutoHideDelay(0);
m_element->document().webkitDidExitFullScreenForElement(m_element.get());
}
@@ -183,6 +185,16 @@
m_page->corePage()->mainFrame().view()->setScrollPosition(m_scrollPosition);
}
+void WebFullScreenManager::setFullscreenInsetTop(double inset)
+{
+ m_page->corePage()->setFullscreenInsetTop(inset);
+}
+
+void WebFullScreenManager::setFullscreenAutoHideDelay(double delay)
+{
+ m_page->corePage()->setFullscreenAutoHideDelay(delay);
+}
+
} // namespace WebKit
#endif // ENABLE(FULLSCREEN_API)
Modified: trunk/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h (229474 => 229475)
--- trunk/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h 2018-03-09 19:20:31 UTC (rev 229475)
@@ -74,6 +74,8 @@
void requestExitFullScreen();
void saveScrollPosition();
void restoreScrollPosition();
+ void setFullscreenInsetTop(double);
+ void setFullscreenAutoHideDelay(double);
void didReceiveWebFullScreenManagerMessage(IPC::Connection&, IPC::Decoder&);
Modified: trunk/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.messages.in (229474 => 229475)
--- trunk/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.messages.in 2018-03-09 19:14:23 UTC (rev 229474)
+++ trunk/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.messages.in 2018-03-09 19:20:31 UTC (rev 229475)
@@ -30,5 +30,7 @@
SetAnimatingFullScreen(bool animating)
SaveScrollPosition()
RestoreScrollPosition()
+ SetFullscreenInsetTop(double inset)
+ SetFullscreenAutoHideDelay(double delay)
}
#endif