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:
Martin Robinson 2025-09-03 10:29:56 -07:00 committed by GitHub
parent b73c81630a
commit 0ae9ee28d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 160 additions and 109 deletions

View file

@ -860,6 +860,14 @@ Dictionaries = {
'derives': ['Clone', 'MallocSizeOf'],
},
'ScrollOptions': {
'derives': ['Clone'],
},
'ScrollToOptions': {
'derives': ['Clone'],
},
'StereoPannerOptions': {
'derives': ['Clone', 'Copy'],
},