author | Timothy Nikkel <tnikkel@gmail.com> |
Sun, 11 Apr 2010 00:07:52 -0500 | |
changeset 40670 | a5009861bd1b4c01663aa01a4c219379b85178b8 |
parent 40652 | b4fcd21cb6e54755c4efb4fbe0cb53dfc71bf2d6 |
child 40671 | 820bf1a6374cef4e5be2cff60e0f20e7c319910b |
push id | 1 |
push user | root |
push date | Tue, 26 Apr 2011 22:38:44 +0000 |
treeherder | mozilla-beta@bfdb6e623a36 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 553359 |
milestone | 1.9.3a5pre |
backs out | b4fcd21cb6e54755c4efb4fbe0cb53dfc71bf2d6 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
|
--- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -2410,22 +2410,16 @@ nsDocShell::SetItemType(PRInt32 aItemTyp NS_ENSURE_STATE(!mParent || mParent == docLoaderService); mItemType = aItemType; // disable auth prompting for anything but content mAllowAuth = mItemType == typeContent; - nsRefPtr<nsPresContext> presContext = nsnull; - GetPresContext(getter_AddRefs(presContext)); - if (presContext) { - presContext->UpdateIsChromeCache(); - } - return NS_OK; } NS_IMETHODIMP nsDocShell::GetParent(nsIDocShellTreeItem ** aParent) { if (!mParent) { *aParent = nsnull;
--- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -1330,17 +1330,16 @@ nsPresContext::StopImagesFor(nsIFrame* a void nsPresContext::SetContainer(nsISupports* aHandler) { mContainer = do_GetWeakReference(aHandler); if (mContainer) { GetDocumentColorPreferences(); } - UpdateIsChromeCacheInternal(); } already_AddRefed<nsISupports> nsPresContext::GetContainerInternal() const { nsISupports *result = nsnull; if (mContainer) CallQueryReferent(mContainer.get(), &result); @@ -1620,39 +1619,33 @@ void nsPresContext::CountReflows(const char * aName, nsIFrame * aFrame) { if (mShell) { mShell->CountReflows(aName, aFrame); } } #endif -void -nsPresContext::UpdateIsChromeCacheInternal() +PRBool +nsPresContext::IsChrome() const { PRBool isChrome = PR_FALSE; nsCOMPtr<nsISupports> container = GetContainer(); if (container) { nsresult result; nsCOMPtr<nsIDocShellTreeItem> docShell(do_QueryInterface(container, &result)); if (NS_SUCCEEDED(result) && docShell) { PRInt32 docShellType; result = docShell->GetItemType(&docShellType); if (NS_SUCCEEDED(result)) { isChrome = nsIDocShellTreeItem::typeChrome == docShellType; } } } - mIsChrome = isChrome; -} - -void -nsPresContext::UpdateIsChromeCacheExternal() -{ - UpdateIsChromeCacheInternal(); + return isChrome; } /* virtual */ PRBool nsPresContext::HasAuthorSpecifiedRules(nsIFrame *aFrame, PRUint32 ruleTypeMask) const { return nsRuleNode::HasAuthorSpecifiedRules(aFrame->GetStyleContext(), ruleTypeMask,
--- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -805,27 +805,17 @@ public: const nscoord* GetBorderWidthTable() { return mBorderWidthTable; } PRBool IsDynamic() { return (mType == eContext_PageLayout || mType == eContext_Galley); } PRBool IsScreen() { return (mMedium == nsGkAtoms::screen || mType == eContext_PageLayout || mType == eContext_PrintPreview); } // Is this presentation in a chrome docshell? - PRBool IsChrome() const { return mIsChrome; } - - virtual void UpdateIsChromeCacheExternal(); - void UpdateIsChromeCacheInternal(); -#ifdef _IMPL_NS_LAYOUT - void UpdateIsChromeCache() - { UpdateIsChromeCacheInternal(); } -#else - void UpdateIsChromeCache() - { UpdateIsChromeCacheExternal(); } -#endif + PRBool IsChrome() const; // Public API for native theme code to get style internals. virtual PRBool HasAuthorSpecifiedRules(nsIFrame *aFrame, PRUint32 ruleTypeMask) const; // Is it OK to let the page specify colors and backgrounds? PRBool UseDocumentColors() const { return GetCachedBoolPref(kPresContext_UseDocumentColors) || IsChrome(); } @@ -1120,19 +1110,16 @@ protected: // the document rather than to change the document's dimensions unsigned mSupressResizeReflow : 1; unsigned mIsVisual : 1; unsigned mProcessingRestyles : 1; unsigned mProcessingAnimationStyleChange : 1; - // Cache whether we are chrome or not because it is expensive. - unsigned mIsChrome : 1; - #ifdef DEBUG PRBool mInitialized; #endif protected: virtual ~nsPresContext() NS_HIDDEN;