Historically, Blink has split large text nodes that are longer than 64k. This 
behavior is non-standard and was added in WebKit back in 2007 to address a 
specific performance concern around text selection at the time (see commit 
f6d7c1c6fb65ee928f38934c601ffed72c02bbbd<https://chromium.googlesource.com/chromium/src.git/+/f6d7c1c6fb65ee928f38934c601ffed72c02bbbd>
 
<https://chromium.googlesource.com/chromium/src.git/+/f6d7c1c6fb65ee928f38934c601ffed72c02bbbd>
 for details).

Many of Blink's optimizations since this time actually make this text node 
splitting a net-negative today (e.g. the parser fast path, LayoutNG, etc).

In Chrome 151, we are removing this text splitting behavior. A Blink flag was 
added to restore the old behavior called "SplitLargeTextNodes", which can be 
enabled via adding `--enable-blink-features=SplitLargeTextNodes` to the command 
line arguments. This flag will be removed in M153.

There is no visible change with this behavior - even with split nodes, the 
adjacent Text nodes were merged into a single layout box. The only 
developer-facing behavior is in the DOM structure (e.g. a node with 65k 
characters would have previously been automatically split into two Text nodes 
and now it won't be).

A note on compatibility - WebKit still splits text at 64k, while Gecko does 
not. An incredibly small number of sites have text nodes this large, so we do 
not expect any live sites to depend on this behavior. The main use case is 
large plain-text documents.

There are no web-tests for this behavior, as 64k is very large and the value is 
arbitrary. There are unit tests validating our behavior with and without the 
flag enabled.

Bug: https://issues.chromium.org/issues/525278782
PR (merged today): Remove text node splitting at 64k (7932253) ยท Gerrit Code 
Review<https://chromium-review.googlesource.com/c/chromium/src/+/7932253>

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/DS0PR00MB2541F4E6E0F9895B93B535ACD6EF2%40DS0PR00MB2541.namprd00.prod.outlook.com.

Reply via email to