Commit graph

7707 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
0f512b4432
style: Fix Servo build. 2019-11-04 13:41:55 +01:00
Emilio Cobos Álvarez
a44515c314 style: Rustfmt recent changes. 2019-11-04 13:36:32 +01:00
Sam Mauldin
ac4894ed8d style: Rename Mozfield / Mozfieldtext to Field and Fieldtext.
Split off of Bug 1590894
Rename these to support unprefixed version
Also add alias to keep compatibility

Differential Revision: https://phabricator.services.mozilla.com/D50989
2019-11-04 13:36:32 +01:00
Boris Chiou
0624324942 style: Extend compositor properties for motion.
Differential Revision: https://phabricator.services.mozilla.com/D50014
2019-11-04 13:36:32 +01:00
Boris Chiou
40ede5bacb style: Use serde to serialize LengthPercentage and StyleRayFunction.
We need to pass these two types into the compositor, so we need a better
way to serialize these rust types. We use serde and bincode to
serialize/deserialize them, and use ByteBuf to pass the &[u8] data
through IPC. We define StyleVecU8 for FFI usage only.

Differential Revision: https://phabricator.services.mozilla.com/D50688
2019-11-04 13:36:32 +01:00
Boris Chiou
d99606a841 style: Add new layer messages for passing motion path info.
This also includes the implementation of SetAnimatable, FromAnimatable,
and merge the final matrix with motion path.

Besides, we always use PathBuilderSkia for calculating the gfx::Path for
web-renderer.

Differential Revision: https://phabricator.services.mozilla.com/D50011
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
fc1233f3d2 style: Remove -moz-binding, nsStyleDisplay::mBinding and similar.
Differential Revision: https://phabricator.services.mozilla.com/D50556
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
5f30ecc9b1 style: Remove some XBL code in the style system.
Differential Revision: https://phabricator.services.mozilla.com/D50554
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
854c480177 style: Experiment with implementing zoom as a transform + transform-origin shorthand.
This is a gross hack, of course, but has the advantage of not breaking sites
that use both zoom and -moz-transform / -moz-transform-origin.

There should be no behavior change when the pref is off, of course, and the
webcompat team wanted to experiment with this.

Differential Revision: https://phabricator.services.mozilla.com/D49792
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
ca05003ef6 style: Simplify media query code now that lifetimes are non-lexical.
We can deindent and simplify a bunch of this code now.

Differential Revision: https://phabricator.services.mozilla.com/D49509
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
11c1317c37 style: Remove useless conditional compilation.
Servo doesn't use this flag or -webkit- prefixed media queries, so no point in
doing this conditionally.

Differential Revision: https://phabricator.services.mozilla.com/D49508
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
70dda74b0f style: Remove layout.css.prefixes.device-pixel-ratio-webkit.
There's no effort to disable it any time soon, so I don't think it's useful to
keep the pref around.

Differential Revision: https://phabricator.services.mozilla.com/D49507
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
b98ac61a70 style: Hide -moz-touch-enabled media query in Nightly and Early Beta.
This is effectively superseded by the hover / any-hover media queries, which
actually are standard, and is also causing trouble in the wild.

Not even the browser fronted uses it, so we should be able to just remove it
everywhere at once.

Differential Revision: https://phabricator.services.mozilla.com/D49506
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
7965ddefa6 style: Support multiple parts in ::part() selectors.
Differential Revision: https://phabricator.services.mozilla.com/D48753
2019-11-04 13:36:32 +01:00
Emilio Cobos Álvarez
f701192e38 style: Remove old scroll-snap implementation, and scroll snapping prefs.
Differential Revision: https://phabricator.services.mozilla.com/D49267
2019-11-04 13:36:32 +01:00
Cameron McCormack
972e89fd41 style: Report missing include filename in ServoBindings.toml.
Differential Revision: https://phabricator.services.mozilla.com/D48625
2019-11-04 13:36:32 +01:00
Simon Sapin
5eb1472a33 2020: paint borders 2019-10-24 15:06:20 +02:00
Simon Sapin
59f68525c4 2020: enable CSS parsing of properties that are (somewhat) implemented 2019-10-24 10:44:31 +02:00
Simon Sapin
8f89f59329 2020: parse display: contents 2019-10-24 10:44:31 +02:00
Simon Sapin
13e494d74f More compact debug output for CSS values
```
Rect {
    start_corner: Vec2 { i: 0.0 px, b: 0.0 px },
    size: Vec2 { i: 1024.0 px, b: 20.0 px },
}
```

… instead of:

```
Rect {
    start_corner: Vec2 {
        inline: CSSPixelLength(
            0.0,
        ),
        block: CSSPixelLength(
            0.0,
        ),
    },
    size: Vec2 {
        inline: CSSPixelLength(
            1024.0,
        ),
        block: CSSPixelLength(
            0.0,
        ),
    },
}
```
2019-10-24 10:44:31 +02:00
Anthony Ramine
785a344e32 Update rand to 0.7 (fixes #24448) 2019-10-23 15:34:48 +02:00
Kitlith
0a07a88904 Remove usage of opts::get() from style.
Part of #22854.
2019-10-21 13:44:31 -07:00
bors-servo
4ded3038c0
Auto merge of #24339 - servo:sharing-cache-size, r=emilio
Remove obsolete logic for LRUCache size

The LRUCache implementation has been replaced, and no longer requires a backing store larger than its capacity.

<!-- 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/24339)
<!-- Reviewable:end -->
2019-10-10 00:45:14 -04:00
Emilio Cobos Álvarez
031cb05c67 style: Fix servo build. 2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
33d39d37a2 style: Rustfmt recent changes. 2019-10-09 13:21:35 +02:00
Brendan Dahl
112a68723e style: Add way to disable XBL in servo.
Adds a feature "moz_xbl" that when disabled causes the XBL code in servo to
be stubbed out.

Differential Revision: https://phabricator.services.mozilla.com/D45614
2019-10-09 13:21:35 +02:00
Brian Birtles
f6b587051d style: Don't make visibility additive.
As per discussion here: https://github.com/web-platform-tests/wpt/pull/19160

This property type does not have a procedure for addition defined so it should
not be additive.

Differential Revision: https://phabricator.services.mozilla.com/D48454
2019-10-09 13:21:35 +02:00
Savo
38e5897353 style: Replace #define NS_STYLE_FLEX_WRAP with enum class.
Differential Revision: https://phabricator.services.mozilla.com/D48166
2019-10-09 13:21:35 +02:00
Morgan Reschenberg
1c1437df59 style: Add readability backplate for all elements containing text when HCM or a11y theme is active.
Differential Revision: https://phabricator.services.mozilla.com/D42979
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
d43632c9f8 style: Don't allow negative radii in radial gradients.
Mostly renaming for clarity, as the gradient parsing code is a bit hairy.

This also changes -webkit- gradients, which is, I think, the right thing to do
(otherwise I need to give up on the type system and sprinkle parse_non_negatives
around, which would be unfortunate).

I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1008112 on
Chromium still accepting negative radii for those, so will wait to submit the
patch for review until they reply there with their intentions.

Differential Revision: https://phabricator.services.mozilla.com/D47141
2019-10-09 13:21:35 +02:00
Boris Chiou
19ddfd57d5 style: Set WillChangeBits::TRANSFORM for individual transform.
We always check StyleWillChangeBits_TRANSFORM bit together with a
transform-like property set, so using WillChangeBits::TRANSFORM bit to
represent all transform-like properties is ok.

However, it seems the new test case works well even if we don't have this
patch. I still add it for individual transform properties to make sure
the test coverage is enough anyway.

Differential Revision: https://phabricator.services.mozilla.com/D47509
2019-10-09 13:21:35 +02:00
Mats Palmgren
4a97d6f4a0 style: Implement 'repeat(auto-fill, <line-names>)' in subgridded axis.
Differential Revision: https://phabricator.services.mozilla.com/D46895
2019-10-09 13:21:35 +02:00
Boris Chiou
4a23556c4b style: Add offset shorthand.
Also, update the serialization by the shorter perference because this is
a new feature and using older syntax doesn't make sense.

Besides, use `cssOffset` for web animation IDL attribute name.

Differential Revision: https://phabricator.services.mozilla.com/D45607
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
3cb18071a2 style: Use fallible allocation for stylesheet invalidation.
If the sets get too big we cannot allocate anything else, we'll just empty them
and invalidate the whole document.

Differential Revision: https://phabricator.services.mozilla.com/D46828
2019-10-09 13:21:35 +02:00
Brian Birtles
c349dbbaa9 style: Make various border-image-* properties interpolable.
Differential Revision: https://phabricator.services.mozilla.com/D46724
2019-10-09 13:21:35 +02:00
Brian Birtles
877c6ac821 style: Parse '0' as a number for border-image-width.
As per CSS Values & Units:

"However, if a 0 could be parsed as either a <number> or a <length> in a
property (such as line-height), it must parse as a <number>."

(https://drafts.csswg.org/css-values-4/#lengths)

Differential Revision: https://phabricator.services.mozilla.com/D46723
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
a0e2aeb51c style: Let the CSS use counter prefs be independent.
* Let layout.css.use-counters.enabled be independent from the unimplemented
   property counters.

 * Always count in the style system (that is, always create
   Document::mStyleUseCounters), so that the warning from bug 1582374 works
   irrespective of these prefs.

 * Add a pref check to the SVGElement code path so that the prefs properly
   reflect whether the histograms end up being recorded or not.

 * Make the pref checks consistent (check both when reporting telemetry, not
   earlier).

Differential Revision: https://phabricator.services.mozilla.com/D46633
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
7d23cfb91e style: Always serialize aspect-ratio and font shorthand with spaces around the slash.
Differential Revision: https://phabricator.services.mozilla.com/D46568
2019-10-09 13:21:35 +02:00
Daniel Holbert
fee0f2cd23 style: In css 'display' blockification codepath, leave -moz-box alone and promote -moz-inline-box to -moz-box (if a new pref is set).
This is in the interests of allowing the frontend team to experiment with
switching from XUL grid to CSS grid, without inadvertently changing the
display values for the grid items via css-grid-item blockification.

This patch's new pref is not expected to remain in the codebase for long.
We're just adding it so that the behavior remains the same by default, because
we do currently have some XUL code that inadvertently depends on -moz-box
display values being blockified to 'block'.  The plan is for folks to remove
that dependency e.g. by adding explicit 'display:block' styling to frontend
code as-needed. After we've done that, we can tentatively flip the pref to true
by default, and then remove the pref entirely.

Differential Revision: https://phabricator.services.mozilla.com/D45258
2019-10-09 13:21:35 +02:00
Ting-Yu Lin
0138fc3707 style: Split SIDEWAYS bit in WritingMode.
Currently, there's no way to tell whether the SIDEWAYS bit is set from
`writing-mode:sideways-*` or `writing-mode:vertical-*; text-orientation:sideways;`.
To be able to tell them apart, split SIDEWAYS bits into VERTICAL_SIDEWAYS
and TEXT_SIDEWAYS. This is needed by my proposed solution in bug 1102175.

Also, provide convenience methods related to sideways writing-mode, and replace
obscure checks in the codebase.

Note that we don't have the use cases to distinguish vertical-rl from
sideways-rl in layout, but for the completeness, IsSidewaysLR() is still
defined.

Differential Revision: https://phabricator.services.mozilla.com/D46321
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
c92d1f6b9c style: Report counted unknown properties as well.
Differential Revision: https://phabricator.services.mozilla.com/D44717
2019-10-09 13:21:35 +02:00
Boris Chiou
5e77ba9bf4 style: Support ray() in offset-path and make it animatable.
1. Add `generics::motion::OffsetPath`, and use specified `Angle` and
   computed `Angle` to define specified `OffsetPath` and computed `OffsetPath`.
2. Add `ray` function into `OffsetPath`.

We also tweak the degree from 150deg to 135deg in wpt (e.g.
offset-path-ray-001.html and others) to avoid floating point precision issues.
For example:
```
// offset-path: ray(150deg ...);
// offset-distance: 20px;
matrix:
{
  {0.500000 0.866025 0.000000 0.000000},
  {-0.866025 0.500000 0.000000 0.000000},
  {0.000000 0.000000 1.000000 0.000000},
  {10.000000 17.320509 0.000000 1.000000}
}

// rotate(60deg) translate(20px)
matrix:
{
  {0.500000 0.866025 0.000000 0.000000},
  {-0.866025 0.500000 0.000000 0.000000},
  {0.000000 0.000000 1.000000 0.000000},
  {10.000000 17.320507 0.000000 1.000000}
}
```
Their translate parts, 17.320509 vs 17.320507, are almost the same (only
tiny difference), which may cause the reftest failed.

Differential Revision: https://phabricator.services.mozilla.com/D42721
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
35a98af0ed style: Add a comment quoting the spec. 2019-10-09 13:21:35 +02:00
fantasai
8798549beb style: 'text-orientation: upright' forces used 'direction' to LTR. r=jfkthame
Bug: 1315892
Reviewed-by: jfkthame
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
c78f1b62de style: Remove LengthPercentage::was_calc.
There should not be any behavior change between specifying a percentage using %
or calc(%) per the resolution of https://github.com/w3c/csswg-drafts/issues/3482.

Differential Revision: https://phabricator.services.mozilla.com/D43747
2019-10-09 13:21:35 +02:00
Emilio Cobos Álvarez
6b674a670b
style: Use consistent naming and shared code for out-of-flow stuff.
Use the functions introduced in ee17eedf3a.
2019-10-07 16:57:18 +02:00
Matt Brubeck
d0913ec528
Remove obsolete logic for LRUCache size
The LRUCache implementation has been replaced, and no longer requires a backing store larger than its capacity.
2019-10-01 09:59:12 -07:00
bors-servo
402db83b2b
Auto merge of #24303 - servo:script-codegen, r=nox
WebIDL codegen: Replace cmake with a single Python script

When [playing around with Cargo’s new timing visualization](https://internals.rust-lang.org/t/exploring-crate-graph-build-times-with-cargo-build-ztimings/10975/21), I was surprised to see the `script` crate’s build script take 76 seconds. I did not expect WebIDL bindings generation to be *that* computationally intensive.

It turns out almost all of this time is overhead. The build script uses CMake to generate bindings for each WebIDL file in parallel, but that causes a lot of work to be repeated 366 times:

* Starting up a Python VM
* Importing (parts of) the Python standard library
* Importing ~16k lines of our Python code
* Recompiling the latter to bytecode, since we used `python -B` to disable writing `.pyc` files
* Deserializing with `cPickle` and recreating in memory the results   of parsing all WebIDL files

----

This commit remove the use of CMake and cPickle for the `script` crate. Instead, all WebIDL bindings generation is done sequentially in a single Python process. This takes 2 to 3 seconds.

<!-- 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/24303)
<!-- Reviewable:end -->
2019-09-30 05:23:19 -04:00
Anthony Ramine
bceecddb64 Update html5ever to 0.24 2019-09-27 17:43:37 +02:00
Simon Sapin
5c60023cb8 WebIDL codegen: Replace cmake with a single Python script
When playing around with Cargo’s new timing visualization:
https://internals.rust-lang.org/t/exploring-crate-graph-build-times-with-cargo-build-ztimings/10975/21

… I was surprised to see the `script` crate’s build script take 76 seconds.
I did not expect WebIDL bindings generation to be *that* computationally
intensive.

It turns out almost all of this time is overhead. The build script uses CMake
to generate bindings for each WebIDL file in parallel, but that causes a lot
of work to be repeated 366 times:

* Starting up a Python VM
* Importing (parts of) the Python standard library
* Importing ~16k lines of our Python code
* Recompiling the latter to bytecode, since we used `python -B` to disable
  writing `.pyc` file
* Deserializing with `cPickle` and recreating in memory the results
  of parsing all WebIDL files

----

This commit remove the use of CMake and cPickle for the `script` crate.
Instead, all WebIDL bindings generation is done sequentially
in a single Python process. This takes 2 to 3 seconds.
2019-09-27 13:53:19 +02:00