Commit graph

108 commits

Author SHA1 Message Date
Jack Moffitt
a7ef1cd35e Upgrade to latest Rust. 2014-01-12 19:45:45 -07:00
Bruno de Oliveira Abinader
17b35d52ff Implement Document::head()
Implementation details according to the specification below:
http://www.whatwg.org/specs/web-apps/current-work/#dom-document-head

This patch is for:
https://github.com/mozilla/servo/issues/1465
2014-01-07 15:51:45 -04:00
Shamir Khodzha
8bb1724c1e implemented iterator for child elements 2014-01-03 21:52:22 +04:00
Ms2ger
95913d1fed Pass a Namespace to Element::get_attr. 2013-12-23 13:03:52 +01:00
Bruno de Oliveira Abinader
ce434dfb3e Implement Document's 'body' attribute
Implement Document's 'body' attribute (getter and setter). Proper
implementation of setter requires Node::ReplaceChild(), which is
currently a stub and will be done on a later step.

This patch is for:
https://github.com/mozilla/servo/issues/1428
2013-12-20 10:58:03 -04:00
Patrick Walton
436b1e891d script: Eliminate the phantom type in Node, as it is no longer needed
for enforcing layout memory safety.
2013-12-17 18:07:41 -08:00
Patrick Walton
8f886e599e layout: Stop exposing raw Element types to layout as well.
This should make layout memory-safe as is, though we will need to do
more stuff for incremental reflow and parallelism.
2013-12-17 18:07:41 -08:00
Patrick Walton
be69a503fe script: Eliminate the phantom type in favor of just whitelisting methods
that layout can safely call.

This is simpler. Currently, the set of methods is not safe, but I plan
to lock it down more soon.
2013-12-17 18:07:12 -08:00
Patrick Walton
199ca33b72 script: Make trees less generic 2013-12-17 13:46:14 -08:00
Keegan McAllister
0238410b47 Allow setting id, class, style without a full reflow
Instead we do selector matching again, then diff the style structs to set the
"restyle damage" bits which are used to prune reflow traversals.

Also don't force a reflow when timers finish, because individual DOM methods
should already take care of that.
2013-12-12 14:43:26 -08:00
Simon Sapin
b290823f4d Fix #1264: support namespaced attribute selectors. 2013-12-10 17:53:12 +00:00
Ms2ger
29a7405b4e Report exceptions to JS when the DOM implementation fails.
As a bonus, adds some debugging statements.
2013-12-05 16:14:02 +01:00
Josh Matthews
f9f9c42ab7 Ensure that it's safe to modify the DOM node pointers before doing so. Fixes #1224. 2013-12-02 19:25:11 -05:00
Tetsuharu OHZEKI
4e4eb10ffc Use 'DOMString' to define the type insteand of '~str'.
At now, 'DOMString' is equal to '~str'.
155befe10d/src/components/script/dom/bindings/utils.rs (L119)
2013-11-23 22:24:52 +09:00
Tetsuharu OHZEKI
aa72c413ed Enable to update id attribute for Document.getElementById(). (#740) 2013-11-23 11:53:45 +09:00
Ms2ger
dc6dbc63af Make the HTML parser parse into the document rather than an element.
This removes the duplicate html element.
2013-11-17 13:58:24 +01:00
Ms2ger
d4a48995a2 Remove type_id arguments from Event::new and UIEvent::new. 2013-11-14 21:10:23 +01:00
Tetsuharu OHZEKI
f5ef4365f4 Stop passing DOMStrings via borrowed pointer. (#1201) 2013-11-14 20:35:36 +09:00
Ms2ger
08afc6d19d Don't pass nullable strings to native DOM methods that want non-nullable strings. Fixes #1207. 2013-11-12 13:57:18 +01:00
Ms2ger
803cd4b7cf Make DOMString represent a non-nullable string. 2013-11-12 13:32:53 +01:00
James Graham
15b9d4d199 Initial support for Attr and namespaces. 2013-11-12 17:39:04 +09:00
Ms2ger
80a6103f7d Remove Reflectable::GetParentObject. 2013-11-06 21:56:47 +01:00
Ms2ger
ccd9306681 Remove DerivedWrapper. 2013-11-06 18:16:31 +01:00
Ms2ger
53731b62ae Remove Reflectable::wrap_object_shared. 2013-11-06 16:40:16 +01:00
Ms2ger
8a7448bc67 Rewrite Document creation and reflection. 2013-11-05 20:45:50 +01:00
Josh Matthews
bb97fd13f3 Add Event and EventTarget hierarchy via gross AbstractFoo mechanism. 2013-11-05 12:58:28 -05:00
Josh Matthews
7ecf5abbbd Generate code for handling callbacks. Implement add/removeEventListener and hacky dispatchEvent proof-of-concept. 2013-11-05 12:58:28 -05:00
Ms2ger
78e51c8309 Rewrite DocumentFragment::new to current standards. 2013-11-02 22:23:44 +01:00
Ms2ger
a431202989 Rewrite Comment::new to current standards. 2013-11-02 22:10:07 +01:00
Ms2ger
da37fde44f Rewrite Text::new to current standards. 2013-11-02 21:55:36 +01:00
Ms2ger
7700a892fc Cleanup build_element_from_tag's signature. 2013-11-02 21:13:37 +01:00
Ms2ger
e918d4daf0 Use HTMLTitleElement::new in Document::SetTitle. 2013-11-02 20:36:50 +01:00
Josh Matthews
99a36cbeb6 Make Document a Node. 2013-10-31 13:34:44 -04:00
Ms2ger
2ca1eede9a Implement insertBefore and reimplement appendChild. 2013-10-29 21:48:28 +01:00
Patrick Walton
baba35adc9 Revert "Make Document a Node." for breaking Acid1
This reverts commit 4e47d59165.

Conflicts:

	src/components/script/dom/domparser.rs
2013-10-24 15:08:09 -07:00
bors-servo
13644ccab1 auto merge of #1079 : jdm/servo/docnode, r=jdm,metajack
The bit I don't like about these changes is that I ended up hiding the document node from the CSS selecting/matching code, so it continues thinking of the document's first child as the root. When I tried to send the full tree including the document node to layout, the layout code refused to create any child flows. When I sent the document's first child without hiding the document, it saw inherited values for properties like font-family, and later tried to treat the document node as an Element when searching for named nodes.
2013-10-24 09:15:55 -07:00
Josh Matthews
4e47d59165 Make Document a Node. 2013-10-24 18:07:46 +02:00
Ms2ger
5d1eea5f03 Remove unused get_scope_and_cx functions. 2013-10-24 16:37:56 +02:00
bors-servo
d222443b38 auto merge of #1117 : Ms2ger/servo/HTMLCollection, r=kmcallister 2013-10-24 06:22:16 -07:00
bors-servo
21270738ae auto merge of #1102 : Ms2ger/servo/dead-document-code, r=jdm
I don't think it's useful to keep those lying around, in particular because we should never even implement some of those (`mozHidden`, `mozVisibilityState`, …)
2013-10-24 05:40:24 -07:00
Ms2ger
8cb4976136 Cleanup HTMLCollection binding. 2013-10-23 20:59:14 +02:00
Jack Moffitt
94202661c0 Update to latest Rust. 2013-10-21 17:38:34 -06:00
Ms2ger
e418e4d830 Remove no-op implementations from Document and HTMLDocument. 2013-10-21 19:51:12 +02:00
Ms2ger
b90766404c Replace Document::{with_base, with_mut_base} by Document::{document, mut_document}. 2013-10-21 17:57:44 +02:00
Ms2ger
364256e359 Replace Node::{with_base, with_mut_base} by Node::{node, mut_node}. 2013-10-21 15:58:16 +02:00
Ms2ger
321e0373fa Merge BindingObject and Reflectable. 2013-10-18 17:02:16 +02:00
Ms2ger
3da1a206d8 Remove DerivedWrapper::wrap_shared, as it's unused. 2013-10-18 15:56:35 +02:00
Ms2ger
c08e4fe36b Make Node.owner_doc private. 2013-10-17 18:44:26 +02:00
Ms2ger
25cae74093 Remove unused aTriedToWrap argument. 2013-10-17 16:43:28 +02:00
Simon Sapin
62f1f03c16 Move Element::get_attr to a trait defined in util::tree
… and add a get_local_name() method to that trait.
2013-10-16 18:10:39 +01:00