mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 959847. Part 11. Use nsLayoutUtils::ViewportHasDisplayPort instead of repeating boilerplate code. r=roc
This commit is contained in:
parent
c98b478ef2
commit
00358747ba
@ -3494,9 +3494,9 @@ nsDisplaySubDocument::BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
nsRect
|
||||
nsDisplaySubDocument::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
|
||||
{
|
||||
nsIFrame* rootScrollFrame = mFrame->PresContext()->PresShell()->GetRootScrollFrame();
|
||||
nsIContent* content = rootScrollFrame ? rootScrollFrame->GetContent() : nullptr;
|
||||
bool usingDisplayPort = content && nsLayoutUtils::GetDisplayPort(content);
|
||||
bool usingDisplayPort =
|
||||
nsLayoutUtils::ViewportHasDisplayPort(mFrame->PresContext());
|
||||
|
||||
if ((mFlags & GENERATE_SCROLLABLE_LAYER) && usingDisplayPort) {
|
||||
*aSnap = false;
|
||||
return mFrame->GetRect() + aBuilder->ToReferenceFrame(mFrame);
|
||||
@ -3510,11 +3510,9 @@ nsDisplaySubDocument::ComputeVisibility(nsDisplayListBuilder* aBuilder,
|
||||
nsRegion* aVisibleRegion,
|
||||
const nsRect& aAllowVisibleRegionExpansion)
|
||||
{
|
||||
nsIFrame* rootScrollFrame = mFrame->PresContext()->PresShell()->GetRootScrollFrame();
|
||||
nsIContent* content = rootScrollFrame ? rootScrollFrame->GetContent() : nullptr;
|
||||
nsRect displayport;
|
||||
bool usingDisplayPort = content &&
|
||||
nsLayoutUtils::GetDisplayPort(content, &displayport);
|
||||
bool usingDisplayPort =
|
||||
nsLayoutUtils::ViewportHasDisplayPort(mFrame->PresContext(), &displayport);
|
||||
|
||||
if (!(mFlags & GENERATE_SCROLLABLE_LAYER) || !usingDisplayPort) {
|
||||
return nsDisplayWrapList::ComputeVisibility(aBuilder, aVisibleRegion,
|
||||
@ -3542,9 +3540,9 @@ nsDisplaySubDocument::ComputeVisibility(nsDisplayListBuilder* aBuilder,
|
||||
bool
|
||||
nsDisplaySubDocument::ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBuilder)
|
||||
{
|
||||
nsIFrame* rootScrollFrame = mFrame->PresContext()->PresShell()->GetRootScrollFrame();
|
||||
nsIContent* content = rootScrollFrame ? rootScrollFrame->GetContent() : nullptr;
|
||||
bool usingDisplayPort = content && nsLayoutUtils::GetDisplayPort(content);
|
||||
bool usingDisplayPort =
|
||||
nsLayoutUtils::ViewportHasDisplayPort(mFrame->PresContext());
|
||||
|
||||
if ((mFlags & GENERATE_SCROLLABLE_LAYER) && usingDisplayPort) {
|
||||
return true;
|
||||
}
|
||||
@ -3555,9 +3553,9 @@ nsDisplaySubDocument::ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBui
|
||||
nsRegion
|
||||
nsDisplaySubDocument::GetOpaqueRegion(nsDisplayListBuilder* aBuilder, bool* aSnap)
|
||||
{
|
||||
nsIFrame* rootScrollFrame = mFrame->PresContext()->PresShell()->GetRootScrollFrame();
|
||||
nsIContent* content = rootScrollFrame ? rootScrollFrame->GetContent() : nullptr;
|
||||
bool usingDisplayPort = content && nsLayoutUtils::GetDisplayPort(content);
|
||||
bool usingDisplayPort =
|
||||
nsLayoutUtils::ViewportHasDisplayPort(mFrame->PresContext());
|
||||
|
||||
if ((mFlags & GENERATE_SCROLLABLE_LAYER) && usingDisplayPort) {
|
||||
*aSnap = false;
|
||||
return nsRegion();
|
||||
|
@ -376,10 +376,8 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
bool ignoreViewportScrolling = false;
|
||||
nsIFrame* savedIgnoreScrollFrame = nullptr;
|
||||
if (subdocRootFrame) {
|
||||
nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame();
|
||||
nsIContent* content = rootScrollFrame ? rootScrollFrame->GetContent() : nullptr;
|
||||
nsRect displayPort;
|
||||
if (content && nsLayoutUtils::GetDisplayPort(content, &displayPort)) {
|
||||
if (nsLayoutUtils::ViewportHasDisplayPort(presContext, &displayPort)) {
|
||||
haveDisplayPort = true;
|
||||
dirty = displayPort;
|
||||
} else {
|
||||
@ -389,6 +387,7 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
dirty = dirty.ConvertAppUnitsRoundOut(parentAPD, subdocAPD);
|
||||
}
|
||||
|
||||
nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame();
|
||||
ignoreViewportScrolling =
|
||||
rootScrollFrame && presShell->IgnoringViewportScrolling();
|
||||
if (ignoreViewportScrolling) {
|
||||
|
Loading…
Reference in New Issue
Block a user