Commit graph

4787 commits

Author SHA1 Message Date
Anthony Ramine
60f0f8eaa5 Update the WebIDL parser 2016-08-26 00:56:08 +02:00
Anthony Ramine
7ac2464302 Restore abstract.patch which was mistakenly removed 2016-08-26 00:55:47 +02:00
Anthony Ramine
a4f96761b2 Hoist 7fd65affab as its own patch 2016-08-26 00:55:29 +02:00
bors-servo
6beec195ed Auto merge of #13028 - ofekd:implement-data-value-attr, r=KiChjang
Implement HTMLDataElement#value

<!-- Please describe your changes on the following line: -->
Implement HTMLDataElement#value

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12966

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13028)
<!-- Reviewable:end -->
2016-08-25 12:48:06 -05:00
bors-servo
160d15670e Auto merge of #13017 - nox:wrong-receiver, r=Ms2ger
Pass the receiver to get_property_on_prototype (fixes #11600)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13017)
<!-- Reviewable:end -->
2016-08-25 11:49:54 -05:00
Anthony Ramine
6c1167b1e2 Pass the receiver to get_property_on_prototype (fixes #11600) 2016-08-25 15:48:07 +02:00
Anthony Ramine
f70fa98954 Make has_property_on_prototype fallible 2016-08-25 15:46:43 +02:00
Anthony Ramine
fbc8938bee Mark get_property_on_prototype and has_property_on_prototype as unsafe 2016-08-25 15:46:42 +02:00
bors-servo
f4bd1b224e Auto merge of #12847 - clstl:HTMLDialogElement#close, r=nox
Implements HTMLDialogElement#close

<!-- Please describe your changes on the following line: -->
Implements HTMLDialogElement#close according to [link](https://html.spec.whatwg.org/multipage/#the-dialog-element:dom-dialog-close)

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12352
- [X] There are tests for these change

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12847)
<!-- Reviewable:end -->
2016-08-25 08:43:23 -05:00
clstl
aa5edd1118 Implements HTMLDialogElement#close 2016-08-25 16:13:30 +03:00
Ofek
cc23f9a87a implement HTMLDataElement#value 2016-08-25 16:08:09 +03:00
bors-servo
8b84566097 Auto merge of #13030 - nox:global, r=Ms2ger
Improve prototypes of global objects

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13030)
<!-- Reviewable:end -->
2016-08-25 07:45:39 -05:00
Anthony Ramine
241de3dfd0 Call JS_SetImmutablePrototype for prototypes of globals (fixes #13023) 2016-08-25 14:29:27 +02:00
Anthony Ramine
6da56f7e67 Define interface members on the global object directly (fixes #4593) 2016-08-25 14:29:16 +02:00
Anthony Ramine
0729000b56 Pass a MutableHandleObject to create_global_object 2016-08-25 14:03:09 +02:00
Anthony Ramine
5f59bb2e0c Make create_global_object take a &'static Class 2016-08-25 14:03:08 +02:00
Anthony Ramine
a4f2159e36 Rename utils::create_dom_object to interface::create_global_object 2016-08-25 14:03:07 +02:00
Anthony Ramine
32a600246e Split global logic out of CGWrapMethod 2016-08-25 14:02:52 +02:00
bors-servo
7834475482 Auto merge of #12980 - jdm:proxychanges, r=nox
Fix ridiculous DOM proxy getter performance

This implements the missing shadowing checks that were causing us to take many slow paths when dealing with proxy objects. Verified by running `tests/html/binding_perf.html` before and after and observing a 12x improvement.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12357
- [X] These changes do not require tests because we can't test performance yet.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12980)
<!-- Reviewable:end -->
2016-08-25 06:31:46 -05:00
Anthony Ramine
fa17814f12 Make define_constants unsafe 2016-08-25 13:07:46 +02:00
Josh Matthews
4961a513d4 Check for shadowing properties on DOM proxies. Fixes #12357. 2016-08-25 00:11:39 -04:00
Josh Matthews
2ad293ca64 Pass real values to the proxy handler setup. 2016-08-25 00:11:38 -04:00
Jeena Lee
e3624edbf6 Implement iterable for Headers.
This commit implements iterable in DOM Headers based on iterable
implementation from #12819. Expected wpt results are updated as well.
2016-08-24 13:12:35 -07:00
bors-servo
1370fa5e3b Auto merge of #12819 - jdm:iterable2, r=nox
Support pair and value iterable WebIDL bindings

The actual iterator implementation and JSAPI calls related to setting up the interface are ported directly from Gecko's Codegen.py, IterableIterator.h, and IterableIterator.webidl. The changes to support multiple interfaces in one file are required because the internal iterator interface the parser generates gets associated with the original interface's WebIDL file. It seemed like a good time to address #571 in that case.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12628 and fix #571.
- [X] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12819)
<!-- Reviewable:end -->
2016-08-24 12:47:53 -05:00
Josh Matthews
86a0c45f87 Use named arguments for CGImports. 2016-08-24 13:47:26 -04:00
Josh Matthews
6492c090f1 Set up the iterator prototype as the prototype of iterator interfaces, and alias forEach to the entries method. 2016-08-24 13:47:24 -04:00
bors-servo
77af4e26ce Auto merge of #13016 - servo:fromjsval-interface, r=jdm
Refactor some from_jsval implementations.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13016)
<!-- Reviewable:end -->
2016-08-24 11:04:29 -05:00
Josh Matthews
812a761abf Implement pair iterators in WebIDL interfaces. 2016-08-24 11:26:01 -04:00
Josh Matthews
34bb937aee Support value iterators in WebIDL interfaces. 2016-08-24 11:26:00 -04:00
Josh Matthews
221bc84693 Support multiple WebIDL interfaces being generated in the same output binding file.
Each interface gets its own module named ${Interface}Binding. Structs, enums, and callbacks
continue to use the root module of the binding file. If there is only one interface in the
file, we generate reexports for several public APIs and types so that existing DOM implementations
don't need any modifications. When multiple interfaces exist, the reexported names get the interface
name prepended (eg. FooWrap instead of Wrap).

As part of this work, stop glob-importing all DOM types in every generated binding and start generating
more targeted lists of relevant types based on the methods, members, etc. of WebIDL types that are in use.
2016-08-24 11:25:58 -04:00
Ms2ger
b29ffb1c4c Reformat from_jsval implementation for unions. 2016-08-24 15:41:07 +02:00
Ms2ger
6ef5894f01 Remove the throw_type_error call from FromJSValConvertible::from_jsval. 2016-08-24 15:15:40 +02:00
bors-servo
ccf79de66e Auto merge of #13014 - nox:dispatch, r=Ms2ger
Fix step 10 of eventdispatcher::dispatch_event (fixes #11609)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13014)
<!-- Reviewable:end -->
2016-08-24 07:17:22 -05:00
Anthony Ramine
540fe15f17 Fix step 10 of eventdispatcher::dispatch_event (fixes #11609)
We consolidate steps 10-12 in a single function to expose less general-purpose
mutating methods on Event.
2016-08-24 13:54:44 +02:00
bors-servo
3c4a08c016 Auto merge of #12954 - GuillaumeGomez:dictionary_error, r=nox
Update rust-mozjs

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12954)
<!-- Reviewable:end -->
2016-08-24 06:19:37 -05:00
Guillaume Gomez
2f3f4a5bd6 Update rust-mozjs dependency 2016-08-24 12:56:49 +02:00
bors-servo
9d32088116 Auto merge of #13009 - bzbarsky:fix-proto-splice, r=Ms2ger
Use JS_SplicePrototype to set the right proto on the global, instead of JS_SetPrototype, since the latter will permanently deoptimize it.

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because it's a performance improvement and I have no idea how to add performance tests.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13009)
<!-- Reviewable:end -->
2016-08-24 02:10:33 -05:00
Boris Zbarsky
5341f852ce Use JS_SplicePrototype to set the right proto on the global, instead of JS_SetPrototype, since the latter will permanently deoptimize it. 2016-08-24 00:43:52 -04:00
Chris McDonald
349d0e5108 Changed first line of script to line 1 instead of line 0 2016-08-23 16:44:56 -06:00
Anthony Ramine
e034117152 Update Rust to 1.13.0-nightly (3c5a0fa45 2016-08-22) 2016-08-23 17:05:41 +02:00
bors-servo
fe09cb5504 Auto merge of #12921 - paulrouget:imgOnError, r=nox
Trigger image.onerror

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #12885 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->

---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12921)
<!-- Reviewable:end -->
2016-08-23 02:31:48 -05:00
Paul Rouget
a48cf1d215 Trigger image.onerror 2016-08-23 07:51:47 +02:00
bors-servo
c5e81f8361 Auto merge of #12945 - Manishearth:bgarray, r=SimonSapin
Support multiple backgrounds in both servo and stylo

(Commits do not build individually, but split up for review)

These patches make all of the background- properties accept multiple values, and add the layout code to display them.

Still needs some cleanup, and some testing, but it seems to work.

r? @SimonSapin

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12945)
<!-- Reviewable:end -->
2016-08-22 22:09:23 -05:00
bors-servo
1e10f8bbf7 Auto merge of #12915 - jeenalee:parse-headers, r=Manishearth
Include "content-type" in cors safelisted request headers.

<!-- Please describe your changes on the following line: -->

The changes in headers.rs will allow headers with "content-type" name to be classified as cors safelisted request headers, depending on its value according to [the Fetch spec](https://fetch.spec.whatwg.org/#cors-safelisted-request-header). As a result of this change, more request web platform tests pass, whose expected test results are updated with this commit.

There is possibly one TODO related to this PR:
- Figure out what `name/'invalid'` is in step 4 of the [Headers Delete method](https://fetch.spec.whatwg.org/#dom-headers-delete), and how to implement that.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because web platform tests for the changes already exist.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

This commit allows headers with "content-type" name to be classified as valid header name, depending on its value according to [the Fetch spec](https://fetch.spec.whatwg.org/#cors-safelisted-request-header). As a result of this change, more request web platform tests pass, whose expected test results are updated as well.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12915)
<!-- Reviewable:end -->
2016-08-22 20:17:16 -05:00
Jeena Lee
cc7b1c508a Include "content-type" in cors safelisted request headers.
This commit allows headers with "content-type" name to be classified as valid header name, depending on its value according to [the Fetch spec](https://fetch.spec.whatwg.org/#cors-safelisted-request-header). As a result of this change, more request web platform tests pass, whose expected test results are updated with this commit.
2016-08-22 11:06:53 -07:00
Manish Goregaokar
69ada0d7a3 Support multiple backgrounds in servo layout 2016-08-22 22:42:43 +05:30
bors-servo
1911606e5c Auto merge of #12970 - servo:thread-state, r=nox
Move thread_state to style.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12970)
<!-- Reviewable:end -->
2016-08-22 10:39:51 -05:00
Ms2ger
307d1ced3c Move thread_state to style. 2016-08-22 16:08:56 +02:00
Christian Sonne
908b9627a2 Track only the number of important declarations in a declaration block 2016-08-22 14:05:09 +02:00
Zhen Zhang
2527dc07f2 Burn SelectedFileId in fire 2016-08-22 10:05:01 +02:00