-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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+WebContent: Move scrollbar painting into WebContent #24554
Draft
jamierocks
wants to merge
6
commits into
SerenityOS:master
Choose a base branch
from
jamierocks:ladybird-21
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a hack needed to preserve current behaviour after making set viewport_rect() being not async in upcoming changes. For example both handle_mousedown and handle_mouseup should use the same viewport scroll offset even though handle_mousedown runs focusing steps that might cause scrolling to focused element: - handle_mousedown({ 0, 0 }) - run_focusing_steps() - set_focused_element() - scroll_into_viewport() changes viewport scroll offset - handle_mouseup({ 0, 0 }) (cherry picked from commit 50920b05953a6bc2aacb07d291d503052caadf15)
(cherry picked from commit eb909118bfe9d939a1109823b6e0b8736abab138)
The main intention of this change is to have a consistent look and behavior across all scrollbars, including elements with `overflow: scroll` and `overflow: auto`, iframes, and a page. Before: - Page's scrollbar is painted by Browser (Qt/AppKit) using the corresponding UI framework style, - Both WebContent and Browser know the scroll position offset. - WebContent uses did_request_scroll_to() IPC call to send updates. - Browser uses set_viewport_rect() to send updates. After: - Page's scrollbar is painted on WebContent side using the same style as currently used for elements with `overflow: scroll` and `overflow: auto`. A nice side effects: scrollbars are now painted for iframes, and page's scrollbar respects scrollbar-width CSS property. - Only WebContent knows scroll position offset. - did_request_scroll_to() is no longer used. - set_viewport_rect() is changed to set_viewport_size(). (cherry picked from commit 5285e22f2aa09152365179865f135e7bc5d254a5)
No longer used after moving scrollbar painting into WebContent. (cherry picked from commit cc3d95a356ea3769d325c2f7bb73947cb4ba7baa)
No longer used after moving scrollbar painting into WebContent. (cherry picked from commit 94eacf6da736f957a5fc22faa552341165aaf1ca)
(cherry picked from commit 881e97084625184543b93cee235cb0b96ee055ae)
Without making changes in SerenityOS Browser you will get duplicated scrollbar (one painted in WebContent and another in Browser) and probably some other issues. |
Hmm, silly me. I'll work on this later / tomorrow :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See LadybirdBrowser/ladybird#21 for details :^)