Fix for bug #71979: <br><hr> inside link displays additional hr upon each mouseover

Modified FindFrameWithContent() to skip over sibling :before pseudo frames when
looking for the primary frame for non-splittable-element aContent.

r=dbaron@fas.harvard.edu   sr=waterson@netscape.com


git-svn-id: svn://10.0.0.236/trunk@108697 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kin%netscape.com
2001-11-21 14:24:59 +00:00
parent e690a4a290
commit fd1f07fa3a
2 changed files with 46 additions and 0 deletions

View File

@@ -11154,6 +11154,29 @@ keepLooking:
// Ignore the placeholder and return the out-of-flow frame instead
return ((nsPlaceholderFrame*)kidFrame)->GetOutOfFlowFrame();
} else {
// Check if kidframe is the :before pseudo frame for aContent. If it
// is, and aContent is an element, then aContent might be a
// non-splittable-element, so the real primary frame could be the
// next sibling.
if (aContent->IsContentOfType(nsIContent::eELEMENT) &&
IsGeneratedContentFor(aContent, kidFrame, nsCSSAtoms::beforePseudo)) {
nsIFrame *nextSibling = nsnull;
kidFrame->GetNextSibling(&nextSibling);
if (nextSibling) {
nsCOMPtr<nsIContent> nextSiblingContent;
nextSibling->GetContent(getter_AddRefs(nextSiblingContent));
// Make sure the content matches, and because I'm paranoid,
// make sure it's not the :after pseudo frame.
if (nextSiblingContent.get() == aContent &&
!IsGeneratedContentFor(aContent, nextSibling, nsCSSAtoms::afterPseudo))
kidFrame = nextSibling;
}
}
// Return the matching child frame
return kidFrame;
}