Commit graph

110 commits

Author SHA1 Message Date
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
68f534c45a Use DOMString in a few more places in utils.rs. 2014-02-16 09:50:29 +01:00
Ms2ger
6cc8a4dfba Simplify string construction in InterfaceObjectToString. 2014-02-16 09:50:10 +01:00
Ms2ger
59184bf6e1 Move DOMString into servo_util. 2014-02-14 12:48:51 +01:00
Ms2ger
5765de12cd Remove unused Reflector::get_rootable. 2014-02-07 13:04:31 +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
Jack Moffitt
a7ef1cd35e Upgrade to latest Rust. 2014-01-12 19:45:45 -07: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
Tom Schuster
f9433e357c trace window.location and window.navigator 2013-11-24 23:11:11 +01: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
Tetsuharu OHZEKI
f5ef4365f4 Stop passing DOMStrings via borrowed pointer. (#1201) 2013-11-14 20:35:36 +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
James Graham
15b9d4d199 Initial support for Attr and namespaces. 2013-11-12 17:39:04 +09:00
Ms2ger
793d87f07d Rewrite jsval_to_str and introduce jsval_to_domstring. 2013-11-09 14:49:15 +01:00
Ms2ger
255864a843 Simplify InterfaceObjectToString. 2013-11-09 14:07:09 +01:00
Ms2ger
610d1649cd Introduce jsid_to_str to simplify jsval_to_str callers that have an id. 2013-11-09 14:05:53 +01:00
Ms2ger
80a6103f7d Remove Reflectable::GetParentObject. 2013-11-06 21:56:47 +01:00
Ms2ger
edd9c1d5eb Remove WrapNativeParent and nearby cleanup. 2013-11-06 21:56:36 +01:00
Ms2ger
ccd9306681 Remove DerivedWrapper. 2013-11-06 18:16:31 +01:00
Ms2ger
4074412107 Pass a Reflector to WrapNewBindingObject instead of a Reflectable, and rename it GetReflector. 2013-11-06 17:52:59 +01:00
Ms2ger
53731b62ae Remove Reflectable::wrap_object_shared. 2013-11-06 16:40:16 +01:00
Ms2ger
c693cb185c Stop calling wrap_object_shared in WrapNewBindingObject and WrapNativeParent. Fixes #1083. 2013-11-06 16:01:57 +01:00
Josh Matthews
88f5c2b133 Add basic event dispatch with bubbling, capturing, and propagation interruption. 2013-11-05 12:58:28 -05:00
Josh Matthews
bb97fd13f3 Add Event and EventTarget hierarchy via gross AbstractFoo mechanism. 2013-11-05 12:58:28 -05:00
Josh Matthews
7ecf5abbbd Generate code for handling callbacks. Implement add/removeEventListener and hacky dispatchEvent proof-of-concept. 2013-11-05 12:58:28 -05:00
Ms2ger
ad658ba4ec Remove node::create. 2013-11-03 10:57:41 +01:00
Keegan McAllister
30a9fb2f45 Factor out a helper for eagerly creating JS wrappers 2013-10-22 12:52:04 -07:00
Jack Moffitt
94202661c0 Update to latest Rust. 2013-10-21 17:38:34 -06:00
Ms2ger
321e0373fa Merge BindingObject and Reflectable. 2013-10-18 17:02:16 +02:00
Ms2ger
3da1a206d8 Remove DerivedWrapper::wrap_shared, as it's unused. 2013-10-18 15:56:35 +02:00
bors-servo
ebe1c1353c auto merge of #1077 : kmcallister/servo/jsstr, r=jdm
This doesn't resolve the big questions of how Servo will represent strings; it's just about doing the conversion correctly for our existing types.
2013-10-17 16:34:30 -07:00
Keegan McAllister
5f14ee617b Check for allocation failure in domstring_to_jsval 2013-10-17 12:59:05 -07:00
Ms2ger
f58c7874b2 Remove an unnecessary cast::transmute call. 2013-10-17 19:35:53 +02:00
Keegan McAllister
2c302a4627 Convert between JS and Rust strings in a way that handles Unicode
This doesn't handle invalid UTF-16 and may not be efficient.  It's just a small
change to make things better until we decide what we're doing about strings in
the long run.

Fixes #1068.
2013-10-16 16:18:12 -07:00
Ms2ger
98cdf5c118 Implement Document.createComment. 2013-10-11 12:40:35 +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
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
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
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
Huon Wilson
451519b6ff Use str.char_offset_iter instead of manually calling str.char_range_at. 2013-10-04 22:26:36 +10:00
Josh Matthews
bc81716c30 Make proxy finalizers retrieve the DOM object from the right slot. 2013-10-02 01:43:14 -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
Jack Moffitt
0695e09568 Make CreateElement comply with the spec. 2013-09-14 09:07:20 -06:00