Commit graph

6718 commits

Author SHA1 Message Date
Mats Palmgren
62c6f58a5b
style: Add 'row-gap' and 'gap' properties; make 'grid-[column|row]-gap' and 'grid-gap' alias the respective unprefixed properties.
This also makes 'normal' the initial value for the grid-*
properties, per:
https://github.com/w3c/csswg-drafts/issues/2294#issuecomment-369313438

Bug: 1398482
Reviewed-by: emilio
2018-04-28 10:26:08 +02:00
Emilio Cobos Álvarez
e5878b96a9
style: Remove Valgrind workaround to make ::slotted use the rule hash.
Bug: 1426516
Reviewed-by: emilio
MozReview-Commit-ID: 2q14kHjajIr
2018-04-28 10:26:07 +02:00
Emilio Cobos Álvarez
b5c18c24fe
style: Pack the shadow cascade order in ApplicableDeclarationBlock.
I didn't bother not shifting there. We need to load the whole thing and shift
for at least one of cascade level / shadow cascade order.

Callers of level() other than for_rule_tree are non-existent in release builds,
so we'd be doing the shift anyway. I can implement the same thing for
shadow_cascade_order too, but I don't think that optimization is measurable in
any way, either, the compiler should make the decision.

And just in case, the simpler version actually generated less instructions in:

  https://play.rust-lang.org/?gist=ceadb0d3cbce4eeca76e4d9ab9a1c744&version=nightly

with the simple thing.

Bug: 1455032
Reviewed-by: heycam
MozReview-Commit-ID: 8xPBJmlcyKh
2018-04-28 10:26:07 +02:00
Emilio Cobos Álvarez
b1fbb28b8a
style: Only parse font-stretch keywords in the font shorthand.
Bug: 1454883
Reviewed-by: xidorn
MozReview-Commit-ID: 4BqnOSz83w4
2018-04-28 10:26:07 +02:00
Jonathan Watt
36cef8ec68
style: Use user defined types for font-stretch / font-style.
Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io>
Bug: 1436048
Reviewed-by: jfkthame,jwatt
MozReview-Commit-ID: 7ONYtICeAqb
2018-04-28 10:26:06 +02:00
Emilio Cobos Álvarez
b2722e965c
style: Cleanup (a bit) system font copypasta.
If I had to write that again I would've killed myself :).

This is still not perfect, and the system font code is still quite a mess, but
well, little steps.

Bug: 1455358
Reviewed-by: xidorn
MozReview-Commit-ID: BmrZlCSejo7
2018-04-28 10:26:06 +02:00
Emilio Cobos Álvarez
0a8518b452
style: Fix clamping on animations for fort-style.
Bug: 1455358
Reviewed-by: xidorn
MozReview-Commit-ID: Awyub0dMOmq
2018-04-28 10:26:06 +02:00
Emilio Cobos Álvarez
737501153b
style: Use a generic type in preparation to fix animation.
Apart from a bit more code reuse.

Bug: 1455358
Reviewed-by: xidorn
MozReview-Commit-ID: 2BNOK6v30lX
2018-04-28 10:26:05 +02:00
Emilio Cobos Álvarez
32d4da8a99
style: Update font-style to css-fonts-4.
Bug: 1455358
Reviewed-by: xidorn
MozReview-Commit-ID: 1Nq5DyCjaZe
2018-04-28 10:26:05 +02:00
Emilio Cobos Álvarez
f7636e6662
style: Update font-stretch to css-fonts-4.
These won't "just work", pending changes from bug 1436048 to use a floating
point representation for those.

Bug: 1454883
Reviewed-by: xidorn
MozReview-Commit-ID: Bi5iTdFreMA
2018-04-28 10:26:04 +02:00
Xidorn Quan
91be6c31c3
style: Not copy generated binding files into dist.
Bug: 1455623
Reviewed-by: emilio
MozReview-Commit-ID: GBnkmwjDS8Y
2018-04-28 10:26:04 +02:00
Emilio Cobos Álvarez
91c3214772
style: Update bindings. 2018-04-28 10:26:03 +02:00
Emilio Cobos Álvarez
48de556f8c
style: Fixups for css-fonts-4 font-weight. 2018-04-28 10:26:03 +02:00
Xidorn Quan
0f19c25706
style: Add CAN_ANIMATE_ON_COMPOSITOR in Servo side and propagate it to ServoCSSPropList.h.
Bug: 1454830
Reviewed-by: emilio
MozReview-Commit-ID: 2OBCliDY02g
2018-04-28 10:26:02 +02:00
Xidorn Quan
bc81f09833
style: Add GETCS_NEEDS_LAYOUT_FLUSH flag in Servo side and propagate it to ServoCSSPropList.h.
Bug: 1454830
Reviewed-by: emilio
MozReview-Commit-ID: 5k08FWjobCg
2018-04-28 10:26:02 +02:00
Xidorn Quan
cfffff33a0
style: Generate nsCSSPropertyID.h from data file directly.
Bug: 1454831
Reviewed-by: emilio
MozReview-Commit-ID: CcX2uzgjWFo
2018-04-28 10:26:02 +02:00
Emilio Cobos Álvarez
84d6c13871
style: Fix cascade order of !important in Shadow DOM.
No cleaner ideas right now that carrying that counter around... Maybe a custom
type may be cleaner?

This makes ApplicableDeclarationBlock a bit bigger. I could probably try to make
the counter a 4 / 5-bit number or something and pack the counter there in the
SourceOrderAndCascadeLevel somehow...

But doesn't seem really worth the churn, and can be done as a followup in any
case. Let me know if you want to block on that.

Bug: 1454162
Reviewed-by: heycam
MozReview-Commit-ID: 1LdW9S4xA6f
2018-04-28 10:26:01 +02:00
Xidorn Quan
78f9672b6c
style: Generate property list from Servo data.
Bug: 1452542
Reviewed-by: emilio,froydnj
MozReview-Commit-ID: CwK2oL88r6F
2018-04-28 10:26:01 +02:00
Xidorn Quan
2cd06807fa
style: Have ENABLED_IN flags in nsCSSPropList.h match those in Servo side.
Bug: 1452542
Reviewed-by: emilio
MozReview-Commit-ID: 48t5u1D5rZX
2018-04-28 10:26:00 +02:00
Xidorn Quan
ff9325de5e
style: Use snake_case naming for nsCSSPropertyID of alias as well.
Bug: 1452542
Reviewed-by: emilio
MozReview-Commit-ID: 242ms8wBDIU
2018-04-28 10:26:00 +02:00
Bobby Holley
dfa019c884
style: Parse sheets on the thread pool.
Note that we also drop the dead optional aReusableSheets argument from
the async parsing path, since it was always null.

Bug: 1346988
Reviewed-by: bz,emilio
MozReview-Commit-ID: KddpGFdaqEe
2018-04-28 10:25:59 +02:00
Emilio Cobos Álvarez
bc1126ee8c
style: Update font-weight property and descriptor to css-fonts-4.
Bug: 1454596
Reviewed-by: xidorn
MozReview-Commit-ID: 27aS2UrgXjs
2018-04-28 10:25:59 +02:00
Emilio Cobos Álvarez
593e4e4c9e
style: Rename justify-items: auto to legacy.
Bug: 1363875
Reviewed-by: mats,xidorn
MozReview-Commit-ID: Jfwib2XDmSw
2018-04-28 10:25:58 +02:00
Bastien Orivel
8bd2e91cdc Update Webrender
Fixes #20609
2018-04-25 10:25:21 +02:00
bors-servo
3695fc4efc
Auto merge of #20662 - mbrubeck:smallbitvec, r=nox
Update to smallbitvec 2.1

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because covered by existing 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/20662)
<!-- Reviewable:end -->
2018-04-18 03:04:10 -04:00
Matt Brubeck
e3f79d9130 Update to smallbitvec 2.1 2018-04-17 17:24:54 -07:00
bors-servo
087bd20b6d
Auto merge of #20657 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.

See each individual commit from details.
2018-04-17 14:06:08 -04:00
Emilio Cobos Álvarez
a82ed50257
style: Fix build after 1bc30a6732. 2018-04-17 20:03:55 +02:00
Emilio Cobos Álvarez
827b82dc39
style: Fix build bustage after afe484e46b. 2018-04-17 20:02:58 +02:00
Emilio Cobos Álvarez
f5c85a816a
style: Remove an unused import. 2018-04-17 20:02:33 +02:00
Emilio Cobos Álvarez
376aafc2c8
style: Update bindings. 2018-04-17 20:02:33 +02:00
Xidorn Quan
b11c3f1f45
style: Remove trailing underscore of float ident.
Bug: 1454528
Reviewed-by: heycam
MozReview-Commit-ID: DN7rQu3adSB
2018-04-17 20:02:16 +02:00
Emilio Cobos Álvarez
1bc30a6732
style: Move unboxing to style, and handle display: contents before other suppressions.
This also adopts the resolution of [1] while at it, and switches XUL to not
support display: contents until a use case appears.

This makes our behavior consistent both with the spec and also in terms of
handling dynamic changes to stuff that would otherwise get suppressed.

Also makes us consistent with both Blink and WebKit in terms of computed style.
We were the only ones respecting "behaves as display: none" without actually
computing to display: none. Will file a spec issue to get that changed.

It also makes us match Blink and WebKit in terms of respecting display: contents
before other suppressions, see the reftest which I didn't write as a WPT
(because there's no spec supporting neither that or the opposite of what we do),
where a <g> element respects display: contents even though if it had any other
kind of display value we'd suppress the frame for it and all the descendants
since it's an SVG element in a non-SVG subtree.

Also, this removes the page-break bit from the display: contents loop, which I
think is harmless.

As long as the tests under style are based in namespace id / node name /
traversal parent, this should not make style sharing go wrong in any way, since
that's the first style sharing check we do at [2].

The general idea under this change is making all nodes with computed style of
display: contents actually honor it. Otherwise there's no way of making the
setup sound except re-introducing something similar to all the state tracking
removed in bug 1303605.

[1]: https://github.com/w3c/csswg-drafts/issues/2167
[2]: https://searchfox.org/mozilla-central/rev/fca4426325624fecbd493c31389721513fc49fef/servo/components/style/sharing/mod.rs#700

Bug: 1453702
Reviewed-by: mats, xidorn
MozReview-Commit-ID: JoCKnGYEleD
2018-04-17 20:01:46 +02:00
Bobby Holley
afe484e46b
style: Allow placeholder import sheets.
This is necessary because we can't create GeckoStyleSheets off-main-thread,
so we need a placeholder until it can be filled in.

Bug: 1454030
Reviewed-by: emilio
MozReview-Commit-ID: ssRme4fLYg
2018-04-17 20:01:27 +02:00
Jonathan Watt
ccbd84886b
Fix error name in comment for try_match_ident_ignore_ascii_case 2018-04-17 13:24:30 +01:00
Xidorn Quan
7403ec8b70
style: Support prefs for aliases.
Bug: 1453521
Reviewed-by: heycam
MozReview-Commit-ID: 8DAFmLDVYlR
2018-04-16 20:15:13 +02:00
Emilio Cobos Álvarez
0d15ab17d3
style: Update binidngs. 2018-04-14 21:15:44 +02:00
Emilio Cobos Álvarez
3ef77f59d8
style: Fix IsInAnonymousSubtree to account for XBL in Shadow DOM.
Bug: 1453206
Reviewed-by: smaug
MozReview-Commit-ID: B2aYury8K7i
2018-04-14 21:15:44 +02:00
Jonathan Watt
245d848508
style: Use a user defined type for font weight everywhere.
Bug: 1436048
Reviewed-by: emilio
2018-04-14 21:15:43 +02:00
Emilio Cobos Álvarez
061c87ad00
style: Let overflow parse two values.
Per https://github.com/w3c/csswg-drafts/issues/2484.

Bug: 1453148
Reviewed-by: xidorn
MozReview-Commit-ID: D7M3PhnTtD2
2018-04-12 10:44:38 +02:00
bors-servo
7462eda675
Auto merge of #20619 - upsuper:properties-data, r=emilio
Have nscssproperty a method of data instances

<!-- 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/20619)
<!-- Reviewable:end -->
2018-04-11 14:41:15 -04:00
Emilio Cobos Álvarez
1b84019832
style: Update bindings.
MozReview-Commit-ID: Fxe4m6jgBuZ
2018-04-11 09:50:20 +02:00
Emilio Cobos Álvarez
1d8e64c8ee
style: Simplify ImageValue.
Bug: 1452987
Reviewed-by: heycam
MozReview-Commit-ID: 5LRaaEPSSdY
2018-04-11 09:47:47 +02:00
Xidorn Quan
1599357cff Make nscssproperty a method of longhand/shorthand/alias class. 2018-04-11 15:55:11 +10:00
Xidorn Quan
2aee174b6d Put alias instances into {longhand,shorthand}.alias. 2018-04-11 15:55:09 +10:00
Bobby Holley
c99bcdd4b8 Run rustfmt on selectors, servo_arc, and style.
This was generated with:

./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style

Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
2018-04-10 17:35:15 -07:00
Bobby Holley
f7ae1a37e3 Manual fixups so that the rustfmt output won't trigger tidy. 2018-04-10 17:33:25 -07:00
Emilio Cobos Álvarez
68ce13aae4
style: Simplify border-image-repeat serialization.
We're the only ones to preserve explicitly the second keyword, as noticed in:

  https://github.com/w3c/web-platform-tests/pull/10170
2018-04-11 00:43:45 +02:00
Gecko Backout
007218b9ec Backed out changeset d186bcce1235 for failing on layout/style/test/test_shorthand_property_getters.html on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/20610
2018-04-10 16:44:34 +00:00
bors-servo
07dd37a0cf
Auto merge of #20610 - emilio:border-image-repeat, r=nox
style: Simplify border-image-repeat serialization.

We're the only ones to preserve explicitly the second keyword, as noticed in:

  https://github.com/w3c/web-platform-tests/pull/10170

<!-- 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/20610)
<!-- Reviewable:end -->
2018-04-10 08:49:28 -04:00