gecko-dev/parser/html/nsHtml5PendingNotification.h
Ryan VanderMeulen 6626f074d4 Backed out 8 changesets (bug 959150) for Linux debug build bustage on a CLOSED TREE.
Backed out changeset 30bdc9b15e8e (bug 959150)
Backed out changeset 630e489aed30 (bug 959150)
Backed out changeset c6874004efe7 (bug 959150)
Backed out changeset ebc67518a962 (bug 959150)
Backed out changeset 14441e528582 (bug 959150)
Backed out changeset 8d0ae8bffb08 (bug 959150)
Backed out changeset 603b63c33e9a (bug 959150)
Backed out changeset 261e2d244c54 (bug 959150)
2014-03-05 15:26:07 -05:00

52 lines
1.2 KiB
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsHtml5PendingNotification_h
#define nsHtml5PendingNotification_h
#include "nsNodeUtils.h"
class nsHtml5TreeBuilder;
class nsHtml5PendingNotification {
public:
nsHtml5PendingNotification(nsIContent* aParent)
: mParent(aParent),
mChildCount(aParent->GetChildCount() - 1)
{
MOZ_COUNT_CTOR(nsHtml5PendingNotification);
}
~nsHtml5PendingNotification() {
MOZ_COUNT_DTOR(nsHtml5PendingNotification);
}
inline void Fire() {
nsNodeUtils::ContentAppended(mParent, mParent->GetChildAt(mChildCount),
mChildCount);
}
inline bool Contains(nsIContent* aNode) {
return !!(mParent == aNode);
}
inline bool HaveNotifiedIndex(uint32_t index) {
return index < mChildCount;
}
private:
/**
* An element
*/
nsIContent* mParent;
/**
* Child count at start of notification deferring
*/
uint32_t mChildCount;
};
#endif // nsHtml5PendingNotification_h