Commit graph

1070 commits

Author SHA1 Message Date
Josh Matthews
742f73ded5 Add transparent Traceable and Untraceable types to aid proper rooting practices, and replace ad-hoc Untraceable structs with empty Encodable implementations. 2014-04-17 17:41:09 -04:00
bors-servo
7441dae1af auto merge of #2129 : lpy/servo/issue2116, r=jdm
see #2116
I add an `is_interval` field, so that when the `TimerData` is passed by `SetInterval`, we will not delete it from `active_timers`.
Also I think maybe we can extract the code in `ClearTimeout` and `ClearInterval` into another method to avoid duplicate.
2014-04-17 13:34:09 -04:00
lpy
b7dcf62ed0 Implement Window.set/clearInterval.(fixes #2116) 2014-04-18 01:30:39 +08:00
Ms2ger
c9c96d4758 Ensure that optional primitive arguments aren't treated as nullable.
By forgetting the Some(), we caused type inference to convert to Option<T>
for optional non-nullable primitive arguments, and to Option<Option<T>> for
optional nullable primitive arguments (essentially the same thing). This
change brings the primitive codegen in line with the DOMString codegen.

Using distinct types for optionality and nullability would have prevented
this issue.
2014-04-17 16:23:09 +02:00
Ms2ger
f77b775e62 Remove unwrap_object.
There is no good reason to have both unwrap_object and unwrap_jsmanaged.
Removing unwrap_object simplifies the codegen and makes further
simplifications easier.
2014-04-16 11:54:46 +02:00
bors-servo
7149a25e91 auto merge of #2112 : Ms2ger/servo/IDLInterface-JS, r=jdm 2014-04-16 04:22:11 -04:00
Ms2ger
ac46cc6047 Implement FromJSValConvertible for JS<T>. 2014-04-15 21:33:18 +02:00
bors-servo
038730c4bb auto merge of #2054 : sankha93/servo/imageattr, r=jdm 2014-04-15 12:49:14 -04:00
bors-servo
e4f33eb9b9 auto merge of #2114 : Ms2ger/servo/unused-obj-local-arg, r=jdm
This removes the local variable and prefixes the argument with an underscore.
Neither is used right now.
2014-04-15 12:22:44 -04:00
Ms2ger
e4305fe20e Remove unused variable 'obj' from binding functions.
This removes the local variable and prefixes the argument with an underscore.
Neither is used right now.
2014-04-15 17:37:54 +02:00
Ms2ger
dc11464933 Remove the return value from DefineDOMInterface.
This moves the assertion from its only caller into the function itself, to
clarify that we don't intent to deal with any failure here.
2014-04-15 17:32:10 +02:00
Matt Brubeck
28a013cfc5 Move child_inserted into VirtualMethods.
Follow-up from #1984.
2014-04-14 13:39:11 -07:00
Matt Brubeck
8c794c6739 Move inline stylesheet parsing out of HTML parser.
Instead, use shared code to parse stylesheet content when it is inserted,
whether during parsing or dynamically by script.

Based on work by sanools in #1350.
2014-04-14 11:14:07 -07:00
bors-servo
b174a6439b auto merge of #2094 : Manishearth/servo/id-efficiency, r=Ms2ger
This improves the code written for #1822 to use a single linear traversal.

The current code uses a binary search with `CompareDocumentPosition()` for comparing element position, however this method internally calls `traverse_preorder()` (i.e. a linear traversal) so calling this on every pass is quite inefficient.
2014-04-11 17:04:09 -04:00
bors-servo
9d2a6b7824 auto merge of #2087 : Ms2ger/servo/vtable2, r=jdm
Fixes #1527. Does *not* include the code for #1528.

(Originally by @jdm in #1688 and #1866.)
2014-04-11 16:31:14 -04:00
Manish Goregaokar
9f617e9f0c Make register_named_element more efficient 2014-04-11 14:39:23 +05:30
bors-servo
0c4354a439 auto merge of #2093 : Ms2ger/servo/DOMObjectPointerType, r=jdm 2014-04-10 15:16:17 -04:00
Ms2ger
493227c938 Remove DOMObjectPointerType. 2014-04-10 20:19:32 +02:00
Ms2ger
d11316fa05 Make GetCallableProperty more rustic. 2014-04-10 19:21:17 +02:00
bors-servo
986664f527 auto merge of #2088 : Ms2ger/servo/global-ToJSValConvertible, r=jdm 2014-04-10 12:43:23 -04:00
Ms2ger
6c32a7f05f Remove getWrapTemplateForType and simplify wrapForType. 2014-04-10 13:08:54 +02:00
Ms2ger
8c4a3aa387 Use ToJSValConvertible for all conversions to JSVal. 2014-04-10 12:09:18 +02:00
Ms2ger
a3d13c35a2 Remove the IElement trait. 2014-04-10 10:27:32 +02:00
Josh Matthews
6388dec996 Add overridable tree binding/unbinding behaviour. 2014-04-10 10:27:32 +02:00
Josh Matthews
f5d1907195 Integrate Element's after_set/remove behaviour into the virtual method hierarchy. 2014-04-10 10:27:32 +02:00
Josh Matthews
ca6cfb5bca Add support for trait-based virtual methods on Nodes, and use it for before_remove_attr and after_set_attr. 2014-04-10 10:27:28 +02:00
Ms2ger
0dfbfa0b07 Fix HTMLElementDerived::is_htmlelement to take non-HTML elements into account. 2014-04-10 10:06:14 +02:00
Ms2ger
ea2560ef20 Rename before_remove_attr and after_set_attr to allow reusing those names in the next commit. 2014-04-09 23:55:45 +02:00
bors-servo
d7f450dbd7 auto merge of #2045 : Manishearth/servo/pub-struct-2044, r=SimonSapin
See #2044
2014-04-09 10:40:26 -04:00
bors-servo
b9a7949ce4 auto merge of #2067 : saneyuki/servo/id, r=Ms2ger
Follow up #1917
(Derived from #2066)
2014-04-08 14:55:01 -04:00
Tetsuharu OHZEKI
25e6366efc Remove the needless comment for document.getElementById. 2014-04-09 03:20:47 +09:00
Ms2ger
ed18e4c948 Merge Attr::new_ns and Attr::new. 2014-04-08 20:17:15 +02:00
Ms2ger
d665ad5a17 Reimplement SetAttributeNS. 2014-04-08 20:17:15 +02:00
Ms2ger
bf73a47ce0 Reimplement SetAttribute. 2014-04-08 20:17:15 +02:00
Ms2ger
883d67882a Move SetAttributeNS onto JS<Element>. 2014-04-08 20:16:55 +02:00
Ms2ger
b19165e9e1 Move SetAttribute onto JS<Element>. 2014-04-08 20:16:55 +02:00
Ms2ger
3347c3ef80 Split out a do_set_attribute method. 2014-04-08 20:16:55 +02:00
bors-servo
6b1799caa3 auto merge of #2063 : lpy/servo/issue2059, r=Ms2ger
see #2059
2014-04-08 11:37:09 -04:00
bors-servo
aa36ae62cd auto merge of #2058 : jdm/servo/rmcrust, r=Ms2ger 2014-04-08 11:13:12 -04:00
bors-servo
51ff762bc5 auto merge of #1917 : lpy/servo/issue1822, r=jdm
see #1822
2014-04-08 10:49:14 -04:00
Josh Matthews
b87d351fee Remove all traces of C wrappers for SpiderMonkey class stubs. 2014-04-08 10:15:12 -04:00
lpy
77941dc996 Move Node.namespaceURI to Element.(fixes #2059) 2014-04-08 22:13:28 +08:00
lpy
50aea70f98 Make sure getElementById always returns the first element with the given ID in tree order.(fixes #1822) 2014-04-08 12:21:58 +08:00
Sankha Narayan Guria
58e5feca9f HTMLImageElement attribute getters and setters 2014-04-08 08:44:38 +05:30
bors-servo
7541b57526 auto merge of #2051 : Ms2ger/servo/more-xray, r=jdm
On top of #2050
2014-04-07 13:01:16 -04:00
bors-servo
a65ff6089a auto merge of #2048 : Ms2ger/servo/set_uint_attribute, r=jdm 2014-04-07 12:34:18 -04:00
bors-servo
f9c9e62340 auto merge of #2053 : Ms2ger/servo/createElementNS, r=jdm
#1391 rebased
2014-04-07 11:43:22 -04:00
Ms2ger
4e34fcd264 Remove trailing whitespace. 2014-04-07 11:41:58 +02:00
Daniel Glazman
4b0da08573 Implement Document.createElementNS. 2014-04-07 10:20:10 +02:00
Ms2ger
2e2a39b8d5 Remove some more xray code. 2014-04-06 23:08:54 +02:00