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

353 Коммитов

Автор SHA1 Сообщение Дата
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
Daniel Holbert 486efeca4f Bug 1338053: Make nsFlexContainerFrame::MarkIntrinsicISizesDirty() also call its parent class's method. r=emilio
MozReview-Commit-ID: 72oIlunLcVq

--HG--
extra : rebase_source : 291e8b6c17bc94a5bb557e9dbf75da7d28efb961
2017-02-08 23:08:43 -08:00
Emilio Cobos Álvarez d161d20ce7 Bug 1336708: Don't reuse cached flex-item reflow measurements if the item's computed height has changed. r=dholbert
For some stretched items, we override the computed height of the input for
measuring reflows, which may change the ascent and height result.

Just use that as a key for the reflow result cache too.

MozReview-Commit-ID: 9NyObfVucnC
2017-02-07 21:00:45 +01:00
Emilio Cobos Álvarez 222cfd4e2c Bug 1209697: Part 2, Cache flex measuring reflows to avoid exponential behavior. r=dholbert
MozReview-Commit-ID: 8vcLUvASEFM
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

--HG--
extra : rebase_source : e0341ceaf269a6d0ed44fb6a82fff90956192073
2017-01-06 15:34:16 +01:00
Mats Palmgren deb52d2e03 Bug 1312379 part 2 - [css-flexbox] Improve support for CSS Alignment 'last baseline' alignment by exporting the last baseline when asked for. r=dholbert 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 043abe72aa Bug 1313811 - [css-flexbox] Synthesize the flex container baseline per alignment context when needed. r=dholbert 2016-12-20 23:56:34 +01:00
Daniel Holbert a970d791f5 Bug 1321698 part 3: Fold nsFlexContainerFrame's old IsLegacyBox() function into its only remaining caller, nsFlexContainerFrame::Init(). r=mats
This patch is to prevent any new callers of this API, since we can now rely on
the new frame state bit (NS_STATE_FLEX_IS_LEGACY_WEBKIT_BOX) to test for this.

MozReview-Commit-ID: BONaqPC30Cn

--HG--
extra : rebase_source : 7e4bf712d6ebd23efae5495e4e6c130cd1dba8cb
2016-12-02 10:44:07 -08:00
Daniel Holbert a720a44ada Bug 1321698 part 2: Use the new frame state bit to check for -webkit-box containers. r=mats
Note that at the callsites in nsCSSFrameConstructor.cpp, we have to also check
the frame type (since the frame state bit is in a range of bits whose meaning
differs depending on frame type).  The first change in this patch is the
addition of a convenience fucntion that checks both the frame type as well as
the frame state bit.

MozReview-Commit-ID: DEOThTX5NAO

--HG--
extra : rebase_source : 95e86eec663b3ef2e7bb86214871fcd3ea86057c
2016-12-02 10:32:31 -08:00
Daniel Holbert f2e0c89b68 Bug 1321698 part 1: Set a frame state bit on nsFlexContainerFrame if it's emulating -webkit-box. r=mats
MozReview-Commit-ID: 5eL55atUBnT

--HG--
extra : rebase_source : c947804edfadd1b9aa3630e1f1e57484b98adb59
2016-12-02 01:02:00 -08:00
Brad Werth 0d9163aeec Bug 1221524 Part 3: Implement align-self:last baseline behavior in flex containers. r=dholbert
MozReview-Commit-ID: 7Qo7LPu74Ra

--HG--
extra : rebase_source : 81bccbf7bdb7c7e83198783514acba35a690d9f2
2016-11-07 09:53:14 -08:00
Brad Werth 660c37a2d7 Bug 1221524 Part 1: Map align-self:"baseline" to "flex-start" when FlexItem writing mode is orthogonal to container main axis. r=dholbert
MozReview-Commit-ID: 2IlkVDWNirG

--HG--
extra : rebase_source : 6885a5a4a4247b4cec74d6ff9ca1c463cd6b0e14
2016-10-31 14:46:52 -07: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 ddb49488f0 Bug 1300369 part 8 - Move nsLayoutUtils::ComputeSizeWithIntrinsicDimensions to a nsFrame method (idempotent patch). r=dholbert 2016-11-05 02:57:06 +01:00
Daniel Holbert 5801c1a6f6 Bug 1269046 part 7: Give nsFlexContainerFrame a CSSAlignmentForAbsPosChild() implementation (to determine appropriate align enum for abspos children). r=mats
MozReview-Commit-ID: LFQfKPlR9Gv
2016-10-31 08:59:40 -07:00
Daniel Holbert 773cf89b1c Bug 1269046 part 6: Add a flags enum-class to customize FlexboxAxisTracker behavior. r=mats
Right now, there's only one flag in this new class (with no usages until a
later patch). This flag suppresses a hack, which otherwise makes us
transparently reverse the child list & flex axes in some circumstances, to
prevent bottom-to-top child ordering. (We don't want that hack when we're
dealing with individual abspos children, since it only makes things more
complicated.)

MozReview-Commit-ID: HYUf0vjlfiJ
2016-10-31 08:58:18 -07:00
Daniel Holbert 689d473b8d Bug 1269046 part 4: Set flags on nsPlaceholderFrame & ReflowInput to track abspos frames that need CSS Box Alignment to resolve static position. r=mats
(We'll react to the ReflowInput flags and do the actual CSS Box Alignment in a
later patch in this series.)

MozReview-Commit-ID: EZd7npWSzQI
2016-10-31 08:58:18 -07:00
Daniel Holbert 3903256ea3 Bug 1269045 part 3: Stop wrapping placeholder frames in anonymous flex items. r=mats
This patch also:
 * Removes some now-unnecessary code from nsFlexContainerFrame, which was for jumping from wrapped-placeholders to their out-of-flow frames (for DOM comparisons). This code is now unnecessary because placeholders won't be wrapped anymore.
 * Updates some reftests with abspos content to match the updated spec's expectations, with one marked as "fails" for the time being (until bug 1269046 implements css box alignment, which we need to render that test correctly).

MozReview-Commit-ID: 8canWfXk6Kf
2016-10-31 08:58:17 -07:00
Daniel Holbert 4bef1cf802 Bug 1269045 part 2: Separate out abspos placeholders when creating FlexItems, and give them a trivial reflow at container's content-box origin. r=mats
MozReview-Commit-ID: 5lXUsusLryC
2016-10-31 08:58:17 -07:00
Daniel Holbert 6195387be1 Bug 1269045 part 1: Adjust flex item "order"-sorting code to treat placeholder frames as <= anything they're compared against, including each other. r=mats
This patch makes the following specific changes:
 (1) Adds an early-return to both versions of the IsOrderLEQ function, to treat placeholder children as LEQ everything (including each other). This will tend to sort them to the beginning of the child list, which is unimportant but fine. More importantly, though: this means our "order"-sorting code won't reorder placeholders *with respect to each other* (since our sort algorithm is stable). So their painting order won't be affected by the "order" property, which is required by the spec.
 (2) Drops some nsPlaceholderFrame::GetRealFrameFor() calls -- they're unnecessary, since any placeholder frames will have prompted us to return earlier.

One caveat to (2): this patch does leave a few "nsPlaceholderFrame::GetRealFrameFor()" calls in place, *for the moment*.  These remaining calls are for handling placeholders that are wrapped, i.e. inside of anonymous flex items. These calls are still needed to avoid assertion-failures (i.e. to get a consistent ordering) at this point, but they'll be removed in a later patch in this same bug, when we stop wrapping placeholders in anonymous flex items.

MozReview-Commit-ID: 1R6NW30Kxgv
2016-10-31 08:58:17 -07: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 a6ab4069c5 Bug 1269046 part 7: Give nsFlexContainerFrame a CSSAlignmentForAbsPosChild() implementation (to determine appropriate align enum for abspos children). r=mats
MozReview-Commit-ID: LFQfKPlR9Gv
2016-10-27 18:58:26 -07:00
Daniel Holbert 7bc4cc7005 Bug 1269046 part 6: Add a flags enum-class to customize FlexboxAxisTracker behavior. r=mats
Right now, there's only one flag in this new class (with no usages until a
later patch). This flag suppresses a hack, which otherwise makes us
transparently reverse the child list & flex axes in some circumstances, to
prevent bottom-to-top child ordering. (We don't want that hack when we're
dealing with individual abspos children, since it only makes things more
complicated.)

MozReview-Commit-ID: HYUf0vjlfiJ
2016-10-27 18:58:26 -07:00
Daniel Holbert 222438d58d Bug 1269046 part 4: Set flags on nsPlaceholderFrame & ReflowInput to track abspos frames that need CSS Box Alignment to resolve static position. r=mats
(We'll react to the ReflowInput flags and do the actual CSS Box Alignment in a
later patch in this series.)

MozReview-Commit-ID: EZd7npWSzQI
2016-10-27 18:58:26 -07:00
Daniel Holbert 5b242f67d2 Bug 1269045 part 3: Stop wrapping placeholder frames in anonymous flex items. r=mats
This patch also:
 * Removes some now-unnecessary code from nsFlexContainerFrame, which was for jumping from wrapped-placeholders to their out-of-flow frames (for DOM comparisons). This code is now unnecessary because placeholders won't be wrapped anymore.
 * Updates some reftests with abspos content to match the updated spec's expectations, with one marked as "fails" for the time being (until bug 1269046 implements css box alignment, which we need to render that test correctly).

MozReview-Commit-ID: 8canWfXk6Kf
2016-10-27 18:58:26 -07:00
Daniel Holbert 1ceb807b65 Bug 1269045 part 2: Separate out abspos placeholders when creating FlexItems, and give them a trivial reflow at container's content-box origin. r=mats
MozReview-Commit-ID: 5lXUsusLryC
2016-10-27 18:58:26 -07:00
Daniel Holbert 0237208c0b Bug 1269045 part 1: Adjust flex item "order"-sorting code to treat placeholder frames as <= anything they're compared against, including each other. r=mats
This patch makes the following specific changes:
 (1) Adds an early-return to both versions of the IsOrderLEQ function, to treat placeholder children as LEQ everything (including each other). This will tend to sort them to the beginning of the child list, which is unimportant but fine. More importantly, though: this means our "order"-sorting code won't reorder placeholders *with respect to each other* (since our sort algorithm is stable). So their painting order won't be affected by the "order" property, which is required by the spec.
 (2) Drops some nsPlaceholderFrame::GetRealFrameFor() calls -- they're unnecessary, since any placeholder frames will have prompted us to return earlier.

One caveat to (2): this patch does leave a few "nsPlaceholderFrame::GetRealFrameFor()" calls in place, *for the moment*.  These remaining calls are for handling placeholders that are wrapped, i.e. inside of anonymous flex items. These calls are still needed to avoid assertion-failures (i.e. to get a consistent ordering) at this point, but they'll be removed in a later patch in this same bug, when we stop wrapping placeholders in anonymous flex items.

MozReview-Commit-ID: 1R6NW30Kxgv
2016-10-27 18:58:25 -07:00
Daniel Holbert b76fdcd7b9 Bug 1313421 part 2: Use flex container's FlexLine linked-list to determine the first flex item, rather than its child-frame list. r=mats
This shouldn't change our behavior right now, but it will make a difference
after bug 1269045 -- when that bug lands, we'll have nsPlaceholderFrames (which
are not flex items) in the child-frame list, which means we can't depend on its
first entry being a flex item anymore.

MozReview-Commit-ID: KRXYaK8R8bc
2016-10-27 18:56:48 -07:00
Daniel Holbert 0f4079b53d Bug 1313421 part 1: Unconditionally cache a FlexItem's ascent, after it's been reflowed. r=mats
This removes a (very minor) optimization. The optimization was simply that we
avoided storing this nscoord value, if we could tell that we weren't ever going
to need it. Now it's becoming a bit more complicated to prove that we'll never
need it, so we might as well just store it unconditionally.

MozReview-Commit-ID: 94FFc9SO516
2016-10-27 18:56:41 -07:00
Daniel Holbert b70af4f32a Bug 1309119 part 2: Make nsFlexContainerFrame::IsLegacyBox assert that legacy -webkit-box elements are backed by nsFlexContainerFrame. r=mats
MozReview-Commit-ID: 62VsCtKJg3C
2016-10-20 13:23:51 -07:00
Daniel Holbert 72b186f76f Bug 1309119 part 1: Expose nsFlexContainerFrame helper-function IsLegacyBox as a static method. r=mats
MozReview-Commit-ID: 8fztWk2sp0L
2016-10-20 13:23:51 -07:00
Brad Werth 76fb14b998 Bug 1235922 Part 4: Add support for "align-content: space-evenly" to flexbox layout. r=mats
MozReview-Commit-ID: 3ETuPrIURJ3

--HG--
extra : rebase_source : 95d4d7029660086b0bf6380b98efe57e11d4be83
2016-10-14 17:17:33 -07:00
Daniel Holbert 9fd00fc1f2 Bug 1235922 Part 2: Add support for "justify-content: space-evenly" to flexbox layout. r=mats
MozReview-Commit-ID: 6Am15EIVAXH

--HG--
extra : rebase_source : f0500b5737f8834765707724c5204bc2ab5b40d1
2016-10-14 17:16:00 -07:00
Brad Werth 8bd396d59a Bug 1235922 Part 1: Introduce a helper-function to share code for justify-content and align-content space-around and space-between in flexbox layout. r=mats
MozReview-Commit-ID: tncRJiojh

--HG--
extra : rebase_source : 279c790926f89b1942069f8cc4eeb70fe58eaf65
2016-10-14 17:23:36 -07:00
Brad Werth 8455bc616a Bug 1310015: Change MainAxisTracker to consistently use NS_STYLE_JUSTIFY constants. r=mats
MozReview-Commit-ID: F8VfIuZJqFa

--HG--
extra : rebase_source : c013d6b4e25daf8dbcb010720eb2ea42ffd0ae35
2016-10-13 14:20:48 -07:00
Julian Descottes 86fd0737d8 Bug 1308993 - aboutdebugging remove align-items: self-start;r=erahm
MozReview-Commit-ID: 7d054lVgwdt

--HG--
extra : rebase_source : 9c84df5b59f3fe0de661fc5485beb9cb33c25caa
2016-10-13 16:42:26 +02:00
Daniel Holbert 5ea7b37dd6 Bug 1090031: Apply CSS 'align-content' in flex containers if they *could* wrap (rather than if they *have* wrapped). r=mats
The spec says that single-line flex containers should stretch their one flex
line to the flex container's cross size, and should ignore 'align-content'.

Initially, the spec defined 'single-line' to include any flex container that
happens to have only 1 line (even if it's got 'flex-wrap:wrap' or
'wrap-reverse'). But later, the term 'single-line' was intentionally redefined
to *only* include flex containers that have 'flex-wrap: nowrap'.  So, instead
of checking the line-count, we should instead check 'flex-wrap', when deciding
whether to stretch our one line & ignore 'align-content'.


MozReview-Commit-ID: D2ZMIBS16ui

--HG--
extra : rebase_source : 835a64e0f9cdaa375f8e57f55ffe5b011525cbeb
2016-10-12 09:04:03 -07:00
Wes Kocher 5c9e53976d Backed out changeset 37e0c017b268 (bug 1090031) for reftest failures a=backout 2016-10-12 14:46:23 -07:00
Daniel Holbert 7c6df4e0a1 Bug 1090031: Apply CSS 'align-content' in flex containers if they *could* wrap (rather than if they *have* wrapped). r=mats
The spec says that single-line flex containers should stretch their one flex
line to the flex container's cross size, and should ignore 'align-content'.

Initially, the spec defined 'single-line' to include any flex container that
happens to have only 1 line (even if it's got 'flex-wrap:wrap' or
'wrap-reverse'). But later, the term 'single-line' was intentionally redefined
to *only* include flex containers that have 'flex-wrap: nowrap'.  So, instead
of checking the line-count, we should instead check 'flex-wrap', when deciding
whether to stretch our one line & ignore 'align-content'.


MozReview-Commit-ID: D2ZMIBS16ui

--HG--
extra : rebase_source : c600a80b96df3c937f2a56a5e0ed1825750234e0
2016-10-12 09:04:03 -07:00
Brad Werth 35c396cb6a Bug 1306894 Part 1: Cache baseline from nsFlexContainerFrame::Reflow() for use in later calls to GetLogicalBaseline(). r=dholbert
MozReview-Commit-ID: JXUK8a0L1RZ

--HG--
extra : rebase_source : 9c4f885ac883429512073f38dfa1226058d8b8a5
2016-10-11 12:54:00 -07:00
Brad Werth e321b44ac3 Bug 1221565 Part 2: Make nsFlexContainerFrame map justify-content and align-content values of 'left' and 'right' to 'start' or 'end'. r=dholbert
MozReview-Commit-ID: 8sZyFwIlpr4

--HG--
extra : rebase_source : 594f467df3f34021a363510d945ea87d2a82ba24
2016-10-07 09:22:52 -07:00
Brad Werth 2ac369120e Bug 1221565 Part 1: Make nsFlexContainerFrame map align-self values of 'left' and 'right' to either 'start' or 'end'. r=dholbert
MozReview-Commit-ID: 8Xv4BzZ3Okv

--HG--
extra : rebase_source : 796dea9e9b81183ad9b87c1e14a10c780aba30dc
2016-10-06 15:55:39 -07:00
Mats Palmgren d7f4c1f451 Bug 984869 - Add support for display:flex/grid and columnset layout to <button>. r=tn 2016-10-06 22:43:22 +02:00
Brad Werth 25da11fb5e Bug 1305844 - Make most align/justify nsStylePosition members public, and remove trivial accessors. r=dholbert
--HG--
extra : rebase_source : a38fdd5d608370e3408a698fd887cc15f5c01537
2016-10-03 13:05:35 -07:00
Brad Werth 2fe8e4a753 Bug 1304012 -- Part 2: Rename nsStyleStruct Computed**Self functions to Used**Self. r=dholbert
MozReview-Commit-ID: FCBuT2Z7sy6
2016-09-30 09:15:57 -07:00
Daniel Holbert 8ee9cc8def Bug 1306213: When resolving a flex item's "align-self: auto", use the flex container (not style-context parent) as the "align-items" source. r=mats
(Normally, the style-context parent will *be* the flex container's style
context, so this patch won't change behavior at all. But if a flex container
has a "display:table" child, then there's an extra style context in the
inheritance chain (due to how style inheritance works for nsTableWrapperFrame).
And we don't want that extra style context to mess up the ability of a flex
container's "align-items" property to actually align the flex items.)

MozReview-Commit-ID: GFyxhEwM68S

--HG--
extra : rebase_source : 4be8ac901e10de20747ed44b889d234646d4b2fd
2016-09-28 23:53:20 -07:00
Xidorn Quan 6354ca8b8e Bug 1301014 - Fix intrinsic inline-size of flex container in vertical writing modes. r=dholbert
MozReview-Commit-ID: 7ef2EqMxOI5

--HG--
extra : source : 05adfc934ff38205bf3d84ad621e6501f8b9ce86
2016-09-16 20:39:39 +10:00
Nicholas Nethercote b71747b2ac Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.

--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
2016-09-01 15:01:16 +10:00
Emilio Cobos Álvarez 619cb14d87 Bug 1299066: Make NS_STYLE_DISPLAY_* an enum class. Prefer indexing instead of linear search in the frame constructor r=heycam,bz
The main renaming was generated with the following python script:

```

import sys
import re

CAMEL_CASE_REGEX = re.compile(r"(^|_|-)([A-Z])([A-Z]+)")
DISPLAY_REGEX = re.compile(r"\bNS_STYLE_DISPLAY_([^M][A-Z_]+)\b")

def to_camel_case(ident):
  return re.sub(CAMEL_CASE_REGEX,
                lambda m: m.group(2) + m.group(3).lower(), ident)

def constant_to_enum(constant):
  return "StyleDisplay::" + to_camel_case(constant) + ("_" if constant == "NONE" else "")

def process_line(line):
  return re.sub(DISPLAY_REGEX,
                lambda m: constant_to_enum(m.group(1)), line)

lines = []
with open(sys.argv[1], "r") as f:
  for line in f:
    lines.append(process_line(line))

with open(sys.argv[1], "w") as f:
  for line in lines:
    f.write(line)
```

And the following shell commands:

```
find . -name '*.cpp' -exec python display.py {} \;
find . -name '*.h' -exec python display.py {} \;
```

MozReview-Commit-ID: 91xYCbLC2Vf
2016-09-01 20:41:17 -07:00