Normalize createTextNode hook data - #690
Open
olavoasantos wants to merge 1 commit into
Open
olavoasantos wants to merge 1 commit into
olavoasantos wants to merge 1 commit into
Conversation
olavoasantos
force-pushed
the
normalize-text-node-hooks
branch
from
September 3, 2026 15:30
5863b4e to
291e2de
Compare
olavoasantos
force-pushed
the
normalize-text-node-hooks
branch
from
September 4, 2026 14:31
291e2de to
e1acf97
Compare
olavoasantos
marked this pull request as ready for review
September 4, 2026 15:29
marvinhagemeister
approved these changes
Sep 15, 2026
JoviDeCroock
approved these changes
Sep 15, 2026
henrytao-me
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Document.createTextNode()normalized nullish input in theTextnode constructor, but passedString(data)to thecreateTexthook. As a result, the local node and the Remote DOM hook described different text for the same operation.Impact
Minor. Creating a text node with
nullorundefinedstored''locally while emitting'null'or'undefined'to the hook. A remote receiver could therefore render text that did not exist in the worker’s local DOM.Reproduction
Before this change, the hook logged
'null'even thoughtext.datawas'';undefinedhad the equivalent mismatch. It now receivestext.data, so both values are''. Empty and ordinary strings continue to reach the hook unchanged.Change
Pass the newly created node’s normalized
dataproperty tocreateTextrather than independently coercing the original argument. This makes the hook payload use the same single normalization result as localCharacterData.Tests
Adds focused hook assertions for
null,undefined,'', and an ordinary string. Each test verifies the stored text data, the node passed to the hook, and the hook payload agree.Stack
default-custom-event-detailValidation
Fresh GitHub CI on restacked head
e1acf97passes: