script: Minimize layout queries for window scroll offsets. (#38018)

These changes reduce the number of times we need to query layout for the
same information when creating mouse/pointer events.

Testing: No new tests required for maintaining existing behaviour.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-07-12 10:17:55 -04:00 committed by GitHub
parent 6dbd64e72d
commit d0a93a8b02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 32 additions and 21 deletions

View file

@ -488,7 +488,7 @@ DOMInterfaces = {
},
'MouseEvent': {
'canGc': ['OffsetX', 'OffsetY'],
'canGc': ['InitMouseEvent', 'OffsetX', 'OffsetY'],
},
'NavigationPreloadManager': {
@ -649,6 +649,10 @@ DOMInterfaces = {
'additionalTraits': ['crate::interfaces::WebGL2RenderingContextHelpers'],
},
'WheelEvent': {
'canGc': ['InitWheelEvent'],
},
'Window': {
'canGc': ['Stop', 'Fetch', 'Scroll', 'Scroll_','ScrollBy', 'ScrollBy_', 'Stop', 'Fetch', 'Open', 'CreateImageBitmap', 'CreateImageBitmap_', 'TrustedTypes', 'WebdriverCallback', 'WebdriverException'],
'inRealms': ['Fetch', 'GetOpener', 'WebdriverCallback', 'WebdriverException'],