Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: brave.com is now scrollable #24066

Closed
wants to merge 1 commit into from

Conversation

mayatyner
Copy link

The is_user_scrollable method in Box now ignores overflow: hidden. This makes websites like brave.com scrollable via the mouse wheel.

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Apr 22, 2024
@BuggieBot
Copy link
Member

Hello!

One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

@NguyenH-T NguyenH-T force-pushed the master branch 4 times, most recently from 8b56d99 to 8a19d8a Compare April 22, 2024 03:17
@kalenikaliaksandr
Copy link
Contributor

Please, change the commit to reference the issue you intended to fix #24009

Comment on lines +60 to +61
if (computed_values().overflow_y() == CSS::Overflow::Hidden || computed_values().overflow_x() == CSS::Overflow::Hidden)
return false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignoring scrolling if either of directions has "overflow: hidden" is wrong: vertical scrolling should not be ignored, if only horizontal direction has hidden overflow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming you trying to fix:

<!doctype html><style>
* { font-size: 200px; }
main { overflow-x: hidden; }
</style>
<main>
1<br>
2<br>
3<br>
4<br>
5<br>
6<br>
7<br>
8<br>
9<br>

let's have a look at paintable tree dump:

ViewportPaintable (Viewport<#document>) [0,0 1279x780] overflow: [0,0 1279x2086]
  PaintableWithLines (BlockContainer<HTML>) [0,0 1279x2086]
    PaintableWithLines (BlockContainer<BODY>) [8,8 1263x2070]
      PaintableWithLines (BlockContainer<MAIN>) [8,8 1263x2070]
        TextPaintable (TextNode<#text>)
        TextPaintable (TextNode<#text>)
        TextPaintable (TextNode<#text>)
        TextPaintable (TextNode<#text>)
        TextPaintable (TextNode<#text>)
        TextPaintable (TextNode<#text>)
        TextPaintable (TextNode<#text>)
        TextPaintable (TextNode<#text>)
        TextPaintable (TextNode<#text>)

the only paintable with scrollable overflow (named overflow in the dump) is viewport. <main> does not have any. so <main> is scrollable based on css overflow properties, because overflow_y is auto.
BUT it does not have any scrollable overflow. let's make is_user_scrollable() to also look at rect returned by PaintableBox::scrollable_overflow_rect()?

@kalenikaliaksandr
Copy link
Contributor

The problem this PR intended to address was fixed in #24228

@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants