Bug 248693 - [GTK][cairo] overflow-x: clip on html and body causes content to be invisible unless zoomed in
Summary: [GTK][cairo] overflow-x: clip on html and body causes content to be invisible...
Status: RESOLVED DUPLICATE of bug 228920
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-02 15:52 PST by two
Modified: 2023-05-10 13:01 PDT (History)
2 users (show)

See Also:


Attachments
2 windows with the same code (as described above, plus a background) & an html preview buffer: the 1st one shows a page with only the background visible, the 2nd shows the page with also visible text (1015.58 KB, image/png)
2022-12-02 15:52 PST, two
no flags Details
test case (188 bytes, text/html)
2023-04-30 13:33 PDT, Fujii Hironori
no flags Details
WIP patch (1.05 KB, patch)
2023-04-30 14:53 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
WIP patch of changing kLayoutUnitFractionalBits (644 bytes, patch)
2023-05-09 23:48 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description two 2022-12-02 15:52:45 PST
Created attachment 463861 [details]
2 windows with the same code (as described above, plus a background) & an html preview buffer: the 1st one shows a page with only the background visible, the 2nd shows the page with also visible text

one website wasn't rendering correctly in epiphany, all the text was invisible, but it became visible after i zoomed in on the page. after poking some css rules in the inspector, it turned out that having `overflow-x: clip` on both `<head>` and `<body>` is what's causing it.

a minimal document to reproduce:

```html
<html>
  <head>
    <style>
      html { overflow-x: clip; }
      body { overflow-x: clip; }
    </style>
  </head>
  <body>
    <p>some text blabla</p>
  </body>
</html>
```

here are some screenshots with a background to show the zoom clearer:
Comment 1 two 2022-12-02 16:00:41 PST
reproducible on 16 Technology Preview too
Comment 2 Fujii Hironori 2023-04-30 13:33:19 PDT
Created attachment 466150 [details]
test case
Comment 3 Fujii Hironori 2023-04-30 14:50:04 PDT
RenderBox::overflowClipRect expands the clip rect to inifinite in Y axis.

    if (style().overflowX() == Overflow::Clip && style().overflowY() == Overflow::Visible)
        clipRect.expandToInfiniteY();

https://github.com/WebKit/WebKit/blob/aad6f77b647edba28f9e192346076d2922841a0d/Source/WebCore/rendering/RenderBox.cpp#L2132-L2133
Comment 4 Fujii Hironori 2023-04-30 14:53:36 PDT
Created attachment 466152 [details]
WIP patch
Comment 5 Fujii Hironori 2023-05-09 00:43:52 PDT
LayoutUnit is using 26.6 fixed point number while cairo is using 24.8 fixed point number internally.
_cairo_fixed_from_double returns 0 for large numbers.
Comment 6 Fujii Hironori 2023-05-09 23:48:49 PDT
Created attachment 466304 [details]
WIP patch of changing kLayoutUnitFractionalBits

I tried another approach of changing kLayoutUnitFractionalBits to match with cairo.
However, some tests fail due to the maximum value change and the precision change.

Regressions: Unexpected text-only failures (20)
  css1/formatting_model/vertical_formatting.html [ Failure ]
  css1/text_properties/vertical_align.html [ Failure ]
  css2.1/t080301-c411-vt-mrgn-00-b.html [ Failure ]
  css3/flexbox/flex-algorithm.html [ Failure ]
  css3/flexbox/flex-flow-auto-margins-no-available-space-assert.html [ Failure ]
  fast/css-grid-layout/grid-auto-repeat-huge-grid.html [ Failure ]
  fast/css/calc-parsing-limits.html [ Failure ]
  fast/css/calc-parsing.html [ Failure ]
  fast/css/getComputedStyle/getComputedStyle-margin-percentage.html [ Failure ]
  fast/css/large-number-round-trip.html [ Failure ]
  fast/css/large-numbers.html [ Failure ]
  fast/css/percentage-non-integer.html [ Failure ]
  fast/css/word-space-extra.html [ Failure ]
  fast/dom/HTMLMeterElement/meter-optimums.html [ Failure ]
  fast/dom/HTMLMeterElement/meter-styles.html [ Failure ]
  fast/events/constructors/mouse-event-constructor.html [ Failure ]
  fast/events/constructors/wheel-event-constructor.html [ Failure ]
  fast/text/text-letter-spacing.html [ Failure ]
  fast/text/whitespace/024.html [ Failure ]
  fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html [ Failure ]
Comment 7 Fujii Hironori 2023-05-10 13:01:00 PDT
I'm goint to fix this bug in bug#228920.

*** This bug has been marked as a duplicate of bug 228920 ***