diff options
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 +} + |