WebKit Bugzilla
Attachment 342663 Details for
Bug 186585
: [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186585-20180613091000.patch (text/plain), 10.03 KB, created by
zalan
on 2018-06-13 09:10:00 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2018-06-13 09:10:00 PDT
Size:
10.03 KB
patch
obsolete
>Subversion Revision: 232790 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 316a0e76163307c3ae51f801fe0ecdfb5a928b3d..f41d39046324dc668e4a3c50a062b720f0316367 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-06-13 Zalan Bujtas <zalan@apple.com> >+ >+ [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units >+ https://bugs.webkit.org/show_bug.cgi?id=186585 >+ <rdar://problem/30685325> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use the existing "override viewport size for viewport units" mechanism to compute the preferred >+ viewport unit values for the Mail Viewer html content. >+ >+ Test: fast/dynamic/mail-autosize-viewport-unit.html >+ >+ * page/FrameView.cpp: >+ (WebCore::FrameView::FrameView): >+ (WebCore::FrameView::enableAutoSizeMode): >+ (WebCore::FrameView::clearViewportSizeOverrideForCSSViewportUnits): >+ (WebCore::FrameView::setViewportSizeForCSSViewportUnits): >+ (WebCore::FrameView::overrideViewportSizeForCSSViewportUnits): >+ (WebCore::FrameView::viewportSizeForCSSViewportUnits const): >+ * page/FrameView.h: >+ > 2018-06-12 Philippe Normand <pnormand@igalia.com> > > [GStreamer] Video freezes when GStreamerGL is not installed >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index e80df81311561d9dfcc753dc27cf4c481e8a938b..0c9f6b7c2190075bc160e494e1db158de31799a8 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -190,7 +190,6 @@ FrameView::FrameView(Frame& frame) > , m_useCustomFixedPositionLayoutRect(false) > , m_useCustomSizeForResizeEvent(false) > #endif >- , m_hasOverrideViewportSize(false) > , m_shouldAutoSize(false) > , m_inAutoSize(false) > , m_didRunAutosize(false) >@@ -4375,9 +4374,13 @@ void FrameView::enableAutoSizeMode(bool enable, const IntSize& minSize, const In > > setNeedsLayout(); > layoutContext().scheduleLayout(); >- if (m_shouldAutoSize) >+ if (m_shouldAutoSize) { >+ // We should consider overriding the height as well. See webkit.org/b/186586 >+ overrideViewportSizeForCSSViewportUnits({ minSize.width(), std::nullopt }); > return; >+ } > >+ clearViewportSizeOverrideForCSSViewportUnits(); > // Since autosize mode forces the scrollbar mode, change them to being auto. > setVerticalScrollbarLock(false); > setHorizontalScrollbarLock(false); >@@ -5088,30 +5091,57 @@ void FrameView::setViewExposedRect(std::optional<FloatRect> viewExposedRect) > if (auto* page = frame().page()) > page->pageOverlayController().didChangeViewExposedRect(); > } >- >+ >+void FrameView::clearViewportSizeOverrideForCSSViewportUnits() >+{ >+ if (!m_overrideViewportSize) >+ return; >+ >+ m_overrideViewportSize = std::nullopt; >+ if (auto* document = frame().document()) >+ document->styleScope().didChangeStyleSheetEnvironment(); >+} >+ > void FrameView::setViewportSizeForCSSViewportUnits(IntSize size) > { >- if (m_hasOverrideViewportSize && m_overrideViewportSize == size) >+ overrideViewportSizeForCSSViewportUnits({ size.width(), size.height() }); >+} >+ >+void FrameView::overrideViewportSizeForCSSViewportUnits(OverrideViewportSize size) >+{ >+ if (m_overrideViewportSize && *m_overrideViewportSize == size) > return; >- >+ > m_overrideViewportSize = size; >- m_hasOverrideViewportSize = true; >- >- if (Document* document = frame().document()) >+ >+ if (auto* document = frame().document()) > document->styleScope().didChangeStyleSheetEnvironment(); > } >- >+ > IntSize FrameView::viewportSizeForCSSViewportUnits() const > { >- if (m_hasOverrideViewportSize) >- return m_overrideViewportSize; >+ OverrideViewportSize viewportSize; > >- if (useFixedLayout()) >- return fixedLayoutSize(); >+ if (m_overrideViewportSize) { >+ viewportSize = *m_overrideViewportSize; >+ // auto-size overrides the width only, so we can't always bail out early here. >+ if (viewportSize.width && viewportSize.height) >+ return { *viewportSize.width, *viewportSize.height }; >+ } >+ >+ if (useFixedLayout()) { >+ auto fixedLayoutSize = this->fixedLayoutSize(); >+ viewportSize.width = viewportSize.width.value_or(fixedLayoutSize.width()); >+ viewportSize.height = viewportSize.height.value_or(fixedLayoutSize.height()); >+ return { *viewportSize.width, *viewportSize.height }; >+ } > > // FIXME: the value returned should take into account the value of the overflow > // property on the root element. >- return visibleContentRectIncludingScrollbars().size(); >+ auto visibleContentSizeIncludingScrollbars = visibleContentRectIncludingScrollbars().size(); >+ viewportSize.width = viewportSize.width.value_or(visibleContentSizeIncludingScrollbars.width()); >+ viewportSize.height = viewportSize.height.value_or(visibleContentSizeIncludingScrollbars.height()); >+ return { *viewportSize.width, *viewportSize.height }; > } > > bool FrameView::shouldPlaceBlockDirectionScrollbarOnLeft() const >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index 8f60e7cdb275fbef0876bd10dc7382af634b9bda..685e061e8c69757ef8756c7fd725fa5df3925460 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -211,7 +211,9 @@ public: > WEBCORE_EXPORT void adjustViewSize(); > > WEBCORE_EXPORT void setViewportSizeForCSSViewportUnits(IntSize); >+ void clearViewportSizeOverrideForCSSViewportUnits(); > IntSize viewportSizeForCSSViewportUnits() const; >+ > > IntRect windowClipRect() const final; > WEBCORE_EXPORT IntRect windowClipRectForFrameOwner(const HTMLFrameOwnerElement*, bool clipToLayerContents) const; >@@ -782,6 +784,14 @@ private: > void willDoLayout(WeakPtr<RenderElement> layoutRoot); > void didLayout(WeakPtr<RenderElement> layoutRoot); > >+ struct OverrideViewportSize { >+ std::optional<int> width; >+ std::optional<int> height; >+ >+ bool operator==(const OverrideViewportSize& rhs) const { return rhs.width == width && rhs.height == height; } >+ }; >+ void overrideViewportSizeForCSSViewportUnits(OverrideViewportSize); >+ > HashSet<Widget*> m_widgetsInRenderTree; > > static MonotonicTime sCurrentPaintTimeStamp; // used for detecting decoded resource thrash in the cache >@@ -867,8 +877,7 @@ private: > IntSize m_customSizeForResizeEvent; > #endif > >- IntSize m_overrideViewportSize; >- bool m_hasOverrideViewportSize; >+ std::optional<OverrideViewportSize> m_overrideViewportSize; > > // If true, automatically resize the frame view around its content. > bool m_shouldAutoSize; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 3ca8c80a502c3531008c4ab124ce8e37cf42af70..50afcfaf5a67eb4b2f9a2d6d5112ea420ab76823 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-06-13 Zalan Bujtas <zalan@apple.com> >+ >+ [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units >+ https://bugs.webkit.org/show_bug.cgi?id=186585 >+ <rdar://problem/30685325> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/dynamic/mail-autosize-viewport-unit-expected.txt: Added. >+ * fast/dynamic/mail-autosize-viewport-unit.html: Added. >+ > 2018-06-12 Zalan Bujtas <zalan@apple.com> > > Complex text handling should opt out of bounded text layout. >diff --git a/LayoutTests/fast/dynamic/mail-autosize-viewport-unit-expected.txt b/LayoutTests/fast/dynamic/mail-autosize-viewport-unit-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..165145db57104cb366022745029a92a3fa8b106e >--- /dev/null >+++ b/LayoutTests/fast/dynamic/mail-autosize-viewport-unit-expected.txt >@@ -0,0 +1,2 @@ >+ >+2000px 1000px 200px 0px >diff --git a/LayoutTests/fast/dynamic/mail-autosize-viewport-unit.html b/LayoutTests/fast/dynamic/mail-autosize-viewport-unit.html >new file mode 100644 >index 0000000000000000000000000000000000000000..be083c0f28585e1d72dfb36a7b9791c5efadf8c1 >--- /dev/null >+++ b/LayoutTests/fast/dynamic/mail-autosize-viewport-unit.html >@@ -0,0 +1,51 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<title>This tests that autosize uses the min-width as the base for resolving viewport unit values</title> >+<style> >+#w100 { >+ width: 100vw; >+ height: 10px; >+} >+ >+#w50 { >+ width: 50vw; >+ height: 10px; >+} >+ >+#w10 { >+ width: 10vw; >+ height: 10px; >+} >+ >+#w0 { >+ width: 0vw; >+ height: 10px; >+} >+</style> >+<script> >+if (window.internals) >+ internals.enableAutoSizeMode(true, 2000, 600, 4000, 1000); >+ >+if (window.testRunner) >+ testRunner.dumpAsText(); >+</script> >+</head> >+<body> >+<div id=w100></div> >+<div id=w50></div> >+<div id=w10></div> >+<div id=w0></div> >+<img src="notfound.jpg" width=3000px height=100px> >+<pre id=result></pre> >+<script> >+document.body.offsetWidth; >+result.textContent = window.getComputedStyle(w100, null).getPropertyValue("width") + " " >+ + window.getComputedStyle(w50, null).getPropertyValue("width") + " " >+ + window.getComputedStyle(w10, null).getPropertyValue("width") + " " >+ + window.getComputedStyle(w0, null).getPropertyValue("width"); >+if (window.internals) >+ internals.enableAutoSizeMode(false, 0, 0, 0, 0); >+</script> >+</body> >+</html> >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index 55d39f13272f54c7bbdeac98477e430c725713f0..d6022de5d27056dd65b443b95e1d7c988dae63a8 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -3305,3 +3305,6 @@ webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/i18n/css3-text- > webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/i18n/css3-text-line-break-opclns-115.html [ ImageOnlyFailure ] > webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/i18n/css3-text-line-break-opclns-116.html [ ImageOnlyFailure ] > webkit.org/b/183258 imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-006.html [ ImageOnlyFailure ] >+ >+# unsupported >+fast/dynamic/mail-autosize-viewport-unit.html [ Failure ]
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 186585
:
342624
|
342663
|
342665
|
342669
|
342680
|
342689
|
342694
|
343446