Commit Graph

12254 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
6eacde7b60 Bug 1518098 - Manually rename some variables. r=jwatt#style
lop is not an acceptable variable name for LengthPercentage.

Differential Revision: https://phabricator.services.mozilla.com/D15813

--HG--
extra : moz-landing-system : lando
2019-01-07 12:42:40 +00:00
Emilio Cobos Álvarez
b78489b8af Bug 1518098 - Rename LengthOrPercentage to LengthPercentage. r=jwatt#style
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

--HG--
extra : moz-landing-system : lando
2019-01-07 12:42:42 +00:00
Emilio Cobos Álvarez
83fed3d31d Bug 1517511 - Simplify computed::LengthOrPercentage and friends. r=heycam
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

--HG--
extra : moz-landing-system : lando
2019-01-07 11:00:27 +00:00
Bastien Orivel
24db8c61b4 Bug 1518045 - Update owning_ref to 0.4.
This cherry-picks https://github.com/servo/servo/pull/22534, plus the relevant
re-vendoring.
2019-01-07 01:13:43 +01:00
Emilio Cobos Álvarez
b1ddabc921 Bug 1518045 - Rustfmt recent changes. 2019-01-07 00:53:17 +01:00
Simon Sapin
2720b7c034 Bug 1518045 - Publish selectors 0.21.0 on crates.io. r=emilio
This cherry-picks https://github.com/servo/servo/pull/22577, with the relevant
lockfile update.
2019-01-07 00:53:11 +01:00
Bastien Orivel
a0c3211f27 Bug 1518045 - Fix all clippy warnings in style_derive. r=emilio
This cherry-picks https://github.com/servo/servo/pull/22439.
2019-01-07 00:53:08 +01:00
Simon Sapin
81312a11be Bug 1518045 - Rustfmt has changed its default style. r=emilio
This cherry-picks the formatting parts of
https://github.com/servo/servo/pull/22385.
2019-01-07 00:53:06 +01:00
Emilio Cobos Álvarez
1834c20f36 Bug 1518045 - Make Servo use a single thread-pool for layout-related tasks per-process. r=jdm
Instead of per-document. This also allows to reuse this thread-pool if needed
for other stuff, like parallel CSS parsing (#22478), and to share more code with
Gecko, which is always nice.

This cherry-picks https://github.com/servo/servo/pull/22487, with a few minor
fixes to the build that are landing as part of the sync associated to this bug,
and an lsan exception tweak to point to the right module since it's moving.
2019-01-07 00:53:04 +01:00
bitnotri
542ea80ecd Bug 1461737 - Move nsstring-rs to a better location, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D15743

--HG--
rename : servo/support/gecko/nsstring/Cargo.toml => xpcom/rust/nsstring/Cargo.toml
rename : servo/support/gecko/nsstring/src/conversions.rs => xpcom/rust/nsstring/src/conversions.rs
rename : servo/support/gecko/nsstring/src/lib.rs => xpcom/rust/nsstring/src/lib.rs
extra : moz-landing-system : lando
2019-01-04 22:03:56 +00:00
Hiroyuki Ikezoe
88483b9261 Bug 1517682 - Drop layout.css.background-blend-mode.enabled pref. r=heycam
It was enabled by default in bug 970600.

Depends on D15707

Differential Revision: https://phabricator.services.mozilla.com/D15708

--HG--
extra : moz-landing-system : lando
2019-01-04 07:21:32 +00:00
Hiroyuki Ikezoe
1415d28adf Bug 1517682 - Drop layout.css.scroll-behavior.property-enabled pref. r=heycam
It was enabled by default in bug 1041833 (for desktops) and
bug 1087562 (for Fennect).

Depends on D15706

Differential Revision: https://phabricator.services.mozilla.com/D15707

--HG--
extra : moz-landing-system : lando
2019-01-04 07:21:53 +00:00
Hiroyuki Ikezoe
602a0bb6c3 Bug 1517682 - Drop layout.css.mix-blend-mode.enabled pref. r=heycam
It was enabled by default in bug 952643.

Depends on D15705

Differential Revision: https://phabricator.services.mozilla.com/D15706

--HG--
extra : moz-landing-system : lando
2019-01-04 07:22:13 +00:00
Hiroyuki Ikezoe
bed5a404f1 Bug 1517682 - Drop layout.css.isolation.enabled pref. r=heycam
It was enabled by default in bug 1091885.

Depends on D15704

Differential Revision: https://phabricator.services.mozilla.com/D15705

--HG--
extra : moz-landing-system : lando
2019-01-04 07:22:27 +00:00
Hiroyuki Ikezoe
9bdfa0cf64 Bug 1517682 - Drop layout.css.image-orientation.enabled pref. r=heycam
It was enabled by default in bug 825771.

Depends on D15703

Differential Revision: https://phabricator.services.mozilla.com/D15704

--HG--
extra : moz-landing-system : lando
2019-01-04 07:22:52 +00:00
Hiroyuki Ikezoe
6aaa816a8a Bug 1517682 - Drop layout.css.color-adjust.enabled pref. r=heycam
It was enabled by default in bug 1209273.

Depends on D15702

Differential Revision: https://phabricator.services.mozilla.com/D15703

--HG--
extra : moz-landing-system : lando
2019-01-04 07:23:38 +00:00
Hiroyuki Ikezoe
f2d516f849 Bug 1517682 - Drop layout.css.box-decoration-break.enabled pref. r=heycam
It was enabled by default in bug 1006326.

Differential Revision: https://phabricator.services.mozilla.com/D15702

--HG--
extra : moz-landing-system : lando
2019-01-04 07:23:07 +00:00
Emilio Cobos Álvarez
d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
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.
2019-01-03 17:48:33 +01:00
Xidorn Quan
e9eae8a984 Bug 1516829 - Replace trim_{left,right}* with trim_{start,end}*. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D15496

--HG--
extra : moz-landing-system : lando
2018-12-30 08:37:19 +00:00
quasicomputational
baf06c6032 Bug 1422235 - Implement the 'overflow-inline' media query. r=emilio 2018-12-28 02:16:59 +01:00
quasicomputational
20fa93316d Bug 1422235 - Implement the 'overflow-block' media query. r=emilio 2018-12-28 02:16:53 +01:00
Emilio Cobos Álvarez
d6f2d4bb73 Bug 1516365 - Update the Rust target version for bindgen. r=xidorn
This brings us alignas support and also associated constants for bitfield enums.

Differential Revision: https://phabricator.services.mozilla.com/D15334

--HG--
extra : moz-landing-system : lando
2018-12-25 23:09:29 +00:00
sharath
ba62a9414a Bug 1516221 - changes to implement enum class for #define NS_STYLE_COLOR_ADJUST. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D15284

--HG--
extra : moz-landing-system : lando
2018-12-24 15:28:11 +00:00
Cameron McCormack
99f949e5e4 Bug 1515533 - Bump smallvec and smallbitvec r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D15052

--HG--
extra : moz-landing-system : lando
2018-12-20 01:49:42 +00:00
Boris Chiou
87c7ed9b72 Bug 1512883 - Part 1: Clamp to non-negative value after doing interpolation for circle(), ellipse(), and inset(). r=emilio,birtles
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

--HG--
extra : moz-landing-system : lando
2018-12-19 19:08:08 +00:00
Boris Chiou
5c91563dc1 Bug 1322780 - Part 3: Let logical height, block-size, accept keywords. r=emilio
We should let block-size/min-block-size/max-block-size accept keywords as the
initial value, just like width in vertical writing mode or height in horizontal
writing mode.

Depends on D7536

Differential Revision: https://phabricator.services.mozilla.com/D14320

--HG--
extra : moz-landing-system : lando
2018-12-18 18:47:39 +00:00
Boris Chiou
c35f47093e Bug 1322780 - Part 2: Support unprefixed min-content and max-content. r=mats,emilio
Support unprefixed min-content and max-content and treat the prefixed
version as aliases for
1. width, min-width, max-width if inline-axis is horizontal, and
2. height, min-height, max-height if inline-axis is vertical, and
3. inline-size, min-inline-size, max-inline-size, and
4. flex-basis.

Besides, update the test cases to use unprefixed max-content and
min-content.

Depends on D7535

Differential Revision: https://phabricator.services.mozilla.com/D7536

--HG--
extra : moz-landing-system : lando
2018-12-18 18:47:37 +00:00
Boris Chiou
17c2c5c3c4 Bug 1322780 - Part 1: Use cbindgen for ExtremumLength. r=emilio
ExtremumLength is the keyword type for css sizing properties, so we
could use cbindgen.

In Gecko, we use nsStyleCoord to store the sizing properties, and use
integer values to check the enum values, so I keep the macros in nsStyleConsts.
Even though we need to convert the enum type into integer, we still have
benefits to reduce the complexity of converting Rust into C++, and leave
the simplified mappings in C++ for better readability.

Differential Revision: https://phabricator.services.mozilla.com/D7535

--HG--
extra : moz-landing-system : lando
2018-12-18 18:47:35 +00:00
Emilio Cobos Álvarez
63179c8b0f Bug 1514449 - Use NonNegative more in the border code. r=boris,#style
This ended up not being so small of a patch as I'd have thought, since it
propagated a bit. But most of it is mechanical. Interesting part is
NonNegativeNumberOrPercentage and the actual uses of the NonNegative stuff and
during parsing.

This looks like it'd fix a few correctness issues during interpolation for all
the types except for BorderRadius and co (which handled it manually).

I should write tests for those in a different patch.

Depends on D14672

Differential Revision: https://phabricator.services.mozilla.com/D14673

--HG--
extra : moz-landing-system : lando
2018-12-17 21:35:14 +00:00
Emilio Cobos Álvarez
d9fc919cd1 Bug 1514449 - Cleanup some conversion code dealing with NonNegative. r=boris,xidorn,#style
I'm about to introduce another use of it and I don't want to repeat the same
copy-pasta again.

Differential Revision: https://phabricator.services.mozilla.com/D14672

--HG--
extra : moz-landing-system : lando
2018-12-16 09:13:49 +00:00
Emilio Cobos Álvarez
94522362b2 Bug 1513920 - Make <use> shadow trees lookup keyframe rules in the containing tree. r=heycam
The same thing we do for rule matching.

Differential Revision: https://phabricator.services.mozilla.com/D14548

--HG--
extra : moz-landing-system : lando
2018-12-17 13:14:19 +00:00
Emilio Cobos Álvarez
a8df58f265 Bug 1514086 - The 'all' property is not animatable. r=hiro
Since it allows to animate display, which is not good.

This is a regression from:

  https://hg.mozilla.org/mozilla-central/rev/6884ba750aa3

Actually I wonder if the logic shouldn't be the other way around, i.e., a
shorthand is animatable if all the longhands are, not if just one.

In any case this rolls back to the previous behavior, should we do that, it
should be another bug.

Differential Revision: https://phabricator.services.mozilla.com/D14632

--HG--
extra : moz-landing-system : lando
2018-12-15 22:48:37 +00:00
Daniel Holbert
1d4ecff2ef Bug 1501492: Enable CSS containment for frontend code. r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D9963

--HG--
extra : moz-landing-system : lando
2018-12-15 08:17:46 +00:00
Emilio Cobos Álvarez
5b2e5c9d79 Bug 1514439 - Fix tidy issues. 2018-12-15 03:55:44 +01:00
Shotaro Yamada
1f70d62e6e Bug 1514439 - Remove redundant .clone()s. r=emilio 2018-12-15 03:55:42 +01:00
Emilio Cobos Álvarez
2e85a22d15 Bug 1514439 - Fix formatting of inverse transform matrix. 2018-12-15 03:55:41 +01:00
Emilio Cobos Álvarez
2348a061d6 Bug 1513009 - Fix a build warning in the stylo tests on linux32. 2018-12-14 23:35:44 +01:00
Daniel Holbert
38e7aed189 Bug 1514309 part 1: Include the 'unsafe' keyword in serializations of css-align properties. r=emilio
Previously we'd omit it since it was merely an explicit way of requesting the
default behavior.  But the spec has changed such that it's not necessarily
equivalent to the default anymore:
https://drafts.csswg.org/css-align/#overflow-values

(Technically the behaviors are probably still equivalent in our implementation,
pending bug 1451380, but we don't have to publicize that via our
serialization.)

Differential Revision: https://phabricator.services.mozilla.com/D14599

--HG--
extra : moz-landing-system : lando
2018-12-14 21:24:17 +00:00
Boris Zbarsky
5fda010a9b Bug 1514029. Fix serialization of explicitly case-sensitive attr selectors with a namespace. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D14493

--HG--
extra : moz-landing-system : lando
2018-12-13 23:25:08 +00:00
Cosmin Sabou
7e60b89bf0 Merge mozilla-central to autoland. 2018-12-13 06:00:52 +02:00
Emilio Cobos Álvarez
61a51a3800 Bug 1512026 - Handle nested slots correctly in slotted matching and invalidation. r=heycam
The patch and test should be pretty much self-descriptive.

Differential Revision: https://phabricator.services.mozilla.com/D14063

--HG--
extra : moz-landing-system : lando
2018-12-13 02:17:53 +00:00
Emilio Cobos Álvarez
77c4b9ea02 No bug - Fix a warning in a test. 2018-12-12 20:06:00 +01:00
Emilio Cobos Álvarez
8acdef75e7 Bug 1512271 - Allow link.exe to keep linking the stylo tests after rust-lang/rust#54451. r=simonsapin 2018-12-11 15:31:17 +01:00
Boris Zbarsky
d3b02f9991 Bug 1512386. Add support for 's' flag on attribute selectors. r=emilio
We could keep using ParsedCaseSensitivity::CaseSensitive as a temporary stand-in
for "case-sensitive or maybe not depending on what HTML says" until we check the
attribute list, but it seems better to make that explicit.

Differential Revision: https://phabricator.services.mozilla.com/D14093

--HG--
extra : moz-landing-system : lando
2018-12-10 22:24:49 +00:00
Emilio Cobos Álvarez
4591031b65 Bug 1513012 - Move overflow to use cbindgen. r=heycam
It's one of the most annoying / hacky mako bits we have.

Differential Revision: https://phabricator.services.mozilla.com/D14084
2018-12-11 03:07:08 +01:00
Emilio Cobos Álvarez
1bc5b6ea92 Bug 1513058 - Deduplicate a bit the malloc_size_of code for hashmaps / hashsets. r=heycam
This allows to experiment with other hash maps easily rather than
depending on what hashglobe::fake::HashMap dereferences to.

In particular I wrote it while trying to get a build working with hashbrown.

Differential Revision: https://phabricator.services.mozilla.com/D14098

--HG--
extra : moz-landing-system : lando
2018-12-11 00:11:18 +00:00
Emilio Cobos Álvarez
0b0dd2d95f Bug 1512328 - Use cbindgen for a couple more CSS properties. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D13886
2018-12-07 15:06:07 -05:00
Bastien Orivel
e648c4dee9 Bug 1511811 - Update syn and related dependencies. r=emilio 2018-12-07 09:00:20 -05:00
Daniel Varga
860ad350dd Merge mozilla-central to autoland. a=merge
--HG--
extra : rebase_source : 8ee1e412347621306f50b7d0dd1d8121ddcd498e
2018-12-06 23:48:46 +02:00
Olli Pettay
1ceeb71b80 Bug 1512256 - Move FragmentOrElement::mAttrs to Element, r=ehsan 2018-12-06 15:58:40 +02:00
Cameron McCormack
4ec3ded8ab Bug 1511718 - Remove eSafeAgentSheetFeatures. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D13866

--HG--
extra : moz-landing-system : lando
2018-12-05 21:18:21 +00:00
Emilio Cobos Álvarez
79ea897cf5 Bug 1511811 - Minor build fixup after the Servo crossbeam_channel update. 2018-12-03 08:48:25 -05:00
Bastien Orivel
87addfd044 Bug 1511811 - Update crossbeam-channel to 0.3.
Cherry-picks https://github.com/servo/servo/pull/22142
2018-12-03 08:48:15 -05:00
Emilio Cobos Álvarez
c11d6bcf14 Bug 1511811 - Update Servo's version of encoding_rs. 2018-12-03 08:47:30 -05:00
Paul Rouget
f17cf51bfd Bug 1511811 - Update mozjs and enable 'init_once' feature for Android.
Cherry-picks https://github.com/servo/servo/pull/22200
2018-12-03 08:47:06 -05:00
Emilio Cobos Álvarez
59e1f1e9ec Bug 1511811 - Rustfmt new changes to ensure Servo-tidy doesn't complain. 2018-12-03 08:45:08 -05:00
Emilio Cobos Álvarez
41f6c49a69 Bug 1511811 - Make page-break-* Gecko-only.
Servo doesn't support it.
2018-12-03 08:44:49 -05:00
Emilio Cobos Álvarez
1f4fecfcd2 Bug 1511811 - Use https for the MPL license URL.
Cherry-picks https://github.com/servo/servo/pull/22198
2018-12-03 08:43:48 -05:00
shindli
6c6e4a960d Backed out 13 changesets (bug 1511811) for Btup bustages
Backed out changeset d71cde918f43 (bug 1511811)
Backed out changeset 0ae2634de8e1 (bug 1511811)
Backed out changeset 53d1f5ca4099 (bug 1511811)
Backed out changeset 5a08148928ef (bug 1511811)
Backed out changeset da7816ec50ef (bug 1511811)
Backed out changeset 5fe23889cccc (bug 1511811)
Backed out changeset 800bc60c75a7 (bug 1511811)
Backed out changeset 2392d8199cd0 (bug 1511811)
Backed out changeset 7bc486fbd195 (bug 1511811)
Backed out changeset d2c997426108 (bug 1511811)
Backed out changeset ddd573878432 (bug 1511811)
Backed out changeset 29c8ec1559a4 (bug 1511811)
Backed out changeset f5851346109d (bug 1511811)

--HG--
rename : third_party/rust/darling_core/src/macros_private.rs => third_party/rust/darling_core/src/macros.rs
2018-12-03 15:39:11 +02:00
Emilio Cobos Álvarez
ee324a2b68 Bug 1511811 - Minor build fixup after the Servo crossbeam_channel update. 2018-12-03 08:15:30 -05:00
Emilio Cobos Álvarez
9ba570d998 Bug 1511811 - Go back to bindgen 0.43 since I can't manage to make the tup build succeed. 2018-12-03 08:15:29 -05:00
Emilio Cobos Álvarez
bd99a5f577 Bug 1511811 - Fix formatting of inverse transform matrix to appease tidy. 2018-12-03 08:15:27 -05:00
Bastien Orivel
768dd101be Bug 1511811 - Update crossbeam-channel to 0.3.
Cherry-picks https://github.com/servo/servo/pull/22142
2018-12-03 08:15:26 -05:00
Emilio Cobos Álvarez
6461b805b2 Bug 1511811 - Update Servo's version of encoding_rs. 2018-12-03 08:15:24 -05:00
Paul Rouget
0faf4cc0c4 Bug 1511811 - Update mozjs and enable 'init_once' feature for Android.
Cherry-picks https://github.com/servo/servo/pull/22200
2018-12-03 08:15:23 -05:00
Emilio Cobos Álvarez
920bd15066 Bug 1511811 - Make page-break-* Gecko-only.
Servo doesn't support it.
2018-12-03 08:15:22 -05:00
Emilio Cobos Álvarez
6359ab5223 Bug 1511811 - Use https for the MPL license URL.
Cherry-picks https://github.com/servo/servo/pull/22198
2018-12-03 08:15:21 -05:00
Emilio Cobos Álvarez
f2451c8b17 Bug 1511811 - Rustfmt new changes to ensure Servo-tidy doesn't complain. 2018-12-03 08:15:19 -05:00
Bastien Orivel
d9cbef23e2 Bug 1511811 - Update syn and related dependencies. r=emilio 2018-12-03 08:15:15 -05:00
Emilio Cobos Álvarez
b54948124d Bug 1509717 - Use cbindgen for border-style and outline-style. r=heycam
I'm pretty sure the FIXME I left in the outline-style code is a bug,
but I want to clean this up further and I didn't want to fix it without adding
a test.

Differential Revision: https://phabricator.services.mozilla.com/D12859

--HG--
extra : moz-landing-system : lando
2018-11-30 05:27:28 +00:00
Emilio Cobos Álvarez
31b0b0f833 Bug 1509717 - Move BorderStyle to border.rs. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D12858

--HG--
extra : moz-landing-system : lando
2018-11-30 05:16:52 +00:00
Emilio Cobos Álvarez
c279a94301 Bug 775618 - Implement page-break-{before,after} as legacy shorthands for {before,after}. r=heycam
This is all the style-system work needed for this.

This implements the concept of legacy shorthands, teaches tests to understand
it, and adds a few more tests for these properties in particular.

The WPT even caught a few WebKit / Blink bugs:

  https://bugs.chromium.org/p/chromium/issues/detail?id=906336
  https://bugs.webkit.org/show_bug.cgi?id=191803

This doesn't change the layout behavior for page-break-before: always, since
it'd stop breaking in multicol and such. Similarly, break-before / break-after:
column and page still behave the same, I'll file followups for those given
comment 22.

Differential Revision: https://phabricator.services.mozilla.com/D12211

--HG--
extra : moz-landing-system : lando
2018-11-30 05:35:47 +00:00
Emilio Cobos Álvarez
cd451a8c96 Bug 775618 - Introduce the concept of legacy shorthands. r=heycam
We need this because there's a weird mapping between these properties' values
('always' maps to 'page').

See https://drafts.csswg.org/css-cascade-4/#legacy-shorthand.

Differential Revision: https://phabricator.services.mozilla.com/D12213

--HG--
extra : moz-landing-system : lando
2018-11-20 04:39:36 +00:00
Emilio Cobos Álvarez
c76f00a8ad Bug 775618 - Introduce break-inside, and alias page-break-inside to it. r=heycam
This property has no weird value mapping, so we can just do this.

Differential Revision: https://phabricator.services.mozilla.com/D12212

--HG--
extra : moz-landing-system : lando
2018-11-20 05:07:52 +00:00
Shubham Kumaram
b87c4f4c0c Bug 1509664 - Change Text Rendering constants to enum classes in nsStyleConsts.h. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D12839

--HG--
extra : moz-landing-system : lando
2018-11-30 05:08:46 +00:00
Emilio Cobos Álvarez
e119964c92 Bug 1510862 - Prevent exponential blowup of custom properties. r=jwatt
Put a hard cap on the value length instead of counting substitutions, because it
works best, see the comment.

Differential Revision: https://phabricator.services.mozilla.com/D13352
2018-11-29 12:14:01 +01:00
Dorel Luca
12d48b559b Backed out changeset 3e5ea9da2cbb (bug 1510862) for Linting failure. CLOSED TREE 2018-11-29 12:35:42 +02:00
Emilio Cobos Álvarez
6ae5fdab0a Bug 1510862 - Prevent exponential blowup of custom properties. r=jwatt
Put a hard cap on the value length instead of counting substitutions, because it
works best, see the comment.

Differential Revision: https://phabricator.services.mozilla.com/D13352

--HG--
extra : moz-landing-system : lando
2018-11-29 10:16:38 +00:00
Hiroyuki Ikezoe
22056382c0 Bug 1504065 - Run background-color animations on the compositor. r=birtles
Changes for nsIDOMWindowUtils.getOMTAValue is in the next commit with come test
cases.

Differential Revision: https://phabricator.services.mozilla.com/D13001

--HG--
extra : moz-landing-system : lando
2018-11-28 00:58:46 +00:00
Andreea Pavel
f97b59258b Backed out 2 changesets (bug 1504065) for failing Win reftest at child-in-animating-element-display-none.html on a CLOSED TREE
Backed out changeset 129188370231 (bug 1504065)
Backed out changeset 359e81b35cfb (bug 1504065)
2018-11-27 15:33:29 +02:00
Hiroyuki Ikezoe
212fa4884a Bug 1504065 - Run background-color animations on the compositor. r=birtles
Changes for nsIDOMWindowUtils.getOMTAValue is in the next commit with come test
cases.

Differential Revision: https://phabricator.services.mozilla.com/D13001

--HG--
extra : moz-landing-system : lando
2018-11-27 09:26:51 +00:00
Emilio Cobos Álvarez
ef08f4f834 Bug 1509945 - Remove the display: -moz-box overrides display: -webkit-box hack. r=dholbert
display: -moz-box is no longer exposed to content so this is not necessary.

See bug 1407701 for context.

Differential Revision: https://phabricator.services.mozilla.com/D12961

--HG--
extra : moz-landing-system : lando
2018-11-26 18:56:14 +00:00
Emilio Cobos Álvarez
9ed36d7ba6 Bug 1506547 - Align user-select behavior more with other UAs. r=mats
There's a few subtle behavior changes here, which I'll try to break down in the
commit message.

The biggest one is the EditableDescendantCount stuff going away. This
was added in bug 1181130, to prevent clicking on the non-editable div from
selecting the editable div inside. This is problematic for multiple reasons:

 * First, I don't think non-editable regions of an editable element should
   be user-select: all.

 * Second, it just doesn't work in Shadow DOM (the editable descendant count is
   not kept up-to-date when not in the uncomposed doc), so nested
   contenteditables behave differently inside vs. outside a Shadow Tree.

 * Third, I think it's user hostile to just entirely disable selection if you
   have a contenteditable descendant as a child of a user-select: all thing.

   WebKit behaves like this patch in the following test-case (though not Blink):

     https://crisal.io/tmp/user-select-all-contenteditable-descendant.html

   Edge doesn't seem to support user-select: all at all (no pun intended).

   But we don't allow to select anything at all which looks wrong.

 * Fourth, it's not tested at all (which explains how we broke it in Shadow DOM
   and not even notice...).

In any case I've verified that this doesn't regress the editor from that bug. If
this regresses anything we can fix it as outlined in the first bullet point
above, which should also make us more compatible with other UAs in that
test-case.

The other change is `all` not overriding everything else. So, something like:

  <div style="-webkit-user-select: all">All <div style="-webkit-user-select: none">None</div></div>

Totally ignores the -webkit-user-select: none declaration in Firefox before this
change. This doesn't match any other UA nor the spec, and this patch aligns us
with WebKit / Blink.

This in turn makes us not need -moz-text anymore, whose only purpose was to
avoid this.

This also fixes a variety of bugs uncovered by the previous changes, like the
SetIgnoreUserModify(false) call in editor being completely useless, since
presShell->SetCaretEnabled ended in nsCaret::SetVisible, which overrode it.

This in turn uncovered even more bugs, from bugs in the caret painting code,
like not checking -moz-user-modify on the right frame if you're the last frame
of a line, to even funnier bits where before this patch you show the caret but
can't write at all...

In any case, the new setup I came up with is that when you're editing (the
selection is focused on an editable node) moving the caret forces it to end up
in an editable node, thus jumping over non-editable ones.

This has the nice effect of not completely disabling selection of
-moz-user-select: all elements that have editable descendants (which was a very
ad-hoc hack for bug 1181130, and somewhat broken per the above), and also
not needing the -moz-user-select: all for non-editable bits in contenteditable.css
at all.

This also fixes issues with br-skipping like not being able to insert content in
the following test-case:

  <div contenteditable="true"><span contenteditable="false">xyz </span><br>editable</div>

If you start moving to the left from the second line, for example.

I think this yields way better behavior in all the relevant test-cases from bug
1181130 / bug 1109968 / bug 1132768, shouldn't cause any regression, and the
complexity is significantly reduced in some places.

There's still some other broken bits that this patch doesn't fix, but I'll file
follow-ups for those.

Differential Revision: https://phabricator.services.mozilla.com/D12687

--HG--
extra : moz-landing-system : lando
2018-11-26 09:21:37 +00:00
Brindusan Cristian
31f0c21cca Backed out changeset 1575904619b5 (bug 1506547) for mochitest failures on test_reftests_with_caret.html. 2018-11-26 03:03:14 +02:00
Emilio Cobos Álvarez
b74c31e4d9 Bug 1506547 - Align user-select behavior more with other UAs. r=mats
There's a few subtle behavior changes here, which I'll try to break down in the
commit message.

The biggest one is the EditableDescendantCount stuff going away. This
was added in bug 1181130, to prevent clicking on the non-editable div from
selecting the editable div inside. This is problematic for multiple reasons:

 * First, I don't think non-editable regions of an editable element should
   be user-select: all.

 * Second, it just doesn't work in Shadow DOM (the editable descendant count is
   not kept up-to-date when not in the uncomposed doc), so nested
   contenteditables behave differently inside vs. outside a Shadow Tree.

 * Third, I think it's user hostile to just entirely disable selection if you
   have a contenteditable descendant as a child of a user-select: all thing.

   WebKit behaves like this patch in the following test-case (though not Blink):

     https://crisal.io/tmp/user-select-all-contenteditable-descendant.html

   Edge doesn't seem to support user-select: all at all (no pun intended).

   But we don't allow to select anything at all which looks wrong.

 * Fourth, it's not tested at all (which explains how we broke it in Shadow DOM
   and not even notice...).

In any case I've verified that this doesn't regress the editor from that bug. If
this regresses anything we can fix it as outlined in the first bullet point
above, which should also make us more compatible with other UAs in that
test-case.

The other change is `all` not overriding everything else. So, something like:

  <div style="-webkit-user-select: all">All <div style="-webkit-user-select: none">None</div></div>

Totally ignores the -webkit-user-select: none declaration in Firefox before this
change. This doesn't match any other UA nor the spec, and this patch aligns us
with WebKit / Blink.

This in turn makes us not need -moz-text anymore, whose only purpose was to
avoid this.

This also fixes a variety of bugs uncovered by the previous changes, like the
SetIgnoreUserModify(false) call in editor being completely useless, since
presShell->SetCaretEnabled ended in nsCaret::SetVisible, which overrode it.

This in turn uncovered even more bugs, from bugs in the caret painting code,
like not checking -moz-user-modify on the right frame if you're the last frame
of a line, to even funnier bits where before this patch you show the caret but
can't write at all...

In any case, the new setup I came up with is that when you're editing (the
selection is focused on an editable node) moving the caret forces it to end up
in an editable node, thus jumping over non-editable ones.

This has the nice effect of not completely disabling selection of
-moz-user-select: all elements that have editable descendants (which was a very
ad-hoc hack for bug 1181130, and somewhat broken per the above), and also
not needing the -moz-user-select: all for non-editable bits in contenteditable.css
at all.

This also fixes issues with br-skipping like not being able to insert content in
the following test-case:

  <div contenteditable="true"><span contenteditable="false">xyz </span><br>editable</div>

If you start moving to the left from the second line, for example.

I think this yields way better behavior in all the relevant test-cases from bug
1181130 / bug 1109968 / bug 1132768, shouldn't cause any regression, and the
complexity is significantly reduced in some places.

There's still some other broken bits that this patch doesn't fix, but I'll file
follow-ups for those.

Differential Revision: https://phabricator.services.mozilla.com/D12687

--HG--
extra : moz-landing-system : lando
2018-11-25 20:01:07 +00:00
Margareta Eliza Balazs
876022232b Merge inbound to mozilla-central. a=merge 2018-11-22 11:21:21 +02:00
Coroiu Cristina
5b23f6f303 Merge mozilla-central to autoland a=merge 2018-11-22 06:33:06 +02:00
Hiroyuki Ikezoe
1c6d6276f9 Bug 1506988 - Set the important rule change flag when a newly important rule is inserted. r=birtles
Without this change an assertion checking IsInStyleRefresh() in
EffectCompositor::PostRestyleForAnimation will be hit when we call
FindAnimationsForCompositor from RestyleManager::DoProcessPendingRestyles
that will be introduced in a subsequent commit in this series.

I wrote a crash test which causes an assertion in KeyframeEffect::CanThrottle()
without the subsequent commit, but we need more work in display item stuff to
make the assertion won't happen (bug 1508466).

Depends on D12367

Differential Revision: https://phabricator.services.mozilla.com/D12368

--HG--
extra : moz-landing-system : lando
2018-11-22 04:03:06 +00:00
Mats Palmgren
91372ff9f3 Bug 1507905 - Add -webkit-appearance:textarea and make that the default for <textarea> for compatibility with other UAs. r=jwatt 2018-11-21 22:05:20 +01:00
Cameron McCormack
9c372819c4 Bug 1508013 - Run rustfmt on servo/ports/geckolib/ r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D12206

--HG--
extra : moz-landing-system : lando
2018-11-20 04:37:53 +00:00
Andreea Pavel
72b0594cb8 Merge mozilla-inbound to mozilla-central. a=merge 2018-11-17 13:27:24 +02:00
Emilio Cobos Álvarez
77a61b05f9 Bug 1508026 - Cherry-pick some changes to malloc_size_of's Cargo.toml. 2018-11-17 10:01:59 +01:00
CYBAI
7433c9192b Bug 1508026 - Fix wrong spec link. r=emilio
This cherry-picks servo/servo#22172.
2018-11-17 10:01:31 +01:00
Emilio Cobos Álvarez
bdd6cb8f48 Bug 1508026 - Fix formatting. 2018-11-17 10:01:24 +01:00
Boris Chiou
e2fc919e91 Bug 1464791 - Add comments for the calculation of Procedure::Add on Scale and transform list. r=birtles
Add more comments to let people know the intention of the special case.

Differential Revision: https://phabricator.services.mozilla.com/D12070

--HG--
extra : moz-landing-system : lando
2018-11-16 19:06:16 +00:00
Boris Chiou
727ec2b557 Bug 1424134 - Part 4: Expand the mako code of Matrix3D and move them into transform.rs. r=emilio
Although the methods of Matrix3D in animated_properties.mako.rs could be
simplified by mako, it's a little bit hard to read because they are far
from the usage and definition. Therefore, we move them to the definition of
computed::Matrix3D and expand the mako.

Depends on D11935

Differential Revision: https://phabricator.services.mozilla.com/D11961

--HG--
extra : moz-landing-system : lando
2018-11-16 19:29:28 +00:00
Boris Chiou
2718fd0897 Bug 1424134 - Part 3: Implement ComputeSquaredDistance for individual transforms. r=birtles
We manually implement ComputeSquaredDistance for Translate, Rotate, and
Scale because we have to handle mismatch cases, and actually we don't
need to implement it for specified types.

Depends on D11934

Differential Revision: https://phabricator.services.mozilla.com/D11935

--HG--
extra : moz-landing-system : lando
2018-11-16 18:58:41 +00:00
Boris Chiou
40a2db875c Bug 1424134 - Part 2: Move the animation code of transform into a different file. r=emilio
Basically, most of the animation code of transform don't need mako, so
we could move them into values/animated/transform.rs.

However, we still use mako to generate some code to make the methods of
Matrix3D simpler, so I still leave them in animated_properties.mako.rs.

Depends on D11933

Differential Revision: https://phabricator.services.mozilla.com/D11934

--HG--
rename : servo/components/style/properties/helpers/animated_properties.mako.rs => servo/components/style/values/animated/transform.rs
extra : moz-landing-system : lando
2018-11-16 18:58:39 +00:00
Boris Chiou
a9d05e01da Bug 1424134 - Part 1: Factor the mako code out from transform functions. r=emilio
I'm trying to put all the mako code together, so we could move transform
code into a different file.

Differential Revision: https://phabricator.services.mozilla.com/D11933

--HG--
extra : moz-landing-system : lando
2018-11-16 18:58:37 +00:00
Kristen Wright
f22175b197 Bug 1460439 - Conversion from NS_STYLE_BORDER_STYLE_* macro to StyleBorderStyle::* enum class r=emilio
Converted NS_STYLE_BORDER_STYLE_* consts to enum class. Updated corresponding values to enum class. reduced BCCornerInfo struct values to fit StyleBorderStyle values inside struct. Added defaults to switches that do not fully cover all instances of StyleBorderStyle.
2018-11-07 11:56:17 -08:00