Bug 273792

Summary: REGRESSION(276079@main): [GTK] Web view content disappears after back/forward navigation
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, mcatanzaro, vitaly
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 270445    

Description Michael Catanzaro 2024-05-06 13:32:44 PDT
Reproducer:

 * Visit https://www.cnn.com/middleeast/live-news/israel-hamas-war-gaza-news-05-06-24-intl-hnk/index.html in Epiphany
 * Enter reader mode
 * Click Back to return to the original page

The web view contents will be solid black. I'm using 278417@main with my personal jhbuild of Epiphany. This error does not occur in Epiphany Tech Preview, so it probably regressed sometime after 2.44.
Comment 1 Michael Catanzaro 2024-05-06 14:26:12 PDT
This is bisectable. I should have a result soon.
Comment 2 Michael Catanzaro 2024-05-07 08:34:09 PDT
OK, here is the bisect result. But note that the way in which this is broken changed at some point between here and now. Currently when you press Back, you go to a solid black web view. But as of the first bad commit, you go to back to a transparent web view. Something changed later on to change it from transparent to black. I should be able to bisect that if needed, but I'll assume it's not needed unless requested.


7c138c89f181e0a39ee64cd986ef11a848793575 is the first bad commit
commit 7c138c89f181e0a39ee64cd986ef11a848793575
Author: Vitaly Dyachkov <vitaly@igalia.com>
Date:   Thu Mar 14 02:18:59 2024 -0700

    [CoordinatedGraphics] Setting `LocalFrameView`'s content size should not require relayout
    https://bugs.webkit.org/show_bug.cgi?id=270445
    
    Reviewed by Darin Adler.
    
    In `LocalFrameViewLayoutContext::performLayout()` we layout the render
    tree in several phases:
    
    - `LayoutPhase::InPreLayout`
    - `LayoutPhase::InRenderTreeLayout`
    - `LayoutPhase::InViewSizeAdjust`
    - `LayoutPhase::InPostLayout`
    
    In the last phase, we assert that the layout root doesn't require
    relayout after updating `LocalFrameView`'s content size.
    
    Currently, at the end of `LayerTreeHost::contentsSizeChanged()` we call
    `didChangeViewport()`, which in some circumstances (e.g. when fixed
    layout is used) can trigger
    `LocalFrameView::setViewportConstrainedObjectsNeedLayout()` and make
    `RenderView::needsLayout()` return `true`. This should not happen.
    
    * Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
    (WebKit::LayerTreeHost::contentsSizeChanged):
    
    Canonical link: https://commits.webkit.org/276079@main

 Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp | 1 -
 1 file changed, 1 deletion(-)
Comment 3 Michael Catanzaro 2024-05-07 08:54:12 PDT
Pull request: https://github.com/WebKit/WebKit/pull/28239
Comment 4 EWS 2024-05-07 11:03:09 PDT
Committed 278469@main (5034eecac6ed): <https://commits.webkit.org/278469@main>

Reviewed commits have been landed. Closing PR #28239 and removing active labels.