Bug 1451971 - Rebuild the whole page when we have perspective or preserve-3d. r?miko
MozReview-Commit-ID: 2SkKvpdLWMi
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2839,27 +2839,27 @@ nsIFrame::BuildDisplayListForStackingCon
// Save dirty rect on the builder to avoid being distorted for
// multiple transforms along the chain.
aBuilder->SavePreserves3DRect();
// We rebuild everything within preserve-3d and don't try
// to retain, so override the dirty rect now.
if (aBuilder->IsRetainingDisplayList()) {
dirtyRect = visibleRect;
- aBuilder->MarkFrameModifiedDuringBuilding(this);
+ aBuilder->SetDisablePartialUpdates(true);
}
}
// nsDisplayPerspective items use an index to keep their PerFrameKey unique.
// We need to make sure we build all of them for them to be consistent, so
// rebuild all items if we have perspective. Bug 1431249 should remove
// this requirement.
if (aBuilder->IsRetainingDisplayList() && childrenHavePerspective) {
dirtyRect = visibleRect;
- aBuilder->MarkFrameModifiedDuringBuilding(this);
+ aBuilder->SetDisablePartialUpdates(true);
}
// reset blend mode so we can keep track if this stacking context needs have
// a nsDisplayBlendContainer. Set the blend mode back when the routine exits
// so we keep track if the parent stacking context needs a container too.
AutoSaveRestoreContainsBlendMode autoRestoreBlendMode(*aBuilder);
aBuilder->SetContainsBlendMode(false);
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -3194,17 +3194,17 @@ ScrollFrameHelper::AppendScrollPartsTo(n
appendToTopFlags |= APPEND_OWN_LAYER;
}
if (aPositioned) {
appendToTopFlags |= APPEND_POSITIONED;
}
if (overlayScrollbars ||
scrollParts[i] == mResizerBox) {
appendToTopFlags |= APPEND_OVERLAY;
- aBuilder->SetBuiltOverlayScrollbars(true);
+ aBuilder->SetDisablePartialUpdates(true);
}
{
nsDisplayListBuilder::AutoBuildingDisplayList
buildingForChild(aBuilder, scrollParts[i],
visible + mOuter->GetOffsetTo(scrollParts[i]),
dirty + mOuter->GetOffsetTo(scrollParts[i]), true);
nsDisplayListBuilder::AutoCurrentScrollbarInfoSetter
--- a/layout/painting/RetainedDisplayListBuilder.cpp
+++ b/layout/painting/RetainedDisplayListBuilder.cpp
@@ -996,19 +996,19 @@ RetainedDisplayListBuilder::AttemptParti
// Do not allow partial builds if the retained display list is empty, or if
// ShouldBuildPartial heuristic fails.
bool shouldBuildPartial = !mList.IsEmpty() && ShouldBuildPartial(modifiedFrames.Frames());
// We don't support retaining with overlay scrollbars, since they require
// us to look at the display list and pick the highest z-index, which
// we can't do during partial building.
- if (mBuilder.BuiltOverlayScrollbars()) {
+ if (mBuilder.DisablePartialUpdates()) {
shouldBuildPartial = false;
- mBuilder.SetBuiltOverlayScrollbars(false);
+ mBuilder.SetDisablePartialUpdates(false);
}
if (mPreviousCaret != mBuilder.GetCaretFrame()) {
if (mPreviousCaret) {
if (mBuilder.MarkFrameModifiedDuringBuilding(mPreviousCaret)) {
modifiedFrames.Frames().AppendElement(mPreviousCaret);
}
}
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -999,17 +999,17 @@ nsDisplayListBuilder::nsDisplayListBuild
mWindowDraggingAllowed(false),
mIsBuildingForPopup(nsLayoutUtils::IsPopup(aReferenceFrame)),
mForceLayerForScrollParent(false),
mAsyncPanZoomEnabled(nsLayoutUtils::AsyncPanZoomEnabled(aReferenceFrame)),
mBuildingInvisibleItems(false),
mHitTestIsForVisibility(false),
mIsBuilding(false),
mInInvalidSubtree(false),
- mBuiltOverlayScrollbars(false)
+ mDisablePartialUpdates(false)
{
MOZ_COUNT_CTOR(nsDisplayListBuilder);
const bool useWRHitTest =
gfxPrefs::WebRenderHitTest() && gfxVars::UseWebRender();
mBuildCompositorHitTestInfo = mAsyncPanZoomEnabled && IsForPainting() &&
(useWRHitTest || gfxPrefs::SimpleEventRegionItems());
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -835,18 +835,18 @@ public:
void SetInTransform(bool aInTransform) { mInTransform = aInTransform; }
/**
* Return true if we're currently building a display list for a
* nested presshell.
*/
bool IsInSubdocument() { return mPresShellStates.Length() > 1; }
- void SetBuiltOverlayScrollbars(bool aOverlayScrollbars) { mBuiltOverlayScrollbars = aOverlayScrollbars; }
- bool BuiltOverlayScrollbars() { return mBuiltOverlayScrollbars; }
+ void SetDisablePartialUpdates(bool aDisable) { mDisablePartialUpdates = aDisable; }
+ bool DisablePartialUpdates() { return mDisablePartialUpdates; }
/**
* Return true if we're currently building a display list for the presshell
* of a chrome document, or if we're building the display list for a popup.
*/
bool IsInChromeDocumentOrPopup() {
return mIsInChromePresContext || mIsBuildingForPopup;
}
@@ -2008,17 +2008,17 @@ private:
bool mForceLayerForScrollParent;
bool mAsyncPanZoomEnabled;
bool mBuildingInvisibleItems;
bool mHitTestIsForVisibility;
bool mIsBuilding;
bool mInInvalidSubtree;
bool mBuildCompositorHitTestInfo;
bool mLessEventRegionItems;
- bool mBuiltOverlayScrollbars;
+ bool mDisablePartialUpdates;
};
class nsDisplayItem;
class nsDisplayList;
class RetainedDisplayList;
/**
* nsDisplayItems are put in singly-linked lists rooted in an nsDisplayList.
* nsDisplayItemLink holds the link. The lists are linked from lowest to