author | Cameron McCormack <cam@mcc.id.au> |
Fri, 07 Feb 2014 14:08:49 +1100 | |
changeset 184611 | 3c925e73a1d0184420c3f57e9a5736addc6c5b4a |
parent 184610 | d7c466f72d2a1d1dafc7c4d591b1100a8494f141 |
child 184612 | 3b87641dd2f831b85c796fec38a078e787c46866 |
push id | 3503 |
push user | raliiev@mozilla.com |
push date | Mon, 28 Apr 2014 18:51:11 +0000 |
treeherder | mozilla-beta@c95ac01e332e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | roc |
bugs | 969099 |
milestone | 30.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -2891,17 +2891,17 @@ nsDocShell::SetItemType(int32_t aItemTyp mItemType = aItemType; // disable auth prompting for anything but content mAllowAuth = mItemType == typeContent; nsRefPtr<nsPresContext> presContext = nullptr; GetPresContext(getter_AddRefs(presContext)); if (presContext) { - presContext->InvalidateIsChromeCache(); + presContext->UpdateIsChrome(); } return NS_OK; } NS_IMETHODIMP nsDocShell::GetParent(nsIDocShellTreeItem ** aParent) {
--- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -1545,17 +1545,17 @@ nsPresContext::ScreenWidthInchesForFontI void nsPresContext::SetContainer(nsIDocShell* aDocShell) { if (aDocShell) { mContainer = static_cast<nsDocShell*>(aDocShell)->asWeakPtr(); } else { mContainer = WeakPtr<nsDocShell>(); } - InvalidateIsChromeCache(); + UpdateIsChrome(); if (mContainer) { GetDocumentColorPreferences(); } } nsISupports* nsPresContext::GetContainerWeakInternal() const { @@ -2038,29 +2038,21 @@ void nsPresContext::CountReflows(const char * aName, nsIFrame * aFrame) { if (mShell) { mShell->CountReflows(aName, aFrame); } } #endif -bool -nsPresContext::IsChromeSlow() const +void +nsPresContext::UpdateIsChrome() { mIsChrome = mContainer && nsIDocShellTreeItem::typeChrome == mContainer->ItemType(); - mIsChromeIsCached = true; - return mIsChrome; -} - -void -nsPresContext::InvalidateIsChromeCacheExternal() -{ - InvalidateIsChromeCacheInternal(); } /* virtual */ bool nsPresContext::HasAuthorSpecifiedRules(nsIFrame *aFrame, uint32_t ruleTypeMask) const { return nsRuleNode::HasAuthorSpecifiedRules(aFrame->StyleContext(), ruleTypeMask,
--- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -808,30 +808,18 @@ public: gfxTextPerfMetrics *GetTextPerfMetrics() { return mTextPerf; } bool IsDynamic() { return (mType == eContext_PageLayout || mType == eContext_Galley); } bool IsScreen() { return (mMedium == nsGkAtoms::screen || mType == eContext_PageLayout || mType == eContext_PrintPreview); } // Is this presentation in a chrome docshell? - bool IsChrome() const - { - return mIsChromeIsCached ? mIsChrome : IsChromeSlow(); - } - - virtual void InvalidateIsChromeCacheExternal(); - void InvalidateIsChromeCacheInternal() { mIsChromeIsCached = false; } -#ifdef MOZILLA_INTERNAL_API - void InvalidateIsChromeCache() - { InvalidateIsChromeCacheInternal(); } -#else - void InvalidateIsChromeCache() - { InvalidateIsChromeCacheExternal(); } -#endif + bool IsChrome() const { return mIsChrome; } + void UpdateIsChrome(); // Public API for native theme code to get style internals. virtual bool HasAuthorSpecifiedRules(nsIFrame *aFrame, uint32_t ruleTypeMask) const; // Is it OK to let the page specify colors and backgrounds? bool UseDocumentColors() const { return GetCachedBoolPref(kPresContext_UseDocumentColors) || IsChrome(); } @@ -1309,21 +1297,17 @@ protected: unsigned mIsVisual : 1; unsigned mProcessingRestyles : 1; unsigned mProcessingAnimationStyleChange : 1; unsigned mFireAfterPaintEvents : 1; - // Cache whether we are chrome or not because it is expensive. - // mIsChromeIsCached tells us if mIsChrome is valid or we need to get the - // value the slow way. - mutable unsigned mIsChromeIsCached : 1; - mutable unsigned mIsChrome : 1; + unsigned mIsChrome : 1; // Should we paint flash in this context? Do not use this variable directly. // Use GetPaintFlashing() method instead. mutable unsigned mPaintFlashing : 1; mutable unsigned mPaintFlashingInitialized : 1; #ifdef DEBUG bool mInitialized;