4 ms·
The primary motivator for this was Servo's DOM, although it ended up getting deployed first in Rust to deal with Windows paths. We haven't determined whether we
by pcwalton 11y ago
The primary motivator for this was Servo's DOM, although it ended up getting deployed first in Rust to deal with Windows paths. We haven't determined whether we'll need to use WTF-8 throughout Servo—it may depend on how document.write() is used in the wild.
- yonran 11y agoWhat does the DOM do when it receives a surrogate half from Javascript? I thought that the DOM APIs (e.g. createTextNode, innerHTML setter, setAttribute, HTMLInputElement.value setter, document.write) would all strip out the lone surrogate code units?
- gsnedders 11y agoIn current browsers they'll happily pass around lone surrogates. Nothing special happens to them (v. any other UTF-16 code-unit) till they reach the layout layer (where they obviously cannot be drawn).
- frik 11y agoIs there a roadmap for Servo on Windows7+ ? Is this the best start point to dive in: https://github.com/servo/servo/issues/1908 https://github.com/servo/servo/issues/1908 ?
- pcwalton 11y agoYes, that bug is the best place to start. We've future proofed the architecture for Windows, but there is no direct work on it that I'm aware of.
- Animats 11y agoSo we're going to see this on web sites. Oh, joy. It's time for browsers to start saying no to really bad HTML. When a browser detects a major error, it should put an error bar across the top of the page, with something like "This page may display improperly due to errors in the page source (click for details)". Start doing that for serious errors such as Javascript code aborts, security errors, and malformed UTF-8. Then extend that to pages where the character encoding is ambiguous, and stop trying to guess character encoding. The HTML5 spec formally defines consistent handling for many errors. That's OK, there's a spec. Stop there. Don't try to outguess new kinds of errors.
- SimonSapin 11y agoNo. This is an internal implementation detail, not to be used on the Web. As to draconian error handling, that’s what XHTML is about and why it failed. Just define a somewhat sensible behavior for every input, no matter how ugly.