Created attachment 750578 [details] testcase Assertion failure: nsLayoutUtils::IsFrameListSorted<IsOrderLEQWithDOMFallback>(mFrames) (Frame list should've been sorted in reflow), at layout/generic/nsFlexContainerFrame.cpp:1111 Similar to bug 826483, which dholbert fixed two weeks ago.
So, bug 867454 added a special-case for flex container's children that have ":after". However, in this case, the :after frame isn't a *child* of the flex container -- it's wrapped inside several anonymous table boxes. (since it's a table-cell frame) We should be able to use the existing logic in GetContentForComparison() to descend through those anonymous frames.
Created attachment 750744 [details] [diff] [review] fix v1 This patch converts the existing "GetContentForComparison" helper-function into a more targeted "GetFirstNonAnonBoxDescendant" method, and calls it slightly earlier, so that we can benefit from it when checking for ::before and ::after.
Created attachment 750747 [details] [diff] [review] fix v1a [just tweaked a comment] Oops; noticed a stale (& now duplicate) comment about << Same "order" value >>. I tweaked it to instead say "Usual case" (as opposed to the Special case above it, for ::before/::after)
Comment on attachment 750747 [details] [diff] [review] fix v1a [just tweaked a comment] Ah, very nice! r=me
Thanks! Try run, with the patches for this bug and Bug 825810: https://tbpl.mozilla.org/?tree=Try&rev=21312c3ec51b
Apparently I just eyeballed the reftest instead of actually running it, so it turns out it fails, but it fails in a way that's actually expected, so it's a test-bug and not a code-bug. The test fails because we're ignoring "align-self" on the ::before/::after table-cell and table-row elements. This is correct behavior, because align-self only applies to flex items, and the cell/row aren't themselves flex items -- they get wrapped in tables, and the *tables* are the flex items. So, I'm just going to rename the reftest to "flexbox-with-pseudo-elements-3.html" (instead of "-1b") and give it its own reference case. (The reference case will be similar to flexbox-with-pseudo-elements-1-ref.html, but without the "align-self" settings.) (Note: the reftest also happens to aborts in debug builds when the patch for bug 825810 is also applied, as it was in that Try run -- but that's an issue in that bug's patch & it has a relatively straightforward solution -- I'll discuss that abort issue over on bug 825810.)
Created attachment 751410 [details] [diff] [review] fix v1b [fixed reftest] [r=bz] Here's the patch with that fixed. Carrying forward r=bz. Try run with that fixed (just reftests, & just this patch -- not bug 825810 anymore): https://tbpl.mozilla.org/?tree=Try&rev=8a071ff5e5b4