Fix scroll_sensitivity related naming issue (#35462)

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
Euclid Ye 2025-02-14 18:18:25 +08:00 committed by GitHub
parent 03fc54e682
commit 3e1d15da9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View file

@ -41,7 +41,7 @@ pub struct BoxTree {
canvas_background: CanvasBackground, canvas_background: CanvasBackground,
/// Whether or not the viewport should be sensitive to scrolling input events in two axes /// Whether or not the viewport should be sensitive to scrolling input events in two axes
scroll_sensitivity: AxesScrollSensitivity, viewport_scroll_sensitivity: AxesScrollSensitivity,
} }
impl BoxTree { impl BoxTree {
@ -94,7 +94,7 @@ impl BoxTree {
contains_floats, contains_floats,
}, },
canvas_background: CanvasBackground::for_root_element(context, root_element), canvas_background: CanvasBackground::for_root_element(context, root_element),
scroll_sensitivity: AxesScrollSensitivity { viewport_scroll_sensitivity: AxesScrollSensitivity {
x: viewport_overflow.x.to_scrollable().into(), x: viewport_overflow.x.to_scrollable().into(),
y: viewport_overflow.y.to_scrollable().into(), y: viewport_overflow.y.to_scrollable().into(),
}, },
@ -401,7 +401,7 @@ impl BoxTree {
scrollable_overflow, scrollable_overflow,
initial_containing_block: physical_containing_block, initial_containing_block: physical_containing_block,
canvas_background: self.canvas_background.clone(), canvas_background: self.canvas_background.clone(),
root_scroll_sensitivity: self.scroll_sensitivity, viewport_scroll_sensitivity: self.viewport_scroll_sensitivity,
} }
} }
} }

View file

@ -37,8 +37,8 @@ pub struct FragmentTree {
/// <https://drafts.csswg.org/css-backgrounds/#special-backgrounds> /// <https://drafts.csswg.org/css-backgrounds/#special-backgrounds>
pub(crate) canvas_background: CanvasBackground, pub(crate) canvas_background: CanvasBackground,
/// Whether or not the root element is sensitive to scroll input events. /// Whether or not the viewport is sensitive to scroll input events.
pub root_scroll_sensitivity: AxesScrollSensitivity, pub viewport_scroll_sensitivity: AxesScrollSensitivity,
} }
impl FragmentTree { impl FragmentTree {

View file

@ -854,7 +854,7 @@ impl LayoutThread {
fragment_tree.scrollable_overflow(), fragment_tree.scrollable_overflow(),
self.id.into(), self.id.into(),
epoch.into(), epoch.into(),
fragment_tree.root_scroll_sensitivity, fragment_tree.viewport_scroll_sensitivity,
); );
display_list.wr.begin(); display_list.wr.begin();

View file

@ -315,7 +315,7 @@ impl CompositorDisplayListInfo {
content_size: LayoutSize, content_size: LayoutSize,
pipeline_id: PipelineId, pipeline_id: PipelineId,
epoch: Epoch, epoch: Epoch,
root_scroll_sensitivity: AxesScrollSensitivity, viewport_scroll_sensitivity: AxesScrollSensitivity,
) -> Self { ) -> Self {
let mut scroll_tree = ScrollTree::default(); let mut scroll_tree = ScrollTree::default();
let root_reference_frame_id = scroll_tree.add_scroll_tree_node( let root_reference_frame_id = scroll_tree.add_scroll_tree_node(
@ -329,7 +329,7 @@ impl CompositorDisplayListInfo {
Some(ScrollableNodeInfo { Some(ScrollableNodeInfo {
external_id: ExternalScrollId(0, pipeline_id), external_id: ExternalScrollId(0, pipeline_id),
scrollable_size: content_size - viewport_size, scrollable_size: content_size - viewport_size,
scroll_sensitivity: root_scroll_sensitivity, scroll_sensitivity: viewport_scroll_sensitivity,
offset: LayoutVector2D::zero(), offset: LayoutVector2D::zero(),
}), }),
); );