diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2016-06-08 18:46:02 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2016-06-10 18:43:04 -0700 |
commit | 041cfe6d0a07882819ae35380c286e7fe09c1013 (patch) | |
tree | 464033c42b2417f4f993e70840ea8a2bae03b3c9 /components/script/lib.rs | |
parent | ce88b8ed30feff9c7d3f067041fe5d781e012351 (diff) | |
download | servo-041cfe6d0a07882819ae35380c286e7fe09c1013.tar.gz servo-041cfe6d0a07882819ae35380c286e7fe09c1013.zip |
script: When using WebRender, keep the DOM-side scroll positions for
elements with `overflow: scroll` up to date, and take them into account
when doing hit testing.
Closes #11648.
Diffstat (limited to 'components/script/lib.rs')
-rw-r--r-- | components/script/lib.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/components/script/lib.rs b/components/script/lib.rs index 50b0c47ac6b..71e53141d9a 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -112,8 +112,9 @@ mod unpremultiplytable; mod webdriver_handlers; use dom::bindings::codegen::RegisterBindings; -use js::jsapi::SetDOMProxyInformation; +use js::jsapi::{Handle, JSContext, JSObject, SetDOMProxyInformation}; use std::ptr; +use util::opts; #[cfg(target_os = "linux")] #[allow(unsafe_code)] @@ -168,3 +169,14 @@ pub fn init() { perform_platform_specific_initialization(); } + +/// FIXME(pcwalton): Currently WebRender cannot handle DOM-initiated scrolls. Remove this when it +/// can. See PR #11680 for details. +/// +/// This function is only marked `unsafe` because the `[Func=foo]` WebIDL attribute requires it. It +/// shouldn't actually do anything unsafe. +#[allow(unsafe_code)] +pub unsafe fn script_can_initiate_scroll(_: *mut JSContext, _: Handle<*mut JSObject>) -> bool { + !opts::get().use_webrender +} + |