2012-05-29 15:52:43 +00:00
|
|
|
/* 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/. */
|
2009-10-12 13:08:04 +00:00
|
|
|
|
|
|
|
#include "nsHtml5Speculation.h"
|
|
|
|
|
2011-09-28 12:45:17 +00:00
|
|
|
nsHtml5Speculation::nsHtml5Speculation(nsHtml5OwningUTF16Buffer* aBuffer,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aStart,
|
|
|
|
int32_t aStartLineNumber,
|
2009-10-12 13:08:04 +00:00
|
|
|
nsAHtml5TreeBuilderState* aSnapshot)
|
|
|
|
: mBuffer(aBuffer)
|
|
|
|
, mStart(aStart)
|
2009-10-28 13:48:37 +00:00
|
|
|
, mStartLineNumber(aStartLineNumber)
|
2009-10-12 13:08:04 +00:00
|
|
|
, mSnapshot(aSnapshot)
|
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(nsHtml5Speculation);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsHtml5Speculation::~nsHtml5Speculation()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(nsHtml5Speculation);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-11-17 08:52:30 +00:00
|
|
|
nsHtml5Speculation::MoveOpsFrom(nsTArray<nsHtml5TreeOperation>& aOpQueue)
|
2009-10-12 13:08:04 +00:00
|
|
|
{
|
|
|
|
if (mOpQueue.IsEmpty()) {
|
|
|
|
mOpQueue.SwapElements(aOpQueue);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
mOpQueue.MoveElementsFrom(aOpQueue);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsHtml5Speculation::FlushToSink(nsAHtml5TreeOpSink* aSink)
|
|
|
|
{
|
2009-11-17 08:52:30 +00:00
|
|
|
aSink->MoveOpsFrom(mOpQueue);
|
2009-10-12 13:08:04 +00:00
|
|
|
}
|