Commit graph

850 commits

Author SHA1 Message Date
bors-servo
f0014bd9cd Auto merge of #10224 - emilio:shader-type-validations, r=jdm
webgl: Add attribute validations and other nits

Fixes https://github.com/servo/servo/issues/9958

Depends on a bunch of prs, and needs a test.

r? @jdm

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10224)
<!-- Reviewable:end -->
2016-04-12 05:18:49 +05:30
bors-servo
07304235cc Auto merge of #10502 - KiChjang:fix-open-url-base, r=Ms2ger
Add API base url method to global objects

This adds an `api_base_url` function to global objects, which fixes `open-url-base.htm` under XMLHttpRequest.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10502)
<!-- Reviewable:end -->
2016-04-11 17:57:02 +05:30
Keith Yeung
c75079eff3 Add API base url method to global objects 2016-04-11 07:49:31 -04:00
Ms2ger
0d732ebb5f Implement Clone for Root. 2016-04-11 10:29:13 +02:00
Joe Wilm
229b176321 Implement Worker#terminate() (fixes #4427).
Adds support for terminating DOM workers. A closing flag was added to
WorkerGlobalScope per the spec.
2016-04-07 18:54:32 -04:00
Rahul Sharma
2caa9a2a76 refactors entities from script_thread into script_runtime 2016-04-06 12:46:49 +05:30
Paul Rouget
df6e7394d4 forcetouch events support
This enables Apple forcetouch DOM events. It requires the preference dom.forcetouch.enabled.

The DOM events are described here:
- https://developer.apple.com/library/mac/documentation/AppleApplications/Conceptual/SafariJSProgTopics/RespondingtoForceTouchEventsfromJavaScript.html

The Cocoa mechanism is documented here:
- 20000016-SW274
2016-04-05 18:42:28 +08:00
Emilio Cobos Álvarez
6fcc03c965 webgl: Make the api return the context limits and use them for validations
This allows keeping the VertexAttrib* calls asynchronous.

Another option would be to do the validation in the apply() function,
but that'd require us passing an unnecessary channel around and add
extra synchronization.

The counterpart of this is that it has to be updated when the context
changes, but that's less problem.
2016-04-03 01:21:56 +02:00
bors-servo
524a004e77 Auto merge of #10291 - jfhumann:10211, r=emilio
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10291)
<!-- Reviewable:end -->
2016-04-01 01:57:20 +05:30
Jan-Fabian Humann
d778562844 #10211: Stop re-exporting webrender_traits WebGL types from canvas_traits 2016-03-30 20:05:16 +02:00
Josh Matthews
042883eac2 Enable dictionaries in WebIDL sequences. Fixes #10282. 2016-03-30 11:07:37 -04:00
faineance
418842faf9 use self.0 instead of destructing single item tuple structs 2016-03-27 11:50:08 +01:00
bors-servo
edcf24fd4d Auto merge of #10152 - jdm:9511-rebase, r=nox
Fix #9511. Export webidl enums using "pub use".

Change typedef codegen to export the underlying enum itself, rather
than an alias. Works around https://github.com/rust-lang/rust/issues/31355

Rebase of #9691.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10152)
<!-- Reviewable:end -->
2016-03-24 10:40:44 +05:30
Ben
2477f6a363 Fix #9511. Export webidl enums using "pub use".
Change typedef codegen to export the underlying enum itself, rather
than an alias. Works around https://github.com/rust-lang/rust/issues/31355
2016-03-23 12:49:34 -04:00
bors-servo
e95368df62 Auto merge of #10096 - GuillaumeGomez:fun_to_string, r=nox
Make all interface objects share the same funToString

Fixes #9280

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10096)
<!-- Reviewable:end -->
2016-03-21 16:50:44 +05:30
Guillaume Gomez
b6feab97e0 Make all interface objects share the same funToString 2016-03-21 11:57:48 +01:00
Ms2ger
6f679c124c Update to Rust 2016-03-18. 2016-03-20 10:05:45 +01:00
Keith Yeung
3f2cbf0025 Add task_source directory
Use DOMManipulationTaskSource whenever possible
2016-03-10 01:05:53 -05:00
bors-servo
c37a086660 Auto merge of #9786 - peterjoel:fix_codegen_is_array_like, r=jdm
Fixed compile error in generated code, when webidl constructors have same number of args

One of the ways that generated code differentiates constructors is by comparing if the args are array-like. The generated code was calling a function `IsArrayLike` that no longer exists. I re-implemented it with a more rust-like naming scheme.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9786)
<!-- Reviewable:end -->
2016-03-04 15:14:20 +05:30
Peter
3e78b54d46 Fixed compile error in generated code, when webidl constructors have same number of args
Edited test webidl to show issue, and fix
2016-03-03 20:21:48 +00:00
bors-servo
9ceda7de50 Auto merge of #9837 - nox:deterministic-raf, r=mbrubeck
Use a BTreeMap for Document::animation_frame_list (fixes #9834)

The callbacks must stay ordered.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9837)
<!-- Reviewable:end -->
2016-03-02 21:24:38 +05:30
Anthony Ramine
1d87f61350 Use a BTreeMap for Document::animation_frame_list (fixes #9834)
The callbacks must stay ordered.
2016-03-02 16:53:06 +01:00
Ms2ger
549f2669f0 Stop generating a parser.out file in the source. 2016-03-01 15:02:50 +01:00
Anthony Ramine
2ed1a4ab3b Do not generate RegisterBindings::Register anymore 2016-02-25 15:56:54 +01:00
Anthony Ramine
1559f5a39f Lazily define interface objects on globals (fixes #6419) 2016-02-25 15:56:47 +01:00
Anthony Ramine
ca979e115b Cache legacy callback interface objects in proto_or_icache_array
We need them to be cached to not instantiate them multiple times with
lazy initialisation.
2016-02-25 15:15:44 +01:00
Anthony Ramine
2c4d5da866 Lazily-define standard ECMAScript classes 2016-02-25 15:15:44 +01:00
Anthony Ramine
0adfb08089 Implement From<DOMString> for Atom 2016-02-24 17:52:17 +01:00
Matt Brubeck
973918967f Dirty elements whose selectors are affected by sibling changes
This fixes incremental layout of nodes that match pseudo-class selectors such
as :first-child, :nth-child, :last-child, :first-of-type, etc.

* Fixes #8191
* Fixes #9063
* Fixes #9303
* Fixes #9448

This code is based on the following flags from Gecko:
https://hg.mozilla.org/mozilla-central/file/e1cf617a1f28/dom/base/nsINode.h#l134
2016-02-23 17:31:38 -08:00
bors-servo
d85ee09bc7 Auto merge of #9729 - Ms2ger:bc-option, r=jdm
Stop returning an Option from Window::browsing_context.

A Window always has a WindowProxy; the only reason it's wrapped in a nullable
field is the order in which those objects are created.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9729)
<!-- Reviewable:end -->
2016-02-24 01:21:01 +05:30
bors-servo
7192495e1a Auto merge of #9067 - nox:unenumerable-named-properties, r=jdm
Make NamedNodeMap's named properties unenumerable

https://dom.spec.whatwg.org/#dom-htmlcollection-item

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9067)
<!-- Reviewable:end -->
2016-02-23 22:58:30 +05:30
Anthony Ramine
86f3f37950 Always implement getOwnEnumerablePropertyKeys
According to JSProxy.h, without this the default implementation calls
ownPropertyKeys and filters out the unenumerable properties. We know when such
things exist so we don't need to do that.
2016-02-23 17:23:56 +01:00
Anthony Ramine
7f36247d03 Support [LegacyUnenumerableNamedProperties] 2016-02-23 17:23:51 +01:00
Anthony Ramine
cbf514d63f Fix a typo in CGDOMJSProxyHandler_getOwnPropertyDescriptor
Named properties are read-only if there is no named setter.
2016-02-23 17:23:03 +01:00
Anthony Ramine
b783d96749 Make fill_property_descriptor take a flags argument 2016-02-23 17:14:27 +01:00
Anthony Ramine
c95855c7ea Implement [LegacyUnenumerableNamedProperties] in the WebIDL parser
http://github.com/heycam/webidl/issues/82
2016-02-23 17:06:13 +01:00
bors-servo
433232a7ff Auto merge of #9598 - TimNN:xhr-header-step-3, r=Ms2ger
Implement XHR::SetRequestHeader Step 3

Closes #9548.

Alternative implementation of #9595.

cc @timvandermeij

I'm not sure if a utility method on `ByteString` is the best place for this functionality, maybe a free function in XHR module would be more suitable.

Also where would be the correct place to add a test for this functionality (if required)?

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9598)
<!-- Reviewable:end -->
2016-02-23 21:08:43 +05:30
Ms2ger
0e35931152 Stop returning an Option from Window::browsing_context.
A Window always has a WindowProxy; the only reason it's wrapped in a nullable
field is the order in which those objects are created.
2016-02-23 16:08:28 +01:00
Anthony Ramine
0af373cef6 Just pass global to CreateInterfaceObjects
The receiver parameter is useless here.
2016-02-23 15:42:45 +01:00
Anthony Ramine
96e28086e3 Clean up CGDOMJSClass 2016-02-23 15:42:44 +01:00
Tim Neumann
746f7dd29e move method from ByteString to module where it was used 2016-02-23 15:21:35 +01:00
Tim Neumann
3af3926d63 remove rarely used is_token method from ByteString 2016-02-23 15:21:35 +01:00
benshu
f2d4a7bbca Clean up of script timer code.
The code was split into the following two abstractions.
 - OneshotTimers can be used to schedule arbitrary oneshot timers, such
   as XHR-Timeouts.
 - JsTimers (`setTimeout` and `setInterval`) which use OneshotTimers to
   schedule individual callbacks.

With this change the implementation (of JsTimers in particular) is in
much closer alignment with the specification.
2016-02-20 22:43:16 +01:00
bors-servo
2676307793 Auto merge of #9633 - GuillaumeGomez:has_instance, r=nox
All interface objects now share the same hasInstance

r? @nox

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9633)
<!-- Reviewable:end -->
2016-02-19 19:49:33 +05:30
bors-servo
aae6525f7d Auto merge of #9684 - danlrobertson:i9655, r=KiChjang
Add methods to move ByteStrings underlying bytes

Add methods to move the underlying `Vec<u8>` for `ByteString`.

I saw this as at least two methods. One to "move and replace with and empty Vec<u8> (`bytes`), and one to take ownership of the whole object (`own_bytes`). I typically also don't like adding methods with out unit tests. If you think they're unnecessary, just let me know.

As always, please let me know if you have any comments, critiques, or nits!

Fixes #9655

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9684)
<!-- Reviewable:end -->
2016-02-19 17:21:14 +05:30
Daniel Robertson
72f74c27ef Convert unwrapping of ByteString to self.0
Convert traditional unwrapping of the tuple struct ByteString to
self.0
2016-02-18 19:41:03 +00:00
Daniel Robertson
d23774d3d7 Add methods to move ByteStrings underlying bytes
Add methods to move the underlying Vec<u8> for ByteString.
2016-02-18 19:40:24 +00:00
zakorgyula
6d6f23a69d Fixing issue with uniontypes not created with primitive types
refer to #9531
2016-02-18 11:08:47 +01:00
bors-servo
07cb6599d0 Auto merge of #9678 - servo:debug-enum, r=KiChjang
Derive the Debug trait for WebIDL-generated enums.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9678)
<!-- Reviewable:end -->
2016-02-18 09:51:57 +05:30
Kamil Muszyński
c6dfd7e2fa Issue #9561 continued - renamed *_thread_source to *_task_source in global.rs and related files 2016-02-17 21:25:12 +01:00