Commit graph

8329 commits

Author SHA1 Message Date
bors-servo
5ec725488f
Auto merge of #22923 - peterjoel:issue_8539_prefs_refactor, r=jdm
#8539 Config preferences backend restructure

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

A procedural macro for generating static structures for use as the backend for config preferences, as well a mapping from string names to accessors.

Preferences can be accessed and updated via a map-like interface with `String` keys, and now also via a convenience macro: `get_pref!(path.to.pref)`. Various `serde`-compatible field attributes are also supported, including renaming the string keys. This could be useful when changing the backend structure without breaking existing usages.

I have added the choice to use `i64` as well as `f64` for storing numbers. As it turns out, none of the existing preferences used non-integer values. Setting a floating point value from a command-line argument requires a decimal point in order to parse correctly.

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

<!-- Either: -->
- [X] 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. -->

-----

I have a few outstanding problems or questions:

1. I am unable to get rid of this warning:
    ```
    warning: unnecessary path disambiguator
       --> components/config/prefs.rs:130:51
        |
    130 |         accessor_type = crate::pref_util::Accessor::<Prefs, crate::pref_util::PrefValue>,
        |                                                   ^^ try removing `::`
    ```
    See: https://stackoverflow.com/questions/54710797/how-to-disable-unnecessary-path-disambiguator-warning
2. Several of the preferences in use were not represented in `prefs.json`. Some of these may be in error, but it is hard to tell. For example `js.offthread_compilation.enabled` vs `js.ion.offthread_compilation.enabled` could be different preferences or could be intended to have the same value.
3. Previously, several pieces of code provided default values when accessing a preference that may not be present. For example:
    ```Rust
    let DBL_CLICK_TIMEOUT = Duration::from_millis(
        PREFS
            .get("dom.document.dblclick_timeout")
            .as_u64()
            .unwrap_or(300),
    );
    ```
    Fallback values don't really make sense now and I've added these defaults to `prefs.json`. Does this sound right?
4. I have kept `PrefValue::Missing`, though it doesn't seem very useful any more. An error might be more appropriate now for an incorrect preference key. I've kept this partly because [`webdriver_server` uses it](https://github.com/servo/servo/blob/master/components/webdriver_server/lib.rs#L224).

<!-- 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/22923)
<!-- Reviewable:end -->
2019-03-20 14:33:37 -04:00
bors-servo
43cc2a0224
Auto merge of #23029 - KwanEsq:insertRuleNoIndex, r=SimonSapin
Update StyleSheet.insertRule WebIDL to make index optional.

Update wpt metadata to show the new passes.
Add one test as crashing since currently passing an \@import rule to insertRule
leads to "Expected a stylesheet loader for \@import"

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #23025
- [x] There are tests for these changes
- [x] ./mach test-wpt css/cssom passes with 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/23029)
<!-- Reviewable:end -->
2019-03-20 13:04:13 -04:00
Peter Hall
8bfd4dc1e2 #8539 Config preferences backend restructure 2019-03-20 15:01:26 +00:00
cdeler
220a471b14 implemented missed constructor for DOMException; fixed the tests expectations 2019-03-19 22:49:14 +03:00
Russell Cousineau
d9beca6fec create uuid before sending PromoteMemory message 2019-03-18 18:27:46 -07:00
Manish Goregaokar
a2c4270f55 Cleanup XRFrame 2019-03-18 16:28:37 -07:00
Manish Goregaokar
191fcf66cc Add requestReferenceSpace 2019-03-18 16:27:59 -07:00
Manish Goregaokar
f2a6164a52 Add XRReferenceSpace::identity 2019-03-18 16:27:27 -07:00
Manish Goregaokar
8f14007979 Add session parameter to XRSpace 2019-03-18 16:27:11 -07:00
Manish Goregaokar
ffacb1179e Add originOffset to XRReferenceSpace 2019-03-18 16:26:48 -07:00
Manish Goregaokar
503ea3d943 Add XRRigidTransform attributes 2019-03-18 16:26:31 -07:00
Manish Goregaokar
c775820a79 Add XRRigidTransform constructor 2019-03-18 16:26:13 -07:00
bors-servo
34fda66dfa
Auto merge of #22891 - georgeroman:implement_cdatasection, r=Manishearth
Implement CDATASection interface and createCDATASection method

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

<!-- 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/22891)
<!-- Reviewable:end -->
2019-03-18 17:22:55 -04:00
bors-servo
0fac8f2f62
Auto merge of #23021 - ejmg:assert_fail_#18439, r=jdm
Assert fail #18439

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

This PR addresses #18439 by removing an assert statement that forces a panic whenever `LoadBlocker` is dropped during a GC sweep and receives a `None` `SCRIPT_THREAD_ROOT` value from `mark_document_with_no_blocked_loads()`. Instead of panicking on the assert, we remove it and let the None value pass silently.

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

<!-- 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/23021)
<!-- Reviewable:end -->
2019-03-18 15:44:36 -04:00
Caio
1cecb080b3 Add url for LayoutImageContext 2019-03-16 12:26:31 -03:00
George Roman
4b8282b3b1 Implement CDATASection interface and createCDATASection method 2019-03-14 21:41:02 +02:00
bors-servo
bc03d32142
Auto merge of #23016 - pngai:remove-on-prefix, r=jdm
Remove 'on' prefix from event handler macros

<!-- Please describe your changes on the following line: -->
Remove 'on' prefix from event handler macros

---
<!-- 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 #22516 (GitHub issue number if applicable)

<!-- Either: -->
- [X] 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/23016)
<!-- Reviewable:end -->
2019-03-14 15:14:44 -04:00
elias
be82d7c905 ran ./mach fmt
- removed unused import in document_loader.rs
- limit unsafe block in mark_document_with_no_blocked_loads in script_thread.rs
- changed name of if let value to load in Drop for LoadBlocker in document_loader.rs
2019-03-14 14:10:29 -05:00
bors-servo
2cd454f4f8
Auto merge of #23033 - Manishearth:xhr-copies, r=jdm,emilio
Stop cloning response text on every chunk in XHR

r? @jdm

<!-- 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/23033)
<!-- Reviewable:end -->
2019-03-14 09:34:00 -04:00
Manish Goregaokar
79a565930b xhr: Reserve content-length worth of space in the response if possible 2019-03-13 23:03:45 -07:00
Manish Goregaokar
f340a5bf29 xhr: Stop cloning response text every time we get a chunk 2019-03-13 15:22:38 -07:00
Ian Moody
948e169e51 Update StyleSheet.insertRule WebIDL to make index optional.
Update wpt metadata to show the new passes.
Add one test as crashing since currently passing an @import rule to insertRule
leads to "Expected a stylesheet loader for @import"

Fixes #23025
2019-03-13 19:49:00 +00:00
Patrick Ngai
b17343a0ff Remove 'on' prefix from event handler macros 2019-03-14 00:55:21 +08:00
elias
c713febe7a let mark_document_with_no_blocked_loads() take a None value silently 2019-03-13 11:21:58 -05:00
elias
d6b3eb6db9 removed spurrious assert in Drop for LoadBlocker 2019-03-13 11:20:31 -05:00
bors-servo
c12e341c0c
Auto merge of #23007 - BartGitHub:remove-pipeline-visibility-checks, r=jdm
Remove pipeline visibility checks

<!-- Please describe your changes on the following line: -->
This includes the following changes/clean-ups:

- Remove ```is_visible``` field from ```Pipeline``` struct
- Remove ```SetVisible``` script message, and related message sending/handling.

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

<!-- Either: -->
- [x] These changes do not require tests because the issue description states having a passing build is enough for a pull request.

<!-- 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/23007)
<!-- Reviewable:end -->
2019-03-13 08:33:26 -04:00
Aron Zwaan
39c652ed13 Remove SetVisible message from iframe 2019-03-12 11:26:41 +01:00
bors-servo
9513544e91
Auto merge of #23008 - georgeroman:implement_webdriver_find_elem_from_elem, r=Manishearth
Implement WebDriver FindElementFromElement command

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

<!-- 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/23008)
<!-- Reviewable:end -->
2019-03-11 20:47:27 -04:00
bors-servo
90e5f6264c
Auto merge of #23013 - servo:rm-rooted-reference, r=jdm
Simplify RootedReference and make it specifically about slices

It's now called `DomSlice<T>`.

<!-- 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/23013)
<!-- Reviewable:end -->
2019-03-11 14:32:13 -04:00
bors-servo
f2ea73f360
Auto merge of #22802 - gterzian:only_run_tasks_for_fully_active_docs, r=nox
In BC event-loop, only run tasks related to fully-active documents

<!-- 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 #22792 (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/22802)
<!-- Reviewable:end -->
2019-03-11 12:32:03 -04:00
Anthony Ramine
4d527b20ee Simplify RootedReference and make it specifically about slicesIt's now called DomSlice<T>. 2019-03-11 16:25:39 +01:00
bors-servo
6890347cd5
Auto merge of #22966 - Goncalerta:22962, r=jdm
Simplify VideoTrackList::set_selected

---
<!-- 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
- [x] These changes fix #22962 (GitHub issue number if applicable)
- [x] These changes do not require tests because just refactors existing code

<!-- 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/22966)
<!-- Reviewable:end -->
2019-03-11 11:21:10 -04:00
Anthony Ramine
1744a42dad Don't use RootedReference for Option<T> in codegen anymore 2019-03-10 18:24:35 +01:00
Anthony Ramine
5fe5e5d6de Remove most RootedReference uses
We can replace all uses of RootedReference for Option<T> by Option::deref calls.
2019-03-10 17:51:35 +01:00
bors-servo
169b8cf144
Auto merge of #22851 - georgeroman:make_blank_target_imply_noopener, r=cybai,jdm
Make blank target imply noopener, implement "opener" link type

<!-- 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 part of #22845

<!-- 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/22851)
<!-- Reviewable:end -->
2019-03-09 16:49:00 -05:00
George Roman
46cd0d17ee Implement WebDriver FindElementFromElement command 2019-03-09 16:56:51 +02:00
bors-servo
db29cb01b0
Auto merge of #22995 - servo:jdm-patch-28, r=nox
Remove an unnecessary synchronous full reflow.

We already reflow any nodes that are dirtied during any turn of the event loop. There is no reason to synchronously reflow the entire document, especially when we don't even modify it in this method.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22988
- [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/22995)
<!-- Reviewable:end -->
2019-03-08 13:27:10 -05:00
bors-servo
ac3c002138
Auto merge of #22999 - jdm:iframe-replace, r=asajeffrey,cbrewster
Fix replacement logic when navigating nested browsing contexts

These changes also fix a bug where traversing the session history in a nested browsing context did not update the iframe's contentWindow appropriately.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22996
- [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/22999)
<!-- Reviewable:end -->
2019-03-07 21:20:14 -05:00
Josh Matthews
c2ce7d72a1 Make nested browsing context navigations check the loaded status of the active document of the nested browsing context. 2019-03-07 19:01:54 -05:00
Josh Matthews
edfd15c36f Ensure iframe's contentWindow is updated when traversing the session history. 2019-03-07 18:58:53 -05:00
Josh Matthews
a8683bc3d8
Remove an unnecessary synchronous full reflow. 2019-03-07 10:42:36 -05:00
Josh Matthews
3121f42d52 Remove offscreen_gl_context dependency from canvas_traits and script. 2019-03-07 09:27:36 -05:00
Gregory Terzian
ecfb9c639a in BC event-loop, only run tasks related to fully-active documents 2019-03-06 14:18:18 +08:00
PedroGonçaloCorreia
4b01d8ce0d Simplify VideoTrackList::set_selected 2019-03-05 11:50:48 +00:00
Manish Goregaokar
ce635b715b Add support for default dict values being boolean, use in MediaStreamConstraints 2019-03-04 15:31:47 +05:30
Manish Goregaokar
caa05948bf Add aspect/frameRate/sampleRate parameters 2019-03-04 15:31:47 +05:30
Manish Goregaokar
dd7b69b6d8 Add support for basic MediaTrackConstraints 2019-03-04 15:31:47 +05:30
bors-servo
28c6dec62d
Auto merge of #22958 - Manishearth:attrs-on-types, r=nox
Add support for attributes on types in WebIDL

WebIDL moved `[Clamp]`, `[RangeEnforced]`, and `[TreatNullAs]` to applying directly to types in https://github.com/heycam/webidl/pull/286.

I implemented parser support for this upstream in [bug 1359269](https://bugzilla.mozilla.org/show_bug.cgi?id=1359269). This pull request downstreams those changes and updates codegen as well as any webidls to conform.

Needed to land #22874

r? @nox

<!-- 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/22958)
<!-- Reviewable:end -->
2019-03-04 03:36:27 -05:00
Manish Goregaokar
7b48df53a1 Update WebIDL.py to 4166cae81546
4166cae815

Pulls in changes from https://bugzilla.mozilla.org/show_bug.cgi?id=1359269
2019-03-04 14:03:31 +05:30
bors-servo
d3ad9d6ffb
Auto merge of #22963 - servo:rustup, r=jdm
Upgrade to rustc 1.34.0-nightly (0ea22717a 2019-03-02)

<!-- 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/22963)
<!-- Reviewable:end -->
2019-03-03 14:49:25 -05:00