Commit graph

19254 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
3ef77f59d8
style: Fix IsInAnonymousSubtree to account for XBL in Shadow DOM.
Bug: 1453206
Reviewed-by: smaug
MozReview-Commit-ID: B2aYury8K7i
2018-04-14 21:15:44 +02:00
Jonathan Watt
245d848508
style: Use a user defined type for font weight everywhere.
Bug: 1436048
Reviewed-by: emilio
2018-04-14 21:15:43 +02:00
bors-servo
e4472f7c1f
Auto merge of #20629 - cbrewster:session_history_fixup, r=asajeffrey
Session history fixup

<!-- Please describe your changes on the following line: -->
When a browsing context was removed, its entries were not removed from the joint session history.
The embedder should be notified that the history changed after a navigation matures.

---
<!-- 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
- [ ] These changes fix #__ (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/20629)
<!-- Reviewable:end -->
2018-04-12 12:33:06 -04:00
Connor Brewster
787ec4b209 Remove entries for removed iframes
Notify history changed after a navigation

Add history drop test
2018-04-12 11:30:57 -05:00
Emilio Cobos Álvarez
061c87ad00
style: Let overflow parse two values.
Per https://github.com/w3c/csswg-drafts/issues/2484.

Bug: 1453148
Reviewed-by: xidorn
MozReview-Commit-ID: D7M3PhnTtD2
2018-04-12 10:44:38 +02:00
ddh
e5a009ee98 added spec comments 2018-04-11 21:29:03 +01:00
bors-servo
7462eda675
Auto merge of #20619 - upsuper:properties-data, r=emilio
Have nscssproperty a method of data instances

<!-- 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/20619)
<!-- Reviewable:end -->
2018-04-11 14:41:15 -04:00
Connor Brewster
5f85824ab3 Replace initial about:blank loads 2018-04-11 09:51:22 -05:00
Connor Brewster
004549da9f Update pipeline activity before closing pipelines 2018-04-11 09:01:01 -05:00
Emilio Cobos Álvarez
1b84019832
style: Update bindings.
MozReview-Commit-ID: Fxe4m6jgBuZ
2018-04-11 09:50:20 +02:00
Emilio Cobos Álvarez
1d8e64c8ee
style: Simplify ImageValue.
Bug: 1452987
Reviewed-by: heycam
MozReview-Commit-ID: 5LRaaEPSSdY
2018-04-11 09:47:47 +02:00
Xidorn Quan
1599357cff Make nscssproperty a method of longhand/shorthand/alias class. 2018-04-11 15:55:11 +10:00
Xidorn Quan
2aee174b6d Put alias instances into {longhand,shorthand}.alias. 2018-04-11 15:55:09 +10:00
Bobby Holley
c99bcdd4b8 Run rustfmt on selectors, servo_arc, and style.
This was generated with:

./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style

Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
2018-04-10 17:35:15 -07:00
Bobby Holley
f7ae1a37e3 Manual fixups so that the rustfmt output won't trigger tidy. 2018-04-10 17:33:25 -07:00
Emilio Cobos Álvarez
68ce13aae4
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-11 00:43:45 +02:00
bors-servo
cba8b083d3
Auto merge of #20614 - asajeffrey:script-dissimilar-orgin-postMessage-from-incumbent, r=cbrewster
Use the incumbent global as the source of x-origin postMessage

<!-- 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 build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20604 (github issue number if applicable).
- [X] These changes do not require tests because it's already caught by existing WPT

<!-- 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/20614)
<!-- Reviewable:end -->
2018-04-10 15:10:07 -04:00
Alan Jeffrey
cef3f0e039 Use the incumbent global as the source of x-origin postMessage 2018-04-10 12:25:26 -05:00
Gecko Backout
007218b9ec Backed out changeset d186bcce1235 for failing on layout/style/test/test_shorthand_property_getters.html on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/20610
2018-04-10 16:44:34 +00:00
bors-servo
07dd37a0cf
Auto merge of #20610 - emilio:border-image-repeat, r=nox
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

<!-- 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/20610)
<!-- Reviewable:end -->
2018-04-10 08:49:28 -04:00
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
ce72e52656
Auto merge of #20598 - servo:webgl, r=Manishearth
Four nondescript WebGL improvements

<!-- 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/20598)
<!-- Reviewable:end -->
2018-04-10 04:28:40 -04: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
Simon Sapin
52dceb3d5f Use new std::num::NonZero* types instead of deprecated core::nonzero::NonZero 2018-04-09 21:43:26 +02:00
Simon Sapin
3d6614e314 Upgrade to rustc 1.27.0-nightly (056f589fb 2018-04-07) 2018-04-09 21:43:25 +02:00
Anthony Ramine
f837354cb7 Do not emit a WebGL error for "gl_" prefixed names in gl.getAttribLocation 2018-04-09 15:52:56 +02:00
Anthony Ramine
561c41097f Fix filtering of reserved WebGL names in gl.getAttribLocation 2018-04-09 14:44:02 +02:00
Anthony Ramine
fcb6d5112e Properly check for cubic dimensions in gl.copyTexImage2D 2018-04-09 14:44:02 +02: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
Anthony Ramine
68898f4ebd Fix the error emitted for invalid targets in WebGLTexture::bind
It doesn't actually matter because this is only called from
WebGLRenderingContext::BindTexture, which already checks the target,
but better be safe than sorry.
2018-04-09 11:46:12 +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
bors-servo
954ac8157f
Auto merge of #20586 - emilio:moz-gradient-pref, r=xidorn
style: Respect the -moz- gradient pref again.

This hopefully allows us to unship them eventually.

Bug: 1451874
Reviewed-by: xidorn
MozReview-Commit-ID: 2MDRZLmLMM0

<!-- 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/20586)
<!-- Reviewable:end -->
2018-04-07 11:07:55 -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
bors-servo
ecfcf35c26
Auto merge of #20583 - emilio:affine-stuff, r=upsuper
selectors: Don't serialize :nth-child(-n) as -1n.

<!-- 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/20583)
<!-- Reviewable:end -->
2018-04-07 10:10:35 -04:00
Emilio Cobos Álvarez
1eab5927a5
selectors: Don't serialize :nth-child(-n) as -1n. 2018-04-07 14:54:23 +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
bors-servo
646e487309
Auto merge of #20571 - emilio:align-shorthands-again, r=mats
style: Don't restrict alignment shorthand parsing now that's not ambiguous.

Bug: 1339656
Reviewed-by: mats
MozReview-Commit-ID: AnYBt6zwnPl

<!-- 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/20571)
<!-- Reviewable:end -->
2018-04-06 07:11:37 -04: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