Commit graph

6718 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
2f324aa665
style: Simplify border-image-repeat serialization.
We're the only ones to preserve explicitly the second keyword, as noticed in:

  https://github.com/w3c/web-platform-tests/pull/10170
2018-04-10 13:43:09 +02:00
bors-servo
e31fefdf78
Auto merge of #20602 - hiikezoe:dont-make-logical-properties-animatable, r=emilio
Don't make logical properties animatable

|animation_type| was renamed in 94fb839fdd, but the commit missed renaming
one place.  It means that some of logical properties might have been
accidentally animatable.  Logical properties should be animatable but we
haven't yet implemented the proper Animate trait for logical properties.

<!-- 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/20602)
<!-- Reviewable:end -->
2018-04-10 03:30:13 -04:00
Emilio Cobos Álvarez
eaefaa890e
style: Implement the functional :host(..) selector.
We could invalidate in a slightly more fine-grained way, but I don't think it's
worth the churn vs. keeping the special-cases minimal.

Bug: 1452640
Reviewed-by: xidorn
MozReview-Commit-ID: 5DkQrgwg9GW
2018-04-10 08:04:09 +02:00
Hiroyuki Ikezoe
162d563180 Don't make logical properties animatable
|animation_type| was renamed in 94fb839fdd, but the commit missed renaming
one place.  It means that some of logical properties might have been
accidentally animatable.  Logical properties should be animatable but we
haven't yet implemented the proper Animate trait for logical properties.
2018-04-10 09:43:20 +09:00
bors-servo
cb754b2627
Auto merge of #20597 - emilio:host, r=xidorn
style: Implement the non-functional :host selector.

Kinda tricky because :host only matches rules on the shadow root where the rules
come from. So we need to be careful during invalidation and style sharing.

I didn't use the non_ts_pseudo_class_list bits because as soon as we implement
the :host(..) bits we're going to need to special-case it anyway.

The general schema is the following:

 * Rightmost featureless :host selectors are handled inserting them in the
   host_rules hashmap. Note that we only insert featureless stuff there. We
   could insert all of them and just filter during matching, but that's slightly
   annoying.

 * The other selectors, like non-featureless :host or what not, are added to the
   normal cascade data. This is harmless, since the shadow host rules are never
   matched against the host, so we know they'll just never match, and avoids
   adding more special-cases.

 * Featureless :host selectors to the left of a combinator are handled during
   matching, in the special-case of next_element_for_combinator in selectors.
   This prevents this from being more invasive, and keeps the usual fast path
   slim, but it's a bit hard to match the spec and the implementation.

   We could keep a copy of the SelectorIter instead in the matching context to
   make the handling of featureless-ness explicit in match_non_ts_pseudo_class,
   but we'd still need the special-case anyway, so I'm not fond of it.

 * We take advantage of one thing that makes this sound. As you may have
   noticed, if you had `root` element which is a ShadowRoot, and you matched
   something like `div:host` against it, using a MatchingContext with
   current_host == root, we'd incorrectly report a match. But this is impossible
   due to the following constraints:

    * Shadow root rules aren't matched against the host during styling (except
      these featureless selectors).

    * DOM APIs' current_host needs to be the _containing_ host, not the element
      itself if you're a Shadow host.

Bug: 992245
Reviewed-by: xidorn
MozReview-Commit-ID: KayYNfTXb5h

<!-- 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/20597)
<!-- Reviewable:end -->
2018-04-09 06:41:59 -04:00
Emilio Cobos Álvarez
db5db13559
style: Implement the non-functional :host selector.
Kinda tricky because :host only matches rules on the shadow root where the rules
come from. So we need to be careful during invalidation and style sharing.

I didn't use the non_ts_pseudo_class_list bits because as soon as we implement
the :host(..) bits we're going to need to special-case it anyway.

The general schema is the following:

 * Rightmost featureless :host selectors are handled inserting them in the
   host_rules hashmap. Note that we only insert featureless stuff there. We
   could insert all of them and just filter during matching, but that's slightly
   annoying.

 * The other selectors, like non-featureless :host or what not, are added to the
   normal cascade data. This is harmless, since the shadow host rules are never
   matched against the host, so we know they'll just never match, and avoids
   adding more special-cases.

 * Featureless :host selectors to the left of a combinator are handled during
   matching, in the special-case of next_element_for_combinator in selectors.
   This prevents this from being more invasive, and keeps the usual fast path
   slim, but it's a bit hard to match the spec and the implementation.

   We could keep a copy of the SelectorIter instead in the matching context to
   make the handling of featureless-ness explicit in match_non_ts_pseudo_class,
   but we'd still need the special-case anyway, so I'm not fond of it.

 * We take advantage of one thing that makes this sound. As you may have
   noticed, if you had `root` element which is a ShadowRoot, and you matched
   something like `div:host` against it, using a MatchingContext with
   current_host == root, we'd incorrectly report a match. But this is impossible
   due to the following constraints:

    * Shadow root rules aren't matched against the host during styling (except
      these featureless selectors).

    * DOM APIs' current_host needs to be the _containing_ host, not the element
      itself if you're a Shadow host.

Bug: 992245
Reviewed-by: xidorn
MozReview-Commit-ID: KayYNfTXb5h
2018-04-09 12:19:05 +02:00
Xidorn Quan
22cf429c35 Use Servo code to check whether a property is inherited. 2018-04-09 19:10:44 +10:00
bors-servo
e460b4ab8a
Auto merge of #20575 - Manishearth:filler-y, r=emilio
Use correct filler y value when animating with an implied-y translate()s

r=emilio https://bugzilla.mozilla.org/show_bug.cgi?id=1451724

<!-- 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/20575)
<!-- Reviewable:end -->
2018-04-09 01:47:58 -04:00
Emilio Cobos Álvarez
3927b3453a
style: Respect the -moz- gradient pref again.
This hopefully allows us to unship them eventually.

Bug: 1451874
Reviewed-by: xidorn
MozReview-Commit-ID: 2MDRZLmLMM0
2018-04-07 16:40:38 +02:00
Xidorn Quan
3274e84278 Have CSSOM append rather than replace slot in declaration block.
The early return for identical setting in importance matching as well
as the comment before `index_to_remove` are removed because the order
is web-exposing regardless of whether it's from CSSOM or parsing. e.g.
`top: 1px; left: 2px; top: 1px;` is effectively `left: 2px; top: 1px;`,
not `top: 1px; left: 2px;`.
2018-04-07 19:58:27 +10:00
bors-servo
ecf71d77cd
Auto merge of #20573 - Ramshell:issue/20498, r=mbrubeck
Add support for percentages in column-gap.

<!-- Please describe your changes on the following line: -->
# Changes in this PR
* I've removed the `if product == "gecko"` line in order to make the column_gap type "NonNegativeLengthOrPercentageOrNormal" always.

* Then I've changed this line
```rust
Either::First(len) => len.into(),
```
to
```rust
Either::First(len) => len.0.to_pixel_length(content_inline_size).into(),
```

---
<!-- 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 build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20498  (github issue number if applicable).

<!-- Either: -->
- [X] These changes do not require tests because there are tests already for this in wpt, in particular css/css-align/gaps/column-gap-parsing-001.html for the parsing bits, and css/css-multicol/multicol-gap-percentage-001.html for the layout bits.

<!-- 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/20573)
<!-- Reviewable:end -->
2018-04-06 19:48:59 -04:00
Bobby Holley
9b5354f953 Stop using Gecko namespace ids in servo.
MozReview-Commit-ID: 2532dHCGPXW
2018-04-06 11:32:00 -07:00
Ramshell
14a0e74ca3 Remove col_gap_type variable 2018-04-06 12:23:25 -03:00
Manish Goregaokar
e5afb22184 Use correct filler y value when animating with an implied-y translate()s 2018-04-06 08:11:58 -07:00
bors-servo
a0bdba73e3
Auto merge of #20572 - jwatt:master, r=emilio
Stop using NS_STYLE_FONT_WEIGHT_NORMAL and NS_STYLE_FONT_WEIGHT_BOLD

The Servo side of the changes for
https://bugzilla.mozilla.org/show_bug.cgi?id=1452040

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

- [ ] There are tests for these changes OR
- [X] These changes do not require tests because it's a trivial change to internal constants

<!-- 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/20572)
<!-- Reviewable:end -->
2018-04-06 09:22:33 -04:00
bors-servo
ad4905cb90
Auto merge of #20486 - Eijebong:walkdir, r=nox
Bump walkdir

<!-- 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/20486)
<!-- Reviewable:end -->
2018-04-06 08:14:00 -04:00
Ramshell
20e8922433 Remove FIXME comment 2018-04-06 08:34:03 -03:00
Jonathan Watt
f72136800f Stop using NS_STYLE_FONT_WEIGHT_NORMAL and NS_STYLE_FONT_WEIGHT_BOLD
The Servo side of the changes for
https://bugzilla.mozilla.org/show_bug.cgi?id=1452040
2018-04-06 11:03:51 +01:00
Emilio Cobos Álvarez
0a87a15d23
style: Use a consistent style for position shorthand parsing. 2018-04-06 11:56:40 +02:00
Emilio Cobos Álvarez
725943f383
style: Don't restrict alignment shorthand parsing now that's not ambiguous.
Bug: 1339656
Reviewed-by: mats
MozReview-Commit-ID: AnYBt6zwnPl
2018-04-06 11:52:21 +02:00
Ramshell
d588590ed2 Add support for percentages in column-gap. 2018-04-05 21:04:29 -03:00
Xidorn Quan
a140a70c12 Update bindings. 2018-04-05 19:37:20 +10:00
Xidorn Quan
8932dc98be Remove all color stuff from nsCSSValue. 2018-04-05 19:37:20 +10:00
Xidorn Quan
665ea9037a Make DOMIntersectionObserver use nsStyleSides for mRootMargin, and use Servo code to serialize it. 2018-04-05 19:37:19 +10:00
Xidorn Quan
80ab893e3a Use Servo data to back @counter-style rule. 2018-04-05 09:33:45 +10:00
Xidorn Quan
32cd0b4ea0 Add source_location to CounterStyleRule. 2018-04-05 09:00:25 +10:00
Xidorn Quan
9ad03d3ec9 Remove initial value of @counter-style rule descriptors. 2018-04-05 09:00:16 +10:00
bors-servo
34b13dac66
Auto merge of #20519 - upsuper:font-face-rule, r=emilio
Use Servo data to back @font-face rule in Gecko

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

<!-- 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/20519)
<!-- Reviewable:end -->
2018-04-03 19:33:59 -04:00
Xidorn Quan
ac7467221a Use Servo data to back @font-face rule in Gecko. 2018-04-04 09:33:07 +10:00
Xidorn Quan
0332674909 Implement the correct ToCss for UrlSource. 2018-04-04 08:43:41 +10:00
bors-servo
d744e35d38
Auto merge of #20482 - brainlessdeveloper:list-style-image-computed, r=emilio
Implement a URL-generic type for ListStyleImage

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

This should fix the following two "expected to fail" tests described in https://github.com/servo/servo/issues/18015:

- getComputedStyle(elem) for url() listStyleImage uses the resolved URL
  and elem.style uses the original URL

- getComputedStyle(elem) for url() listStyle uses the resolved URL
  and elem.style uses the original URL

I updated the test failure expectations by removing the corresponding `.ini` 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
- [x] These changes fix #18015 (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/20482)
<!-- Reviewable:end -->
2018-04-03 18:12:13 -04:00
Fausto Núñez Alberro
cc838f54e5
Implement a URL-generic type for list-style-image
This should fix the following two "expected to fail" tests:

- getComputedStyle(elem) for url() listStyleImage uses the resolved URL
  and elem.style uses the original URL

- getComputedStyle(elem) for url() listStyle uses the resolved URL
  and elem.style uses the original URL
2018-04-03 22:01:26 +02:00
Nicholas Nethercote
8705fb3783 Convert StylePrefs to StaticPrefs. 2018-04-03 11:41:03 +10:00
Emilio Cobos Álvarez
15c416b133
style: Use a more consistent style for parsing functions. 2018-04-02 19:34:58 +02:00
bors-servo
39018f9339
Auto merge of #20481 - emilio:debug-wat, r=nox
style: Derive a debug impl instead of implementing by hand.

<!-- 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/20481)
<!-- Reviewable:end -->
2018-04-02 12:09:29 -04:00
Emilio Cobos Álvarez
ac088b4a72
style: Update bindings. 2018-04-02 03:17:57 +02:00
Emilio Cobos Álvarez
744809a8b2
style: Add support for 'flex-basis:content' in the style system.
Bug: 1105111
Reviewed-by: xidorn
MozReview-Commit-ID: 5WhgHJJ0mDB
2018-04-02 03:17:56 +02:00
Mats Palmgren
3532f64b32
[css-multicol] style: Implement percentages for 'column-gap'.
Bug: 1398537
Reviewed-by: emilio,dholbert
2018-04-02 00:56:45 +02:00
Li Hao Tan
8d5a2a9aeb Refactor text-emphasis-position to use ${helpers.predefined_type(..)} 2018-04-01 21:12:01 +08:00
Bastien Orivel
f12b7bbd7a Bump walkdir 2018-03-31 12:22:36 +02:00
Emilio Cobos Álvarez
ec0c4f396a
style: Derive a debug impl instead of implementing by hand. 2018-03-31 00:53:47 +02:00
Emilio Cobos Álvarez
f815d2f9c6
style: Add a fast path to each_anonymous_content_child.
If we know that we don't have anon children it is pointless to go through FFI.
2018-03-30 21:06:34 +02:00
bors-servo
c8b0dc965d
Auto merge of #20468 - Eijebong:fix_log, r=mbrubeck
Fix style/build_gecko.rs for log 0.4

<!-- 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/20468)
<!-- Reviewable:end -->
2018-03-28 17:18:31 -04:00
Bastien Orivel
8d738a5048 Fix style/build_gecko.rs for log 0.4 2018-03-28 23:08:01 +02:00
bors-servo
12d82fe621
Auto merge of #20465 - Eijebong:log, r=SimonSapin
Bump env_logger to 0.5 and log to 0.4 in every servo 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/20465)
<!-- Reviewable:end -->
2018-03-28 15:08:52 -04:00
Bastien Orivel
0918ac8cc7 Bump env_logger to 0.5 and log to 0.4 in every servo crate 2018-03-28 19:50:58 +02:00
Xidorn Quan
dc25b51b6e Remove StyleBackendType uses. 2018-03-28 23:13:44 +11:00
Xidorn Quan
688fb23d25 Remove nsCSSPseudoClasses.{h,cpp} and nsCSSPseudoClassList.h. 2018-03-28 09:50:14 +11:00
Xidorn Quan
e57b6c65a0 Move matching logic of :-moz-table-border-nonzero and :-moz-browser-frame into individual binding functions. 2018-03-28 09:50:14 +11:00
Xidorn Quan
911f174b70 Make :-moz-native-anonymous and :-moz-use-shadow-tree-root matches in Rust code. 2018-03-28 09:50:13 +11:00