aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r--components/layout/construct.rs40
1 files changed, 21 insertions, 19 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index f3309b97b75..660d4f64834 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -38,6 +38,7 @@ use multicol::{MulticolColumnFlow, MulticolFlow};
use parallel;
use script_layout_interface::{LayoutElementType, LayoutNodeType, is_image_data};
use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
+use servo_config::opts;
use servo_url::ServoUrl;
use std::borrow::ToOwned;
use std::collections::LinkedList;
@@ -64,7 +65,6 @@ use table_rowgroup::TableRowGroupFlow;
use table_wrapper::TableWrapperFlow;
use text::TextRunScanner;
use traversal::PostorderNodeMutTraversal;
-use util::opts;
use wrapper::{LayoutNodeLayoutData, TextContent, ThreadSafeLayoutNodeHelpers};
/// The results of flow construction for a DOM node.
@@ -141,17 +141,22 @@ pub struct InlineFragmentsConstructionResult {
/// The resulting `ConstructionItem` for the outer `span` will be:
///
/// ```ignore
-/// ConstructionItem::InlineFragments(Some(~[
-/// InlineBlockSplit {
-/// predecessor_fragments: ~[
-/// A
+/// ConstructionItem::InlineFragments(
+/// InlineFragmentsConstructionResult{
+/// splits: linked_list![
+/// InlineBlockSplit{
+/// predecessors: IntermediateInlineFragments{
+/// fragments: linked_list![A],
+/// absolute_descendents: AbsoluteDescendents{
+/// descendant_links: vec![]
+/// }
+/// },
+/// flow: B
+/// }
/// ],
-/// block: ~BlockFlow {
-/// B
-/// },
-/// }),~[
-/// C
-/// ])
+/// fragments: linked_list![C],
+/// }
+/// )
/// ```
#[derive(Clone)]
pub struct InlineBlockSplit {
@@ -346,14 +351,12 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
SpecificFragmentInfo::Iframe(IframeFragmentInfo::new(node))
}
Some(LayoutNodeType::Element(LayoutElementType::HTMLImageElement)) => {
- let image_info = box ImageFragmentInfo::new(node,
- node.image_url(),
+ let image_info = box ImageFragmentInfo::new(node.image_url(),
&self.layout_context.shared);
SpecificFragmentInfo::Image(image_info)
}
Some(LayoutNodeType::Element(LayoutElementType::HTMLObjectElement)) => {
- let image_info = box ImageFragmentInfo::new(node,
- node.object_data(),
+ let image_info = box ImageFragmentInfo::new(node.object_data(),
&self.layout_context.shared);
SpecificFragmentInfo::Image(image_info)
}
@@ -372,11 +375,11 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
}
Some(LayoutNodeType::Element(LayoutElementType::HTMLCanvasElement)) => {
let data = node.canvas_data().unwrap();
- SpecificFragmentInfo::Canvas(box CanvasFragmentInfo::new(node, data, self.style_context()))
+ SpecificFragmentInfo::Canvas(box CanvasFragmentInfo::new(data))
}
Some(LayoutNodeType::Element(LayoutElementType::SVGSVGElement)) => {
let data = node.svg_data().unwrap();
- SpecificFragmentInfo::Svg(box SvgFragmentInfo::new(node, data, self.style_context()))
+ SpecificFragmentInfo::Svg(box SvgFragmentInfo::new(data))
}
_ => {
// This includes pseudo-elements.
@@ -1207,8 +1210,7 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
let flotation = FloatKind::from_property(flotation);
let marker_fragments = match node.style(self.style_context()).get_list().list_style_image {
Either::First(ref url_value) => {
- let image_info = box ImageFragmentInfo::new(node,
- url_value.url().map(|u| u.clone()),
+ let image_info = box ImageFragmentInfo::new(url_value.url().map(|u| u.clone()),
&self.layout_context.shared);
vec![Fragment::new(node, SpecificFragmentInfo::Image(image_info), self.layout_context)]
}