Commit graph

91 commits

Author SHA1 Message Date
Jaeman Park
6dba191efe Implementation of pseudo class 'first-child'. 2013-10-29 14:53:39 +00:00
Patrick Walton
42092921c1 Optimize reflow by changing enums to traits and inlining more 2013-10-28 13:22:26 -07: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
Ms2ger
5ee3bc7450 Cleanup NodeList bindings. 2013-10-23 21:13:18 +02:00
Simon Sapin
2045f6a068 Remove (now unused) NetSurf’s libcss and libwapcaplet.
This removes four submodules (two C libraries and their Rust bindings.)
2013-10-23 14:42:29 +02:00
bors-servo
9b25df1968 auto merge of #1109 : sanxiyn/servo/new-style, r=SimonSapin
Regressions are:
* Incremental layout is broken
* `:link` is broken
* Source URL is not passed to CSS parser
* `text-decoration` propagation for block containers establishing an inline formatting context is not handled

This also does not remove NetSurf libcss from the build. That can be done in a followup.

This was a team effort. Credits to Deokjin Kim, Ilyong Cho, Jaeman Park, Junyoung Cho, Ryan Choi, Sangeun Kim, Yongjin Kim, Youngmin Yoo, Youngsoo Son.
2013-10-23 03:57:55 -07:00
Ilyong Cho
a4aa8b05f7 Implementation of node.parentNode/parentElement 2013-10-23 17:04:57 +09:00
Seo Sanghyeon
b2431912d3 Use the new style system
Credits to:
    Deokjin Kim
    Ilyong Cho
    Jaeman Park
    Junyoung Cho
    Ryan Choi
    Sangeun Kim
    Yongjin Kim
    Youngmin Yoo
    Youngsoo Son
2013-10-23 16:49:35 +09:00
Jack Moffitt
94202661c0 Update to latest Rust. 2013-10-21 17:38:34 -06: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
c08e4fe36b Make Node.owner_doc private. 2013-10-17 18:44:26 +02:00
Simon Sapin
b0f694d5b0 CSS: Use libutil’s traits in Selector matching to not depend on libscript. 2013-10-16 20:20:29 +01:00
Simon Sapin
6d808fbdd0 Move AbastractNode::is_element to the TreeNodeRef trait. 2013-10-16 19:22:44 +01:00
Simon Sapin
6c41be9c13 Add a with_imm_element_like() method.
… gives a generic element from a generic node.
2013-10-16 18:44:41 +01:00
Ms2ger
60b6d1bb57 Issue #1071 - Ensure that Documents always have a non-null Window. 2013-10-16 10:15:09 +02:00
Tim Taubert
189bb6c95f Remove View type parameter from DocumentType 2013-10-14 17:32:38 -07:00
bors-servo
8d3c7a2ded auto merge of #1051 : Ms2ger/servo/private-root, r=jdm
In preparation for removing it as part of making Document a Node.
2013-10-14 10:22:00 -07:00
bors-servo
90baad3fff auto merge of #983 : saneyuki/servo/getid, r=jdm
This has not implemented these features yet:
* Update hashmap which is used for `getElementById()` when updating element attributes.
* Keep node order in tree.

However, this has the quality of that we can use this method for testcases.
2013-10-14 10:01:10 -07:00
bors-servo
5d00b52055 auto merge of #1050 : Ms2ger/servo/get_cx, r=jdm 2013-10-14 09:37:14 -07:00
Tetsuharu OHZEKI
db3b5c3c4c Basic Implementation of document.getElementById(), #740 2013-10-15 00:21:13 +09:00
Tetsuharu OHZEKI
f9be872e61 Pass AbstractNode to Node<ScriptView>.add_to_doc(). 2013-10-14 23:01:03 +09:00
Ms2ger
b6b2606c96 Make Document::root private, in preparation for removing it as part of making Document a Node. 2013-10-13 14:08:37 +02:00
Ms2ger
da2cf6cbd7 Implement Window::get_cx() to reduce code repetition. 2013-10-13 12:06:32 +02:00
Ms2ger
438d121cd8 Implement DocumentFragment. 2013-10-12 15:14:09 +02:00
Tim Taubert
9fe9145be4 implement NodeList and consolidate common scope and context retrieval 2013-10-11 07:34:38 -07:00
Ms2ger
cfc9f4956a Reindent some match expressions. 2013-10-10 23:05:30 +02:00
Ms2ger
a5233f2bc4 Support Node.nodeType and Node.nodeValue. 2013-10-10 22:09:34 +02:00
Bobby Holley
c4bbc4cd37 Introduce mutable/immutable variants of reflector() with named lifetimes, and kill unsafe casts. 2013-10-10 13:11:24 +02:00
Ms2ger
40106841f8 Address review comment and add fixmes. 2013-10-10 10:57:38 +02:00
Ms2ger
04319fdb68 Issue #888 - Node's owner document should never be None. 2013-10-10 10:57:38 +02:00
Bobby Holley
5ed8b9e83f Rename |wrapper| to |reflector_| in Reflectable implementations for DOM objects. 2013-10-09 12:21:38 +02:00
Bobby Holley
62ddac8b6f Rename get_wrappercache() to reflector(). v1
I also updated some variable names in the codegen.
2013-10-09 12:11:25 +02:00
Bobby Holley
2cbe2d7ce9 Rename WrapperCache to Reflector.
I think the abstraction from the raw JSObject is still probably worthwhile for
now.
2013-10-09 12:07:41 +02:00
Bobby Holley
0a0599ad9b Rename CacheableWrapper to Reflectable. 2013-10-09 12:03:18 +02:00
Ms2ger
388f685549 Cleanup some code. 2013-10-07 16:30:34 +02:00
Luis de Bethencourt
2dbd065d91 Rename the element field of the DOM Node hierarchy
Renamed htmlelement, and element

Fixes #924
2013-09-19 19:39:38 -04:00
Keegan McAllister
73c1a12f30 bindings: Return errors in Result rather than setting an out parameter
Fixes #909.
2013-09-18 18:07:37 -07:00
Keegan McAllister
4b0680a136 Replace our rust_box with std::unstable::raw::Box
This will keep us in sync with compiler changes.  In fact we had the 'prev' and
'next' fields in the wrong order (but we aren't using them).
2013-09-18 14:57:12 -07:00
Keegan McAllister
68ddc6b4ab Make DOMString an alias for Option<~str>
Fixes #898.
2013-09-18 14:46:42 -07:00
Josh Matthews
d465abdb1c Make all DOM manipulation wait until it's safe to do so (ie. all reflows for the page have completed). Fix a race where a newly-initiated reflow would be considered complete when receiving the completion notice for the previous reflow. 2013-09-16 23:41:34 -04:00
Josh Matthews
37787d55d0 Pass the AbstractNode into the Node.textContent setter. 2013-09-16 23:39:16 -04:00
Ms2ger
bea1c4f01e Issue #852 - Implement the Node.textContent setter. 2013-09-14 11:30:22 -07:00
Josh Matthews
4ec428b9d6 Trigger a reflow when nodes are appended and removed from the document. Fixes #907. 2013-09-12 10:17:00 -07:00
Ilyong Cho
0d4cfd0eb9 Add node.appendChild 2013-09-10 12:39:58 +09:00
Ilyong Cho
bcd7c0b8c6 Add node.removeChild 2013-09-10 11:35:31 +09:00