mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Fix context menu and select dropdown position in iframe
This commit is contained in:
Notes:
github-actions[bot]
2025-01-22 12:26:46 +00:00
Author: https://github.com/Psychpsyo Commit: https://github.com/LadybirdBrowser/ladybird/commit/d5c21301dbb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3249 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user