Commit graph

5713 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
d8a22d8bd7
style: Fix starts_with_ignore_ascii_case.
In particular, fix a panic when the input is not ASCII and we happen to index in
something that is not a char boundary.

This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1379380
2017-07-08 19:32:11 +02: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
Gecko Backout
32269fa7cc Backed out changeset fec394734f83 (bug 17624) for build bustage a=backout CLOSED TREE
Backs out https://github.com/servo/servo/pull/17624
2017-07-06 21:58:15 +00:00
bors-servo
585468da9a Auto merge of #17624 - jdm:stylo-error-reporter, r=emilio
Hook up Stylo error reporter to Firefox devtools

Reviewed by @emilio in https://bugzilla.mozilla.org/show_bug.cgi?id=1352669.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [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/17624)
<!-- Reviewable:end -->
2017-07-06 11:44:47 -07:00
Josh Matthews
f5a3830ea2 stylo: Update rust-cssparser; extract more specific error types when reporting (bug 1352669). 2017-07-06 14:32:37 -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
Imanol Fernandez
fe4ee6de2e WebVR 1.1 spec compatibility 2017-07-05 22:38:29 +02:00
Alan Jeffrey
0b7a43da6b Clear canvas thread state on recreation. 2017-07-05 13:33:21 -05:00
bors-servo
d52a08a5c5 Auto merge of #17568 - upsuper:user-select, r=Manishearth
Handle prefixed value of -moz-user-select properly

This is supposed to fix [bug 1374996](https://bugzilla.mozilla.org/show_bug.cgi?id=1374996).

<!-- 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/17568)
<!-- Reviewable:end -->
2017-07-03 21:56:19 -07:00
bors-servo
fe666eb724 Auto merge of #17599 - asajeffrey:script-worklets-wpt-tests, r=jdm
Copied w3c css-paint-api wpt test suite into tests/wpt/mozilla

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

As a stop-gap until #17416 lands, copy the css-paint-api wpt tests into the mozilla directory.

---
<!-- 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] 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/17599)
<!-- Reviewable:end -->
2017-07-03 18:11:31 -07:00
bors-servo
7a71035793 Auto merge of #17268 - servo:grid, r=wafflespeanut,canaltinova
Add support for subgrids and fix some other grid properties

This covers the `subgrid <line-name-lists>?` for `grid-template` (for gecko, and hence, stylo).

<!-- 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/17268)
<!-- Reviewable:end -->
2017-07-03 17:10:25 -07:00
Ravi Shankar
9d9d99ec25 Switch to GridTemplateComponent for subgrid line names 2017-07-03 17:08:00 -07:00
Alan Jeffrey
fc6c1bfc9d Copied w3c css-paint-api wpt test suite into tests/wpt/mozilla. 2017-07-03 16:43:47 -05: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
Matt Brubeck
2aef2af9b8 Update flags for absolutely positioned elements on style changes
Fixes #17307.
2017-06-30 22:14:28 -07: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
Xidorn Quan
9299a0dc2c Handle prefixed value of -moz-user-select properly 2017-06-29 14:37:28 -07:00
Anthony Ramine
9ab0b9b4ac Introduce ToAnimatedValue 🎥 2017-06-29 14:03:15 +02:00
bors-servo
522d24d126 Auto merge of #17543 - servo:derive-all-the-things, r=emilio
Make text-shadow and box-shadow use SimpleShadow

<!-- 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/17543)
<!-- Reviewable:end -->
2017-06-28 07:28:45 -07:00
Anthony Ramine
201d7e79e7 Make text-shadow and box-shadow use SimpleShadow 2017-06-28 16:28:25 +02: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
083bb49d0d Auto merge of #17524 - HarveyHunt:rename_privatize_test, r=jdm
tests: Rename privatize.rs to deny_public_fields.rs

Privatize is no longer mentioned in the codebase, as of 8bcf36b9a5, so
rename the relevant test to avoid confusion.

---
<!-- 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] These changes do not require tests because the affected file is a test itself.

<!-- 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/17524)
<!-- Reviewable:end -->
2017-06-27 09:25:46 -07:00
Zakor Gyula
649ccef021 Move Bluetooth WPT tests one directory up 2017-06-27 12:16:26 +02:00
Harvey Hunt
eb98adf039 tests: Rename privatize.rs to deny_public_fields.rs
Privatize is no longer mentioned in the codebase, as of 8bcf36b9a5, so
rename the relevant test to avoid confusion.
2017-06-26 22:44:44 +01:00
Harvey Hunt
6081241962 deny_public_fields: display field identifier in help message
Use a binding's field identifier to produce more descriptive output.
Fall back to a binding's identifier if a field identifier is not
available.

Additionally, make the privatize.rs compiletest more specific and
wrap the identifier in backticks to aid readability.
2017-06-25 18:12:43 +01: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
dd9bb0550b Fix broken path to CE helper file 2017-06-23 21:09:59 -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
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
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
bf7f1d7ab0 Auto merge of #17480 - asajeffrey:wpt-reenable-iframe-append-to-child-document, r=emilio
Re-enabled iframe-append-to-child-document.html

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

Re-enabled a WPT test. Don't get too excited, the test FAILs.

---
<!-- 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 #15196
- [X] These changes do not require tests because it's re-enabling a test.

<!-- 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/17480)
<!-- Reviewable:end -->
2017-06-23 08:23:01 -07:00
bors-servo
92679480b1 Auto merge of #17469 - nox:empty-vs-initial, r=emilio
Distinguish the emptiness of a property from its initial value

<!-- 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/17469)
<!-- Reviewable:end -->
2017-06-23 05:59:49 -07:00
Anthony Ramine
f01ea53ac1 Distinguish the emptiness of a property from its initial value 2017-06-23 12:39:44 +02:00
bors-servo
9c08a7b5c4 Auto merge of #17475 - asajeffrey:wpt-workers-exception-handling, r=jdm
Added exception-handling to worker wpt tests.

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

Added exception-handling to worker wpt 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 #15668 and #17460
- [X] These changes do not require tests because these are 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/17475)
<!-- Reviewable:end -->
2017-06-23 02:45:19 -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
9ba71fcd57 Auto merge of #17481 - jryans:move-rule-node, r=bholley
Stylo: Move match and cascade temporaries to CurrentElementInfo

https://bugzilla.mozilla.org/show_bug.cgi?id=1370719

<!-- 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/17481)
<!-- Reviewable:end -->
2017-06-22 17:46:55 -07: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
Nazım Can Altınova
5362c5ee74 Bump cssparser version to 0.16.1 in toml files 2017-06-22 15:44:03 -07:00
J. Ryan Stinnett
87c51bd8bf Shrink ElementData by moving pseudo count to type
`ElementStyles` holds an optional list of values for each eager pseudo-element.
However, the type was declared as a slice instead of a fixed size array, so an
extra 8 bytes were being allocated to hold the size, even though it never
changes.

Moving the constant size into the type reduces `ElementStyles` and `ElementData`
by 8 bytes.

MozReview-Commit-ID: GaO6DKFxUMo
2017-06-22 15:47:34 -05:00
J. Ryan Stinnett
2b5c56e6a8 Move match and cascade temporaries to CurrentElementInfo
Before this change, the `ComputedStyle` struct that is part of permanent style
data per element holds 2 `StrongRuleNode`s (unvisited and visited) and 2
`Arc<ComputedValues>` (unvisited and visited).

Both rule nodes and the visited values don't actually need to be here.  This
patch moves these 3 to new temporary storage in `CascadeInputs` on
`CurrentElementInfo` during the match and cascade process.  Rule nodes are
pushed down inside the `ComputedValues` for later access after the cascade.
(Visited values were already available there.)

The permanent style data per element now has just the `Arc<ComputedValues>` for
itself and eager pseudo-elements (plus the `RestyleHint`).

MozReview-Commit-ID: 3wq52ERMpdi
2017-06-22 15:47:32 -05:00
Alan Jeffrey
d70964b881 Re-enabled iframe-append-to-child-document.html 2017-06-22 15:25:14 -05:00
Alan Jeffrey
030e01c1d1 Added exception-handling to worker wpt tests. 2017-06-22 11:28:58 -05:00
bors-servo
813eed222e Auto merge of #17456 - asajeffrey:script-paint-worklets-size, r=emilio
Paint worklet size should agree with Chrome.

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

Getting our implementation to agree with Chrome about the definition of the size parameter to a paint worklet.

---
<!-- 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 #17376
- [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/17456)
<!-- Reviewable:end -->
2017-06-22 07:54:10 -07:00