mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibWeb: Clear grapheme segmenter when invalidating TextNode text
We only set the grapheme segmenter's text once after creating a new segmenter, so we also need to clear it whenever we invalidate the text.
This commit is contained in:
parent
4fcaeabe1a
commit
25516e351e
|
|
@ -0,0 +1,2 @@
|
||||||
|
<!DOCTYPE html><textarea>a
|
||||||
|
b</textarea>
|
||||||
9
Tests/LibWeb/Ref/textnode-segmenter-invalidation.html
Normal file
9
Tests/LibWeb/Ref/textnode-segmenter-invalidation.html
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<head><link rel="match" href="reference/textnode-segmenter-invalidation.html" /></head>
|
||||||
|
<textarea id="output"></textarea>
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
document.body.offsetWidth // Force layout
|
||||||
|
document.getElementById('output').value = 'a\nb';
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -304,6 +304,7 @@ static ErrorOr<String> apply_text_transform(String const& string, CSS::TextTrans
|
||||||
void TextNode::invalidate_text_for_rendering()
|
void TextNode::invalidate_text_for_rendering()
|
||||||
{
|
{
|
||||||
m_text_for_rendering = {};
|
m_text_for_rendering = {};
|
||||||
|
m_grapheme_segmenter.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
String const& TextNode::text_for_rendering() const
|
String const& TextNode::text_for_rendering() const
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user