commit 09f09088e7267ce4fea0483e801503fdd0b8cf6f
parent ec0aa566fa19398f7157fd77da8258599c5d91fe
Author: agoloman <agoloman@mozilla.com>
Date: Wed, 19 Nov 2025 17:51:18 +0200
Revert "Bug 2001105 - Remove unused content.maxtextrun pref r=dom-core,smaug" for causing build bustages @nsHTMLContentSink.cpp.
This reverts commit e4c0a7574228f2d4c7b06641f511fb01379e9093.
Diffstat:
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/dom/html/nsHTMLContentSink.cpp b/dom/html/nsHTMLContentSink.cpp
@@ -116,6 +116,9 @@ class HTMLContentSink : public nsContentSink, public nsIHTMLContentSink {
RefPtr<nsHTMLDocument> mHTMLDocument;
+ // The maximum length of a text run
+ int32_t mMaxTextRun;
+
RefPtr<nsGenericHTMLElement> mRoot;
RefPtr<nsGenericHTMLElement> mBody;
RefPtr<nsGenericHTMLElement> mHead;
@@ -525,9 +528,12 @@ nsresult NS_NewHTMLContentSink(nsIHTMLContentSink** aResult, Document* aDoc,
return NS_OK;
}
-HTMLContentSink::HTMLContentSink() mCurrentContext(nullptr),
- mHeadContext(nullptr), mHaveSeenHead(false),
- mNotifiedRootInsertion(false) {}
+HTMLContentSink::HTMLContentSink()
+ : mMaxTextRun(0),
+ mCurrentContext(nullptr),
+ mHeadContext(nullptr),
+ mHaveSeenHead(false),
+ mNotifiedRootInsertion(false) {}
HTMLContentSink::~HTMLContentSink() {
if (mNotificationTimer) {
@@ -582,6 +588,10 @@ nsresult HTMLContentSink::Init(Document* aDoc, nsIURI* aURI,
NS_ASSERTION(mDocShell, "oops no docshell!");
+ // Changed from 8192 to greatly improve page loading performance on
+ // large pages. See bugzilla bug 77540.
+ mMaxTextRun = Preferences::GetInt("content.maxtextrun", 8191);
+
RefPtr<mozilla::dom::NodeInfo> nodeInfo;
nodeInfo = mNodeInfoManager->GetNodeInfo(
nsGkAtoms::html, nullptr, kNameSpaceID_XHTML, nsINode::ELEMENT_NODE);