Commit graph

31404 commits

Author SHA1 Message Date
bors-servo
8a740aa4d1 Auto merge of #19791 - emilio:calc-clean, r=jdm
style: Cleanup a bit the calc code.

I happened to be looking at 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/19791)
<!-- Reviewable:end -->
2018-01-17 09:09:49 -06:00
Emilio Cobos Álvarez
49535d6987
style: Cleanup a bit the calc code.
I happened to be looking at it.

MozReview-Commit-ID: Ketot34XtOX
2018-01-17 15:26:13 +01:00
Emilio Cobos Álvarez
75af7c0b41
style: Make Gecko's media query evaluation work with a document, not a pres context.
Returning a zero-sized viewport in the case there's no shell / pres context.

For now, no other change yet. After this we can start tweaking the ShadowRoot
Stylist setup, and even try to return computed styles without a document \o/.

Bug: 1430608
MozReview-Commit-ID: 3cT2PKQISri
2018-01-17 14:36:04 +01:00
Emilio Cobos Álvarez
e858dc060e
style: Special-case pseudo style attributes to avoid ignoring doc colors.
That way color pickers work even when this setting is on. We always know that
pseudo-element style attributes are trusted.

Bug: 1429248
Reviewed-by: heycam
MozReview-Commit-ID: 6IdmRaMzj6I
2018-01-17 14:35:42 +01:00
Emilio Cobos Álvarez
7bdeeaa702
style: Fix slotted invalidation.
This is a partial revert of
ce1d8cd232

If you're in a shadow tree, you may not be slotted but you still need to look at
the slotted rules, since a <slot> could be a descendant of yours.

Just use the same invalidation map everywhere, and remove complexity.

This means that we can do some extra work while trying to gather invalidation
if there are slotted rules, but I don't think it's a problem.

The test is ported from https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/fast/css/invalidation/slotted.html?l=1&rcl=58d68fdf783d7edde1c82a642e037464861f2787

Curiously, Blink fails the test as written, presumably because they don't flush
styles from getComputedStyle correctly (in their test they do via
updateStyleAndReturnAffectedElementCount), due to <slot>s not being in the flat
tree in their implementation.

Bug: 1429846
Reviewed-by: heycam
MozReview-Commit-ID: 6b7BQ6bGMgd
2018-01-17 14:35:19 +01:00
bors-servo
8281ee0043 Auto merge of #19755 - streichgeorg:decoupling_metrics_gfx, r=jdm
Decouple metrics and gfx

Added gfx_traits::DisplayList so metrics doesn't depend on the gfx crate for gfx::display_list::DisplayList.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because succesful compilation should be enough

<!-- 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/19755)
<!-- Reviewable:end -->
2018-01-17 07:28:01 -06:00
bors-servo
4f09987611 Auto merge of #19761 - tigercosmos:m1, r=KiChjang
implement range input sanitization

<!-- Please describe your changes on the following line: -->
implement range input sanitation.
Since there is no `min`, `max`, `step` implementation currently, this should be continued in the future.

r? KiChjang

---
<!-- 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 #19172 (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/19761)
<!-- Reviewable:end -->
2018-01-17 04:30:58 -06:00
tigercosmos
b29230bd76 implement range input sanitization 2018-01-17 16:27:21 +08:00
bors-servo
525758ea5e Auto merge of #19781 - upsuper:matching-opt, r=emilio
Optimize selector matching for some common cases

This is the "better way" I mentioned in #19774, which seems to actually improve the score of dromaeo_css on talos.

<!-- 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/19781)
<!-- Reviewable:end -->
2018-01-16 16:47:29 -06:00
Xidorn Quan
d0fd92221c Optimize selector matching for some common cases. 2018-01-17 09:46:57 +11:00
bors-servo
1ac35dc7ab Auto merge of #19787 - emilio:opt-has-class, r=bholley
style: Make GeckoElement::has_class faster.

By force-inlining the fast path, and pulling out a branch that rust didn't manage to pull out.

<!-- 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/19787)
<!-- Reviewable:end -->
2018-01-16 15:15:01 -06:00
Emilio Cobos Álvarez
e55bb3e76d
style: Always inline GeckoElement::has_class.
It's easier, and probably faster, than trying to inline the function call to
Gecko.

This symbol is in libxul.so as of right now.
2018-01-16 22:14:11 +01:00
Emilio Cobos Álvarez
1e72a12265
style: Pull out the branch from snapshot_helpers::has_class.
I've verified that current libxul, at least for Linux, doesn't manage to pull
the branch out.
2018-01-16 21:38:31 +01:00
bors-servo
6f53f4fb5c Auto merge of #19785 - emilio:place-content-fallback, r=xidorn,mats
style: Don't allow fallback alignment in place-content shorthand.

Bug: 1430622
Reviewed-by: xidorn,mats
MozReview-Commit-ID: sALBFJeqvr
2018-01-16 10:52:38 -06:00
Emilio Cobos Álvarez
404148c82e
style: Don't allow fallback alignment in place-content shorthand.
Bug: 1430622
Reviewed-by: xidorn,mats
MozReview-Commit-ID: sALBFJeqvr
2018-01-16 17:51:24 +01:00
Anthony Ramine
afc78ea907 Don't bind hostname when running wptrunner for Servo 2018-01-16 17:18:10 +01:00
Anthony Ramine
4d3c932c47 Update web-platform-tests to revision c26470dac73f2df9d4822a0d3482f7eb1ebf57d9 2018-01-16 17:18:09 +01:00
bors-servo
cafc152e1b Auto merge of #19783 - jessi3py:bug-1428685, r=emilio
style: Update shadow dom preference.

We have updated gecko's preference for shadow dom, so updating servo part too.

<!-- 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/19783)
<!-- Reviewable:end -->
2018-01-16 08:50:35 -06:00
Emilio Cobos Álvarez
1c1f9c94fd
style: update bindings. 2018-01-16 15:49:50 +01:00
Simon Sapin
e790ee976e servobuild: remove obsolete comment 2018-01-16 14:39:30 +01:00
Simon Sapin
9ec53344f5 servobuild: comment some more on the default value 2018-01-16 14:39:01 +01:00
Jessica Jong
2e532b8e00 style: Update shadow dom preference. 2018-01-16 17:52:50 +08:00
bors-servo
7de87c487b Auto merge of #19779 - bholley:avoid_rule_debug_hooks, r=emilio
Avoid debug serialization of PropertyDeclaration & co in release builds

In total, this PR saves ~60k.

The conditional compilation on the _Debug FFI function eliminates one
of the ToCss variants, eliminating 54.4k, as well as a bunch of other
<1k functions. Removing the public trait implementation of Debug for the
font metrics provider eliminates the last Debug impl from stylo.

<!-- 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/19779)
<!-- Reviewable:end -->
2018-01-15 19:24:59 -06:00
Bobby Holley
9a8821a1b0 Avoid debug serialization of PropertyDeclaration & co in release builds.
In total, this PR saves ~60k.

The conditional compilation on the _Debug FFI function eliminates one
of the ToCss variants, eliminating 54.4k, as well as a bunch of other
<1k functions. Removing the public trait implementation of Debug for the
font metrics provider eliminates the last Debug impl from stylo.

MozReview-Commit-ID: nIfQ3sy4OW
2018-01-15 17:24:27 -08:00
Georg Streich
4b7cb2080e Decoupled gfx and metrics 2018-01-15 16:25:51 +01:00
bors-servo
2ff3e119fa Auto merge of #19749 - gootorov:move_-moz-context-properties_from_mako, r=emilio
style: Move -moz-context-properties outside of mako.

<!-- Please describe your changes on the following line: -->
Sub-PR of #19015

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests

<!-- 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/19749)
<!-- Reviewable:end -->
2018-01-15 06:04:30 -06:00
bors-servo
f2036e7661 Auto merge of #19757 - emilio:bye-custom-cascade, r=nox
style: Remove -servo-text-decorations-in-effect

It is bogus, because it depends on the display property as it's cascaded, but
the display property can change afterwards, for example, if we get blockified
because we're the root element or a flex item.

Replace it with a normal field instead.

Also, it carries some weight, because it's the last property that uses this
concept of "derived" property, and "custom cascade". So we can remove some code
after this.

Compute it after the cascade process in StyleAdjuster.

<!-- 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/19757)
<!-- Reviewable:end -->
2018-01-15 05:14:49 -06:00
bors-servo
032fd388e4 Auto merge of #19769 - emilio:simplify-layout-construct, r=nox
layout: Simplify the pseudo-element setup.

It's kind of a mess. See individual commits for details.

<!-- 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/19769)
<!-- Reviewable:end -->
2018-01-15 04:14:13 -06:00
bors-servo
f866e1aacb Auto merge of #19772 - ferjm:performance.wpt, r=nox
Do not fire pending callbacks on disconnected performance observer

Implement this change in the Performance Timeline API https://github.com/w3c/performance-timeline/issues/66

- [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/19772)
<!-- Reviewable:end -->
2018-01-15 03:20:57 -06:00
Fernando Jiménez Moreno
d600f246f4 Do not fire pending callbacks on disconnected performance observer 2018-01-15 09:42:31 +01:00
Emilio Cobos Álvarez
95edda93c4
layout: Add a FIXME for #19771. 2018-01-15 03:12:22 +01:00
Emilio Cobos Álvarez
ecf538ff04
layout: Avoid doing stupid calls to Node::style. 2018-01-15 03:09:13 +01:00
bors-servo
eb1634b56b Auto merge of #19768 - glennw:update-wr-fixes1, r=jdm
Update WR (overlap radii fix, subpixel AA in fast text shadows).

<!-- 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/19768)
<!-- Reviewable:end -->
2018-01-14 20:00:59 -06:00
bors-servo
ec34023d7a Auto merge of #19766 - jonleighton:issue-19765, r=emilio
Move image-orientation property outside of mako

Fixes https://github.com/servo/servo/issues/19765

r? emilio

<!-- 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/19766)
<!-- Reviewable:end -->
2018-01-14 16:55:15 -06:00
Glenn Watson
89837e6641 Update WR (overlap radii fix, subpixel AA in fast text shadows). 2018-01-15 06:56:08 +10:00
Emilio Cobos Álvarez
bc29a16285
layout: Deduplicate Node::fragment_type and FragmentDisplayListBuilding::fragment_type. 2018-01-14 21:45:39 +01:00
Emilio Cobos Álvarez
e32d6f6adf
layout: Remove type parameter from PseudoElementType.
Everyone uses () now.
2018-01-14 21:45:39 +01:00
Emilio Cobos Álvarez
cb2bba8777
style: Remove unused optional display from PseudoElementType definition.
Everyone passes None now.
2018-01-14 21:45:38 +01:00
Emilio Cobos Álvarez
55174991b6
layout: Stop overriding display of the ::-servo-details-content pseudo-element.
We only override it when there's no "open" attribute. But a display: none
pseudo-element is the same as no pseudo-element at all.

This should get the same behavior when iterating children in dom_wrapper.rs
2018-01-14 21:45:37 +01:00
Jon Leighton
bd55639d01 Move image-orientation property outside of mako
Fixes https://github.com/servo/servo/issues/19765
2018-01-14 21:19:12 +01:00
Emilio Cobos Álvarez
9dc25ed214
style: Remove "derived" properties and the concept of "custom cascade". 2018-01-14 17:10:44 +01:00
Emilio Cobos Álvarez
8732a1d7de
style: Remove -servo-text-decorations-in-effect.
It is bogus, because it depends on the display property as it's cascaded, but
the display property can change afterwards, for example, if we get blockified
because we're the root element or a flex item.

Replace it with a normal field instead.

Also, it carries some weight, because it's the last property that uses this
concept of "derived" property, and "custom cascade". So we can remove some code
after this.

Compute it after the cascade process in StyleAdjuster.
2018-01-14 17:10:44 +01:00
bors-servo
1b46e2e759 Auto merge of #19709 - CYBAI:servo-display-out-of-mako, r=emilio
style: Remove -servo-display-for-hypothetical-box from longhand

This is a sub-PR of #19015
r? emilio

For the `fn set_original_display` inside `properties.mako.rs`, I removed `is_item_or_root` first to see how the tests result is. If it's needed, I'll add it back.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19697
- [x] These changes do not require 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/19709)
<!-- Reviewable:end -->
2018-01-14 08:27:14 -06:00
bors-servo
73cb6d415e Auto merge of #19764 - servo:rustup, r=SimonSapin
Upgrade to rustc 1.25.0-nightly (e6072a7b3 2018-01-13)

CC #19762
2018-01-14 03:10:13 -06:00
Simon Sapin
fbc048aa68 Upgrade to rustc 1.25.0-nightly (e6072a7b3 2018-01-13)
CC #19762
2018-01-14 10:08:44 +01:00
Simon Sapin
631623a80e Remove work-around that is now unnecessary
We use rustup.rs, where each toolchain has its own Cargo version.
2018-01-14 01:39:31 +01:00
Simon Sapin
fe0d2866f1 Restore the ability to disable incremental compilation
It became the default in debug mode in the last Rust/Cargo update.
2018-01-14 01:38:37 +01:00
Igor Gutorov
90978c1777 Make MozContextProperties a different type 2018-01-13 22:29:52 +02:00
bors-servo
7b92eb932b Auto merge of #19760 - emilio:ruby-display-adjust, r=upsuper
style: Ruby style adjustments shouldn't reset mOriginalDisplay.

This matches what Gecko does:

  https://searchfox.org/mozilla-central/rev/7476b71e0010ab3277b77cc0ae4d998c4b1d2b64/layout/style/GeckoStyleContext.cpp#992

And it's conceptually more right, since we ideally shouldn't mutate
mOriginalDisplay from StyleAdjuster.

<!-- 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/19760)
<!-- Reviewable:end -->
2018-01-13 13:16:06 -06:00
bors-servo
08fc9f190d Auto merge of #19756 - bholley:avoid_debug_impls_in_release, r=emilio
Avoid entraining various Debug impls in release builds

See https://bugzilla.mozilla.org/show_bug.cgi?id=1351737#c29

This patch saves more than 80k of code size.

<!-- 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/19756)
<!-- Reviewable:end -->
2018-01-13 11:52:15 -06:00