зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1324591 - Add nsLayoutUtils::IsInPositionFixedSubtree. r=TYLin
Depends on D75729 Differential Revision: https://phabricator.services.mozilla.com/D81480
This commit is contained in:
Родитель
cb8a5d8210
Коммит
7115e973a0
|
@ -2615,13 +2615,9 @@ nsDOMWindowUtils::ZoomToFocusedInput() {
|
|||
// Note that we only do this if the frame belongs to `presShell` (that is,
|
||||
// we still zoom in fixed elements in subdocuments, as they're not fixed to
|
||||
// the root content document).
|
||||
if (frame->PresShell() == presShell) {
|
||||
for (; frame; frame = frame->GetParent()) {
|
||||
if (frame->StyleDisplay()->mPosition == StylePositionProperty::Fixed &&
|
||||
nsLayoutUtils::IsReallyFixedPos(frame)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (frame->PresShell() == presShell &&
|
||||
nsLayoutUtils::IsInPositionFixedSubtree(frame)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}();
|
||||
|
|
|
@ -174,14 +174,8 @@ void AccessibleCaret::EnsureApzAware() {
|
|||
}
|
||||
|
||||
bool AccessibleCaret::IsInPositionFixedSubtree() const {
|
||||
for (nsIFrame* f = mImaginaryCaretReferenceFrame.GetFrame(); f;
|
||||
f = f->GetParent()) {
|
||||
if (f->StyleDisplay()->mPosition == StylePositionProperty::Fixed &&
|
||||
nsLayoutUtils::IsReallyFixedPos(f)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return nsLayoutUtils::IsInPositionFixedSubtree(
|
||||
mImaginaryCaretReferenceFrame.GetFrame());
|
||||
}
|
||||
|
||||
void AccessibleCaret::InjectCaretElement(Document* aDocument) {
|
||||
|
|
|
@ -7653,6 +7653,17 @@ bool nsLayoutUtils::MayBeReallyFixedPos(const nsIFrame* aFrame) {
|
|||
parentType == LayoutFrameType::PageContent;
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool nsLayoutUtils::IsInPositionFixedSubtree(const nsIFrame* aFrame) {
|
||||
for (const nsIFrame* f = aFrame; f; f = f->GetParent()) {
|
||||
if (f->StyleDisplay()->mPosition == StylePositionProperty::Fixed &&
|
||||
nsLayoutUtils::IsReallyFixedPos(f)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
nsLayoutUtils::SurfaceFromElementResult
|
||||
nsLayoutUtils::SurfaceFromOffscreenCanvas(OffscreenCanvas* aOffscreenCanvas,
|
||||
uint32_t aSurfaceFlags,
|
||||
|
|
|
@ -2186,6 +2186,11 @@ class nsLayoutUtils {
|
|||
*/
|
||||
static bool MayBeReallyFixedPos(const nsIFrame* aFrame);
|
||||
|
||||
/**
|
||||
* Returns true if |aFrame| is inside position:fixed subtree.
|
||||
*/
|
||||
static bool IsInPositionFixedSubtree(const nsIFrame* aFrame);
|
||||
|
||||
/**
|
||||
* Obtain a SourceSurface from the given DOM element, if possible.
|
||||
* This obtains the most natural surface from the element; that
|
||||
|
|
Загрузка…
Ссылка в новой задаче