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
Shamir Khodzha
8bb1724c1e
implemented iterator for child elements
2014-01-03 21:52:22 +04:00
Ms2ger
29897580e1
Remove the hashmap for attributes.
2014-01-03 18:24:00 +01:00
patrick kim
e0a04fff46
fix unit of clientrect &
...
add width,height test in src/test/html/content/test_getBoundingClientRect.html
2014-01-03 17:25:46 +09:00
Ms2ger
886ab020d8
Use string reflection methods for HTMLIFrameElement.sandbox.
2014-01-01 17:24:56 +01:00
Ms2ger
6e6d45ca26
Introduce methods to simplify implementing reflecting attributes.
2013-12-24 10:24:35 +01:00
Ms2ger
95913d1fed
Pass a Namespace to Element::get_attr.
2013-12-23 13:03:52 +01:00
Ms2ger
e64ee3557e
Pass a Namespace to Element::get_attribute.
2013-12-23 12:21:18 +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