aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/table_caption.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2015-03-05 12:37:37 -0800
committerPatrick Walton <pcwalton@mimiga.net>2015-03-09 17:13:45 -0700
commitf9cdd05d58e7f1a8cd6198dad3058d86bf479a08 (patch)
treea09fafccb79081207407e9a691728816c75231c1 /components/layout/table_caption.rs
parent2df4dd9e098671fdbe2951f6669473e7737d6ed3 (diff)
downloadservo-f9cdd05d58e7f1a8cd6198dad3058d86bf479a08.tar.gz
servo-f9cdd05d58e7f1a8cd6198dad3058d86bf479a08.zip
layout: Implement ordered lists, CSS counters, and `quotes` per CSS 2.1
§ 12.3-12.5. Only simple alphabetic and numeric counter styles are supported. (This is most of them though.) Although this PR adds a sequential pass to layout, I verified that on pages that contain a reasonable number of ordered lists (Reddit `/r/rust`), the time spent in generated content resolution is dwarfed by the time spent in the parallelizable parts of layout. So I don't expect this to negatively affect our parallelism expect perhaps in pathological cases.
Diffstat (limited to 'components/layout/table_caption.rs')
-rw-r--r--components/layout/table_caption.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs
index ceb6bf7e3aa..b0b08e7cdec 100644
--- a/components/layout/table_caption.rs
+++ b/components/layout/table_caption.rs
@@ -7,10 +7,9 @@
#![deny(unsafe_blocks)]
use block::BlockFlow;
-use construct::FlowConstructor;
use context::LayoutContext;
use flow::{FlowClass, Flow};
-use fragment::FragmentBorderBoxIterator;
+use fragment::{Fragment, FragmentBorderBoxIterator};
use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect};
@@ -26,11 +25,10 @@ pub struct TableCaptionFlow {
}
impl TableCaptionFlow {
- pub fn from_node(constructor: &mut FlowConstructor,
- node: &ThreadSafeLayoutNode)
- -> TableCaptionFlow {
+ pub fn from_node_and_fragment(node: &ThreadSafeLayoutNode, fragment: Fragment)
+ -> TableCaptionFlow {
TableCaptionFlow {
- block_flow: BlockFlow::from_node(constructor, node)
+ block_flow: BlockFlow::from_node_and_fragment(node, fragment)
}
}
}
@@ -96,6 +94,10 @@ impl Flow for TableCaptionFlow {
stacking_context_position: &Point2D<Au>) {
self.block_flow.iterate_through_fragment_border_boxes(iterator, stacking_context_position)
}
+
+ fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
+ self.block_flow.mutate_fragments(mutator)
+ }
}
impl fmt::Debug for TableCaptionFlow {