Commit Graph

24 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
1f3d6c04f2 Bug 1519958 - Refactor grid types to preserve repeat() at computed value time and use cbindgen. r=mats,boris
I'm _really_ sorry for the size of the patch. I tried to do this in two steps
but it was a lot of work and pretty ugly.

This patch makes us use cbindgen for grid-template-{rows,columns}, in order to:

 * Make us preserve repeat() at computed-value time. This is per spec since
   interpolation needs to know about repeat(). Except for subgrid, which did the
   repeat expansion at parse-time and was a bit more annoying (plus it doesn't
   really animate yet so we don't need it to comply with the spec).

 * Tweaks the WPT tests for interpolation to adopt the resolution at:
   https://github.com/w3c/csswg-drafts/issues/3503.

Trade-off here, as this patch stands, is that this change makes us use less
long-living memory, since we expand repeat() during layout, but at the cost of a
bit of CPU time during layout (conditional on the property applying though,
which wasn't the case before). It should be very easy to store a cached version
of the template, should this be too hot (I expect it isn't), or to change the
representation in other ways to optimize grid layout code if it's worth it.

Another trade-off: I've used SmallPointerArray to handle line-name merging,
pointing to the individual arrays in the style data, rather than actually
heap-allocating the merged lists. This would also be pretty easy to change
should we measure and see that it's not worth it.

This patch also opens the gate to potentially improving memory usage in some
other ways, by reference-counting line-name lists for example, though I don't
have data that suggests it is worth it.

In general, this patch makes much easier to tweak the internal representation of
the grid style data structures. Overall, I think it's a win, the amount of magic
going on in that mako code was a bit huge; it took a bit to wrap my head around
it.

This patch comments out the style struct size assertions. They will be
uncommented in a follow-up patch which contains some improvements for this type,
which are worth getting reviewed separately.

Also, this patch doesn't remove as much code as I would've hoped for because of
I tried not to change most of the dom/grid code for inspector, but I think a
fair bit of the nsGridContainerFrame.cpp code that collects information for it
can be simplified / de-copy-pasted to some extent. But that was a pre-existing
problem and this patch is already quite massive.

Differential Revision: https://phabricator.services.mozilla.com/D36598
2019-08-05 22:13:21 +02:00
Emilio Cobos Álvarez
6ed8680108 Bug 1559546 - Use atoms for grid line names. r=mats
The style system already atomizes all CustomIdent values, which means that we're
just wasting memory and CPU by doing string copies all over the place.

This patch fixes it. This also simplifies further changes to use as much of the
rust data structures as possible.

I had to switch from nsTHashtable to mozilla::HashTable because the former
doesn't handle well non-default-constructible structs (like NamedLine, which
now has a StyleAtom, which is not default-constructible).

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

--HG--
extra : moz-landing-system : lando
2019-06-19 05:58:11 +00:00
Emilio Cobos Álvarez
841d3eea32 Bug 1559545 - Use servo for the representation of grid template areas. r=mats
Right now we do a lot of useless string copying. In order to avoid transcoding
to utf-16 during layout, make sure to use nsCString at a few related places.

I may revisit this since we're storing other line names as atoms in some places.
So it may be better to just use atoms everywhere.

But that'd be a different patch either way.

Depends on D35116

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

--HG--
extra : moz-landing-system : lando
2019-06-18 22:29:58 +00:00
Micah Tigley
37269bd347 Bug 1531982 Part 1: Assign correct line names to reversed implicit areas r=bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D21297

--HG--
extra : moz-landing-system : lando
2019-04-17 17:19:01 +00:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Brad Werth
33507e6126 Bug 1456590 Part 1: Omit line names from implicitly named areas, to avoid confusion. r=mats
MozReview-Commit-ID: 3vK2MUeEuqw

--HG--
extra : rebase_source : 52b948982757381deed80879917135c887103b2b
2018-05-02 16:24:20 -07:00
Brad Werth
b61d32f5ef Bug 1423378 Part 1: Specially treat the explicit line names following a repeat auto-fit or auto-fill declaration to ensure they are always applied to the following line. r=mats
MozReview-Commit-ID: iFM5J6wRL6
2017-12-05 14:51:06 -08:00
Brad Werth
e583e7216c Bug 1425954 Part 1: Strip out duplicate names when reporting line names via grid chrome API. r=mats
MozReview-Commit-ID: 9DW6EOFEpR6

--HG--
extra : rebase_source : 0a17162035230c48c9b4376eff4471275ee00724
2017-12-18 15:42:21 -08:00
Brad Werth
f2b7fe179b Bug 1415670 Part 2: Calculate negativeNumber for each GridLine. r=mats
MozReview-Commit-ID: D56jk7MbeIa

--HG--
extra : rebase_source : 344eff097ccce60224533c12ed68401934d7536a
2017-11-08 14:06:51 -08:00
Bogdan Tara
09195ba0cc Backed out 3 changesets (bug 1415670) for failing chrome test dom/grid/test/chrome/test_grid_implicit.html r=backout on a CLOSED TREE
Backed out changeset 812aaf31c577 (bug 1415670)
Backed out changeset ec9fa6d9dca9 (bug 1415670)
Backed out changeset 92d2a5673bbc (bug 1415670)
2017-12-04 21:58:13 +02:00
Brad Werth
884393d1ec Bug 1415670 Part 2: Calculate negativeNumber for each GridLine. r=mats
MozReview-Commit-ID: D56jk7MbeIa

--HG--
extra : rebase_source : 9ebbf7877126ca90fbb929e0472aff235221b898
2017-11-08 14:06:51 -08:00
Brad Werth
a0fd338be1 Bug 1416350 - Part 2: Correct logic for Grid API line numbering with leading implicit tracks. r=mats
MozReview-Commit-ID: 4tiwdqhb5hb

--HG--
extra : rebase_source : 58db5f92938cce5c7a658c2e89c8cde286452ea1
extra : histedit_source : 863399fbebc805b5d9a4718c5d77aefeca43dbdb
2017-11-10 09:46:22 -08:00
Brad Werth
0ea02461da Bug 1373678 Part 1: Reduce grid line numbers by count of leading implicit lines, minimum 0. r=dholbert
MozReview-Commit-ID: 7RdautCGTn4

--HG--
extra : rebase_source : 537ec239115aa322c267a4a1519fe9a2574cc894
2017-06-16 11:19:36 -07:00
Andi-Bogdan Postelnicu
454d1e68fa Bug 1308208 - remove redundant null check from GridLines::SetLineInfo. r=baku
MozReview-Commit-ID: 55lIk7Klh4I

--HG--
extra : rebase_source : b60609990e5a9c88cb9a6227af1f210cf1333ca1
2016-10-06 19:05:46 +03:00
Brad Werth
ac8eac6caa Bug 1300877 - Expose removed grid auto-fit tracks to devtools API. r=mats, r=ehsan
MozReview-Commit-ID: 3E1au3BQyLw

--HG--
rename : dom/grid/test/chrome/test_grid_track_state.html => dom/grid/test/chrome/test_grid_repeats.html
2016-09-21 11:49:29 -07:00
Brad Werth
0c33f1af41 Bug 1297189 - Expose implicit grid areas via dev tools API. r=mats, r=bz 2016-09-02 16:28:27 -07:00
Brad Werth
3d92babadf Bug 1289200 - Adds GridAreas to grid css dev tools API. r=bz, mats 2016-08-23 13:34:51 -07:00
Brad Werth
dde35eb992 Bug 1241932 - Expose decoded CSS grid line properties via a Chrome API. r=mats 2016-07-07 11:38:12 -07:00
Brad Werth
e0d3269112 Bug 1241932 - Expose decoded CSS grid track properties in a Chrome API. r=heycam, r=khuey
--HG--
extra : rebase_source : 0c2a49236a2c71233a1ce6a92e50663b8a9f6238
2016-07-06 11:45:18 -07:00
Carsten "Tomcat" Book
1bb9877c16 Backed out changeset 3de5b79d7373 (bug 1241932) for bustage 2016-07-06 06:00:03 +02:00
Carsten "Tomcat" Book
2de695aebf Backed out changeset e98d1ac584d6 (bug 1241932) 2016-07-06 05:59:52 +02:00
Brad Werth
1656f9d629 Bug 1241932 - Expose decoded CSS grid line properties via a Chrome API. r=mats 2016-07-05 13:35:52 -07:00
Brad Werth
dd6149d032 Bug 1241932 - Expose decoded CSS grid track properties in a Chrome API. r=heycam, r=khuey 2016-06-24 12:20:05 -07:00