Bug 1667594 - Avoid including nsLayoutUtils.h in nsIFrame.h. r=emilio

The only thing in nsIFrame.h that was using it was the implementation
of a templated method, which could be moved to nsIFrameInlines.h.

Depends on D91504

Differential Revision: https://phabricator.services.mozilla.com/D91505
This commit is contained in:
Botond Ballo 2020-09-26 18:18:11 +00:00
parent 1976364433
commit 4e4819d795
7 changed files with 16 additions and 10 deletions

View File

@ -19,6 +19,7 @@
#include "nsIInterfaceRequestorUtils.h"
#include "nsIDocShell.h"
#include "nsIFrame.h"
#include "nsLayoutUtils.h"
#include "prtime.h"
namespace mozilla {

View File

@ -10,6 +10,7 @@
#include "mozilla/dom/EventTarget.h"
#include "mozilla/PresShell.h"
#include "nsIFrame.h"
#include "nsLayoutUtils.h"
#include "nsView.h"
#include "PositionedEventTargeting.h"

View File

@ -58,13 +58,13 @@
#include "mozilla/Result.h"
#include "mozilla/SmallPointerArray.h"
#include "mozilla/PresShell.h"
#include "mozilla/ToString.h"
#include "mozilla/WritingModes.h"
#include "nsDirection.h"
#include "nsFrameList.h"
#include "nsFrameState.h"
#include "mozilla/ReflowInput.h"
#include "nsITheme.h"
#include "nsLayoutUtils.h"
#include "nsQueryFrame.h"
#include "mozilla/ComputedStyle.h"
#include "nsStyleStruct.h"
@ -106,6 +106,7 @@ class nsISelectionController;
class nsBoxLayoutState;
class nsBoxLayout;
class nsILineIterator;
class nsDisplayItem;
class nsDisplayItemBase;
class nsDisplayListBuilder;
class nsDisplayListSet;
@ -5724,15 +5725,6 @@ template <bool IsLessThanOrEqual(nsIFrame*, nsIFrame*)>
return result;
}
template <bool IsLessThanOrEqual(nsIFrame*, nsIFrame*)>
/* static */ void nsIFrame::SortFrameList(nsFrameList& aFrameList) {
nsIFrame* head = MergeSort<IsLessThanOrEqual>(aFrameList.FirstChild());
aFrameList.Clear();
aFrameList = nsFrameList(head, nsLayoutUtils::GetLastSibling(head));
MOZ_ASSERT(IsFrameListSorted<IsLessThanOrEqual>(aFrameList),
"After we sort a frame list, it should be in sorted order...");
}
template <bool IsLessThanOrEqual(nsIFrame*, nsIFrame*)>
/* static */ bool nsIFrame::IsFrameListSorted(nsFrameList& aFrameList) {
if (aFrameList.IsEmpty()) {

View File

@ -265,4 +265,13 @@ mozilla::LogicalPoint nsIFrame::GetLogicalNormalPosition(
aContainerSize - mRect.Size());
}
template <bool IsLessThanOrEqual(nsIFrame*, nsIFrame*)>
/* static */ void nsIFrame::SortFrameList(nsFrameList& aFrameList) {
nsIFrame* head = MergeSort<IsLessThanOrEqual>(aFrameList.FirstChild());
aFrameList.Clear();
aFrameList = nsFrameList(head, nsLayoutUtils::GetLastSibling(head));
MOZ_ASSERT(IsFrameListSorted<IsLessThanOrEqual>(aFrameList),
"After we sort a frame list, it should be in sorted order...");
}
#endif

View File

@ -63,6 +63,7 @@
#include "nsGkAtoms.h"
#include "nsHTMLParts.h"
#include "nsIContent.h"
#include "nsIFrameInlines.h"
#include "nsIScrollableFrame.h"
#include "nsITheme.h"
#include "nsLayoutUtils.h"

View File

@ -12,6 +12,7 @@
#include "nsWindow.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/Likely.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/MiscEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/Telemetry.h"

View File

@ -10,6 +10,7 @@
#include "nsPrintfCString.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/Tools.h"
#include "gfx2DGlue.h"
#include "gfxPlatform.h"
#include "MozContainer.h"
#include "nsTArray.h"