Commit graph

5232 commits

Author SHA1 Message Date
Ms2ger
08fce9a321 Use handleOptional for dictionary conversion.
This does not have any effect, as isOptional is always False for dictionaries.
This change is made only for consistency.
2014-04-28 10:38:44 +02:00
bors-servo
9f742a9462 auto merge of #2237 : Ms2ger/servo/union-fromjsvalconvertible, r=jdm
With bonus codegen tests.
2014-04-28 04:01:36 -04:00
bors-servo
493aa2cdf3 auto merge of #2238 : mozilla/servo/rustup_20140410c, r=Ms2ger
r? @metajack 

Note that all pending submodule PRs must be landed before this should be given r+.
2014-04-27 18:52:39 -04:00
Lars Bergstrom
948daf2422 This batch of changes upgrades Servo to work with the Rust upgrade as of
April 10, 2014. The main changes are to privacy, to work around the
issues with incorrect bounds on the libstd `Arc<Mutex<T>>`, and the
various API changes strewn throughout the libraries.
2014-04-27 15:46:12 -05:00
Ms2ger
54d2e8e235 Use handleOptional for interface conversion. 2014-04-27 20:55:21 +02:00
Ms2ger
7c3480de60 Move optional/nullable handling out of CastableObjectUnwrapper.
This puts the code that wraps the type in Option<> and the code that wraps
the expression in Some() into the same if block, which should clarify the
code.
2014-04-27 19:44:09 +02:00
Ms2ger
89d4fac36e Use handleOptional for the enumeration conversion. 2014-04-26 18:32:45 +02:00
Ms2ger
13e26e0fe0 Use handleOptional for the DOMString conversion. 2014-04-26 17:29:30 +02:00
Ms2ger
b73a87e955 Use handleOptional for the union conversion.
Note that unions didn't handle optional arguments correctly before.
2014-04-26 17:22:07 +02:00
Ms2ger
1e2be02eb8 Use handleOptional for the 'any' conversion. 2014-04-26 17:15:28 +02:00
Ms2ger
b264c65f2e Implement a cleaner way of dealing with optional arguments in codegen and use it for primitive types.
This puts the Some constructor outside the match, making the actual
generating code independent of the optionality of the argument.
2014-04-26 17:10:59 +02:00
Ms2ger
35f6a24de7 Use FromJSValConvertible's nullable conversion code. 2014-04-26 16:42:39 +02:00
Ms2ger
9cc5460dd6 Implement FromJSValConvertible for union types. 2014-04-26 16:42:39 +02:00
Ms2ger
adcc7e694f Increase codegen test coverage. 2014-04-26 16:41:09 +02:00
Philip Horger
6312ff38dc #2183 Initialize Event::bubbles to false 2014-04-25 14:48:48 -07:00
bors-servo
4942cc76bd auto merge of #2231 : Ms2ger/servo/remove-holderType, r=jdm
It is always None.
2014-04-25 10:28:13 -04:00
Ms2ger
06df422718 Remove the holderType return value of getJSToNativeConversionTemplate.
It is always None.
2014-04-25 16:24:21 +02:00
bors-servo
691d82a92f auto merge of #2228 : Ms2ger/servo/object-unwrapping-expressionify, r=jdm 2014-04-25 09:19:14 -04:00
bors-servo
27798980bf auto merge of #2229 : Ms2ger/servo/getUnionAccessorSignatureType, r=jdm 2014-04-25 08:52:18 -04:00
Ms2ger
ee23074232 Remove unused function getUnionAccessorSignatureType. 2014-04-25 11:59:03 +02:00
Ms2ger
1d51e7d227 Rewrite dictionary codegen to initialize members directly into the struct. 2014-04-25 11:51:47 +02:00
Ms2ger
66c89f27aa Remove the 'retval' local variable from union TryConvertTo methods. 2014-04-25 11:33:18 +02:00
Ms2ger
05d0ba783f Move responsibility for assigning to ${declName} out of getJSToNativeConversionTemplate.
This commit does not make any change to the generated code.
2014-04-25 11:31:40 +02:00
Ms2ger
c5bf011d1e Rewrite the enumeration unwrapping to return an expression. 2014-04-25 10:55:16 +02:00
Ms2ger
2b9d1d6bc1 Rewrite the primitive unwrapping to return an expression. 2014-04-25 10:47:00 +02:00
Ms2ger
643ea874d1 Rewrite the any unwrapping to return an expression. 2014-04-25 10:47:00 +02:00
Ms2ger
1027801b04 Rewrite the DOMString unwrapping to return an expression. 2014-04-25 10:46:58 +02:00
Ms2ger
4905b22673 Rewrite the union unwrapping to return an expression. 2014-04-25 09:58:49 +02:00
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
bors-servo
c1f0d70883 auto merge of #2216 : jgraham/servo/extra_args_wptrunner, r=jack 2014-04-24 17:49:12 -04:00
bors-servo
2abd46a7b3 auto merge of #2225 : Ms2ger/servo/any-dictionary, r=jdm 2014-04-24 17:22:16 -04:00
James Graham
12d2539684 Pass extra args through to wptrunner 2014-04-24 21:38:55 +01:00
bors-servo
a7494f7ce4 auto merge of #2224 : mbrubeck/servo/hidpi, r=metajack
On high-density (e.g. "Retina") displays, this will set the default scale to 1 px per screen coordinate, rather than the current 1px per hardware pixel. This means that content on high-density displays will be rendered at a higher resolution but about the same physical size, compared to lower-density displays.
2014-04-24 16:31:29 -04: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
Matt Brubeck
c036f1721b Set default scale based on dpi 2014-04-24 11:44:25 -07:00
bors-servo
b193767350 auto merge of #2221 : hazz/servo/normalize, r=jdm
Fixes #2170 by recursively calling `normalize()` on all children that aren't text nodes.
2014-04-24 12:58:16 -04: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
6c987c31b5 Add Page::get_nodes_under_mouse(). 2014-04-24 14:37:04 +09:00
Tetsuharu OHZEKI
fff94a35b3 Add Page::hit_test(). 2014-04-24 14:37:04 +09: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
bors-servo
cc33a721ab auto merge of #2200 : jdm/servo/loadfail, r=mbrubeck
...k-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:10:12 -04: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
7326df044c auto merge of #2203 : mbrubeck/servo/back-crash, r=jdm
This fixes two `RefCell<T> is already borrowed` failures when reloading an
existing pipeline, both caused by functions trying to modify `Pipeline::url`
or `ScriptTask::url` while a reference to a previous borrow is still in scope.

Note: After applying this patch, there are some painting issues after navigating back.
2014-04-23 14:10:21 -04:00