Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: fd191036e4de76b64e4dfad091a2c2dcb40892d3
https://github.com/WebKit/WebKit/commit/fd191036e4de76b64e4dfad091a2c2dcb40892d3
Author: j0pan <[email protected]>
Date: 2026-02-12 (Thu, 12 Feb 2026)
Changed paths:
M Source/WebCore/page/LocalFrameView.cpp
M Source/WebCore/page/Quirks.cpp
M Source/WebCore/page/Quirks.h
M Source/WebCore/page/QuirksData.h
Log Message:
-----------
discord.com: Formatting menu is way above text box
https://bugs.webkit.org/show_bug.cgi?id=306779
rdar://162719481
Reviewed by Tim Nguyen.
Discord uses getBoundingClientRect() to find where selected text is
on screen, then positions the toolbar there. But when the
keyboard is open, this function was returning coordinates
based on where the page scrolled to, not where things visually
appear on screen.
This fix calculates coordinates based on the "layout viewport"
instead of the "visual viewport" (which moves when you scroll).
This makes getBoundingClientRect() return positions that match
where things actually appear.
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::documentToClientOffset const):
* Source/WebCore/page/Quirks.cpp:
(WebCore::Quirks::shouldUseLayoutViewportForClientRects const):
(WebCore::handleDiscordQuirks):
(WebCore::Quirks::determineRelevantQuirks):
* Source/WebCore/page/Quirks.h:
* Source/WebCore/page/QuirksData.h:
Canonical link: https://commits.webkit.org/307378@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications