Skip to content

Implement dangling markup injection mitigation #10022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Added base URL paramter to parse a URL to support base URL
  • Loading branch information
shhnjk committed Feb 3, 2024
commit 5e5fefa942d5d3205fd42608b07d638e873cc439
15 changes: 8 additions & 7 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -7081,14 +7081,15 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
injection attacks, while <span>URL parser</span> does not.</p>

<p>To <dfn export>parse a URL</dfn>, given a <span>scalar value string</span> <var>url</var>,
relative to a <code>Document</code> object or <span>environment settings object</span>
<var>environment</var>,and an optional <span>encoding</span> <var>encoding</var> (default
<span>UTF-8</span>), run these steps. They return failure or a <span>URL</span>.</p>
with an optional null or <span data-x="document base URL">base URL</span> <var>base</var> (default
null), and an optional <span>encoding</span> <var>encoding</var> (default <span>UTF-8</span>), run
these steps. They return failure or a <span>URL</span>.</p>

<ol>
<li><p>Let <var>baseURL</var> be <var>environment</var>'s <span data-x="document base URL">base
URL</span>, if <var>environment</var> is a <code>Document</code> object; otherwise
<var>environment</var>'s <span>API base URL</span>.</p></li>
<li><p>If <var>base</var> is not null, let <var>baseURL</var> be <var>base</var>. Otherwise, let
<var>baseURL</var> be <var>environment</var>'s <span data-x="document base URL">base URL</span>,
if <var>environment</var> is a <code>Document</code> object; otherwise <var>environment</var>'s
<span>API base URL</span>.</p></li>

<li><p>Let <var>newline</var> and <var>lt</var> flag be false.</p></li>

Expand Down Expand Up @@ -15010,7 +15011,7 @@ interface <dfn interface>HTMLBaseElement</dfn> : <span>HTMLElement</span> {
<li><p>Let <var>url</var> be the value of the <code data-x="attr-base-href">href</code>
attribute of this element, if it has one, and the empty string otherwise.</p></li>

<li><p>Let <var>urlRecord</var> be the result of <span data-x="URL parser">parsing</span>
<li><p>Let <var>urlRecord</var> be the result of <span data-x="parse a URL">parsing</span>
<var>url</var> with <var>document</var>'s <span>fallback base URL</span>, and
<var>document</var>'s <span data-x="document's character encoding">character encoding</span>.
(Thus, the <code>base</code> element isn't affected by other <code>base</code> elements or
Expand Down