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

440 Коммитов

Автор SHA1 Сообщение Дата
Daniel Holbert 9e97acb7ae Bug 1499542 part 2: Skip frozen flex items when recording grow-vs-shrink state and deltas. r=bradwerth
Frozen flex items have already been clamped to their min/max sizes, so their
size-change isn't a "how much we want to flex" measurement, and it's not useful
for determining whether the rest of the line is shrinking.

This patch is just adding a `if (!item->IsFrozen())` check around some code,
and reindenting that code, and adjusting a few comments.

This change is necessary to avoid failing the "GrowthState" assertions,
because (for example) a flex item that's clamped to a small max-width
could fool us into thinking we're in a "shrinking" state (since its final
size is smaller than its base size), even though really we're
in a "growth" state and the item was simply clamped.  We avoid this
problem by skipping (potentially-clamped) frozen items when determining
the line's GrowthState.

Depends on D8922

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

--HG--
extra : moz-landing-system : lando
2018-10-17 18:52:33 +00:00
Daniel Holbert 03b6e5b8d7 Bug 1499542 part 1: Don't do early-freeze of flexible-but-doomed-to-be-clamped flex items, if devtools are active. r=bradwerth
We'd like to be able to record the "desired" (pre-clamped) delta size from
tentatively flexing for these items.  That size would be computed during a loop
of the flex layout algorithm -- but we can't do that if we freeze them before
we start flexing. So let's bypass this early freeze so they get a chance to
compute this tentative size, even though they can never have it.

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

--HG--
extra : moz-landing-system : lando
2018-10-18 23:44:42 +00:00
Brad Werth e2f5a79f00 Bug 1497589 Part 4: Set ComputedFlexContainerInfo physical axis values, and expose them through the Flex API. r=dholbert
Depends on D8616

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

--HG--
extra : moz-landing-system : lando
2018-10-17 20:23:09 +00:00
Manuel Rego Casasnovas d9ecddc9fa Bug 1491235: [css-contain] Make 'contain:layout' (not 'contain:size') suppress baseline measurements r=dholbert
The CSSWG has recently resolved that layout containment
suppress baseline alignment, while size containment does not:
https://github.com/w3c/csswg-drafts/issues/2995

Spec text (https://drafts.csswg.org/css-contain/#containment-layout):
  "7. For the purpose of the vertical-align property,
   or any other property whose effects need to relate
   the position of the containing element's baseline
   to something other than its descendants,
   the containing element is treated as having no baseline."

And a note in (https://drafts.csswg.org/css-contain/#containment-size):
  "Note: size containment does not suppress baseline alignment.
   See layout containment for that."

This patch does this change just switching IsContainSize()
by IsLayoutSize() in several places related to baseline alignment
in the source code.

With the patch several WPT tests start to pass. Apart from that,
some of the tests under vendor-imports are updated to follow
the new behavior.

--HG--
extra : amend_source : 05dc9a320afeb1d58981e2bd8bc47b435999f2f9
2018-10-09 14:13:13 -07:00
Emilio Cobos Álvarez eed1014705 Bug 1495169 - Remove cached measuring reflows if we aren't measuring the right thing because we got interrupted. r=dholbert
If we're waiting on an interrupt, then our child items haven't been totally
reflowed and our measures would be bogus.

This will probably regress performance in the cases bug 1209697 fixed, so we
should probably add an interrupt check somewhere in nsFlexContainerFrame to
avoid keeping reflowing flex containers indefinitely.

We could probably just bail out from our reflow if any kid reflow was
interrupted.

Filed bug 1495532 to consider that.

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

--HG--
extra : moz-landing-system : lando
2018-10-04 20:24:04 +00:00
Daniel Holbert fc5c7b4491 Bug 1493645 part 2: When caching flex item sizes, don't bother using available inline size as part of cache key. r=emilio
A flex item's available inline size would be relevant (i.e. would have an
impact on layout) if we were fragmenting the flex item in its inline direction
(e.g. if it were an inline-level box, in an inline-layout context).

But we're not doing that, so its available isize doesn't make a difference. To
the extent that it's been useful at all in this flex-item-caching code up to
this point, we'll now be caching something more-specific (the item's *computed*
inline size) which should serve roughly the same purpose.

Depends on D6991

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

--HG--
extra : moz-landing-system : lando
2018-09-26 21:44:21 +00:00
Daniel Holbert 62925b4703 Bug 1493645 part 1: When caching flex item sizes, use computed inline size as part of the cache key. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D6991

--HG--
extra : moz-landing-system : lando
2018-09-26 22:51:08 +00:00
Daniel Holbert 5e7929410f Bug 1491510: Treat 'auto' cross size as definite, for 'contain:size' flex container. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D5947

--HG--
extra : moz-landing-system : lando
2018-09-15 18:06:18 +00:00
Daniel Holbert 6898253a2e Bug 1490890: Make flex item cached-measurement invalidation more targeted. r=emilio
Right now, when a flex item's intrinsic size is invalidated, we clear cached
flex measurements on all of its sibling flex items (indirectly, by virtue of
invalidating the flex container's intrinsic sizes, which does the dirty work of
clearing the measurements).

This is excessive. We do need to clear the measurements on any flex item
whose intrinsic sizes are invalidated, but we don't need to clear them on other
flex items whose intrinsic sizes are still valid.  So: this patch changes our
implementation accordingly.

This patch isn't expected to change behavior - it should just be an
optimization.

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

--HG--
extra : moz-landing-system : lando
2018-09-15 16:09:00 +00:00
Zhang Junzhi e081858ecc 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

--HG--
extra : moz-landing-system : lando
2018-09-12 12:35:47 +00:00
Daniel Holbert b93eae7de2 Bug 1486086: Switch to use logical axes, for stale physical-axis-based flex-item border/padding calculation. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D4974

--HG--
extra : moz-landing-system : lando
2018-09-10 17:40:41 +00:00
Mihir Iyer 299e679ae7 Bug 1472843 - Implement justify-content:left/right/start/end, align-content:start/end, align-self:self-start/self-end for flexbox. r=dholbert
This commit also removes some cases & warnings about unsupported values that
have now been removed from the css alignment spec.
Specifically: "justify-content:[last] baseline" and
"align-self/align-content: left/right".

--HG--
rename : layout/reftests/w3c-css/submitted/flexbox/flexbox-align-content-vert-001-ref.xhtml => layout/reftests/w3c-css/submitted/flexbox/flexbox-align-content-wmvert-001-ref.xhtml
rename : layout/reftests/w3c-css/submitted/flexbox/flexbox-align-content-horiz-001a.xhtml => layout/reftests/w3c-css/submitted/flexbox/flexbox-align-content-wmvert-001.xhtml
rename : layout/reftests/w3c-css/submitted/flexbox/flexbox-align-self-vert-002-ref.xhtml => layout/reftests/w3c-css/submitted/flexbox/flexbox-align-self-vert-rtl-005-ref.xhtml
rename : layout/reftests/w3c-css/submitted/flexbox/flexbox-align-self-vert-002.xhtml => layout/reftests/w3c-css/submitted/flexbox/flexbox-align-self-vert-rtl-005.xhtml
rename : layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-horiz-005-ref.xhtml => layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-horiz-006-ref.xhtml
rename : layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-horiz-005.xhtml => layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-horiz-006.xhtml
rename : layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-vert-001-ref.xhtml => layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-vert-006-ref.xhtml
rename : layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-vert-001a.xhtml => layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-vert-006.xhtml
rename : layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-vert-001-ref.xhtml => layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-wmvert-001-ref.xhtml
rename : layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-vert-001a.xhtml => layout/reftests/w3c-css/submitted/flexbox/flexbox-justify-content-wmvert-001.xhtml
extra : amend_source : 93cd04450f573fcfa11f3400ffd0ecb4cb3e6d90
2018-08-03 07:56:32 -07:00
Cameron McCormack 99d9013b12 Bug 1482782 - Part 5: Move CSS anonymous box atoms to nsGkAtoms. r=njn,emilio
Summary: Depends On D3283

Reviewers: njn!, emilio!

Tags: #secure-revision

Bug #: 1482782

Differential Revision: https://phabricator.services.mozilla.com/D3284
2018-08-15 15:46:39 +10:00
Narcis Beleuzu d20e8e7674 Backed out 8 changesets (bug 1483121, bug 1482782) for build bustages on nsDirectoryService.cpp. CLOSED TREE
Backed out changeset 0a8334bbcf45 (bug 1483121)
Backed out changeset cb2dcb859071 (bug 1482782)
Backed out changeset c834d4ca2eef (bug 1482782)
Backed out changeset 887de0efbb67 (bug 1482782)
Backed out changeset 018fdb50a6be (bug 1482782)
Backed out changeset 33a8aa8096c9 (bug 1482782)
Backed out changeset e3632354f16e (bug 1482782)
Backed out changeset 46f8319bee82 (bug 1482782)
2018-08-15 09:14:41 +03:00
Cameron McCormack d9edae8bde Bug 1482782 - Part 5: Move CSS anonymous box atoms to nsGkAtoms. r=njn,emilio
Summary: Depends On D3283

Reviewers: njn!, emilio!

Tags: #secure-revision

Bug #: 1482782

Differential Revision: https://phabricator.services.mozilla.com/D3284
2018-08-15 15:46:39 +10:00
Mihir Iyer f7cad8b983 Bug 1473047 - Re-resolve row-gap percentages after intrinsic block size calculated. r=dholbert
MozReview-Commit-ID: EHX1WFvqwr1

--HG--
extra : rebase_source : fb9c082c1c3f74fcc9404016343eb456cb8948ed
2018-07-24 11:38:54 -07:00
Mihir Iyer 4751922915 Bug 1311892 - Implement <overflow-position> 'safe'/'unsafe' for absolutely positioned boxes in grid and flexbox. r=dholbert
MozReview-Commit-ID: 1xKmq7KFAM4

--HG--
extra : rebase_source : 64c143d908d31fa9bee522e4995b29ddf67749ca
2018-07-19 12:30:48 -07:00
Mihir Iyer 60111bbc33 Bug 1297774 - Implement safe/unsafe for flexbox 'justify-content' and 'align-{content,self,items}' r=dholbert
MozReview-Commit-ID: BHpaSvj5EOW

--HG--
extra : rebase_source : b8b9326fb6f439418471b3e972b80ba78efd43ca
2018-06-26 14:33:02 -07:00
Andreea Pavel b0e30af17e Merge mozilla-inbound to mozilla-central. a=merge 2018-07-13 00:51:26 +03:00
Mihir Iyer 0caaba609c Bug 1473044 - Make flexbox cross size take row/column gap into account. r=dholbert
MozReview-Commit-ID: 47BNLZOA79W

--HG--
extra : rebase_source : 7d3d99cee3ded337c8a15ea44f2fcff2140a16cd
2018-07-10 10:16:31 -07:00
Andi-Bogdan Postelnicu 5e3e0d4498 Bug 1453795 - Layout - Initialize member fields in classes/ structures. r=dbaron 2018-07-12 09:42:14 +03:00
Morgan Rae Reschenberg 9ab261d6c6 Bug 1467209 - Implement contain:size for flexContainerFrame. r=dholbert
MozReview-Commit-ID: 46BFbEGa7uz

--HG--
extra : rebase_source : 5135a92a82340219f2c3b83287af5929105ab5b7
2018-06-29 10:31:22 -07:00
Mihir Iyer b3ebeebc31 Bug 1398483 - Implement column and row gap for flexbox. r=dholbert
MozReview-Commit-ID: 2EmaG3G0HRI

--HG--
extra : rebase_source : ce90f9a38c0f3a6634a95b0f4f97a2a3fbd48a57
2018-06-19 10:28:31 -07:00
Daniel Holbert 732182f0c9 Bug 1461446: Make flex layout explicitly handle integer overflow when summing up flex item hypothetical sizes. r=mats
This patch accomodates for the unfortunate fact that elements with
"table-layout:fixed" have a max-content size of nscoord_MAX (infinity,
effectively), which turns out to be an easy source of integer overflow during
flex layout.

Before this patch, a flex container with "table-layout:fixed" in several flex
items could end up triggering integer-overflow & making the wrong judgement on
its arithmetic to determine...
 - whether a given flex item will fit on an existing flex line.
 - whether we've got positive free space and need to grow our items, or have
   negative free space and need to shrink our items.

This patch makes two changes to fix this issue.

(1) This patch makes us use CheckedInt when summing up flex item hypothetical
    sizes, which prevents integer overflow from flipping the sign of our line's
    total length.

(2) This patch makes us *directly* track the space reserved for flex item
    margin/border/padding within a flex line.  Previously, we tracked this
    implicitly as the difference between two other quantities that we stored;
    but with the other changes in this patch, those two other quantities can
    *both* trigger overflow and get clamped, which would make us lose track of
    how much space to reserve for margin/border/padding.  So now we simply
    track that space-to-reserve directly.

MozReview-Commit-ID: 9izhOnlS4F1

--HG--
extra : rebase_source : 185f2409dcb2f9c5bd0a2466a8e2233d7db3250a
2018-05-25 19:46:29 -07:00
Emilio Cobos Álvarez 00763b545a Bug 1449326: Account for min- / max- block size changes too in the flex caching code. r=dholbert
We may be reflowing the same kid with different (definite / non-definite)
containing block sizes, which changes the min block size in:

  https://searchfox.org/mozilla-central/rev/f65d7528e34ef1a7665b4a1a7b7cdb1388fcd3aa/layout/generic/ReflowInput.cpp#3077

In which case we may need to reflow in order to properly align the flex item.

MozReview-Commit-ID: 27aS2UrgXjs
2018-04-20 09:55:51 +02:00
Daniel Holbert acccfe6d00 Bug 1454822 part 2: Cache the results of nsFlexContainerFrame::GetMinISize/GetPrefISize. r=mats
Assuming we call MarkIntrinsicISizesDirty in the appropriate scenarios, this
patch shouldn't change behavior - it just caches these values so we don't
needlessly recalculate them.

MozReview-Commit-ID: 8QY4AZJXshy

--HG--
extra : rebase_source : a7c87b03ac8240ba71efd2198ce1976d96c91f64
2018-04-17 17:06:26 -07:00
Daniel Holbert 14267669bd Bug 1454822 part 1: Refactor nsFlexContainerFrame::GetMinISize/GetPrefISize to be implemented via a common helper function. r=mats
This patch does not change behavior; it just merges the implementations of
these two functions into a single common function.

MozReview-Commit-ID: BqsRt3p2NQT

--HG--
extra : rebase_source : e8792f2bed3fd0708ffb38b91cf15a78cb6fbd59
2018-04-17 17:06:23 -07:00
Daniel Holbert 555deebbc9 Bug 1374540 part 3: Refactor nsFrame::ComputeSize methods to handle the two "used flex-basis of content" scenarios with a consistent codepath. r=mats
This patch doesn't change behavior.

It simply makes us share code/data for two different cases that both ended up
producing mainAxisCoord->GetUnit() == eStyleUnit_Auto.  Now, they'll *both* use
the same static nsStyleCoord to represent this "auto" value.

Originally, in one of these cases ("flex-basis:auto;[main-size-property]:auto),
we left the mainAxisCoord untouched. Now we'll point it at this dummy 'auto'
value. Either way we end up with mainAxisCoord->GetUnit() == eStyleUnit_Auto,
so the behavior doesn't change.

The next patch in this series will make further changes to one of these spots,
as noted in the "XXXdholbert" code-comment included here.

MozReview-Commit-ID: 5ClfbNHuKhO

--HG--
extra : rebase_source : 17efe1e9f721324d6182db654e601727c791800b
2018-04-13 12:17:51 -07:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Brad Werth 15154e29fb Bug 1298008 Part 2: Make nsFlexContainer update UsedMargin property after final reflow. r=dholbert
MozReview-Commit-ID: HV4uhJqWjfj

--HG--
extra : rebase_source : 8dd4d384ed78dcea6093cb4f86f5a84d03048fa5
2018-03-08 17:35:47 -08:00
Daniel Holbert c090d777c6 Bug 1174003 late-breaking followup: remove obsolete comment about flex align-self:baseline behavior. (no review, comment-only, DONTBUILD)
There's been a clarification to the spec text that this comment was worried about:
  https://github.com/w3c/csswg-drafts/issues/2316
And with that clarification, this comment is no longer applicable.
2018-03-30 16:13:08 -07:00
Brindusan Cristian 1fa25f597f Backed out 3 changesets (bug 1298008) for devtools failures on browser_boxmodel_pseudo-element.js CLOSED TREE
Backed out changeset c18e2aac48a5 (bug 1298008)
Backed out changeset b5a4113f4649 (bug 1298008)
Backed out changeset 40f53976a5b8 (bug 1298008)
2018-03-30 23:10:23 +03:00
Brad Werth 0c04a5bbab Bug 1298008 Part 2: Make nsFlexContainer update UsedMargin property after final reflow. r=dholbert
MozReview-Commit-ID: HV4uhJqWjfj

--HG--
extra : rebase_source : 61861ec388f184bb715de5bbe2c2d39a4cef9c36
2018-03-08 17:35:47 -08:00
Daniel Holbert 99b46a1c49 Bug 1449838 part 1: Add utility function nsFlexContainerFrame::IsItemInlineAxisMainAxis(). r=mats
This patch doesn't affect behavior - it's just refactoring / de-duplicating.

(The refactored function does include some new "legacy box" code, just for
completeness & to ensure that the included assertion passes.  But beyond the
assertion, that new code isn't exercised right now -- this function's only
callsites are skipped if the NS_STATE_FLEX_IS_EMULATING_LEGACY_BOX state-bit is
set on the container. Hence, this patch still doesn't affect behavior, even
though it's adding some new logic in the refactored-out function.)

MozReview-Commit-ID: G5aCzwTwkTa

--HG--
extra : rebase_source : 695a2341074b1c344a1c5831989b95a693e16970
2018-03-29 14:49:28 -07:00
Emilio Cobos Álvarez e341b20ec4 Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt on a CLOSED TREE
MozReview-Commit-ID: JPopq0LudD
2018-03-22 20:06:24 +01:00
Emilio Cobos Álvarez 5dd797f154 Back out changeset b683bb3f22a1 (Bug 1447483) for not landing with all the files. r=me on a CLOSED TREE
This reverts commit 1808914126bb9f9e4a82d2c3d7ac961885fe7d62.

MozReview-Commit-ID: 5skESBseEvo
2018-03-22 20:05:22 +01:00
Emilio Cobos Álvarez ca5ac79cca Bug 1447483: Merge nsStyleContext and ServoStyleContext, rename to ComputedStyle. r=jwatt
MozReview-Commit-ID: JPopq0LudD
2018-03-22 19:48:42 +01:00
Chris Peterson 73675ec9f2 Bug 1443402 - Fix some -Wmissing-prototypes warnings in layout. r=dholbert
-Wmissing-prototypes is a new optional warning available in clang ToT. It warns about global functions that have no previous function declaration (e.g. from an #included header file). These functions can probably be made static (allowing the compiler to better optimize them) or they may be unused.

Confusingly, clang's -Wmissing-prototypes is equivalent to gcc's -Wmissing-declarations, not gcc's -Wmissing-prototypes. A function prototype is a function declaration that specifies the function's argument types. C++ requires that all function declarations specify their argument types, but C does not. As such, gcc's -Wmissing-prototypes is a C-only warning about C functions that have no previous function *prototypes* (with argument types), even if a previous function *declaration* (without argument types) was seen.

MozReview-Commit-ID: FGKVLzeQ2oK

--HG--
extra : rebase_source : 81e62163bf41a5d5dd87abf5397e6e8c62ed4096
extra : source : 653a9fc279e2f6a6d066474a94a70d65ac703d6b
2018-02-22 21:03:45 -08:00
Daniel Holbert d9da77e5f9 Bug 1174003 part 11: [css-flexbox] Remove IsCrossAxisHorizontal(), and make IsMainAxisHorizontal() a private implementation detail. r=mats
At this point in the series:
 - AxisOrientationTracker::IsCrossAxisHorizontal() has zero callers, so it can
   be deleted.
 - AxisOrientationTracker::IsMainAxisHorizontal() only has two callers, and
   both are inside its own class. So it's effectively become an implementation
   detail of its class, and it can be made private.  (I'm not entirely removing
   it, because it does make its two callers more readable. The callers are
   working with a physical-axis-dependent type, 'LayoutDeviceIntSize', which
   comes from an API that isn't logical-axis-friendly, "GetMinimumWidgetSize",
   so they're not easily logicalized. So: it's nice to keep
   IsMainAxisHorizontal() around as an internal convenience method to tell us
   whether to extract the width or height inside of these two specific
   methods. But we don't want to introduce more callers, so let's leave it
   around & make it private.)

MozReview-Commit-ID: 1iz1e52NmxV

--HG--
extra : rebase_source : e8e92bbaadb5b8e636bd1dda79cb0041ce36a2ea
2018-02-28 09:41:16 -08:00
Daniel Holbert 6c3de63544 Bug 1174003 part 10: [css-flexbox] Remove GET_MAIN_COMPONENT/GET_CROSS_COMPONENT macros (expanding each at its only remaining callsite). r=mats
This patch doesn't affect behavior. Each of these macros only had one caller
remaining, and this patch simply expands each of these macros at its sole
callsite.

Note that I'm using the "IsMainAxisHorizontal()" helper in *both* expansions
here, which makes the alternative variant "IsCrossAxisHorizontal()" unused as
of this patch. The next patch in this series will remove that now-unused
method, which will reduce the "Horizontal"-querying API surface here.

The documentation for the macros is still relevant to their still-existing
"_LOGICAL" variants (and those variants do still have callers), so I'm updating
the documentation to be about those variants.

MozReview-Commit-ID: 5i32VYXzo3r

--HG--
extra : rebase_source : 4697e6c23ea743e6b928b091c9dfc9ca1ce4c403
2018-02-28 09:41:13 -08:00
Daniel Holbert e1f331768e Bug 1174003 part 9: [css-flexbox] Remove GET_MAIN_COMPONENT calls from CheckForMinSizeAuto(). r=mats
This patch doesn't change behavior.

The GET_MAIN_COMPONENT macro (some of whose calls I'm removing here) makes a
call to IsMainAxisHorizontal() under the hood.  So I want to get rid of calls
to this this macro, to get closer to killing that method.

In this code, we're interested in the flex item's min-size property in the flex
container's main axis.  This patch makes us simply use MinISize/MinBSize (in
terms of the *flex container's* writing mode) to get the appropriate min-size
property.  The call to IsRowOriented() (querying the flex container's
"flex-direction" property) tells us whether the inline or block axis is the
main axis.

This patch also does away with an unnecessary axis-specific 'overflow-{x/y}'
check, which we don't need to bother with, as noted in a new code-comment (due
to how the 'overflow' subproperties influence each other).

MozReview-Commit-ID: Kqyh69W5IQJ

--HG--
extra : rebase_source : 92d20c8b607d9526c19f387258248388d1c89d85
2018-02-28 09:40:48 -08:00
Daniel Holbert 010964c7b6 Bug 1174003 part 8: [css-flexbox] Change flex item intrinsic ratio calculations to use logical axes and a LogicalSize. r=mats
This patch doesn't affect behavior. It does the following:
 - Changes the AxisOrientationTracker "GetMainComponent/GetCrossComponent" APIs
   to take a LogicalSize rather than a nsSize.
 - Changes FlexItem::mIntrinsicRatio to be a LogicalSize rather than a nsSize.
 - Simplifies the MainSizeFromAspectRatio() helper-function (in particular, it
   removes a call to IsCrossAxisHorizontal(), which is an API I'm gradually
   removing in this patch series.)

MozReview-Commit-ID: KXUmaUVPMZa

--HG--
extra : rebase_source : 345e95978a8abd3ed3ab5b8acabbc6f163785f63
2018-02-27 16:32:58 -08:00
Daniel Holbert cc0ea3c45c Bug 1174003 part 7: [css-flexbox] Logicalize IsCrossAxisHorizontal() check in GetBaselineOffsetFromOuterCrossSize (and simplify a condition for baseline fallback). r=mats
This patch doesn't change our behavior -- not in opt builds, at least. In debug
builds, this patch does change an assertion condition, to remove a usage of
IsCrossAxisHorizontal().  This means debug builds may proceed a bit further
when loading e.g. bug 1384266's testcase (which up until now was tripping this
assertion).  Now that testcase fails a slighlty later assertion (which I'll
sort out on that bug).

The first hunk of this patch is just a simplification -- replacing a
complicated condition (IsRowOriented==IsOrthogonalTo) with a simpler
formulation of the same condition.  I'm making that simplification in this
patch so that we're more clearly consistent about what condition we depend on
for baseline alignment.  After this patch, that (simplified) condition matches
the condition that we assert inside of GetBaselineOffsetFromOuterCrossEdge().

Note: I'm adding two XXXdholbert comments in this patch, for outstanding issues
that I ran across which are out-of-scope for this patch series.

MozReview-Commit-ID: 5x5xqWWilQZ

--HG--
extra : rebase_source : b25e8bfd7425f76b9784df0bd60fc454d4089347
2018-02-27 15:50:30 -08:00
Daniel Holbert fbc7422d44 Bug 1174003 part 6: [css-flexbox] Replace ComputedCrossSize() helper with a new API that uses logical axes internally. r=mats
This patch doesn't affect behavior.

It removes a helper-function that simply returned nsStylePosition::mWidth or
mHeight -- whichever was in the flex container's cross axis. This helper was
only used to answer the question "is the cross size 'auto'", at a single
callsite.  So, this patch replaces the helper with a new helper that more
directly answers that question.  The new helper's implementation uses logical
axes for its reasoning, too, whereas the removed one used physical axes (and in
particular, it relied on AxisOrientationTracker::IsCrossAxisHorizontal(), which
I'll be getting rid of later in this patch series).

MozReview-Commit-ID: EJ8MObTauZH

--HG--
extra : rebase_source : 74caa7a1d06a2a9c5113d4e3cfabaa1d0e9ec1ab
2018-02-27 15:46:55 -08:00
Daniel Holbert 9c3ad8ef78 Bug 1174003 part 5: [css-flexbox] Remove is-{main,cross}-axis-horizontal checks from ReflowFlexItem. r=mats
This patch mostly[1] doesn't affect behavior.  It just changes some ReflowInput
width/height-setting logic to use ISize/BSize setters instead of width/height
setters.

To help with this, I'm also adding some more getters to answer the question "is
this flex item's {inline,block} axis the same as the flex container's
{main,cross} axis", for convenience/readability at callsites. (All of these
getters are simply giving a different view of the same underlying single bit of
information.)

[1] One way this patch *kind of* affects behavior: it generalizes the
conditions under which we set the NS_FRAME_CONTAINS_RELATIVE_BSIZE flag on a
flex item.  But that doesn't actually have any user-visible effects right now,
because that flag's only purpose is to determine whether we should reflow, and
currently we always reflow all flex items. If/when that changes, though
(i.e. when we start reflowing flex items more selectively), this patch is
adding a reftest that may test this generalized behavior. (The reftest actually
trivially passes right now, due to unrelated bug 1441348.)

MozReview-Commit-ID: 4NEKLBAjowh

--HG--
rename : layout/reftests/flexbox/flexbox-resizeviewport-1-helper.html => layout/reftests/flexbox/flexbox-resizeviewport-2-helper.html
rename : layout/reftests/flexbox/flexbox-resizeviewport-1-ref.xhtml => layout/reftests/flexbox/flexbox-resizeviewport-2-ref.xhtml
rename : layout/reftests/flexbox/flexbox-resizeviewport-1.xhtml => layout/reftests/flexbox/flexbox-resizeviewport-2.xhtml
extra : rebase_source : c6535e1cdcb1757a16cd02e0d485638827344c23
2018-02-27 15:40:18 -08:00
Daniel Holbert 08920aae73 Bug 1174003 part 4: [css-flexbox] Remove IsMainAxisHorizontal() check from DoFlexLayout(). r=mats
This patch doesn't affect behavior.  It just replaces some (correct) physical-axis-dependent code with equivalent logical-axis-dependent code.

MozReview-Commit-ID: 27QJU2cFWh

--HG--
extra : rebase_source : 856e90428468aac0d93854a0bc20e78c2dcb8c57
2018-02-27 15:40:18 -08:00
Daniel Holbert 4afe7c70cc Bug 1174003 part 3: [css-flexbox] Make GetMarginSizeInMainAxis() take a LogicalMargin, instead of nsMargin. r=mats
This patch doesn't change behavior. It just makes us use logical axes/types instead of physical ones for this particular API and its caller.

MozReview-Commit-ID: Jt6SECGI9EU

--HG--
extra : rebase_source : 60d7e52ed9a53f0c0d3ebf3103cbdab476606ddb
2018-02-27 15:40:10 -08:00
Daniel Holbert 3dfe09e9e1 Bug 1174003 part 2: [css-flexbox] Reformat code around GetMinimumWidgetSize call slightly. r=mats
This patch doesn't change behavior. It's purely to allow the next patch to be more surgical. Specifically, this patch:
 - splits a subtract-and-clamp operation into two separate operations.
 - splits one a comment into two.
...so that the next patch can swap out these variables for new ones, without
pushing these lines over 80 characters.

MozReview-Commit-ID: 4N5sI755CqF

--HG--
extra : rebase_source : 96af106d739256a6871e75d0d34e9691cfbfb0c2
2018-02-27 11:26:43 -08:00
Daniel Holbert 375dc5dc6e Bug 1174003 part 1: [css-flexbox] Remove unused method nsFlexContainerFrame::IsHorizontal. r=mats
MozReview-Commit-ID: JzvGzJvMhLS

--HG--
extra : rebase_source : 08916cb0fa201f036d69de41f7a3f760a6c081d9
2018-02-27 11:21:22 -08:00