Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / layout / style / DocumentStyleRootIterator.h
blob84f48d02d74a1d8372ee680b530ef45c1253c413
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DocumentStyleRootIterator_h
8 #define DocumentStyleRootIterator_h
10 #include "nsTArray.h"
12 class nsIContent;
14 class nsINode;
16 namespace mozilla {
18 namespace dom {
19 class Element;
20 } // namespace dom
22 /**
23 * DocumentStyleRootIterator traverses the roots of the document from the
24 * perspective of the Servo-backed style system. In the general case, this
25 * will first traverse the document root, followed by any document level
26 * native anonymous content.
28 * If the caller passes an element to the constructor rather than the document,
29 * that element (and nothing else) is returned from GetNextStyleRoot.
31 class DocumentStyleRootIterator {
32 public:
33 explicit DocumentStyleRootIterator(nsINode* aStyleRoot);
34 MOZ_COUNTED_DTOR(DocumentStyleRootIterator)
36 dom::Element* GetNextStyleRoot();
38 private:
39 AutoTArray<nsIContent*, 8> mStyleRoots;
40 uint32_t mPosition;
43 } // namespace mozilla
45 #endif // DocumentStyleRootIterator_h