mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1541253 - Check PresShell::IsUnderHiddenEmbedderElement where we need to check CSS visibility state across the document boundary. r=tnikkel
Depends on D26252 Differential Revision: https://phabricator.services.mozilla.com/D26253 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
a7b7f105b5
commit
ddb35d3718
@ -315,13 +315,19 @@ uint64_t Accessible::VisibilityState() const {
|
||||
return states::INVISIBLE;
|
||||
}
|
||||
|
||||
// Walk the parent frame chain to see if there's invisible parent or the frame
|
||||
// is in background tab.
|
||||
if (!frame->StyleVisibility()->IsVisible()) return states::INVISIBLE;
|
||||
|
||||
// It's invisible if the presshell is hidden by a visibility:hidden element in
|
||||
// an ancestor document.
|
||||
if (frame->PresShell()->IsUnderHiddenEmbedderElement()) {
|
||||
return states::INVISIBLE;
|
||||
}
|
||||
|
||||
// Offscreen state if the document's visibility state is not visible.
|
||||
if (Document()->IsHidden()) return states::OFFSCREEN;
|
||||
|
||||
// Walk the parent frame chain to see if the frame is in background tab or
|
||||
// scrolled out.
|
||||
nsIFrame* curFrame = frame;
|
||||
do {
|
||||
nsView* view = curFrame->GetView();
|
||||
@ -366,8 +372,6 @@ uint64_t Accessible::VisibilityState() const {
|
||||
|
||||
if (!parentFrame) {
|
||||
parentFrame = nsLayoutUtils::GetCrossDocParentFrame(curFrame);
|
||||
if (parentFrame && !parentFrame->StyleVisibility()->IsVisible())
|
||||
return states::INVISIBLE;
|
||||
}
|
||||
|
||||
curFrame = parentFrame;
|
||||
|
@ -393,6 +393,10 @@ bool nsIFrame::IsVisibleConsideringAncestors(uint32_t aFlags) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (PresShell()->IsUnderHiddenEmbedderElement()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const nsIFrame* frame = this;
|
||||
while (frame) {
|
||||
nsView* view = frame->GetView();
|
||||
@ -416,8 +420,6 @@ bool nsIFrame::IsVisibleConsideringAncestors(uint32_t aFlags) const {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!parent->StyleVisibility()->IsVisible()) return false;
|
||||
|
||||
frame = parent;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user