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