Commit graph

827 commits

Author SHA1 Message Date
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
Ms2ger
eede44984d Derive the Debug trait for WebIDL-generated enums. 2016-02-17 16:29:37 +01:00
bors-servo
61f09cce4e Auto merge of #9676 - nox:domexception, r=KiChjang
Support [ExceptionClass]

Use it on DOMException.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9676)
<!-- Reviewable:end -->
2016-02-17 18:51:47 +05:30
Anthony Ramine
c21a164396 Support [ExceptionClass]
Use it on DOMException.
2016-02-17 13:58:58 +01:00
Guillaume Gomez
bb9d3692c7 All interface objects now share the same hasInstance 2016-02-17 06:37:52 +01:00
Daniel Robertson
7a35ef1555 Implement RootedReference<T> for Option<JS<T>>
An implementation of RootedReference for Option<JS<T>> based off of
other implementations of RootedReference for Option wrapped types.
2016-02-16 22:40:03 +00:00
Anthony Ramine
ae72d1dfbe Fix the hasInstance hook of interface objects
Step 2 wasn't properly implemented.
2016-02-15 14:12:53 +01:00
Anthony Ramine
e08f817058 Clean up imports in script::dom::bindings::interface 2016-02-15 12:59:18 +01:00
Peter
f374e8f420 #9640 Refactor: Move util::str::is_token to script::dom::bindings::str 2016-02-14 22:47:52 +00:00
Kamil Muszyński
076cc409e6 Issue #9561 Renamed *_thread_source to *_task_source and ThreadSource to TaskSource 2016-02-14 15:29:44 +01:00
Anthony Ramine
55dcee94be Bump heapsize to 0.3 2016-02-13 11:13:19 +01:00
Anthony Ramine
71092e142d Bump js to get fix from servo/rust-mozjs#237 2016-02-12 17:15:09 +01:00
Josh Matthews
2796a4dfa8 Compile raw inline event handlers lazily. Resolves #8489. 2016-02-11 15:44:52 +01:00
bors-servo
3d63f09361 Auto merge of #9244 - paulrouget:securitychange, r=jdm
mozbrowsersecuritychange event

Fixes #8544

No test yet. Is there a way to mock a https connection?

Also, I wish I could use the `HTTPSState` enum instead of a `String` when calling `trigger_mozbrowser_event` (https://github.com/servo/servo/compare/master...paulrouget:securitychange?expand=1#diff-30a18e04d7e0b66aafdf192e416cad44R306) but that would require `constellation_msg.rs` to know about `HTTPSState`, which is defined in `document.rs`, which would add a dependency to `components/msg`. I could define `HTTPSState` somewhere else maybe? Or maybe it's fine to use a `String`. But then, should I use the HTTPSState strings (`"modern/deprecated/none"`) or the mozbrowser strings (`"secure/insecure/broken"`) (as it is now)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9244)
<!-- Reviewable:end -->
2016-02-09 13:00:29 +05:30
Paul Rouget
63519c3574 mozbrowsersercuritychange event 2016-02-09 08:05:17 +01:00
Alexander Lopatin
2be49404be Fix #9508: Beautify our union enums constructors 2016-02-07 02:55:21 +03:00
Anthony Ramine
cb5cd8d881 Say farewell to in-tree HeapSizeOf 2016-02-04 22:03:32 +01:00
Emilio Cobos Álvarez
a1c830f1c1 Update rust-selectors
This commits updates rust-selectors to use the generic parser, and as
such it moves the element state into the style crate.
2016-02-03 02:11:31 +01:00
Anthony Ramine
436b952298 Bump Rust to 2016-01-31 nightly 2016-02-01 17:55:36 +01:00
bors-servo
46b3eb6535 Auto merge of #9208 - jmr0:master-img, r=asajeffrey
Use image metadata to lay out images

Fixes #7047.

cc: @jdm

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9208)
<!-- Reviewable:end -->
2016-01-31 01:18:41 +05:30
jmr0
167ffa7a95 adding image metadata notification capabilities to image cache 2016-01-29 20:54:49 -05:00
Shing Lyu
18b6817755 Add mach test-webidl command 2016-01-29 21:12:21 +08:00
bors-servo
a75f2cecda Auto merge of #9419 - psdh:includeTypedef, r=nox
generate typedefs in CodegenRust.

fixes #9384

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9419)
<!-- Reviewable:end -->
2016-01-26 22:10:57 +05:30
Prabhjyot Singh Sodhi
d6df844ae5 generate typedefs in CodegenRust 2016-01-26 21:56:44 +05:30