Commit graph

311 commits

Author SHA1 Message Date
bors-servo
a3d3337aed auto merge of #1058 : Ms2ger/servo/get_cx-followup, r=jdm
These changes landed in parallel.
2013-10-14 15:30:55 -07:00
Simon Sapin
dc882b8ecf Move the content of 'script/style' into the new 'style' crate. 2013-10-14 21:44:24 +01:00
Ms2ger
b34432471e Use Window::get_cx() in DocumentFragment::Constructor. 2013-10-14 21:06:00 +02: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
f4edbb6b2e Remove some type variables and an explicit dereference. 2013-10-12 16:08:45 +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
bors-servo
bc3eeb6f1c auto merge of #1036 : Ms2ger/servo/createComment, r=jdm 2013-10-11 03:53:14 -07:00
Ms2ger
98cdf5c118 Implement Document.createComment. 2013-10-11 12:40:35 +02:00
Keegan McAllister
f73e48b32f Extract content type and character set from HTTP response headers
We don't use this information anywhere, yet.
2013-10-10 18:18:39 -07:00
Keegan McAllister
48af4e53a9 Refactor resource loader protocol to send metadata first 2013-10-10 18:18:39 -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
Bobby Holley
e6be738d97 Fix infinite-looping reflector() implementation for WindowProxy. 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
bors-servo
59d2d345c8 auto merge of #1013 : huonw/servo/text-iter, r=pcwalton
And 3 other minor clean-ups: removing a redundant `if`, a redundant function call, and using `slice_from` where it is possible.
2013-10-09 16:19:24 -07:00
Luis de Bethencourt
5801f948e3 Remove unused imports in htmlformelement 2013-10-09 16:33:04 -04:00
Bobby Holley
5ed8b9e83f Rename |wrapper| to |reflector_| in Reflectable implementations for DOM objects. 2013-10-09 12:21:38 +02:00
Bobby Holley
92e91c58da Rename the |wrapper| field in Reflector. 2013-10-09 12:18:17 +02:00
Bobby Holley
549ac6a29b Rename some local variables and shorten some lines.
This was done manually, and might benefit from a more careful review.
2013-10-09 12:15:56 +02:00
Bobby Holley
622aa76515 Rename WrappableDocument stuff. 2013-10-09 12:13:18 +02:00
Bobby Holley
6bf740d967 Rename {get,set}_wrapper to {get,set}_jsobject. v1 2013-10-09 12:13:18 +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
bors-servo
77f8dba48b auto merge of #1016 : Ms2ger/servo/ownerdoc, r=jdm 2013-10-08 05:16:01 -07:00
Ms2ger
388f685549 Cleanup some code. 2013-10-07 16:30:34 +02:00
Ms2ger
e43505d641 Remove Document::set_root.
All callers have an AbstractDocument, and this makes my life easier later.
2013-10-07 15:17:47 +02:00
Ms2ger
179582d939 Remove unnecessary mutability. 2013-10-06 09:15:38 +02:00
Ms2ger
17796725f4 Address review comments. 2013-10-06 09:02:12 +02:00
Ms2ger
c93d13b0da Don't require passing a root element to Document::new (needed for issue #888). 2013-10-05 21:42:13 +02:00
Huon Wilson
451519b6ff Use str.char_offset_iter instead of manually calling str.char_range_at. 2013-10-04 22:26:36 +10:00
bors-servo
d6d2534b56 auto merge of #1001 : SimonSapin/servo/newnewcss, r=kmcallister
Add selector matching, style structs, cascading. The matching is quite naive and has many low hanging fruits for optimization. No pseudo-class (except `:not()`) is implemented yet, but those are easy to add as needed.

Next step is to update the layout code to use this and drop netsurf-css.

(Most of the +7066 lines stat is for bootstrap.css, added as a test.)
2013-10-02 12:21:53 -07:00
Josh Matthews
bc81716c30 Make proxy finalizers retrieve the DOM object from the right slot. 2013-10-02 01:43:14 -04:00
Josh Matthews
92f6599854 Wait for any layout tasks to complete in a page tree before a handling a pipeline's exit message. 2013-10-02 01:43:08 -04:00
Simon Sapin
284770aa02 Selector matching: tweak variable naming, add comments. 2013-10-02 01:37:03 +01:00
Simon Sapin
02364d7db7 Sorting on specificity needs to be stable for correctness of the cascade. 2013-10-02 01:19:36 +01:00
Simon Sapin
a04e96b7c6 Fix missing license header. 2013-10-02 00:31:57 +01:00
Simon Sapin
20089e4bea New style sytsem: add selector matching
Also make scribt::dom::element::Element::get_attr ASCII case-insensitive
on attribute names, per spec:
http://dom.spec.whatwg.org/#dom-element-getattribute
2013-10-02 00:28:14 +01:00
Brian Anderson
38ea00074c Run script in its own thread to avoid starving other tasks 2013-10-01 15:43:45 -07:00
Josh Matthews
cb826f9920 Make proxy bindings generate trace and finalization hooks. 2013-09-30 22:14:27 -04:00
Simon Sapin
226ccf7e72 Merge commit '25d6448f28' 2013-09-30 19:21:27 +01:00