Commit graph

1070 commits

Author SHA1 Message Date
Ms2ger
a9ffff9215 Rewrite the interface unwrapping to return an expression. 2014-04-25 09:58:49 +02:00
bors-servo
0745d656a3 auto merge of #2227 : Ms2ger/servo/assign-outside-match, r=jdm 2014-04-24 18:13:13 -04:00
Ms2ger
de8f123b1d Assign to 'this' immediately in CGAbstractBindingMethod.
This makes the generated code a bit more rustic.
2014-04-24 23:57:28 +02:00
Ms2ger
a6a06e0ffc Inline CGAbstractBindingMethod.getThis.
There's no good reason to keep this separate; it's only called once, and
inlining the function makes the code a little clearer.

This commit does not make any change to the generated code.
2014-04-24 23:52:27 +02:00
Ms2ger
82afae123e Move responsability for the assignment out of CastableObjectUnwrapper.
This is a second step towards making getJSToNativeConversionTemplate return an
expression, which will improve dictionary codegen in particular.

This commit does not make any change to the generated code.
2014-04-24 23:50:21 +02:00
Ms2ger
ab1b429aef Move assignments outside match expressions in getJSToNativeConversionTemplate.
This is a first step towards making getJSToNativeConversionTemplate return an
expression, which will improve dictionary codegen in particular.
2014-04-24 22:21:23 +02:00
Ms2ger
90f4d256cf Add support for dictionaries containing 'any'. 2014-04-24 21:50:20 +02:00
Harry Maclean
9e1f63e147 Ensure Node.Normalize() acts on all descendants by recursively calling it on all non-text child nodes. 2014-04-24 17:41:30 +01:00
bors-servo
6d89e67194 auto merge of #2210 : saneyuki/servo/query, r=jdm
- see #356
- To decrease the conversion code, `JS<Node>` -> `Node`, I added API methods to `NodeHelpers`.
- I added APIs to `Page` not `Document` because I had thought that their APIs returns the hitted nodes address in the "page".
2014-04-24 09:52:11 -04:00
Tetsuharu OHZEKI
7d511f4baf Add NodeHelpers::get_content_boxes(). 2014-04-24 14:37:02 +09:00
Tetsuharu OHZEKI
dce92dc44a Add NodeHelpers::get_bounding_content_box(). 2014-04-24 14:36:43 +09:00
Josh Matthews
be2b983ec1 Make the I Tried star appear when a top-level page load fails for network-related reasons.
Under the hood, this requires treating the I Tried pipeline as a new load instead of a replacement, since the failure-handling code interacts poorly with the rest of the replacement code when we get a series of staggered failures over time from the various pipeline components.
2014-04-24 01:07:52 -04:00
bors-servo
3fc2c11910 auto merge of #2209 : lpy/servo/issue2188, r=Ms2ger
see #2188
2014-04-23 03:19:23 -04:00
lpy
dfe5215b88 Implement Element.localName.(fixes #2188) 2014-04-23 11:00:03 +08:00
bors-servo
b35d830999 auto merge of #2192 : evilpie/servo/children, r=Ms2ger
Fixes #2186
2014-04-22 16:52:17 -04:00
Tom Schuster
4c057deaf9 Implement ParentNode.children for Document and Element
Also implement it for DocumentFragment
2014-04-22 22:19:52 +02:00
bors-servo
bdcd8dd0c2 auto merge of #2111 : jdm/servo/browsercontext, r=Ms2ger 2014-04-22 11:01:18 -04:00
Josh Matthews
94dffca1e1 Remove all traces of WindowProxy. Implement basic browser context concept and outerizing of inner windows. 2014-04-22 10:57:25 -04:00
Tetsuharu OHZEKI
cdbe179acb Make Attr handles all setting value. 2014-04-22 16:15:15 +09:00
Tetsuharu OHZEKI
b2fa6fa221 Make Attr::SetValue to reflect attribute change. 2014-04-22 16:15:15 +09:00
Tetsuharu OHZEKI
a74397432e Make Attr::SetValue uses the internal setter. 2014-04-22 16:15:15 +09:00
bors-servo
3c175c7ac0 auto merge of #2195 : lpy/servo/issue2190, r=Ms2ger
see #2190
2014-04-21 16:49:28 -04:00
bors-servo
73a0658b8a auto merge of #2196 : hazz/servo/initevent, r=Ms2ger
Should fix #2189

This is my first PR for servo (and first time using Rust), so apologies if anything is horribly wrong.
2014-04-21 16:22:25 -04:00
bors-servo
f864d21212 auto merge of #2072 : brunoabinader/servo/domimpl-createdocument, r=Ms2ger
Spec:
http://dom.spec.whatwg.org/#dom-domimplementation-createdocument

Closes #1509.
2014-04-21 15:58:27 -04:00
bors-servo
c760577aee auto merge of #2199 : sankha93/servo/prefix-impl, r=Ms2ger
See #1737.

r? @ms2ger
2014-04-21 15:31:36 -04:00
Sankha Narayan Guria
36bf23de20 Implement Element.prefix (Fixes #1737) 2014-04-22 00:27:06 +05:30
Bruno de Oliveira Abinader
41898f0a76 Implement DOMImplementation::createDocument
Spec:
http://dom.spec.whatwg.org/#dom-domimplementation-createdocument

Closes #1509.
2014-04-21 09:30:36 -03:00
Ms2ger
4f9e119334 Remove JSPageInfo::js_compartment.
A js::rust::Compartment is little more than a glorified pointer to the
reflector of a window, so there's no good reason to use it. Instead, this
commit passes a JS<Window> directly when it's necessary.

This also means that we now have to use JS_DefineFunctions rather than
Compartment::define_functions; I believe the former is clearer to the reader
than the extra indirection involved in the latter calling through three
reopsitories.

This commit also simplifies ScriptTask::load to reuse the 'cx' local that is
in scope already, rather than refetching it through js_info.
2014-04-21 13:43:18 +02:00
Harry Maclean
7dbf69c223 set the right flags and attrs for InitEvent 2014-04-20 19:23:55 +01:00
lpy
fd9541357f Implement CharacterData.{deleteData, insertData, replaceData} 2014-04-21 00:53:16 +08:00
Ms2ger
a04d4e63eb Remove not-yet-implemented methods from CharacterData.
This speeds up a web-platform-tests run by about 45 seconds (of 11-12 minutes)
by avoiding three timeouts.
2014-04-19 17:39:13 +02:00
bors-servo
ba9177b7cc auto merge of #2178 : Ms2ger/servo/enum-position, r=jdm
This is a shorter and probably slightly more efficient to write the loop.
2014-04-19 11:01:15 -04:00
bors-servo
5c20ed3023 auto merge of #2179 : Manishearth/servo/refactor-canceled, r=Ms2ger
See #2177
2014-04-19 07:25:15 -04:00
Manish Goregaokar
a748e48f48 Rename Event::default_prevented -> Event::canceled to better match spec (#2177) 2014-04-19 16:02:14 +05:30
bors-servo
4331fad53d auto merge of #2175 : Manishearth/servo/domtests-createevent, r=Ms2ger
#2172

All subtests of `dom/events/Event-defaultPrevented.html` pass now.

CustomEvent has yet to be implemented.(#2173)
2014-04-19 06:22:07 -04:00
Ms2ger
48b8c066f9 Use position in FindEnumStringIndex.
This is a shorter and probably slightly more efficient to write the loop.
2014-04-19 12:20:50 +02:00
Manish Goregaokar
fa7bc7a686 Fix most defaultPrevented test failures (#2172) 2014-04-19 15:46:18 +05:30
Ms2ger
65ed97bab8 Introduce a get_dictionary_property function to reduce duplicated code in the dictionary conversion codegen.
This also explicitly disallows dictionary members without a default value, as
the code for those doesn't currently compile.

This is the second step of my planned rewrite of the dictionary initialization
that will remove the default values we currently use to initialize the
dictionary struct in the 'new' function.
2014-04-18 20:10:55 +02:00
Ms2ger
88c5e733b5 Merge the 'new' and 'Init' functions for dictionaries.
This moves the code in callers more in line with conversions for other types
and ensures the default values given to the dictionary fields (as defined by
the defaultValue function in CGDictionary.impl) do not escape the 'new'
method. The new code is also more in line with the code used by the
FromJSValConvertible trait.

This is the first step of my planned rewrite of the dictionary initialization
that will remove the default values entirely and reduce the code
duplication in the 'Init' (now 'new') function.
2014-04-18 17:12:20 +02:00
Ms2ger
8e596d142e Use 'exceptionCode' when converting to DOMString.
This change allows us to use the code even in cases where we return a
Result type rather than a JSBool. Interface, primitive and union types
already get this right.
2014-04-18 17:12:20 +02:00
bors-servo
58efe0bf75 auto merge of #2156 : Ms2ger/servo/codegen-deadcode, r=jdm 2014-04-18 10:28:11 -04:00
Ms2ger
857eb87bb6 Remove unused references to jsids in the generated code for dictionaries. 2014-04-18 15:52:40 +02:00
Ms2ger
9d7478ab8a Remove some dead code from codegen as found by pyflakes. 2014-04-18 15:52:40 +02:00
bors-servo
099815683d auto merge of #2155 : Ms2ger/servo/dictionary-codegen, r=jdm 2014-04-18 09:40:11 -04:00
Ms2ger
5ac5ba2468 Support nullable strings in dictionaries.
We copy the string in all cases, so there's no need to handle the isMember
case differently.
2014-04-18 11:37:56 +02:00
Ms2ger
b31fdf12ef Add a few tests for dictionary codegen. 2014-04-18 11:30:16 +02:00
Ms2ger
4d20d1716d Implement support for default values for enumeration arguments. 2014-04-18 11:08:21 +02:00
Ms2ger
d53841b016 Handle exceptions from FindEnumStringIndex correctly.
The previous code would return success from the JSNative with a pending
exception, potentially leading to assertion failures inside the JS engine
later.
2014-04-18 10:18:24 +02:00
Ms2ger
baa3845362 Rewrite FindEnumStringIndex to distinguish 'value not found' and 'exception raised'.
This is in preparation for handling those cases differently.
2014-04-18 10:18:17 +02:00
Ms2ger
fa653a5984 Introduce some (commented-out) tests for enumeration codegen. 2014-04-18 10:18:11 +02:00