Skip to content
Permalink
Browse files

Eliminate servo_util::atom

We only needed this for Encodable, and now we use JSTraceable instead.
  • Loading branch information
kmcallister committed Sep 30, 2014
1 parent 4be0a07 commit 6429750b339ca45651ac3a45df380f1badd3917c
Showing with 77 additions and 74 deletions.
  1. +7 −0 Cargo.lock
  2. +6 −0 components/layout/Cargo.toml
  3. +1 −1 components/layout/css/matching.rs
  4. +3 −0 components/layout/lib.rs
  5. +1 −1 components/layout/wrapper.rs
  6. +6 −0 components/script/Cargo.toml
  7. +1 −1 components/script/dom/attr.rs
  8. +1 −1 components/script/dom/bindings/trace.rs
  9. +1 −1 components/script/dom/document.rs
  10. +1 −1 components/script/dom/domtokenlist.rs
  11. +1 −1 components/script/dom/element.rs
  12. +1 −1 components/script/dom/htmlbodyelement.rs
  13. +1 −1 components/script/dom/htmlbuttonelement.rs
  14. +1 −1 components/script/dom/htmlcanvaselement.rs
  15. +1 −1 components/script/dom/htmlcollection.rs
  16. +1 −1 components/script/dom/htmlelement.rs
  17. +1 −1 components/script/dom/htmlfieldsetelement.rs
  18. +1 −1 components/script/dom/htmliframeelement.rs
  19. +1 −1 components/script/dom/htmlimageelement.rs
  20. +1 −1 components/script/dom/htmlinputelement.rs
  21. +1 −1 components/script/dom/htmllinkelement.rs
  22. +1 −1 components/script/dom/htmlobjectelement.rs
  23. +1 −1 components/script/dom/htmloptgroupelement.rs
  24. +1 −1 components/script/dom/htmloptionelement.rs
  25. +1 −1 components/script/dom/htmlselectelement.rs
  26. +1 −1 components/script/dom/htmlserializer.rs
  27. +1 −1 components/script/dom/htmltextareaelement.rs
  28. +1 −1 components/script/dom/virtualmethods.rs
  29. +1 −1 components/script/html/hubbub_html_parser.rs
  30. +3 −0 components/script/lib.rs
  31. +6 −0 components/style/Cargo.toml
  32. +5 −0 components/style/lib.rs
  33. +1 −1 components/style/node.rs
  34. +1 −2 components/style/selector_matching.rs
  35. +1 −2 components/style/selectors.rs
  36. +3 −0 components/util/Cargo.toml
  37. +0 −43 components/util/atom.rs
  38. +3 −1 components/util/lib.rs
  39. +7 −0 ports/cef/Cargo.lock

Some generated files are not rendered by default. Learn more.

@@ -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"
@@ -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;
@@ -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>,
@@ -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;
@@ -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;
@@ -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 {
@@ -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"
@@ -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,
@@ -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) {
@@ -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;
@@ -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]
@@ -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]
@@ -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]
@@ -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]
@@ -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;

@@ -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;
@@ -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]
@@ -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]
@@ -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;
@@ -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};

@@ -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]
@@ -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]
@@ -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;

@@ -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]
@@ -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]
@@ -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]
@@ -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 {
@@ -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]
@@ -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.
@@ -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;
@@ -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,
@@ -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;

@@ -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"
@@ -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;

0 comments on commit 6429750

Please sign in to comment.
You can’t perform that action at this time.