aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/table.rs
diff options
context:
space:
mode:
authorPu Xingyu <pu.stshine@gmail.com>2017-02-07 10:45:13 +0800
committerPu Xingyu <pu.stshine@gmail.com>2017-02-08 08:47:54 +0800
commit336aa795b4b9933436c9df0200de64e18b6f3b7e (patch)
tree7b8acf2d9eba39a68d47205462b0b29633584a28 /components/layout/table.rs
parentf07bfaa97466018f93124e308556aa93293cf648 (diff)
downloadservo-336aa795b4b9933436c9df0200de64e18b6f3b7e.tar.gz
servo-336aa795b4b9933436c9df0200de64e18b6f3b7e.zip
Remove cached thread local context from LayoutContext
Remove cached thread local context from LayoutContext, use LayoutContext for assign_inline_sizes(), and simplify the parallel flow traversal code.
Diffstat (limited to 'components/layout/table.rs')
-rw-r--r--components/layout/table.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/layout/table.rs b/components/layout/table.rs
index 81cde44bba6..e45fd7ca8c2 100644
--- a/components/layout/table.rs
+++ b/components/layout/table.rs
@@ -9,7 +9,7 @@
use app_units::Au;
use block::{BlockFlow, CandidateBSizeIterator, ISizeAndMarginsComputer};
use block::{ISizeConstraintInput, ISizeConstraintSolution};
-use context::{LayoutContext, SharedLayoutContext};
+use context::LayoutContext;
use display_list_builder::{BlockFlowDisplayListBuilding, BorderPaintingMode, DisplayListBuildState};
use euclid::Point2D;
use flow;
@@ -345,11 +345,12 @@ impl Flow for TableFlow {
/// Recursively (top-down) determines the actual inline-size of child contexts and fragments.
/// When called on this context, the context has had its inline-size set by the parent context.
- fn assign_inline_sizes(&mut self, shared_context: &SharedStyleContext) {
+ fn assign_inline_sizes(&mut self, layout_context: &LayoutContext) {
let _scope = layout_debug_scope!("table::assign_inline_sizes {:x}",
self.block_flow.base.debug_id());
debug!("assign_inline_sizes({}): assigning inline_size for flow", "table");
+ let shared_context = layout_context.shared_context();
// The position was set to the containing block by the flow's parent.
let containing_block_inline_size = self.block_flow.base.block_container_inline_size;
@@ -464,13 +465,13 @@ impl Flow for TableFlow {
});
}
- fn assign_block_size<'a>(&mut self, _: &'a LayoutContext<'a>) {
+ fn assign_block_size(&mut self, _: &LayoutContext) {
debug!("assign_block_size: assigning block_size for table");
let vertical_spacing = self.spacing().vertical;
self.block_flow.assign_block_size_for_table_like_flow(vertical_spacing)
}
- fn compute_absolute_position(&mut self, layout_context: &SharedLayoutContext) {
+ fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
self.block_flow.compute_absolute_position(layout_context)
}