<textarea></aaaaa... should insert a text node?

Open
#1,306 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
html
Domain
web-dev

Research direction

Start with the linked WHATWG issue comment and saved live DOM viewer examples 4224 and 4225, then compare the specification's tokenizer behavior with the browser behavior described here. Done means resolving the expected DOM and handling of the temporary buffer and documenting the agreed specification change or implementation requirement.

Written by the indexing model from the issue text.

Description

normative change topic: parser

@RReverser found this in https://github.com/whatwg/html/issues/1257#issuecomment-220664626

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4224

  window[0].document.write('<textarea></textar');

So far so good; no EOF yet (no document.close()) and a script might later write ea> to finish the end tag.

Now consider

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/4225

  window[0].document.write('<textarea></textart');

Per spec this should have the same DOM as the previous one, and the parser having consumed </textart into the temporary buffer, waiting for a > or space or slash or EOF.

Two problems:

  • This can cause unnecessary OOM in streaming parsers that implement the spec literally, for <textarea></aaaaaa...
  • Browsers disagree for this case; Gecko seems to check each character if it still matches what is expected, while WebKit/Blink/IE11 seem to fill the temporary buffer like the spec.
Dominant language
HTML
Stars
9.4k
Forks
3.2k
Avg merge
3d 9h
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from whatwg/html

All issues in whatwg/html

Similar issues

More Web Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.