html base element - forbid href with data or javascript url #20646
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.
The
href
in the<base>
element disallowsdata:
andjavascript:
URLs in a recent spec change. Note however that Chrome and Safari already obey this rule. FF does not - but will in https://bugzilla.mozilla.org/show_bug.cgi?id=1850967This was tested using first test in http://wpt.live/html/semantics/document-metadata/the-base-element/base-javascript.html and http://wpt.live/html/semantics/document-metadata/the-base-element/base-data.html
Note that the dynamic case of using JavaScript to add a new base element is not yet supported by our browsers - this is the third test in the above tests (currently failing). This PR only applies to the HTML base element.
Associated docs: mdn/content#28865