diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-08-18 16:25:15 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-08-18 16:26:16 +0200 |
commit | 202296d02aa99afa90581333ab059c050b9c3ade (patch) | |
tree | 6ed8a1289bed1bb06d2703ea77cba5fccd3bdffa /parser/html/nsHtml5Highlighter.cpp | |
parent | 1530f48c27fb13d7cbd2708c9f0fcf2dabc6ed6a (diff) | |
parent | ab6242a93b849b0a3c7525b16bc01dd3172fc167 (diff) | |
download | UXP-202296d02aa99afa90581333ab059c050b9c3ade.tar UXP-202296d02aa99afa90581333ab059c050b9c3ade.tar.gz UXP-202296d02aa99afa90581333ab059c050b9c3ade.tar.lz UXP-202296d02aa99afa90581333ab059c050b9c3ade.tar.xz UXP-202296d02aa99afa90581333ab059c050b9c3ade.zip |
Pull Basilisk-release forward.
Diffstat (limited to 'parser/html/nsHtml5Highlighter.cpp')
-rw-r--r-- | parser/html/nsHtml5Highlighter.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/parser/html/nsHtml5Highlighter.cpp b/parser/html/nsHtml5Highlighter.cpp index 259803ee1..23cdf7d84 100644 --- a/parser/html/nsHtml5Highlighter.cpp +++ b/parser/html/nsHtml5Highlighter.cpp @@ -91,7 +91,7 @@ nsHtml5Highlighter::Start(const nsAutoString& aTitle) if (length > INT32_MAX) { length = INT32_MAX; } - AppendCharacters(aTitle.get(), 0, (int32_t)length); + AppendCharacters(aTitle.BeginReading(), 0, (int32_t)length); Pop(); // title Push(nsGkAtoms::link, nsHtml5ViewSourceUtils::NewLinkAttributes()); @@ -105,7 +105,7 @@ nsHtml5Highlighter::Start(const nsAutoString& aTitle) Push(nsGkAtoms::body, nsHtml5ViewSourceUtils::NewBodyAttributes()); nsHtml5HtmlAttributes* preAttrs = new nsHtml5HtmlAttributes(0); - nsString* preId = new nsString(NS_LITERAL_STRING("line1")); + nsHtml5String preId = nsHtml5Portability::newStringFromLiteral("line1"); preAttrs->addAttribute(nsHtml5AttributeName::ATTR_ID, preId, -1); Push(nsGkAtoms::pre, preAttrs); @@ -618,7 +618,7 @@ nsHtml5Highlighter::FlushOps() void nsHtml5Highlighter::MaybeLinkifyAttributeValue(nsHtml5AttributeName* aName, - nsString* aValue) + nsHtml5String aValue) { if (!(nsHtml5AttributeName::ATTR_HREF == aName || nsHtml5AttributeName::ATTR_SRC == aName || @@ -630,7 +630,7 @@ nsHtml5Highlighter::MaybeLinkifyAttributeValue(nsHtml5AttributeName* aName, nsHtml5AttributeName::ATTR_DEFINITIONURL == aName)) { return; } - AddViewSourceHref(*aValue); + AddViewSourceHref(aValue); } void @@ -717,10 +717,10 @@ nsHtml5Highlighter::AddClass(const char16_t* aClass) } void -nsHtml5Highlighter::AddViewSourceHref(const nsString& aValue) +nsHtml5Highlighter::AddViewSourceHref(nsHtml5String aValue) { char16_t* bufferCopy = new char16_t[aValue.Length() + 1]; - memcpy(bufferCopy, aValue.get(), aValue.Length() * sizeof(char16_t)); + aValue.CopyToBuffer(bufferCopy); bufferCopy[aValue.Length()] = 0; mOpQueue.AppendElement()->Init(eTreeOpAddViewSourceHref, @@ -730,14 +730,14 @@ nsHtml5Highlighter::AddViewSourceHref(const nsString& aValue) } void -nsHtml5Highlighter::AddBase(const nsString& aValue) +nsHtml5Highlighter::AddBase(nsHtml5String aValue) { if(mSeenBase) { return; } mSeenBase = true; char16_t* bufferCopy = new char16_t[aValue.Length() + 1]; - memcpy(bufferCopy, aValue.get(), aValue.Length() * sizeof(char16_t)); + aValue.CopyToBuffer(bufferCopy); bufferCopy[aValue.Length()] = 0; mOpQueue.AppendElement()->Init(eTreeOpAddViewSourceBase, |