Bug 611103 - Part 3: Handle the edge case where the br element appears immediately after another br; r=bzbarsky

The test for bug 1119503 examines this edge case.
This commit is contained in:
Ehsan Akhgari 2015-01-23 11:23:24 -05:00
parent 60d26d5122
commit eefcf4a572

View File

@ -330,9 +330,12 @@ IsInvisibleBreak(nsINode *aNode) {
}
// If the BRFrame has caused a visible line break, it should have a next
// sibling, or otherwise no siblings and a non-zero height.
// sibling, or otherwise no siblings (or immediately after a br) and a
// non-zero height.
bool visible = frame->GetNextSibling() ||
(!frame->GetPrevSibling() && frame->GetRect().Height() != 0);
((!frame->GetPrevSibling() ||
frame->GetPrevSibling()->GetType() == nsGkAtoms::brFrame) &&
frame->GetRect().Height() != 0);
return !visible;
}