This is cherry-picked from https://github.com/mozilla/servo/pull/1688:
* Initial spec-incompliant implementation of default click action for anchor elements.
* Add documentation; gut the new document URL loading method
and move it all into the new Window method.
* Add test for default event prevention.
Original developer: Josh Matthews <josh@joshmatthews.net>
getDefaultRetval was supposed to be used after throwing an exception on the
ErrorResult outparam in C++. However, as we throw exceptions through the
return value in Servo, we don't need it at all.
This moves all the handling of optional arguments into `CGArgumentConverter`, and leaves `instantiateJSToNativeConversionTemplate` to only deal with the declaration of stack variables.
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.
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.
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?
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.
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.
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.