Commit graph

312 commits

Author SHA1 Message Date
Ms2ger
b51e83819d Fix obsolete format traits.
They are to be removed from the language in the next rust upgrade.
2015-01-02 19:04:18 +01:00
Megha Gupta
f85b9e37cc Add HTMLElementTypeId enum (fixes #3625) 2015-01-02 23:10:31 +05:30
Ms2ger
1dad710063 Replace Root::deref() calls by Root::r() calls where possible.
This changes those calls that were already sound.
2015-01-01 20:36:43 +01:00
Ms2ger
c9f26dfd59 Rename Root::root_ref() to Root::r().
As it will be used much more widely after the upcoming changes, this limits
the effort reading and writing the method calls.
2015-01-01 20:36:43 +01:00
bors-servo
56d1b16d1b auto merge of #4173 : Manishearth/servo/a-more-dom-struct, r=kmcallister
Now `#[dom_struct]` also generates Reflectable impls, and there's another lint to ensure that a DOM struct only contains one bare DOM field (as the first field) or a Reflector.

A lot of this was generated by sed -- each autogenerated change has its own commit for easy review; these will be squashed later.
2014-12-27 22:12:45 -07:00
Manish Goregaokar
e9d1740e19 script: to_string() -> into_string() 2014-12-27 14:48:36 +01:00
Manish Goregaokar
50c246bdc5 Fix warnings post-upgrade 2014-12-27 03:28:35 +05:30
Manish Goregaokar
7d65673561 Remove extra spaces
Command: `find . -maxdepth 1 -type f -print0 | xargs -0 sed -z -i "s/}\\n\\n\\n/}\\n\\n/"`
2014-12-27 02:53:35 +05:30
Manish Goregaokar
552db382d6 Remove manual impls of Reflectors (autogen)
Obtained via:

 `find . -maxdepth 1 -type f -print0 | xargs -0 sed -z -i "s/\\nimpl Reflectable for[^{]*{[^}]*}[^}]*}\\n//"`
 `find . -maxdepth 1 -type f -print0 |xargs -0  grep -lZ dom_struct | xargs -0 grep -LZ  "reflector()\\|Reflector::new" |xargs -0 sed -z -i "s/use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};/use dom::bindings::utils::reflect_dom_object;/"`

followed by semi-automated removal of leftover imports
2014-12-27 02:52:33 +05:30
Amanda Watson
582ba9d796 GlobalRef passed by value in reflect_dom_object, reflect_node #4165 2014-12-20 16:20:53 -08:00
Ms2ger
96180ec3ad Move unwrap_jsmanaged and related machinery to conversions.rs. 2014-12-20 14:51:14 +01:00
Tetsuharu OHZEKI
a7bb436177 script: Remove glob imports added in #4405 2014-12-19 04:52:48 +09:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
Patrick Walton
a1ea44b294 style: Address review comments relating to bgcolor and column spans 2014-12-15 18:09:44 -08:00
Patrick Walton
d101c1dd91 script: Improve dirty propagation and fix script-layout synchronization.
This fixes race conditions whereby layout and script could be running
simultaneously.
2014-12-15 14:16:04 -08:00
bors-servo
368d6dc6bf auto merge of #4280 : Ms2ger/servo/cleanup-node, r=jdm 2014-12-08 13:55:08 -07:00
bors-servo
5c506f7a98 auto merge of #4194 : cgaebel/servo/incremental-reflow-fix, r=pcwalton
When inserting a node that was already dirtied, the dirtying logic
would short circuit: "This node is already dirty? Great! Then its
parents must be HAS_DIRTY_DESCENDANTS, too! Let's skip that step."

This isn't appropriate when nodes move around the tree. In that case,
the node may be marked HAS_CHANGED, but ancestors may not yet have
the HAS_DIRTY_DESCENDANTS flag set.

This patch adds a `content_and_heritage_changed` hook in the document,
to deal with these cases appropriately.
2014-12-08 12:28:14 -07:00
Ms2ger
e63a92956d Cleanup Node::is_html_element_in_html_document. 2014-12-08 12:26:10 +01:00
Ms2ger
c009bdec4e Cleanup Node::as_element. 2014-12-08 12:23:34 +01:00
Ms2ger
ba5a08c106 Cleanup Node::CloneNode. 2014-12-08 12:19:43 +01:00
Ms2ger
327b5d0ce5 Cleanup Node::Normalize. 2014-12-08 12:16:41 +01:00
Ms2ger
19e44362e2 Cleanup Node::ChildNodes. 2014-12-08 12:13:17 +01:00
Ms2ger
91c43ac18d Cleanup Node::clone. 2014-12-08 12:09:58 +01:00
Ms2ger
1611b8d0a8 Cleanup Node::summarize. 2014-12-08 12:03:12 +01:00
Ms2ger
54c0601950 Cleanup Node::query_selector. 2014-12-08 11:58:59 +01:00
Manish Goregaokar
e7ac792ed6 Switch to NodeFlags (the footprint has not changed) 2014-12-05 18:34:53 -08:00
Manish Goregaokar
3ba4bba28b Implement QuerySelectorIterator (fixes #4082) 2014-12-05 18:34:52 -08:00
Clark Gaebel
d3e4d29368 Fixed #4170 - Incremental reflow wasn't being aggressive enough when nodes get reparented.
When inserting a node that was already dirtied, the dirtying logic
would short circuit: "This node is already dirty? Great! Then its
parents must be HAS_DIRTY_DESCENDANTS, too! Let's skip that step."

This isn't appropriate when nodes move around the tree. In that case,
the node may be marked HAS_CHANGED, but ancestors may not yet have
the HAS_DIRTY_DESCENDANTS flag set.

This patch adds a `content_and_heritage_changed` hook in the document,
to deal with these cases appropriately.
2014-12-03 11:17:38 -08:00
Michael Booth
2cbf5a3671 Updated reflect_dom_object to be passed by value 2014-11-30 19:47:52 +00:00
Tetsuharu OHZEKI
d53ce7f8d2 Remove Node.eventtarget(). 2014-11-28 06:02:21 +09:00
Rohan Prinja
4b754bd457 implement Document#createAttribute 2014-11-23 14:51:04 +05:30
Ms2ger
859f14f38b Correct the checks in step 5 of Node::pre_insert. 2014-11-16 12:40:42 +01:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
Ms2ger
82ff32a710 Pass the correct argument to Element::create when cloning.
The current code calls as_slice() on the Option, yielding &[DOMString], and
then calls to_string, yielding "[prefix]".
2014-11-05 20:51:41 +01:00
bors-servo
69f8b46f36 auto merge of #3835 : pcwalton/servo/script-microoptzns, r=Ms2ger
This is a grab bag of various microoptimizations for script that I came across when profiling our performance on RoboHornet.

r? @jdm
2014-11-03 15:48:34 -07:00
Martin Robinson
2d72f00ccf Have ContentBox(es)Queries consult the flow tree
Instead of looking at the display tree, have ContentBox(es)Query consult
the flow tree. This allow optimizing away parts of the display tree
later. To do this we need to be more careful about how we send reflow
requests, only querying the flow tree when possible.

Fixes #3790.
2014-11-03 10:30:28 -08:00
Ms2ger
68f3daa7ef Simplify the implementation of NodeIterator::next_child. 2014-11-02 21:28:06 +01:00
Ms2ger
cb68fbd68e Simplify the implementation of NodeHelpers::child_elements. 2014-11-02 21:26:59 +01:00
Patrick Walton
b245a2475f script: Fix busted document fragment appending code 2014-10-31 10:24:49 -07:00
Bruno de Oliveira Abinader
d5d4d0bec4 s/peek().is_some()/!is_empty()/ 2014-10-31 11:17:08 -04:00
Bruno de Oliveira Abinader
11d2251b1e ChildElementIterator is now peekable 2014-10-31 10:52:39 -04:00
Bruno de Oliveira Abinader
eb1ef59aee s/AbstractNodeChildrenIterator/NodeChildrenIterator/ 2014-10-31 10:52:02 -04:00
Ms2ger
82216fd5c0 Move build_element_from_tag out of the HTML parser.
This function is not particular to the parser, so should live in the DOM.
2014-10-30 18:03:19 +01:00
Matt Brubeck
598150ea78 Implement cloning steps for script element 2014-10-29 14:31:47 -07:00
Matt Brubeck
fe123ad07c Switch to synchronous script loading
This removes the old code for asyncronously loading scripts during HTML
parsing and then executing them afterward.

Fixes #3356.
2014-10-29 14:31:47 -07:00
Patrick Walton
8ab354ac08 script: Don't create a temporary vector on the heap when inserting
non-fragment nodes.
2014-10-28 11:18:43 -07:00
Patrick Walton
6a7a96a86c script: Don't dirty nodes that are already dirty. 2014-10-28 11:17:26 -07:00
Patrick Walton
e034c1cee2 script: Use String::new() instead of the formatting infrastructure
when constructing DOM unique IDs.

This was showing up in the RoboHornet profile.
2014-10-28 11:16:20 -07:00
Clark Gaebel
a8f80b89f4 layout: Implement flow tree dumping with RUST_LOG=debug is on.
r? @pcwalton
2014-10-28 10:14:12 -07:00
Ray Clanan
85f746f9b9 Rename untraceable!() to no_jsmanaged_fields!(). References issue #3671 2014-10-23 21:33:32 -04:00