瀏覽代碼

LibWeb: Invalidate layout tree in textContent setter

The textContent setter changes the structure of the DOM, therefore the
layout tree becomes invalid.
Andi Gallo 2 年之前
父節點
當前提交
827936cf7b
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Userland/Libraries/LibWeb/DOM/Node.cpp

+ 2 - 1
Userland/Libraries/LibWeb/DOM/Node.cpp

@@ -201,7 +201,8 @@ void Node::set_text_content(DeprecatedString const& content)
 
     // Otherwise, do nothing.
 
-    set_needs_style_update(true);
+    document().invalidate_style();
+    document().invalidate_layout();
 }
 
 // https://dom.spec.whatwg.org/#dom-node-nodevalue