diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /parser/html/javasrc/Tokenizer.java | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'parser/html/javasrc/Tokenizer.java')
-rw-r--r-- | parser/html/javasrc/Tokenizer.java | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/parser/html/javasrc/Tokenizer.java b/parser/html/javasrc/Tokenizer.java index 0357cd0155..6d7c349155 100644 --- a/parser/html/javasrc/Tokenizer.java +++ b/parser/html/javasrc/Tokenizer.java @@ -511,6 +511,8 @@ public class Tokenizer implements Locator, Locator2 { private boolean shouldSuspend; + private boolean keepBuffer; + protected boolean confident; private int line; @@ -570,6 +572,7 @@ public class Tokenizer implements Locator, Locator2 { this.systemIdentifier = null; this.attributes = null; this.shouldSuspend = false; + this.keepBuffer = false; this.confident = false; this.line = 0; // CPPONLY: this.attributeLine = 0; @@ -632,6 +635,7 @@ public class Tokenizer implements Locator, Locator2 { // CPPONLY: this.attributes = tokenHandler.HasBuilder() ? new HtmlAttributes(mappingLangToXmlLang) : null; // CPPONLY: this.newAttributesEachTime = !tokenHandler.HasBuilder(); this.shouldSuspend = false; + this.keepBuffer = false; this.confident = false; this.line = 0; // CPPONLY: this.attributeLine = 0; @@ -653,6 +657,18 @@ public class Tokenizer implements Locator, Locator2 { // CPPONLY: return viewingXmlSource; // CPPONLY: } + public void setKeepBuffer(boolean keepBuffer) { + this.keepBuffer = keepBuffer; + } + + public boolean dropBufferIfLongerThan(int length) { + if (strBuf.length > length) { + strBuf = null; + return true; + } + return false; + } + // [NOCPP[ /** @@ -7225,7 +7241,9 @@ public class Tokenizer implements Locator, Locator2 { } public void end() throws SAXException { - strBuf = null; + if (!keepBuffer) { + strBuf = null; + } doctypeName = null; if (systemIdentifier != null) { Portability.releaseString(systemIdentifier); @@ -7415,7 +7433,9 @@ public class Tokenizer implements Locator, Locator2 { public void initializeWithoutStarting() throws SAXException { confident = false; - strBuf = null; + if (!keepBuffer) { + strBuf = null; + } line = 1; // CPPONLY: attributeLine = 1; // [NOCPP[ |