Commit graph

157 commits

Author SHA1 Message Date
Josh Matthews
625325434b Implement JSManaged for DOM objects. 2014-02-24 15:16:42 -05:00
Youngmin Yoo
13f9a66632 Impl Basic support for object element 2014-02-20 17:31:16 +09:00
bors-servo
edd7e32fdb auto merge of #1602 : pcwalton/servo/more-inlines, r=jdm
9% improvement in style recalc on the rainbow page.

r? @jdm
2014-02-18 14:08:12 -05:00
Ms2ger
6681476713 Use push_str instead of operator + for efficiency. 2014-02-16 10:25:12 +01:00
Adam Sinnett
ffcd3833de Change Text, Comment and ProcessingInstructions parent name from element to characterdata
All other node's parent type names reflect the actual type of the parent. This change extends that convention to the indicated nodes.

closes #1594
2014-02-15 13:52:33 -08:00
Ms2ger
59184bf6e1 Move DOMString into servo_util. 2014-02-14 12:48:51 +01:00
Bruno de Oliveira Abinader
b46de88a2b Added missing refs to DOM spec
This is a sub-task for #1655.
2014-02-10 11:40:43 -04:00
Bruno de Oliveira Abinader
4d4495b015 Implement Node.isEqualNode
Spec:
http://dom.spec.whatwg.org/#dom-node-isequalnode

Closes #1645.
2014-02-10 11:01:12 -04:00
HyunJune Kim
c8d503898a This is implement Hover Event. If over element, currently full reflow. after PR, will make partial reflow. 2014-02-10 11:16:07 +09:00
Bruno de Oliveira Abinader
99b3b144d4 Implement Node.contains
Spec:
http://dom.spec.whatwg.org/#dom-node-contains

Closes #1647.
2014-02-09 10:39:07 -04:00
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
Adrien Bustany
2254a9e923 script: Pass the correct parent node to pre_insert in insertBefore
Closes #1572.
2014-02-05 16:27:22 +01:00
Patrick Walton
a0fbc04ba5 script: Inline some hot functions used in flow constructions.
9% improvement in style recalc on the rainbow page.
2014-01-30 18:05:12 -08: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
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
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
James Graham
7aee1cae84 Implement innerHTML getter for HTML documents
XML case is not yet implemented.
2014-01-14 13:10:05 +00:00
Jack Moffitt
a7ef1cd35e Upgrade to latest Rust. 2014-01-12 19:45:45 -07:00
Shamir Khodzha
8bb1724c1e implemented iterator for child elements 2014-01-03 21:52:22 +04: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
9e2b63ddd3 layout: Move the LayoutNode wrapper from script into layout. 2013-12-17 18:07:41 -08:00
Patrick Walton
c506e52c7c layout: Add a lifetime to LayoutNode to prevent layout from stuffing
them into evil places.
2013-12-17 18:07:41 -08:00
Patrick Walton
ee9873bdb5 script: Harden layout a bit more by mostly prohibiting it from seeing
`AbstractNode` at all.

It can still see it by calling `with_element` for now, although that
needs to be fixed.
2013-12-17 18:07:12 -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
Bruno de Oliveira Abinader
cfb73ed123 Make Node::is_in_doc O(1)
Added a flags variable inside Node to represent boolean flags, with
is_in_doc being the first of them. It is updated whenever a node is
appended or removed from a parent.

This patch is for:
https://github.com/mozilla/servo/issues/1030
2013-12-17 16:32:43 -04:00
Ms2ger
7f4283f4bc Rename some 'new' functions to 'new_inherited'. 2013-12-12 14:34:58 +01:00
patrick kim
0026eb0899 remove @ in LayoutTask.FontContext 2013-12-11 11:42:14 +09:00
Patrick Walton
30bbaa49b7 Revert "auto merge of #1356 : ksh8281/servo/remove_@_in_LayoutTask.FontContext, r=pcwalton"
This reverts commit e8ffac13d7, reversing
changes made to db923feffe.

Reverting this change because FreeType is *not* thread safe. See the
documentation here:

http://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html

"In multi-threaded applications, make sure that the same FT_Library
object or any of its children doesn't get accessed in parallel."

We will need to use a `MutexArc` instead.
2013-12-09 19:40:08 -08:00
patrick kim
f187035e25 remove @ in LayoutTask.FontContext 2013-12-10 08:59:43 +09:00
bors-servo
529c21bb65 auto merge of #1252 : jdm/servo/layoutassert, r=jdm,metajack
...224.
2013-12-02 16:32:32 -08: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
june0cho
266b551aa4 Implement local bookmark(hashtag) for Acid2. With @joonwonlee
Support hashtag through link (e.g. <a href="#top">)
2013-12-01 00:36:11 +09:00
Daniel Glazman
9b691611ff Implement :root pseudo-class. Fix #1263, fix #1265 2013-11-20 16:41:12 +00:00
Patrick Walton
155befe10d Rewrite flow construction to be incrementalizable and parallelizable.
This replaces flow construction with a strict bottom-up tree traversal,
allowing for parallelism. Each step of the traversal creates a flow or
a `ConstructionItem`, similar to how Gecko works. {ib} splits are
handled by not creating `InlineFlow`s until the containing block is
reached.

This should be able to be incrementalized by storing the `Flow` from
layout to layout, and performing fixups during flow construction
and/or wiping containing blocks in a previous pass.
2013-11-18 11:24:11 -08: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
Tetsuharu OHZEKI
f5ef4365f4 Stop passing DOMStrings via borrowed pointer. (#1201) 2013-11-14 20:35:36 +09:00
bors-servo
4eb8449621 auto merge of #1208 : pcwalton/servo/any-layout-data, r=metajack
Breaks the dependency between `gfx` and `script`, which is nice.

This exposed some performance issues with Rust's `Any` type, which I've filed:

https://github.com/mozilla/rust/issues/10382
2013-11-13 00:07:16 -08:00
Ms2ger
df41a30814 Implement a missing step in the node 'insert' algorithm. 2013-11-12 19:24:22 +01:00
Ms2ger
9bcf5468e4 Rewrite replace_all. 2013-11-13 01:47:47 +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
Patrick Walton
6ff7b4a6a6 Use Any for the layout data.
Breaks the dependency between `gfx` and `script`, which is nice.
2013-11-08 22:45:40 -08:00