Commit graph

544 commits

Author SHA1 Message Date
Bruno de Oliveira Abinader
aa4b5bb948 Implement ProcessingInstruction DOM interface
Spec:
http://dom.spec.whatwg.org/#interface-processinginstruction

Closes #1619.
2014-02-06 14:41:55 -04:00
Bruno de Oliveira Abinader
a6c897e445 Implement document.characterSet
Spec:
http://dom.spec.whatwg.org/#dom-document-characterset

This is a sub-task for #1428.
2014-02-06 07:46:24 -04:00
Adrien Bustany
2254a9e923 script: Pass the correct parent node to pre_insert in insertBefore
Closes #1572.
2014-02-05 16:27:22 +01:00
Bruno de Oliveira Abinader
56572a2814 Implement document.compatMode
Spec:
http://dom.spec.whatwg.org/#dom-document-compatmode

This is a sub-task for #1428.
2014-01-30 19:12:19 -04:00
bors-servo
572959c3e6 auto merge of #1583 : brunoabinader/servo/document-url, r=Ms2ger
Specs:
http://dom.spec.whatwg.org/#dom-document-url
http://dom.spec.whatwg.org/#dom-document-documenturi

This is a sub-task for #1428.
2014-01-30 08:58:40 -08:00
Bruno de Oliveira Abinader
43416ef91f Implement document.URL & document.documentURI
Specs:
http://dom.spec.whatwg.org/#dom-document-url
http://dom.spec.whatwg.org/#dom-document-documenturi

This is a sub-task for #1428.
2014-01-30 10:41:24 -04:00
Bruno de Oliveira Abinader
0c6de1bb34 Basic skeleton for DOMException
Spec:
http://dom.spec.whatwg.org/#domexception

This is a subtask for #1542.
2014-01-29 14:58:22 -04:00
Tetsuharu OHZEKI
c95bb6403c Make Node::{remove, insert} take a descriptive enum for suppress_observers instead of a boolean. 2014-01-29 20:13:12 +09:00
Patrick Walton
9c3af574e5 layout: Perform cascading in parallel.
Speeds up the cascade by 3x.
2014-01-27 14:41:52 -08:00
Simon Sapin
5ae7aad6e2 Make Namespace::to_str() return a string. 2014-01-25 12:23:11 -08:00
Simon Sapin
fdafc3701f Make get_attr() take a &Namespace rather than Option<~str> 2014-01-25 12:23:04 -08:00
Simon Sapin
624e2714d4 Move script::dom::namespace into util, in order to use it from style later. 2014-01-25 12:14:06 -08:00
Simon Sapin
ae0cbda327 Change Namespace::from_str to take &str, fix #1367 2014-01-25 11:50:06 -08:00
Simon Sapin
b8556afeeb Do not lowercase names for *AttributeNS APIs. (Move lower-casing to callers.) 2014-01-25 11:25:42 -08:00
Ms2ger
d6b5015d7a Revert PR #1554 because it's wrong. 2014-01-25 09:50:03 +01:00
Patrick Walton
1b786fe414 script: Avoid an allocation when getting attribute data.
15% improvement in selector matching performance on the rainbow page.
2014-01-24 16:58:07 -08:00
bors-servo
d11e431887 auto merge of #1533 : metajack/servo/unsafe-get-attr, r=jdm
The old code was used by both layout and script, but was erroneously
borrowing for the layout case (which causes parallelism
problems). script now uses only `value_ref()` or `get_attribute()`, and
layout now has its own unsafe version that dances around the borrows of
`@mut Attr`.
2014-01-22 16:28:20 -08:00
Jack Moffitt
c443bcbfff Change get_attr() to get_attr_val_for_layout().
The old code was used by both layout and script, but was erroneously
borrowing for the layout case (which causes parallelism
problems). script now uses only `value_ref()` or `get_attribute()`, and
layout now has its own unsafe version that dances around the borrows of
`@mut Attr`.
2014-01-22 17:02:21 -07:00
Bruno de Oliveira Abinader
1067da7df8 Basic support for Document::contentType
Spec:
http://dom.spec.whatwg.org/#dom-document-contenttype

This is a subtask for #1428, #1510 and #1526.
2014-01-21 12:48:09 -04:00
Bruno de Oliveira Abinader
a58838e14b Implement DOMImplementation::createHTMLDocument
Spec:
http://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument

Closes #1510.
2014-01-20 15:20:23 -04:00
bors-servo
733162e217 auto merge of #1508 : Ms2ger/servo/following-siblings-iter, r=jdm 2014-01-20 05:05:35 -08:00
Youngmin Yoo
0523a7dfe9 Move webidl files to dom/webidl 2014-01-20 12:56:23 +09:00
Bruno de Oliveira Abinader
cdf29d4394 Remove Document's unused 'title'
There is no current use for this variable.

This is a subtask for #1428.
2014-01-17 10:00:50 -04:00
Ms2ger
1117e24334 Remove AbstractNode::followed_by_doctype and AbstractNode::inclusively_followed_by_doctype in favour of iterators over following siblings. 2014-01-16 16:19:16 +01:00
Bruno de Oliveira Abinader
3b82b11054 Implement Node::replaceChild()
Implements Node:replaceChild() according to spec below:
http://dom.spec.whatwg.org/#concept-node-replace

Closes #1430.
2014-01-16 10:25:17 -04:00
bors-servo
89bb1194c1 auto merge of #1501 : Ms2ger/servo/add_child, r=jdm 2014-01-15 15:09:20 -08:00
Ms2ger
0157ff3ca3 Reorder changes in add_child to be correct. 2014-01-15 23:53:27 +01:00
Bruno de Oliveira Abinader
ef8ce13550 DocumentType does not need to know about quirks mode
TSIA. Closes #1498.
2014-01-15 16:07:11 -04:00
Bruno de Oliveira Abinader
0d35d4932b Implement DOMImplementation::createDocumentType
Implementation according to spec:
http://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype

Closes #1489.
2014-01-15 14:56:14 -04:00
bors-servo
c876335d22 auto merge of #1490 : pcwalton/servo/distrust-layout-new, r=jdm
Pointers to DOM nodes from layout could go stale if incremental reflow
does not correctly destroy dead nodes. Therefore, we ask the JavaScript
garbage collector to verify that each DOM node is indeed a valid pointer
before calling event handlers on it, and fail otherwise.

Depends on the `get-addressable-gc-thing` branches of `mozjs` and `rust-mozjs`.

r? @jdm
2014-01-14 22:06:56 -08:00
Patrick Walton
7d447dbc06 script: Stop trusting pointers to DOM nodes that layout provides.
Pointers to DOM nodes from layout could go stale if incremental reflow
does not correctly destroy dead nodes. Therefore, we ask the JavaScript
garbage collector to verify that each DOM node is indeed a valid pointer
before calling event handlers on it, and fail otherwise.
2014-01-14 21:51:24 -08:00
Bruno de Oliveira Abinader
60dd40f412 Add DOMImplementation skeleton
Creates a DOMImplementation struct corresponding to DOMImplementation
WebIDL. Also implements a getter for Document::implementation.

Closes #1486.
2014-01-14 13:20:36 -04:00
James Graham
7aee1cae84 Implement innerHTML getter for HTML documents
XML case is not yet implemented.
2014-01-14 13:10:05 +00:00
bors-servo
50b66f3552 auto merge of #1483 : brunoabinader/servo/document-doctype, r=jdm
Closes #1482.
2014-01-13 13:05:42 -08:00
Bruno de Oliveira Abinader
742ad9cd24 Implement Document::doctype
Closes #1482.
2014-01-13 15:45:34 -04:00
zmike
193b6d2635 add names for all servo spawned tasks
* add servo_util::task::{spawn_named,spawn_with_named} functions

* add name param for spawn_listener and spawn_conversation functions

this should resolve #1169
2014-01-13 13:12:48 -05:00
bors-servo
99f24fbd40 auto merge of #1481 : Ms2ger/servo/unused-imports-2, r=metajack 2014-01-13 08:19:12 -08:00
Ms2ger
b15e6dfc84 Remove unused imports. 2014-01-13 17:04:10 +01:00
Tetsuharu OHZEKI
7a9ecffaa0 Implement Element.removeAttribute()/removeAttributeNS(). 2014-01-13 23:12:08 +09:00
Tetsuharu OHZEKI
31e2f22d20 Add the comment to explain the dual declaration. 2014-01-13 23:10:21 +09:00
Tetsuharu OHZEKI
fd0dadbddf Enable only remove operation for Document::update_idmap(). 2014-01-13 23:10:21 +09:00
Tetsuharu OHZEKI
8dc5fe0fe5 Split up the utility function to make internal attribute's namespace. 2014-01-13 23:10:21 +09:00
Tetsuharu OHZEKI
617a95ff5b Remove needless code.
This `OK(())` should be propagated from `Element.set_attribute()`.
2014-01-13 23:07:00 +09:00
bors-servo
943ab4a4f0 auto merge of #1473 : metajack/servo/rustup-20131219, r=jdm 2014-01-12 19:16:21 -08:00
Jack Moffitt
a7ef1cd35e Upgrade to latest Rust. 2014-01-12 19:45:45 -07:00
Bruno de Oliveira Abinader
b5eba001ef Fix to avoid attribute name clash between Document/HTMLDocument
Use children() instead of traverse_preorder(), and avoid having
GetHead() in both Document and HTMLDocument.

Closes #1465.
2014-01-08 16:44:47 -04: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
Ms2ger
4c0e7dda7b Make Element::set_attribute not lower-case the name argument.
In particular, for SetAttributeNS, we should not change the case.
2014-01-04 18:06:57 +01:00
Ms2ger
76a9d59632 Avoid mixing up local name and name when creating attributes. 2014-01-04 11:05:10 +01:00
bors-servo
8cdfbf3fae auto merge of #1443 : khodzha/servo/child_elements, r=jdm
implemented child_elements to filter children with is_element predicate
2014-01-03 14:16:27 -08:00