Changeset 244944 in webkit
- Timestamp:
- May 3, 2019 7:25:03 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r244938 r244944 1 2019-05-03 Zalan Bujtas <zalan@apple.com> 2 3 [iOS] outlook.live.com: Compose email frame not fully visible and not scrollable 4 https://bugs.webkit.org/show_bug.cgi?id=197573 5 <rdar://problem/48008441> 6 7 Reviewed by Wenson Hsieh. 8 9 The outlook mail view's flex column setup produces a somewhat unfortunate layout at certain viewport widths. 10 This patch addresses the issue by ensuring that we never fall into that range. 11 12 * page/Quirks.cpp: 13 (WebCore::Quirks::shouldIgnoreShrinkToFitContent const): 14 (WebCore::Quirks::overriddenViewportLayoutWidth const): 15 * page/Quirks.h: 16 1 17 2019-05-02 Jiewen Tan <jiewen_tan@apple.com> 2 18 -
trunk/Source/WebCore/page/Quirks.cpp
r244912 r244944 56 56 } 57 57 58 bool Quirks::shouldIgnoreShrinkToFitContent() const 59 { 60 #if PLATFORM(IOS_FAMILY) 61 if (!needsQuirks()) 62 return false; 63 64 auto host = m_document->topDocument().url().host(); 65 if (equalLettersIgnoringASCIICase(host, "outlook.live.com")) 66 return true; 67 #endif 68 return false; 69 } 70 71 Optional<LayoutUnit> Quirks::overriddenViewLayoutWidth(LayoutUnit currentViewLayoutWidth) const 72 { 73 #if PLATFORM(IOS_FAMILY) 74 if (!needsQuirks()) 75 return { }; 76 77 auto host = m_document->topDocument().url().host(); 78 if (equalLettersIgnoringASCIICase(host, "outlook.live.com")) { 79 if (currentViewLayoutWidth <= 989 || currentViewLayoutWidth >= 1132) 80 return { }; 81 return { 989 }; 82 } 83 #else 84 UNUSED_PARAM(currentViewLayoutWidth); 85 #endif 86 return { }; 87 } 88 58 89 bool Quirks::shouldIgnoreInvalidSignal() const 59 90 { -
trunk/Source/WebCore/page/Quirks.h
r244912 r244944 40 40 41 41 bool shouldIgnoreInvalidSignal() const; 42 WEBCORE_EXPORT bool shouldIgnoreShrinkToFitContent() const; 43 WEBCORE_EXPORT Optional<LayoutUnit> overriddenViewLayoutWidth(LayoutUnit currentViewLayoutWidth) const; 42 44 bool needsFormControlToBeMouseFocusable() const; 43 45 bool needsAutoplayPlayPauseEvents() const; -
trunk/Source/WebCore/page/ViewportConfiguration.h
r244849 r244944 119 119 WEBCORE_EXPORT IntSize layoutSize() const; 120 120 WEBCORE_EXPORT int layoutWidth() const; 121 WEBCORE_EXPORT int layoutHeight() const; 121 122 WEBCORE_EXPORT double initialScale() const; 122 123 WEBCORE_EXPORT double initialScaleIgnoringContentSize() const; … … 147 148 double viewportArgumentsLength(double length) const; 148 149 double initialScaleFromSize(double width, double height, bool shouldIgnoreScalingConstraints) const; 149 int layoutHeight() const;150 150 151 151 bool shouldOverrideDeviceWidthAndShrinkToFit() const; -
trunk/Source/WebKit/ChangeLog
r244941 r244944 1 2019-05-03 Zalan Bujtas <zalan@apple.com> 2 3 [iOS] outlook.live.com: Compose email frame not fully visible and not scrollable 4 https://bugs.webkit.org/show_bug.cgi?id=197573 5 <rdar://problem/48008441> 6 7 Reviewed by Wenson Hsieh. 8 9 * WebProcess/WebPage/WebPage.h: 10 * WebProcess/WebPage/ios/WebPageIOS.mm: 11 (WebKit::WebPage::adjustLayoutSizeIfNeeded): 12 (WebKit::WebPage::setViewportConfigurationViewLayoutSize): 13 (WebKit::WebPage::dynamicViewportSizeUpdate): 14 (WebKit::WebPage::immediatelyShrinkToFitContent): 15 1 16 2019-05-03 Dean Jackson <dino@apple.com> 2 17 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r244932 r244944 1212 1212 1213 1213 #if PLATFORM(IOS_FAMILY) 1214 WebCore::FloatSize viewLayoutSizeAdjustedForQuirks(const WebCore::FloatSize&); 1214 1215 void resetViewportDefaultConfiguration(WebFrame* mainFrame, bool hasMobileDocType = false); 1215 1216 enum class ZoomToInitialScale { No, Yes }; -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r244932 r244944 2787 2787 } 2788 2788 2789 FloatSize WebPage::viewLayoutSizeAdjustedForQuirks(const FloatSize& size) 2790 { 2791 if (auto* document = m_page->mainFrame().document()) 2792 return { document->quirks().overriddenViewLayoutWidth(size.width()).valueOr(size.width()), size.height() }; 2793 return size; 2794 } 2795 2789 2796 void WebPage::setViewportConfigurationViewLayoutSize(const FloatSize& size, double scaleFactor, double minimumEffectiveDeviceWidth) 2790 2797 { … … 2793 2800 auto previousLayoutSizeScaleFactor = m_viewportConfiguration.layoutSizeScaleFactor(); 2794 2801 auto clampedMinimumEffectiveDevice = m_viewportConfiguration.isKnownToLayOutWiderThanViewport() ? WTF::nullopt : Optional<double>(minimumEffectiveDeviceWidth); 2795 if (!m_viewportConfiguration.setViewLayoutSize( size, scaleFactor, WTFMove(clampedMinimumEffectiveDevice)))2802 if (!m_viewportConfiguration.setViewLayoutSize(viewLayoutSizeAdjustedForQuirks(size), scaleFactor, WTFMove(clampedMinimumEffectiveDevice))) 2796 2803 return; 2797 2804 … … 2876 2883 LOG_WITH_STREAM(VisibleRects, stream << "WebPage::dynamicViewportSizeUpdate setting view layout size to " << viewLayoutSize); 2877 2884 bool viewportChanged = m_viewportConfiguration.setIsKnownToLayOutWiderThanViewport(false); 2878 viewportChanged |= m_viewportConfiguration.setViewLayoutSize(viewLayoutSize );2885 viewportChanged |= m_viewportConfiguration.setViewLayoutSize(viewLayoutSizeAdjustedForQuirks(viewLayoutSize)); 2879 2886 if (viewportChanged) 2880 2887 viewportConfigurationChanged(); … … 3045 3052 } 3046 3053 3047 Document* document = frame->coreFrame()->document();3054 auto* document = frame->coreFrame()->document(); 3048 3055 if (document->isImageDocument()) 3049 3056 m_viewportConfiguration.setDefaultConfiguration(ViewportConfiguration::imageDocumentParameters()); … … 3053 3060 m_viewportConfiguration.setDefaultConfiguration(parametersForStandardFrame()); 3054 3061 m_viewportConfiguration.setIsKnownToLayOutWiderThanViewport(false); 3062 3063 if (auto overriddenViewLayoutWidth = document->quirks().overriddenViewLayoutWidth(m_viewportConfiguration.layoutWidth())) 3064 m_viewportConfiguration.setViewLayoutSize(FloatSize(*overriddenViewLayoutWidth, m_viewportConfiguration.layoutHeight())); 3055 3065 } 3056 3066 … … 3086 3096 auto mainDocument = makeRefPtr(mainFrame->document()); 3087 3097 if (!view || !mainDocument) 3098 return false; 3099 3100 if (mainDocument->quirks().shouldIgnoreShrinkToFitContent()) 3088 3101 return false; 3089 3102
Note: See TracChangeset
for help on using the changeset viewer.