diff --git a/parser/html/moz.build b/parser/html/moz.build
index b548d76f25ba..12fe8c8ada93 100644
--- a/parser/html/moz.build
+++ b/parser/html/moz.build
@@ -90,5 +90,3 @@ FINAL_LIBRARY = "xul"
LOCAL_INCLUDES += [
"/dom/base",
]
-
-REQUIRES_UNIFIED_BUILD = True
diff --git a/parser/html/nsHtml5AutoPauseUpdate.h b/parser/html/nsHtml5AutoPauseUpdate.h
index f7c91d9786aa..16c298111d11 100644
--- a/parser/html/nsHtml5AutoPauseUpdate.h
+++ b/parser/html/nsHtml5AutoPauseUpdate.h
@@ -7,6 +7,8 @@
#ifndef nsHtml5AutoPauseUpdate_h
#define nsHtml5AutoPauseUpdate_h
+#include "nsHtml5DocumentBuilder.h"
+
class MOZ_RAII nsHtml5AutoPauseUpdate final {
private:
RefPtr mBuilder;
diff --git a/parser/html/nsHtml5Parser.cpp b/parser/html/nsHtml5Parser.cpp
index 5425b7d8a763..f1916ca2d44d 100644
--- a/parser/html/nsHtml5Parser.cpp
+++ b/parser/html/nsHtml5Parser.cpp
@@ -7,6 +7,7 @@
#include "nsHtml5Parser.h"
#include "mozilla/AutoRestore.h"
+#include "mozilla/UniquePtr.h"
#include "nsCRT.h"
#include "nsContentUtils.h" // for kLoadAsData
#include "nsHtml5AtomTable.h"
@@ -410,10 +411,11 @@ nsresult nsHtml5Parser::Parse(const nsAString& aSourceBuffer, void* aKey,
if (!mDocWriteSpeculativeTreeBuilder) {
// Lazily initialize if uninitialized
mDocWriteSpeculativeTreeBuilder =
- MakeUnique(nullptr, executor->GetStage(), true);
+ mozilla::MakeUnique(nullptr,
+ executor->GetStage(), true);
mDocWriteSpeculativeTreeBuilder->setScriptingEnabled(
mTreeBuilder->isScriptingEnabled());
- mDocWriteSpeculativeTokenizer = MakeUnique(
+ mDocWriteSpeculativeTokenizer = mozilla::MakeUnique(
mDocWriteSpeculativeTreeBuilder.get(), false);
mDocWriteSpeculativeTokenizer->setInterner(&mAtomTable);
mDocWriteSpeculativeTokenizer->start();
diff --git a/parser/html/nsHtml5StackNode.h b/parser/html/nsHtml5StackNode.h
index be570171c2b0..b73dc57a69eb 100644
--- a/parser/html/nsHtml5StackNode.h
+++ b/parser/html/nsHtml5StackNode.h
@@ -31,6 +31,7 @@
#include "nsAtom.h"
#include "nsHtml5AtomTable.h"
+#include "nsHtml5HtmlAttributes.h"
#include "nsHtml5String.h"
#include "nsNameSpaceManager.h"
#include "nsIContent.h"
diff --git a/parser/html/nsHtml5String.cpp b/parser/html/nsHtml5String.cpp
index bd62e08fe8ad..5f30869cbb59 100644
--- a/parser/html/nsHtml5String.cpp
+++ b/parser/html/nsHtml5String.cpp
@@ -150,7 +150,8 @@ nsHtml5String nsHtml5String::FromLiteral(const char* aLiteral) {
MOZ_CRASH("Out of memory.");
}
char16_t* data = reinterpret_cast(buffer->Data());
- ConvertAsciitoUtf16(Span(aLiteral, length), Span(data, length));
+ ConvertAsciitoUtf16(mozilla::Span(aLiteral, length),
+ mozilla::Span(data, length));
data[length] = 0;
return nsHtml5String(reinterpret_cast(buffer.forget().take()) |
eStringBuffer);
diff --git a/parser/html/nsHtml5TokenizerCppSupplement.h b/parser/html/nsHtml5TokenizerCppSupplement.h
index 180268196129..b5bb2aec6b80 100644
--- a/parser/html/nsHtml5TokenizerCppSupplement.h
+++ b/parser/html/nsHtml5TokenizerCppSupplement.h
@@ -79,7 +79,7 @@ void nsHtml5Tokenizer::StartPlainText() {
}
void nsHtml5Tokenizer::EnableViewSource(nsHtml5Highlighter* aHighlighter) {
- mViewSource = WrapUnique(aHighlighter);
+ mViewSource = mozilla::WrapUnique(aHighlighter);
}
bool nsHtml5Tokenizer::ShouldFlushViewSource() {
diff --git a/parser/html/nsHtml5TreeBuilderCppSupplement.h b/parser/html/nsHtml5TreeBuilderCppSupplement.h
index 5500a9c2c85a..d52aa16afbf6 100644
--- a/parser/html/nsHtml5TreeBuilderCppSupplement.h
+++ b/parser/html/nsHtml5TreeBuilderCppSupplement.h
@@ -11,6 +11,7 @@
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/StaticPrefs_network.h"
#include "mozilla/UniquePtr.h"
+#include "mozilla/UniquePtrExtensions.h"
nsHtml5TreeBuilder::nsHtml5TreeBuilder(nsHtml5OplessBuilder* aBuilder)
: mode(0),
@@ -179,7 +180,7 @@ nsIContentHandle* nsHtml5TreeBuilder::createElement(
if (nsGkAtoms::img == aName) {
nsHtml5String loading =
aAttributes->getValue(nsHtml5AttributeName::ATTR_LOADING);
- if (!StaticPrefs::dom_image_lazy_loading_enabled() ||
+ if (!mozilla::StaticPrefs::dom_image_lazy_loading_enabled() ||
!loading.LowerCaseEqualsASCII("lazy")) {
nsHtml5String url =
aAttributes->getValue(nsHtml5AttributeName::ATTR_SRC);
@@ -281,7 +282,7 @@ nsIContentHandle* nsHtml5TreeBuilder::createElement(
mSpeculativeLoadQueue.AppendElement()->InitPreconnect(
url, crossOrigin);
}
- } else if (StaticPrefs::network_preload() &&
+ } else if (mozilla::StaticPrefs::network_preload() &&
rel.LowerCaseEqualsASCII("preload")) {
nsHtml5String url =
aAttributes->getValue(nsHtml5AttributeName::ATTR_HREF);
@@ -760,7 +761,8 @@ void nsHtml5TreeBuilder::appendCharacters(nsIContentHandle* aParent,
memcpy(bufferCopy.get(), aBuffer, aLength * sizeof(char16_t));
if (mImportScanner.ShouldScan()) {
- nsTArray imports = mImportScanner.Scan(Span(aBuffer, aLength));
+ nsTArray imports =
+ mImportScanner.Scan(mozilla::Span(aBuffer, aLength));
for (nsString& url : imports) {
mSpeculativeLoadQueue.AppendElement()->InitImportStyle(std::move(url));
}
@@ -1232,7 +1234,7 @@ mozilla::Result nsHtml5TreeBuilder::Flush(bool aDiscretionary) {
"as broken.");
}
if (!mOpSink->MoveOpsFrom(mOpQueue)) {
- return Err(NS_ERROR_OUT_OF_MEMORY);
+ return mozilla::Err(NS_ERROR_OUT_OF_MEMORY);
}
}
return hasOps;
diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp
index da570e5b6dba..0908642956b6 100644
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
+++ b/parser/html/nsHtml5TreeOpExecutor.cpp
@@ -37,6 +37,7 @@
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsINestedURI.h"
+#include "nsIHttpChannel.h"
#include "nsIScriptContext.h"
#include "nsIScriptError.h"
#include "nsIScriptGlobalObject.h"
@@ -221,7 +222,7 @@ nsHtml5TreeOpExecutor::DidBuildModel(bool aTerminated) {
// Gather telemetry only for top-level content navigations in order to
// avoid noise from ad iframes.
bool topLevel = false;
- if (BrowsingContext* bc = mDocument->GetBrowsingContext()) {
+ if (mozilla::dom::BrowsingContext* bc = mDocument->GetBrowsingContext()) {
topLevel = bc->IsTopContent();
}
diff --git a/parser/html/nsHtml5TreeOperation.cpp b/parser/html/nsHtml5TreeOperation.cpp
index ac12aec74ec1..5ce3e6924651 100644
--- a/parser/html/nsHtml5TreeOperation.cpp
+++ b/parser/html/nsHtml5TreeOperation.cpp
@@ -10,6 +10,7 @@
#include "mozilla/Likely.h"
#include "mozilla/dom/Comment.h"
#include "mozilla/dom/CustomElementRegistry.h"
+#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/DocumentType.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/LinkStyle.h"
diff --git a/parser/html/nsHtml5ViewSourceUtils.cpp b/parser/html/nsHtml5ViewSourceUtils.cpp
index 1313cacba236..3fb46e8bd2ca 100644
--- a/parser/html/nsHtml5ViewSourceUtils.cpp
+++ b/parser/html/nsHtml5ViewSourceUtils.cpp
@@ -15,10 +15,10 @@ nsHtml5HtmlAttributes* nsHtml5ViewSourceUtils::NewBodyAttributes() {
bodyAttrs->addAttribute(nsHtml5AttributeName::ATTR_ID, id, -1);
nsString klass;
- if (StaticPrefs::view_source_wrap_long_lines()) {
+ if (mozilla::StaticPrefs::view_source_wrap_long_lines()) {
klass.AppendLiteral(u"wrap ");
}
- if (StaticPrefs::view_source_syntax_highlight()) {
+ if (mozilla::StaticPrefs::view_source_syntax_highlight()) {
klass.AppendLiteral(u"highlight");
}
if (!klass.IsEmpty()) {
@@ -26,7 +26,7 @@ nsHtml5HtmlAttributes* nsHtml5ViewSourceUtils::NewBodyAttributes() {
nsHtml5String::FromString(klass), -1);
}
- int32_t tabSize = StaticPrefs::view_source_tab_size();
+ int32_t tabSize = mozilla::StaticPrefs::view_source_tab_size();
if (tabSize > 0) {
nsString style;
style.AssignLiteral("tab-size: ");