Commit Graph

9058 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
fd83f48756 Bug 1609737 - Simplify calc expressions earlier. r=boris
This simplifies a bit the code, and guarantees that all calc()s have percentages
and lengths.

I also wanted to remove unclamped_length() / specified_percentage() (for the
same reason as the above patch), but they're needed for animations for now. When
I implement min() / max() for <length-percentage> they'll be fixed.

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

--HG--
extra : moz-landing-system : lando
2020-01-23 09:18:39 +00:00
Emilio Cobos Álvarez
caa966f9de Bug 1609737 - Forbid accessing the length and percentage parts of a LengthPercentage separately. r=boris
This is just not a thing you can do if you have min() / max() / etc, as the min
/ max value may depend on the percentage basis.

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

--HG--
extra : moz-landing-system : lando
2020-01-23 09:18:39 +00:00
Cosmin Sabou
39c82e1497 Backed out 2 changesets (bug 1609737) for causing build bustages on nsCSSRenderingGradients after backing out Bug 1609711. CLOSED TREE
Backed out changeset d12980bbc425 (bug 1609737)
Backed out changeset 51f3f1a1efb8 (bug 1609737)
2020-01-23 07:39:48 +02:00
Emilio Cobos Álvarez
9b78285fd3 Bug 1609737 - Simplify calc expressions earlier. r=boris
This simplifies a bit the code, and guarantees that all calc()s have percentages
and lengths.

I also wanted to remove unclamped_length() / specified_percentage() (for the
same reason as the above patch), but they're needed for animations for now. When
I implement min() / max() for <length-percentage> they'll be fixed.

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

--HG--
extra : moz-landing-system : lando
2020-01-23 00:36:34 +00:00
Emilio Cobos Álvarez
b06718c3dc Bug 1609737 - Forbid accessing the length and percentage parts of a LengthPercentage separately. r=boris
This is just not a thing you can do if you have min() / max() / etc, as the min
/ max value may depend on the percentage basis.

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

--HG--
extra : moz-landing-system : lando
2020-01-23 00:36:27 +00:00
Emilio Cobos Álvarez
031b6afee0 Bug 1610801 - Remove font-size calc() hack to propagate keyword information. r=manishearth
It does not make any sense with min() / max() / clamp. So just forget the
keyword info when calc() is used. This also removes a bit of complex / hacky
code.

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

--HG--
extra : moz-landing-system : lando
2020-01-22 23:46:24 +00:00
Boris Chiou
ffa1ebad7b Bug 1592822 - Use Serde for OffsetRotate and PositionOrAuto. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60088

--HG--
extra : moz-landing-system : lando
2020-01-22 20:18:38 +00:00
Boris Chiou
14387265a7 Bug 1592822 - Use Serde for SVGOffsetPath. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60087

--HG--
extra : moz-landing-system : lando
2020-01-22 20:18:35 +00:00
Boris Chiou
38cc52c091 Bug 1592822 - Use Serde for Transform. r=emilio
Though this may make us use more space when serializing
StyleTransform, but we don't have to do extra conversion on the compostior
side, and this makes us easier to maintain the Rust type.

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

--HG--
extra : moz-landing-system : lando
2020-01-22 20:20:38 +00:00
Boris Chiou
7b90a66fcb Bug 1592822 - Use Serde for rotate, scale, and translate properties. r=emilio
The only drawback is: we resolve LengthPercentage value before passing
translate property through IPC, so its percentage part is redundant.
However, this makes us easier to maintain the Rust type.

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

--HG--
extra : moz-landing-system : lando
2020-01-22 20:18:31 +00:00
Bogdan Tara
958c34b738 Backed out 6 changesets (bug 1592822) for bustages complaining about layout/painting/nsDisplayList.cpp CLOSED TREE
Backed out changeset 90d0f2ebd310 (bug 1592822)
Backed out changeset 9890bad86a0e (bug 1592822)
Backed out changeset 43870cc90433 (bug 1592822)
Backed out changeset d80e0e3f5b87 (bug 1592822)
Backed out changeset 99be49183325 (bug 1592822)
Backed out changeset 9ce641556acc (bug 1592822)

--HG--
extra : histedit_source : fa4e4b2c899510f1d39ee3baa0374e2ce16d2815
2020-01-22 21:17:39 +02:00
Boris Chiou
e10013895e Bug 1592822 - Use Serde for OffsetRotate and PositionOrAuto. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60088

--HG--
extra : moz-landing-system : lando
2020-01-22 18:40:19 +00:00
Boris Chiou
40f3cb3d65 Bug 1592822 - Use Serde for SVGOffsetPath. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60087

--HG--
extra : moz-landing-system : lando
2020-01-22 18:40:11 +00:00
Boris Chiou
9735c2e972 Bug 1592822 - Use Serde for Transform. r=emilio
Though this may make us use more space when serializing
StyleTransform, but we don't have to do extra conversion on the compostior
side, and this makes us easier to maintain the Rust type.

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

--HG--
extra : moz-landing-system : lando
2020-01-22 18:40:09 +00:00
Boris Chiou
73f0ae66a9 Bug 1592822 - Use Serde for rotate, scale, and translate properties. r=emilio
The only drawback is: we resolve LengthPercentage value before passing
translate property through IPC, so its percentage part is redundant.
However, this makes us easier to maintain the Rust type.

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

--HG--
extra : moz-landing-system : lando
2020-01-22 18:40:07 +00:00
Ting-Yu Lin
ab534fe8d2 Bug 1308636 Part 3 - Remove moz-prefixed aliases for column-gap and CSS multi-column properties. r=dbaron
Introduce a new pref "layout.css.prefixes.columns" to guard the prefixed
aliases.

The modification to `properties-db.js` was generated by
`./mach devtools-css-db`.

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

--HG--
extra : moz-landing-system : lando
2020-01-16 21:45:19 +00:00
Emilio Cobos Álvarez
6110aba7be Bug 1609489 - Remove lazy_static usage from custom_properties.rs. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D60039

--HG--
extra : moz-landing-system : lando
2020-01-16 05:41:16 +00:00
Emilio Cobos Álvarez
595faf4731 Bug 1609428 - Implement min() / max() / clamp() for simple css types behind a pref. r=boris
So for everything but <length> and <length-percentage>, which have more complex
mechanics.

The pref is off for now of course.

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

--HG--
extra : moz-landing-system : lando
2020-01-15 19:43:08 +00:00
Emilio Cobos Álvarez
28f1dbebc9 Bug 1609256 - Centralize calc function parsing. r=boris
So that extending it to support other math functions like min / max / etc is
simpler.

There should be no behavior change with this patch, though I added a comment to
some places where we don't do calc() clamping correctly (though other browsers
don't either so...).

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

--HG--
extra : moz-landing-system : lando
2020-01-15 00:46:01 +00:00
Emilio Cobos Álvarez
fff6c9e1ac Bug 981248 - Rewrite <input type=number> to avoid an anonymous input. r=masayuki,surkov,jwatt,ntim,jfkthame,smaug
Instead, subclass nsTextControlFrame. This simplifies the code and avoids
correctness issues.

I kept the localization functionality though it is not spec compliant. But I
filed a bug to remove it in a followup.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 19:01:05 +00:00
Emilio Cobos Álvarez
a543b6df2f Bug 844349 - Do not ignore color: transparent in high contrast mode. r=jwatt
PDFJS uses it, for example to allow text selection. It's not great if it shows
on top of the actual PDF :-)

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

--HG--
extra : moz-landing-system : lando
2020-01-14 20:25:03 +00:00
Mihai Alexandru Michis
0d01c60c37 Backed out 2 changesets (bug 981248) for causing multiple failures.
CLOSED TREE

Backed out changeset 7a96708cc8b7 (bug 981248)
Backed out changeset 1eace7bd28d9 (bug 981248)
2020-01-14 19:28:17 +02:00
Emilio Cobos Álvarez
da2e4ef888 Bug 981248 - Rewrite <input type=number> to avoid an anonymous input. r=masayuki,surkov,jwatt,ntim,jfkthame,smaug
Instead, subclass nsTextControlFrame. This simplifies the code and avoids
correctness issues.

I kept the localization functionality though it is not spec compliant. But I
filed a bug to remove it in a followup.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 15:05:22 +00:00
Makoto Kato
29c7b3f5dd Bug 1503656 - Part 3. Don't use hardcoded value for safearea. r=emilio
To implement safe area support on Gecko, we should get safe area from Device.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 11:56:25 +00:00
Makoto Kato
c2e7d5dc85 Bug 1503656 - Part 2. Use Device for parameter instead of CssEnvironment. r=emilio
CssEnvironment alwasy is in Device, so use Device as parameter instead of CssEnvironment.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 11:56:25 +00:00
Makoto Kato
7574b8612d Bug 1503656 - Part 1. Always use CssEnvironment from media query's device. r=emilio
Although CssEnvironment is in Device of media query implementation, some code
creates CssEnvironment instance without Device. So I would like always to use it from Device of media query.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 11:55:28 +00:00
Emilio Cobos Álvarez
ba0cc69e47 Bug 1607049 - Pack LengthPercentage better. r=jwatt
So that it takes one pointer instead of two, and doesn't make nsStylePosition's
size blow up.

This is not as ugly as I was fearing, thankfully, though it requires a bit of
boilerplate. I think it's acceptable.

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

--HG--
extra : moz-landing-system : lando
2020-01-13 13:23:22 +00:00
Emilio Cobos Álvarez
d4c2489000 Bug 1607049 - Move LengthPercentage to its own file. r=jwatt
I'm (sadly) about to make it a bit more complicated to pack it better. So we
may as well do this so it is easier to reason about navigate.

I also reordered things a bit, and removed some From<> implementations and
such.

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

--HG--
rename : servo/components/style/values/computed/length.rs => servo/components/style/values/computed/length_percentage.rs
extra : moz-landing-system : lando
2020-01-13 13:23:44 +00:00
Emilio Cobos Álvarez
d10341c0bc Bug 1607049 - Split LengthPercentage again. r=boris
This is needed to support min() / max() / clamp(), etc, as those need to be a
tree of values and thus need heap storage.

This unfortunately grows LengthPercentage to be two pointers, which is bad as
it blows up the size of nsStylePosition enough to trigger the size assertions.

This patch comments out the assertion for now, the follow-up patches will
uncomment them.

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

--HG--
extra : moz-landing-system : lando
2020-01-13 13:21:58 +00:00
Xidorn Quan
87fdc21f61 Bug 1513275 - Ensure nested ruby level container don't escape from line break suppression. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D58351

--HG--
extra : moz-landing-system : lando
2020-01-10 23:47:28 +00:00
Emilio Cobos Álvarez
74eedc7178 No bug - Minor comment fix.
Differential Revision: https://phabricator.services.mozilla.com/D59310

--HG--
extra : moz-landing-system : lando
2020-01-09 11:36:02 +00:00
Emilio Cobos Álvarez
65ad59b310 Bug 1607553 - Make an assertion a release assert in nightly. r=heycam
If this can happen legitimately, this will help fuzzers to catch it.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 00:55:18 +00:00
Emilio Cobos Álvarez
547c9db8cd Bug 1606130 - Make display: -moz-box more similar to other display types for block layout. r=jfkthame,surkov
It is unexpected (see bug) that a -moz-box is affected by baseline alignment.
Make -moz-box be block-outside, and -moz-inline-box be inline-outside, instead
of the bespoke thing we have now.

This is more similar to everything else, and fixes the bug.

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

--HG--
extra : moz-landing-system : lando
2020-01-07 21:00:42 +00:00
Bogdan Tara
6571a2a6fb Backed out changeset 23d862866f3a (bug 1606130) for android crashtest complaining about 1547420-1.html 2020-01-07 22:53:10 +02:00
Emilio Cobos Álvarez
ff938720a8 Bug 1606130 - Make display: -moz-box more similar to other display types for block layout. r=jfkthame,surkov
It is unexpected (see bug) that a -moz-box is affected by baseline alignment.
Make -moz-box be block-outside, and -moz-inline-box be inline-outside, instead
of the bespoke thing we have now.

This is more similar to everything else, and fixes the bug.

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

--HG--
extra : moz-landing-system : lando
2020-01-07 18:02:05 +00:00
Emilio Cobos Álvarez
ab672d9f29 Bug 1605803 - Use cbindgen for content property. r=xidorn
This cleans up and also allows us to keep the distinction between content: none
and content: normal, which allows us to fix the computed style we return from
getComputedStyle().

Do this last bit from the resolved value instead of StyleAdjuster, because
otherwise we need to tweak every initial struct for ::before / ::after.

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

--HG--
extra : moz-landing-system : lando
2020-01-05 13:10:39 +00:00
Ting-Yu Lin
9cbd872e72 Bug 1499281 - Remove column-span pref in column.mako.rs. r=dbaron
Differential Revision: https://phabricator.services.mozilla.com/D58399

--HG--
extra : moz-landing-system : lando
2019-12-31 16:15:12 +00:00
Emilio Cobos Álvarez
233b5958d9 Bug 1604989 - Do not incorrectly share style across elements with different part names. r=nordzilla
Do the same we do for classes for now. We could be more precise and achieve a
bit more sharing with some more effort (left a comment there), but it seems
unlikely to matter in practice (and if we did that, we'd probably want to do the
same for classes).

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

--HG--
extra : moz-landing-system : lando
2019-12-31 18:14:35 +00:00
Emilio Cobos Álvarez
4d1924c9fb Bug 1606019 - Remove unused FFI function to refcount nsIReferrerInfo. r=xidorn
We don't use RefPtr<nsIReferrerInfo> in rust.

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

--HG--
extra : moz-landing-system : lando
2019-12-26 22:17:35 +00:00
Emilio Cobos Álvarez
2c729a4323 Bug 1604023 - Workaround LLVM ABI bug. r=froydnj
All the gory details in https://bugzilla.mozilla.org/show_bug.cgi?id=1600735 and
related LLVM / GCC bugs. Avoid the issue by forcing the relevant enum to be
32-bit wide, so as to not trigger the LLVM bug.

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

--HG--
extra : moz-landing-system : lando
2019-12-19 20:43:06 +00:00
Emilio Cobos Álvarez
cae1e55d61 Bug 1581467 - Do not use synthetic display-inside values. r=TYLin
This matches the new servo layout engine too, and thus removes some #[cfg]
gunk.  Just use `flow` since it doesn't simplify the layout code as much.

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

--HG--
extra : moz-landing-system : lando
2019-12-19 01:19:04 +00:00
Sean Voisen
0e463d054a Bug 1453472 - Add support for logical versions of overscroll-behavior. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D57363

--HG--
extra : moz-landing-system : lando
2019-12-17 11:27:41 +00:00
Emilio Cobos Álvarez
8a91625e5c Bug 1604173 - Cherry-pick various servo-layout-2020 changes.
Depends on D57314

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

--HG--
extra : moz-landing-system : lando
2019-12-16 13:34:23 +00:00
Emilio Cobos Álvarez
d40bfe4265 Bug 1604173 - Rustfmt recent changes.
Differential Revision: https://phabricator.services.mozilla.com/D57314

--HG--
extra : moz-landing-system : lando
2019-12-16 13:34:20 +00:00
Emilio Cobos Álvarez
5758ca4f25 Bug 1604062 - Use less Au in font code. r=boris
Font code is the only thing that was using Au in the style system without
interfacing with Gecko, and there was no real reason for it to do so.

This slightly simplifies the code.

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

--HG--
extra : moz-landing-system : lando
2019-12-16 13:22:04 +00:00
Emilio Cobos Álvarez
78dbde3534 Bug 1604063 - Make LengthPercentage not copy. r=boris
This is needed to support min() / max() / clamp(), etc.

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

--HG--
extra : moz-landing-system : lando
2019-12-15 21:33:34 +00:00
Emilio Cobos Álvarez
b498defa90 Bug 1603455 - Remove full-screen-api.unprefix.enabled. r=xidorn,smaug
It's been enabled since Firefox 64.

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

--HG--
extra : moz-landing-system : lando
2019-12-13 13:27:27 +00:00
jeffin143
8f714c8f81 Bug 1601856 : convert NS_STYLE_VISIBILITY_* to an enum class in nsStyleConsts.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D56140

--HG--
extra : moz-landing-system : lando
2019-12-13 05:34:38 +00:00
Emilio Cobos Álvarez
fe173632c7 Bug 1602843 - Preserve CSS input exactly during sanitization. r=hsivonen
This avoids the mutation due to the different serialization in some cases.

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

--HG--
extra : moz-landing-system : lando
2019-12-12 13:57:54 +00:00
Noemi Erli
2b5af87228 Backed out changeset d23f209ada8b (bug 1603455) for causing failures in test_fullscreen-api.html
--HG--
extra : rebase_source : 7b7990746d3884eeced2404ed9bc78590db4b77c
2019-12-12 23:49:35 +02:00