Bug 1130892 - Allow vibrancy in popups from non-chrome prescontexts. r=roc

This commit is contained in:
Markus Stange 2015-02-09 13:24:51 -05:00
Родитель 8919ee56bb
Коммит ae23b9318a
2 изменённых файлов: 15 добавлений и 10 удалений

Просмотреть файл

@ -582,7 +582,7 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
mAllowMergingAndFlattening(true),
mWillComputePluginGeometry(false),
mInTransform(false),
mIsInRootChromeDocument(false),
mIsInChromePresContext(false),
mSyncDecodeImages(false),
mIsPaintingToWindow(false),
mIsCompositingCheap(false),
@ -590,7 +590,8 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
mAncestorHasTouchEventHandler(false),
mAncestorHasScrollEventHandler(false),
mHaveScrollableDisplayPort(false),
mWindowDraggingAllowed(false)
mWindowDraggingAllowed(false),
mIsBuildingForPopup(nsLayoutUtils::IsPopup(aReferenceFrame))
{
MOZ_COUNT_CTOR(nsDisplayListBuilder);
PL_InitArenaPool(&mPool, "displayListArena", 1024,
@ -1015,8 +1016,7 @@ nsDisplayListBuilder::EnterPresShell(nsIFrame* aReferenceFrame,
nsPresContext* pc = aReferenceFrame->PresContext();
pc->GetDocShell()->GetWindowDraggingAllowed(&mWindowDraggingAllowed);
mIsInRootChromeDocument = !IsInSubdocument() && pc->IsChrome();
mIsInChromePresContext = pc->IsChrome();
}
void
@ -1032,7 +1032,7 @@ nsDisplayListBuilder::LeavePresShell(nsIFrame* aReferenceFrame)
if (!mPresShellStates.IsEmpty()) {
nsPresContext* pc = CurrentPresContext();
pc->GetDocShell()->GetWindowDraggingAllowed(&mWindowDraggingAllowed);
mIsInRootChromeDocument = !IsInSubdocument() && pc->IsChrome();
mIsInChromePresContext = pc->IsChrome();
}
}
@ -2117,7 +2117,7 @@ static void
RegisterThemeGeometry(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
nsITheme::ThemeGeometryType aType)
{
if (aBuilder->IsInRootChromeDocument() && !aBuilder->IsInTransform()) {
if (aBuilder->IsInRootChromeDocumentOrPopup() && !aBuilder->IsInTransform()) {
nsIFrame* displayRoot = nsLayoutUtils::GetDisplayRootFrame(aFrame);
nsRect borderBox(aFrame->GetOffsetTo(displayRoot), aFrame->GetSize());
aBuilder->RegisterThemeGeometry(aType,
@ -2257,7 +2257,7 @@ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(nsDisplayListBuilder* aBuil
if (isThemed) {
nsITheme* theme = presContext->GetTheme();
if (theme->NeedToClearBackgroundBehindWidget(aFrame->StyleDisplay()->mAppearance) &&
aBuilder->IsInRootChromeDocument() && !aBuilder->IsInTransform()) {
aBuilder->IsInRootChromeDocumentOrPopup() && !aBuilder->IsInTransform()) {
bgItemList.AppendNewToTop(
new (aBuilder) nsDisplayClearBackground(aBuilder, aFrame));
}

Просмотреть файл

@ -432,9 +432,13 @@ public:
/**
* Return true if we're currently building a display list for the root
* presshell which is the presshell of a chrome document.
* presshell which is the presshell of a chrome document, or if we're
* building the display list for a popup and have not entered a subdocument
* inside that popup.
*/
bool IsInRootChromeDocument() { return mIsInRootChromeDocument; }
bool IsInRootChromeDocumentOrPopup() {
return (mIsInChromePresContext || mIsBuildingForPopup) && !IsInSubdocument();
}
/**
* @return true if images have been set to decode synchronously.
@ -911,7 +915,7 @@ private:
// True when we're building a display list that's directly or indirectly
// under an nsDisplayTransform
bool mInTransform;
bool mIsInRootChromeDocument;
bool mIsInChromePresContext;
bool mSyncDecodeImages;
bool mIsPaintingToWindow;
bool mIsCompositingCheap;
@ -923,6 +927,7 @@ private:
// which WantsAsyncScroll().
bool mHaveScrollableDisplayPort;
bool mWindowDraggingAllowed;
bool mIsBuildingForPopup;
};
class nsDisplayItem;