Commit graph

7437 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
90c0ec0cf7 Fix servo build and rustfmt recent changes.
We need to introduce another Cursor enum that is specific to embedder_traits and
that layout converts to to avoid dependency hell.
2019-01-20 16:31:01 +01:00
Emilio Cobos Álvarez
05881b5ab4 style: Represent the percentage in LengthPercentage with something other than an option.
Not the prettiest, but it will work, and LengthPercentage will be 12 bytes which
is pretty good (we could do better if wanted I guess):

  * Au(i32) length;
  * f32 percentage;
  * AllowedNumericType(u8) clamping_mode;
  * bool has_percentage;
  * bool was_calc;

This will allow me to start moving C++ stuff to use this representation.

Differential Revision: https://phabricator.services.mozilla.com/D16929
2019-01-20 14:33:12 +01:00
Martin Stransky
e27c15e2f9 Honour system titlebar button left/right placement.
Differential Revision: https://phabricator.services.mozilla.com/D16466
2019-01-20 14:32:58 +01:00
Mats Palmgren
c40839a24f style: Implement the flow-relative border-radius properties.
Bug: 1520684
Reviewed-by: emilio
2019-01-20 14:32:42 +01:00
Mats Palmgren
beb4ad91af style: Add plumbing for handling physical/logical corner values.
Bug: 1520684
Reviewed-by: emilio
2019-01-20 14:32:26 +01:00
Mats Palmgren
50babf81f8 style: Implement the border-{block,inline}-{color,style,width} shorthands.
Bug: 1520236
Reviewed-by: emilio
2019-01-20 14:32:11 +01:00
Martin Stransky
424eb94c7f Enable hidden system titlebar by default on Gnome.
This patch implements -moz-gtk-csd-hide-titlebar-by-default media query
to check if the system titlebar should be disabled by default on Linux systems
(it's already disabled on Window/Mac).

It also removes explicit definition of browser.tabs.drawInTitlebar preference on Linux.
When browser.tabs.drawInTitlebar is missing the -moz-gtk-csd-hide-titlebar-by-default
is used to obtain the titlebar state. When browser.tabs.drawInTitlebar is set
in about:config or by Customize menu, the user peference is used instead of the default.

It also fixes a -moz-gtk-csd-available media query,
it was always true regardless the actual system setting.

Differential Revision: https://phabricator.services.mozilla.com/D16036
2019-01-20 14:32:01 +01:00
Noemi Erli
1ae815214a Backed out changeset 009cf5f885ba (bug 1520236) for multiple failures in logical-box-border-color-visited-link-002.html 2019-01-20 14:31:56 +01:00
Mats Palmgren
89e12780b9 style: Implement the border-block/border-inline shorthands.
Bug: 1520396
Reviewed-by: emilio
2019-01-20 14:31:39 +01:00
Mats Palmgren
604ec247f7 style: Implement the border-{block,inline}-{color,style,width} shorthands.
Bug: 1520236
Reviewed-by: emilio
2019-01-20 14:31:20 +01:00
Mats Palmgren
30184370b1 style: Implement the inset-block/inline shorthands.
Bug: 1520229
Reviewed-by: emilio
2019-01-20 14:31:04 +01:00
Emilio Cobos Álvarez
92b58ade2f style: Move cursor to cbindgen.
The only reason it was on style_traits is so that they could use it from some
other crates, but Servo eventually ends up getting the value from an integer, so
may as well pass it around and do that in the end of the process anyway.

Differential Revision: https://phabricator.services.mozilla.com/D16557
2019-01-20 14:30:51 +01:00
Mats Palmgren
88fd730775 style: Implement the margin-block/inline shorthands.
Bug: 1519944
Reviewed-by: emilio
2019-01-20 14:30:36 +01:00
Mats Palmgren
2509c729dc style: Implement the padding-block/inline shorthands.
Bug: 1519847
Reviewed-by: emilio
2019-01-20 14:30:21 +01:00
Emilio Cobos Álvarez
2e6d34cad9 style: Rustfmt recent changes. 2019-01-13 21:59:35 +01:00
Emilio Cobos Álvarez
8101539c0a style: Document a few more macros. 2019-01-13 21:59:25 +01:00
Bobby Holley
f2d6e07aa0 Put malloc_size_of_derive on crates.io, and add a reduced fork of malloc_size_of for WebRender.
Differential Revision: https://phabricator.services.mozilla.com/D16353
2019-01-13 21:59:15 +01:00
Cameron McCormack
5bf0eea1f8 style: Remove ServoStyleSet::PrependStyleSheet.
Differential Revision: https://phabricator.services.mozilla.com/D16284
2019-01-13 21:59:07 +01:00
Boris Chiou
2b77a29697 style: Implement Animate for track lists on grid-template-{columns|rows}.
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1348519#c6 and
https://github.com/w3c/csswg-drafts/issues/3201:

Currently grid-template-rows/columns interpolate “per computed value”, which
means that if the number of tracks differs, or any track changes to/from a
particular keyword value to any other value, or if a line name is added/removed
at any position, the entire track listing is interpolated as “discrete”.
But we "agree" with two more granular options:

1. Check interpolation type per track, rather than for the entire list, before
   falling back to discrete. I.e. a length-percentage track can animate between
   two values while an adjacent auto track flips discretely to min-content.
2. Allow discrete interpolation of line name changes independently of track
   sizes.

Besides, for the repeat() function, it's complicated to support interpolation
between different repeat types (i.e. auto-fill, auto-fit) and different repeat
counts, so we always fall-back to discrete if the first parameter of repeat()
is different.

Differential Revision: https://phabricator.services.mozilla.com/D16129
2019-01-13 21:58:44 +01:00
Boris Chiou
a8943d2ec5 style: Part 1: Support field_bound on Animate.
So we can derive Animate on more generic types.

Differential Revision: https://phabricator.services.mozilla.com/D16339
2019-01-13 21:58:36 +01:00
Cameron McCormack
7efbd9cde6 style: Remove unnecessary mem::transmute in MediaListKey.
Differential Revision: https://phabricator.services.mozilla.com/D16147
2019-01-13 21:58:28 +01:00
Ryan Hunt
c04a4140a7 style: Add 'overflow-anchor' CSS property.
https://drafts.csswg.org/css-scroll-anchoring/#exclusion-api

Differential Revision: https://phabricator.services.mozilla.com/D13265
2019-01-13 21:58:18 +01:00
Simon Sapin
3a710f22ed Document public macros.
Undocumented public macros emit warnings in nightly-2019-01-11,
and we #![deny] that warning.
2019-01-11 14:17:22 +01:00
Emilio Cobos Álvarez
99f6d6f1b8 style: Three-value position syntax uses calc() as its computed value representation.
This restores the previous behavior of using calc().

Note that background-position / object-position, which test this, weren't
hitting the assertion because they use another codepath.

I didn't add more extensive tests for this because it's well tested for those
two properties, and because this is legacy anyway, see the comment in the test.

I did add the assertion to the codepath those two properties hit.

Differential Revision: https://phabricator.services.mozilla.com/D16176
2019-01-11 01:12:41 +01:00
Emilio Cobos Álvarez
119b316885 style: Rustfmt recent changes. 2019-01-11 00:57:26 +01:00
Emilio Cobos Álvarez
28cc747a0d style: Use a less-specific indexmap version. 2019-01-11 00:55:09 +01:00
Cameron McCormack
03507801cf style: Make GkAtoms opaque to avoid lld-link.exe errors.
Differential Revision: https://phabricator.services.mozilla.com/D15800
2019-01-11 00:50:46 +01:00
Cameron McCormack
63fd707bd3 style: Use atom handles in favour of atom pointers in style system code.
Differential Revision: https://phabricator.services.mozilla.com/D15078
2019-01-11 00:50:26 +01:00
Shanavas M
b763d6737c Remove OrderedMap in favor of IndexMap 2019-01-10 12:57:09 +05:30
Emilio Cobos Álvarez
2a6cdaa30a Rustfmt recent changes. 2019-01-08 12:01:28 +01:00
Emilio Cobos Álvarez
80651fde47 style: Manually rename some variables.
lop is not an acceptable variable name for LengthPercentage.

Differential Revision: https://phabricator.services.mozilla.com/D15813
2019-01-08 12:00:48 +01:00
Emilio Cobos Álvarez
daf1f02feb style: Rename LengthOrPercentage to LengthPercentage.
It does not represent `<length> | <percentage>`, but `<length-percentage>`, so
`LengthOrPercentage` is not the right name.

This patch is totally autogenerated using:

rg 'LengthOrPercentage' servo | cut -d : -f 1 | sort | uniq > files
for file in $(cat files); do sed -i "s#LengthOrPercentage#LengthPercentage#g" $file; done

Differential Revision: https://phabricator.services.mozilla.com/D15812
2019-01-08 12:00:48 +01:00
Emilio Cobos Álvarez
4a31509215 style: Fix servo build.
This also fixes a bunch of calc handling issues and such.

Also remove tests that no longer compile and are covered by WPT.
2019-01-08 12:00:42 +01:00
Emilio Cobos Álvarez
ca503b4908 style: Simplify computed::LengthOrPercentage and friends.
This is a first step to share LengthOrPercentage representation between Rust and
Gecko.

We need to preserve whether the value came from a calc() expression, for now at
least, since we do different things depending on whether we're calc or not right
now. See https://github.com/w3c/csswg-drafts/issues/3482 and dependent bugs for
example.

That means that the gecko conversion code needs to handle calc() in a bit of an
awkward way until I change it to not be needed (patches for that incoming in the
next few weeks I hope).

I need to add a hack to exclude other things from the PartialEq implementation
because the new conversion code is less lossy than the old one, and we relied on
the lousiness in AnimationValue comparison (in order to start transitions and
such, in [1] for example).

I expect to remove that manual PartialEq implementation as soon as I'm done with
the conversion.

The less lossy conversion does fix a few serialization bugs for animation values
though, like not loosing 0% values in calc() when interpolating lengths and
percentages, see the two modified tests:

 * property-types.js
 * test_animation_properties.html

Differential Revision: https://phabricator.services.mozilla.com/D15793
2019-01-07 17:05:40 +01:00
Emilio Cobos Álvarez
4c1076a9ac style: Fix gecko build. 2019-01-07 00:32:54 +01:00
Emilio Cobos Álvarez
5f173c463e style: Rustfmt recent changes. 2019-01-07 00:32:54 +01:00
Hiroyuki Ikezoe
152ef2e042 style: Drop layout.css.background-blend-mode.enabled pref.
It was enabled by default in bug 970600.

Differential Revision: https://phabricator.services.mozilla.com/D15708
2019-01-07 00:32:53 +01:00
Hiroyuki Ikezoe
48e4433ab8 style: Drop layout.css.scroll-behavior.property-enabled pref.
It was enabled by default in bug 1041833 (for desktops) and
bug 1087562 (for Fennec).

Differential Revision: https://phabricator.services.mozilla.com/D15707
2019-01-07 00:32:53 +01:00
Hiroyuki Ikezoe
a0d1a038a2 style: Drop layout.css.mix-blend-mode.enabled pref.
It was enabled by default in bug 952643.

Differential Revision: https://phabricator.services.mozilla.com/D15706
2019-01-07 00:32:53 +01:00
Hiroyuki Ikezoe
0488f81dac style: Drop layout.css.isolation.enabled pref.
It was enabled by default in bug 1091885.

Differential Revision: https://phabricator.services.mozilla.com/D15705
2019-01-07 00:32:52 +01:00
Hiroyuki Ikezoe
d862daeee6 style: Drop layout.css.image-orientation.enabled pref.
It was enabled by default in bug 825771.

Differential Revision: https://phabricator.services.mozilla.com/D15704
2019-01-07 00:32:52 +01:00
Hiroyuki Ikezoe
529ff36bb6 style: Drop layout.css.color-adjust.enabled pref.
It was enabled by default in bug 1209273.

Depends on D15702

Differential Revision: https://phabricator.services.mozilla.com/D15703
2019-01-07 00:32:52 +01:00
Hiroyuki Ikezoe
d5bee572d7 style: Drop layout.css.box-decoration-break.enabled pref.
It was enabled by default in bug 1006326.

Differential Revision: https://phabricator.services.mozilla.com/D15702
2019-01-07 00:32:52 +01:00
Emilio Cobos Álvarez
a454f6233d Rename nsIDocument to mozilla::dom::Document.
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.

Bug: 1517241
Reviewed-by: smaug
2019-01-07 00:32:51 +01:00
quasicomputational
274845fc14 style: Implement the 'overflow-inline' media query.
Bug: 1422235
Reviewed-by: emilio
2019-01-07 00:32:51 +01:00
quasicomputational
81a07b4351 style: Implement the 'overflow-block' media query.
Bug: 1422235
Reviewed-by: emilio
2019-01-07 00:32:51 +01:00
Emilio Cobos Álvarez
8929087d83 style: Update the Rust target version for bindgen.
This brings us alignas support and also associated constants for bitfield enums.

Differential Revision: https://phabricator.services.mozilla.com/D15334
2019-01-07 00:32:50 +01:00
sharath
8a6230e5a2 style: changes to implement enum class for #define NS_STYLE_COLOR_ADJUST.
Differential Revision: https://phabricator.services.mozilla.com/D15284
2019-01-07 00:32:50 +01:00
Cameron McCormack
7b444182fe style: Bump smallvec and smallbitvec.
Differential Revision: https://phabricator.services.mozilla.com/D15052
2019-01-07 00:32:50 +01:00
Boris Chiou
f0f3eb3194 style: Clamp to non-negative value after doing interpolation for circle(), ellipse(), and inset().
Replace LengthOrPercentage with NonNegativeLengthOrPercentage on
ShapeRadius, Circle, Ellipse. And derive ToAnimatedValue for ShapeSource and
its related types, so we clamp its interpolated results into non-negative
values. (i.e. The radius of circle()/ellipse() and the border-radius of
inset().)

Note: We may get negative values when using a negative easing function, so the
clamp is necessary to avoid the incorrect result or any undefined behavior.

Differential Revision: https://phabricator.services.mozilla.com/D14654
2019-01-07 00:32:49 +01:00