Bug 1295852 - Part 4: Check for generated content containers more precisely when reflowing grid containers. r=me

I'm not convinced that we can actually get regular content
<_moz_generated_content_before> elements in here, since it's only if
CompareTreePosition returned 0 that we look at the element name,
but might be best to make this test stronger in any case.

MozReview-Commit-ID: 8CgxcU9AbDA

--HG--
extra : rebase_source : 4a47ed62895d83f720ec7ccfde253e2c1945b34f
This commit is contained in:
Cameron McCormack 2016-08-19 11:46:43 +08:00
Родитель 6b7cc9d914
Коммит 792c4f4eb0
1 изменённых файлов: 8 добавлений и 9 удалений

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

@ -245,21 +245,20 @@ MergeSortedFrameLists(nsFrameList& aDest, nsFrameList& aSrc,
aDest.AppendFrames(nullptr, aSrc);
break;
}
int32_t result = nsLayoutUtils::CompareTreePosition(src->GetContent(),
dest->GetContent(),
nsIContent* srcContent = src->GetContent();
nsIContent* destContent = dest->GetContent();
int32_t result = nsLayoutUtils::CompareTreePosition(srcContent,
destContent,
aCommonAncestor);
if (MOZ_UNLIKELY(result == 0)) {
// NOTE: we get here when comparing ::before/::after for the same element.
auto srcPseudo = src->GetContent()->NodeInfo()->NameAtom();
if (MOZ_UNLIKELY(srcPseudo == nsGkAtoms::mozgeneratedcontentbefore)) {
auto destPseudo = dest->GetContent()->NodeInfo()->NameAtom();
if (MOZ_LIKELY(destPseudo != nsGkAtoms::mozgeneratedcontentbefore) ||
if (MOZ_UNLIKELY(srcContent->IsGeneratedContentContainerForBefore())) {
if (MOZ_LIKELY(!destContent->IsGeneratedContentContainerForBefore()) ||
::IsPrevContinuationOf(src, dest)) {
result = -1;
}
} else if (MOZ_UNLIKELY(srcPseudo == nsGkAtoms::mozgeneratedcontentafter)) {
auto destPseudo = dest->GetContent()->NodeInfo()->NameAtom();
if (MOZ_UNLIKELY(destPseudo == nsGkAtoms::mozgeneratedcontentafter) &&
} else if (MOZ_UNLIKELY(srcContent->IsGeneratedContentContainerForAfter())) {
if (MOZ_UNLIKELY(destContent->IsGeneratedContentContainerForAfter()) &&
::IsPrevContinuationOf(src, dest)) {
result = -1;
}