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