Changeset 244944 in webkit


Ignore:
Timestamp:
May 3, 2019 7:25:03 PM (5 years ago)
Author:
Alan Bujtas
Message:

[iOS] outlook.live.com: Compose email frame not fully visible and not scrollable
https://bugs.webkit.org/show_bug.cgi?id=197573
<rdar://problem/48008441>

Reviewed by Wenson Hsieh.

Source/WebCore:

The outlook mail view's flex column setup produces a somewhat unfortunate layout at certain viewport widths.
This patch addresses the issue by ensuring that we never fall into that range.

  • page/Quirks.cpp:

(WebCore::Quirks::shouldIgnoreShrinkToFitContent const):
(WebCore::Quirks::overriddenViewportLayoutWidth const):

  • page/Quirks.h:

Source/WebKit:

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::adjustLayoutSizeIfNeeded):
(WebKit::WebPage::setViewportConfigurationViewLayoutSize):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::immediatelyShrinkToFitContent):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r244938 r244944  
     12019-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
    1172019-05-02  Jiewen Tan  <jiewen_tan@apple.com>
    218
  • trunk/Source/WebCore/page/Quirks.cpp

    r244912 r244944  
    5656}
    5757
     58bool 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
     71Optional<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
    5889bool Quirks::shouldIgnoreInvalidSignal() const
    5990{
  • trunk/Source/WebCore/page/Quirks.h

    r244912 r244944  
    4040
    4141    bool shouldIgnoreInvalidSignal() const;
     42    WEBCORE_EXPORT bool shouldIgnoreShrinkToFitContent() const;
     43    WEBCORE_EXPORT Optional<LayoutUnit> overriddenViewLayoutWidth(LayoutUnit currentViewLayoutWidth) const;
    4244    bool needsFormControlToBeMouseFocusable() const;
    4345    bool needsAutoplayPlayPauseEvents() const;
  • trunk/Source/WebCore/page/ViewportConfiguration.h

    r244849 r244944  
    119119    WEBCORE_EXPORT IntSize layoutSize() const;
    120120    WEBCORE_EXPORT int layoutWidth() const;
     121    WEBCORE_EXPORT int layoutHeight() const;
    121122    WEBCORE_EXPORT double initialScale() const;
    122123    WEBCORE_EXPORT double initialScaleIgnoringContentSize() const;
     
    147148    double viewportArgumentsLength(double length) const;
    148149    double initialScaleFromSize(double width, double height, bool shouldIgnoreScalingConstraints) const;
    149     int layoutHeight() const;
    150150
    151151    bool shouldOverrideDeviceWidthAndShrinkToFit() const;
  • trunk/Source/WebKit/ChangeLog

    r244941 r244944  
     12019-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
    1162019-05-03  Dean Jackson  <dino@apple.com>
    217
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r244932 r244944  
    12121212
    12131213#if PLATFORM(IOS_FAMILY)
     1214    WebCore::FloatSize viewLayoutSizeAdjustedForQuirks(const WebCore::FloatSize&);
    12141215    void resetViewportDefaultConfiguration(WebFrame* mainFrame, bool hasMobileDocType = false);
    12151216    enum class ZoomToInitialScale { No, Yes };
  • trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r244932 r244944  
    27872787}
    27882788
     2789FloatSize 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
    27892796void WebPage::setViewportConfigurationViewLayoutSize(const FloatSize& size, double scaleFactor, double minimumEffectiveDeviceWidth)
    27902797{
     
    27932800    auto previousLayoutSizeScaleFactor = m_viewportConfiguration.layoutSizeScaleFactor();
    27942801    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)))
    27962803        return;
    27972804
     
    28762883    LOG_WITH_STREAM(VisibleRects, stream << "WebPage::dynamicViewportSizeUpdate setting view layout size to " << viewLayoutSize);
    28772884    bool viewportChanged = m_viewportConfiguration.setIsKnownToLayOutWiderThanViewport(false);
    2878     viewportChanged |= m_viewportConfiguration.setViewLayoutSize(viewLayoutSize);
     2885    viewportChanged |= m_viewportConfiguration.setViewLayoutSize(viewLayoutSizeAdjustedForQuirks(viewLayoutSize));
    28792886    if (viewportChanged)
    28802887        viewportConfigurationChanged();
     
    30453052    }
    30463053
    3047     Document* document = frame->coreFrame()->document();
     3054    auto* document = frame->coreFrame()->document();
    30483055    if (document->isImageDocument())
    30493056        m_viewportConfiguration.setDefaultConfiguration(ViewportConfiguration::imageDocumentParameters());
     
    30533060        m_viewportConfiguration.setDefaultConfiguration(parametersForStandardFrame());
    30543061    m_viewportConfiguration.setIsKnownToLayOutWiderThanViewport(false);
     3062
     3063    if (auto overriddenViewLayoutWidth = document->quirks().overriddenViewLayoutWidth(m_viewportConfiguration.layoutWidth()))
     3064        m_viewportConfiguration.setViewLayoutSize(FloatSize(*overriddenViewLayoutWidth, m_viewportConfiguration.layoutHeight()));
    30553065}
    30563066
     
    30863096    auto mainDocument = makeRefPtr(mainFrame->document());
    30873097    if (!view || !mainDocument)
     3098        return false;
     3099
     3100    if (mainDocument->quirks().shouldIgnoreShrinkToFitContent())
    30883101        return false;
    30893102
Note: See TracChangeset for help on using the changeset viewer.