Commit graph

1855 commits

Author SHA1 Message Date
Ms2ger
671a487145 Format Element#tagName correctly when there's a prefix.
format!("{}", atom) yields strings like "Atom('span' type=Inline)", which is
not intended here.
2014-10-30 11:51:27 +01:00
Matt Brubeck
598150ea78 Implement cloning steps for script element 2014-10-29 14:31:47 -07:00
Matt Brubeck
f39e01b336 Don't force reflow on content changes
This fixes a performance regression caused by the previous patches.  Once we
allowed script and layout to run during parsing, it was running too often
(every time the document changed and called window.reflow).

Fixes #1269.
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
Matt Brubeck
65a0d1fe9a Infrastructure for synchronous script loading
This implements the parts of the "prepare a script element" algorithm that are
required for synchronous scripts.  It also adds some infrastructure for future
support of the `async` and `defer` attributes.
2014-10-29 14:30:42 -07:00
bors-servo
5858fccf87 auto merge of #3718 : juzer10/servo/master, r=jdm
We have created parser trait and declared parse_chunk function in this trait. We are yet to implement this parse_chunk for ServoHTMLParser struct.
2014-10-29 14:36:45 -06:00
nchinth
6a736c7f3c Adding initial version of parser trait
Added parse_chunk method declaration to parser

Removed unnecessary visibilty for parse_chunk function

Implemented parse_chunk function

Implemented parse_chunk fn for ServoHTMLParser

Moved parser trait to mod.rs and added finish fn

added licence header to mod.rs and other review comments

Fixed trailing space issue

Fixed failed tabular space test
2014-10-29 11:31:20 -04:00
bors-servo
2d8bd10abe auto merge of #3828 : cgaebel/servo/layout-node-dumping, r=pcwalton
r? @pcwalton
2014-10-28 13:12:52 -06:00
Patrick Walton
a94e13f888 script: Use an FNV hash to hash event listeners.
The security properties of SipHash are irrelevant for event listeners
and the creation of the random number generator was showing up high in
the profiles.
2014-10-28 11:34:06 -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
Patrick Walton
6f577c7c84 script: Avoid a temporary when constructing <td> and <tr> elements.
Was a huge improvement to RoboHornet.
2014-10-28 11:14:06 -07:00
Patrick Walton
5e9127e2b2 script: Use a 16-element SmallVec for the root collection.
In my tests the size of the root collection never exceeded 7, so 16
seems like a nice conservative number.
2014-10-28 11:12:09 -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
Clark Gaebel
14b1c320a6 make naming more consistent 2014-10-28 10:06:39 -07:00
Clark Gaebel
6df1cc8e4c Run all task spawning through util, to allow for easy hooking.
During debugging, I found it useful to hook all task creation in a
central location, and util::task was the perfect place for it.

r? @pcwalton (or maybe someone else, I'm kinda sending you a bunch of
reviews today because I don't know who better to give them to)
2014-10-28 09:53:45 -07:00
Mukilan Thiyagarajan
e023662571 Implement [LenientThis] support and enable it in Document.webidl
Closes issue #3760
2014-10-25 12:05:36 +05:30
Keegan McAllister
f508a82582 Provide safety check helpers in release builds
debug_assert! uses

    if cfg!(not(ndebug)) { ... }

so the body in a release build is dead code, but it still needs to compile.
2014-10-24 16:53:58 -07:00
Keegan McAllister
49234484d6 Ignore the HTML parser's borrow flag in GC tracing
Adds some other dynamic checks in debug builds.
2014-10-24 16:27:37 -07:00
Keegan McAllister
6ec0939a22 Dynamically check DOMRefCell access from layout in debug builds 2014-10-24 16:27:37 -07:00
Keegan McAllister
0162214b1f Fix a layout method to use borrow_for_layout() 2014-10-24 16:27:36 -07:00
Keegan McAllister
96e180a22c Customize RefCell instead of wrapping it
This gets rid of a dubious transmute:

    let val = mem::transmute::<&RefCell<T>, &T>(&self.base);

The code duplication will be reduced once rust-lang/rust#18131 is fixed.
2014-10-24 16:27:36 -07:00
Ray Clanan
85f746f9b9 Rename untraceable!() to no_jsmanaged_fields!(). References issue #3671 2014-10-23 21:33:32 -04:00
Josh Matthews
225ec3ed4e Really fix #3738 by only processing iframe src attributes during parsing. 2014-10-23 18:58:34 -04:00
Ms2ger
903f3fa729 Cleanup Document::Title. 2014-10-23 18:21:33 +02:00
Ms2ger
fff0491c01 Move the methods on bare Document onto DocumentHelpers. 2014-10-23 18:21:02 +02:00
Ms2ger
d643ade7e8 Introduce LayoutDocumentHelpers::is_html_document_for_layout for LayoutElementHelpers::html_element_in_html_document_for_layout. 2014-10-23 18:20:11 +02:00
Ms2ger
32bcc192b0 Cleanup some Document methods. 2014-10-23 18:20:11 +02:00
Josh Matthews
539c21f380 Implement Document.readyState. Prevent iframes from notifying the compositor after the initial parse. Fixes #1720. Fixes #3738. 2014-10-23 10:55:59 -04:00
bors-servo
470d27a668 auto merge of #3776 : saneyuki/servo/macro, r=jdm
Fix #3755

This doesn't convert some specialized event handlers (e.g. `HTMLBodyElement`'s ones, `HTMLElement.GetOnload()`).
2014-10-22 22:30:29 -06:00
Tetsuharu OHZEKI
0a84c5d479 Macroize event handler getters and setters. 2014-10-23 13:03:58 +09:00
Edit Balint
daf9e59869 Make DOM getters that return &JS<T> return Temporary<T> instead #3707 2014-10-22 19:05:25 +02:00
Bruno de Oliveira Abinader
bbab8831e0 Usage of JSRef<Attr> in before_remove_attr & after_set_attr
JSRef<Attr> does not require allocating a DOMString for value, which are
unused in most cases. It also provides more access to Attr data.
2014-10-22 11:13:58 -04:00
Tetsuharu OHZEKI
71b4143d32 Use DOMRefCell for XMLHttpRequest. 2014-10-22 10:01:01 +09:00
Tetsuharu OHZEKI
6d089a87d5 Use DOMRefCell for URLSearchParams. 2014-10-22 10:01:01 +09:00
Tetsuharu OHZEKI
38ddddd1ca Use DOMRefCell for ServoHTMLParser. 2014-10-22 10:01:01 +09:00
Tetsuharu OHZEKI
36d8dc5a42 Use DOMRefCell for Window. 2014-10-22 10:01:01 +09:00
Tetsuharu OHZEKI
7e7c610837 Use DOMRefCell for Node.
Altough LayoutDataRef is touched, we don't use DOMRefCell in it becasuse
it's expected to manipulate in other task.
2014-10-22 10:01:01 +09:00
Tetsuharu OHZEKI
d8c4588f0e Use DOMRefCell for HTMLInputElement. 2014-10-22 10:01:00 +09:00
Tetsuharu OHZEKI
4c72727a56 Use DOMRefCell for HTMLImageElement. 2014-10-22 10:01:00 +09:00
Tetsuharu OHZEKI
f33e09d8f8 Use DOMRefCell for FormData. 2014-10-22 10:01:00 +09:00
Tetsuharu OHZEKI
752c821e43 Use DOMRefCell for EventTarget. 2014-10-22 10:01:00 +09:00
Tetsuharu OHZEKI
1aefa5423a Use DOMRefCell for Event. 2014-10-22 10:01:00 +09:00
Tetsuharu OHZEKI
ab2d3bc1bb Use DOMRefCell for Document. 2014-10-22 10:01:00 +09:00
Clark Gaebel
a5bb2f299f more efficient preorder DOM traversals 2014-10-21 10:01:15 -07:00
Gilles Leblanc
8b727e3680 Edits dom/bindings/DESIGN.md
This corrects and improves the dom/bindings/DESIGN.md document and also
corrects a grammatical error in a tests/reftest.rs message.
2014-10-17 23:12:58 -04:00
Gilles Leblanc
a31849df11 Make HTMLFormElementHelpers::submit take an enumerated argument instead of a boolean
Fixes #3677
2014-10-16 20:57:55 -04:00
Keegan McAllister
9da7679367 Use html5ever for HTML parsing 2014-10-16 13:06:34 -07:00
Ms2ger
b60a601f56 Move jsstring_to_str and jsid_to_str to conversions.rs.
This appears to be a more sensible location for them.

Relevant to #433.
2014-10-16 10:42:09 +02:00