Commit graph

16726 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
0b930255f4
style: Early return and skip duplicate assertion in matching.rs 2017-09-25 10:59:34 +02:00
Hiroyuki Ikezoe
aefea7230f Handle display property change from 'none' only if there is restyle hint for SMIL
We only need to handle changes when the display property is changed from 'none'
when we have a restyle hint for SMIL.  The only other case where we expect to
see changes to display property during an animation are from using the CSSOM.
However, when the display property is changed from 'none' by the CSSOM, during
the animation-only restyle we can skip all descendants since they will be
traversed in the subsequent normal traversal because at that time we flush
style sheets and traverse all elements in the document. So we don't need to
care about the descendants during animation-only restyle.
2017-09-25 13:53:30 +09:00
Hiroyuki Ikezoe
fd0295ead2 Use 4-spaces instead of 2-spaced 2017-09-25 13:49:17 +09:00
bors-servo
dd6aae9d52 Auto merge of #18621 - emilio:unused-crate, r=glennw
selectors: Remove unused 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/18621)
<!-- Reviewable:end -->
2017-09-24 21:05:49 -05:00
bors-servo
4628db1495 Auto merge of #18620 - emilio:bye-unsafe-node, r=glennw
style: Remove UnsafeNode.

No longer needed since a while ago.

<!-- 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/18620)
<!-- Reviewable:end -->
2017-09-24 20:04:58 -05:00
Emilio Cobos Álvarez
4f984a6428
selectors: Remove unused crate. 2017-09-25 02:01:55 +02:00
Emilio Cobos Álvarez
e3c58df155
style: Remove UnsafeNode.
No longer needed since a while ago.
2017-09-25 01:58:52 +02:00
bors-servo
61f0fc199e Auto merge of #18598 - glennw:update-wr-driver-bug, r=emilio
Update WR (work around a mac GL driver bug).

Also includes updates to the mac core-* crates and friends.

<!-- 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/18598)
<!-- Reviewable:end -->
2017-09-24 16:13:47 -05:00
Manish Goregaokar
b238eae66c Add FIXME for font-size animated value 2017-09-24 00:47:54 -07:00
Manish Goregaokar
ce7d82e9c4 stylo: Animate font-size as NonNegativeLength 2017-09-23 16:22:42 -07:00
bors-servo
35aad08619 Auto merge of #18603 - tigercosmos:allocating, r=KiChjang
fix #18594: Unnecessarily allocating an error string

<!-- Please describe your changes on the following line: -->
r? @asajeffrey

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] 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/18603)
<!-- Reviewable:end -->
2017-09-23 17:11:51 -05:00
Manish Goregaokar
cd6f68c545 stylo: Clean up keyword values 2017-09-23 11:02:22 -07:00
Manish Goregaokar
df9d7cd941 stylo: Move font-size stuff to values::*::font 2017-09-23 10:52:07 -07:00
Manish Goregaokar
e1a39a2012 stylo: Remove FontComputationData, switch over to using the new font tracking 2017-09-23 10:51:55 -07:00
Manish Goregaokar
c73dc5704b stylo: Add font keyword info fields on nsStyleFont 2017-09-23 10:51:44 -07:00
Manish Goregaokar
c2fcc9ce1a stylo: Add keyword info to computed value of font-size 2017-09-23 10:51:21 -07:00
tigercosmos
7db47f8084 fix #18594: Unnecessarily allocating an error string 2017-09-23 22:42:34 +08:00
Emilio Cobos Álvarez
fed5960f2c
style: Make sure to not run any style invalidation in an unstyled children only traversal.
Bug: 1402472
Reviewed-by: bholley
MozReview-Commit-ID: IFPA7LJpvsZ
2017-09-23 04:15:01 +02:00
Matt Brubeck
4c4dbf5a7a Remove unused 'untagged_unions' feature gate 2017-09-22 12:17:47 -07:00
bors-servo
c48ef50b72 Auto merge of #18514 - asajeffrey:layout-dont-panic-if-no-iframe-bc, r=emilio
Remove sources of panic when laying out an iframe without a nested browsing context

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

At the moment, layout panics if it discovers an iframe without a nested browsing context. Under normal circumstances, this is reasonable, but it requires very tight synchronization between script, layout, the constellation and the compositor. In particular, if a layout is in progress when an iframe's browsing context is discarded, this can trigger panic.

This PR fixes this in two ways:

1. Making the pipeline and browsing context ids optional in layout's representation of an iframe.
2. Shutting down layout before discarding a browsing context, rather than after.

This is belt and braces.

---
<!-- 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 #17482 and #18477
- [X] These changes do not require tests because the PR is fixing a panic caused by a race condition

<!-- 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/18514)
<!-- Reviewable:end -->
2017-09-22 09:34:12 -05:00
Alan Jeffrey
fbfb9a80b4 Remove sources of panic when laying out an iframe without a nested browsing context. 2017-09-22 09:04:18 -05:00
bors-servo
4af0d9acb3 Auto merge of #18600 - servo:promises, r=<try>
Improve Promise

The elephant 🐘 (not PHP's) still remains in the room: `Rc<Promise>` shouldn't require `#⁠[allow(unrooted_must_root)]`.

<!-- 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/18600)
<!-- Reviewable:end -->
2017-09-22 07:36:38 -05:00
Anthony Ramine
386973efeb Make Promise::new_resolved unsafe 2017-09-22 14:18:32 +02:00
Anthony Ramine
a69c5da208 Make Promise::new_rejected unsafe 2017-09-22 14:18:28 +02:00
Anthony Ramine
860f2d806f Rename Promise::is_settled to Promise::is_fulfilled 2017-09-22 14:18:25 +02:00
Anthony Ramine
dabecfade6 Remove unused method Promise::then 2017-09-22 14:18:23 +02:00
Anthony Ramine
d31018d444 Make Promise::reject unsafe 2017-09-22 14:18:20 +02:00
Anthony Ramine
d246c5cf20 Remove JSContext argument from AsyncBluetoothListener::handle_response 2017-09-22 13:56:31 +02:00
Glenn Watson
153e0a1dad Update WR (workaround a mac GL driver bug).
Also includes updates to the mac core-* crates and friends.
2017-09-22 14:46:40 +10:00
bors-servo
a8a25dac52 Auto merge of #18553 - mdboom:tidy-support-multiline-strings, r=wafflespeanut
Make tidy aware of Rust multiline strings

<!-- Please describe your changes on the following line: -->
This makes the internal tidy script properly ignore the contents of Rust multiline strings.

---
<!-- 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 #18551 (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/18553)
<!-- Reviewable:end -->
2017-09-21 23:38:29 -05:00
Anthony Ramine
2400731bfc Make Promise::resolve unsafe 2017-09-22 02:15:28 +02:00
Anthony Ramine
5994e40070 Use Promise::resolve_native in fullscreen tasks 2017-09-22 02:15:26 +02:00
Anthony Ramine
af2e83f378 Make Promise::reject_error sound 2017-09-22 02:15:22 +02:00
bors-servo
be9c8ec07a Auto merge of #18595 - bholley:nth_index_cache, r=emilio
Implement an nth-index cache

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

<!-- 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/18595)
<!-- Reviewable:end -->
2017-09-21 18:10:05 -05:00
Bobby Holley
438740b912 Implement an nth-index cache.
MozReview-Commit-ID: Ee0um3QXkxl
2017-09-21 15:25:38 -07:00
bors-servo
83705a8fa8 Auto merge of #18593 - jryans:stylo-anim-inherit-context, r=heycam
Update inherited prop state for animation

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

<!-- 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/18593)
<!-- Reviewable:end -->
2017-09-21 16:43:37 -05:00
Michael Droettboom
c9dafda03a Make tidy aware of Rust multiline strings
As a result of tighter and more correct handling of character
literals, this now catches a few kinds of syntax involving lifetimes
that were previously missed, so those have been updated.
2017-09-21 17:17:47 -04:00
J. Ryan Stinnett
c5c604b9c4 Update inherited prop state for animation
`AnimationValue` has its own path for conversion to computed values, so we need
to update `for_non_inherited_property` in the context to match the property
being converted.

I didn't notice any other generic conversions, so hopefully this is the only
missing path.

MozReview-Commit-ID: HskrpMctmYE
2017-09-21 15:52:35 -05:00
bors-servo
29517d553e Auto merge of #18579 - mbrubeck:features, r=KiChjang
Remove unused feature gates

CC #5286.

---
- [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 no code 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/18579)
<!-- Reviewable:end -->
2017-09-21 15:08:04 -05:00
bors-servo
5c797d1943 Auto merge of #18059 - sendilkumarn:mito, r=nox
Using OnceCell<T> from Mitochondria

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

<!-- 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/18059)
<!-- Reviewable:end -->
2017-09-21 13:20:29 -05:00
Matt Brubeck
2f030966bf Split feature gates into lines for easy grepping 2017-09-21 09:40:46 -07:00
Anthony Ramine
15acd1525e Make Promise::reject_native sound 2017-09-21 16:19:29 +02:00
Anthony Ramine
5addc2dfa3 Make Promise::resolve_native actually sound
We shouldn't have to pass a raw JSContext pointer, and to enter the
promise's context's compartment by hand.
2017-09-21 16:00:48 +02:00
Anthony Ramine
658dc8a501 Rename a couple of Promise methods 2017-09-21 15:35:04 +02:00
bors-servo
581f0bf09a Auto merge of #18590 - hiikezoe:increment-ref-count-for-will-change, r=xidorn
Use Atom::from(nsIAtom) to increment reference count in case of dynam…

…ic atom for will-change.

If we don't increment the reference count for the Atom in servo side, it's
possible to try to release the Atom in servo side even if we have already
released in gecko side.  When it happens, nsIAtom::mKind is no longer reliable.

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

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

<!-- 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/18590)
<!-- Reviewable:end -->
2017-09-21 04:18:28 -05:00
bors-servo
ce7cee75e4 Auto merge of #18591 - chenpighead:stylo-singular-matrix-animation, r=BorisChiou
stylo: do not handle the fallback discrete animation inside the Animate trait

At present, we do the fallback discrete animation for non-invertible matrices in
ComputedMatrix.animate(). However, according to the spec, we should fallback to
discrete animation for cases like:

1. animation between transform with single non-invertible matrix
2. animation between transform with matched transform functions that have at least
   one non-invertible matrix
2. animation between transform with mismatched transform functions that have at
   least one non-invertible matrix.

The current implementation only handles the first case.

Moreover, we already have fallback discrete animation procedures in CSS Animation
and Web Animation, so we should be able to not doing any fallback inside the
Animate trait.

In this patch, we let the animation between non-invertible matrices to return Err().
So, we can propagate the Err() to the callers, and let the fallback discrete
animation procedure stay at the Servo_MatrixTransform_Operate, which is ouside
the Animate trait.

Gecko bug: [Bug 1394284](https://bugzilla.mozilla.org/show_bug.cgi?id=1394284)

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1394284](https://bugzilla.mozilla.org/show_bug.cgi?id=1394284)
- [X] There are wpt tests for these changes, and thet will be landed in [Bug 1394284](https://bugzilla.mozilla.org/show_bug.cgi?id=1394284)

<!-- 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/18591)
<!-- Reviewable:end -->
2017-09-21 03:16:58 -05:00
Jeremy Chen
21148c7e51 stylo: do not handle the fallback discrete animation inside the Animate trait.
At present, we do the fallback discrete animation for non-invertible matrices in
ComputedMatrix.animate(). However, according to the spec, we should fallback to
discrete animation for cases like:

1. animation between transform with single non-invertible matrix
2. animation between transform with matched transform functions that have at least
   one non-invertible matrix
2. animation between transform with mismatched transform functions that have at
   least one non-invertible matrix.

The current implementation only handles the first case.

Moreover, we already have fallback discrete animation procedures in CSS Animation
and Web Animation, so we should be able to not doing any fallback inside the
Animate trait.

In this patch, we let the animation between non-invertible matrices to return Err().
So, we can propagate the Err() to the callers, and let the fallback discrete
animation procedure stay at the Servo_MatrixTransform_Operate, which is ouside
the Animate trait.
2017-09-21 15:30:18 +08:00
Hiroyuki Ikezoe
dcd959fc72 Use Atom::from(nsIAtom) to increment reference count in case of dynamic atom for will-change.
If we don't increment the reference count for the Atom in servo side, it's
possible to try to release the Atom in servo side even if we have already
released in gecko side.  When it happens, nsIAtom::mKind is no longer reliable.
2017-09-21 15:44:26 +09:00
Bobby Holley
ab9edf3d69 Hoist index computation into a helper.
MozReview-Commit-ID: ALeggMDh92m
2017-09-20 23:22:44 -07:00
Bobby Holley
48466bf876 Introduce an NthIndexCache type and pipe it from ThreadLocalStyleContext to MatchingContext.
Some future refactoring here to pass fewer things as parameters would be nice.
2017-09-20 23:22:38 -07:00