Bug 824862: Don't skip over generated-content children of a flex container, even if they look like whitespace. r=bz

This commit is contained in:
Daniel Holbert 2013-01-04 20:05:44 -08:00
Родитель a8668b3606
Коммит b17ad863b0
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -9532,7 +9532,15 @@ nsCSSFrameConstructor::CreateNeededAnonFlexItems(
// there's anything wrappable immediately after it. If not, we just drop
// the whitespace and move on. (We're not supposed to create any anonymous
// flex items that _only_ contain whitespace).
if (iter.item().IsWhitespace(aState)) {
// (BUT if this is generated content, then we don't give whitespace nodes
// any special treatment, because they're probably not really whitespace --
// they're just temporarily empty, waiting for their generated text.)
// XXXdholbert If this node's generated text will *actually end up being
// entirely whitespace*, then we technically should still skip over it, per
// the flexbox spec. I'm not bothering with that at this point, since it's
// a pretty extreme edge case.
if (!aParentFrame->IsGeneratedContentFrame() &&
iter.item().IsWhitespace(aState)) {
FCItemIterator afterWhitespaceIter(iter);
bool hitEnd = afterWhitespaceIter.SkipWhitespace(aState);
bool nextChildNeedsAnonFlexItem =