Граф коммитов

273 Коммитов

Автор SHA1 Сообщение Дата
Daniel Holbert d6f3c58c61 Bug 812687 part 3: Move CSSOrderAwareFrameIterator code to its own .h/.cpp file. r=mats
This patch just moves code, so it should not affect our behavior at all.

MozReview-Commit-ID: 4yxSR5rWUV1
2017-04-05 19:31:47 -07:00
Daniel Holbert 9a4b6b6d74 Bug 812687 part 2: Rename GridItemCSSOrderIterator to CSSOrderAwareFrameIterator (& similar for its Reverse form). r=mats
This patch is purely type-renames, so it should not affect our behavior at all.

MozReview-Commit-ID: 51zRGFyVDtT
2017-04-05 19:31:47 -07:00
Daniel Holbert db6436ab45 Bug 812687 part 1: Rename GridItemCSSOrderIteratorT to CSSOrderAwareFrameIteratorT, and drop "Grid" from its method names. r=mats
This patch is purely type-renames & method-renames, so it should not affect our
behavior at all.

MozReview-Commit-ID: 5N7zru0uPfD
2017-04-05 19:31:47 -07:00
L. David Baron 28b9e9b1d4 Bug 1351359 - Make nsGridContainerFrame call ReflowInput::SetBResize(true) because of auto-block-size swapping between measuring reflows and regular reflows. r=mats
This fixes the failure of
layout/reftests/css-grid/grid-min-max-content-sizing-002.html with the
primary patch in bug 1308876 (which causes a child whose parent is dirty
to pick up the dirty bit from the parent only the first reflow of the
child if the parent reflows the child multiple times).  A simplified
testcase for that failure is
https://bugzilla.mozilla.org/attachment.cgi?id=8849771 .

The failure was caused by an error in height calculation of the first
<x> in the test.  The div that is the parent of that x has a definite
height (presumably due to rules in grid), and the x has a specified
height.  The div gets three reflows:  two measuring reflows (from
MinContentContribution and then from MaxContentContribution) and then a
final reflow from nsGridContainerFrame::ReflowInFlowChild.  Prior to the
primary patch in this bug, the div was marked dirty on all three
reflows, but with it it is marked dirty only on the first.  This means
that, without the block-resize flag, the div optimizes away the reflow
of its children, since ShouldReflowAllKids returns false because
IsBResize() is false, even though NS_FRAME_CONTAINS_RELATIVE_BSIZE is
correctly set.

In order to fix this, we need to make sure the BResize flag on the
reflow state in at least some cases (see the comments in the patch for
when, and for how the cases could be optimized in the future).

Note that:

 * when the dirty bit is set on the grid container, the new behavior
   (with the combination of the patches) is strictly more efficient than
   the old, since we will sometimes do non-dirty reflows on the grid
   items (with the b-resize flag)

 * when the dirty bit is *not* set on the grid container, the new
   behavior is less efficient than the old, since we will set the
   b-resize flag when we did not do so before.  However, this slowdown
   fixes existing bugs such as the one in the reftest.

Given that I was able to construct a reftest that triggers the failure
without the changes from bug 1308876, I've moved this to a separate bug.
Without the patch, grid-measuring-reflow-resize-dynamic-001.html fails,
but grid-measuring-reflow-resize-static-001.html passes.  With the patch
both tests pass.  (And without the patch, doing a text zoom on the
dynamic test fixes the layout error.)

MozReview-Commit-ID: JQOdVTQIkU0

--HG--
extra : transplant_source : %8B%2ARO%3B%D0%7B%EC%C9_%B3%60Sp%F9T%14X%85%DC
2017-03-30 22:56:14 -04:00
Mats Palmgren ac83d82472 Bug 1349650 - [css-grid] Fix a bogus assertion. r=dholbert
When mArray is used it contains all grid container children, including
placeholders.  aGridItemCount always excludes placeholders.

MozReview-Commit-ID: 2RVFOdVvTq
2017-03-23 21:04:36 +01:00
Mats Palmgren d1da72310f Bug 1346699 part 2 - [css-grid] Don't require 'fr' to be non-zero to apply min/max-size. r=dholbert
The calculated 'fr' value might change in the second round (after
applying min/max-size) even if it's zero in the first round.

MozReview-Commit-ID: 60moiyoWwuo
2017-03-16 13:24:50 +01:00
Mats Palmgren 0f9743bbe7 Bug 1346699 part 1 - [css-grid] Don't require that some (flexible) track size changed to apply min/max-size. r=dholbert
The "origSizes.isSome()" condition on the outer if-block was
a logical mistake.  We should check it before re-assigning
mSizes though (this was the optimization originally intended).

MozReview-Commit-ID: AooUHYKG3jB
2017-03-16 13:24:50 +01:00
Daniel Holbert 10796eda46 Bug 1340309 part 1: Resolve "align-self:auto"/"justify-self:auto" to flex/grid parent's *-items value, when resolving static pos of abspos children. r=mats
MozReview-Commit-ID: 6fSmo1WGqow

--HG--
extra : rebase_source : 0b07e02f2e584261a18f78ef9e6c16637a022e16
2017-02-24 08:38:31 -08:00
Ting-Yu Lin 8f840dc923 Bug 775624 Part 22 - Remove NS_FRAME_COMPLETE. r=dholbert
This patch is written by the following script with some manual adjustment to
the comment in nsRubyTextContainerFrame.cpp and nsRubyFrame.cpp, and
nsColumnSetFrame's constructor.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "nsReflowStatus *([a-zA-Z0-9]*) = NS_FRAME_COMPLETE" "nsReflowStatus \1"
rename "([a-zA-Z0-9.*]*) *= NS_FRAME_COMPLETE;" "\1.Reset();"
rename "([a-zA-Z0-9.*]*) == NS_FRAME_COMPLETE" "\1.IsEmpty()"

MozReview-Commit-ID: 9tqQAHvdQex

--HG--
extra : rebase_source : 3119776946dc2c8350098b7bf9f3ceff29bdffb5
2017-02-14 17:55:48 +08:00
Ting-Yu Lin 8f66d2167b Bug 775624 Part 17 - Convert NS_INLINE_IS_BREAK_AFTER to a method. r=dholbert
MozReview-Commit-ID: CD9uuOC3CzP

--HG--
extra : rebase_source : e7a12a1b37f591ba33e4ed8e73502f7cddf5d619
2017-02-14 16:22:04 +08:00
Ting-Yu Lin d5c6d28836 Bug 775624 Part 16 - Convert NS_INLINE_IS_BREAK_BEFORE to a method. r=dholbert
MozReview-Commit-ID: 8vxRpqbZNnk

--HG--
extra : rebase_source : 195e2da23d64da9e9a888968a45eaae2e6539585
2017-02-14 16:05:24 +08:00
Ting-Yu Lin d1e11eca37 Bug 775624 Part 13 - Convert NS_INLINE_LINE_BREAK_AFTER to a method. r=dholbert
NS_INLINE_MAKE_BREAK_TYPE is used only in BRFrame. Delete it, too.

MozReview-Commit-ID: GC4vF0GFsAD

--HG--
extra : rebase_source : d7727fe41410a8998142d9ded8dcd8ae9c2a780f
2017-02-14 11:52:53 +08:00
Ting-Yu Lin 56ebb62910 Bug 775624 Part 12 - Add bit-fields for inline break status, and convert NS_INLINE_LINE_BREAK_BEFORE. r=dholbert
NS_INLINE_LINE_BREAK_BEFORE() was replaced by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename " = NS_INLINE_LINE_BREAK_BEFORE\(\);" ".SetInlineLineBreakBeforeAndReset();"

MozReview-Commit-ID: mz6L8zay7q

--HG--
extra : rebase_source : fddffa1288c7a52c7245aec0839a65f8d1d3f008
2017-02-14 11:52:53 +08:00
Ting-Yu Lin 19a2af3275 Bug 775624 Part 11 - Convert NS_MergeReflowStatusInto() to a method. r=dholbert
Also, remove NS_FRAME_TRUNCATED and NS_FRAME_REFLOW_NEXTINFLOW because both
are used only by NS_MergeReflowStatusInto().

MozReview-Commit-ID: LsPOji9j2e

--HG--
extra : rebase_source : 7cf1421c066f0f8df3e8402b84ae0f584cad2d11
2017-02-13 17:15:01 +08:00
Ting-Yu Lin 11579e0ce5 Bug 775624 Part 9 - Convert NS_FRAME_REFLOW_NEXTINFLOW to use bit-field and methods. r=dholbert
MozReview-Commit-ID: 1TXOShK62X8

--HG--
extra : rebase_source : df0b26da3aefc239f11c28ccc746062e88ab86a3
2017-02-13 14:56:45 +08:00
Ting-Yu Lin b7c479e1c2 Bug 775624 Part 8 - Remove NS_FRAME_SET_OVERFLOW_INCOMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_SET_OVERFLOW_INCOMPLETE\(\*([a-zA-Z0-9.*]*)\)" "\1->SetOverflowIncomplete()"
rename "NS_FRAME_SET_OVERFLOW_INCOMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.SetOverflowIncomplete()"

MozReview-Commit-ID: EJOIs84vwev

--HG--
extra : rebase_source : 59a5ac827f57e7a0e50910f5a813c44560baeb00
2017-02-11 23:18:04 +08:00
Ting-Yu Lin 14b6536193 Bug 775624 Part 7 - Remove NS_FRAME_SET_INCOMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_SET_INCOMPLETE\(\*([a-zA-Z0-9.*]*)\)" "\1->SetIncomplete()"
rename "NS_FRAME_SET_INCOMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.SetIncomplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 185f5d6f5a3c8306761860c579eff10d931f3b35
2017-02-11 23:06:17 +08:00
Ting-Yu Lin f7a393e947 Bug 775624 Part 5 - Remove NS_FRAME_IS_COMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_IS_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsComplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : aa8b11d3a756c9e7c521e6ffd70713af0174bd98
2017-02-11 22:45:07 +08:00
Ting-Yu Lin 99ebdf6cf3 Bug 775624 Part 4 - Remove NS_FRAME_IS_FULLY_COMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_IS_FULLY_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsFullyComplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 200639e836cebe26fd77cde21f478fd027e1725f
2017-02-11 22:38:48 +08:00
Ting-Yu Lin b31150930a Bug 775624 Part 3 - Remove NS_FRAME_IS_NOT_COMPLETE. r=dholbert
This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_IS_NOT_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsIncomplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 412b60e7954118d8443ebf2a786046d7cd38c516
2017-02-11 22:17:26 +08:00
Ravi Shankar 9f7341a8f1 Bug 1339765 - Replace NS_STYLE_GRID_TRACK_BREADTH_* with enum classes;r=heycam
MozReview-Commit-ID: BAMrykPhoIl

--HG--
extra : rebase_source : 025144924eb6270837d74adab5e72265b6d2f62a
2017-02-17 09:28:36 +05:30
Jeff Walden cdee578059 Bug 1287006 - Don't pass Maybe (or any class containing a Maybe member) by value, only by reference or pointer, in layout/-related code. r=bz
--HG--
extra : rebase_source : 94377970d6ec591044a10dab1aa5568e4a051837
2017-02-13 09:07:40 -08:00
Mats Palmgren 6944ddd800 Bug 1330380 part 2 - We must always pass along a CB size when reflowing grid items, also in MeasuringReflow. r=dholbert 2017-01-14 01:05:52 +01:00
Mats Palmgren a3cd53c12c Bug 1330380 part 1 - Rename a couple of variables. r=dholbert 2017-01-14 01:05:52 +01:00
Cameron McCormack babad063ff Bug 1328832 - Part 2: Rename mozFlushType to mozilla::FlushType and make it an enum class. r=bzbarsky
MozReview-Commit-ID: D3fIngSHSsl
2017-01-05 15:31:56 +08:00
Mats Palmgren 10150aa1b7 Bug 1232194 part 1 - [writing-mode] Drop "Get" from GetConsumedBSize() and add a WritingMode param. r=dholbert 2017-01-04 00:56:19 +01:00
Mats Palmgren 99856fc256 Bug 1312379 part 4 - Rename GetBaseline() to BaselineBOffset(). r=me 2016-12-20 23:56:35 +01:00
Mats Palmgren ed15c70d6d Bug 1312379 part 1 - [css-align][css-flexbox][css-grid] Introduce nsIFrame methods for calculating baselines per CSS Alignment and CSS2 'vertical-align'. r=dholbert 2016-12-20 23:56:35 +01:00
Mats Palmgren 4050dea957 Bug 1313068 - [css-grid] Synthesize a grid container baseline from the margin-box when in an inline-level context, and from the border-box otherwise. r=dholbert 2016-12-20 23:56:34 +01:00
Mats Palmgren 016956854d Bug 1314664 part 4 - [css-grid] Don't include percentage tracks in the repeat track calculation. r=dholbert 2016-12-20 23:56:34 +01:00
Mats Palmgren 57e65418cf Bug 1314664 part 3 - [css-grid] Remove unused eIndefinitePercentMinSizing bit. r=dholbert 2016-12-20 23:56:34 +01:00
Mats Palmgren 93730b726a Bug 1314664 part 2 - [css-grid] Don't re-resolve percentage track sizes since there is no need. r=dholbert 2016-12-20 23:56:34 +01:00
Mats Palmgren 802952926b Bug 1314664 part 1 - [css-grid] Don't include percentage tracks in the back-computed intrinsic size equation. r=dholbert 2016-12-20 23:56:34 +01:00
Nathan Froyd 2ebbd09068 Bug 1320752 - remove mozilla/Function.h; r=gerald
We have std::function available now, which is likely to be somewhat more
efficient.
2016-11-28 11:03:53 -05:00
Mats Palmgren 5129a5aa52 Bug 1316051 part 3 - [css-grid] Store the CB size that we give to table-wrappers on a frame property, then propagate that later (minus margins) to the inner table frame. r=dholbert 2016-11-18 19:08:31 +01:00
Daniel Holbert e8d54b0d73 Bug 1269017 part 5 - [css-grid] Tag grid placeholder children as needing CSS Box Alignment, & consolidate their placement code. r=mats
MozReview-Commit-ID: 5105oez3IO3
2016-11-08 16:30:00 -08:00
Daniel Holbert e2446048f6 Bug 1269017 part 2 - [css-grid] Give grid an implementation of CSSAlignmentForAbsPosChild(). r=mats
This grid implementation is similar to the one on nsFlexContainerFrame, with a few simplifications:
 - We can simply use the LogicalAxis to decide between align-* vs justify-* prpoerties (whereas flexbox has extra abstraction from the flex axes).
 - We don't have to bother with "align-content" or "justify-content", since those apply to grid areas rather than to children. (And any grid area that's involved will be sized/positioned separately.)
 - Grid can unconditionally treat "flex-start" & "flex-end" as "start" & "end".

MozReview-Commit-ID: 9l1Wq9Cq5T0
2016-11-08 16:30:00 -08:00
Mats Palmgren faf8e6f6bf Bug 1313254 part 6 - [css-grid] A few comment tweaks. rs=dholbert 2016-11-05 02:57:08 +01:00
Mats Palmgren b1c4b6d89a Bug 1313254 part 2 - [css-align] Change "last-baseline" to "last baseline" in layout/ (scripted change). r=dholbert 2016-11-05 02:57:07 +01:00
Mats Palmgren e54d8218a4 Bug 1300369 part 7 - [css-grid] Implement margin-box min-size clamping for grid item reflow. r=dholbert 2016-11-05 02:57:06 +01:00
Mats Palmgren 6b8c4c8679 Bug 1300369 part 3 - [css-grid] Implement margin-box min-size clamping during track sizing. r=dholbert 2016-11-05 02:57:06 +01:00
Daniel Holbert 8a46fab5d0 Bug 1269046 part 8: Rewrite CSSAlignUtils::AlignJustifySelf to use a single "flags" arg instead of boolean args. r=mats
MozReview-Commit-ID: 5loE21U7FF6
2016-10-31 08:59:40 -07:00
Daniel Holbert 2a8bcc81e7 Bug 1269046 part 1: Spin out some grid alignment code into a helper method, in a new CSSAlignUtils class. r=mats
MozReview-Commit-ID: 1Eh2CreOLTC
2016-10-31 08:58:18 -07:00
Mats Palmgren 05a1e2c9a6 Bug 1305244 part 3 - [css-grid] Stop handling <flex> track min-sizing in layout since they can't occur anymore. r=dholbert 2016-10-29 01:30:10 +02:00
Mats Palmgren d18b43c8b2 Bug 1228455 - [css-grid] Update the 'used flex fraction' for indefinite sizes to clamp flex factors less than 1 before dividing the base size (due to CSS Grid spec change). r=dholbert
CSS Grid spec change:
https://hg.csswg.org/drafts/rev/42427088d71f
2016-10-27 10:32:00 -04:00
Phil Ringnalda c38078f6a2 Backed out 12 changesets (bug 1269045, bug 1269046) as the most likely cause of Windows build bustage
CLOSED TREE

Backed out changeset 16db55b642a9 (bug 1269046)
Backed out changeset a0008dd33cf4 (bug 1269046)
Backed out changeset 75b58c4e61e6 (bug 1269046)
Backed out changeset fb7655f3e1cf (bug 1269046)
Backed out changeset 8088e5a9e6e3 (bug 1269046)
Backed out changeset eea6479452f0 (bug 1269046)
Backed out changeset eb4b52bf06ec (bug 1269046)
Backed out changeset 539db74e4a88 (bug 1269046)
Backed out changeset f57f9ac1435e (bug 1269045)
Backed out changeset 2162d5c9fb54 (bug 1269045)
Backed out changeset 7aa8199183fc (bug 1269045)
Backed out changeset 86a391e3e163 (bug 1269045)

MozReview-Commit-ID: HYL7Bh8l02E
2016-10-27 21:59:00 -07:00
Daniel Holbert d927c41a9f Bug 1269046 part 1: Spin out some grid alignment code into a helper method, in a new CSSAlignUtils class. r=mats
MozReview-Commit-ID: 1Eh2CreOLTC
2016-10-27 18:58:26 -07:00
Daniel Holbert d2f9598859 Bug 1311865: Refactor the grid "same sides" code into a simpler WritingMode::ParallelAxisHasSamePolarity() utility function. r=mats
MozReview-Commit-ID: G9FRriSlZaG

--HG--
extra : rebase_source : 6ecceaf0c8e21778787c567b6a7c2e4591c92283
2016-10-20 17:45:07 -07:00
Mats Palmgren 2c24c06a3b Bug 1302541 part 5 - [css-grid] Back-compute percentages when calculating the number of auto-fill/fit tracks. r=dholbert 2016-10-19 04:20:48 +02:00
Mats Palmgren 5e3a5a5414 Bug 1302541 part 4 - [css-grid] Back-compute percentages for the intrinsic block size. r=dholbert 2016-10-19 04:20:48 +02:00