3 ms·
browsers backtracked and reparsed when seeing an EOF inside a script to deal with </script> inside an inline script Correct me if I'm wrong, but it seems to me
by judofyr 16y ago
browsers backtracked and reparsed when seeing an EOF inside a script to deal with </script> inside an inline script
Correct me if I'm wrong, but it seems to me that in order to detect that the </script> is inside an inline script, you'll have to parse the JavaScript. Requiring every HTML5 parser to include a JavaScript parser in order to parse it correctly seems a little too much for me.
Another reason: code complexity. Backtracking makes everything a lot more complex which is the exact opposite of what they're trying to achieve with the HTML5 parsing algorithm. Less code = fewer bugs, easier to understand and easier to implement.