aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout')
-rw-r--r--components/layout/Cargo.toml3
-rw-r--r--components/layout/construct.rs10
-rw-r--r--components/layout/fragment.rs2
-rw-r--r--components/layout/lib.rs3
-rw-r--r--components/layout/query.rs2
5 files changed, 14 insertions, 6 deletions
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml
index 338a5cf4075..c5e9fd3aeb5 100644
--- a/components/layout/Cargo.toml
+++ b/components/layout/Cargo.toml
@@ -21,6 +21,7 @@ gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0"
heapsize_derive = "0.1"
+html5ever-atoms = "0.1"
ipc-channel = "0.5"
libc = "0.2"
log = "0.3.5"
@@ -36,8 +37,8 @@ script_layout_interface = {path = "../script_layout_interface"}
script_traits = {path = "../script_traits"}
selectors = "0.14"
serde_derive = "0.8"
+servo_atoms = {path = "../atoms"}
smallvec = "0.1"
-string_cache = {version = "0.2.26", features = ["heap_size"]}
style = {path = "../style"}
style_traits = {path = "../style_traits"}
unicode-bidi = "0.2"
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index 572498aad35..a0667b0b502 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -1660,7 +1660,10 @@ trait ObjectElement {
impl<N> ObjectElement for N where N: ThreadSafeLayoutNode {
fn has_object_data(&self) -> bool {
let elem = self.as_element().unwrap();
- let type_and_data = (elem.get_attr(&ns!(), &atom!("type")), elem.get_attr(&ns!(), &atom!("data")));
+ let type_and_data = (
+ elem.get_attr(&ns!(), &local_name!("type")),
+ elem.get_attr(&ns!(), &local_name!("data")),
+ );
match type_and_data {
(None, Some(uri)) => is_image_data(uri),
_ => false
@@ -1669,7 +1672,10 @@ impl<N> ObjectElement for N where N: ThreadSafeLayoutNode {
fn object_data(&self) -> Option<Url> {
let elem = self.as_element().unwrap();
- let type_and_data = (elem.get_attr(&ns!(), &atom!("type")), elem.get_attr(&ns!(), &atom!("data")));
+ let type_and_data = (
+ elem.get_attr(&ns!(), &local_name!("type")),
+ elem.get_attr(&ns!(), &local_name!("data")),
+ );
match type_and_data {
(None, Some(uri)) if is_image_data(uri) => Url::parse(uri).ok(),
_ => None
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index ab9563c90bc..045b50775dc 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -886,7 +886,7 @@ impl TableColumnFragmentInfo {
/// Create the information specific to an table column fragment.
pub fn new<N: ThreadSafeLayoutNode>(node: &N) -> TableColumnFragmentInfo {
let element = node.as_element().unwrap();
- let span = element.get_attr(&ns!(), &atom!("span"))
+ let span = element.get_attr(&ns!(), &local_name!("span"))
.and_then(|string| string.parse().ok())
.unwrap_or(0);
TableColumnFragmentInfo {
diff --git a/components/layout/lib.rs b/components/layout/lib.rs
index 59c59bed502..c0131b5064a 100644
--- a/components/layout/lib.rs
+++ b/components/layout/lib.rs
@@ -29,6 +29,7 @@ extern crate gfx;
extern crate gfx_traits;
extern crate heapsize;
#[macro_use] extern crate heapsize_derive;
+#[macro_use] extern crate html5ever_atoms;
extern crate ipc_channel;
extern crate libc;
#[macro_use]
@@ -47,8 +48,8 @@ extern crate range;
extern crate rustc_serialize;
extern crate script_layout_interface;
extern crate script_traits;
+#[macro_use] extern crate servo_atoms;
extern crate smallvec;
-#[macro_use(atom, ns)] extern crate string_cache;
extern crate style;
extern crate style_traits;
extern crate unicode_bidi;
diff --git a/components/layout/query.rs b/components/layout/query.rs
index 8b394ac8fec..f313010118c 100644
--- a/components/layout/query.rs
+++ b/components/layout/query.rs
@@ -23,10 +23,10 @@ use script_layout_interface::wrapper_traits::{LayoutNode, ThreadSafeLayoutElemen
use script_traits::LayoutMsg as ConstellationMsg;
use script_traits::UntrustedNodeAddress;
use sequential;
+use servo_atoms::Atom;
use std::cmp::{min, max};
use std::ops::Deref;
use std::sync::{Arc, Mutex};
-use string_cache::Atom;
use style::computed_values;
use style::context::StyleContext;
use style::logical_geometry::{WritingMode, BlockFlowDirection, InlineBaseDirection};