Commit graph

499 commits

Author SHA1 Message Date
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
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
bors-servo
c5d81f13c1 auto merge of #1388 : hyunjunekim/servo/cssissues, r=kmcallister
Fixed this issue ( https://github.com/mozilla/rust/issues/10683 )
2013-12-13 15:40:13 -08:00
Patrick Walton
971f77d2c6 layout: Stop going to the DOM for iframe sizes 2013-12-13 15:10:04 -08:00
Patrick Walton
21e8c72a75 constellation: Stop using futures for frame sizes.
This will allow us to stop going to the DOM in order to handle iframe
sizing. Instead we can just store the pipeline and frame IDs of iframes
inside the flow tree itself.
2013-12-13 10:43:27 -08:00
Keegan McAllister
0238410b47 Allow setting id, class, style without a full reflow
Instead we do selector matching again, then diff the style structs to set the
"restyle damage" bits which are used to prune reflow traversals.

Also don't force a reflow when timers finish, because individual DOM methods
should already take care of that.
2013-12-12 14:43:26 -08:00
Keegan McAllister
93e10eaf20 Call Element::after_set_attr only for null namespace 2013-12-12 14:43:26 -08:00
Keegan McAllister
39fc9eb868 Get rid of reflow_all
This refactoring should not alter behavior.
2013-12-12 14:43:26 -08:00
Ms2ger
7f4283f4bc Rename some 'new' functions to 'new_inherited'. 2013-12-12 14:34:58 +01:00
HyunJune Kim
cf537469b1 add FIX comments 2013-12-12 14:40:02 +09:00
HyunJune Kim
a7865495f6 Fixed this issue (https://github.com/mozilla/rust/issues/10683) 2013-12-12 13:14:37 +09:00
Patrick Walton
fc80be982a Merge pull request #1368 from SimonSapin/master
Fix #1264: support namespaced attribute selectors.
2013-12-11 09:16:47 -08:00
patrick kim
0026eb0899 remove @ in LayoutTask.FontContext 2013-12-11 11:42:14 +09:00
Simon Sapin
b290823f4d Fix #1264: support namespaced attribute selectors. 2013-12-10 17:53:12 +00: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
Simon Sapin
61c7f2f220 Change Namespace::to_str() to not allocate and return a reference. 2013-12-09 15:10:09 +00:00
Daniel Glazman
28575c20bf add namespaces to elements 2013-12-09 15:55:51 +01:00
Ryan Choi
ecd44fe9a8 removing unnecessary to_owned 2013-12-06 17:50:26 +09:00
Ms2ger
29a7405b4e Report exceptions to JS when the DOM implementation fails.
As a bonus, adds some debugging statements.
2013-12-05 16:14:02 +01: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
Keegan McAllister
5157eac238 Warning police
And fix some formatting.
2013-11-25 13:29:34 -08:00
bors-servo
f6646e17bf auto merge of #1270 : evilpie/servo/url, r=jdm
I wasn't sure how to store @window in Location, so I just made it use @Page for now. I was going to implement stringifier, but sadly some of the webidl stuff is like 1 year out of sync.
2013-11-24 15:52:04 -08:00
Tom Schuster
f9433e357c trace window.location and window.navigator 2013-11-24 23:11:11 +01:00
Tom Schuster
ccc7fa7be0 basic location 2013-11-24 22:40:24 +01:00
Tom Schuster
73e67568c1 Add FormData constructor 2013-11-24 22:37:28 +01:00
Tetsuharu OHZEKI
4e4eb10ffc Use 'DOMString' to define the type insteand of '~str'.
At now, 'DOMString' is equal to '~str'.
155befe10d/src/components/script/dom/bindings/utils.rs (L119)
2013-11-23 22:24:52 +09:00
Tetsuharu OHZEKI
aa72c413ed Enable to update id attribute for Document.getElementById(). (#740) 2013-11-23 11:53:45 +09:00
Tetsuharu OHZEKI
072ff20140 Use 'match' instead of 'if'. 2013-11-23 11:53:45 +09:00