Commit graph

3088 commits

Author SHA1 Message Date
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
7696a6bd20 Fix HTMLCollection::NamedItem 2016-02-23 17:23:54 +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
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
Anthony Ramine
144e215548 Don't use the hasOwn hook anymore in browsingcontext
There is no [[HasOwnProperty]] hook in the ES spec, we should just define
the has proxy trap.

https://bugzilla.mozilla.org/show_bug.cgi?id=980565
2016-02-23 15:42:43 +01:00
Anthony Ramine
a734b8fa21 Reorder js imports in browsingcontext 2016-02-23 15:42:42 +01:00
Tim Neumann
fac4c31b42 implement XHR::SetRequestHeader Step 3 2016-02-23 15:22:37 +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
Ms2ger
2547fcb1e9 Remove an unused import from xmlhttprequest. 2016-02-23 13:59:02 +01:00
bors-servo
8f278109ce Auto merge of #8603 - benschulz:timers-clean-up, r=jdm
Timers clean up

This PR splits the `ActiveTimers` abstraction into

 - `OneshotTimers` for scheduling "arbitrary" oneshot timers, such as XHR timeouts, and
 - `JsTimers`, based on `OneshotTimers`, for scheduling JS timers (`setTimeout`/`setInterval`).

The result is mich cleaner and the timer initialization steps now closely resemble the specification.

**Notes**
 - The second and third commit are strictly renames and code rearrangements.
 - I'm not particularily happy with the `OneshotTimerCallback` enum and its circular dependency with `XHRTimeoutCallback`, but I couldn't come up with anything better.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8603)
<!-- Reviewable:end -->
2016-02-21 21:43:28 +05:30
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
Josh Matthews
f5b5079e2a Use the browsing context from the document where appropriate.
This should not change behaviour.
2016-02-20 18:47:11 +01:00
Josh Matthews
7045056173 Make it possible for XMLDocuments to have a browsing context. 2016-02-20 18:03:14 +01:00
bors-servo
c68fbee03e Auto merge of #9689 - saurvs:master, r=jdm
Update some canvas properties as enums instead of DOMString

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

I'm going to incrementally rollout commits and squash them finally.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9689)
<!-- Reviewable:end -->
2016-02-20 00:40:28 +05:30
bors-servo
94d28bfecf Auto merge of #9700 - servo:xhr-to-owned, r=KiChjang
Avoid some spurious string copies in XHR.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9700)
<!-- Reviewable:end -->
2016-02-19 22:23:35 +05:30
Saurav Sachidanand
939560bd6e Update some canvas properties as enums instead of DOMString 2016-02-19 22:19:09 +05:30
bors-servo
0209d42b7b Auto merge of #9701 - Ms2ger:listener-is-some, r=KiChjang
Use if-let in set_inline_event_listener.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9701)
<!-- Reviewable:end -->
2016-02-19 21:34:22 +05:30
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
bors-servo
361bb24a49 Auto merge of #9610 - liviuba:Fix-9553, r=KiChjang
Bypass GetResponseXML to better match spec

Resolves https://github.com/servo/servo/issues/9553

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9610)
<!-- Reviewable:end -->
2016-02-19 15:39:59 +05:30
liviuba
347f3c15b2 Add caching to document_response 2016-02-19 11:30:09 +02:00
Ms2ger
18e6a63851 Avoid some spurious string copies in XHR. 2016-02-19 09:31:35 +01:00
bors-servo
ee158cc65f Auto merge of #9603 - Ms2ger:document-bc, r=jdm
Store a pointer to the browsing context in the Document.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9603)
<!-- Reviewable:end -->
2016-02-19 12:49:35 +05:30
bors-servo
2374e9d30e Auto merge of #9526 - schuster:node-remove, r=nox
My updates so far for issue #8465. See comments there for more information.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9526)
<!-- Reviewable:end -->
2016-02-19 03:14:28 +05:30
bors-servo
96d185359d Auto merge of #9383 - KiChjang:xhr-cleanup, r=Ms2ger
Clean up XHR API

I've also added annotations about the steps that we're performing within each method.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9383)
<!-- Reviewable:end -->
2016-02-19 02:25:18 +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
bors-servo
ab07b06823 Auto merge of #9589 - glennw:webrender, r=pcwalton
Add WebRender integration to Servo.

WebRender is an experimental GPU accelerated rendering backend for Servo.

The WebRender backend can be specified by running Servo with the -w option (otherwise the default rendering backend will be used).

WebRender has many bugs, and missing features - but it is usable to browse most websites - please report any WebRender specific rendering bugs you encounter!

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9589)
<!-- Reviewable:end -->
2016-02-19 00:54:06 +05:30
bors-servo
fe70efe07f Auto merge of #8952 - KiChjang:planned-navigation, r=Manishearth
Implement planned navigation

Fixes #3648.

Note that I have only implemented "mutate action URL" and "get action URL". The remaining ones can have E-less easy issues created for them.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8952)
<!-- Reviewable:end -->
2016-02-18 22:26:19 +05:30
Keith Yeung
ace5b7a2e8 Implement planned navigation 2016-02-18 06:37:32 -05: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
bors-servo
d8ffa3d0b8 Auto merge of #9529 - paulrouget:focusEvents, r=asajeffrey
Implement focus, blur, focusin and focusout events

Based on https://github.com/servo/servo/pull/7985

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

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9529)
<!-- Reviewable:end -->
2016-02-18 09:03:42 +05:30
Paul Rouget
c7195cb456 Implement focus and blur events 2016-02-18 03:49:31 +01:00
Glenn Watson
c0531c312f Add WebRender integration to Servo.
WebRender is an experimental GPU accelerated rendering backend for Servo.

The WebRender backend can be specified by running Servo with the -w option (otherwise the default rendering backend will be used).

WebRender has many bugs, and missing features - but it is usable to browse most websites - please report any WebRender specific rendering bugs you encounter!
2016-02-18 10:35:29 +10:00
bors-servo
63dc161b77 Auto merge of #9683 - kmuszyn:9561-more-thread-source-renamings, r=jdm
Issue #9561 continued - renamed *_thread_source to *_task_source

components/script/dom/bindings/global.rs modified -> all *_thread_source occurrences renamed to *_task_source to comply with spec

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9683)
<!-- Reviewable:end -->
2016-02-18 04:59:32 +05:30
bors-servo
bc034845b7 Auto merge of #9662 - rebstar6:websocket_cookies, r=jdm
Add support for websocket cookies

Addresses both cookies in request and response. Resolves #9540.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9662)
<!-- Reviewable:end -->
2016-02-18 02:44:01 +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
Rebecca
cf6fd6dafe Add support for websocket request and response cookies
Also change expected behavior to pass for all in tests/wpt/web-platform-tests/websockets/cookies
2016-02-17 14:50:52 -05:00
Keith Yeung
066c5ea73a Clean up XHR API 2016-02-17 12:44:54 -05: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