Backed out changeset 5a4a5749f8dc (bug 1767262) for causing wpt failures.

This commit is contained in:
Butkovits Atila
2022-08-23 18:33:04 +03:00
parent e50fa41df7
commit 22dc8215a9
13 changed files with 8 additions and 334 deletions

View File

@@ -11821,37 +11821,3 @@ void PresShell::PingPerTickTelemetry(FlushType aFlushType) {
bool PresShell::GetZoomableByAPZ() const {
return mZoomConstraintsClient && mZoomConstraintsClient->GetAllowZoom();
}
void PresShell::EnsureReflowIfFrameHasHiddenContent(nsIFrame* aFrame) {
if (!aFrame || !aFrame->IsSubtreeDirty() ||
!StaticPrefs::layout_css_content_visibility_enabled()) {
return;
}
MOZ_ASSERT(mHiddenContentInForcedLayout.IsEmpty());
nsIFrame* topmostFrameWithContentHidden = nullptr;
for (nsIFrame* cur = aFrame->GetInFlowParent(); cur;
cur = cur->GetInFlowParent()) {
if (cur->IsContentHidden()) {
topmostFrameWithContentHidden = cur;
mHiddenContentInForcedLayout.Insert(cur->GetContent());
}
}
if (mHiddenContentInForcedLayout.IsEmpty()) {
return;
}
// Queue and immediately flush a reflow for this node.
MOZ_ASSERT(topmostFrameWithContentHidden);
FrameNeedsReflow(topmostFrameWithContentHidden, IntrinsicDirty::Resize,
NS_FRAME_IS_DIRTY);
aFrame->PresContext()->Document()->FlushPendingNotifications(
FlushType::Layout);
mHiddenContentInForcedLayout.Clear();
}
bool PresShell::IsForcingLayoutForHiddenContent(const nsIFrame* aFrame) const {
return mHiddenContentInForcedLayout.Contains(aFrame->GetContent());
}