Commit graph

16155 commits

Author SHA1 Message Date
Jeremy Chen
adcd86deb2 stylo: Do not skip parent display-based style fixups for NAC that is not a NAC root
Stylo is currently skipping parent display-based style fixups for all NAC,
whereas we probably only want to do this for NAC roots.

In this patch, we ensure that we skip it for NAC roots, and pseudo-elements,
but not other NAC.
2017-08-31 10:28:02 +08:00
Emilio Cobos Álvarez
c69f769285
Revert "Rewrite CounterStyleOrNone::from_gecko_value to use fewer binding functions"
This reverts commit 65c2047df2.
2017-08-30 14:21:13 +02:00
bors-servo
3fa5d83ab7 Auto merge of #18234 - BorisChiou:stylo/transform/distance_mismatch, r=birtles,nox
stylo: Bug 1390039 - Implement compute_distance for mismatched transform lists.

Implement ComputeSquaredDistance for mismatched transform lists.
In order to do this, we have to convert a transform list into a 3d matrix,
so I move the code from layout module into style module for reusing it.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1390039](https://bugzilla.mozilla.org/show_bug.cgi?id=1390039).
- [X] These changes do not require tests because this is a Gecko feature and I add many tests in Gecko already.

<!-- 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/18234)
<!-- Reviewable:end -->
2017-08-30 06:03:32 -05:00
bors-servo
5dee83d54d Auto merge of #18300 - emilio:die-hvp-die, r=nox
style: Remove HasViewportPercentage.

It's not needed since #18268, let's kill 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/18300)
<!-- Reviewable:end -->
2017-08-30 04:31:11 -05:00
Boris Chiou
5c5a72c1d8 Return Err(()) if determinant is not 1 or -1 while decomposing the 2d matrix.
This may happen in some cases, and we shouldn't panic in debug mode,
so let's return Err(()) for it to fall back to discrete animation.
2017-08-30 13:58:33 +08:00
bors-servo
88e7906191 Auto merge of #18304 - upsuper:counter-style-clone, r=heycam
Rewrite CounterStyleOrNone::from_gecko_value to use fewer binding functions

This is the Servo side change of [bug 1393189](https://bugzilla.mozilla.org/show_bug.cgi?id=1393189).

<!-- 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/18304)
<!-- Reviewable:end -->
2017-08-29 23:18:06 -05:00
Xidorn Quan
65c2047df2 Rewrite CounterStyleOrNone::from_gecko_value to use fewer binding functions 2017-08-30 13:52:19 +10:00
bors-servo
421e6d8f91 Auto merge of #18302 - upsuper:atom-assert, r=bholley
Harden assert for creating atom from raw pointer

One of Stylo's common assertion turns out to be from having a null Atom (see [Gecko 1385925 bug comment 7](https://bugzilla.mozilla.org/show_bug.cgi?id=1385925#c7)). It would be helpful if we can catch this kind of crash earlier via a release-assertion.

This may regress performance to some extent which I'm not sure. But we can probably have it there for diagnosis for now, and remove later.

<!-- 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/18302)
<!-- Reviewable:end -->
2017-08-29 22:13:02 -05:00
Xidorn Quan
4f6752ed1a Harden assert for creating atom from raw pointer. 2017-08-30 12:36:45 +10:00
bors-servo
7e363d60bb Auto merge of #18175 - stshine:no-floats-in-flexbox, r=mbrubeck
layout: Stop call normal block size assignment for flex container

No need to call the `assign_block_size_block_base()` method of normal block in flex.rs since it is implemented for CSS2.

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

<!-- Either: -->
- [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/18175)
<!-- Reviewable:end -->
2017-08-29 19:15:59 -05:00
Emilio Cobos Álvarez
36ff89bd28
style: Remove HasViewportPercentage.
It's not needed since #18268
2017-08-29 23:51:21 +02:00
bors-servo
473934c989 Auto merge of #18268 - emilio:dirty-viewport-followup, r=SimonSapin
style: Recascade the document instead of using the dirty_on_viewport_size_change bit

This allows us to simplify a lot of code.

On top of #18267.

<!-- 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/18268)
<!-- Reviewable:end -->
2017-08-29 14:18:58 -05:00
bors-servo
ef401dd637 Auto merge of #17269 - gterzian:remove_compositor_forwarding_code_and_use_dedicated_mechanism, r=asajeffrey
Remove compositor forwarding code and use dedicated mechanism

<!-- Please describe your changes on the following line: -->
@paulrouget Here is a first sketch of the proposed "design", handling a first message as a proof of concept, if you could please already take a look before I move all the messages(or method calls) across... thanks

---
<!-- 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 #15934 (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/17269)
<!-- Reviewable:end -->
2017-08-29 12:57:58 -05:00
bors-servo
62930d0073 Auto merge of #18295 - paulrouget:better_default_options, r=jdm
enable antialiasing by default

This is not a problem for regular Servo because these values are toggled when the command line is parsed. But it's not the case when embedding Servo.

<!-- 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/18295)
<!-- Reviewable:end -->
2017-08-29 11:26:45 -05:00
Paul Rouget
560a8bdcb1 enable antialiasing by default 2017-08-29 17:50:26 +02:00
bors-servo
b2f8974ab8 Auto merge of #18290 - jdm:selectorerr, r=heycam
Report more specific CSS selector errors

Report more specific errors for invalid CSS selectors. Reviewed by @heycam in https://bugzilla.mozilla.org/show_bug.cgi?id=1384216.

---
- [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/18290)
<!-- Reviewable:end -->
2017-08-29 09:46:22 -05:00
bors-servo
5062dc5914 Auto merge of #18293 - emilio:selector-map-box, r=SimonSapin
style: Box the PerPseudo<SelectorMap>, so we don't waste a lot of space.

<!-- 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/18293)
<!-- Reviewable:end -->
2017-08-29 07:37:55 -05:00
Emilio Cobos Álvarez
f28a62ccf3
style: Box the PerPseudo<SelectorMap>, so we don't waste a lot of space.
MozReview-Commit-ID: JmVqI6zNHql
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-29 14:23:57 +02:00
bors-servo
1c4d0d2d5d Auto merge of #18292 - emilio:animate-nan, r=nox
style: Prevent Animate to generate NaN float values.

This should fix the assertions in https://bugzilla.mozilla.org/show_bug.cgi?id=1394558.

<!-- 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/18292)
<!-- Reviewable:end -->
2017-08-29 05:18:33 -05:00
Emilio Cobos Álvarez
a7210fd082
style: Prevent Animate to generate NaN float values. 2017-08-29 11:57:50 +02:00
bors-servo
bea11cadf9 Auto merge of #18275 - Manishearth:coorddata-unsafe, r=nox
Mark the CoordData traits as unsafe

r? @nox

<!-- 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/18275)
<!-- Reviewable:end -->
2017-08-29 03:57:16 -05:00
bors-servo
bd9cf3ce98 Auto merge of #18281 - emilio:more-parse-dumbness, r=jdm
style: Avoid scanning the longhand id twice in the fast path of PropertyDeclarationBlock::parse_common

This makes the overhead of this function much lower according to `perf`.

And in general makes sense, removing overhead from the fast path.

<!-- 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/18281)
<!-- Reviewable:end -->
2017-08-29 02:48:09 -05:00
bors-servo
441ae08d24 Auto merge of #18280 - emilio:parse-dumbness, r=jdm
style: Avoid dropping a parse error on the floor when checking whether a prop is enabled.

<!-- 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/18280)
<!-- Reviewable:end -->
2017-08-29 01:34:57 -05:00
Manish Goregaokar
799437430e Mark the CoordData traits as unsafe 2017-08-28 22:28:20 -07:00
bors-servo
4804e211e8 Auto merge of #18276 - tromey:cssparser-line-number-offset, r=SimonSapin
Use cssparser's new_with_line_number_offset

cssparser provides a way to set the initial line number on a
ParserInput.  This patch changes servo to use this facility, rather than
reimplement the same functionality itself.

---

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #_N/A_ (github issue number if applicable).

- [ ] There are tests for these changes OR
- [x] These changes do not require tests because pre-existing tests cover this change.

<!-- 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/18276)
<!-- Reviewable:end -->
2017-08-28 22:57:13 -05:00
Josh Matthews
4016371e1d Report more invalid selectors (bug 1384216). 2017-08-28 17:21:57 -07:00
Josh Matthews
9a7cceb0a1 Report invalid selectors (bug 1384216). 2017-08-28 17:21:07 -07:00
Josh Matthews
408c34a76d Report more specific invalid attribute selectors (bug 1384216). 2017-08-28 17:20:45 -07:00
Josh Matthews
73e903ad3c Report unexpected attribute selector tokens (bug 1384216). 2017-08-28 17:20:17 -07:00
Josh Matthews
8e20a6a110 Report unknown pseudos (bug 1384216). 2017-08-28 17:19:28 -07:00
bors-servo
9e2f243b4d Auto merge of #18282 - emilio:moar-parsing, r=jdm
style: Remove uninlineable function in PropertyDeclarationIterator.

That literally made no sense, and is probably leftover from where we passed Map
directly there.

<!-- 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/18282)
<!-- Reviewable:end -->
2017-08-28 19:18:37 -05:00
bors-servo
d68c57158d Auto merge of #18279 - jdm:rearrange, r=emilio
Prioritize parsing non-custom property names.

This should cause a slight improvement in the common case where we are parsing non-custom property names.

---
- [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/18279)
<!-- Reviewable:end -->
2017-08-28 18:14:59 -05:00
Anthony Ramine
ef9d614349 Fix impl of ToComputedValue for TrackSize<T> 2017-08-28 22:48:08 +02:00
Emilio Cobos Álvarez
f6e4c5547c
style: Remove uninlineable function in PropertyDeclarationIterator.
That literally made no sense, and is probably leftover from where we passed Map
directly there.
2017-08-28 21:25:25 +02:00
Emilio Cobos Álvarez
344d53bd29
style: Avoid scanning the longhand id twice in the fast path of PropertyDeclarationBlock::push_common.
This makes the overhead of this function much lower according to `perf`.

And in general makes sense, removing overhead from the fast path.

MozReview-Commit-ID: 4dJRap9dxNG
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-28 21:20:46 +02:00
Emilio Cobos Álvarez
8a0a690384
style: Avoid dropping a parse error on the floor when checking whether a prop is enabled. 2017-08-28 21:05:06 +02:00
Tom Tromey
546ecaeee9 Use cssparser's new_with_line_number_offset
cssparser provides a way to set the initial line number on a
ParserInput.  This patch changes servo to use this facility, rather than
reimplement the same functionality itself.
2017-08-28 12:49:30 -06:00
bors-servo
04fb310847 Auto merge of #18247 - Majora320:master, r=emilio
Silenced camel case warning for the iOS enum variant

Fix a simple warning.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

This change is obviously too trivial for tests.

<!-- 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/18247)
<!-- Reviewable:end -->
2017-08-28 13:39:25 -05:00
Josh Matthews
4a949e112d Prioritize parsing non-custom property names. 2017-08-28 11:20:24 -07:00
Pu Xingyu
9103743d0c layout: Stop calling normal block size assignment for flex container
No need to call the `assign_block_size_block_base()` method of normal
block since it is implemented for CSS2.
2017-08-29 01:30:09 +08:00
bors-servo
c2deac171d Auto merge of #18269 - rlustin:filter-buffer-by-name-and-type, r=ferjm
Use `Filter buffer by name and type` algorithm implementation

Following #18176, it uses the new implementation and removes the old one.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #18186
- [x] These changes do not require tests because it’s only internal changes in `components/script/dom/performance.rs`

<!-- 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/18269)
<!-- Reviewable:end -->
2017-08-28 11:18:52 -05:00
bors-servo
a266e96d28 Auto merge of #18239 - servo:derive-all-the-things, r=emilio
Refactor how we handle trait bounds in style_derive

<!-- 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/18239)
<!-- Reviewable:end -->
2017-08-28 10:13:13 -05:00
bors-servo
96b4e064a1 Auto merge of #18267 - emilio:dirty-on-viewport-size-change, r=SimonSapin
style: Don't look for viewport units in stylesheets.

Use whether we've computed any viewport unit instead.

This is more accurate (we avoid restyling unnecessarily if we've found anything
ever on the stylesheet, but that hasn't matched).

This has the benefit of also matching Gecko, and simplify some code and
fishyness around, and also hopefully speeding up stylesheet parsing.

<!-- 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/18267)
<!-- Reviewable:end -->
2017-08-28 08:48:47 -05:00
Emilio Cobos Álvarez
dcbe196ed5
style: Remove NODE_NEEDS_DIRTY_ON_VIEWPORT_SIZE_CHANGE.
Recascading is enough.
2017-08-28 14:40:48 +02:00
Emilio Cobos Álvarez
2291ce4767
style: Remove CascadeInfo. 2017-08-28 14:40:47 +02:00
Emilio Cobos Álvarez
6e9a96a6f8
style: Recascade the document instead of using the dirty_on_viewport_percentage bit. 2017-08-28 14:40:46 +02:00
bors-servo
94c870726f Auto merge of #18261 - emilio:silly-pseudo-style, r=heycam
style: Really only resolve applicable ::before / ::after.

<!-- 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/18261)
<!-- Reviewable:end -->
2017-08-28 07:01:51 -05:00
Emilio Cobos Álvarez
14d60a7e89
style: Really only resolve applicable ::before / ::after.
MozReview-Commit-ID: 4dIykkUdIxZ
2017-08-28 14:00:43 +02:00
Gregory Terzian
6bca3402a6 implement clone for embedder and compositor proxies 2017-08-28 18:39:31 +08:00
Gregory Terzian
01c24e017d move embedder related messages, and window event handling, out of compositor 2017-08-28 18:39:10 +08:00