WebKit Bugzilla
Attachment 343264 Details for
Bug 186684
: Address fullscreen api CSS env feedback
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-186684-20180621132748.patch (text/plain), 45.54 KB, created by
Jer Noble
on 2018-06-21 13:27:48 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2018-06-21 13:27:48 PDT
Size:
45.54 KB
patch
obsolete
>Subversion Revision: 233032 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6b71bfb2a8b40c967830b01885d1f2a5a7b51ad8..cd91df00b26bd848bf7d9adbec9ead7e99361345 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,57 @@ >+2018-06-15 Jer Noble <jer.noble@apple.com> >+ >+ Address fullscreen api CSS env feedback >+ https://bugs.webkit.org/show_bug.cgi?id=186684 >+ >+ Reviewed by Simon Fraser. >+ >+ Test: fullscreen/fullscreen-env.html >+ >+ + Update the phishing alert text to be more explicit about the specific threats >+ phishing sites represent. >+ + Make the top inset static, rather than dynamic. >+ + Add bottom, left, and right insets for completeness. >+ + Set the fullscreen animation duration as well as delay. >+ + Notify the page when the controls show and hide. >+ >+ * English.lproj/Localizable.strings: >+ * css/CSSSelector.cpp: >+ (WebCore::CSSSelector::selectorText const): >+ * css/CSSSelector.h: >+ * css/SelectorChecker.cpp: >+ (WebCore::SelectorChecker::checkOne const): >+ * css/SelectorCheckerTestFunctions.h: >+ (WebCore::matchesFullScreenControlsHiddenPseudoClass): >+ * css/SelectorPseudoClassAndCompatibilityElementMap.in: >+ * cssjit/SelectorCompiler.cpp: >+ (WebCore::SelectorCompiler::addPseudoClassType): >+ * dom/ConstantPropertyMap.cpp: >+ (WebCore::ConstantPropertyMap::nameForProperty const): >+ (WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets): >+ (WebCore::ConstantPropertyMap::didChangeFullscreenInsets): >+ (WebCore::ConstantPropertyMap::setFullscreenAutoHideDuration): >+ (WebCore::ConstantPropertyMap::setFullscreenInsetTop): Deleted. >+ * dom/ConstantPropertyMap.h: >+ * dom/Document.cpp: >+ (WebCore::Document::areFullscreenControlsHidden const): >+ (WebCore::Document::setFullscreenControlsHidden): >+ * dom/Document.h: >+ * page/Page.cpp: >+ (WebCore::Page::setFullscreenInsets): >+ (WebCore::Page::setFullscreenAutoHideDuration): >+ (WebCore::Page::setFullscreenControlsHidden): >+ (WebCore::Page::setFullscreenInsetTop): Deleted. >+ * page/Page.h: >+ (WebCore::Page::fullscreenInsets const): >+ * testing/Internals.cpp: >+ (WebCore::Internals::resetToConsistentState): >+ (WebCore::Internals::setFullscreenInsets): >+ (WebCore::Internals::setFullscreenAutoHideDuration): >+ (WebCore::Internals::setFullscreenControlsHidden): >+ (WebCore::Internals::setFullscreenInsetTop): Deleted. >+ * testing/Internals.h: >+ * testing/Internals.idl: >+ > 2018-06-20 David Kilzer <ddkilzer@apple.com> > > Fix leaks in WebCore found by clang static analyzer in deep mode >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index a05483172da05cd9566eeea3853fd13a3d02d87c..8260383d7818215fe18a85ce54817e7a6434e492 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,42 @@ >+2018-06-15 Jer Noble <jer.noble@apple.com> >+ >+ Address fullscreen api CSS env feedback >+ https://bugs.webkit.org/show_bug.cgi?id=186684 >+ >+ Reviewed by Simon Fraser. >+ >+ + Update the phishing alert text to be more explicit about the specific threats >+ phishing sites represent. >+ + Make the top inset static, rather than dynamic. >+ + Add bottom, left, and right insets for completeness. >+ + Set the fullscreen animation duration as well as delay. >+ + Notify the page when the controls show and hide. >+ >+ * UIProcess/WebFullScreenManagerProxy.cpp: >+ (WebKit::WebFullScreenManagerProxy::setFullscreenInsets): >+ (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideTiming): >+ (WebKit::WebFullScreenManagerProxy::setFullscreenControlsHidden): >+ (WebKit::WebFullScreenManagerProxy::setFullscreenInsetTop): Deleted. >+ (WebKit::WebFullScreenManagerProxy::setFullscreenAutoHideDelay): Deleted. >+ * UIProcess/WebFullScreenManagerProxy.h: >+ * UIProcess/ios/fullscreen/WKFullScreenViewController.mm: >+ (-[WKFullScreenViewController showUI]): >+ (-[WKFullScreenViewController hideUI]): >+ (-[WKFullScreenViewController viewWillAppear:]): >+ (-[WKFullScreenViewController _effectiveFullscreenInsets]): >+ (-[WKFullScreenViewController _updateWebViewFullscreenInsets]): >+ (-[WKFullScreenViewController _showPhishingAlert]): >+ (-[WKFullScreenViewController _effectiveFullscreenInsetTop]): Deleted. >+ * WebProcess/FullScreen/WebFullScreenManager.cpp: >+ (WebKit::WebFullScreenManager::didExitFullScreen): >+ (WebKit::WebFullScreenManager::setFullscreenInsets): >+ (WebKit::WebFullScreenManager::setFullscreenAutoHideTiming): >+ (WebKit::WebFullScreenManager::setFullscreenControlsHidden): >+ (WebKit::WebFullScreenManager::setFullscreenInsetTop): Deleted. >+ (WebKit::WebFullScreenManager::setFullscreenAutoHideDelay): Deleted. >+ * WebProcess/FullScreen/WebFullScreenManager.h: >+ * WebProcess/FullScreen/WebFullScreenManager.messages.in: >+ > 2018-06-21 Fujii Hironori <Hironori.Fujii@sony.com> > > [GTK] http/tests/misc/bubble-drag-events.html crashes >diff --git a/Source/WebCore/English.lproj/Localizable.strings b/Source/WebCore/English.lproj/Localizable.strings >index 68d17b6769a41e9a9e6479597be4bf37660a10d7..4b79ba91cbf0f7859e5048c30f561942af779017 100644 >--- a/Source/WebCore/English.lproj/Localizable.strings >+++ b/Source/WebCore/English.lproj/Localizable.strings >@@ -734,7 +734,7 @@ > "The user name or password you entered for this area on %@ was incorrect. Make sure youâre entering them correctly, and then try again." = "The user name or password you entered for this area on %@ was incorrect. Make sure youâre entering them correctly, and then try again."; > > /* Fullscreen Deceptive Website Warning Sheet Content Text */ >-"The website \"%@\" may be a deceptive website. Would you like to exit fullscreen?" = "The website \"%@\" may be a deceptive website. Would you like to exit fullscreen?"; >+"The website â%@â may try to trick you into doing something dangerous, like installing software or disclosing personal or financial information, like passwords, phone numbers, or credit cards." = "The website â%@â may try to trick you into doing something dangerous, like installing software or disclosing personal or financial information, like passwords, phone numbers, or credit cards."; > > /* text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index' */ > "This is a searchable index. Enter search keywords: " = "This is a searchable index. Enter search keywords: "; >diff --git a/Source/WebCore/css/CSSSelector.cpp b/Source/WebCore/css/CSSSelector.cpp >index 906b3b071b960c07b373433b3859b450590137ce..67c5a32ce3c9b1889cad50367fb2de2dfe08ae06 100644 >--- a/Source/WebCore/css/CSSSelector.cpp >+++ b/Source/WebCore/css/CSSSelector.cpp >@@ -453,6 +453,9 @@ String CSSSelector::selectorText(const String& rightSide) const > case CSSSelector::PseudoClassFullScreenDocument: > str.appendLiteral(":-webkit-full-screen-document"); > break; >+ case CSSSelector::PseudoClassFullScreenControlsHidden: >+ str.appendLiteral(":-webkit-full-screen-controls-hidden"); >+ break; > #endif > case CSSSelector::PseudoClassActive: > str.appendLiteral(":active"); >diff --git a/Source/WebCore/css/CSSSelector.h b/Source/WebCore/css/CSSSelector.h >index 03e9f16d884d7a2b5e21e2c7ee7628bd7b47ba5e..6f571f15287ebc6d618afa6c975e68364ac319ab 100644 >--- a/Source/WebCore/css/CSSSelector.h >+++ b/Source/WebCore/css/CSSSelector.h >@@ -148,6 +148,7 @@ namespace WebCore { > PseudoClassFullScreenDocument, > PseudoClassFullScreenAncestor, > PseudoClassAnimatingFullScreenTransition, >+ PseudoClassFullScreenControlsHidden, > #endif > PseudoClassInRange, > PseudoClassOutOfRange, >diff --git a/Source/WebCore/css/SelectorChecker.cpp b/Source/WebCore/css/SelectorChecker.cpp >index 354bfc234eb43b36bba69d6b190c0da91a4460e4..0ab738815b202b7841d059cac95c941effab6194 100644 >--- a/Source/WebCore/css/SelectorChecker.cpp >+++ b/Source/WebCore/css/SelectorChecker.cpp >@@ -1033,6 +1033,8 @@ bool SelectorChecker::checkOne(CheckingContext& checkingContext, const LocalCont > return matchesFullScreenAncestorPseudoClass(element); > case CSSSelector::PseudoClassFullScreenDocument: > return matchesFullScreenDocumentPseudoClass(element); >+ case CSSSelector::PseudoClassFullScreenControlsHidden: >+ return matchesFullScreenControlsHiddenPseudoClass(element); > #endif > case CSSSelector::PseudoClassInRange: > return isInRange(element); >diff --git a/Source/WebCore/css/SelectorCheckerTestFunctions.h b/Source/WebCore/css/SelectorCheckerTestFunctions.h >index 0e8534aa745bf6387137900539a92968e88f25fc..b7b2e3bcff0e3506c355816160465219ac089245 100644 >--- a/Source/WebCore/css/SelectorCheckerTestFunctions.h >+++ b/Source/WebCore/css/SelectorCheckerTestFunctions.h >@@ -365,6 +365,13 @@ ALWAYS_INLINE bool matchesFullScreenDocumentPseudoClass(const Element& element) > return false; > return true; > } >+ >+ALWAYS_INLINE bool matchesFullScreenControlsHiddenPseudoClass(const Element& element) >+{ >+ if (&element != element.document().webkitCurrentFullScreenElement()) >+ return false; >+ return element.document().areFullscreenControlsHidden(); >+} > #endif > > #if ENABLE(VIDEO_TRACK) >diff --git a/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in b/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in >index 9bcd104a760ae70c8f1de63f72f42c80cf46148d..63bd94a6d1c82b287fe2df45a030a6c985552ead 100644 >--- a/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in >+++ b/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in >@@ -72,6 +72,7 @@ window-inactive > -webkit-full-screen > -webkit-full-screen-ancestor > -webkit-full-screen-document >+-webkit-full-screen-controls-hidden > #endif > > #if ENABLE(VIDEO_TRACK) >diff --git a/Source/WebCore/cssjit/SelectorCompiler.cpp b/Source/WebCore/cssjit/SelectorCompiler.cpp >index d79ad01f6d084ea0087d2098f635c108dfcad189..6efe000cc84622078ba32f12eac92b0af9d3cfc7 100644 >--- a/Source/WebCore/cssjit/SelectorCompiler.cpp >+++ b/Source/WebCore/cssjit/SelectorCompiler.cpp >@@ -604,6 +604,10 @@ static inline FunctionType addPseudoClassType(const CSSSelector& selector, Selec > case CSSSelector::PseudoClassAnimatingFullScreenTransition: > fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr<CSSOperationPtrTag>(matchesFullScreenAnimatingFullScreenTransitionPseudoClass)); > return FunctionType::SimpleSelectorChecker; >+ >+ case CSSSelector::PseudoClassFullScreenControlsHidden: >+ fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr<CSSOperationPtrTag>(matchesFullScreenControlsHiddenPseudoClass)); >+ return FunctionType::SimpleSelectorChecker; > #endif > #if ENABLE(VIDEO_TRACK) > case CSSSelector::PseudoClassFuture: >diff --git a/Source/WebCore/dom/ConstantPropertyMap.cpp b/Source/WebCore/dom/ConstantPropertyMap.cpp >index e1350b52bf2faa74b379d6517adffcdaaf9dfac7..04d991e2f120c1fd97a9f8cd5c37c181220811c2 100644 >--- a/Source/WebCore/dom/ConstantPropertyMap.cpp >+++ b/Source/WebCore/dom/ConstantPropertyMap.cpp >@@ -55,7 +55,11 @@ const AtomicString& ConstantPropertyMap::nameForProperty(ConstantProperty proper > 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> fullscreenInsetLeftName("fullscreen-inset-left", AtomicString::ConstructFromLiteral); >+ static NeverDestroyed<AtomicString> fullscreenInsetBottomName("fullscreen-inset-bottom", AtomicString::ConstructFromLiteral); >+ static NeverDestroyed<AtomicString> fullscreenInsetRightName("fullscreen-inset-right", AtomicString::ConstructFromLiteral); > static NeverDestroyed<AtomicString> fullscreenAutoHideDelayName("fullscreen-auto-hide-delay", AtomicString::ConstructFromLiteral); >+ static NeverDestroyed<AtomicString> fullscreenAutoHideDurationName("fullscreen-auto-hide-duration", AtomicString::ConstructFromLiteral); > > switch (property) { > case ConstantProperty::SafeAreaInsetTop: >@@ -68,8 +72,16 @@ const AtomicString& ConstantPropertyMap::nameForProperty(ConstantProperty proper > return safeAreaInsetLeftName; > case ConstantProperty::FullscreenInsetTop: > return fullscreenInsetTopName; >+ case ConstantProperty::FullscreenInsetLeft: >+ return fullscreenInsetLeftName; >+ case ConstantProperty::FullscreenInsetBottom: >+ return fullscreenInsetBottomName; >+ case ConstantProperty::FullscreenInsetRight: >+ return fullscreenInsetRightName; > case ConstantProperty::FullscreenAutoHideDelay: > return fullscreenAutoHideDelayName; >+ case ConstantProperty::FullscreenAutoHideDuration: >+ return fullscreenAutoHideDurationName; > } > > return nullAtom(); >@@ -103,11 +115,11 @@ static Ref<CSSVariableData> variableDataForPositivePixelLength(float lengthInPx) > return CSSVariableData::create(tokenRange, false); > } > >-static Ref<CSSVariableData> variableDataForPositiveDuration(float durationInSeconds) >+static Ref<CSSVariableData> variableDataForPositiveDuration(Seconds durationInSeconds) > { >- ASSERT(durationInSeconds >= 0); >+ ASSERT(durationInSeconds >= 0_s); > >- CSSParserToken token(NumberToken, durationInSeconds, NumberValueType, NoSign); >+ CSSParserToken token(NumberToken, durationInSeconds.value(), NumberValueType, NoSign); > token.convertToDimensionWithUnit("s"); > > Vector<CSSParserToken> tokens { token }; >@@ -130,16 +142,31 @@ void ConstantPropertyMap::didChangeSafeAreaInsets() > m_document.invalidateMatchedPropertiesCacheAndForceStyleRecalc(); > } > >-void ConstantPropertyMap::setFullscreenInsetTop(double inset) >+void ConstantPropertyMap::updateConstantsForFullscreenInsets() > { >- setValueForProperty(ConstantProperty::FullscreenInsetTop, variableDataForPositivePixelLength(inset)); >+ FloatBoxExtent fullscreenInsets = m_document.page() ? m_document.page()->fullscreenInsets() : FloatBoxExtent(); >+ setValueForProperty(ConstantProperty::FullscreenInsetTop, variableDataForPositivePixelLength(fullscreenInsets.top())); >+ setValueForProperty(ConstantProperty::FullscreenInsetRight, variableDataForPositivePixelLength(fullscreenInsets.right())); >+ setValueForProperty(ConstantProperty::FullscreenInsetBottom, variableDataForPositivePixelLength(fullscreenInsets.bottom())); >+ setValueForProperty(ConstantProperty::FullscreenInsetLeft, variableDataForPositivePixelLength(fullscreenInsets.left())); >+} >+ >+void ConstantPropertyMap::didChangeFullscreenInsets() >+{ >+ updateConstantsForFullscreenInsets(); > m_document.invalidateMatchedPropertiesCacheAndForceStyleRecalc(); > } > >-void ConstantPropertyMap::setFullscreenAutoHideDelay(double delay) >+void ConstantPropertyMap::setFullscreenAutoHideDelay(Seconds delay) > { > setValueForProperty(ConstantProperty::FullscreenAutoHideDelay, variableDataForPositiveDuration(delay)); > m_document.invalidateMatchedPropertiesCacheAndForceStyleRecalc(); > } > >+void ConstantPropertyMap::setFullscreenAutoHideDuration(Seconds duration) >+{ >+ setValueForProperty(ConstantProperty::FullscreenAutoHideDuration, variableDataForPositiveDuration(duration)); >+ m_document.invalidateMatchedPropertiesCacheAndForceStyleRecalc(); >+} >+ > } >diff --git a/Source/WebCore/dom/ConstantPropertyMap.h b/Source/WebCore/dom/ConstantPropertyMap.h >index 88f5a760b20d82d1f30ad4f934261fc8d9f1ea80..1d5eb7c5a4ac5d153ef3b3f7867e84cde70b8408 100644 >--- a/Source/WebCore/dom/ConstantPropertyMap.h >+++ b/Source/WebCore/dom/ConstantPropertyMap.h >@@ -28,6 +28,7 @@ > > #include <wtf/HashMap.h> > #include <wtf/Ref.h> >+#include <wtf/Seconds.h> > #include <wtf/text/AtomicString.h> > #include <wtf/text/AtomicStringHash.h> > >@@ -43,7 +44,11 @@ enum class ConstantProperty { > SafeAreaInsetBottom, > SafeAreaInsetLeft, > FullscreenInsetTop, >+ FullscreenInsetRight, >+ FullscreenInsetBottom, >+ FullscreenInsetLeft, > FullscreenAutoHideDelay, >+ FullscreenAutoHideDuration, > }; > > class ConstantPropertyMap { >@@ -54,8 +59,9 @@ public: > const Values& values() const; > > void didChangeSafeAreaInsets(); >- void setFullscreenInsetTop(double); >- void setFullscreenAutoHideDelay(double); >+ void didChangeFullscreenInsets(); >+ void setFullscreenAutoHideDelay(Seconds); >+ void setFullscreenAutoHideDuration(Seconds); > > private: > void buildValues(); >@@ -64,6 +70,7 @@ private: > void setValueForProperty(ConstantProperty, Ref<CSSVariableData>&&); > > void updateConstantsForSafeAreaInsets(); >+ void updateConstantsForFullscreenInsets(); > > std::optional<Values> m_values; > >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 6873146b6e3f03bf453beb7b0aa09fb0c75fc381..2cf488e24a76b47656c488fea9697d05dd7858bf 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -6415,6 +6415,23 @@ void Document::setAnimatingFullScreen(bool flag) > } > } > >+bool Document::areFullscreenControlsHidden() const >+{ >+ return m_areFullscreenControlsHidden; >+} >+ >+void Document::setFullscreenControlsHidden(bool flag) >+{ >+ if (m_areFullscreenControlsHidden == flag) >+ return; >+ m_areFullscreenControlsHidden = flag; >+ >+ if (m_fullScreenElement && m_fullScreenElement->isDescendantOf(*this)) { >+ m_fullScreenElement->invalidateStyleForSubtree(); >+ scheduleForcedStyleRecalc(); >+ } >+} >+ > void Document::clearFullscreenElementStack() > { > m_fullScreenElementStack.clear(); >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index 6ed1e6879ca1e1d89af89b21a2dd0ff65fe3c990..b007817380ddf64cf0a2adca6fb346a2a8487d02 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -1153,6 +1153,9 @@ public: > WEBCORE_EXPORT bool isAnimatingFullScreen() const; > WEBCORE_EXPORT void setAnimatingFullScreen(bool); > >+ WEBCORE_EXPORT bool areFullscreenControlsHidden() const; >+ WEBCORE_EXPORT void setFullscreenControlsHidden(bool); >+ > WEBCORE_EXPORT bool webkitFullscreenEnabled() const; > Element* webkitFullscreenElement() const { return !m_fullScreenElementStack.isEmpty() ? m_fullScreenElementStack.last().get() : nullptr; } > Element* webkitFullscreenElementForBindings() const { return ancestorElementInThisScope(webkitFullscreenElement()); } >@@ -1708,6 +1711,7 @@ private: > > bool m_areKeysEnabledInFullScreen { false }; > bool m_isAnimatingFullScreen { false }; >+ bool m_areFullscreenControlsHidden { false }; > #endif > > HashSet<HTMLPictureElement*> m_viewportDependentPictures; >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index 59a7876dd2bcb00ef667dd2dac5f4288b682050b..20a610a5b52f7f5b4fa39413c9a74f04495f11d6 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -2377,16 +2377,20 @@ bool Page::defaultAppearance() const > return m_defaultAppearance; > } > >-void Page::setFullscreenInsetTop(double inset) >+void Page::setFullscreenInsets(const FloatBoxExtent& insets) > { >+ if (insets == m_fullscreenInsets) >+ return; >+ m_fullscreenInsets = insets; >+ > for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) { > if (!frame->document()) > continue; >- frame->document()->constantProperties().setFullscreenInsetTop(inset); >+ frame->document()->constantProperties().didChangeFullscreenInsets(); > } > } > >-void Page::setFullscreenAutoHideDelay(double delay) >+void Page::setFullscreenAutoHideDelay(Seconds delay) > { > for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) { > if (!frame->document()) >@@ -2395,6 +2399,28 @@ void Page::setFullscreenAutoHideDelay(double delay) > } > } > >+void Page::setFullscreenAutoHideDuration(Seconds duration) >+{ >+ for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) { >+ if (!frame->document()) >+ continue; >+ frame->document()->constantProperties().setFullscreenAutoHideDuration(duration); >+ } >+} >+ >+void Page::setFullscreenControlsHidden(bool hidden) >+{ >+#if ENABLE(FULLSCREEN_API) >+ for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) { >+ if (!frame->document()) >+ continue; >+ frame->document()->setFullscreenControlsHidden(hidden); >+ } >+#else >+ UNUSED_PARAM(hidden); >+#endif >+} >+ > #if ENABLE(DATA_INTERACTION) > > bool Page::hasSelectionAtPosition(const FloatPoint& position) const >diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h >index 6b8482ad23e887f7d05561c075cf3b6b8be814b0..ec498c5a0a1c09182a4cff93206070852ac77bd8 100644 >--- a/Source/WebCore/page/Page.h >+++ b/Source/WebCore/page/Page.h >@@ -350,9 +350,13 @@ public: > void setTextAutosizingWidth(float textAutosizingWidth) { m_textAutosizingWidth = textAutosizingWidth; } > #endif > >- WEBCORE_EXPORT void setFullscreenInsetTop(double); >- WEBCORE_EXPORT void setFullscreenAutoHideDelay(double); >- >+ WEBCORE_EXPORT void setFullscreenInsets(const FloatBoxExtent&); >+ const FloatBoxExtent& fullscreenInsets() const { return m_fullscreenInsets; } >+ >+ WEBCORE_EXPORT void setFullscreenAutoHideDelay(Seconds); >+ WEBCORE_EXPORT void setFullscreenAutoHideDuration(Seconds); >+ WEBCORE_EXPORT void setFullscreenControlsHidden(bool); >+ > bool shouldSuppressScrollbarAnimations() const { return m_suppressScrollbarAnimations; } > WEBCORE_EXPORT void setShouldSuppressScrollbarAnimations(bool suppressAnimations); > void lockAllOverlayScrollbarsToHidden(bool lockOverlayScrollbars); >@@ -743,6 +747,7 @@ private: > float m_topContentInset { 0 }; > FloatBoxExtent m_obscuredInsets; > FloatBoxExtent m_unobscuredSafeAreaInsets; >+ FloatBoxExtent m_fullscreenInsets; > > #if PLATFORM(IOS) > bool m_enclosedInScrollableAncestorView { false }; >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index 13ce8aee1c70ffc9ae4055cb471f7624937d7566..1ccacb1b10d1ad09adc98ccc4ede0098ad157f3f 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -503,8 +503,10 @@ void Internals::resetToConsistentState(Page& page) > #endif > > page.settings().setStorageAccessAPIEnabled(false); >- page.setFullscreenAutoHideDelay(0); >- page.setFullscreenInsetTop(0); >+ page.setFullscreenAutoHideDelay(0_s); >+ page.setFullscreenAutoHideDuration(0_s); >+ page.setFullscreenInsets({ }); >+ page.setFullscreenControlsHidden(false); > } > > Internals::Internals(Document& document) >@@ -2840,12 +2842,12 @@ bool Internals::isAnimatingFullScreen() const > > #endif > >-void Internals::setFullscreenInsetTop(double inset) >+void Internals::setFullscreenInsets(FullscreenInsets insets) > { > Page* page = contextDocument()->frame()->page(); > ASSERT(page); > >- page->setFullscreenInsetTop(inset); >+ page->setFullscreenInsets(FloatBoxExtent(insets.top, insets.right, insets.bottom, insets.left)); > } > > void Internals::setFullscreenAutoHideDelay(double delay) >@@ -2853,7 +2855,23 @@ void Internals::setFullscreenAutoHideDelay(double delay) > Page* page = contextDocument()->frame()->page(); > ASSERT(page); > >- page->setFullscreenAutoHideDelay(delay); >+ page->setFullscreenAutoHideDelay(Seconds(delay)); >+} >+ >+void Internals::setFullscreenAutoHideDuration(double duration) >+{ >+ Page* page = contextDocument()->frame()->page(); >+ ASSERT(page); >+ >+ page->setFullscreenAutoHideDuration(Seconds(duration)); >+} >+ >+void Internals::setFullscreenControlsHidden(bool hidden) >+{ >+ Page* page = contextDocument()->frame()->page(); >+ ASSERT(page); >+ >+ page->setFullscreenControlsHidden(hidden); > } > > void Internals::setApplicationCacheOriginQuota(unsigned long long quota) >diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h >index 5abbbf02f295d56e09abff66733bc706d0f726db..8faca7124183edce1df951cbb974231f5975d741 100644 >--- a/Source/WebCore/testing/Internals.h >+++ b/Source/WebCore/testing/Internals.h >@@ -401,8 +401,16 @@ public: > bool isAnimatingFullScreen() const; > #endif > >- void setFullscreenInsetTop(double); >+ struct FullscreenInsets { >+ float top; >+ float left; >+ float bottom; >+ float right; >+ }; >+ void setFullscreenInsets(FullscreenInsets); > void setFullscreenAutoHideDelay(double); >+ void setFullscreenAutoHideDuration(double); >+ void setFullscreenControlsHidden(bool); > > WEBCORE_TESTSUPPORT_EXPORT void setApplicationCacheOriginQuota(unsigned long long); > >diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl >index 3e0b4cdbbcc4da93a925f260463a73746b6e7735..33e8aa5a1a1b3951456fa27e1b3e8e76d80bf552 100644 >--- a/Source/WebCore/testing/Internals.idl >+++ b/Source/WebCore/testing/Internals.idl >@@ -100,6 +100,16 @@ enum EventThrottlingBehavior { > unsigned long long uniqueIdentifier; > }; > >+[ >+ ExportMacro=WEBCORE_TESTSUPPORT_EXPORT, >+ JSGenerateToJSObject, >+] dictionary FullscreenInsets { >+ double top; >+ double left; >+ double bottom; >+ double right; >+}; >+ > [ > ExportMacro=WEBCORE_TESTSUPPORT_EXPORT, > NoInterfaceObject, >@@ -371,8 +381,10 @@ enum EventThrottlingBehavior { > [Conditional=FULLSCREEN_API] void webkitDidExitFullScreenForElement(Element element); > [Conditional=FULLSCREEN_API] readonly attribute boolean isAnimatingFullScreen; > >- void setFullscreenInsetTop(double inset); >+ void setFullscreenInsets(FullscreenInsets insets); > void setFullscreenAutoHideDelay(double delay); >+ void setFullscreenAutoHideDuration(double duration); >+ void setFullscreenControlsHidden(boolean hidden); > > void setApplicationCacheOriginQuota(unsigned long long quota); > >diff --git a/Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp b/Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp >index a0d8cdbeb2f01efe996134c61a97afb0e6e4db0e..0ae141e7927dd0bd161c1ed0e44e7ba062615c6e 100644 >--- a/Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp >+++ b/Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp >@@ -120,14 +120,19 @@ void WebFullScreenManagerProxy::restoreScrollPosition() > m_page->process().send(Messages::WebFullScreenManager::RestoreScrollPosition(), m_page->pageID()); > } > >-void WebFullScreenManagerProxy::setFullscreenInsetTop(double inset) >+void WebFullScreenManagerProxy::setFullscreenInsets(const WebCore::FloatBoxExtent& insets) > { >- m_page->process().send(Messages::WebFullScreenManager::SetFullscreenInsetTop(inset), m_page->pageID()); >+ m_page->process().send(Messages::WebFullScreenManager::SetFullscreenInsets(insets), m_page->pageID()); > } > >-void WebFullScreenManagerProxy::setFullscreenAutoHideDelay(double delay) >+void WebFullScreenManagerProxy::setFullscreenAutoHideTiming(Seconds delay, Seconds duration) > { >- m_page->process().send(Messages::WebFullScreenManager::SetFullscreenAutoHideDelay(delay), m_page->pageID()); >+ m_page->process().send(Messages::WebFullScreenManager::SetFullscreenAutoHideTiming(delay, duration), m_page->pageID()); >+} >+ >+void WebFullScreenManagerProxy::setFullscreenControlsHidden(bool hidden) >+{ >+ m_page->process().send(Messages::WebFullScreenManager::SetFullscreenControlsHidden(hidden), m_page->pageID()); > } > > void WebFullScreenManagerProxy::invalidate() >diff --git a/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h b/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h >index 897e9b41e5019f368ed3a132f76e542fa24a19d0..ce89030a926da6905d1f88c72541e9dec1741613 100644 >--- a/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h >+++ b/Source/WebKit/UIProcess/WebFullScreenManagerProxy.h >@@ -30,9 +30,13 @@ > #include "MessageReceiver.h" > #include <wtf/RefCounted.h> > #include <wtf/RefPtr.h> >+#include <wtf/Seconds.h> > > namespace WebCore { > class IntRect; >+ >+template <typename> class RectEdges; >+using FloatBoxExtent = RectEdges<float>; > } > > namespace WebKit { >@@ -69,8 +73,9 @@ public: > void requestExitFullScreen(); > void saveScrollPosition(); > void restoreScrollPosition(); >- void setFullscreenInsetTop(double); >- void setFullscreenAutoHideDelay(double); >+ void setFullscreenInsets(const WebCore::FloatBoxExtent&); >+ void setFullscreenAutoHideTiming(Seconds delay, Seconds duration); >+ void setFullscreenControlsHidden(bool); > > private: > explicit WebFullScreenManagerProxy(WebPageProxy&, WebFullScreenManagerProxyClient&); >diff --git a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm >index 2d0e24443d241e4962996125172f3f351aee55bd..c2a5f07ce0fd03665114d3f0e98b2a028aaf3678 100644 >--- a/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm >+++ b/Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenViewController.mm >@@ -102,7 +102,7 @@ @end > @interface WKFullScreenViewController () <UIGestureRecognizerDelegate, UIToolbarDelegate> > @property (weak, nonatomic) WKWebView *_webView; // Cannot be retained, see <rdar://problem/14884666>. > @property (readonly, nonatomic) WebFullScreenManagerProxy* _manager; >-@property (readonly, nonatomic) CGFloat _effectiveFullscreenInsetTop; >+@property (readonly, nonatomic) WebCore::FloatBoxExtent _effectiveFullscreenInsets; > @end > > @implementation WKFullScreenViewController { >@@ -166,6 +166,11 @@ - (void)showUI > [_stackView setHidden:NO]; > [_stackView setAlpha:1]; > self.prefersStatusBarHidden = NO; >+ [self.view removeConstraints:@[_topConstraint.get()]]; >+ _topConstraint = [[_topGuide topAnchor] constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor]; >+ [_topConstraint setActive:YES]; >+ if (auto* manager = self._manager) >+ manager->setFullscreenControlsHidden(false); > }]; > } > >@@ -174,17 +179,16 @@ - (void)hideUI > [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hideUI) object:nil]; > [UIView animateWithDuration:showHideAnimationDuration animations:^{ > [self.view removeConstraints:@[_topConstraint.get()]]; >- _topConstraint = [[_topGuide topAnchor] constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor constant:self.view.safeAreaInsets.top]; >+ _topConstraint = [[_topGuide topAnchor] constraintEqualToAnchor:self.view.topAnchor constant:self.view.safeAreaInsets.top]; > [_topConstraint setActive:YES]; > [_stackView setAlpha:0]; > self.prefersStatusBarHidden = YES; >+ if (auto* manager = self._manager) >+ manager->setFullscreenControlsHidden(true); > } completion:^(BOOL finished) { > if (!finished) > return; > >- [self.view removeConstraints:@[_topConstraint.get()]]; >- _topConstraint = [[_topGuide topAnchor] constraintEqualToAnchor:self.view.safeAreaLayoutGuide.topAnchor]; >- [_topConstraint setActive:YES]; > [_stackView setHidden:YES]; > }]; > } >@@ -302,7 +306,7 @@ - (void)viewWillAppear:(BOOL)animated > [self.view insertSubview:self._webView atIndex:0]; > > if (auto* manager = self._manager) >- manager->setFullscreenAutoHideDelay(autoHideDelay); >+ manager->setFullscreenAutoHideTiming(Seconds(autoHideDelay), Seconds(showHideAnimationDuration)); > > [super viewWillAppear:animated]; > } >@@ -359,15 +363,16 @@ - (WebFullScreenManagerProxy*)_manager > return nullptr; > } > >-@dynamic _effectiveFullscreenInsetTop; >-- (CGFloat)_effectiveFullscreenInsetTop >+@dynamic _effectiveFullscreenInsets; >+- (WebCore::FloatBoxExtent)_effectiveFullscreenInsets > { >- if (self.prefersStatusBarHidden) >- return 0; >+ auto safeAreaInsets = self.view.safeAreaInsets; >+ WebCore::FloatBoxExtent insets { safeAreaInsets.top, safeAreaInsets.right, safeAreaInsets.bottom, safeAreaInsets.left }; > > CGRect cancelFrame = _cancelButton.get().frame; > CGPoint maxXY = CGPointMake(CGRectGetMaxX(cancelFrame), CGRectGetMaxY(cancelFrame)); >- return [_cancelButton convertPoint:maxXY toView:self.view].y; >+ insets.setTop([_cancelButton convertPoint:maxXY toView:self.view].y); >+ return insets; > } > > - (void)_cancelAction:(id)sender >@@ -419,13 +424,13 @@ - (void)_statusBarFrameDidChange:(NSNotificationCenter *)notification > - (void)_updateWebViewFullscreenInsets > { > if (auto* manager = self._manager) >- manager->setFullscreenInsetTop(self._effectiveFullscreenInsetTop); >+ manager->setFullscreenInsets(self._effectiveFullscreenInsets); > } > > - (void)_showPhishingAlert > { > NSString *alertTitle = WEB_UI_STRING("Deceptive Website Warning", "Fullscreen Deceptive Website Warning Sheet Title"); >- NSString *alertMessage = [NSString stringWithFormat:WEB_UI_STRING("The website \"%@\" may be a deceptive website. Would you like to exit fullscreen?", "Fullscreen Deceptive Website Warning Sheet Content Text") , (NSString *)self.location]; >+ NSString *alertMessage = [NSString stringWithFormat:WEB_UI_STRING("The website â%@â may try to trick you into doing something dangerous, like installing software or disclosing personal or financial information, like passwords, phone numbers, or credit cards.", "Fullscreen Deceptive Website Warning Sheet Content Text") , (NSString *)self.location]; > UIAlertController* alert = [UIAlertController alertControllerWithTitle:alertTitle message:alertMessage preferredStyle:UIAlertControllerStyleAlert]; > > UIAlertAction* exitAction = [UIAlertAction actionWithTitle:WEB_UI_STRING("Exit Fullscreen", "Fullscreen Deceptive Website Exit Action") style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) { >diff --git a/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp b/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp >index 11f5790e95c8ddc8df7ed412c8a0b04a5246036c..414596e9160cec94c069798ff23e3c567b45e013 100644 >--- a/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp >+++ b/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp >@@ -181,8 +181,8 @@ void WebFullScreenManager::willExitFullScreen() > void WebFullScreenManager::didExitFullScreen() > { > ASSERT(m_element); >- setFullscreenInsetTop(0); >- setFullscreenAutoHideDelay(0); >+ setFullscreenInsets(FloatBoxExtent()); >+ setFullscreenAutoHideTiming(0_s, 0_s); > m_element->document().webkitDidExitFullScreenForElement(m_element.get()); > } > >@@ -213,14 +213,21 @@ void WebFullScreenManager::restoreScrollPosition() > m_page->corePage()->mainFrame().view()->setScrollPosition(m_scrollPosition); > } > >-void WebFullScreenManager::setFullscreenInsetTop(double inset) >+void WebFullScreenManager::setFullscreenInsets(const WebCore::FloatBoxExtent& insets) > { >- m_page->corePage()->setFullscreenInsetTop(inset); >+ m_page->corePage()->setFullscreenInsets(insets); > } > >-void WebFullScreenManager::setFullscreenAutoHideDelay(double delay) >+void WebFullScreenManager::setFullscreenAutoHideTiming(Seconds delay, Seconds duration) > { >- m_page->corePage()->setFullscreenAutoHideDelay(delay); >+ auto corePage = m_page->corePage(); >+ corePage->setFullscreenAutoHideDelay(delay); >+ corePage->setFullscreenAutoHideDuration(duration); >+} >+ >+void WebFullScreenManager::setFullscreenControlsHidden(bool hidden) >+{ >+ m_page->corePage()->setFullscreenControlsHidden(hidden); > } > > } // namespace WebKit >diff --git a/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h b/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h >index c170fa2aeaa72e5cf1f30261969de4228da05a79..eee706edd075619dfe3cb8c53bebd6455735f581 100644 >--- a/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h >+++ b/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.h >@@ -27,7 +27,9 @@ > > #if ENABLE(FULLSCREEN_API) > >+#include "WebCoreArgumentCoders.h" > #include <WebCore/IntRect.h> >+#include <WebCore/LengthBox.h> > #include <wtf/RefCounted.h> > #include <wtf/RefPtr.h> > >@@ -78,8 +80,9 @@ protected: > void requestExitFullScreen(); > void saveScrollPosition(); > void restoreScrollPosition(); >- void setFullscreenInsetTop(double); >- void setFullscreenAutoHideDelay(double); >+ void setFullscreenInsets(const WebCore::FloatBoxExtent&); >+ void setFullscreenAutoHideTiming(Seconds delay, Seconds duration); >+ void setFullscreenControlsHidden(bool); > > void didReceiveWebFullScreenManagerMessage(IPC::Connection&, IPC::Decoder&); > >diff --git a/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.messages.in b/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.messages.in >index 1de817952e267de19f4ca60ebbaf82f6a7cfecdf..7f371f876715495d6c7365ed47b230e2fd83edd3 100644 >--- a/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.messages.in >+++ b/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.messages.in >@@ -30,7 +30,8 @@ messages -> WebFullScreenManager LegacyReceiver { > SetAnimatingFullScreen(bool animating) > SaveScrollPosition() > RestoreScrollPosition() >- SetFullscreenInsetTop(double inset) >- SetFullscreenAutoHideDelay(double delay) >+ SetFullscreenInsets(WebCore::RectEdges<float> insets) >+ SetFullscreenAutoHideTiming(Seconds delay, Seconds duration) >+ SetFullscreenControlsHidden(bool hidden) > } > #endif >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 9d5615d44cb911be4288619c668d94b55b5ab741..cd712ba3ed270ae28c7872e5fb4b376cadf83e94 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-06-15 Jer Noble <jer.noble@apple.com> >+ >+ Address fullscreen api CSS env feedback >+ https://bugs.webkit.org/show_bug.cgi?id=186684 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fullscreen/fullscreen-env-expected.txt: Added. >+ * fullscreen/fullscreen-env.html: Added. >+ * fullscreen/fullscreen-inset-top-expected.txt: Removed. >+ * fullscreen/fullscreen-inset-top.html: Removed. >+ > 2018-06-21 Fujii Hironori <Hironori.Fujii@sony.com> > > [GTK] http/tests/misc/bubble-drag-events.html crashes >diff --git a/LayoutTests/fullscreen/fullscreen-env-expected.txt b/LayoutTests/fullscreen/fullscreen-env-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..ae4fac8c895b5e1f4a800b89858436aae9e75c97 >--- /dev/null >+++ b/LayoutTests/fullscreen/fullscreen-env-expected.txt >@@ -0,0 +1,35 @@ >+Â >+RUN(internals.setFullscreenInsets({top:1, left:2, bottom:3, right:4})) >+EXPECTED (window.getComputedStyle(target).top == '1px') OK >+EXPECTED (window.getComputedStyle(target).left == '2px') OK >+EXPECTED (window.getComputedStyle(target).bottom == '3px') OK >+EXPECTED (window.getComputedStyle(target).right == '4px') OK >+RUN(internals.setFullscreenInsets({top:20, left:30, bottom:40, right:50})) >+EXPECTED (window.getComputedStyle(target).top == '20px') OK >+EXPECTED (window.getComputedStyle(target).left == '30px') OK >+EXPECTED (window.getComputedStyle(target).bottom == '40px') OK >+EXPECTED (window.getComputedStyle(target).right == '50px') OK >+RUN(internals.setFullscreenInsets({top:0, left:0, bottom:0, right:0})) >+EXPECTED (window.getComputedStyle(target).top == '0px') OK >+EXPECTED (window.getComputedStyle(target).left == '0px') OK >+EXPECTED (window.getComputedStyle(target).bottom == '0px') OK >+EXPECTED (window.getComputedStyle(target).right == '0px') OK >+RUN(internals.setFullscreenAutoHideDelay(1)) >+RUN(internals.setFullscreenAutoHideDuration(2)) >+EXPECTED (window.getComputedStyle(target).transitionDelay == '1s') OK >+EXPECTED (window.getComputedStyle(target).transitionDuration == '2s') OK >+RUN(internals.setFullscreenAutoHideDelay(20)) >+RUN(internals.setFullscreenAutoHideDuration(30)) >+EXPECTED (window.getComputedStyle(target).transitionDelay == '20s') OK >+EXPECTED (window.getComputedStyle(target).transitionDuration == '30s') OK >+RUN(internals.setFullscreenAutoHideDelay(0)) >+RUN(internals.setFullscreenAutoHideDuration(0)) >+EXPECTED (window.getComputedStyle(target).transitionDelay == '0s') OK >+EXPECTED (window.getComputedStyle(target).transitionDuration == '0s') OK >+EVENT(webkitfullscreenchange) >+RUN(internals.setFullscreenControlsHidden(true)) >+EXPECTED (document.querySelector("#target:-webkit-full-screen-controls-hidden") == '[object HTMLDivElement]') OK >+RUN(internals.setFullscreenControlsHidden(false)) >+EXPECTED (document.querySelector("#target:-webkit-full-screen-controls-hidden") == 'null') OK >+END OF TEST >+ >diff --git a/LayoutTests/fullscreen/fullscreen-env.html b/LayoutTests/fullscreen/fullscreen-env.html >new file mode 100644 >index 0000000000000000000000000000000000000000..acf7adfaf99878714649dae1dfa71ccaec97def9 >--- /dev/null >+++ b/LayoutTests/fullscreen/fullscreen-env.html >@@ -0,0 +1,60 @@ >+<!DOCTYPE html> >+<html> >+<head> >+ <script src="full-screen-test.js"></script> >+ <script> >+ window.addEventListener('load', event => { >+ window.target = document.querySelector('#target'); >+ run('internals.setFullscreenInsets({top:1, left:2, bottom:3, right:4})'); >+ testExpected('window.getComputedStyle(target).top', '1px'); >+ testExpected('window.getComputedStyle(target).left', '2px'); >+ testExpected('window.getComputedStyle(target).bottom', '3px'); >+ testExpected('window.getComputedStyle(target).right', '4px'); >+ run('internals.setFullscreenInsets({top:20, left:30, bottom:40, right:50})'); >+ testExpected('window.getComputedStyle(target).top', '20px'); >+ testExpected('window.getComputedStyle(target).left', '30px'); >+ testExpected('window.getComputedStyle(target).bottom', '40px'); >+ testExpected('window.getComputedStyle(target).right', '50px'); >+ run('internals.setFullscreenInsets({top:0, left:0, bottom:0, right:0})'); >+ testExpected('window.getComputedStyle(target).top', '0px'); >+ testExpected('window.getComputedStyle(target).left', '0px'); >+ testExpected('window.getComputedStyle(target).bottom', '0px'); >+ testExpected('window.getComputedStyle(target).right', '0px'); >+ run('internals.setFullscreenAutoHideDelay(1)'); >+ run('internals.setFullscreenAutoHideDuration(2)'); >+ testExpected('window.getComputedStyle(target).transitionDelay', '1s'); >+ testExpected('window.getComputedStyle(target).transitionDuration', '2s'); >+ run('internals.setFullscreenAutoHideDelay(20)'); >+ run('internals.setFullscreenAutoHideDuration(30)'); >+ testExpected('window.getComputedStyle(target).transitionDelay', '20s'); >+ testExpected('window.getComputedStyle(target).transitionDuration', '30s'); >+ run('internals.setFullscreenAutoHideDelay(0)'); >+ run('internals.setFullscreenAutoHideDuration(0)'); >+ testExpected('window.getComputedStyle(target).transitionDelay', '0s'); >+ testExpected('window.getComputedStyle(target).transitionDuration', '0s'); >+ runWithKeyDown(() => {target.webkitRequestFullscreen() }); >+ waitForEventOnce(document, 'webkitfullscreenchange', event => { >+ run('internals.setFullscreenControlsHidden(true)'); >+ testExpected('document.querySelector("#target:-webkit-full-screen-controls-hidden")', target); >+ run('internals.setFullscreenControlsHidden(false)'); >+ testExpected('document.querySelector("#target:-webkit-full-screen-controls-hidden")', null); >+ endTest(); >+ }); >+ }); >+ </script> >+ <style> >+ #target { >+ position: absolute; >+ top: env(fullscreen-inset-top); >+ left: env(fullscreen-inset-left); >+ bottom: env(fullscreen-inset-bottom); >+ right: env(fullscreen-inset-right); >+ transition-duration: env(fullscreen-auto-hide-duration); >+ transition-delay: env(fullscreen-auto-hide-delay); >+ } >+ </style> >+</head> >+<body> >+ <div id="target"> </div> >+</body> >+</html> >diff --git a/LayoutTests/fullscreen/fullscreen-inset-top-expected.txt b/LayoutTests/fullscreen/fullscreen-inset-top-expected.txt >deleted file mode 100644 >index cf823d971abc2ec6a33a0be5fcb1db31614553f0..0000000000000000000000000000000000000000 >--- a/LayoutTests/fullscreen/fullscreen-inset-top-expected.txt >+++ /dev/null >@@ -1,9 +0,0 @@ >-Â >-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 >- >diff --git a/LayoutTests/fullscreen/fullscreen-inset-top.html b/LayoutTests/fullscreen/fullscreen-inset-top.html >deleted file mode 100644 >index 9ad9700f1f179d28a2896dbbc4bf76bde3af32de..0000000000000000000000000000000000000000 >--- a/LayoutTests/fullscreen/fullscreen-inset-top.html >+++ /dev/null >@@ -1,27 +0,0 @@ >-<!DOCTYPE html> >-<html> >-<head> >- <script src="full-screen-test.js"></script> >- <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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186684
:
342830
|
342956
|
343102
|
343113
|
343243
|
343254
|
343261
|
343263
|
343264
|
343270
|
343281