Commit graph

5567 commits

Author SHA1 Message Date
Fernando Jiménez Moreno
db044bdbef Set navigation start value according to navigation timing spec 2017-07-18 17:42:14 +02:00
Austin Hicks
033b31979b Convert node serialization to a purely iterative algorithm.
We maintain a stack of open element nodes and non-node elements and use it to determine when to close them.
2017-07-17 12:24:30 -04:00
bors-servo
2bb4f65100 Auto merge of #16508 - brainlessdeveloper:fetch-set-origin, r=asajeffrey
Properly set origin of fetch requests

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

These changes aim to fix #15247

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

<!-- Either: -->
- [ ] There are tests for these changes
- [x] These changes do not require tests because cors is already tested with different origins

These changes require changes in tests, but I need help with that (see comments below).

<!-- 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/16508)
<!-- Reviewable:end -->
2017-07-17 08:29:23 -07:00
bors-servo
38f4ae80c4 Auto merge of #17739 - jdm:no-vendor-prefixed-errors, r=emilio
Suppress CSS parser errors for vendor-prefixed properties.

This matches the behaviour of Gecko's CSS parser.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #17736
- [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/17739)
<!-- Reviewable:end -->
2017-07-17 07:10:11 -07:00
Josh Matthews
94d631c1f4 Suppress CSS parser errors for vendor-prefixed properties. 2017-07-17 10:00:31 -04:00
Fausto Núñez Alberro
6032940fb8 Change RequestInit origin type to ImmutableOrigin 2017-07-16 21:44:33 +02:00
Emilio Cobos Álvarez
310be02ba8
style: Respect calc for percentages. 2017-07-14 13:43:27 +02:00
bors-servo
559c0d1d90 Auto merge of #17501 - jyc:Text-children_changed, r=emilio
Have CharacterData call children_changed on its parent when data is set.

**Can't run WPT on my computer, so pushing here to run tests 😢**

Have CharacterData.SetData call children_changed on its parent when
data is set (if it is a Text node) so that HTMLStyleElement parents can
re-parse. Add variant ChildrenMutation::Text for it to use as the
mutation.

This fixes an issue where an empty <style> element's data is set but the
style is not updated. An HTMLStyleElement parent re-parses in its
children_changed implementation.

<!-- 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 are part of a series to fix #17182 (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/17501)
<!-- Reviewable:end -->
2017-07-13 14:00:13 -07:00
Jonathan Chan
4142665282 Have CharacterData call children_changed on its parent when data is set.
Have CharacterData.SetData call children_changed on its parent when
data is set (if it is a Text node) so that HTMLStyleElement parents can
re-parse. Add variant ChildrenMutation::Text for it to use as the
mutation.

This fixes an issue where an empty <style> element's data is set but the
style is not updated. An HTMLStyleElement parent re-parses in its
children_changed implementation.
2017-07-13 13:02:27 -07:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Jonathan Chan
92ec8f15f0 Implement CSSStyleRule.selectorText.
We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
https://github.com/w3c/csswg-drafts/issues/1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext
2017-07-12 01:03:58 -07:00
bors-servo
749891e48e Auto merge of #17672 - sadmansk:heap_in_box, r=jdm
Use boxed slice instead of vec for FuntionTimerCallback

<!-- Please describe your changes on the following line: -->
Added `fn trace()` implementation for `Box<[T]>` type, and change FunctionTimerCallback to store boxed slices for heap values instead of Vector.

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

<!-- Either: -->
- [x] These changes do not require tests

<!-- 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/17672)
<!-- Reviewable:end -->
2017-07-11 18:55:18 -07:00
bors-servo
bc44246fc6 Auto merge of #17364 - asajeffrey:script-paint-worklets-properties, r=jdm
Implement paint worklet properties

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

This is the final PR to get basic paint worklet support. It adds support for paint worklet properties (https://drafts.css-houdini.org/css-paint-api/#paint-definition-input-properties). When a paint worklet is registered, it specifies a list of CSS properties, and is provided with their computed values when it is invoked.

This is a dependent PR:
* "Implemented paint worklets invoking worklet scripts" is #17239.
* "Implemented paint worklets rendering contexts" is #17326.

There should be tests added for this, hopefully the existing wpt houdini tests.

---
<!-- 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 #16839
- [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/17364)
<!-- Reviewable:end -->
2017-07-11 16:24:18 -07:00
Alan Jeffrey
ef033b8362 Implemented paint worklet properties. 2017-07-11 17:28:56 -05:00
Sadman Kazi
fa678992ff Use boxed slice instead of vec for FuntionTimerCallback 2017-07-11 14:07:40 -07:00
Josh Matthews
4c54129877 Avoid panic when postMessage targets closed window. 2017-07-11 10:37:58 -04:00
Omar Akkila
420a7878b9 Refactor HTMLImageElement::handle_event to be idiomatic
Clean up HTMLImageElement::handle_event

Area::hit_test now uses a reference instead of taking ownership

Fix trailing whitespace

Unalign => in match

Fix Area::hit_test tests to reflect updated function signature
2017-07-07 21:07:12 +04:00
bors-servo
f18782fb0e Auto merge of #17578 - pyfisch:input-event, r=jdm
Implement the InputEvent

Add WebIDL, from UI Events working draft.
Implement script type for event.

Note that actually firing InputEvents is not part of this commit.

<!-- Please describe your changes on the following line: -->
As part of my effort to improve [keyboard handling](https://groups.google.com/forum/#!topic/mozilla.dev.servo/e6R7eBDjo4M) it is necessary to introduce the InputEvent. While I have a working prototype using the input event this still needs a lot of work  before it can be merged into servo.

cc @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/17578)
<!-- Reviewable:end -->
2017-07-06 10:55:41 -07:00
Pyfisch
1102660015 Implement the InputEvent
Add WebIDL, from UI Events working draft.
Implement script type for event.

Note that actually firing InputEvents is not part of this commit.
2017-07-06 19:37:55 +02:00
bors-servo
ddd3a15b50 Auto merge of #17608 - MortimerGoro:webvr_11, r=jdm
WebVR 1.1 spec compatibility

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

Servo WebVR implementation started when WebVR spec 1.2 was about to be released. 1.2 API included some minor breaking changes from spec 1.1 in order to improve the support of the API in WebWorkers.

But eventually the WebVR  committee decided not to release 1.2 and make it a major version number with a lot more changes. WebVR API 2.0 is still under heavy churn.

This PR removes the WebVR changes that non-released 1.2 version introduced to support full WebVR 1.1 spec.

I pushed some GC fixes in a separate commit. See https://github.com/servo/servo/issues/17076 and https://github.com/servo/rust-mozjs/issues/351

---
<!-- 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: -->
- [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/17608)
<!-- Reviewable:end -->
2017-07-06 07:25:57 -07:00
Omar Akkila
186d15edc2 Clean up Area::parse (#15834)
Replace mutable reference to array with direct use

Remove unecessary clone

Replace call to unwrap()
2017-07-06 15:16:00 +04:00
Imanol Fernandez
e936eac831 GC Fixes 2017-07-05 22:38:37 +02:00
Imanol Fernandez
fe4ee6de2e WebVR 1.1 spec compatibility 2017-07-05 22:38:29 +02:00
Emilio Cobos Álvarez
1263075776
stylo: Fix StyleSheetInner/Stylesheet mapping
The key of this patch is the split between Stylesheet and StylesheetContents.

Gecko will use StylesheetContents, which maps to a ServoStyleSheetInner.
2017-07-02 15:49:40 +02:00
Alan Jeffrey
328fb25a65 Implemented paint worklet rendering context. 2017-06-30 16:41:08 -05:00
Alan Jeffrey
3db4761767 Implemented paint worklets invoking worklet scripts. 2017-06-29 17:32:21 -05:00
Matt Brubeck
f511a77ec5 Stop using the unstable optin_builtin_traits feature 2017-06-28 15:00:21 -07:00
bors-servo
51dd0c65cd Auto merge of #17527 - cbrewster:iframe_cycles, r=asajeffrey
Don't return window proxy if it has been discarded

<!-- 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 #17479 (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/17527)
<!-- Reviewable:end -->
2017-06-28 01:59:16 -07:00
Connor Brewster
79f3237692 Don't return window proxy if it has been discarded 2017-06-27 22:14:19 -10:00
bors-servo
65ff4a399c Auto merge of #17535 - jyc:unsafe-no-jsmanaged-field-ty, r=jdm
Have unsafe_no_jsmanaged_fields! macro take a type as argument rather than an ident.

We only write unsafe_no_jsmanaged_fields!(SomeType), and the
documentation says it is to be used for types.

<!-- 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
- [ ] 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 should be checked at compile time

<!-- 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/17535)
<!-- Reviewable:end -->
2017-06-28 00:25:03 -07:00
Jonathan Chan
a4cbbeef14 Have unsafe_no_jsmanaged_fields! macro take a type as argument rather than an ident.
We only write unsafe_no_jsmanaged_fields!(SomeType), and the
documentation says it is to be used for types.
2017-06-27 15:59:00 -07:00
streichgeorg
fa6fc141c8 replaced ParseNodeID with ParseNodeId 2017-06-26 14:06:26 +02:00
bors-servo
f740366c61 Auto merge of #17515 - frewsxcv:frewsxcv-simple-node-iterator, r=KiChjang
Merge explicit node iterator structures into single generic structure.

<!-- 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/17515)
<!-- Reviewable:end -->
2017-06-25 00:38:23 -07:00
Corey Farwell
011ff28aee Merge explicit node iterator structures into single generic structure. 2017-06-25 00:29:08 -04:00
bors-servo
bc3ec0ce1b Auto merge of #17381 - cbrewster:custom_element_creation, r=jdm
Custom element creation

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

This implements the CE-related steps when creating elements. `is` is now support by `document.createElement` and is stored on `Element`s. Only synchronously created autonomous elements are supported as async element creation and customized built-in elements both require custom element upgrade reactions.

Spec: https://dom.spec.whatwg.org/#concept-create-element

---
<!-- 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 #17191 (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/17381)
<!-- Reviewable:end -->
2017-06-23 21:08:40 -07:00
Connor Brewster
37e8b89377 Allow element prefix to be set
Implements step 6.1.10 of
https://dom.spec.whatwg.org/#concept-create-element
2017-06-23 21:10:01 -06:00
Connor Brewster
062b128688 Add flag for sync/async CE creation 2017-06-23 21:09:57 -06:00
Connor Brewster
2f36d3544f Support is option when creating elements 2017-06-23 21:09:55 -06:00
Connor Brewster
6697f5469d Hook CE registry into element creation 2017-06-23 21:09:53 -06:00
bors-servo
1d045e5c3b Auto merge of #17503 - frewsxcv:frewsxcv-return-node-list-2, r=mbrubeck
Replace iterator struct with anonymous return iterator types.

Similar to https://github.com/servo/servo/pull/17488.

<!-- 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/17503)
<!-- Reviewable:end -->
2017-06-23 19:01:33 -07:00
Corey Farwell
0cabc5c7fd Replace iterator struct with anonymous return iterator types.
Similar to https://github.com/servo/servo/pull/17488.
2017-06-23 18:51:46 -04:00
bors-servo
e2a26e7bd0 Auto merge of #17491 - KiChjang:update-fetch, r=jdm
Introduce service-worker mode

Bringing in the spec changes from whatwg/fetch#435.

<!-- 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/17491)
<!-- Reviewable:end -->
2017-06-23 14:56:00 -07:00
bors-servo
bc5e8f89ff Auto merge of #17488 - frewsxcv:frewsxcv-return-node-list, r=jdm
Replace iterator struct with anonymous return iterator type.

```
hi servo. it's been
some time. here's a pull request.
i hope you like it.
```

<!-- 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/17488)
<!-- Reviewable:end -->
2017-06-23 12:38:02 -07:00
bors-servo
7e493529f0 Auto merge of #17259 - jyc:new-CSSStyleSheet, r=emilio
Force HTMLStyleElement to create a new CSSStyleSheet when re-parsing.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

- [X] These changes do not require tests because I'm pushing to find out what test results this changes; this is part of a series of PRs to fix bug #17182

<!-- 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/17259)
<!-- Reviewable:end -->
2017-06-23 11:37:23 -07:00
bors-servo
626c029623 Auto merge of #17385 - pyfisch:better-scroll, r=mrobinson
Fix several bugs related to scrolling

* scrollLeft/scrollTop returned values of parent or even document root
   Only the scroll of the node itself is returned. Otherwise 0.0.
* Scrolling via script had set viewport.
   This resulted in other nodes appearing scrolled.
   Now scroll_offsets are updated with correct node id.

These bugs caused other odd behavior like both body and
document.documentElement being scrolled or the view for scrolled
elements jumping.

Also try scrolling this [example page](https://pyfisch.org/stuff/scrolltest.html) in servo with and without this change.

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

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

<!-- 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/17385)
<!-- Reviewable:end -->
2017-06-23 01:50:39 -07:00
Keith Yeung
6adc653083 Introduce service-worker mode 2017-06-22 23:48:07 -07:00
bors-servo
dd7540a5d4 Auto merge of #17472 - moonlightdrive:globalscope-current-option, r=asajeffrey
return Option from GlobalScope::current

<!-- Please describe your changes on the following line: -->
handles the case where `GlobalScope::current` calls `CurrentGlobalOrNull` and the result is null

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because: no functionality change & ./mach build -d has no 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/17472)
<!-- Reviewable:end -->
2017-06-22 22:01:43 -07:00
Corey Farwell
917fe9241a Replace iterator struct with anonymous return iterator type. 2017-06-22 23:49:38 -04:00
Jonathan Chan
80dee7a65f Force HTMLStyleElement to create a new CSSStyleSheet when re-parsing.
We already call Document::invalidate_style_sheets and set
the stylesheet member to a new Stylesheet. This matches the behavior of
Firefox, and means the new CSSStyleSheet you get from accessing .sheet
from JS will be correct instead of stale.

(::get_cssom_stylesheet already tries to use the new Stylesheet, but
MutNullableJS::or_init is called, so if we already created a
CSSStyleSheet we will continue to return that one).
2017-06-22 15:51:59 -07:00
Jyotsna Prakash
433cd90bc3 return Option from GlobalScope::current
handles the case where GlobalScope::current calls CurrentGlobalOrNull
and the result is null
2017-06-22 10:04:06 -07:00