1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 sw=2 et tw=78: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsHtml5AutoPauseUpdate_h
8 #define nsHtml5AutoPauseUpdate_h
10 #include "nsHtml5DocumentBuilder.h"
12 class MOZ_RAII nsHtml5AutoPauseUpdate final
{
14 RefPtr
<nsHtml5DocumentBuilder
> mBuilder
;
17 explicit nsHtml5AutoPauseUpdate(nsHtml5DocumentBuilder
* aBuilder
)
18 : mBuilder(aBuilder
) {
19 mBuilder
->EndDocUpdate();
21 ~nsHtml5AutoPauseUpdate() {
22 // Something may have terminated the parser during the update pause.
23 if (!mBuilder
->IsComplete()) {
24 mBuilder
->BeginDocUpdate();
29 #endif // nsHtml5AutoPauseUpdate_h