mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 15:26:07 +00:00
Bug 1457286: Teach nsFind about display: contents. r=mats
MozReview-Commit-ID: LODyc8yuuSs
This commit is contained in:
parent
c91cd00748
commit
340d7141bb
@ -815,9 +815,13 @@ nsFind::PeekNextChar(nsRange* aSearchRange,
|
||||
return t1b ? CHAR_TO_UNICHAR(t1b[index]) : t2b[index];
|
||||
}
|
||||
|
||||
// FIXME(emilio): This very probably wants to look at frames instead.
|
||||
bool
|
||||
nsFind::IsBlockNode(nsIContent* aContent)
|
||||
{
|
||||
if (aContent->IsElement() && aContent->AsElement()->IsDisplayContents()) {
|
||||
return false;
|
||||
}
|
||||
if (aContent->IsAnyOfHTMLElements(nsGkAtoms::img,
|
||||
nsGkAtoms::hr,
|
||||
nsGkAtoms::th,
|
||||
@ -829,17 +833,16 @@ nsFind::IsBlockNode(nsIContent* aContent)
|
||||
}
|
||||
|
||||
bool
|
||||
nsFind::IsVisibleNode(nsINode* aDOMNode)
|
||||
nsFind::IsVisibleNode(nsINode* aNode)
|
||||
{
|
||||
nsCOMPtr<nsIContent> content(do_QueryInterface(aDOMNode));
|
||||
if (!content) {
|
||||
if (!aNode->IsContent()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIFrame* frame = content->GetPrimaryFrame();
|
||||
nsIFrame* frame = aNode->AsContent()->GetPrimaryFrame();
|
||||
if (!frame) {
|
||||
// No frame! Not visible then.
|
||||
return false;
|
||||
// No frame! Not visible then, unless it's display: contents.
|
||||
return aNode->IsElement() && aNode->AsElement()->IsDisplayContents();
|
||||
}
|
||||
|
||||
return frame->StyleVisibility()->IsVisible();
|
||||
|
Loading…
x
Reference in New Issue
Block a user