From 528abd534ef3e785d4a926a235e58f5c5179aef5 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 29 Apr 2020 12:36:53 +0000 Subject: Issue #80 - De-unify layout/base --- layout/base/MaskLayerImageCache.h | 1 + layout/base/MobileViewportManager.h | 3 +++ layout/base/RestyleManager.cpp | 7 +------ layout/base/RestyleManager.h | 6 ++++++ layout/base/RestyleManagerBase.cpp | 18 ++++++++++++++++++ layout/base/ServoRestyleManager.cpp | 1 + layout/base/TouchManager.cpp | 2 ++ layout/base/moz.build | 11 +++-------- layout/base/nsFrameTraversal.cpp | 1 + layout/base/nsLayoutUtils.cpp | 1 + layout/base/nsPresShell.cpp | 6 +++++- layout/svg/nsISVGChildFrame.h | 1 + 12 files changed, 43 insertions(+), 15 deletions(-) (limited to 'layout') diff --git a/layout/base/MaskLayerImageCache.h b/layout/base/MaskLayerImageCache.h index b18fe5aa15..61881de834 100644 --- a/layout/base/MaskLayerImageCache.h +++ b/layout/base/MaskLayerImageCache.h @@ -10,6 +10,7 @@ #include "nsAutoPtr.h" #include "nsPresContext.h" #include "mozilla/gfx/Matrix.h" +#include "mozilla/layers/ShadowLayers.h" namespace mozilla { diff --git a/layout/base/MobileViewportManager.h b/layout/base/MobileViewportManager.h index 63128b2817..6324a8645f 100644 --- a/layout/base/MobileViewportManager.h +++ b/layout/base/MobileViewportManager.h @@ -7,8 +7,11 @@ #define MobileViewportManager_h_ #include "mozilla/Maybe.h" +#include "nsIDocument.h" #include "nsIDOMEventListener.h" +#include "nsIDOMEventTarget.h" #include "nsIObserver.h" +#include "nsViewportInfo.h" #include "Units.h" class nsIDOMEventTarget; diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index 124b5535e0..a5a4e1237f 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -239,11 +239,6 @@ RestyleManager::AnimationsWithDestroyedFrame::StopAnimationsWithoutFrame( } } -static inline dom::Element* -ElementForStyleContext(nsIContent* aParentContent, - nsIFrame* aFrame, - CSSPseudoElementType aPseudoType); - // Forwarded nsIDocumentObserver method, to handle restyling (and // passing the notification to the frame). nsresult @@ -1008,7 +1003,7 @@ RestyleManager::TryInitiatingTransition(nsPresContext* aPresContext, return *aNewStyleContext != sc; } -static dom::Element* +dom::Element* ElementForStyleContext(nsIContent* aParentContent, nsIFrame* aFrame, CSSPseudoElementType aPseudoType) diff --git a/layout/base/RestyleManager.h b/layout/base/RestyleManager.h index e22fe90581..4886d77bcb 100644 --- a/layout/base/RestyleManager.h +++ b/layout/base/RestyleManager.h @@ -191,6 +191,7 @@ public: MOZ_ASSERT(false, "unexpected aPseudoType"); return nullptr; } + private: RestyleManager* mRestyleManager; AutoRestore mRestorePointer; @@ -880,6 +881,11 @@ private: AutoTArray mAncestors; }; +dom::Element* +ElementForStyleContext(nsIContent* aParentContent, + nsIFrame* aFrame, + CSSPseudoElementType aPseudoType); + } // namespace mozilla #endif /* mozilla_RestyleManager_h */ diff --git a/layout/base/RestyleManagerBase.cpp b/layout/base/RestyleManagerBase.cpp index 6ef048a19e..e2145934bd 100644 --- a/layout/base/RestyleManagerBase.cpp +++ b/layout/base/RestyleManagerBase.cpp @@ -5,8 +5,26 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/RestyleManagerBase.h" +#include "mozilla/RestyleManager.h" #include "mozilla/StyleSetHandle.h" +#include "mozilla/StyleSetHandleInlines.h" // for Ptr::HasStateDependentStyle +#include "ActiveLayerTracker.h" +#include "nsCSSFrameConstructor.h" +#include "nsCSSRendering.h" #include "nsIFrame.h" +#include "nsIFrameInlines.h" // for IsAbsPosContainingBlock +#include "nsPlaceholderFrame.h" +#include "nsStyleChangeList.h" +#include "nsStyleStructInlines.h" // for HasTransform +#include "nsSVGEffects.h" +#include "nsSVGIntegrationUtils.h" +#include "nsSVGUtils.h" +#include "nsViewportFrame.h" +#include "StickyScrollContainer.h" +#include "SVGTextFrame.h" + +using namespace mozilla; +using namespace mozilla::layers; namespace mozilla { diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index 42ca23bb10..82c81ea469 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -9,6 +9,7 @@ #include "mozilla/ServoStyleSet.h" #include "mozilla/dom/ChildIterator.h" #include "nsContentUtils.h" +#include "nsCSSFrameConstructor.h" #include "nsPrintfCString.h" #include "nsStyleChangeList.h" diff --git a/layout/base/TouchManager.cpp b/layout/base/TouchManager.cpp index 5167ca588f..e7972d5af5 100644 --- a/layout/base/TouchManager.cpp +++ b/layout/base/TouchManager.cpp @@ -12,6 +12,8 @@ #include "nsPresShell.h" #include "nsView.h" +using namespace mozilla::dom; + namespace mozilla { nsDataHashtable* TouchManager::sCaptureTouchList; diff --git a/layout/base/moz.build b/layout/base/moz.build index afc683665a..f115280ce5 100644 --- a/layout/base/moz.build +++ b/layout/base/moz.build @@ -119,7 +119,7 @@ EXPORTS.mozilla += [ 'StaticPresData.h', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'AccessibleCaret.cpp', 'AccessibleCaretEventHub.cpp', 'AccessibleCaretManager.cpp', @@ -151,9 +151,11 @@ UNIFIED_SOURCES += [ 'nsLayoutDebugger.cpp', 'nsLayoutHistoryState.cpp', 'nsLayoutUtils.cpp', + 'nsPresArena.cpp', 'nsPresContext.cpp', 'nsPresShell.cpp', 'nsQuoteList.cpp', + 'nsRefreshDriver.cpp', 'nsStyleChangeList.cpp', 'nsStyleSheetService.cpp', 'PaintTracker.cpp', @@ -169,13 +171,6 @@ UNIFIED_SOURCES += [ 'ZoomConstraintsClient.cpp', ] -# nsPresArena.cpp needs to be built separately because it uses plarena.h. -# nsRefreshDriver.cpp needs to be built separately because of name clashes in the OS X headers -SOURCES += [ - 'nsPresArena.cpp', - 'nsRefreshDriver.cpp', -] - if CONFIG['ENABLE_TESTS']: DIRS += ['gtest'] diff --git a/layout/base/nsFrameTraversal.cpp b/layout/base/nsFrameTraversal.cpp index 40fb5ff30c..ab07d07df3 100644 --- a/layout/base/nsFrameTraversal.cpp +++ b/layout/base/nsFrameTraversal.cpp @@ -10,6 +10,7 @@ #include "nsPlaceholderFrame.h" #include "nsContainerFrame.h" +using namespace mozilla; class nsFrameIterator : public nsIFrameEnumerator { diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 21d20c69fa..04ac9ef527 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -118,6 +118,7 @@ #include "mozilla/StyleSetHandleInlines.h" #include "RegionBuilder.h" #include "SVGSVGElement.h" +#include "nsDocument.h" #ifdef MOZ_XUL #include "nsXULPopupManager.h" diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 264b52b18d..2615bbc490 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -58,6 +58,7 @@ #include "nsNameSpaceManager.h" // for Pref-related rule management (bugs 22963,20760,31816) #include "nsFrame.h" #include "FrameLayerBuilder.h" +#include "FrameMetrics.h" // for ViewID #include "nsViewManager.h" #include "nsView.h" #include "nsCRTGlue.h" @@ -162,11 +163,12 @@ #endif -#include "mozilla/layers/CompositorBridgeChild.h" #include "GeckoProfiler.h" #include "gfxPlatform.h" #include "Layers.h" #include "LayerTreeInvalidation.h" +#include "ClientLayerManager.h" +#include "mozilla/layers/CompositorBridgeChild.h" #include "mozilla/css/ImageLoader.h" #include "mozilla/dom/DocumentTimeline.h" #include "mozilla/Preferences.h" @@ -221,6 +223,8 @@ using namespace mozilla::gfx; using namespace mozilla::layout; using PaintFrameFlags = nsLayoutUtils::PaintFrameFlags; +typedef FrameMetrics::ViewID ViewID; + CapturingContentInfo nsIPresShell::gCaptureInfo = { false /* mAllowed */, false /* mPointerLock */, false /* mRetargetToElement */, false /* mPreventDrag */ }; diff --git a/layout/svg/nsISVGChildFrame.h b/layout/svg/nsISVGChildFrame.h index c9fd0f12ae..f74ff89c04 100644 --- a/layout/svg/nsISVGChildFrame.h +++ b/layout/svg/nsISVGChildFrame.h @@ -8,6 +8,7 @@ #include "gfxRect.h" #include "nsQueryFrame.h" +#include "imgIContainer.h" class gfxContext; class gfxMatrix; -- cgit v1.2.3