summaryrefslogtreecommitdiffstats
path: root/dom/bindings/DOMString.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:37 +0000
commita90a5cba08fdf6c0ceb95101c275108a152a3aed (patch)
tree532507288f3defd7f4dcf1af49698bcb76034855 /dom/bindings/DOMString.h
parentAdding debian version 126.0.1-1. (diff)
downloadfirefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz
firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/bindings/DOMString.h')
-rw-r--r--dom/bindings/DOMString.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/dom/bindings/DOMString.h b/dom/bindings/DOMString.h
index c5404f5351..e87d820777 100644
--- a/dom/bindings/DOMString.h
+++ b/dom/bindings/DOMString.h
@@ -169,8 +169,7 @@ class MOZ_STACK_CLASS DOMString {
if (MOZ_UNLIKELY(aString.IsVoid())) {
SetNull();
} else if (!aString.IsEmpty()) {
- nsStringBuffer* buf = nsStringBuffer::FromString(aString);
- if (buf) {
+ if (nsStringBuffer* buf = aString.GetStringBuffer()) {
SetKnownLiveStringBuffer(buf, aString.Length());
} else if (aString.IsLiteral()) {
SetLiteralInternal(aString.BeginReading(), aString.Length());
@@ -236,7 +235,7 @@ class MOZ_STACK_CLASS DOMString {
auto chars = static_cast<char16_t*>(buf->Data());
if (chars[len] == '\0') {
// Safe to share the buffer.
- buf->ToString(len, aString);
+ aString.Assign(buf, len);
} else {
// We need to copy, unfortunately.
aString.Assign(chars, len);