Commit graph

761 commits

Author SHA1 Message Date
Bruno de Oliveira Abinader
5db3eb0cee Cleanup Element's AttributeHandlers
Remove notify_attribute_{changed,removed} in favor of a unified
notify_content_changed.
2014-10-30 17:14:25 -04:00
bors-servo
7de9ed5fc7 auto merge of #3856 : Ms2ger/servo/tagname, r=Manishearth
format!("{}", atom) yields strings like "Atom('span' type=Inline)", which is
not intended here.
2014-10-30 12:27:35 -06: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
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
Clark Gaebel
a8f80b89f4 layout: Implement flow tree dumping with RUST_LOG=debug is on.
r? @pcwalton
2014-10-28 10:14:12 -07: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
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
Keegan McAllister
9da7679367 Use html5ever for HTML parsing 2014-10-16 13:06:34 -07:00
bors-servo
1de2fb3721 auto merge of #3695 : saneyuki/servo/cell, r=jdm
#3050
2014-10-16 00:03:18 -06:00
Manish Goregaokar
3f2cbb275b Use #[dom_struct] everywhere 2014-10-16 10:20:18 +05:30
Tetsuharu OHZEKI
ab90c718eb Add the comment about to use mem::transmute() for values contained in DOMRefCell. 2014-10-16 10:48:23 +09:00
Tetsuharu OHZEKI
fb98384fa5 Use DOMRefCell<T> in Element. 2014-10-15 13:44:02 +09:00
Patrick Walton
5f8d3f72d8 layout: Introduce support for legacy presentational attributes to selector
matching, and use it for `<input size>` and `<td width>`.

This implements a general framework for legacy presentational attributes
to the DOM and style calculation, so that adding more of them later will
be straightforward.
2014-10-14 12:44:09 -07:00
Patrick Walton
ee2ccc4f87 script: Use atom comparison in more places, especially for attributes.
75% improvement in style recalc for Guardians of the Galaxy.
2014-10-14 10:32:40 -07:00
Tim Taubert
cbe50f1f14 Privatize Element 2014-10-13 13:25:44 +02:00
Tim Taubert
8825296869 Privatize Document 2014-10-13 13:25:43 +02:00
Tim Taubert
df60f8b2c5 Privatize EventTarget and EventListenerEntry 2014-10-13 13:25:43 +02:00
Tim Taubert
78fef7eec5 Privatize Attr 2014-10-13 13:18:57 +02:00
Tim Taubert
9a52bb8310 Privatize InheritTypes 2014-10-13 11:13:12 +02:00
Patrick Walton
2a790d06dd Use Gecko's simpler Bloom filter instead of one based on hash
stretching.

This preserves the usage of the Bloom filter throughout style recalc,
but the implementation is rewritten. Provides a 15% improvement on
Guardians of the Galaxy.
2014-10-10 17:02:27 -07:00
Clark Gaebel
d12c6e7383 Incremental Style Recalc
This patch puts in the initial framework for incremental reflow. Nodes' styles
are no longer recalculated unless the node has changed.

I've been hacking on the general problem of incremental reflow for the past
couple weeks, and I've yet to get a full implementation that actually passes all
the reftests + wikipedia + cnn. Therefore, I'm going to try to land the different
parts of it one by one.

This patch only does incremental style recalc, without incremental flow
construction, inline-size bubbling, reflow, or display lists. Those will be coming
in that order as I finish them.

At least with this strategy, I can land a working version of incremental reflow,
even if not yet complete.

r? @pcwalton
2014-10-09 12:55:21 -04:00
Tim Taubert
35f8270c64 Remove unnecessary deref()s (fixes #3586) 2014-10-09 15:01:54 +02:00
bors-servo
94731270df auto merge of #3605 : Manishearth/servo/form-stuff, r=jdm 2014-10-08 03:42:34 -06:00
Manish Goregaokar
1484acb7af Address review comments 2014-10-08 14:37:22 +05:30
Tim Taubert
b9e23563bb Support [*|attr], attribute selectors in any namespace (fixes #1558) 2014-10-08 11:01:31 +02:00
Manish Goregaokar
96f6c2fd67 Remove Traceable from element.rs 2014-10-05 22:09:12 +05:30
Josh Matthews
54fcab61d6 Implement MutNullableJS for mutable, nullable member pointers to DOM objects. 2014-10-01 17:06:23 +02:00
Cameron Zwarich
8b0361e251 Remove an unused lifetime parameter 2014-09-30 21:26:19 -07:00
Cameron Zwarich
79b4ec99b4 Convert TNode / TElement to use self methods rather than &self 2014-09-30 21:26:19 -07:00
Cameron Zwarich
1581c383bb Convert the remaining ElementHelpers methods to take self 2014-09-30 21:26:19 -07:00
Cameron Zwarich
ccc5d976f7 Refine a lifetime parameter on TElement's get_local_name 2014-09-30 21:22:24 -07:00
Cameron Zwarich
e894499c17 Disambiguate methods without using trait objects 2014-09-30 21:22:24 -07:00
Cameron Zwarich
be9618d55b Add a lifetime parameter to the ElementHelper trait
This refines the lifetime used in get_local_name / get_namespace and
makes it independent of the lifetime on the &self parameter.
2014-09-30 21:21:00 -07:00
Cameron Zwarich
3953456b61 Convert a method from &JSRef to JSRef
This also removes the unnecessary formation of a trait object.
2014-09-30 15:55:05 -07:00
Keegan McAllister
d50114c41d Use string-cache's Namespace type 2014-09-29 21:40:54 -07:00
Keegan McAllister
6429750b33 Eliminate servo_util::atom
We only needed this for Encodable, and now we use JSTraceable instead.
2014-09-29 18:39:36 -07:00
Simon Sapin
b3245fa407 Upgrade to rustc d2b30f7d3 2014-09-23 2014-09-29 17:41:45 +01:00
Cameron Zwarich
b2a3519011 Remove the 'static lifetime parameters from TElement methods
This improves the static correctness of layout's use of DOM nodes.

Fixes #2595.
2014-09-27 11:14:10 -07:00
Cameron Zwarich
61ae80e186 Add an extra lifetime parameter to TElement / TNode
This isn't used for anything yet, but it's easier to propagate this
change in a separate commit.
2014-09-27 11:14:10 -07:00
Manish Goregaokar
95a4731c0e Merge pull request #3468 from Manishearth/jstraceable
Replace our usage our Encodable with JSTraceable; r=jdm
2014-09-24 21:25:41 +05:30
Manish Goregaokar
cc44a3b064 Use JSTraceable everywhere 2014-09-24 05:44:49 +05:30
Ms2ger
d3d7c1dabd Handle null strings in Namespace::new.
This also avoids a string copy in the rare case of an unrecognized namespace.
2014-09-23 22:22:45 +02:00
Tetsuharu OHZEKI
628191e372 Make Document.idmap key to Atom. 2014-09-21 22:38:39 +09:00
Keegan McAllister
dc86e83654 Eliminate warnings 2014-09-20 13:00:55 -07:00
Keegan McAllister
a640a7c5c3 Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000) 2014-09-20 13:00:06 -07:00
Cameron Zwarich
d768ee77ad Convert various helper traits from &JSRef to JSRef
I converted them all with a few exceptions:

- Methods that were used by trait objects, since trait objects don't
  work with `self` methods.
- Methods that take an &'b JSRef<'a, T> and return an &'b. In reality,
  many (all?) could return an &'a instead, but this isn't allowed by the
  Deref trait.
- Methods that internally rely on the same issue with Deref.
- I left out the traits involved in layout entirely, even though not all
  of their methods suffer from one of the above problems.

There will probably be solutions to all of these problems in the future.
2014-09-20 11:54:11 -07:00
Cameron Zwarich
2c8d51a37c More progress in the &JSRef -> JSRef conversion
Change all of the <Class>Methods traits to take `self` instead of
`&self`.
2014-09-20 11:54:10 -07:00
Adenilson Cavalcanti
7581335232 Move is_void() Element method together with the other struct methods,
it becomes part of ElementHelpers.
2014-09-20 10:24:57 -07:00
Cameron Zwarich
4fa8725111 First steps of &JSRef -> JSRef conversion
Replace &JSRef with JSRef in the bulk of the generated code. This will
remove a level of indirection throughout all DOM code.

This patch doesn't change methods implemented on JSRef<T> to take `self`
rather than `&self`, and it leaves a few other uses of &JSRef, but those
changes can be made incrementally.
2014-09-19 13:39:17 -07:00
Josh Matthews
fae7ce3c1d Retrieve some basic layout properties for nodes to make the box model somewhat useful. 2014-09-18 15:07:11 -04:00