Commit graph

1046 commits

Author SHA1 Message Date
bors-servo
48b1938ca3 auto merge of #2394 : Ms2ger/servo/instantiateJSToNativeConversionTemplate, r=jdm
This moves all the handling of optional arguments into `CGArgumentConverter`, and leaves `instantiateJSToNativeConversionTemplate` to only deal with the declaration of stack variables.
2014-05-14 00:25:17 -04:00
Ms2ger
cb9d875aef Handle all attributes coming from the HTML parser (fixes #1976). 2014-05-13 12:28:15 +02:00
bors-servo
fbcfe78bf6 auto merge of #2388 : zwarich/servo/cssom, r=jdm
Implementing the CSSOM requires giving the script task access to the
computed style for a node. Moving it into a new SharedLayoutData struct
member of LayoutDataRef seems to be the best way to achieve this.

This is the first step towards #1721.
2014-05-12 16:46:10 -04:00
Ms2ger
d095c42eaf Move the loading of documents in iframes into HTMLIFrameElement.
Right now, the load is kicked off inside the parser glue. This is unfortunate
for several reasons:

1) we'd like to replace the current parser (libhubbub) by our own parser,
   written in Rust, so code intertwined with the parser will have to be
   rewritten;
2) it is impossible to support dynamically (i.e. from script) created iframes
   in this way;
3) the code flow around loading subdocuments is complicated needlessly.

This commit adds the constellation channel (on which the message to actually
load the document is sent) as a field on the Page, to allow HTMLIFrameElement
to access it.

In rewriting the code, support for dynamically created iframes is added, and
a task failure is avoided when the value of the src attribute can not be
parsed.
2014-05-12 21:21:03 +02:00
Ms2ger
ab5bf80447 Drop the pointless indirection in Window::active_timers. 2014-05-12 17:15:35 +02:00
Ms2ger
8e9e930e3d Remove unused and misnamed url field on HTMLIFrameElement. 2014-05-11 20:37:55 +02:00
Ms2ger
30fcf7ed61 Remove the isOptional argument and the dealWithOptional return value from getJSToNativeConversionTemplate.
Note that dictionaries currently don't support members without default values
right now.

This commit does not change the generated code.
2014-05-10 11:00:01 +02:00
Ms2ger
6ed924f515 Remove the argcAndIndex argument from instantiateJSToNativeConversionTemplate.
This commit does not change the generated code.
2014-05-10 10:50:10 +02:00
bors-servo
5334d8bb25 auto merge of #2384 : saneyuki/servo/2383, r=Ms2ger
Fix #2383

These changes introduce `FooEvent::new_uninitialized()` constructor. This constructor use to create `FooEvent` without calling `FooEvent::InitFooEvent`.

#2383 says integrating `FooEvent::new()` and `InitFooEvent`, but we need to preserve simple `FooEvent::new_uninitialized()` for `document.createEvent()`.

@jdm r?
2014-05-10 03:01:13 -04:00
Tetsuharu OHZEKI
5f8f551c95 Add MouseEvent::new_uninitialized(). 2014-05-10 13:56:46 +09:00
Tetsuharu OHZEKI
ac288f6657 Add UIEvent::new_uninitialized(). 2014-05-10 13:55:19 +09:00
Guro Bokum
04c807dd53 Convert as many of Page's RefCell fields to Cell as possible (fixes #1990). 2014-05-09 23:52:06 +02:00
Cameron Zwarich
0e67202bc2 Move the computed style to a new SharedLayoutData struct.
Implementing the CSSOM requires giving the script task access to the
computed style for a node. Moving it into a new SharedLayoutData struct
member of LayoutDataRef seems to be the best way to achieve this.

This is the first step towards #1721.
2014-05-09 13:22:50 -07:00
bors-servo
1477652295 auto merge of #2357 : Manishearth/servo/xhr-syncget, r=ms2ger
This gets a basic synchronous GET request working. I've also tried to implement a portion of the procedures mentioned in the spec.


Blocks #2282
2014-05-09 11:34:07 -04:00
Manish Goregaokar
b40d8b4d53 Basic synchronous GET with XHR 2014-05-09 20:39:54 +05:30
Ms2ger
30055d9820 Move debug functions to Window IDL.
This is a cleaner way to expose those functions, and makes it possible to
remove a significant amount code in rust-mozjs.

The assert() function is no longer exposed, as it was unused and not very
useful.
2014-05-09 14:44:07 +02:00
bors-servo
78a768ae5c auto merge of #2372 : mrobinson/servo/issue-1596, r=metajack
The performance of using == should now equal that of match, so many
identity methods can be simplified to a single line.

Fixes #1596.
2014-05-08 20:16:21 -04:00
Martin Robinson
300004f3e9 Use == instead of match for tests against a single enum value
The performance of using == should now equal that of match, so many
identity methods can be simplified to a single line.

Fixes #1596.
2014-05-08 17:11:00 -07:00
bors-servo
a28665d3fd auto merge of #2375 : zwarich/servo/progressevent-rename, r=metajack 2014-05-08 19:40:16 -04:00
Cameron Zwarich
d56a308524 Rename an unused parameter to silence a warning. 2014-05-08 16:31:14 -07:00
Cameron Zwarich
20fa4d7e11 Remove an unused field from CodegenRust.py.
The defaultVisibility field was cloned from the C++ implementation,
where it tracks the difference between struct and class visibility.
Since no similar concept exists in Rust, it should be removed.
2014-05-08 13:59:53 -07:00
Manish Goregaokar
2f376a1104 Add ProgressEvent interface 2014-05-08 20:41:51 +05:30
bors-servo
86a6de209e auto merge of #2346 : gsingh93/servo/master, r=jdm 2014-05-07 18:58:18 -04:00
Gulshan Singh
fb0c433b70 Add Performance object to Window and implement Performance::Now() 2014-05-07 17:30:33 -04:00
Ms2ger
0ab3444af9 Add support for DOMString in unions (fixes #2324). 2014-05-07 17:30:32 -04:00
Ms2ger
87008a5ae1 Remove unused zip_copies. 2014-05-07 12:29:26 +02:00
Ms2ger
479c927a39 Use Vec in GetClientRects. 2014-05-07 12:27:14 +02:00
Glenn Watson
51ef2f06ba Rename from_unrooted to from_temporary. Fixes #2332. 2014-05-07 09:25:32 +10:00
bors-servo
8d1b9db5aa auto merge of #2343 : Ms2ger/servo/String-union, r=jdm 2014-05-06 10:25:23 -04:00
bors-servo
d66197ae40 auto merge of #2331 : Ms2ger/servo/global-cx-3, r=jdm
The long-term plan for SpiderMonkey is to eliminate JSContexts by merging
(most of) it into JSRuntime, so to future-proof our code, we should avoid
creating multiple JSContexts for the same JSRuntime.

However, this implies we'll have to use the same JSContext for objects in
different compartments, so we need to enter compartments. This is done by
using the with_compartment function.
2014-05-06 09:58:33 -04:00
Ms2ger
590a8ac824 Add support for DOMString in unions (fixes #2324). 2014-05-06 15:51:17 +02:00
Ms2ger
8ea3cbf18a Enter a compartment when calling callbacks. 2014-05-06 12:16:03 +02:00
bors-servo
b14b2eca37 auto merge of #2325 : Ms2ger/servo/testbinding-default, r=jdm 2014-05-05 15:58:10 -04:00
Harry Maclean
6f310a5c20 Implement ChildNode.remove() 2014-05-05 14:04:25 -04:00
Ms2ger
0016b1839e Use a single JSContext per JSRuntime.
The long-term plan for SpiderMonkey is to eliminate JSContexts by merging
(most of) it into JSRuntime, so to future-proof our code, we should avoid
creating multiple JSContexts for the same JSRuntime.

However, this implies we'll have to use the same JSContext for objects in
different compartments, so we need to enter compartments. This is done by
using the with_compartment function.
2014-05-05 19:41:02 +02:00
bors-servo
f642d5951a auto merge of #2299 : Ms2ger/servo/getJSToNativeConversionTemplate-cleanup, r=jdm 2014-05-05 09:43:18 -04:00
Ms2ger
6cab06fee6 Use default methods to reduce code duplication for TestBinding. 2014-05-05 15:39:28 +02:00
Manish Goregaokar
1008a536a7 Fix some unused_mut/unused_result warnings 2014-05-05 15:43:29 +05:30
Ms2ger
262dc30c18 Assign into the argument binding directly in instantiateJSToNativeConversionTemplate. 2014-05-05 11:36:52 +02:00
Ms2ger
aed95dfd94 Move the assignment outside the if when dealing with optional arguments. 2014-05-05 11:36:52 +02:00
Ms2ger
d14efebb5c Move the assignment of 'None' in the no-argument-passed case into an else branch.
This is the only case where we assign into an argument local twice, so removing
it will allow us to make that binding immutable.
2014-05-05 11:36:52 +02:00
Ms2ger
cb2723c4ed Remove getJSToNativeConversionTemplate's initialValue return value.
This commit does not change the generated code.
2014-05-05 11:36:49 +02:00
Ms2ger
455465f3c6 Move the handling of default values in getJSToNativeConversionTemplate into handleOptional.
This is a first step towards moving responsibility for default values into the
caller, which should improve their code (in particular for the dictionary
codegen.

This also introduces a Dictionary::empty function, whose implementation is a
hack. The implementation will be improved once its codegen has access to the
raw default values.

Besides dictionaries, this commit does not change the generated code.
2014-05-05 11:29:46 +02:00
Ms2ger
e53c768b9e Use CGIfWrapper in instantiateJSToNativeConversionTemplate. 2014-05-05 11:21:13 +02:00
Ms2ger
2db1ce72f0 Remove references to unused substitution variables in getJSToNativeConversionTemplate. 2014-05-05 11:21:13 +02:00
Glenn Watson
71f3f5894e Prevent unused result warning in codegen. Always expect success for now. 2014-05-05 11:04:05 +10:00
Ms2ger
0ff8610727 Reorder some comparisons to avoid allocating strings for them. 2014-05-04 10:17:06 +02:00
Ms2ger
25542e3f7e Replace most ~"string"s with "string".to_owned(). 2014-05-04 09:39:07 +02:00
Ms2ger
243814022e Replace all ~"" with "".to_owned(). 2014-05-03 22:17:45 +02:00
Josh Matthews
91278da9dd Address review comments. 2014-05-03 14:18:31 -04:00