The HTML Standard defines a navigate algorithm that is frought with interoperability issues. There are various endpoints that end up triggering it:
<iframe>
<a>
<form>
location.href
window.open()
- ...
Although the algorithm is based on reverse engineering browsers, the browser landscape has changed and not all choices made were necessarily optimal for the current environment. Furthermore, browsers have not actively aligned with the standard and things have drifted. In order to do better we need to study the algorithm again and:
- Where it doesn't make sense or would be better to change, change it (a good first step here is filing an issue).
- Where there's no test coverage, add tests.
- Where browsers need to change, make sure corresponding bugs are filed on the implementation.