diff --git a/parser/htmlparser/moz.build b/parser/htmlparser/moz.build index 220bbc907ab0..ceac57239922 100644 --- a/parser/htmlparser/moz.build +++ b/parser/htmlparser/moz.build @@ -50,5 +50,3 @@ FINAL_LIBRARY = "xul" LOCAL_INCLUDES += [ "!/security/rlbox", ] - -REQUIRES_UNIFIED_BUILD = True diff --git a/parser/htmlparser/nsExpatDriver.h b/parser/htmlparser/nsExpatDriver.h index 78f9caf34307..b07ba72b6b46 100644 --- a/parser/htmlparser/nsExpatDriver.h +++ b/parser/htmlparser/nsExpatDriver.h @@ -14,6 +14,7 @@ #include "nsIInputStream.h" #include "nsIParser.h" #include "nsCycleCollectionParticipant.h" +#include "nsScanner.h" #include "rlbox_expat.h" #include "nsRLBoxExpatDriver.h" diff --git a/parser/htmlparser/nsScanner.cpp b/parser/htmlparser/nsScanner.cpp index ede8e7dc12e4..b116f288e7c6 100644 --- a/parser/htmlparser/nsScanner.cpp +++ b/parser/htmlparser/nsScanner.cpp @@ -11,6 +11,7 @@ #include "mozilla/Attributes.h" #include "mozilla/DebugOnly.h" #include "mozilla/Encoding.h" +#include "mozilla/UniquePtr.h" #include "nsDebug.h" #include "nsReadableUtils.h" #include "nsUTF8Utils.h" // for LossyConvertEncoding @@ -189,11 +190,13 @@ nsresult nsScanner::Append(const nsAString& aBuffer) { nsresult nsScanner::Append(const char* aBuffer, uint32_t aLen) { nsresult res = NS_OK; if (mUnicodeDecoder) { - CheckedInt needed = mUnicodeDecoder->MaxUTF16BufferLength(aLen); + mozilla::CheckedInt needed = + mUnicodeDecoder->MaxUTF16BufferLength(aLen); if (!needed.isValid()) { return NS_ERROR_OUT_OF_MEMORY; } - CheckedInt allocLen(1); // null terminator due to legacy sadness + mozilla::CheckedInt allocLen( + 1); // null terminator due to legacy sadness allocLen += needed.value(); if (!allocLen.isValid()) { return NS_ERROR_OUT_OF_MEMORY; @@ -209,12 +212,13 @@ nsresult nsScanner::Append(const char* aBuffer, uint32_t aLen) { // Do not use structured binding lest deal with [-Werror=unused-variable] std::tie(result, read, written) = mUnicodeDecoder->DecodeToUTF16WithoutReplacement( - AsBytes(Span(aBuffer, aLen)), Span(unichars, needed.value()), + AsBytes(mozilla::Span(aBuffer, aLen)), + mozilla::Span(unichars, needed.value()), false); // Retain bug about failure to handle EOF MOZ_ASSERT(result != kOutputFull); MOZ_ASSERT(read <= aLen); MOZ_ASSERT(written <= needed.value()); - if (result != kInputEmpty) { + if (result != mozilla::kInputEmpty) { // Since about:blank is empty, this line runs only for XML. Use a // character that's illegal in XML instead of U+FFFD in order to make // expat flag the error. There is no need to loop and convert more, since @@ -279,7 +283,7 @@ void nsScanner::SetPosition(nsScannerIterator& aPosition, bool aTerminate) { void nsScanner::AppendToBuffer(nsScannerString::Buffer* aBuf) { if (!mSlidingBuffer) { - mSlidingBuffer = MakeUnique(aBuf); + mSlidingBuffer = mozilla::MakeUnique(aBuf); mSlidingBuffer->BeginReading(mCurrentPosition); mMarkPosition = mCurrentPosition; } else { diff --git a/parser/htmlparser/nsScannerString.cpp b/parser/htmlparser/nsScannerString.cpp index 7a00276ca39b..396f1fa32e7f 100644 --- a/parser/htmlparser/nsScannerString.cpp +++ b/parser/htmlparser/nsScannerString.cpp @@ -137,8 +137,6 @@ int32_t nsScannerSubstring::CountChar(char16_t c) const { if (!(lengthToExamine -= lengthToExamineInThisFragment)) return result; iter.advance(lengthToExamineInThisFragment); } - // never reached; quiets warnings - return 0; } void nsScannerSubstring::Rebind(const nsScannerSubstring& aString,