WebKit Bugzilla
Attachment 342630 Details for
Bug 186586
: [Mail] Use the Mail Viewer height as the base for resolving vertical viewport units
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Horizontal and vertical
HorizontalAndVertical.patch (text/plain), 6.98 KB, created by
zalan
on 2018-06-12 22:04:05 PDT
(
hide
)
Description:
Horizontal and vertical
Filename:
MIME Type:
Creator:
zalan
Created:
2018-06-12 22:04:05 PDT
Size:
6.98 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 9898df8d32c..036da927b32 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-06-12 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 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed, rolling out r232774. >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 00000000000..0b7c5b1bd99 >--- /dev/null >+++ b/LayoutTests/fast/dynamic/mail-autosize-viewport-unit-expected.txt >@@ -0,0 +1,5 @@ >+ >+2000px 600px >+1000px 300px >+200px 60px >+0px 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 00000000000..56479d5c051 >--- /dev/null >+++ b/LayoutTests/fast/dynamic/mail-autosize-viewport-unit.html >@@ -0,0 +1,55 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<title>This tests that autosize uses the min-width/height as the base for resolving viewport unit values</title> >+<style> >+#w100 { >+ width: 100vw; >+ height: 100vh; >+} >+ >+#w50 { >+ width: 50vw; >+ height: 50vh; >+} >+ >+#w10 { >+ width: 10vw; >+ height: 10vh; >+} >+ >+#w0 { >+ width: 0vw; >+ height: 0vh; >+} >+</style> >+</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=800px> >+<pre id=result></pre> >+<script> >+if (window.internals) >+ internals.enableAutoSizeMode(true, 2000, 600, 4000, 1000); >+ >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ testRunner.dumpAsText(); >+} >+ >+setTimeout(function() { >+ document.body.offsetWidth; >+ result.innerHTML = window.getComputedStyle(w100, null).getPropertyValue("width") + " " + window.getComputedStyle(w100, null).getPropertyValue("height") + "<br>" >+ + window.getComputedStyle(w50, null).getPropertyValue("width") + " " + window.getComputedStyle(w50, null).getPropertyValue("height") + "<br>" >+ + window.getComputedStyle(w10, null).getPropertyValue("width") + " " + window.getComputedStyle(w10, null).getPropertyValue("height") + "<br>" >+ + window.getComputedStyle(w0, null).getPropertyValue("width") + " " + window.getComputedStyle(w0, null).getPropertyValue("height"); >+ if (window.testRunner) { >+ testRunner.notifyDone(); >+ } >+}, 0); >+</script> >+</body> >+</html> >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 67cebe5055b..2522eeaf15d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-06-12 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 Ryan Haddad <ryanhaddad@apple.com> > > Unreviewed, rolling out r232774. >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index e80df813115..0fee3f805e0 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,12 @@ void FrameView::enableAutoSizeMode(bool enable, const IntSize& minSize, const In > > setNeedsLayout(); > layoutContext().scheduleLayout(); >- if (m_shouldAutoSize) >+ if (m_shouldAutoSize) { >+ setViewportSizeForCSSViewportUnits(minSize); > return; >+ } > >+ clearViewportSizeOverrideForCSSViewportUnits(); > // Since autosize mode forces the scrollbar mode, change them to being auto. > setVerticalScrollbarLock(false); > setHorizontalScrollbarLock(false); >@@ -5088,23 +5090,32 @@ 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) >+ 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; >+ if (m_overrideViewportSize) >+ return *m_overrideViewportSize; > > if (useFixedLayout()) > return fixedLayoutSize(); >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index 8f60e7cdb27..a6d7d5a64a1 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -782,6 +782,8 @@ private: > void willDoLayout(WeakPtr<RenderElement> layoutRoot); > void didLayout(WeakPtr<RenderElement> layoutRoot); > >+ void clearViewportSizeOverrideForCSSViewportUnits(); >+ > HashSet<Widget*> m_widgetsInRenderTree; > > static MonotonicTime sCurrentPaintTimeStamp; // used for detecting decoded resource thrash in the cache >@@ -867,8 +869,7 @@ private: > IntSize m_customSizeForResizeEvent; > #endif > >- IntSize m_overrideViewportSize; >- bool m_hasOverrideViewportSize; >+ std::optional<IntSize> m_overrideViewportSize; > > // If true, automatically resize the frame view around its content. > bool m_shouldAutoSize;
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 186586
:
342629
| 342630 |
342638
|
342640
|
342702