Commit graph

488 commits

Author SHA1 Message Date
Ting-Yu Lin
7323697f18 Bug 1625362 Part 3 - Extract grid container's PushIncompleteChildren logic, and move it to nsContainerFrame. r=mats
I left all the bits that related to grid container, such as setting
aStatus, NS_STATE_GRID_DID_PUSH_ITEMS, and aState.mIter in
nsGridContainerFrame::ReflowRowsInFragmentainer().

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

--HG--
extra : moz-landing-system : lando
2020-04-15 18:31:35 +00:00
Ting-Yu Lin
a2e0d00564 Bug 1625362 Part 2 - Move some helpers manipulating overflow lists from nsGridContainerFrame to nsContainerFrame. r=mats
We can utilize these helpers to implement flex item fragmentation.

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

--HG--
extra : moz-landing-system : lando
2020-04-15 18:31:33 +00:00
Ting-Yu Lin
97c3b1d8cb Bug 1625362 Part 1 - Move ReparentFrame and ReparentFrames into nsContainerFrame. r=mats
We have duplicated ReparentFrame and ReparentFrames define in both
nsBlockFrame and nsGridContainerFrame. We should move them into
nsContainerFrame.

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

--HG--
extra : moz-landing-system : lando
2020-04-15 18:31:25 +00:00
Emily McDonough
a076865928 Bug 1628837 - Add subgrid property address to nsGridContainerFrame frame dump output r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D70436

--HG--
extra : moz-landing-system : lando
2020-04-09 21:25:12 +00:00
Emily McDonough
9ae2ce3fae Bug 1624756 - Use EmplaceBack instead of AppendElement(std::make_pair) in TrackSizingFunction::ExpandNonRepeatAutoTracks r=mats
Differential Revision: https://phabricator.services.mozilla.com/D68130

--HG--
extra : moz-landing-system : lando
2020-03-31 16:36:26 +00:00
Emily McDonough
38fbd0aba9 Bug 1625051 Part 1 - Fix calculation of maximum repeat count for grid repeat(auto) r=mats
Differential Revision: https://phabricator.services.mozilla.com/D68488

--HG--
extra : moz-landing-system : lando
2020-03-30 23:46:41 +00:00
André Bargull
2712714d84 Bug 1625138 - Part 35: Replace mozilla::TrueType with std::true_type. r=froydnj,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D68554

--HG--
extra : moz-landing-system : lando
2020-03-28 13:57:20 +00:00
Ting-Yu Lin
b3c3bf9bc9 Bug 1624514 Part 2 - Generalize nsIFrame::ContentBSize() to be ContentSize(). r=AlaskanEmily
To get the logical content size of a frame, some callers use
GetContentRectRelativeToSelf().Size() and then convert it to
LogicalRect. We really should generalize ContentBSize(), and provide
ContentSize() for such purpose.

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

--HG--
extra : moz-landing-system : lando
2020-03-25 18:12:25 +00:00
Emily McDonough
d3cac52f73 Bug 1341507 part 6 - Enable multiple grid repeat values in Servo r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60931

--HG--
extra : moz-landing-system : lando
2020-03-19 22:11:48 +00:00
Emily McDonough
e8a1c53e39 Bug 1341507 part 5 - Support multiple tracks in repeat-auto in line name maps r=mats
This includes when using subgrid layout.

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

--HG--
extra : moz-landing-system : lando
2020-03-19 22:11:45 +00:00
Emily McDonough
e2096a565d Bug 1341507 part 4 - Add auto-fill length field to line name lists returned from Servo. r=mats,emilio
Rename fill_idx to fill_start, to indicate it is not a single value but a
range. Also change a numeric_limits<>::max() involving the fill_start to use
decltype() to ensure its type matches that of the auto-generated structure's
field, while we're touching that code.

The test to ensure only a single repeat value is allowed will be removed by a
later commit.

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

--HG--
extra : moz-landing-system : lando
2020-03-19 22:11:43 +00:00
Emily McDonough
e478232272 Bug 1341507 part 3 - Support multiple repeat values when getting the sizing of a track by index. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D60928

--HG--
extra : moz-landing-system : lando
2020-03-19 22:11:35 +00:00
Emily McDonough
7199fa5871 Bug 1341507 part 2 - Take multiple repeat track sizes into account when computing how many repetitions will fit. r=mats
This also means that the result of CalculateRepeatFillCount is specified to be
a number of repetitions of all repeat tracks, not the total number of tracks.

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

--HG--
extra : moz-landing-system : lando
2020-03-19 22:35:48 +00:00
Stefan Hindli
f3854a78ed Backed out 7 changesets (bug 1341507) for mochitest failures in dom/grid/test/chrome/test_grid_repeat_auto_fill.html CLOSED TREE
Backed out changeset e4e968fabe2b (bug 1341507)
Backed out changeset 6cafdef7eb79 (bug 1341507)
Backed out changeset eff4ad47440c (bug 1341507)
Backed out changeset 55432ee0cd4b (bug 1341507)
Backed out changeset e798ebf91eca (bug 1341507)
Backed out changeset 08d38f05b160 (bug 1341507)
Backed out changeset 6b35af9ecb38 (bug 1341507)
2020-03-19 02:49:17 +02:00
Emily McDonough
8cc2cae246 Bug 1341507 part 6 - Enable multiple grid repeat values in Servo r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60931

--HG--
extra : moz-landing-system : lando
2020-03-18 22:44:41 +00:00
Emily McDonough
cd299acef9 Bug 1341507 part 5 - Support multiple tracks in repeat-auto in line name maps r=mats
This includes when using subgrid layout.

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

--HG--
extra : moz-landing-system : lando
2020-03-18 23:01:23 +00:00
Emily McDonough
3496717c21 Bug 1341507 part 4 - Add auto-fill length field to line name lists returned from Servo. r=mats,emilio
Rename fill_idx to fill_start, to indicate it is not a single value but a
range. Also change a numeric_limits<>::max() involving the fill_start to use
decltype() to ensure its type matches that of the auto-generated structure's
field, while we're touching that code.

The test to ensure only a single repeat value is allowed will be removed by a
later commit.

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

--HG--
extra : moz-landing-system : lando
2020-03-18 22:44:36 +00:00
Emily McDonough
848eb5a6ca Bug 1341507 part 3 - Support multiple repeat values when getting the sizing of a track by index. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D60928

--HG--
extra : moz-landing-system : lando
2020-03-18 22:44:34 +00:00
Emily McDonough
28826122d4 Bug 1341507 part 2 - Take multiple repeat track sizes into account when computing how many repetitions will fit. r=mats
This also means that the result of CalculateRepeatFillCount is specified to be
a number of repetitions of all repeat tracks, not the total number of tracks.

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

--HG--
extra : moz-landing-system : lando
2020-03-18 22:59:58 +00:00
Chris Fronk
d5b004443b Bug 1143478 - Rename mozilla::Pair to CompactPair. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D64511

--HG--
rename : mfbt/Pair.h => mfbt/CompactPair.h
extra : moz-landing-system : lando
2020-03-17 12:42:12 +00:00
Mats Palmgren
796ab8fde7 Bug 1613210 - Delegate intrinsic size calls to the first continuation for nsGridContainerFrames. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D65643

--HG--
extra : moz-landing-system : lando
2020-03-17 09:55:39 +00:00
Ting-Yu Lin
afe9123179 Bug 1622008 Part 3 - Remove nsPresContext* and PresShell* from the argument list of some continuing-frame-creation methods. r=dholbert
Both PresShell() and PresContext() are cached in nsIFrame. This
simplifies the setup for the callers to
nsCSSFrameConstructor::CreateContinuingFrame().

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

--HG--
extra : moz-landing-system : lando
2020-03-12 21:50:23 +00:00
shindli
b02b3a6e1a Backed out changeset a08637fb30c8 (bug 1143478) for causing bustages in /builds/worker/checkouts/gecko/ipc/mscom/Registration.cpp CLOSED TREE
--HG--
rename : mfbt/CompactPair.h => mfbt/Pair.h
2020-03-11 14:30:54 +02:00
Chris Fronk
a27e438c2d Bug 1143478 - Rename mozilla::Pair to CompactPair. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D64511

--HG--
rename : mfbt/Pair.h => mfbt/CompactPair.h
extra : moz-landing-system : lando
2020-03-11 12:18:13 +00:00
Mats Palmgren
e41033bc70 Bug 1618312 - [css-grid] Use the outermost frame to check the computed position value since we don't inherit that to anonymous frames. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D64851

--HG--
extra : moz-landing-system : lando
2020-03-02 15:51:24 +00:00
Mats Palmgren
7003a28618 Bug 1618351 - Floor subgrid auto-fill repeat count at zero to avoid underflow of unsigned integer mRepeatAutoEnd. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D64637

--HG--
extra : moz-landing-system : lando
2020-02-27 21:44:04 +00:00
Mats Palmgren
29b084bccb Bug 1608851 - Only an actual <track-list> guarantees a track (not an ignored 'subgrid' value). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D64452

--HG--
extra : moz-landing-system : lando
2020-02-27 05:47:59 +00:00
Martin McNickle
30c6161dca Bug 1615380 - Part 2 - Use the cbindgen output for GridAutoFlow directly in gecko. r=emilio
Depends on D62787

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

--HG--
extra : moz-landing-system : lando
2020-02-14 15:48:10 +00:00
Chris Fronk
113fa0f94e Bug 1614432 - Remove redundant nested #IF r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D62529

--HG--
extra : moz-landing-system : lando
2020-02-12 02:28:30 +00:00
Emilio Cobos Álvarez
c5c0ef9787 Bug 1613349 - Rename nsIFrame::DeleteProperty to RemoveProperty. r=dholbert
As it doesn't necessarily call delete and that may be confusing.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 16:06:49 +00:00
Daniel Holbert
ae192ec3a5 Bug 1613192: Fix non-unified build bustage in layout/{base,generic} directories. r=TYLin
Summary of the changes/reasons:

- LayoutTelemetryTools.h directly uses several types whose headers it needs to
  include. (These includes were present in its .cpp file; I'm migrating them
  from there to the .h file, and I'm adding a new include for "Saturate.h" to
  provide the SaturateUint8 type.)

- LayoutTelemetryTools.cpp needs an include for MainThreadUtils.h, to provide
  NS_IsMainThread().

- StaticPresData.cpp needs an include for ServoUtils.h, to provide
  AssertIsMainThreadOrServoFontMetricsLocked().

- ZoomConstraintsClient.h needs a forward-decl for mozilla::dom::Document since
  it uses a pointer of that type in a function-decl.

- ScrollSnap.h needs forward-decls of nsPoint/nsRect for some references to
  those types in a method signature.

- nsGridContainerFrame.cpp needs an include for nsBoxLayoutState.h since it
  uses that type (it instantiates a nsBoxLayoutState instance).

- nsPlaceholderFrame.cpp needs a "using" decl for the mozilla::dom namespace in
  order to use the un-namespace-prefixed "Element" type.

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

--HG--
extra : moz-landing-system : lando
2020-02-04 19:34:51 +00:00
Emilio Cobos Álvarez
4812f9408a Bug 1611583 - Use cbindgen for css-align types. r=dholbert
This provides stronger typing and removes a bunch of subtle constants matching.

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

--HG--
extra : moz-landing-system : lando
2020-01-31 00:56:49 +00:00
Emily McDonough
20c74bb15f Bug 1611950 - Make constructor of CellMap::Cell constexpr r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D61179

--HG--
extra : moz-landing-system : lando
2020-01-29 06:34:48 +00:00
Mats Palmgren
df9c8cc274 Bug 1606516 - Inhibit subgridding a parent axis that has no tracks. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D60566

--HG--
extra : moz-landing-system : lando
2020-01-25 02:45:31 +00:00
Mats Palmgren
14fdc03837 Bug 1610362 - Floor track sizes to zero after adjusting for subgrid margin+border+padding. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D60565

--HG--
extra : moz-landing-system : lando
2020-01-25 02:20:28 +00:00
Emilio Cobos Álvarez
aa3a33a08a Bug 1597055 - Don't stretch grid items with non-auto block-size. r=mats
Per the resolution in https://github.com/w3c/csswg-drafts/issues/4525.

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

--HG--
extra : moz-landing-system : lando
2020-01-25 20:14:59 +00:00
Emilio Cobos Álvarez
5cd5e6f148 Bug 1609996 - Remove mozilla::Swap in favor of std::swap. r=froydnj
Now mfbt/Move.h is empty except for that excellent comment about move
semantics... Should we put it somewhere else and delete the header as a
follow-up? Or just delete the header and carry on?

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:17:06 +00:00
Emily McDonough
278cadcc1e Bug 1341507 - Refactor auto-fit empty track calculations into a separate method r=mats
Differential Revision: https://phabricator.services.mozilla.com/D58026

--HG--
extra : moz-landing-system : lando
2020-01-16 04:27:33 +00:00
Emily McDonough
12a9d5c07e Bug 1606485 - Check containing parent frames for 'contain:layout/paint' in grid container frames. r=emilio
This prevents grid container frames from being considered subgrid (even when
they have contain:layout/paint) when they are themselves a grid item of a
contain grid.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 01:06:56 +00:00
Emily McDonough
be59ef32a5 Bug 1607952 - Avoid using both std::move and a method on the same variable for getting the number of explicit tracks for ComputedGridTrackInfo r=emilio
The order of argument evaluation is implementation-defined, so we can't trust
whether the .Length() or the std::move() will get executed first. This is OK
right now since the constructor takes the argument by rvalue and so it can't be
emptied out before the .Length() call. However, a change to the types in the
constructor's argument list could make this still compile, but then depend on
compiler-dependent argument evaluation order to get the correct result.

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

--HG--
extra : moz-landing-system : lando
2020-01-09 00:29:08 +00:00
Emily McDonough
9108c52192 Bug 1341507 - Refactor TrackSizingFunctions::mRepeatEndDelta to be a getter function rather than a variable. r=emilio
The information in it is always derivable from the values of mRepeatAutoStart
and mRepeatAutoEnd. Additionally, its value is used in some cases where it has
not yet been set properly (such as CalculateRepeatFillCount).

This works out currently because the default value is zero we only accept
repeat(auto-fill, ...) and repeat(auto-fit, ...) CSS values that have a single
element in the repeat. In that case, zero is the correct value for
RepeatEndDelta.

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

--HG--
extra : moz-landing-system : lando
2020-01-07 00:50:58 +00:00
Chris Peterson
406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

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

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Daniel Holbert
693c08b645 Bug 1593060: When measuring size of XUL in CSS grid, use the GetXULPrefSize API instead of an explicit reflow. r=mats
Note that the GetXULPrefSize API might still do a "::BoxReflow" under the hood,
inside its call to RefreshSizeCache.

Also: we can't use GetLogicalUsedMargin() in this special case, because the
child may not have been reflowed (which is what populates the "used margin"
frame property).  So instead, we pull the margin off of the reflow state.
As noted in the code-comment alongside that call, this won't work with
percent margins, but hopefully we can just avoid those in our frontend code
that uses XUL-in-grid-items.

Also, this patch makes the grid call ReflowChild() on its grid items using
a loose guess at their position, rather than at position 0,0. This helps
popup frames figure out their size during reflow and size their children
properly.

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

--HG--
extra : moz-landing-system : lando
2019-12-04 03:37:09 +00:00
Emilio Cobos Álvarez
816c826751 Bug 1596361 - Ensure nsGridContainerFrame::GetGridFrameWithComputedInfo really returns a frame with computed info. r=mats
I couldn't repro this with the STR in the bug, but I can repro by inspecting a
grid in print preview, where we don't properly honor the re-reflow request
because $reasons.

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

--HG--
extra : moz-landing-system : lando
2019-11-29 20:24:26 +00:00
Boris Chiou
41488d1a22 Bug 1593796 - Apply the correct specified implicit size. r=mats
Per the spec, if multiple track sizes are given, the pattern is repeated as
necessary to find the size of the implicit tracks:
1. The first implicit grid track after the explicit grid receives the first
   specified size, and so on forwards.
2. The last implicit grid track before the explicit grid receives the last
   specified size, and so on backwards.

We use a positive index of the auto track sizes for (1) and a negative index
for (2), so we can apply the correct specified implicit size.

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

--HG--
extra : moz-landing-system : lando
2019-11-12 22:28:09 +00:00
L. David Baron
449f8593f0 Bug 1584018 - Make flex and grid code indicate that its block resizes can affect basis for percentages. r=dholbert,mats
Differential Revision: https://phabricator.services.mozilla.com/D50511

--HG--
extra : moz-landing-system : lando
2019-10-24 22:35:46 +00:00
Mats Palmgren
a860dc10ba Bug 1234311 part 2 - [css-grid-2] Implement 'grid-template-rows/columns' resolved value correctly for subgrid. r=dholbert
This implements the resolution and adds WPTs for:
https://github.com/w3c/csswg-drafts/issues/4362

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

--HG--
extra : moz-landing-system : lando
2019-10-12 17:16:02 +00:00
Mats Palmgren
b15d020bef Bug 1581106 part 3 - [css-grid-2] Implement 'repeat(auto-fill, <line-names>)' in subgridded axis. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D46895

--HG--
extra : moz-landing-system : lando
2019-09-30 17:32:52 +00:00
Mats Palmgren
7d90d80ff0 Bug 1581106 part 2 - Simplify LineNameMap ctor by deducing track clamping bounds instead of passing them as params (idempotent change). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D46373

--HG--
extra : moz-landing-system : lando
2019-09-30 17:51:28 +00:00
Mats Palmgren
bb73a535cf Bug 1581106 part 1 - Remove unused aNumRepeatTracks param (idempotent change). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D46372

--HG--
extra : moz-landing-system : lando
2019-09-30 17:50:55 +00:00