mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Fix context menu and select dropdown position in iframe
This commit is contained in:
parent
30507681f7
commit
d5c21301db
Notes:
github-actions[bot]
2025-01-22 12:26:46 +00:00
Author: https://github.com/Psychpsyo
Commit: d5c21301db
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3249
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 7 additions and 5 deletions
|
@ -2152,13 +2152,14 @@ CSSPixelRect Navigable::to_top_level_rect(CSSPixelRect const& a_rect)
|
|||
CSSPixelPoint Navigable::to_top_level_position(CSSPixelPoint a_position)
|
||||
{
|
||||
auto position = a_position;
|
||||
for (auto ancestor = parent(); ancestor; ancestor = ancestor->parent()) {
|
||||
for (auto ancestor = this; ancestor; ancestor = ancestor->parent()) {
|
||||
if (is<TraversableNavigable>(*ancestor))
|
||||
break;
|
||||
if (!ancestor->container())
|
||||
return {};
|
||||
if (!ancestor->container()->paintable())
|
||||
return {};
|
||||
// FIXME: Handle CSS transforms that might affect the ancestor.
|
||||
position.translate_by(ancestor->container()->paintable()->box_type_agnostic_position());
|
||||
}
|
||||
return position;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue