Skip to content
Permalink
Browse files
Make TextRun::isolatedCopy copy character data in more cases
https://bugs.webkit.org/show_bug.cgi?id=241581

Reviewed by Simon Fraser.

* Source/WebCore/platform/graphics/TextRun.h:
(WebCore::TextRun::isolatedCopy const):

Canonical link: https://commits.webkit.org/251521@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
heycam committed Jun 14, 2022
1 parent 623a598 commit 98129b5af85678352fb70aa76215e0119333405b
Showing 1 changed file with 4 additions and 2 deletions.
@@ -184,8 +184,10 @@ inline void TextRun::setTabSize(bool allow, const TabSize& size)
inline TextRun TextRun::isolatedCopy() const
{
TextRun clone = *this;
if (m_text.impl() && m_text.impl()->isExternal())
clone.m_text = m_text.isolatedCopy();
if (clone.m_text.is8Bit())
clone.m_text = String(clone.m_text.characters8(), clone.m_text.length());
else
clone.m_text = String(clone.m_text.characters16(), clone.m_text.length());
return clone;
}

0 comments on commit 98129b5

Please sign in to comment.