This is a stab at #2401 - I think this was what @jdm had in mind for a fix.
I've also included a test. There's no "i tried" star, I'm too much of a newb for that, but hopefully the test at least confirms that servo doesn't crash on HTTPS requests.
...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.
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.
#2162 was a tad off, it moves the virtualenv to the object directory (x86_64-unknown-linux-gnu, etc) instead of the build directory (build/, or whatever you're using). This moves it back. (Otherwise the `clean-wpt` target won't work)
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.
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.
See #1479
This sets up a basic environment for running wpt. It instantiates a virtualenv, generates the manifest if it doesn't exist*, and runs the tests.
Currently @Ms2ger's [`run-in-servo` fork of wpt](https://github.com/Ms2ger/web-platform-tests/tree/run-in-servo/) is used.
Note: I did everything in a shell script instead of make since one cannot run `source` from a makefile (the environment is immutable, apparently)
*It does not, however, update the manifest. We'll have to add an extra script for that.
The previous code would return success from the JSNative with a pending
exception, potentially leading to assertion failures inside the JS engine
later.
Fixes#2121
I thought this would be better than passing an `Option<ResourceTask>` to `parse_css` because it avoids having to handle the potential failure at runtime when unwrapping.
No test included, but the error was reproducible by running content/test_getBoundingClientRect.html, and this fixes it. Glad to find a way to add an explicit test if need be.
On Android, our feeble GPU graphics stack is even less reliable than it is on Linux. To make it easier to bring Android devices online, this patch defaults to CPU rendering, which is much more stable and, frankly, faster.
r? @metajack
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.
This reverts [some changes made during the 2014-03-04 Rust upgrade](bbac8aa5c3 (diff-d084c1d37003c83f26aa4dac0e8d9e6bL221)). @larsberg, what was the reason for preferring the unsafe `.to_ascii_nocheck()`?
r? @larsberg
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.
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.