aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
Diffstat (limited to 'components')
-rw-r--r--components/layout/display_list_builder.rs8
-rw-r--r--components/script/script_task.rs15
2 files changed, 8 insertions, 15 deletions
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index c1b661b5f17..3e1af9c16b8 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -790,6 +790,10 @@ impl FragmentDisplayListBuilding for Fragment {
relative_containing_block_mode: WritingMode,
background_and_border_level: BackgroundAndBorderLevel,
clip: &ClippingRegion) {
+ if self.style().get_inheritedbox().visibility != visibility::T::visible {
+ return
+ }
+
// Compute the fragment position relative to the parent stacking context. If the fragment
// itself establishes a stacking context, then the origin of its position will be (0, 0)
// for the purposes of this computation.
@@ -807,10 +811,6 @@ impl FragmentDisplayListBuilding for Fragment {
stacking_relative_flow_origin,
self);
- if self.style().get_inheritedbox().visibility != visibility::T::visible {
- return
- }
-
if !stacking_relative_border_box.intersects(&layout_context.shared.dirty) {
debug!("Fragment::build_display_list: Did not intersect...");
return
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index c9c51eaeb9b..92a5dccb7d4 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -311,7 +311,7 @@ pub struct ScriptTask {
/// The JavaScript runtime.
js_runtime: js::rust::rt,
/// The JSContext.
- js_context: DOMRefCell<Option<Rc<Cx>>>,
+ js_context: Rc<Cx>,
mouse_over_targets: DOMRefCell<Vec<JS<Node>>>
}
@@ -348,7 +348,6 @@ impl<'a> Drop for ScriptMemoryFailsafe<'a> {
let window = page.window_for_script_deallocation();
(*window.unsafe_get()).clear_js_context_for_script_deallocation();
}
- *owner.js_context.borrow_for_script_deallocation() = None;
}
}
None => (),
@@ -488,7 +487,7 @@ impl ScriptTask {
devtools_marker_sender: RefCell::new(None),
js_runtime: js_runtime,
- js_context: DOMRefCell::new(Some(js_context)),
+ js_context: js_context,
mouse_over_targets: DOMRefCell::new(vec!())
}
}
@@ -518,7 +517,7 @@ impl ScriptTask {
}
pub fn get_cx(&self) -> *mut JSContext {
- (**self.js_context.borrow().as_ref().unwrap()).ptr
+ self.js_context.ptr
}
/// Starts the script task. After calling this method, the script task will loop receiving
@@ -962,10 +961,7 @@ impl ScriptTask {
let window = page.window().root();
if window.r().pipeline() == id {
debug!("shutting down layout for root page {:?}", id);
- // To ensure the elements of the DOM tree remain usable (such as the window global),
- // don't free the JS context until all interactions with it are finished.
shut_down_layout(&page, exit_type);
- *self.js_context.borrow_mut() = None;
return true
}
@@ -1008,9 +1004,6 @@ impl ScriptTask {
self.compositor.borrow_mut().set_ready_state(incomplete.pipeline_id, Loading);
- let cx = self.js_context.borrow();
- let cx = cx.as_ref().unwrap();
-
// Create a new frame tree entry.
let page = Rc::new(Page::new(incomplete.pipeline_id, final_url.clone()));
if !root_page_exists {
@@ -1069,7 +1062,7 @@ impl ScriptTask {
let mut page_remover = AutoPageRemover::new(self, page_to_remove);
// Create the window and document objects.
- let window = Window::new(cx.clone(),
+ let window = Window::new(self.js_context.clone(),
page.clone(),
self.chan.clone(),
self.control_chan.clone(),