aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/lib.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2016-06-08 18:46:02 -0700
committerPatrick Walton <pcwalton@mimiga.net>2016-06-10 18:43:04 -0700
commit041cfe6d0a07882819ae35380c286e7fe09c1013 (patch)
tree464033c42b2417f4f993e70840ea8a2bae03b3c9 /components/script/lib.rs
parentce88b8ed30feff9c7d3f067041fe5d781e012351 (diff)
downloadservo-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.rs14
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
+}
+