diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2014-05-21 11:38:25 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2014-05-21 11:38:25 +0200 |
commit | d25ba7d760b017b038e5aa6c0a605b4a330eb68d (patch) | |
tree | 16ec27edc7d5f83986f16236d3a36a2682a0f37e /parser/html/nsHtml5Speculation.h | |
parent | a942906574671868daf122284a9c4689e6924f74 (diff) | |
download | palemoon-gre-d25ba7d760b017b038e5aa6c0a605b4a330eb68d.tar.gz |
Recommit working copy to repo with proper line endings.
Diffstat (limited to 'parser/html/nsHtml5Speculation.h')
-rw-r--r-- | parser/html/nsHtml5Speculation.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/parser/html/nsHtml5Speculation.h b/parser/html/nsHtml5Speculation.h new file mode 100644 index 000000000..43cf51cc9 --- /dev/null +++ b/parser/html/nsHtml5Speculation.h @@ -0,0 +1,71 @@ +/* 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 nsHtml5Speculation_h__ +#define nsHtml5Speculation_h__ + +#include "nsHtml5OwningUTF16Buffer.h" +#include "nsAHtml5TreeBuilderState.h" +#include "nsHtml5TreeOperation.h" +#include "nsAHtml5TreeOpSink.h" +#include "nsTArray.h" +#include "nsAutoPtr.h" +#include "mozilla/Attributes.h" + +class nsHtml5Speculation MOZ_FINAL : public nsAHtml5TreeOpSink +{ + public: + nsHtml5Speculation(nsHtml5OwningUTF16Buffer* aBuffer, + int32_t aStart, + int32_t aStartLineNumber, + nsAHtml5TreeBuilderState* aSnapshot); + + ~nsHtml5Speculation(); + + nsHtml5OwningUTF16Buffer* GetBuffer() { + return mBuffer; + } + + int32_t GetStart() { + return mStart; + } + + int32_t GetStartLineNumber() { + return mStartLineNumber; + } + + nsAHtml5TreeBuilderState* GetSnapshot() { + return mSnapshot; + } + + /** + * Flush the operations from the tree operations from the argument + * queue unconditionally. + */ + virtual void MoveOpsFrom(nsTArray<nsHtml5TreeOperation>& aOpQueue); + + void FlushToSink(nsAHtml5TreeOpSink* aSink); + + private: + /** + * The first buffer in the pending UTF-16 buffer queue + */ + nsRefPtr<nsHtml5OwningUTF16Buffer> mBuffer; + + /** + * The start index of this speculation in the first buffer + */ + int32_t mStart; + + /** + * The current line number at the start of the speculation + */ + int32_t mStartLineNumber; + + nsAutoPtr<nsAHtml5TreeBuilderState> mSnapshot; + + nsTArray<nsHtml5TreeOperation> mOpQueue; +}; + +#endif // nsHtml5Speculation_h__ |