mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
script: More consistently use f32
and have scrolling methods follow the specification more closely (#39104)
This clarifies the units for scrolling: - `f32` is used for internal Servo scrolling APIs as that is the unit used in WebRender. - `f64` is used for the web-exposed scrolling APIs as that is what the WebIDL code generator gives us. Conversions are done consistently at the boundaries of the two APIs. In addition, web-exposed scrolling methods are refactored a bit to more closely follow the specification text. In addition, specification text is added to those methods so that it is clearer that we are following it. Testing: This should not change behavior and is thus covered by existing tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
b73c81630a
commit
0ae9ee28d5
4 changed files with 160 additions and 109 deletions
|
@ -1065,8 +1065,7 @@ impl Document {
|
|||
});
|
||||
|
||||
if let Some((x, y)) = point {
|
||||
self.window
|
||||
.scroll(x as f64, y as f64, ScrollBehavior::Instant)
|
||||
self.window.scroll(x, y, ScrollBehavior::Instant)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue