зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1024082: Remove PresShell::FrameManager(), use PresShell::FrameConstructor instead. r=dholbert
Unfortunately this means that we need to export a couple more headers, but that should be ok. In particular, we have to export some headers that are #included by nsCSSFrameConstructor.h, because nsCSSFrameConstructor.h itself will now be included in more places outside of layout/, by .cpp files that don't necessarily have the ability to indirectly #include its other headers, unless we export them. MozReview-Commit-ID: 2n9KHW6Yjrd
This commit is contained in:
Родитель
043503a6d4
Коммит
c976615ed6
|
@ -19,8 +19,9 @@
|
|||
#include "mozilla/dom/Flex.h"
|
||||
#include "mozilla/dom/Grid.h"
|
||||
#include "mozilla/gfx/Matrix.h"
|
||||
#include "nsDOMAttributeMap.h"
|
||||
#include "nsAtom.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsDOMAttributeMap.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "mozilla/dom/NodeInfo.h"
|
||||
#include "nsIDocumentInlines.h"
|
||||
|
@ -30,7 +31,6 @@
|
|||
#include "nsIContentIterator.h"
|
||||
#include "nsFlexContainerFrame.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIURL.h"
|
||||
|
@ -1249,7 +1249,7 @@ Element::AttachShadowInternal(ShadowRootMode aMode, ErrorResult& aError)
|
|||
if (nsIDocument* doc = GetComposedDoc()) {
|
||||
if (nsIPresShell* shell = doc->GetShell()) {
|
||||
shell->DestroyFramesForAndRestyle(this);
|
||||
MOZ_ASSERT(!shell->FrameManager()->GetDisplayContentsStyleFor(this));
|
||||
MOZ_ASSERT(!shell->FrameConstructor()->GetDisplayContentsStyleFor(this));
|
||||
}
|
||||
}
|
||||
MOZ_ASSERT(!GetPrimaryFrame());
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsString.h"
|
||||
#ifdef MOZ_OLD_STYLE
|
||||
|
@ -25,7 +26,6 @@
|
|||
#include "nsIURI.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsStyleContext.h"
|
||||
#include "nsXBLPrototypeBinding.h"
|
||||
#ifdef MOZ_OLD_STYLE
|
||||
|
@ -272,10 +272,10 @@ nsXBLResourceLoader::NotifyBoundElements()
|
|||
if (!childFrame) {
|
||||
// Check if it's in the display:none or display:contents maps.
|
||||
nsStyleContext* sc =
|
||||
shell->FrameManager()->GetDisplayNoneStyleFor(content);
|
||||
shell->FrameConstructor()->GetDisplayNoneStyleFor(content);
|
||||
|
||||
if (!sc) {
|
||||
sc = shell->FrameManager()->GetDisplayContentsStyleFor(content);
|
||||
sc = shell->FrameConstructor()->GetDisplayContentsStyleFor(content);
|
||||
}
|
||||
|
||||
if (!sc) {
|
||||
|
|
|
@ -3665,7 +3665,7 @@ AutoDisplayContentsAncestorPusher::AutoDisplayContentsAncestorPusher(
|
|||
, mPresContext(aPresContext)
|
||||
{
|
||||
if (aParent) {
|
||||
nsFrameManager* fm = mPresContext->FrameManager();
|
||||
nsFrameManager* fm = mPresContext->FrameConstructor();
|
||||
// Push display:contents mAncestors onto mTreeMatchContext.
|
||||
for (nsIContent* p = aParent; p && fm->GetDisplayContentsStyleFor(p);
|
||||
p = p->GetParent()) {
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "RestyleTracker.h"
|
||||
|
||||
#include "GeckoProfiler.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsStyleChangeList.h"
|
||||
|
@ -311,7 +311,7 @@ RestyleTracker::DoProcessRestyles()
|
|||
(element->GetFlattenedTreeParent() &&
|
||||
(!element->GetFlattenedTreeParent()->GetPrimaryFrame() ||
|
||||
element->GetFlattenedTreeParent()->GetPrimaryFrame()->IsLeaf() ||
|
||||
element->GetComposedDoc()->GetShell()->FrameManager()
|
||||
element->GetComposedDoc()->GetShell()->FrameConstructor()
|
||||
->GetDisplayContentsStyleFor(element))) ||
|
||||
// Or not reachable due to an async reinsert we have
|
||||
// pending? If so, we'll have a reframe hint around.
|
||||
|
|
|
@ -43,9 +43,11 @@ EXPORTS += [
|
|||
'nsCaret.h',
|
||||
'nsChangeHint.h',
|
||||
'nsCompatibility.h',
|
||||
'nsCounterManager.h',
|
||||
'nsCSSFrameConstructor.h',
|
||||
'nsFrameManager.h',
|
||||
'nsFrameTraversal.h',
|
||||
'nsGenConList.h',
|
||||
'nsIFrameTraversal.h',
|
||||
'nsILayoutDebugger.h',
|
||||
'nsIPercentBSizeObserver.h',
|
||||
|
@ -57,6 +59,7 @@ EXPORTS += [
|
|||
'nsPresArenaObjectList.h',
|
||||
'nsPresContext.h',
|
||||
'nsPresState.h',
|
||||
'nsQuoteList.h',
|
||||
'nsRefreshDriver.h',
|
||||
'nsStyleChangeList.h',
|
||||
'nsStyleSheetService.h',
|
||||
|
|
|
@ -1075,7 +1075,7 @@ nsFrameConstructorState::nsFrameConstructorState(
|
|||
already_AddRefed<nsILayoutHistoryState> aHistoryState)
|
||||
: mPresContext(aPresShell->GetPresContext()),
|
||||
mPresShell(aPresShell),
|
||||
mFrameManager(aPresShell->FrameManager()),
|
||||
mFrameManager(aPresShell->FrameConstructor()),
|
||||
#ifdef MOZ_XUL
|
||||
mPopupItems(nullptr),
|
||||
#endif
|
||||
|
|
|
@ -282,8 +282,6 @@ public:
|
|||
|
||||
nsCSSFrameConstructor* FrameConstructor() const { return mFrameConstructor; }
|
||||
|
||||
nsFrameManager* FrameManager() const { return mFrameManager; }
|
||||
|
||||
/* Enable/disable author style level. Disabling author style disables the entire
|
||||
* author level of the cascade, including the HTML preshint level.
|
||||
*/
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include "nsIDOMEvent.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsRegion.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsBidiPresUtils.h"
|
||||
#include "imgIContainer.h"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "base/basictypes.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIPresShellInlines.h"
|
||||
|
@ -34,7 +35,6 @@
|
|||
#include "nsHTMLDocument.h"
|
||||
#include "nsIWeakReferenceUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsViewManager.h"
|
||||
#ifdef MOZ_OLD_STYLE
|
||||
|
|
|
@ -231,9 +231,6 @@ public:
|
|||
return !!mPendingMediaFeatureValuesChange;
|
||||
}
|
||||
|
||||
nsFrameManager* FrameManager()
|
||||
{ return PresShell()->FrameManager(); }
|
||||
|
||||
nsCSSFrameConstructor* FrameConstructor()
|
||||
{ return PresShell()->FrameConstructor(); }
|
||||
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
*/
|
||||
|
||||
#include "nsStyleChangeList.h"
|
||||
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsFrameManager.h"
|
||||
|
||||
void
|
||||
nsStyleChangeList::AppendChange(nsIFrame* aFrame, nsIContent* aContent, nsChangeHint aHint)
|
||||
|
@ -29,7 +30,7 @@ nsStyleChangeList::AppendChange(nsIFrame* aFrame, nsIContent* aContent, nsChange
|
|||
MOZ_ASSERT(!aContent || aContent->IsElement() ||
|
||||
// display:contents elements posts the changes for their children:
|
||||
(aFrame && aContent->GetParent() &&
|
||||
aFrame->PresContext()->FrameManager()->
|
||||
aFrame->PresContext()->FrameConstructor()->
|
||||
GetDisplayContentsStyleFor(aContent->GetParent())) ||
|
||||
(aContent->IsNodeOfType(nsINode::eTEXT) &&
|
||||
aContent->IsStyledByServo() &&
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#include "nsIPresShell.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "LayoutLogging.h"
|
||||
#ifdef MOZ_OLD_STYLE
|
||||
|
@ -9920,7 +9919,7 @@ nsFrame::DoGetParentStyleContext(nsIFrame** aProviderFrame) const
|
|||
/* if next is true then it's really a request for the table frame's
|
||||
parent context, see nsTable[Outer]Frame::GetParentStyleContext. */
|
||||
pseudo == nsCSSAnonBoxes::tableWrapper) {
|
||||
nsFrameManager* fm = PresContext()->FrameManager();
|
||||
nsCSSFrameConstructor* fm = PresContext()->FrameConstructor();
|
||||
nsStyleContext* sc = fm->GetDisplayContentsStyleFor(parentContent);
|
||||
if (MOZ_UNLIKELY(sc)) {
|
||||
return sc;
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include "nsTextFragment.h"
|
||||
#include <algorithm>
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIFrameTraversal.h"
|
||||
|
@ -1602,7 +1603,7 @@ nsFrameSelection::GetFrameForNodeOffset(nsIContent* aNode,
|
|||
return nullptr;
|
||||
|
||||
if (!aNode->GetPrimaryFrame() &&
|
||||
!mShell->FrameManager()->GetDisplayContentsStyleFor(aNode)) {
|
||||
!mShell->FrameConstructor()->GetDisplayContentsStyleFor(aNode)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
#include "gfxContext.h"
|
||||
#include "gfxUtils.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsDisplayList.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIFrameInlines.h"
|
||||
|
@ -190,7 +190,7 @@ nsPlaceholderFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostD
|
|||
if ((GetStateBits() & PLACEHOLDER_FOR_POPUP) ||
|
||||
!nsLayoutUtils::IsProperAncestorFrame(aDestructRoot, oof)) {
|
||||
ChildListID listId = ChildListIDForOutOfFlow(GetStateBits(), oof);
|
||||
nsFrameManager* fm = PresContext()->GetPresShell()->FrameManager();
|
||||
nsFrameManager* fm = PresContext()->FrameConstructor();
|
||||
fm->RemoveFrame(listId, oof);
|
||||
}
|
||||
// else oof will be destroyed by its parent
|
||||
|
@ -218,7 +218,7 @@ nsPlaceholderFrame::GetParentStyleContextForOutOfFlow(nsIFrame** aProviderFrame)
|
|||
nsIContent* parentContent = mContent ? mContent->GetFlattenedTreeParent() : nullptr;
|
||||
if (parentContent) {
|
||||
nsStyleContext* sc =
|
||||
PresContext()->FrameManager()->GetDisplayContentsStyleFor(parentContent);
|
||||
PresContext()->FrameConstructor()->GetDisplayContentsStyleFor(parentContent);
|
||||
if (sc) {
|
||||
*aProviderFrame = nullptr;
|
||||
return sc;
|
||||
|
|
Загрузка…
Ссылка в новой задаче