Commit graph

5903 commits

Author SHA1 Message Date
bors-servo
b3ae74b5c9 Auto merge of #15367 - szeged:bluetooth-webidl, r=nox
Update WebBluetooth webidl files

<!-- Please describe your changes on the following line: -->
Update the WebBluetooth related webidl files with the `[SameObject]` extended attribute, and unify the indentation in these files.

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

<!-- 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/15367)
<!-- Reviewable:end -->
2017-02-03 08:56:33 -08:00
bors-servo
cbcafd18f4 Auto merge of #15189 - jdm:microtasks, r=nox
Implement microtask checkpoints

This generalizes the work previously done for Promise job callbacks. There is now a microtask queue that correctly processes all queued microtasks after each turn of the event loop, as well as after a scripted callback finishes executing, and after a classic script executes.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #4283
- [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/15189)
<!-- Reviewable:end -->
2017-02-03 07:53:17 -08:00
Anthony Ramine
ac254046e4 Implement document.open and document.close (fixes #14591) 2017-02-03 16:50:12 +01:00
bors-servo
536c0d7499 Auto merge of #15122 - anholt:webgl-premultiply, r=emilio
webgl: premultiplication, y flipping, and format conversion

<!-- Please describe your changes on the following line: -->
This series implements a bunch of the texture unpack path features for WebGL.  There are known issues with big-endian systems noted in the comments, but I don't know of a clean way to cast from `Vec<u16>` to `Vec<u8>` (which, if we had one, would make this code much cleaner anyway).

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

<!-- 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/15122)
<!-- Reviewable:end -->
2017-02-03 06:59:11 -08:00
bors-servo
f0e21d0bbe Auto merge of #15285 - simartin:issue_15017, r=nox
Issue #15017: Properly handle and report network errors on page loads.

<!-- Please describe your changes on the following line: -->
This patch fixes how network errors are handled during page loads: they would not be reported and cause crashes before, and do not anymore.

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

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

<!-- 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/15285)
<!-- Reviewable:end -->
2017-02-03 06:04:40 -08:00
UK992
a5ce6304b1 Fix hardcoded path to link.exe 2017-02-03 13:33:37 +01:00
bors-servo
f5e35179d4 Auto merge of #15366 - szeged:name-filter-length, r=nox
Remove the 29 byte limitation, when requesting bluetooth devices

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

Remove the 29 byte limit when calling `requestDevice` using a `name` or `namePrefix`. The following discussion is about this by the specification writers: https://bugs.chromium.org/p/chromium/issues/detail?id=653718.
Related tests also got removed.

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

<!-- 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/15366)
<!-- Reviewable:end -->
2017-02-03 04:15:34 -08:00
Zakor Gyula
706cffbca8 Update WebBluetooth webidl files 2017-02-03 11:30:50 +01:00
Zakor Gyula
b52f9e483f Remove the 29 byte length restriction, when requesting bluetooth devices 2017-02-03 11:12:32 +01:00
Josh Matthews
60d1717eca Remove incorrect uses of asynchronous tasks from ServiceWorker job queue. 2017-02-01 12:54:33 -05:00
Josh Matthews
b5d2bd757b Perform a microtask checkpoint after executing classic scripts and callbacks. 2017-02-01 12:54:33 -05:00
Josh Matthews
32d4f84a30 Generalize promise job queue into solitary microtask queue. 2017-02-01 12:54:33 -05:00
bors-servo
bac2f68b54 Auto merge of #15327 - servo:missing-newline-wrap-panic, r=jdm
Add a missing newline in wrap_panic() calls.

<!-- 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/15327)
<!-- Reviewable:end -->
2017-02-01 06:25:40 -08:00
Ms2ger
49ce1332e1 Add a missing newline in wrap_panic() calls. 2017-02-01 14:46:06 +01:00
Ms2ger
d9013e069c Root the arguments to callback functions.
Note that this relies on the fact that Heap<JSVal> and JSVal are binary
compatible.

Fixes #15324.
2017-02-01 14:27:37 +01:00
Ms2ger
f376f9c2d7 Improve the readability of dictionaries' new() method. 2017-01-31 16:37:31 +01:00
Emilio Cobos Álvarez
314f2ce714
style: Define a CascadeLevel enum, and make the rule tree operate on it.
We'll use this level to know where to stop replacing nodes in the tree.
2017-01-30 23:53:53 +01:00
Emilio Cobos Álvarez
31ecc9b692
script: Don't avoid all the mutation notification methods when the style attribute changes.
Styling was correct because of the explicit dirtiness, but still not fun.

Some things, like dynamic updates to with things like [style~="color"] ~ foo
selectors, were pretty broken, because we didn't take snapshots of those
attributes.
2017-01-30 19:24:42 +01:00
Emilio Cobos Álvarez
cb304fd42c
script: insert the restyle attribute restyle hint when a style attribute is modified. 2017-01-30 19:24:42 +01:00
Emilio Cobos Álvarez
d37e6f8c66
script: Propagate the attribute into the document's element_attr_will_change method. 2017-01-30 19:24:42 +01:00
Emilio Cobos Álvarez
7a9cdbb857
style: Add a style attribute restyle hint. 2017-01-30 19:24:41 +01:00
bors-servo
81712560ca Auto merge of #15300 - servo:blob-fragment, r=Wafflespeanut
Remove unused part of the return value of parse_blob_url().

<!-- 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/15300)
<!-- Reviewable:end -->
2017-01-30 06:21:46 -08:00
Ms2ger
f4ab3ac54d Remove unused part of the return value of parse_blob_url(). 2017-01-30 15:16:27 +01:00
bors-servo
cc2011c050 Auto merge of #15264 - servo:content-type, r=nox
Always set the Document::contentType attribute in ScriptThread::load().

<!-- 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/15264)
<!-- Reviewable:end -->
2017-01-30 05:33:14 -08:00
Ms2ger
69e3173047 Always set the Document::contentType attribute in ScriptThread::load().
There's no good reason to limit this to a few particular content types.
2017-01-30 12:43:49 +01:00
Atheed Thameem
cbe0810e63 removed unused import 2017-01-29 12:52:49 -05:00
bors-servo
e58ef9115f Auto merge of #15289 - montrivo:webidl-exposed, r=cbrewster
Expose interfaces only where they should be. #12415 - Partial

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

I verified the following interfaces:
CSSStyleDeclaration.webidl
ElementCSSInlineStyle.webidl
ElementContentEditable.webidl
EventHandler.webidl
Screen.webidl
StyleSheetList.webidl
StyleSheet.webidl
Client.webidl

---
<!-- 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 #12415 (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/15289)
<!-- Reviewable:end -->
2017-01-29 00:00:19 -08:00
Alan Jeffrey
403499a9d5 Allow windows to share browsing contexts. 2017-01-28 21:57:03 -06:00
Alan Jeffrey
fc67878edf Remove warnings about unnecessary mutability. 2017-01-28 21:48:07 -06:00
Eric Anholt
fcef92f5ba webgl: Fix handling of UNPACK_ALIGNMENT.
We were setting it to whatever value from {1,2,4,8} the user requested
and otherwise ignoring it.  There were two problems there:

1) Validation ignored it, so GL could read outside of the user's array
   in TexImage() or TexSubImage() if the aligment was greater than
   cpp.

2) TexImage()/TexSubImage() from image/canvas sources wasn't packing
   its data according to the unpack alignment.

To fix this, start tracking the user-requested alignment in the DOM
side of the context.  Set the GL's alignment to 1 for image/canvas
sources or the user's value for array sources, and pass the user's
alignment in to validation so that it can figure out the correct size
of image that the GL will ready.
2017-01-28 19:27:09 -08:00
bors-servo
ec12b7665b Auto merge of #15268 - mbrubeck:sideways, r=upsuper
Make text-orientation:sideways-right an alias for sideways in Gecko

Fixes #15214. r? @upsuper

<!-- 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/15268)
<!-- Reviewable:end -->
2017-01-28 17:24:47 -08:00
montrivo
d5c6c24d2a Expose interfaces only where they should be. #12415 - Partial 2017-01-29 01:29:29 +01:00
Eric Anholt
dfc4de0d84 webgl: Add support for premultiplying alpha.
Now the affected testcase only fails due to unpack alignment.
2017-01-28 14:21:21 -08:00
Eric Anholt
57ba1646bc webgl: Convert non-raw TexImage sources to the requested format.
The code was returning RGBA8 data from the non-raw sources (HTML
canvas elements, JS ImageData, etc.), but we then validated and passed
that rgba8 data as if it was whatever format/datatype was specified in
TexImage2D/TexSubImage2D, so the pixels would come out as garbage.

It would seem like we could just rewrite the passed in format/datatype
for the TexImage call to be RGBA/UNSIGNED_BYTE, but that would leave
incorrect levels of precision if the internalformat didn't match the
format/datatype (and older desktop implementations often ignore the
internalformat in choosing their internal format, anyway).
2017-01-28 14:21:21 -08:00
Eric Anholt
2e6eb547a8 webgl: Implement FLIP_Y_AXIS unpacking flag for TexImage, TexSubImage.
This fixes a couple of tests doing RGBA/ubyte image uploads with
flipping.  Other tests with flipping get their expectations changed,
because some other feature is missing (premultiplication or
ImageData/canvas format conversion)
2017-01-28 14:21:20 -08:00
bors-servo
cd0a6b98f4 Auto merge of #15115 - Wafflespeanut:lop, r=emilio
Introduce the `NoCalcLength`

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

I began this for making the `CalcLengthOrPercentage` represent `LengthOrPercentage` (instead of the enum we already have), but only later did I realize that it will make `LengthOrPercentageOrFoo` types fatty (which is the problem we're trying to avoid - #15061) and so, I dropped that attempt. Along the way, I introduced an internal type for `Length`, for representing all its non-calc variants (which are `Copy`). We could still have this type for the `LengthOrPercentageOrFoo` types which don't really need  `Length` since they already have their own variants for calc.

r? @Manishearth @emilio @SimonSapin or anyone interested

---
<!-- 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 it's a refactor

<!-- 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/15115)
<!-- Reviewable:end -->
2017-01-28 14:08:38 -08:00
Ravi Shankar
bdb08b9a82 Change LengthOrPercentageOrAuto to make use of NoCalcLength 2017-01-29 02:30:34 +05:30
Ravi Shankar
590c9579f0 Change LengthOrPercentage to make use of NoCalcLength 2017-01-29 02:30:25 +05:30
Simon Martin
abc9f785e8 Issue #15017: Properly handle and report network errors on page loads. 2017-01-28 21:36:36 +01:00
Ravi Shankar
377a23df50 Refactor and modify stuff to make use of NoCalcLength 2017-01-29 02:04:24 +05:30
Emilio Cobos Álvarez
684545b396
script: Also do so for element owners. 2017-01-28 14:47:10 +01:00
Emilio Cobos Álvarez
9b06932535
script: Fix base url for style-rule-owned declarations. 2017-01-28 14:47:10 +01:00
Emilio Cobos Álvarez
dd90366775
script: Refactor CSSStyleDeclaration and fix some bugs in the way. 2017-01-28 14:47:09 +01:00
Matt Brubeck
b3820c1296 Convert text-orientation to a Gecko-only property
Remove incomplete and buggy support for text-orientation in Servo.
Make the property values align with Gecko and the latest draft of CSS
Writing Modes Level 3.
2017-01-27 21:12:38 -08:00
bors-servo
b5c94bad37 Auto merge of #14971 - asajeffrey:script-track-active-documents, r=cbrewster
Constellation informs script about documents becoming inactive, active or fully active.

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

This PR replaces the current freeze/thaw mechanism by messages from the constellation to script informing it about when documents become inactive, active or fully active.

This means we can now implement |Document::is_active()| which is used in |document.write|.

This PR also changes how timers work: previously they were initialized running, and were then frozen/thawed. This means there was a transitory period when timers were running even though the document was not fully active. With this PR, timers are initially suspended, and are only resumed when the document is made fully active.

---
<!-- 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 #14876
- [X] These changes do not require tests because it's an interal refactoring.

<!-- 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/14971)
<!-- Reviewable:end -->
2017-01-27 16:30:37 -08:00
Alan Jeffrey
ca9cee084e Fix document.write check for activity. 2017-01-27 17:25:40 -06:00
Alan Jeffrey
a43c842099 The constellation notifies the script thread about documents becoming inactive, active and fully active. 2017-01-27 12:39:43 -06:00
bors-servo
a1187c12ee Auto merge of #15262 - alon:master, r=Ms2ger
dom/document: scripting_enabled can be a bool. #15260

Fix #15260 - scripting_enabled can be a bool

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15260

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because - there were no tests previously (not a real good excuse :)

<!-- 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/15262)
<!-- Reviewable:end -->
2017-01-27 08:57:38 -08:00
bors-servo
ba7696ebc6 Auto merge of #15220 - nox:kill-parser-pipeline, r=SimonSapin,jdm
Kill ServoParser::pipeline

<!-- 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/15220)
<!-- Reviewable:end -->
2017-01-27 04:19:24 -08:00
Anthony Ramine
d8238646a0 Kill ServoParser::pipeline 2017-01-27 12:12:21 +01:00