Commit graph

19254 commits

Author SHA1 Message Date
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
Emilio Cobos Álvarez
bbb59614fa
Fix Servo build. 2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
f4cff20649
style: Appease tidy. 2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
38cbada278
style: Optimize QuerySelector in shadow trees.
Pretty much the same setup we have for document.

We have the awkwardness of having to check containing shadow manually for
ShadowRoot because it's not available in TNode (and making it available added a
bit more complexity that wasn't worth it IMO).

Bug: 1464428
Reviewed-by: xidorn
MozReview-Commit-ID: CqOh0sLHf6o
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
82e97b8ec5
style: The fix: scale and translate appropriately.
Loops are hard. This hasn't been the funniest Saturday evening.

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: I8rfuIRIsrY
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
b199ca864a
style: Move skew and rotation application to their own scope for clarity.
The skew resetting of temp I think fixes a bug in presence of skew in every
direction, but again haven't double-checked.

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: Bn93CoaG8Bu
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
66b8bd2829
style: Cleanup multiply().
We assign all the members, the result matrix doesn't really need to be any clone
of a.

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: 3NkhvyfqQL
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
4c51624bcf
style: Add a FIXME comment which I think reveals a bug but I haven't confirmed it.
Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: DgCfqA5TNzP
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
875c4ff621
style: Cleanup and add references to decompose_3d_matrix.
Same, no functional change, but I basically rewrote this two times so...

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: FXOnJDPyPu5
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
6ddb04a483
style: Cleanup and add references to Quaternion::animate.
No functional change, but I did this while searching for the bug.

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: KsJxFoYaOq1
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
99d4e7b65c
style: Trivial cleanup.
Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: K7zVYGiYAn6
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
92b856b70a
style: Reuse computed rotate animation.
I have the feeling this fixes a bug, but...

Bug: 1464615
Reviewed-by: hiro
MozReview-Commit-ID: Aj478qCbMV9
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
2e500d70ef
style: Match rotate ops.
Per bug 1322189 we really should. I've copied the setup we have already for
translate / scale, but we should really clean this up a bit more I'd think.

In any case, probably skew should be matched as well...

Bug: 1464615
Reviewed-by: hiro
MozReview-Commit-ID: Jky5k8HVfuH
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
01f805af9f
style: Make the general setup for computed style bits nicer.
This patch:

 * Makes StyleStructID an enum class, and moves it to the mozilla namespaces.

 * Introduces StyleStructConstants with some constants scattered through the
   codebase.

 * Makes the computed style bits an enum class, and splits mPseudoType and mBits
   into their own members, since we were using a uint64_t when we have only a
   couple flags and CSSPseudoElementType is a byte. We statically assert that
   the number of style structs is less or equal to 32.

 * Makes mPseudoTag, mPseudoType and mBits const, since we don't want them to be
   mutated from C++, and we still need a few more refactorings (mostly getting
   rid of FinishStyle) to avoid mutating ComputedStyle instead.

Bug: 1464060
Reviewed-by: xidorn
MozReview-Commit-ID: 7qsTtASGcYB
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
6b19318cc8
style: Remove a bunch of unused style bits.
Bug: 1464060
MozReview-Commit-ID: FLACqfSHfSO
2018-05-28 15:39:28 +02:00
Emilio Cobos Álvarez
2c1ec89943
style: Cleanup single transform functions that can't really error.
Also call them "resolve" since it's the general term for computing something
more specific than what you have.

Though I don't feel strongly about that, feel free to push back.

Bug: 1464595
Reviewed-by: hiro
MozReview-Commit-ID: KtqjzlppZLp
2018-05-28 15:39:13 +02:00
Emilio Cobos Álvarez
8ad595666f
style: Use a static atom instead of a dynamic one.
MozReview-Commit-ID: CUTwfsCrovQ
2018-05-28 15:39:06 +02:00
Emilio Cobos Álvarez
a360dbf98d
style: Remove dead and unsafe code.
MozReview-Commit-ID: 9seuLNCJAqz
2018-05-28 15:38:56 +02:00
Xidorn Quan
8f367be650
style: Don't generate catch-all branch if a image layer keyword value is exhaustive.
Bug: 1463978
Reviewed-by: emilio
MozReview-Commit-ID: H8T9Low6kqY
2018-05-28 15:38:40 +02:00
Xidorn Quan
6306cc7e2d
style: Ensure modified_reset is set when {mutate,take}_reset_struct is called.
Bug: 1463603
Reviewed-by: heycam
MozReview-Commit-ID: 8mqVb7kl0ok
2018-05-28 15:38:22 +02:00
Emilio Cobos Álvarez
5fc6b47d74
followup: Add a comment regarding why a type is generic.
Bug: 1462829
Rubber-stamped-by: xidorn
MozReview-Commit-ID: 5DE8W2n1NP
2018-05-28 15:38:04 +02:00
Olli Pettay
f82bf81f8e
style: Make mBindingParent strong.
Bug: 1463116
Reviewed-by: bz
2018-05-28 15:37:47 +02:00
Emilio Cobos Álvarez
32c6d5b7c6
style: Refactor vector types.
This fixes clamping of mask-size and moves it out of mako while at it.

Bug: 1462829
Reviewed-by: hiro,xidorn
MozReview-Commit-ID: 9hiTe63odna
2018-05-28 15:37:28 +02:00
Xidorn Quan
3016a7f552
style: Add scrollbar-{face,track}-color properties.
Bug: 1460456
Reviewed-by: heycam
MozReview-Commit-ID: ImNfHHfzRdM
2018-05-28 15:37:12 +02:00
Xidorn Quan
1b236bf620
style: Rename CaretColor to ColorOrAuto for reusing.
Bug: 1460456
Reviewed-by: heycam
MozReview-Commit-ID: LD6PlNI60GC
2018-05-28 15:36:55 +02:00
tigercosmos
423d417dd7 fix logic in overflow_direction, also add a FIXME 2018-05-26 10:31:26 -07: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
91a27ea277
Auto merge of #20857 - servo:simd, r=nox
Use std::simd instead of the simd crate

<!-- 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/20857)
<!-- Reviewable:end -->
2018-05-25 04:15:07 -04: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
Matt Brubeck
baf7dbf064 Basic pinch zoom handling 2018-05-24 14:42:46 -07:00
Simon Sapin
266cb29788 Use std::simd instead of the simd crate 2018-05-24 17:39:38 +02: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
bors-servo
d6c4c743fb
Auto merge of #20771 - servo:webgl, r=emilio
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.

<!-- 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/20771)
<!-- Reviewable:end -->
2018-05-24 06:32:40 -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
bors-servo
0cad37718d
Auto merge of #20840 - fabricedesre:save-localstorage, r=Manishearth
Save local storage at every change and not just on shutdown

<!-- Please describe your changes on the following line: -->
Currently local storage is saved to `local_data.json` only at shutdown when the storage thread receives the `StorageThreadMsg::Exit` message. This is not reliable enough in any case, and especially problematic for a young engine like Servo. Data loss ensues...

I kept the exit message in the storage thread even if we are not doing work anymore. I can remove it if needed but it should be useful once we move to a better storage backend than a json file.

---
<!-- 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 we don't have tests for that persistence layer.

<!-- 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/20840)
<!-- Reviewable:end -->
2018-05-23 15:40:30 -04:00
Gregory Terzian
2812b3cf4a send message to embedder in prompt_to_unload 2018-05-23 21:46:05 +08:00
Gregory Terzian
4234b1252a move top_level_browsing_context_id out of embedder msg 2018-05-23 21:46:05 +08:00
Gregory Terzian
d438240772 move msg to embedder_traits, use in script, handle send error in embedder 2018-05-23 21:45:57 +08:00
Gregory Terzian
57c0d82944 prevent overwriting of salvageable state in later prompt/unload steps 2018-05-22 18:11:45 +08:00
Emilio Cobos Álvarez
b6a17426a0
style: Fix font-stretch animation.
This is a regression from #20506 which Gecko tests caught while trying to import
this.
2018-05-21 11:57:03 +02:00
Fabrice Desré
20266fa103 Save local storage at every change and not just on shutdown 2018-05-20 12:15:02 -07:00
Emilio Cobos Álvarez
fade636ebe
style: Fix Gecko build after #20506. 2018-05-20 20:12:30 +02:00
Mats Palmgren
34722c3de9
style: Inlinify display:list-item to display:inline for now, until we support 'display:inline list-item' properly.
Bug: 1461039
Reviewed-by: xidorn
2018-05-20 18:59:14 +02:00
Xidorn Quan
514aba51ad
style: Use RefPtr::new instead of RefPtr::from_ptr_ref + clone.
Bug: 1461858
Reviewed-by: emilio
2018-05-20 18:58:44 +02:00
Xidorn Quan
ecb2ec63de
style: Rename from_url_value_data to from_url_value and reuse URLValue passed in for ComputedUrl.
Bug: 1461858
Reviewed-by: emilio
MozReview-Commit-ID: LJGm3lUS9mD
2018-05-20 18:58:31 +02:00
Xidorn Quan
5b0903e604
style: Have from_image_request reuse ImageValue from image request directly.
And also remove ComputedImageUrl::from_url_value_data.

Bug: 1461858
Reviewed-by: emilio
MozReview-Commit-ID: 5zifQlU7tOz
2018-05-20 18:58:13 +02:00
Xidorn Quan
45a37503af
style: Make from_image_request infallible.
All callsites already assert, so moving the assertion into the method
should be fine. It is not expected to handle a null image value anyway.

Bug: 1461858
Reviewed-by: emilio
MozReview-Commit-ID: J8CA8m22eSv
2018-05-20 18:57:55 +02:00