Bug 1648673 - Remove duplicate CSSOrderAwareFrameIteratorT typedefs in nsGridContainerFrame.h r=dholbert

* It's easier to maintain the type aliases of in one place, i.e.
CSSOrderAwareFrameIterator.h, and the iterator's header itself doesn't
include a lot of headers that add complex dependencies to
nsGridContainerFrame.h.

* Make "jump to definition" functionality in editors work
correctly (rather than just jumping to those declarations.)

Differential Revision: https://phabricator.services.mozilla.com/D81281
This commit is contained in:
Ting-Yu Lin 2020-06-26 16:51:40 +00:00
parent fcdb41af0e
commit 675da8e9a4
3 changed files with 8 additions and 19 deletions

View File

@ -262,10 +262,10 @@ class CSSOrderAwareFrameIteratorT {
#endif
};
typedef CSSOrderAwareFrameIteratorT<nsFrameList::iterator>
CSSOrderAwareFrameIterator;
typedef CSSOrderAwareFrameIteratorT<nsFrameList::reverse_iterator>
ReverseCSSOrderAwareFrameIterator;
using CSSOrderAwareFrameIterator =
CSSOrderAwareFrameIteratorT<nsFrameList::iterator>;
using ReverseCSSOrderAwareFrameIterator =
CSSOrderAwareFrameIteratorT<nsFrameList::reverse_iterator>;
} // namespace mozilla

View File

@ -16,7 +16,6 @@
#include "mozilla/AutoRestore.h"
#include "mozilla/ComputedStyle.h"
#include "mozilla/CSSAlignUtils.h"
#include "mozilla/CSSOrderAwareFrameIterator.h"
#include "mozilla/dom/GridBinding.h"
#include "mozilla/IntegerRange.h"
#include "mozilla/Maybe.h"

View File

@ -9,6 +9,7 @@
#ifndef nsGridContainerFrame_h___
#define nsGridContainerFrame_h___
#include "mozilla/CSSOrderAwareFrameIterator.h"
#include "mozilla/Maybe.h"
#include "mozilla/HashTable.h"
#include "nsContainerFrame.h"
@ -26,14 +27,6 @@ nsContainerFrame* NS_NewGridContainerFrame(mozilla::PresShell* aPresShell,
namespace mozilla {
// Forward-declare typedefs for grid item iterator helper-class:
template <typename Iterator>
class CSSOrderAwareFrameIteratorT;
typedef CSSOrderAwareFrameIteratorT<nsFrameList::iterator>
CSSOrderAwareFrameIterator;
typedef CSSOrderAwareFrameIteratorT<nsFrameList::reverse_iterator>
ReverseCSSOrderAwareFrameIterator;
/**
* The number of implicit / explicit tracks and their sizes.
*/
@ -319,9 +312,6 @@ class nsGridContainerFrame final : public nsContainerFrame {
typedef mozilla::LogicalPoint LogicalPoint;
typedef mozilla::LogicalRect LogicalRect;
typedef mozilla::LogicalSize LogicalSize;
typedef mozilla::CSSOrderAwareFrameIterator CSSOrderAwareFrameIterator;
typedef mozilla::ReverseCSSOrderAwareFrameIterator
ReverseCSSOrderAwareFrameIterator;
typedef mozilla::WritingMode WritingMode;
typedef nsLayoutUtils::IntrinsicISizeType IntrinsicISizeType;
struct Grid;
@ -403,7 +393,7 @@ class nsGridContainerFrame final : public nsContainerFrame {
eBoth = eFirst | eLast,
};
void CalculateBaselines(BaselineSet aBaselineSet,
CSSOrderAwareFrameIterator* aIter,
mozilla::CSSOrderAwareFrameIterator* aIter,
const nsTArray<GridItemInfo>* aGridItems,
const Tracks& aTracks, uint32_t aFragmentStartTrack,
uint32_t aFirstExcludedTrack, WritingMode aWM,
@ -425,7 +415,7 @@ class nsGridContainerFrame final : public nsContainerFrame {
* axis as aMajor. Pass zero if that's not the axis we're fragmenting in.
*/
static FindItemInGridOrderResult FindFirstItemInGridOrder(
CSSOrderAwareFrameIterator& aIter,
mozilla::CSSOrderAwareFrameIterator& aIter,
const nsTArray<GridItemInfo>& aGridItems, LineRange GridArea::*aMajor,
LineRange GridArea::*aMinor, uint32_t aFragmentStartTrack);
/**
@ -437,7 +427,7 @@ class nsGridContainerFrame final : public nsContainerFrame {
* Pass the number of tracks if that's not the axis we're fragmenting in.
*/
static FindItemInGridOrderResult FindLastItemInGridOrder(
ReverseCSSOrderAwareFrameIterator& aIter,
mozilla::ReverseCSSOrderAwareFrameIterator& aIter,
const nsTArray<GridItemInfo>& aGridItems, LineRange GridArea::*aMajor,
LineRange GridArea::*aMinor, uint32_t aFragmentStartTrack,
uint32_t aFirstExcludedTrack);