Skip to content

Commit

Permalink
Eliminate servo_util::atom
Browse files Browse the repository at this point in the history
We only needed this for Encodable, and now we use JSTraceable instead.
  • Loading branch information
kmcallister committed Sep 30, 2014
1 parent 4be0a07 commit 6429750
Show file tree
Hide file tree
Showing 39 changed files with 77 additions and 74 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions components/layout/Cargo.toml
Expand Up @@ -39,3 +39,9 @@ git = "https://github.com/servo/rust-geom"

[dependencies.url]
git = "https://github.com/servo/rust-url"

[dependencies.string_cache]
git = "https://github.com/servo/string-cache"

[dependencies.string_cache_macros]
git = "https://github.com/servo/string-cache"
2 changes: 1 addition & 1 deletion components/layout/css/matching.rs
Expand Up @@ -11,7 +11,6 @@ use util::{LayoutDataAccess, LayoutDataWrapper};
use wrapper::{LayoutElement, LayoutNode, PostorderNodeMutTraversal, ThreadSafeLayoutNode, TLayoutNode};

use script::dom::node::{TextNodeTypeId};
use servo_util::atom::Atom;
use servo_util::bloom::BloomFilter;
use servo_util::cache::{Cache, LRUCache, SimpleHashCache};
use servo_util::namespace::Null;
Expand All @@ -24,6 +23,7 @@ use style;
use style::{After, Before, ComputedValues, DeclarationBlock, Stylist, TElement, TNode};
use style::cascade;
use sync::Arc;
use string_cache::Atom;

pub struct ApplicableDeclarations {
pub normal: SmallVec16<DeclarationBlock>,
Expand Down
3 changes: 3 additions & 0 deletions components/layout/lib.rs
Expand Up @@ -28,6 +28,9 @@ extern crate "net" as servo_net;
extern crate "msg" as servo_msg;
#[phase(plugin, link)]
extern crate "util" as servo_util;
extern crate string_cache;
#[phase(plugin)]
extern crate string_cache_macros;

extern crate collections;
extern crate encoding;
Expand Down
2 changes: 1 addition & 1 deletion components/layout/wrapper.rs
Expand Up @@ -48,7 +48,6 @@ use script::dom::node::{LayoutNodeHelpers, RawLayoutNodeHelpers, SharedLayoutDat
use script::dom::text::Text;
use script::layout_interface::LayoutChan;
use servo_msg::constellation_msg::{PipelineId, SubpageId};
use servo_util::atom::Atom;
use servo_util::namespace::Namespace;
use servo_util::namespace;
use servo_util::str::is_whitespace;
Expand All @@ -59,6 +58,7 @@ use style::computed_values::{content, display, white_space};
use style::{AnyNamespace, AttrSelector, PropertyDeclarationBlock, SpecificNamespace, TElement};
use style::{TNode};
use url::Url;
use string_cache::Atom;

/// Allows some convenience methods on generic layout nodes.
pub trait TLayoutNode {
Expand Down
6 changes: 6 additions & 0 deletions components/script/Cargo.toml
Expand Up @@ -60,3 +60,9 @@ git = "https://github.com/servo/rust-url"

[dependencies.uuid]
git = "https://github.com/rust-lang/uuid"

[dependencies.string_cache]
git = "https://github.com/servo/string-cache"

[dependencies.string_cache_macros]
git = "https://github.com/servo/string-cache"
2 changes: 1 addition & 1 deletion components/script/dom/attr.rs
Expand Up @@ -15,13 +15,13 @@ use dom::window::Window;
use dom::virtualmethods::vtable_for;

use devtools_traits::AttrInfo;
use servo_util::atom::Atom;
use servo_util::namespace;
use servo_util::namespace::Namespace;
use servo_util::str::{DOMString, split_html_space_chars};
use std::cell::{Ref, RefCell};
use std::mem;
use std::slice::Items;
use string_cache::Atom;

pub enum AttrSettingType {
FirstSetAttr,
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/bindings/trace.rs
Expand Up @@ -35,14 +35,14 @@ use std::rc::Rc;
use std::cell::{Cell, RefCell};

use url::Url;
use servo_util::atom::Atom;
use servo_util::namespace::Namespace;
use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData};
use net::image_cache_task::ImageCacheTask;
use script_traits::ScriptControlChan;
use std::collections::hashmap::HashMap;
use collections::hash::Hash;
use style::PropertyDeclarationBlock;
use string_cache::Atom;

impl<T: Reflectable> JSTraceable for JS<T> {
fn trace(&self, trc: *mut JSTracer) {
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/document.rs
Expand Up @@ -55,10 +55,10 @@ use dom::window::{Window, WindowHelpers};
use html::hubbub_html_parser::build_element_from_tag;
use hubbub::hubbub::{QuirksMode, NoQuirks, LimitedQuirks, FullQuirks};
use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage};
use servo_util::atom::Atom;
use servo_util::namespace;
use servo_util::namespace::{Namespace, Null};
use servo_util::str::{DOMString, split_html_space_chars};
use string_cache::Atom;

use std::collections::hashmap::HashMap;
use std::ascii::StrAsciiExt;
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/domtokenlist.rs
Expand Up @@ -12,9 +12,9 @@ use dom::bindings::utils::{Reflector, Reflectable, reflect_dom_object};
use dom::element::{Element, AttributeHandlers};
use dom::node::window_from_node;

use servo_util::atom::Atom;
use servo_util::namespace::Null;
use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS};
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/element.rs
Expand Up @@ -34,14 +34,14 @@ use layout_interface::MatchSelectorsDocumentDamage;
use devtools_traits::AttrInfo;
use style::{matches, parse_selector_list_from_str};
use style;
use servo_util::atom::Atom;
use servo_util::namespace;
use servo_util::namespace::{Namespace, Null};
use servo_util::str::DOMString;

use std::ascii::StrAsciiExt;
use std::cell::{Cell, RefCell};
use std::mem;
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlbodyelement.rs
Expand Up @@ -17,8 +17,8 @@ use dom::htmlelement::HTMLElement;
use dom::node::{Node, ElementNodeTypeId, window_from_node};
use dom::virtualmethods::VirtualMethods;

use servo_util::atom::Atom;
use servo_util::str::DOMString;
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlbuttonelement.rs
Expand Up @@ -16,8 +16,8 @@ use dom::node::{DisabledStateHelpers, Node, NodeHelpers, ElementNodeTypeId, wind
use dom::validitystate::ValidityState;
use dom::virtualmethods::VirtualMethods;

use servo_util::atom::Atom;
use servo_util::str::DOMString;
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlcanvaselement.rs
Expand Up @@ -18,8 +18,8 @@ use dom::htmlelement::HTMLElement;
use dom::node::{Node, ElementNodeTypeId, window_from_node};
use dom::virtualmethods::VirtualMethods;

use servo_util::atom::Atom;
use servo_util::str::{DOMString, parse_unsigned_integer};
use string_cache::Atom;

use geom::size::Size2D;

Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlcollection.rs
Expand Up @@ -12,11 +12,11 @@ use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::element::{Element, AttributeHandlers, ElementHelpers};
use dom::node::{Node, NodeHelpers};
use dom::window::Window;
use servo_util::atom::Atom;
use servo_util::namespace::Namespace;
use servo_util::str::{DOMString, split_html_space_chars};

use std::ascii::StrAsciiExt;
use string_cache::Atom;

pub trait CollectionFilter : JSTraceable {
fn filter(&self, elem: JSRef<Element>, root: JSRef<Node>) -> bool;
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlelement.rs
Expand Up @@ -17,9 +17,9 @@ use dom::eventtarget::{EventTarget, EventTargetHelpers, NodeTargetTypeId};
use dom::node::{Node, ElementNodeTypeId, window_from_node};
use dom::virtualmethods::VirtualMethods;

use servo_util::atom::Atom;
use servo_util::namespace;
use servo_util::str::DOMString;
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlfieldsetelement.rs
Expand Up @@ -18,8 +18,8 @@ use dom::node::{DisabledStateHelpers, Node, NodeHelpers, ElementNodeTypeId, wind
use dom::validitystate::ValidityState;
use dom::virtualmethods::VirtualMethods;

use servo_util::atom::Atom;
use servo_util::str::{DOMString, StaticStringVec};
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmliframeelement.rs
Expand Up @@ -23,9 +23,9 @@ use page::IterablePage;
use servo_msg::constellation_msg::{PipelineId, SubpageId};
use servo_msg::constellation_msg::{IFrameSandboxed, IFrameUnsandboxed};
use servo_msg::constellation_msg::{ConstellationChan, LoadIframeUrlMsg};
use servo_util::atom::Atom;
use servo_util::namespace::Null;
use servo_util::str::DOMString;
use string_cache::Atom;

use std::ascii::StrAsciiExt;
use std::cell::Cell;
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlimageelement.rs
Expand Up @@ -17,9 +17,9 @@ use dom::htmlelement::HTMLElement;
use dom::node::{Node, ElementNodeTypeId, NodeHelpers, window_from_node};
use dom::virtualmethods::VirtualMethods;
use servo_net::image_cache_task;
use servo_util::atom::Atom;
use servo_util::geometry::to_px;
use servo_util::str::DOMString;
use string_cache::Atom;

use url::{Url, UrlParser};

Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlinputelement.rs
Expand Up @@ -15,8 +15,8 @@ use dom::htmlelement::HTMLElement;
use dom::node::{DisabledStateHelpers, Node, NodeHelpers, ElementNodeTypeId};
use dom::virtualmethods::VirtualMethods;

use servo_util::atom::Atom;
use servo_util::str::DOMString;
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmllinkelement.rs
Expand Up @@ -15,12 +15,12 @@ use dom::htmlelement::HTMLElement;
use dom::node::{Node, NodeHelpers, ElementNodeTypeId, window_from_node};
use dom::virtualmethods::VirtualMethods;
use layout_interface::{LayoutChan, LoadStylesheetMsg};
use servo_util::atom::Atom;
use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS};
use servo_util::namespace::Null;

use std::ascii::StrAsciiExt;
use url::UrlParser;
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlobjectelement.rs
Expand Up @@ -20,9 +20,9 @@ use dom::virtualmethods::VirtualMethods;

use servo_net::image_cache_task;
use servo_net::image_cache_task::ImageCacheTask;
use servo_util::atom::Atom;
use servo_util::namespace::Null;
use servo_util::str::DOMString;
use string_cache::Atom;

use url::Url;

Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmloptgroupelement.rs
Expand Up @@ -15,8 +15,8 @@ use dom::htmlelement::HTMLElement;
use dom::node::{DisabledStateHelpers, Node, NodeHelpers, ElementNodeTypeId};
use dom::virtualmethods::VirtualMethods;

use servo_util::atom::Atom;
use servo_util::str::DOMString;
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmloptionelement.rs
Expand Up @@ -19,9 +19,9 @@ use dom::htmlelement::HTMLElement;
use dom::node::{DisabledStateHelpers, Node, NodeHelpers, ElementNodeTypeId};
use dom::virtualmethods::VirtualMethods;

use servo_util::atom::Atom;
use servo_util::namespace;
use servo_util::str::{DOMString, split_html_space_chars};
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlselectelement.rs
Expand Up @@ -18,8 +18,8 @@ use dom::node::{DisabledStateHelpers, Node, NodeHelpers, ElementNodeTypeId, wind
use dom::validitystate::ValidityState;
use dom::virtualmethods::VirtualMethods;

use servo_util::atom::Atom;
use servo_util::str::DOMString;
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmlserializer.rs
Expand Up @@ -18,8 +18,8 @@ use dom::node::{TextNodeTypeId, NodeHelpers};
use dom::processinginstruction::ProcessingInstruction;
use dom::text::Text;

use servo_util::atom::Atom;
use servo_util::namespace;
use string_cache::Atom;

#[allow(unrooted_must_root)]
pub fn serialize(iterator: &mut NodeIterator) -> String {
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/htmltextareaelement.rs
Expand Up @@ -15,8 +15,8 @@ use dom::htmlelement::HTMLElement;
use dom::node::{DisabledStateHelpers, Node, NodeHelpers, ElementNodeTypeId};
use dom::virtualmethods::VirtualMethods;

use servo_util::atom::Atom;
use servo_util::str::DOMString;
use string_cache::Atom;

#[jstraceable]
#[must_root]
Expand Down
2 changes: 1 addition & 1 deletion components/script/dom/virtualmethods.rs
Expand Up @@ -57,8 +57,8 @@ use dom::htmlstyleelement::HTMLStyleElement;
use dom::htmltextareaelement::HTMLTextAreaElement;
use dom::node::{Node, NodeHelpers, ElementNodeTypeId};

use servo_util::atom::Atom;
use servo_util::str::DOMString;
use string_cache::Atom;

/// Trait to allow DOM nodes to opt-in to overriding (or adding to) common
/// behaviours. Replicates the effect of C++ virtual methods.
Expand Down
2 changes: 1 addition & 1 deletion components/script/html/hubbub_html_parser.rs
Expand Up @@ -25,7 +25,6 @@ use encoding::types::{Encoding, DecodeReplace};
use hubbub::hubbub;
use hubbub::hubbub::{NullNs, HtmlNs, MathMlNs, SvgNs, XLinkNs, XmlNs, XmlNsNs};
use servo_net::resource_task::{Load, LoadData, Payload, Done, ResourceTask, load_whole_resource};
use servo_util::atom::Atom;
use servo_util::namespace;
use servo_util::namespace::{Namespace, Null};
use servo_util::str::DOMString;
Expand All @@ -37,6 +36,7 @@ use std::comm::{channel, Sender, Receiver};
use url::{Url, UrlParser};
use http::headers::HeaderEnum;
use time;
use string_cache::Atom;

macro_rules! handle_element(
($document: expr,
Expand Down
3 changes: 3 additions & 0 deletions components/script/lib.rs
Expand Up @@ -42,6 +42,9 @@ extern crate sync;
extern crate "msg" as servo_msg;
extern crate url;
extern crate uuid;
extern crate string_cache;
#[phase(plugin)]
extern crate string_cache_macros;

pub mod cors;

Expand Down
6 changes: 6 additions & 0 deletions components/style/Cargo.toml
Expand Up @@ -29,3 +29,9 @@ git = "https://github.com/lifthrasiir/rust-encoding"

[dependencies.lazy_static]
git = "https://github.com/Kimundi/lazy-static.rs"

[dependencies.string_cache]
git = "https://github.com/servo/string-cache"

[dependencies.string_cache_macros]
git = "https://github.com/servo/string-cache"
5 changes: 5 additions & 0 deletions components/style/lib.rs
Expand Up @@ -22,6 +22,11 @@ extern crate url;

extern crate cssparser;
extern crate encoding;
extern crate string_cache;

#[phase(plugin)]
extern crate string_cache_macros;

#[phase(plugin)]
extern crate lazy_static;

Expand Down

0 comments on commit 6429750

Please sign in to comment.