script: Chain up keyboard scrolling to parent <iframe>s (#39469)

When an `<iframe>` cannot scroll because the size of the frame is
greater than or
equal to the size of page contents, chain up the keyboard scroll
operation to the parent frame.

Testing: A new Servo-only WPT tests is added, though needs to be
manually
run with `--product servodriver`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
Martin Robinson 2025-09-25 13:16:41 +02:00 committed by GitHub
parent 75e32ba5a4
commit ffdb7d3663
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 406 additions and 132 deletions

View file

@ -42,7 +42,7 @@ pub struct BoxTree {
root: BlockFormattingContext,
/// Whether or not the viewport should be sensitive to scrolling input events in two axes
viewport_scroll_sensitivity: AxesScrollSensitivity,
pub(crate) viewport_overflow: AxesOverflow,
}
impl BoxTree {
@ -65,10 +65,7 @@ impl BoxTree {
// From https://www.w3.org/TR/css-overflow-3/#overflow-propagation:
// > If visible is applied to the viewport, it must be interpreted as auto.
// > If clip is applied to the viewport, it must be interpreted as hidden.
viewport_scroll_sensitivity: AxesScrollSensitivity {
x: viewport_overflow.x.to_scrollable().into(),
y: viewport_overflow.y.to_scrollable().into(),
},
viewport_overflow: viewport_overflow.to_scrollable(),
}
}
@ -266,11 +263,16 @@ impl BoxTree {
&mut root_fragments,
);
let viewport_scroll_sensitivity = AxesScrollSensitivity {
x: self.viewport_overflow.x.into(),
y: self.viewport_overflow.y.into(),
};
FragmentTree::new(
layout_context,
root_fragments,
physical_containing_block,
self.viewport_scroll_sensitivity,
viewport_scroll_sensitivity,
)
}
}