⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185661 in webkit


Ignore:
Timestamp:
Jun 17, 2015, 12:23:08 PM (11 years ago)
Author:
timothy_horton@apple.com
Message:

Safari tabs still have shrunken content after coming out of fullscreen
​https://bugs.webkit.org/show_bug.cgi?id=146037
<rdar://problem/21105960>

Reviewed by Simon Fraser and Darin Adler.

  • UIProcess/WebPageProxy.h:

(WebKit::WebPageProxy::useFixedLayoutDidChange):
(WebKit::WebPageProxy::fixedLayoutSizeDidChange):

  • UIProcess/WebPageProxy.messages.in:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::setUseFixedLayout):
(WebKit::WebPage::setFixedLayoutSize):
Keep the UI process up-to-date when fixed layout is enabled or the size changes.
This is important because these things can change from the Web process side too,
and the UI process uses its (potentially stale) version to do some short-circuiting.
This was causing us to fail to turn off fixed layout when it was turned
on from the Web process side (by TiledCoreAnimationDrawingArea).

  • UIProcess/mac/WKViewLayoutStrategy.mm:

(-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy willChangeLayoutStrategy]):
Reset the view scale, which WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy
makes heavy use of, just like the others.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKit2Cocoa/ShrinkToFit.mm: Added.

(-[ShrinkToFitNavigationDelegate webView:didFinishNavigation:]):
(TEST):
Add a test that ensures that disabling scale-to-fit mode correctly updates
the page's layout.

Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r185653 r185661  
     12015-06-17  Tim Horton  <timothy_horton@apple.com>
     2
     3        Safari tabs still have shrunken content after coming out of fullscreen
     4        https://bugs.webkit.org/show_bug.cgi?id=146037
     5        <rdar://problem/21105960>
     6
     7        Reviewed by Simon Fraser and Darin Adler.
     8
     9        * UIProcess/WebPageProxy.h:
     10        (WebKit::WebPageProxy::useFixedLayoutDidChange):
     11        (WebKit::WebPageProxy::fixedLayoutSizeDidChange):
     12        * UIProcess/WebPageProxy.messages.in:
     13        * WebProcess/WebPage/WebPage.cpp:
     14        (WebKit::WebPage::setUseFixedLayout):
     15        (WebKit::WebPage::setFixedLayoutSize):
     16        Keep the UI process up-to-date when fixed layout is enabled or the size changes.
     17        This is important because these things can change from the Web process side too,
     18        and the UI process uses its (potentially stale) version to do some short-circuiting.
     19        This was causing us to fail to turn off fixed layout when it was turned
     20        on from the Web process side (by TiledCoreAnimationDrawingArea).
     21
     22        * UIProcess/mac/WKViewLayoutStrategy.mm:
     23        (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy willChangeLayoutStrategy]):
     24        Reset the view scale, which WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy
     25        makes heavy use of, just like the others.
     26
    1272015-06-17  Dan Bernstein  <mitz@apple.com>
    228
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r185554 r185661  
    14481448#endif
    14491449
     1450    void useFixedLayoutDidChange(bool useFixedLayout) { m_useFixedLayout = useFixedLayout; }
     1451    void fixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize) { m_fixedLayoutSize = fixedLayoutSize; }
     1452
    14501453    void handleAutoFillButtonClick(const UserData&);
    14511454
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r185554 r185661  
    440440#endif
    441441
     442    UseFixedLayoutDidChange(bool useFixedLayout)
     443    FixedLayoutSizeDidChange(WebCore::IntSize fixedLayoutSize)
    442444}
  • trunk/Source/WebKit2/UIProcess/mac/WKViewLayoutStrategy.mm

    r184358 r185661  
    402402{
    403403    _page->setShouldScaleViewToFitDocument(false);
     404    _page->scaleView(1);
    404405}
    405406
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r185563 r185661  
    15381538    if (!fixed)
    15391539        setFixedLayoutSize(IntSize());
     1540
     1541    send(Messages::WebPageProxy::UseFixedLayoutDidChange(fixed));
    15401542}
    15411543
    … …  
    15471549
    15481550    view->setFixedLayoutSize(size);
     1551
     1552    send(Messages::WebPageProxy::FixedLayoutSizeDidChange(size));
    15491553}
    15501554
  • trunk/Tools/ChangeLog

    r185653 r185661  
     12015-06-17  Tim Horton  <timothy_horton@apple.com>
     2
     3        Safari tabs still have shrunken content after coming out of fullscreen
     4        https://bugs.webkit.org/show_bug.cgi?id=146037
     5        <rdar://problem/21105960>
     6
     7        Reviewed by Simon Fraser and Darin Adler.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/WebKit2Cocoa/ShrinkToFit.mm: Added.
     11        (-[ShrinkToFitNavigationDelegate webView:didFinishNavigation:]):
     12        (TEST):
     13        Add a test that ensures that disabling scale-to-fit mode correctly updates
     14        the page's layout.
     15
    1162015-06-17  Dan Bernstein  <mitz@apple.com>
    217
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r185658 r185661  
    3131                297234B7173AFAC700983601 /* CustomProtocolsInvalidScheme_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 297234B5173AFAC700983601 /* CustomProtocolsInvalidScheme_Bundle.cpp */; };
    3232                2D1FE0B01AD465C1006CD9E6 /* FixedLayoutSize.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D1FE0AF1AD465C1006CD9E6 /* FixedLayoutSize.mm */; };
     33                2D9A53AF1B31FA8D0074D5AA /* ShrinkToFit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D9A53AE1B31FA8D0074D5AA /* ShrinkToFit.mm */; };
    3334                2DD7D3AF178227B30026E1E3 /* lots-of-text-vertical-lr.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 2DD7D3AE178227AC0026E1E3 /* lots-of-text-vertical-lr.html */; };
    3435                2E7765CD16C4D80A00BA2BB1 /* mainIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E7765CC16C4D80A00BA2BB1 /* mainIOS.mm */; };
    … …  
    469470                2D1FE0AF1AD465C1006CD9E6 /* FixedLayoutSize.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FixedLayoutSize.mm; sourceTree = "<group>"; };
    470471                2D640B5417875DFF00BFAF99 /* ScrollPinningBehaviors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollPinningBehaviors.cpp; sourceTree = "<group>"; };
     472                2D9A53AE1B31FA8D0074D5AA /* ShrinkToFit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ShrinkToFit.mm; sourceTree = "<group>"; };
    471473                2DD7D3A9178205D00026E1E3 /* ResizeReversePaginatedWebView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResizeReversePaginatedWebView.cpp; sourceTree = "<group>"; };
    472474                2DD7D3AE178227AC0026E1E3 /* lots-of-text-vertical-lr.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "lots-of-text-vertical-lr.html"; sourceTree = "<group>"; };
    … …  
    843845                                C95501BE19AD2FAF0049BE3E /* Preferences.mm */,
    844846                                37D36F311B004DD400BAF5D9 /* ProvisionalURLChange.mm */,
     847                                2D9A53AE1B31FA8D0074D5AA /* ShrinkToFit.mm */,
    845848                                7CC3E1FA197E234100BE6252 /* UserContentController.mm */,
    846849                                0F3B94A51A77266C00DE3272 /* WKWebViewEvaluateJavaScript.mm */,
    … …  
    16031606                        buildActionMask = 2147483647;
    16041607                        files = (
     1608                                2D9A53AF1B31FA8D0074D5AA /* ShrinkToFit.mm in Sources */,
    16051609                                7AA021BB1AB09EA70052953F /* DateMath.cpp in Sources */,
    16061610                                2D1FE0B01AD465C1006CD9E6 /* FixedLayoutSize.mm in Sources */,
Note: See TracChangeset for help on using the changeset viewer.