Commit graph

6343 commits

Author SHA1 Message Date
Manish Goregaokar
ad198993b1 Assert that DOM structs have the correct first field
DOM structs embed their parent type as their first field. This
introduces a `.parent()` method to the DOM struct that returns its first
field, and codegens a type assert that ensures that `.parent()` returns
the parent struct.

This generates:

On `#[dom_struct]`:

```rust
impl HasParent for Type {
    type Parent = ParentType;
    fn as_parent(&self) -> ParentType {
        &self.first_field
    }
}
```

In the codegen files:

```rust
impl Type {
    fn __assert_parent_type(&self) {
        let _: &ParentType = self.as_parent();
    }
}
````
2018-07-03 09:39:29 -07:00
Emilio Cobos Álvarez
895946bb18
layout: script: Fix build. 2018-06-23 20:34:10 +02:00
Anthony Ramine
02b8766e75 Implement EXT_blend_minmax 2018-06-22 14:10:56 +02:00
Anthony Ramine
124fe69818 Properly enable EXT_shader_texture_lod 2018-06-22 12:20:22 +02:00
bors-servo
388a6f80ac
Auto merge of #21074 - jonathanKingston:toggle-attribute, r=Manishearth
Implement support for Element.toggleAttribute

Copy implementation following from [Firefox implementation](https://bugzilla.mozilla.org/show_bug.cgi?id=1469592) of soon to be standardised [Element.toggleAttribute](https://github.com/whatwg/dom/pull/656). [Other implementers agreed to ship](https://github.com/whatwg/dom/issues/461)

---
<!-- 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 don't fix an issue however the wpt-tests will merge soon and will cause an issue etc.

<!-- Either: -->
- [X] There are tests for these changes **(coming soon in wpt from Firefox and I tested them on this patch)**

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21074)
<!-- Reviewable:end -->
2018-06-21 03:54:23 -04:00
Jonathan Kingston
a271c615f7 Implement support for Element.toggleAttribute 2018-06-21 02:06:32 +01:00
bors-servo
8f84f893a7
Auto merge of #21072 - servo:webgl, r=emilio
Implement checks for vertex attribs enabled as arrays without a bound buffer

<!-- 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/21072)
<!-- Reviewable:end -->
2018-06-20 10:19:38 -04:00
Anthony Ramine
fc3dd7cefc Implement checks for vertex attribs enabled as arrays without a bound buffer 2018-06-20 15:59:06 +02:00
bors-servo
e231a68acf
Auto merge of #21050 - jonathanKingston:fix-replacability-of-window-attrs, r=jdm
Allow supported window attributes to be replacable.

As seen in https://github.com/servo/servo/pull/21045 some Window attributes don't support JavaScript from being able to shadow and replace their values.

This PR adds all other attributes I could find that are supported by servo to be replaceable.

---
<!-- 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

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21050)
<!-- Reviewable:end -->
2018-06-19 18:11:06 -04:00
bors-servo
0226a1a4ad
Auto merge of #21062 - tigercosmos:ggg, r=emilio
textarea minLength/maxLength

<!-- Please describe your changes on the following line: -->
 textarea minLength/maxLength

---
<!-- 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
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21062)
<!-- Reviewable:end -->
2018-06-19 12:46:56 -04:00
Emilio Cobos Álvarez
083857a4b0
Fix Servo build. 2018-06-18 20:01:48 +02:00
bors-servo
1f562af418
Auto merge of #20699 - simartin:issue_20593, r=nox
Issue #20593: Implement proper checks in WebGLRenderingContext's getFramebufferAttachmentParameter().

Add missing input checks.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20593
- [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/20699)
<!-- Reviewable:end -->
2018-06-18 12:01:39 -04:00
tigercosmos
bdb6706f19 textarea minLength/maxLength 2018-06-18 02:01:59 -07:00
tigercosmos
ecb65474a7 Let the popstate and hashchange events not bubble 2018-06-17 11:13:36 -07:00
bors-servo
0c5b020163
Auto merge of #21052 - tigercosmos:rrr, r=jdm
add TextLength

<!-- Please describe your changes on the following line: -->
add TextLength in HTMLTextAreaElement

---
<!-- 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
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21052)
<!-- Reviewable:end -->
2018-06-15 13:59:12 -04:00
tigercosmos
0907940db8 add TextLength 2018-06-15 09:47:37 -07:00
Jonathan Kingston
7dc7173a73 Allow supported window attributes to be replacable. 2018-06-14 10:58:40 -07:00
bors-servo
3279d1fe85
Auto merge of #21051 - jonathanKingston:window-length, r=jdm
Implement window.length DOM attribute.

Implements the `window.length` DOM attribute for enumerating frames on the document.

---
<!-- 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

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21051)
<!-- Reviewable:end -->
2018-06-14 11:59:23 -04:00
Jonathan Kingston
ba9975e099 Implement window.length DOM attribute. 2018-06-14 05:56:16 -07:00
Jonathan Kingston
51db660175 Allow window.parent attribute to be relaceable by JavaScript. 2018-06-13 10:16:13 -07:00
bors-servo
5c4f54c403
Auto merge of #21034 - servo:desktop-oes-element-index-uint, r=KiChjang
Don't check for GL_OES_element_index_unit with desktop GL (fixes #20921)

<!-- 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/21034)
<!-- Reviewable:end -->
2018-06-13 05:11:33 -04:00
Emilio Cobos Álvarez
ab760033fd
style: Fix servo build. 2018-06-12 12:15:18 -07:00
Anthony Ramine
c7603bd4ca Don't check for GL_OES_element_index_unit with desktop GL (fixes #20921) 2018-06-12 12:33:32 +02:00
bors-servo
56f6762cf8
Auto merge of #21015 - tigercosmos:yyy, r=jdm
Support cloning steps for textarea/input

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

---
<!-- 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 #13282 (github issue number if applicable).

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/21015)
<!-- Reviewable:end -->
2018-06-07 10:13:30 -04:00
tigercosmos
73c0af6759 support textarea clone 2018-06-07 06:54:26 -07:00
Anthony Ramine
f1288cc6e0 Implement EXT_texture_filter_anisotropic 2018-06-06 12:24:47 +02:00
bors-servo
652a177ff5
Auto merge of #19511 - DonatJR:implement-read-methods-on-filereadersync, r=jdm
Implement read methods on FileReaderSync

<!-- Please describe your changes on the following line: -->
Implemented the read methods on the FileReaderSync struct according to https://w3c.github.io/FileAPI/#dfn-FileReaderSync

---
<!-- 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 #15114

<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/19511)
<!-- Reviewable:end -->
2018-06-04 15:55:14 -04:00
Jonas Reinwald
0fdafb08c8 Implement read methods on FileReaderSync 2018-06-04 15:53:08 -04:00
bors-servo
0b6df7ef4d
Auto merge of #20915 - servo:webgl, r=jdm
Implement EXT_shader_texture_lod

<!-- 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/20915)
<!-- Reviewable:end -->
2018-06-04 11:11:31 -04:00
Anthony Ramine
4e5e1e6c33 Implement EXT_shader_texture_lod 2018-06-04 16:33:05 +02:00
bors-servo
65eff4fb8a
Auto merge of #20865 - gterzian:improve_spec_compliance_window_close, r=cbrewster
improve spec compliance of window.close

<!-- Please describe your changes on the following line: -->
Improve the spec compliance of https://html.spec.whatwg.org/multipage/window-object.html#dom-window-close, mainly by implementing the steps related to [closing a browsing context](https://html.spec.whatwg.org/multipage/window-object.html#close-a-browsing-context)

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/20865)
<!-- Reviewable:end -->
2018-06-04 06:16:45 -04:00
Gregory Terzian
2753e5efab improve spec compliance of window.close 2018-06-04 15:02:23 +08:00
CYBAI
f2ad35209f Fix typo for worklet 2018-06-03 20:34:28 +08:00
Emilio Cobos Álvarez
aea5e146fe
dom: Remove CSSStyleDeclaration.setPropertyValue/setPropertyPriority. 2018-06-02 17:24:12 +02:00
Emilio Cobos Álvarez
274bc4df3e
dom: don't parse internal properties in CSSStyleDeclaration. 2018-06-02 12:24:44 +02:00
bors-servo
022daccbe1
Auto merge of #20884 - jdm:more-limits, r=avadacatavra
Don't forward GL parameter gets for constant limits.

This avoids IPC traffic for unchanging constants that are determined when the GL context is created. These changes require https://github.com/emilio/rust-offscreen-rendering-context/pull/123.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20876.
- [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/20884)
<!-- Reviewable:end -->
2018-05-31 15:03:43 -04:00
Josh Matthews
76c29f8bd0 Don't forward GL parameter gets for constant limits. 2018-05-31 14:24:18 -04:00
Simon Martin
08b193c922 Issue #20593: Implement proper checks in WebGLRenderingContext's getFramebufferAttachmentParameter(). 2018-05-31 20:09:11 +02:00
Alan Jeffrey
d0cc9d2cd5 Updated to mozjs v0.7.1. 2018-05-30 14:44:47 -05:00
bors-servo
0356be3021
Auto merge of #20879 - tigercosmos:ccc, r=jdm
Update type of custom element constructor

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

---
<!-- 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 #20875 (github issue number if applicable).

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/20879)
<!-- Reviewable:end -->
2018-05-30 08:09:36 -04:00
tigercosmos
6d426f7c14 Update type of custom element constructor 2018-05-30 10:00:12 +08:00
Josh Matthews
b1202cfa9f
Don't panic when tearing down a WebGL context and the thead is unreachable.
This avoids some cascading double-panics when there are errors in the WebGL rendering thread.
2018-05-29 15:26:39 -04:00
bors-servo
2439ab02b8
Auto merge of #20837 - gterzian:tests_for_has_event_listener, r=cbrewster
Fix for document salvageable state

I noticed a bug where if the document was un-salavageable due to the presence of `beforeunload` listeners, this could be overwritten if there were no listeners for `unload`. This could also have happened if an iframe of the document had no listeners while the parent did.

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

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/20837)
<!-- Reviewable:end -->
2018-05-28 15:52:31 -04:00
bors-servo
4e6b100c7e
Auto merge of #20864 - tigercosmos:aa1, r=emilio
remove misleading spec url

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

`pub fn scroll_area(&self)` in `node.rs` is only called by `fn ScrollHeight(&self)` and `fn ScrollWidth(&self)` in `element.rs`.

`scrolltop` and `scrollleft` are actually implemented in `element.rs`.

The misleading spec urls should be removed.

<!-- 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/20864)
<!-- Reviewable:end -->
2018-05-26 09:29:25 -04:00
tigercosmos
393aa06e5b remove misleading url 2018-05-26 06:17:56 -07:00
bors-servo
31f91ec3e1
Auto merge of #20854 - servo:webgl, r=emilio
Drive-by fixes in WebGL

<!-- 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/20854)
<!-- Reviewable:end -->
2018-05-25 00:45:33 -04:00
bors-servo
f6762d54e2
Auto merge of #20707 - gterzian:embedder_handling_of_prompts_and_alerts_2, r=payl
Embedder handling of prompts and alerts

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

Allow embedder to allow alerts and prompts, but via constellation forwarding messages from script.

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/20707)
<!-- Reviewable:end -->
2018-05-24 10:34:48 -04:00
Anthony Ramine
3e510ec008 Implement most of the unsupported parameters in gl.getParameter()
Fixes #20536.
Fixes #20537.
Fixes #20538.
Fixes #20544.
Fixes #20545.
Fixes #20546.
Fixes #20548.
Fixes #20549.
Fixes #20551.
2018-05-24 12:32:15 +02:00
Anthony Ramine
b523267349 Move WebGLVertexArrayObjectOES to script::dom
It's not a WebGL extension itself, it's just used by one.
2018-05-24 12:12:23 +02:00
Anthony Ramine
54f88b5eaf Add OESElementIndexUint to WebGLExtensions::register_all_extensions 2018-05-24 12:09:58 +02:00