Commit Graph

405 Commits

Author SHA1 Message Date
Mats Palmgren
605a4f2732 Bug 1466358 part 9 - [css-grid-2] Percentage basis calculation for subgrid items. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D29241
2018-11-29 18:05:54 +01:00
Mats Palmgren
cbdd809400 Bug 1466358 part 8 - [css-grid-2] Implement subgrid track sizing. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D29767
2018-11-29 18:05:53 +01:00
Mats Palmgren
4ac43b65bd Bug 1466358 part 7 - [css-grid-2] Report the right number of tracks for subgrids in ComputedGridTrackInfo. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D29150
2018-11-29 18:05:54 +01:00
Mats Palmgren
f06728fe8f Bug 1466358 part 6 - [css-grid-2] Always normalize child lists before a child list iterator is used. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D29149
2018-11-29 18:05:54 +01:00
Mats Palmgren
79ebaa22c7 Bug 1466358 part 5 - [css-grid-2] Add the accumulated margin+border+padding of subgrid ancestors to a subgrid item's content contribution if it spans the relevant edge track(s). r=dholbert 2018-11-29 18:05:53 +01:00
Mats Palmgren
ba3444344c Bug 1466358 part 4 - [css-grid-2] Make a subgrid contribute its accumulated margin+border+padding to its edge tracks for intrinsically sized tracks. r=dholbert 2018-11-29 18:05:53 +01:00
Mats Palmgren
722cf8dea1 Bug 1466358 part 3 - [css-grid-2] Add methods to calculate a subgrid's margin+border+padding. r=dholbert 2018-11-29 18:05:40 +01:00
Mats Palmgren
16607365c6 Bug 1466358 part 2 - [css-grid-2] Add a method to recursively collect relevant items for track sizing from subgrids with their lines and state translated into the caller's coordinates (idempotent patch). r=dholbert 2018-11-29 00:18:10 +01:00
Mats Palmgren
ee1d3f70b9 Bug 1466358 part 1 - [css-grid-2] Add grid item state bits for subgrids and items in a subgrid and set them when the item occupies the corresponding edge track (idempotent patch). r=dholbert 2018-11-29 00:18:10 +01:00
Mats Palmgren
6548ab544b Bug 1465296 part 5 - [css-grid-2] Implement nested area name lookups for subgrids. r=dholbert 2018-11-29 00:18:09 +01:00
Mats Palmgren
0fdd0bcf1d Bug 1465296 part 4 - [css-grid-2] Implement nested line name lookups for subgrids. r=dholbert
This adds a pointer to the parent grid's LineNameMap in
the relevant axis and traverses that recursively when
looking up line names.
2018-11-29 00:18:09 +01:00
Mats Palmgren
c52c0faec6 Bug 1465296 part 3 - [css-grid-2] Add a convenience method to get the parent GridContainerFrame for a subgrid. r=dholbert 2018-11-29 00:18:09 +01:00
Mats Palmgren
df07f34715 Bug 1465296 part 2 - [css-grid-2] Clamp lines in a subgrid to its extent. r=dholbert
Per https://drafts.csswg.org/css-grid-2/#subgrid-implicit
2018-11-29 00:18:09 +01:00
Mats Palmgren
d56214e796 Bug 1465296 part 1 - [css-grid-2] Implement subgrid item placement. r=dholbert 2018-11-29 00:18:09 +01:00
Ting-Yu Lin
62fa3e0d6a Bug 1548673 Part 1 - Rename NS_INTRINSIC_WIDTH_UNKNOWN to NS_INTRINSIC_ISIZE_UNKNOWN. r=jfkthame
This patch is generated by running the following script under layout/,
and then manually delete the FIXME comment in LayoutConstants.h

  #!/bin/bash
  function rename() {
      find .\
           -type f\
           ! -path "./obj*"\
           ! -path "./.git"\
           ! -path "./.hg"\
           \( -name "*.cpp" -or\
              -name "*.h" \)\
              -exec sed -i -e "s/$1/$2/g" "{}" \;
  }
  rename NS_INTRINSIC_WIDTH_UNKNOWN NS_INTRINSIC_ISIZE_UNKNOWN

Differential Revision: https://phabricator.services.mozilla.com/D29746
2019-05-03 17:34:36 +00:00
Emilio Cobos Álvarez
8ba05939c2 Bug 1546697 - Use a consistent style for enum classes in layout. r=dholbert
Per the discussion in:

  https://groups.google.com/d/msg/mozilla.dev.platform/P79pwa9z5m8/iPYPAWPHCAAJ

They should be CamelCase, and that's what most of them already do. This converts
the rest, which are a few.

For the ones that already used `e` or `k` prefixes, I've mostly done:

 for file in $(rg Type::e layout | cut -d : -f 1 | sort | uniq); do sed -i 's#Type::e#Type::#g' $file; done

For the ones that used uppercase, I've removed the prefix if it was already in
the type name, and turn them into CamelCase.

Depends on D28680

Differential Revision: https://phabricator.services.mozilla.com/D28681
2019-04-25 23:03:04 +00:00
Emilio Cobos Álvarez
59a88d3326 Bug 1546697 - Make BaselineSharingGroup an enum class. r=dholbert
It looked a bit weird when mixed up with the other enum classes I'm about to
rename.

Depends on D28679

Differential Revision: https://phabricator.services.mozilla.com/D28680
2019-04-25 22:42:13 +00:00
Masayuki Nakano
12b5544904 Bug 1545342 - part 2: Make some public enum of nsIPresShell move to mozilla namespace and defined as enum class in PresShellForwards.h r=smaug
This patch moves some `enum` in `nsIPresShell` which are in public scope into
`mozilla` namespace and change them as `enum class`es.

Unfortunately, only "where to scroll" enum is just defines constants of
percentages of scroll destination.  Therefore, this patch makes only them
as `static const`.

Differential Revision: https://phabricator.services.mozilla.com/D28606
2019-04-25 05:04:15 +00:00
Ting-Yu Lin
fbf66d03ae Bug 1546223 Part 4 - Mechanically replace pointer with Maybe for ReflowInput's optional containing block size. r=dholbert
There's no behavior change in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D28426
2019-04-24 17:35:31 +00:00
Masayuki Nakano
ad09cbb08f Bug 1544343 - part 2: Make factory methods take mozilla::PresShell instead of nsIPresShell r=emilio
Additionally, this patch makes `nsFrame.h` stop including `nsIPresShell.h`
and makes each users include `mozilla/PresShell.h` instead.  So, this improves
rebuild performance of `nsIPresShell.h` (and `mozilla/PresShell.h` in the
future).

Note that due to `nsIFrame::PresShell()`, `mozilla::` prefix is necessary for
`PresShell` in a lot of classes which are derived from `nsIFrame` even in
`.cpp` files.

Differential Revision: https://phabricator.services.mozilla.com/D27476
2019-04-16 07:24:49 +00:00
Masayuki Nakano
ad34e89b46 Bug 1543315 - part 9: Mark nsIPresShell::FlushPendingNotifications() as MOZ_CAN_RUN_SCRIPT r=smaug
So, this patch makes all caller of it safe including its arguments unless
they come from other methods.

Differential Revision: https://phabricator.services.mozilla.com/D27225
2019-04-13 12:43:57 +00:00
Ting-Yu Lin
8e2831d6b3 Bug 1543571 Part 2 - Replace DUMMY_PARENT_REFLOW_STATE with DUMMY_PARENT_REFLOW_INPUT. r=dholbert
This patch is generated by the following script running on Linux:

function rename() {
    find .\
         -type f\
         ! -path "./obj*"\
         ! -path "./.git"\
         ! -path "./.hg"\
         \( -name "*.cpp" -or\
            -name "*.h" \)\
            -exec sed -i -e "s/$1/$2/g" "{}" \;
}
rename DUMMY_PARENT_REFLOW_STATE DUMMY_PARENT_REFLOW_INPUT

Differential Revision: https://phabricator.services.mozilla.com/D27023
2019-04-11 20:27:18 +00:00
Ting-Yu Lin
e9811a10b3 Bug 1543571 Part 1 - Replace "reflow state" with "reflow input". r=dholbert
This patch is generated by the following script on Linux:

function rename() {
    find .\
         -type f\
         ! -path "./obj*"\
         ! -path "./.git"\
         ! -path "./.hg"\
         \( -name "*.cpp" -or\
            -name "*.h" \)\
            -exec sed -i -e "s/$1/$2/g" "{}" \;
}
rename "reflow state" "reflow input"

Differential Revision: https://phabricator.services.mozilla.com/D27022
2019-04-11 20:27:37 +00:00
Emilio Cobos Álvarez
80a8057a37 Bug 1543401 - Use rust lengths for row-gap / column-gap. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D26915
2019-04-10 16:00:03 +00:00
Masayuki Nakano
35197e3840 Bug 1542407 - Make nsIFrame use mozilla::PresShell directly rather than via nsIPresShell r=emilio
Except retrieving from weak reference, `nsIFrame` should treat
`mozilla::PresShell` directly rather than via `nsIPresShell`.

Differential Revision: https://phabricator.services.mozilla.com/D26388
2019-04-06 06:02:28 +00:00
Masayuki Nakano
edcab6281e Bug 1540930 - Make nsPresContext use mozilla::PresShell directly rather than via nsIPresShell r=emilio
`nsPresContext` should use `mozilla::PresShell` directly instead of
`nsIPresShell`.  This patch makes it.

Unfortunately, `nsPresContext` and `nsIFrame` have `PresShell()`.  Therefore,
we cannot use `PresShell*` in its methods so that this patch uses `mozilla::`
namespace prefix.

It might be better to rename them as `PresShellPtr()` in another bug.

Differential Revision: https://phabricator.services.mozilla.com/D25721
2019-04-03 12:40:26 +00:00
Mats Palmgren
ed33ad3cca Bug 288704 part 3 - Make nsBulletFrame use the built-in 'list-item' CSS counter and remove the old implementation. r=emilio 2019-03-24 23:13:53 +01:00
Mats Palmgren
18cbaca8b0 Bug 1526567 - [css-grid] Make the block-axis percentage basis be indefinite for measuring reflows. r=dholbert 2019-02-22 13:58:24 +01:00
Emilio Cobos Álvarez
b3075ed89b Bug 1529058 - Use Rust types for perspective and z-index. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D20381
2019-02-19 23:04:45 +00:00
Emilio Cobos Álvarez
9f26fc9ab4 Bug 1527410 - Use Rust sizes for flex-basis, width, height, and their min/max properties. r=jwatt
Really sorry for the size of the patch :(

Only intentional behavior change is in the uses of HasLengthAndPercentage(),
where it's easier to do the right thing. The checks that used to check for
(IsCalcUnit() && CalcHasPercentage()) are wrong since bug 957915.

Differential Revision: https://phabricator.services.mozilla.com/D19553
2019-02-15 03:59:31 +01:00
Emilio Cobos Álvarez
df05b5492b Bug 1525371 - Kill ComputedStyle::mPresContext, move the pointer to the frame instead. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D18734
2019-02-07 11:15:36 +01:00
Ehsan Akhgari
498e2df734 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset
2019-01-18 10:16:18 +01:00
Ting-Yu Lin
8b74d2a54d Bug 1515192 - Replace handcrafted FrameChildListIDs class with EnumSet. r=mats
The following APIs are changed.
1. Contains() needs to become contains(). (EnumSet's methods have lowercase names.)
2. Use list constructor rather than "|" like a plain enum.
3. Use operator+= instead of operator|=.

Differential Revision: https://phabricator.services.mozilla.com/D14908
2018-12-19 00:50:09 +00:00
Emilio Cobos Álvarez
afcff875f7 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
Cameron McCormack
638e13698f Bug 1512716 - Re-indent NS_QUERYFRAME macros after clang-format. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D13995
2018-12-07 20:00:18 +00:00
Sylvestre Ledru
e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Mats Palmgren
b758a1c9ab (no bug) - Add a couple of 'clang-format off' code comments to preserve formatting for readability. r=me 2018-11-21 22:05:20 +01:00
Emilio Cobos Álvarez
22a94a22f2 Bug 1507127 - Move the page-break-{before,after} properties to not use mako. r=heycam
And respect the computed value of `left` / `right` / etc.

Differential Revision: https://phabricator.services.mozilla.com/D11872
2018-11-15 08:15:13 +00:00
Boris Chiou
55842b617a Bug 1496558 - Part 1: Store the correct computed values for keywords for sizing properties r=mats
In order to get the correct computed value of these keywords, we have to
make sure we store the correct computed values in sizing properties in
both inline axis and block axis.

-moz-max-content and -moz-min-content should behave as the property's
initial value in block axis. -moz-fit-content and -moz-available are not
supported in block axis, so we also treat them as initial values.

Differential Revision: https://phabricator.services.mozilla.com/D8290
2018-10-16 19:38:41 +00:00
Mats Palmgren
800547f46f Bug 1490730 part 1 - [css-grid] Static position should use content-box, not padding-box. r=dholbert 2018-09-15 01:30:18 +02:00
Zhang Junzhi
33e20f7a6d Bug 1490611 - physical to logical name refactor: DISPLAY_*_WIDTH to DISPLAY_*_INLINE_SIZE(as well as the relevant struct in the macro contents) r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D5657
2018-09-12 12:35:47 +00:00
Mats Palmgren
4ccc4ca40b Bug 1489770 - Don't convert InlineBreak::Before reflow status to Incomplete unless we know the child frame is splittable. r=dholbert 2018-09-11 20:07:28 +02:00
Mats Palmgren
0a54f94bbc Bug 1489153 - Push any child next-in-flows in our principal list to OverflowList before starting our reflow. r=dholbert 2018-09-11 20:07:28 +02:00
Gerald Squelart
ad677174b8 Bug 1470462 - contain:size for nsGridContainerFrame - r=dholbert
When contain:size is set for a grid container, ignore sizes from children when
computing own size during layout.

Differential Revision: https://phabricator.services.mozilla.com/D4429
2018-09-11 00:00:05 +00:00
Mihir Iyer
82e3b0e8d2 Bug 1311892 - Implement <overflow-position> 'safe'/'unsafe' for absolutely positioned boxes in grid and flexbox. r=dholbert
MozReview-Commit-ID: 1xKmq7KFAM4
2018-07-19 12:30:48 -07:00
Andi-Bogdan Postelnicu
569bc9b63e Bug 1453795 - Layout - Initialize member fields in classes/ structures. r=dbaron 2018-07-12 09:42:14 +03:00
Brad Werth
bbde5db205 Bug 1468416 Part 1: Make nsGridContainerFrame::GetGridFrameWithComputedInfo use the same code to find the grid container frame as used by the layout algorithm itself. r=mats
MozReview-Commit-ID: 85GeT1MOApS
2018-06-14 16:35:42 -07:00
Ciure Andrei
93bc9e18a4 Backed out 2 changesets (bug 1468416) for failing nsGridContainerFrame CLOSED TREE
Backed out changeset f6f3c67e4d33 (bug 1468416)
Backed out changeset 55e1e865e626 (bug 1468416)
2018-06-22 21:37:15 +03:00
Brad Werth
4089029315 Bug 1468416 Part 1: Make nsGridContainerFrame::GetGridFrameWithComputedInfo use the same code to find the grid container frame as used by the layout algorithm itself. r=mats
MozReview-Commit-ID: 85GeT1MOApS
2018-06-14 16:35:42 -07:00
Mats Palmgren
4fc31ba301 Bug 1467239 - [css-grid] Null-check GetContentInsertionFrame() return value. r=emilio 2018-06-07 17:41:20 +02:00