auto merge of #5135 : iamdanfox/servo/fix-5120-rename-layout-util, r=jdm

A simple rename/refactor (https://github.com/servo/servo/issues/5120)

My first servo contribution!
This commit is contained in:
bors-servo 2015-03-05 11:09:58 -07:00
commit 7fc37dfaa7
27 changed files with 173 additions and 164 deletions

View file

@ -53,9 +53,9 @@ use gfx::display_list::{ClippingRegion, DisplayList};
use rustc_serialize::{Encoder, Encodable}; use rustc_serialize::{Encoder, Encodable};
use msg::compositor_msg::LayerId; use msg::compositor_msg::LayerId;
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use servo_util::geometry::{Au, MAX_AU}; use util::geometry::{Au, MAX_AU};
use servo_util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize}; use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize};
use servo_util::opts; use util::opts;
use std::cmp::{max, min}; use std::cmp::{max, min};
use std::fmt; use std::fmt;
use style::computed_values::{overflow_x, overflow_y, position, box_sizing, display, float}; use style::computed_values::{overflow_x, overflow_y, position, box_sizing, display, float};

View file

@ -13,35 +13,36 @@
#![deny(unsafe_blocks)] #![deny(unsafe_blocks)]
use css::node_style::StyledNode;
use block::BlockFlow; use block::BlockFlow;
use context::LayoutContext; use context::LayoutContext;
use css::node_style::StyledNode;
use floats::FloatKind; use floats::FloatKind;
use flow::{Flow, ImmutableFlowUtils, MutableOwnedFlowUtils};
use flow::{Descendants, AbsDescendants}; use flow::{Descendants, AbsDescendants};
use flow::{Flow, ImmutableFlowUtils, MutableOwnedFlowUtils};
use flow::{IS_ABSOLUTELY_POSITIONED}; use flow::{IS_ABSOLUTELY_POSITIONED};
use flow; use flow;
use flow_ref::FlowRef; use flow_ref::FlowRef;
use fragment::{Fragment, IframeFragmentInfo};
use fragment::ImageFragmentInfo;
use fragment::CanvasFragmentInfo; use fragment::CanvasFragmentInfo;
use fragment::ImageFragmentInfo;
use fragment::InlineAbsoluteHypotheticalFragmentInfo; use fragment::InlineAbsoluteHypotheticalFragmentInfo;
use fragment::{InlineBlockFragmentInfo, SpecificFragmentInfo};
use fragment::TableColumnFragmentInfo; use fragment::TableColumnFragmentInfo;
use fragment::UnscannedTextFragmentInfo; use fragment::UnscannedTextFragmentInfo;
use fragment::{Fragment, IframeFragmentInfo};
use fragment::{InlineBlockFragmentInfo, SpecificFragmentInfo};
use incremental::{RECONSTRUCT_FLOW, RestyleDamage}; use incremental::{RECONSTRUCT_FLOW, RestyleDamage};
use inline::InlineFlow; use inline::InlineFlow;
use data::{HAS_NEWLY_CONSTRUCTED_FLOW, LayoutDataAccess, LayoutDataWrapper};
use list_item::{self, ListItemFlow}; use list_item::{self, ListItemFlow};
use opaque_node::OpaqueNodeMethods;
use parallel; use parallel;
use table_wrapper::TableWrapperFlow;
use table::TableFlow; use table::TableFlow;
use table_caption::TableCaptionFlow; use table_caption::TableCaptionFlow;
use table_colgroup::TableColGroupFlow;
use table_rowgroup::TableRowGroupFlow;
use table_row::TableRowFlow;
use table_cell::TableCellFlow; use table_cell::TableCellFlow;
use table_colgroup::TableColGroupFlow;
use table_row::TableRowFlow;
use table_rowgroup::TableRowGroupFlow;
use table_wrapper::TableWrapperFlow;
use text::TextRunScanner; use text::TextRunScanner;
use util::{HAS_NEWLY_CONSTRUCTED_FLOW, LayoutDataAccess, OpaqueNodeMethods, LayoutDataWrapper};
use wrapper::{PostorderNodeMutTraversal, PseudoElementType, TLayoutNode, ThreadSafeLayoutNode}; use wrapper::{PostorderNodeMutTraversal, PseudoElementType, TLayoutNode, ThreadSafeLayoutNode};
use gfx::display_list::OpaqueNode; use gfx::display_list::OpaqueNode;
@ -49,7 +50,7 @@ use script::dom::element::ElementTypeId;
use script::dom::htmlelement::HTMLElementTypeId; use script::dom::htmlelement::HTMLElementTypeId;
use script::dom::htmlobjectelement::is_image_data; use script::dom::htmlobjectelement::is_image_data;
use script::dom::node::NodeTypeId; use script::dom::node::NodeTypeId;
use servo_util::opts; use util::opts;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::collections::DList; use std::collections::DList;
use std::mem; use std::mem;

View file

@ -16,7 +16,7 @@ use script::layout_interface::LayoutChan;
use script_traits::UntrustedNodeAddress; use script_traits::UntrustedNodeAddress;
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use net::local_image_cache::LocalImageCache; use net::local_image_cache::LocalImageCache;
use servo_util::geometry::Au; use util::geometry::Au;
use std::boxed; use std::boxed;
use std::cell::Cell; use std::cell::Cell;
use std::ptr; use std::ptr;

View file

@ -8,14 +8,14 @@
use css::node_style::StyledNode; use css::node_style::StyledNode;
use incremental::{self, RestyleDamage}; use incremental::{self, RestyleDamage};
use util::{LayoutDataAccess, LayoutDataWrapper}; use data::{LayoutDataAccess, LayoutDataWrapper};
use wrapper::{LayoutElement, LayoutNode, TLayoutNode}; use wrapper::{LayoutElement, LayoutNode, TLayoutNode};
use script::dom::node::NodeTypeId; use script::dom::node::NodeTypeId;
use selectors::bloom::BloomFilter; use selectors::bloom::BloomFilter;
use servo_util::cache::{LRUCache, SimpleHashCache}; use util::cache::{LRUCache, SimpleHashCache};
use servo_util::smallvec::{SmallVec, SmallVec16}; use util::smallvec::{SmallVec, SmallVec16};
use servo_util::arc_ptr_eq; use util::arc_ptr_eq;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::mem; use std::mem;
use std::hash::{Hash, Hasher, Writer}; use std::hash::{Hash, Hasher, Writer};

View file

@ -6,23 +6,15 @@
use construct::{ConstructionItem, ConstructionResult}; use construct::{ConstructionItem, ConstructionResult};
use incremental::RestyleDamage; use incremental::RestyleDamage;
use parallel::DomParallelInfo;
use wrapper::{LayoutNode, TLayoutNode, ThreadSafeLayoutNode};
use azure::azure_hl::Color;
use gfx::display_list::OpaqueNode;
use gfx;
use libc::{c_void, uintptr_t};
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use script::dom::bindings::js::LayoutJS; use parallel::DomParallelInfo;
use script::dom::node::{Node, SharedLayoutData}; use script::dom::node::SharedLayoutData;
use script::layout_interface::{LayoutChan, TrustedNodeAddress}; use script::layout_interface::LayoutChan;
use script_traits::UntrustedNodeAddress;
use std::mem;
use std::cell::{Ref, RefMut}; use std::cell::{Ref, RefMut};
use style::properties::ComputedValues; use std::mem;
use style;
use std::sync::Arc; use std::sync::Arc;
use style::properties::ComputedValues;
use wrapper::{LayoutNode, TLayoutNode};
/// Data that layout associates with a node. /// Data that layout associates with a node.
pub struct PrivateLayoutData { pub struct PrivateLayoutData {
@ -141,65 +133,3 @@ impl<'ln> LayoutDataAccess for LayoutNode<'ln> {
} }
} }
} }
pub trait OpaqueNodeMethods {
/// Converts a DOM node (layout view) to an `OpaqueNode`.
fn from_layout_node(node: &LayoutNode) -> Self;
/// Converts a thread-safe DOM node (layout view) to an `OpaqueNode`.
fn from_thread_safe_layout_node(node: &ThreadSafeLayoutNode) -> Self;
/// Converts a DOM node (script view) to an `OpaqueNode`.
fn from_script_node(node: TrustedNodeAddress) -> Self;
/// Converts a DOM node to an `OpaqueNode'.
fn from_jsmanaged(node: &LayoutJS<Node>) -> Self;
/// Converts this node to an `UntrustedNodeAddress`. An `UntrustedNodeAddress` is just the type
/// of node that script expects to receive in a hit test.
fn to_untrusted_node_address(&self) -> UntrustedNodeAddress;
}
impl OpaqueNodeMethods for OpaqueNode {
fn from_layout_node(node: &LayoutNode) -> OpaqueNode {
unsafe {
OpaqueNodeMethods::from_jsmanaged(node.get_jsmanaged())
}
}
fn from_thread_safe_layout_node(node: &ThreadSafeLayoutNode) -> OpaqueNode {
unsafe {
OpaqueNodeMethods::from_jsmanaged(node.get_jsmanaged())
}
}
fn from_script_node(node: TrustedNodeAddress) -> OpaqueNode {
unsafe {
OpaqueNodeMethods::from_jsmanaged(&LayoutJS::from_trusted_node_address(node))
}
}
fn from_jsmanaged(node: &LayoutJS<Node>) -> OpaqueNode {
unsafe {
let ptr: uintptr_t = node.get_jsobject() as uintptr_t;
OpaqueNode(ptr)
}
}
fn to_untrusted_node_address(&self) -> UntrustedNodeAddress {
let OpaqueNode(addr) = *self;
UntrustedNodeAddress(addr as *const c_void)
}
}
/// Allows a CSS color to be converted into a graphics color.
pub trait ToGfxColor {
/// Converts a CSS color to a graphics color.
fn to_gfx_color(&self) -> Color;
}
impl ToGfxColor for style::values::RGBA {
fn to_gfx_color(&self) -> Color {
gfx::color::rgba(self.red, self.green, self.blue, self.alpha)
}
}

View file

@ -10,6 +10,7 @@
#![deny(unsafe_blocks)] #![deny(unsafe_blocks)]
use azure::azure_hl::Color;
use block::BlockFlow; use block::BlockFlow;
use canvas::canvas_paint_task::CanvasMsg::SendPixelContents; use canvas::canvas_paint_task::CanvasMsg::SendPixelContents;
use context::LayoutContext; use context::LayoutContext;
@ -19,7 +20,7 @@ use fragment::{ScannedTextFragmentInfo, SpecificFragmentInfo};
use inline::InlineFlow; use inline::InlineFlow;
use list_item::ListItemFlow; use list_item::ListItemFlow;
use model::{self, MaybeAuto}; use model::{self, MaybeAuto};
use util::{OpaqueNodeMethods, ToGfxColor}; use opaque_node::OpaqueNodeMethods;
use geom::{Point2D, Rect, Size2D, SideOffsets2D}; use geom::{Point2D, Rect, Size2D, SideOffsets2D};
use gfx::color; use gfx::color;
@ -36,10 +37,10 @@ use msg::compositor_msg::ScrollPolicy;
use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::Msg as ConstellationMsg;
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use net::image::holder::ImageHolder; use net::image::holder::ImageHolder;
use servo_util::cursor::Cursor; use util::cursor::Cursor;
use servo_util::geometry::{self, Au, ZERO_POINT, to_px, to_frac_px}; use util::geometry::{self, Au, ZERO_POINT, to_px, to_frac_px};
use servo_util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize}; use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize};
use servo_util::opts; use util::opts;
use std::cmp; use std::cmp;
use std::default::Default; use std::default::Default;
use std::iter::repeat; use std::iter::repeat;
@ -1572,3 +1573,14 @@ fn shadow_bounds(content_rect: &Rect<Au>, blur_radius: Au, spread_radius: Au) ->
content_rect.inflate(inflation, inflation) content_rect.inflate(inflation, inflation)
} }
/// Allows a CSS color to be converted into a graphics color.
pub trait ToGfxColor {
/// Converts a CSS color to a graphics color.
fn to_gfx_color(&self) -> Color;
}
impl ToGfxColor for RGBA {
fn to_gfx_color(&self) -> Color {
color::rgba(self.red, self.green, self.blue, self.alpha)
}
}

View file

@ -2,10 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use servo_util::geometry::Au; use util::geometry::Au;
use servo_util::logical_geometry::WritingMode; use util::logical_geometry::WritingMode;
use servo_util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize}; use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize};
use servo_util::persistent_list::PersistentList; use util::persistent_list::PersistentList;
use std::cmp::{max, min}; use std::cmp::{max, min};
use std::i32; use std::i32;
use std::fmt; use std::fmt;

View file

@ -51,8 +51,8 @@ use gfx::display_list::ClippingRegion;
use rustc_serialize::{Encoder, Encodable}; use rustc_serialize::{Encoder, Encodable};
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use msg::compositor_msg::LayerId; use msg::compositor_msg::LayerId;
use servo_util::geometry::{Au, ZERO_RECT}; use util::geometry::{Au, ZERO_RECT};
use servo_util::logical_geometry::{LogicalRect, LogicalSize, WritingMode}; use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
use std::mem; use std::mem;
use std::fmt; use std::fmt;
use std::iter::Zip; use std::iter::Zip;

View file

@ -20,7 +20,7 @@ use layout_debug;
use model::{IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, specified}; use model::{IntrinsicISizes, IntrinsicISizesContribution, MaybeAuto, specified};
use model; use model;
use text; use text;
use util::OpaqueNodeMethods; use opaque_node::OpaqueNodeMethods;
use wrapper::{TLayoutNode, ThreadSafeLayoutNode}; use wrapper::{TLayoutNode, ThreadSafeLayoutNode};
use geom::num::Zero; use geom::num::Zero;
@ -33,11 +33,11 @@ use rustc_serialize::{Encodable, Encoder};
use msg::constellation_msg::{ConstellationChan, Msg, PipelineId, SubpageId}; use msg::constellation_msg::{ConstellationChan, Msg, PipelineId, SubpageId};
use net::image::holder::ImageHolder; use net::image::holder::ImageHolder;
use net::local_image_cache::LocalImageCache; use net::local_image_cache::LocalImageCache;
use servo_util::geometry::{self, Au, ZERO_POINT}; use util::geometry::{self, Au, ZERO_POINT};
use servo_util::logical_geometry::{LogicalRect, LogicalSize, LogicalMargin}; use util::logical_geometry::{LogicalRect, LogicalSize, LogicalMargin};
use servo_util::range::*; use util::range::*;
use servo_util::smallvec::SmallVec; use util::smallvec::SmallVec;
use servo_util::str::is_whitespace; use util::str::is_whitespace;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::cmp::{max, min}; use std::cmp::{max, min};
use std::collections::DList; use std::collections::DList;

View file

@ -24,10 +24,10 @@ use geom::{Point2D, Rect};
use gfx::font::FontMetrics; use gfx::font::FontMetrics;
use gfx::font_context::FontContext; use gfx::font_context::FontContext;
use gfx::text::glyph::CharIndex; use gfx::text::glyph::CharIndex;
use servo_util::arc_ptr_eq; use util::arc_ptr_eq;
use servo_util::geometry::{Au, ZERO_RECT}; use util::geometry::{Au, ZERO_RECT};
use servo_util::logical_geometry::{LogicalRect, LogicalSize, WritingMode}; use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
use servo_util::range::{Range, RangeIndex}; use util::range::{Range, RangeIndex};
use std::cmp::max; use std::cmp::max;
use std::fmt; use std::fmt;
use std::mem; use std::mem;

View file

@ -7,17 +7,19 @@
#![allow(unsafe_blocks)] #![allow(unsafe_blocks)]
use css::node_style::StyledNode;
use construct::ConstructionResult; use construct::ConstructionResult;
use context::{SharedLayoutContext, SharedLayoutContextWrapper}; use context::{SharedLayoutContext, SharedLayoutContextWrapper};
use css::node_style::StyledNode;
use display_list_builder::ToGfxColor;
use flow::{self, Flow, ImmutableFlowUtils, MutableFlowUtils, MutableOwnedFlowUtils}; use flow::{self, Flow, ImmutableFlowUtils, MutableFlowUtils, MutableOwnedFlowUtils};
use flow_ref::FlowRef; use flow_ref::FlowRef;
use fragment::{Fragment, FragmentBorderBoxIterator}; use fragment::{Fragment, FragmentBorderBoxIterator};
use incremental::{LayoutDamageComputation, REFLOW, REFLOW_ENTIRE_DOCUMENT, REPAINT}; use incremental::{LayoutDamageComputation, REFLOW, REFLOW_ENTIRE_DOCUMENT, REPAINT};
use data::{LayoutDataAccess, LayoutDataWrapper};
use layout_debug; use layout_debug;
use opaque_node::OpaqueNodeMethods;
use parallel::{self, UnsafeFlow}; use parallel::{self, UnsafeFlow};
use sequential; use sequential;
use util::{LayoutDataAccess, LayoutDataWrapper, OpaqueNodeMethods, ToGfxColor};
use wrapper::{LayoutNode, TLayoutNode, ThreadSafeLayoutNode}; use wrapper::{LayoutNode, TLayoutNode, ThreadSafeLayoutNode};
use encoding::EncodingRef; use encoding::EncodingRef;
@ -51,16 +53,16 @@ use msg::constellation_msg::{ConstellationChan, Failure, PipelineExitType, Pipel
use net::image_cache_task::{ImageCacheTask, ImageResponseMsg}; use net::image_cache_task::{ImageCacheTask, ImageResponseMsg};
use net::local_image_cache::{ImageResponder, LocalImageCache}; use net::local_image_cache::{ImageResponder, LocalImageCache};
use net::resource_task::{ResourceTask, load_bytes_iter}; use net::resource_task::{ResourceTask, load_bytes_iter};
use servo_util::cursor::Cursor; use util::cursor::Cursor;
use servo_util::geometry::Au; use util::geometry::Au;
use servo_util::logical_geometry::LogicalPoint; use util::logical_geometry::LogicalPoint;
use servo_util::opts; use util::opts;
use servo_util::smallvec::{SmallVec, SmallVec1, VecLike}; use util::smallvec::{SmallVec, SmallVec1, VecLike};
use servo_util::task::spawn_named_with_send_on_failure; use util::task::spawn_named_with_send_on_failure;
use servo_util::task_state; use util::task_state;
use servo_util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan}; use util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan};
use servo_util::time::{TimerMetadataFrameType, TimerMetadataReflowType, profile}; use util::time::{TimerMetadataFrameType, TimerMetadataReflowType, profile};
use servo_util::workqueue::WorkQueue; use util::workqueue::WorkQueue;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::cell::Cell; use std::cell::Cell;
use std::ops::{Deref, DerefMut}; use std::ops::{Deref, DerefMut};

View file

@ -43,7 +43,7 @@ extern crate net;
extern crate msg; extern crate msg;
extern crate selectors; extern crate selectors;
#[macro_use] #[macro_use]
extern crate "util" as servo_util; extern crate util;
#[no_link] #[macro_use] #[plugin] #[no_link] #[macro_use] #[plugin]
extern crate string_cache_macros; extern crate string_cache_macros;
@ -60,6 +60,7 @@ pub mod layout_debug;
pub mod block; pub mod block;
pub mod construct; pub mod construct;
pub mod context; pub mod context;
pub mod data;
pub mod display_list_builder; pub mod display_list_builder;
pub mod floats; pub mod floats;
pub mod flow; pub mod flow;
@ -70,6 +71,7 @@ pub mod layout_task;
pub mod inline; pub mod inline;
pub mod list_item; pub mod list_item;
pub mod model; pub mod model;
pub mod opaque_node;
pub mod parallel; pub mod parallel;
pub mod sequential; pub mod sequential;
pub mod table_wrapper; pub mod table_wrapper;
@ -81,7 +83,6 @@ pub mod table_row;
pub mod table_cell; pub mod table_cell;
pub mod text; pub mod text;
pub mod traversal; pub mod traversal;
pub mod util;
pub mod incremental; pub mod incremental;
pub mod wrapper; pub mod wrapper;

View file

@ -18,9 +18,9 @@ use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect}; use geom::{Point2D, Rect};
use gfx::display_list::DisplayList; use gfx::display_list::DisplayList;
use servo_util::geometry::Au; use util::geometry::Au;
use servo_util::logical_geometry::LogicalRect; use util::logical_geometry::LogicalRect;
use servo_util::opts; use util::opts;
use style::properties::ComputedValues; use style::properties::ComputedValues;
use style::computed_values::list_style_type; use style::computed_values::list_style_type;
use std::sync::Arc; use std::sync::Arc;

View file

@ -11,8 +11,8 @@ use fragment::Fragment;
use geom::SideOffsets2D; use geom::SideOffsets2D;
use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone, LengthOrPercentage}; use style::values::computed::{LengthOrPercentageOrAuto, LengthOrPercentageOrNone, LengthOrPercentage};
use style::properties::ComputedValues; use style::properties::ComputedValues;
use servo_util::geometry::Au; use util::geometry::Au;
use servo_util::logical_geometry::LogicalMargin; use util::logical_geometry::LogicalMargin;
use std::cmp::{max, min}; use std::cmp::{max, min};
use std::fmt; use std::fmt;

View file

@ -0,0 +1,63 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![allow(unsafe_blocks)]
use gfx::display_list::OpaqueNode;
use libc::{c_void, uintptr_t};
use script::dom::bindings::js::LayoutJS;
use script::dom::node::Node;
use script::layout_interface::{TrustedNodeAddress};
use script_traits::UntrustedNodeAddress;
use wrapper::{LayoutNode, TLayoutNode, ThreadSafeLayoutNode};
pub trait OpaqueNodeMethods {
/// Converts a DOM node (layout view) to an `OpaqueNode`.
fn from_layout_node(node: &LayoutNode) -> Self;
/// Converts a thread-safe DOM node (layout view) to an `OpaqueNode`.
fn from_thread_safe_layout_node(node: &ThreadSafeLayoutNode) -> Self;
/// Converts a DOM node (script view) to an `OpaqueNode`.
fn from_script_node(node: TrustedNodeAddress) -> Self;
/// Converts a DOM node to an `OpaqueNode'.
fn from_jsmanaged(node: &LayoutJS<Node>) -> Self;
/// Converts this node to an `UntrustedNodeAddress`. An `UntrustedNodeAddress` is just the type
/// of node that script expects to receive in a hit test.
fn to_untrusted_node_address(&self) -> UntrustedNodeAddress;
}
impl OpaqueNodeMethods for OpaqueNode {
fn from_layout_node(node: &LayoutNode) -> OpaqueNode {
unsafe {
OpaqueNodeMethods::from_jsmanaged(node.get_jsmanaged())
}
}
fn from_thread_safe_layout_node(node: &ThreadSafeLayoutNode) -> OpaqueNode {
unsafe {
OpaqueNodeMethods::from_jsmanaged(node.get_jsmanaged())
}
}
fn from_script_node(node: TrustedNodeAddress) -> OpaqueNode {
unsafe {
OpaqueNodeMethods::from_jsmanaged(&LayoutJS::from_trusted_node_address(node))
}
}
fn from_jsmanaged(node: &LayoutJS<Node>) -> OpaqueNode {
unsafe {
let ptr: uintptr_t = node.get_jsobject() as uintptr_t;
OpaqueNode(ptr)
}
}
fn to_untrusted_node_address(&self) -> UntrustedNodeAddress {
let OpaqueNode(addr) = *self;
UntrustedNodeAddress(addr as *const c_void)
}
}

View file

@ -12,17 +12,17 @@ use context::{LayoutContext, SharedLayoutContextWrapper, SharedLayoutContext};
use flow::{Flow, MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal}; use flow::{Flow, MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal};
use flow; use flow;
use flow_ref::FlowRef; use flow_ref::FlowRef;
use traversal::{RecalcStyleForNode, ConstructFlows}; use data::{LayoutDataAccess, LayoutDataWrapper};
use traversal::{BubbleISizes, AssignISizes, AssignBSizesAndStoreOverflow}; use traversal::{BubbleISizes, AssignISizes, AssignBSizesAndStoreOverflow};
use traversal::{ComputeAbsolutePositions, BuildDisplayList}; use traversal::{ComputeAbsolutePositions, BuildDisplayList};
use util::{LayoutDataAccess, LayoutDataWrapper}; use traversal::{RecalcStyleForNode, ConstructFlows};
use wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_node, LayoutNode}; use wrapper::{layout_node_to_unsafe_layout_node, layout_node_from_unsafe_layout_node, LayoutNode};
use wrapper::{PostorderNodeMutTraversal, UnsafeLayoutNode}; use wrapper::{PostorderNodeMutTraversal, UnsafeLayoutNode};
use wrapper::{PreorderDomTraversal, PostorderDomTraversal}; use wrapper::{PreorderDomTraversal, PostorderDomTraversal};
use servo_util::opts; use util::opts;
use servo_util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan, profile}; use util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan, profile};
use servo_util::workqueue::{WorkQueue, WorkUnit, WorkerProxy}; use util::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
use std::mem; use std::mem;
use std::ptr; use std::ptr;
use std::sync::atomic::{AtomicInt, Ordering}; use std::sync::atomic::{AtomicInt, Ordering};

View file

@ -17,8 +17,8 @@ use wrapper::{PostorderNodeMutTraversal};
use wrapper::{PreorderDomTraversal, PostorderDomTraversal}; use wrapper::{PreorderDomTraversal, PostorderDomTraversal};
use geom::point::Point2D; use geom::point::Point2D;
use servo_util::geometry::{Au, ZERO_POINT}; use util::geometry::{Au, ZERO_POINT};
use servo_util::opts; use util::opts;
pub fn traverse_dom_preorder(root: LayoutNode, pub fn traverse_dom_preorder(root: LayoutNode,
shared_layout_context: &SharedLayoutContext) { shared_layout_context: &SharedLayoutContext) {

View file

@ -21,8 +21,8 @@ use table_wrapper::TableLayout;
use wrapper::ThreadSafeLayoutNode; use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect}; use geom::{Point2D, Rect};
use servo_util::geometry::Au; use util::geometry::Au;
use servo_util::logical_geometry::LogicalRect; use util::logical_geometry::LogicalRect;
use std::cmp::max; use std::cmp::max;
use std::fmt; use std::fmt;
use style::properties::ComputedValues; use style::properties::ComputedValues;

View file

@ -14,8 +14,8 @@ use fragment::FragmentBorderBoxIterator;
use wrapper::ThreadSafeLayoutNode; use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect}; use geom::{Point2D, Rect};
use servo_util::geometry::Au; use util::geometry::Au;
use servo_util::logical_geometry::LogicalRect; use util::logical_geometry::LogicalRect;
use std::fmt; use std::fmt;
use style::properties::ComputedValues; use style::properties::ComputedValues;
use std::sync::Arc; use std::sync::Arc;

View file

@ -16,8 +16,8 @@ use table::InternalTable;
use wrapper::ThreadSafeLayoutNode; use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect}; use geom::{Point2D, Rect};
use servo_util::geometry::Au; use util::geometry::Au;
use servo_util::logical_geometry::LogicalRect; use util::logical_geometry::LogicalRect;
use std::fmt; use std::fmt;
use style::properties::ComputedValues; use style::properties::ComputedValues;
use style::legacy::UnsignedIntegerAttribute; use style::legacy::UnsignedIntegerAttribute;

View file

@ -14,7 +14,7 @@ use layout_debug;
use wrapper::ThreadSafeLayoutNode; use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect}; use geom::{Point2D, Rect};
use servo_util::geometry::{Au, ZERO_RECT}; use util::geometry::{Au, ZERO_RECT};
use std::cmp::max; use std::cmp::max;
use std::fmt; use std::fmt;
use style::values::computed::LengthOrPercentageOrAuto; use style::values::computed::LengthOrPercentageOrAuto;

View file

@ -19,8 +19,8 @@ use model::MaybeAuto;
use wrapper::ThreadSafeLayoutNode; use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect}; use geom::{Point2D, Rect};
use servo_util::geometry::Au; use util::geometry::Au;
use servo_util::logical_geometry::LogicalRect; use util::logical_geometry::LogicalRect;
use std::cmp::max; use std::cmp::max;
use std::fmt; use std::fmt;
use style::properties::ComputedValues; use style::properties::ComputedValues;

View file

@ -16,8 +16,8 @@ use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable};
use wrapper::ThreadSafeLayoutNode; use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect}; use geom::{Point2D, Rect};
use servo_util::geometry::Au; use util::geometry::Au;
use servo_util::logical_geometry::LogicalRect; use util::logical_geometry::LogicalRect;
use std::fmt; use std::fmt;
use style::properties::ComputedValues; use style::properties::ComputedValues;
use std::sync::Arc; use std::sync::Arc;

View file

@ -24,7 +24,7 @@ use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
use wrapper::ThreadSafeLayoutNode; use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect}; use geom::{Point2D, Rect};
use servo_util::geometry::Au; use util::geometry::Au;
use std::cmp::{max, min}; use std::cmp::{max, min};
use std::fmt; use std::fmt;
use std::ops::Add; use std::ops::Add;

View file

@ -15,11 +15,11 @@ use gfx::font_context::FontContext;
use gfx::text::glyph::CharIndex; use gfx::text::glyph::CharIndex;
use gfx::text::text_run::TextRun; use gfx::text::text_run::TextRun;
use gfx::text::util::{self, CompressionMode}; use gfx::text::util::{self, CompressionMode};
use servo_util::dlist; use util::dlist;
use servo_util::geometry::Au; use util::geometry::Au;
use servo_util::logical_geometry::{LogicalSize, WritingMode}; use util::logical_geometry::{LogicalSize, WritingMode};
use servo_util::range::Range; use util::range::Range;
use servo_util::smallvec::{SmallVec, SmallVec1}; use util::smallvec::{SmallVec, SmallVec1};
use std::collections::DList; use std::collections::DList;
use std::mem; use std::mem;
use style::computed_values::{line_height, text_orientation, text_rendering, text_transform}; use style::computed_values::{line_height, text_orientation, text_rendering, text_transform};

View file

@ -19,8 +19,8 @@ use wrapper::{PostorderNodeMutTraversal, ThreadSafeLayoutNode, UnsafeLayoutNode}
use wrapper::{PreorderDomTraversal, PostorderDomTraversal}; use wrapper::{PreorderDomTraversal, PostorderDomTraversal};
use selectors::bloom::BloomFilter; use selectors::bloom::BloomFilter;
use servo_util::opts; use util::opts;
use servo_util::tid::tid; use util::tid::tid;
use style::node::TNode; use style::node::TNode;
use std::cell::RefCell; use std::cell::RefCell;

View file

@ -36,8 +36,8 @@ use canvas::canvas_paint_task::CanvasMsg;
use context::SharedLayoutContext; use context::SharedLayoutContext;
use css::node_style::StyledNode; use css::node_style::StyledNode;
use incremental::RestyleDamage; use incremental::RestyleDamage;
use util::{LayoutDataAccess, LayoutDataFlags, LayoutDataWrapper, OpaqueNodeMethods}; use data::{LayoutDataAccess, LayoutDataFlags, LayoutDataWrapper, PrivateLayoutData};
use util::{PrivateLayoutData}; use opaque_node::OpaqueNodeMethods;
use cssparser::RGBA; use cssparser::RGBA;
use gfx::display_list::OpaqueNode; use gfx::display_list::OpaqueNode;
@ -60,7 +60,7 @@ use script::dom::node::{HAS_CHANGED, IS_DIRTY, HAS_DIRTY_SIBLINGS, HAS_DIRTY_DES
use script::dom::text::Text; use script::dom::text::Text;
use script::layout_interface::LayoutChan; use script::layout_interface::LayoutChan;
use msg::constellation_msg::{PipelineId, SubpageId}; use msg::constellation_msg::{PipelineId, SubpageId};
use servo_util::str::{LengthOrPercentageOrAuto, is_whitespace}; use util::str::{LengthOrPercentageOrAuto, is_whitespace};
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::cell::{Ref, RefMut}; use std::cell::{Ref, RefMut};
use std::marker::ContravariantLifetime; use std::marker::ContravariantLifetime;