diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2014-03-28 12:55:29 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2014-04-03 14:50:56 -0700 |
commit | cd9d824c21167721fca40a4eff9563b8316d6c1a (patch) | |
tree | 842382875b8155467b5bb08ea347ad0131760f6c /src/components/script/script_task.rs | |
parent | f8e3e50db5041fd753d0cb83a7cb1464725cc976 (diff) | |
download | servo-cd9d824c21167721fca40a4eff9563b8316d6c1a.tar.gz servo-cd9d824c21167721fca40a4eff9563b8316d6c1a.zip |
servo: Implement stacking contexts and allow multiple layers per
pipeline. This handles fixed positioning mostly correctly.
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r-- | src/components/script/script_task.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index 2fba7693687..7bf6e1af842 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -37,7 +37,8 @@ use js::jsapi::{JSObject, JS_InhibitGC, JS_AllowGC, JS_CallFunctionValue}; use js::jsval::NullValue; use js::rust::{Compartment, Cx, CxUtils, RtUtils}; use js; -use servo_msg::compositor_msg::{FinishedLoading, Loading, PerformingLayout, ScriptListener}; +use servo_msg::compositor_msg::{FinishedLoading, LayerId, Loading, PerformingLayout}; +use servo_msg::compositor_msg::{ScriptListener}; use servo_msg::constellation_msg::{ConstellationChan, IFrameSandboxed, IFrameUnsandboxed}; use servo_msg::constellation_msg::{LoadIframeUrlMsg, LoadCompleteMsg, LoadUrlMsg, NavigationDirection}; use servo_msg::constellation_msg::{PipelineId, SubpageId, Failure, FailureMsg}; @@ -929,10 +930,14 @@ impl ScriptTask { fn scroll_fragment_point(&self, pipeline_id: PipelineId, page: &Page, node: JS<Element>) { let (port, chan) = Chan::new(); let node: JS<Node> = NodeCast::from(&node); - let ContentBoxResponse(rect) = page.query_layout(ContentBoxQuery(node.to_trusted_node_address(), chan), port); + let ContentBoxResponse(rect) = + page.query_layout(ContentBoxQuery(node.to_trusted_node_address(), chan), port); let point = Point2D(to_frac_px(rect.origin.x).to_f32().unwrap(), to_frac_px(rect.origin.y).to_f32().unwrap()); - self.compositor.scroll_fragment_point(pipeline_id, point); + // FIXME(pcwalton): This is pretty bogus when multiple layers are involved. Really + // what needs to happen is that this needs to go through layout to ask which layer + // the element belongs to, and have it send the scroll message to the compositor. + self.compositor.scroll_fragment_point(pipeline_id, LayerId::null(), point); } /// This is the main entry point for receiving and dispatching DOM events. |