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
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 * a list of the recomputation that needs to be done in response to a
12 #ifndef nsStyleChangeList_h___
13 #define nsStyleChangeList_h___
15 #include "mozilla/Attributes.h"
17 #include "nsChangeHint.h"
24 struct nsStyleChangeData
{
25 nsIFrame
* mFrame
; // weak
26 nsCOMPtr
<nsIContent
> mContent
;
30 class nsStyleChangeList
: private AutoTArray
<nsStyleChangeData
, 10> {
31 typedef AutoTArray
<nsStyleChangeData
, 10> base_type
;
32 nsStyleChangeList(const nsStyleChangeList
&) = delete;
35 using base_type::begin
;
36 using base_type::Clear
;
38 using base_type::IsEmpty
;
39 using base_type::Length
;
40 using base_type::operator[];
42 MOZ_COUNTED_DEFAULT_CTOR(nsStyleChangeList
)
43 MOZ_COUNTED_DTOR(nsStyleChangeList
)
44 void AppendChange(nsIFrame
* aFrame
, nsIContent
* aContent
, nsChangeHint aHint
);
46 // Starting from the end of the list, removes all changes until the list is
47 // empty or an element with |mContent != aContent| is found.
48 void PopChangesForContent(nsIContent
* aContent
) {
49 while (!IsEmpty() && LastElement().mContent
== aContent
) {
55 #endif /* nsStyleChangeList_h___ */