diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-11 11:01:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-11 11:01:36 -0500 |
commit | 2d9338085561e7908c80ec7b2dd6d30125489aac (patch) | |
tree | 464033c42b2417f4f993e70840ea8a2bae03b3c9 /components/script/lib.rs | |
parent | ce88b8ed30feff9c7d3f067041fe5d781e012351 (diff) | |
parent | 041cfe6d0a07882819ae35380c286e7fe09c1013 (diff) | |
download | servo-2d9338085561e7908c80ec7b2dd6d30125489aac.tar.gz servo-2d9338085561e7908c80ec7b2dd6d30125489aac.zip |
Auto merge of #11680 - pcwalton:wr-overflow-scroll-hit-testing, r=jdm
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.
r? @jdm
cc @paulrouget
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11680)
<!-- Reviewable:end -->
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 +} + |