diff --git a/source b/source index 4e8478045aa..e6977865346 100644 --- a/source +++ b/source @@ -2685,7 +2685,26 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
URLUtils
interface
@@ -17423,7 +17445,7 @@ included with Exhibit B.
attribute DOMString text;
};
-HTMLAnchorElement implements URLUtils;
+HTMLAnchorElement implements HTMLHyperlinkElementUtils;
@@ -17568,28 +17590,6 @@ included with Exhibit B.
same value as the textContent
IDL attribute on the element, and on setting, must act
as if the textContent
IDL attribute on the element had been set to the new value.
- The a
element also supports the URLUtils
interface.
When the element is created, and whenever the element's href
content attribute is set, changed, or removed, the user
- agent must invoke the element's URLUtils
interface's set the input algorithm with the value of the href
content attribute, if any, or the null value otherwise,
- as the given value.
The element's URLUtils
interface's get the
- base algorithm must simply return the element's base URL.
The element's URLUtils
interface's query
- encoding is the document's character encoding.
When the element's URLUtils
interface invokes its update steps with a string value, the user
- agent must set the element's href
content attribute to
- the string value.
a
and area
elements[NoInterfaceObject, Exposed=Window] +interface HTMLHyperlinkElementUtils { + stringifier attribute USVString href; + attribute USVString origin; + attribute USVString protocol; + attribute USVString username; + attribute USVString password; + attribute USVString host; + attribute USVString hostname; + attribute USVString port; + attribute USVString pathname; + attribute USVString search; + attribute USVString hash; +};+ +
toString()
href
Returns the hyperlink's URL.
+Can be set, to change the URL.
+origin
Returns the hyperlink's URL's origin.
+protocol
Returns the hyperlink's URL's scheme.
+Can be set, to change the URL's scheme.
+username
Returns the hyperlink's URL's username.
+Can be set, to change the URL's username.
+password
Returns the hyperlink's URL's password.
+Can be set, to change the URL's password.
+host
Returns the hyperlink's URL's host and port (if different from the default port for the + scheme).
+Can be set, to change the URL's host and port.
+hostname
Returns the hyperlink's URL's host.
+Can be set, to change the URL's host.
+port
Returns the hyperlink's URL's port.
+Can be set, to change the URL's port.
+pathname
Returns the hyperlink's URL's path.
+Can be set, to change the URL's path.
+search
Returns the hyperlink's URL's query (includes leading "?
" if
+ non-empty).
Can be set, to change the URL's query (ignores leading "?
").
hash
Returns the hyperlink's URL's fragment (includes leading "#
" if
+ non-empty).
Can be set, to change the URL's fragment (ignores leading "#
").
An element implementing the HTMLHyperlinkElementUtils
mixin has an associated url (null or a URL). It is initially null.
+
+
An element implementing the HTMLHyperlinkElementUtils
mixin has an associated set the url algorithm, which sets this
+ element's url to the resulting parsed URL
+ of resolving this element's href
content attribute value relative to this element. If
+ resolving was aborted with an error, set this element's url to null.
When elements implementing the HTMLHyperlinkElementUtils
mixin are created, and
+ whenever those elements have their href
content
+ attribute set, changed, or removed, the user agent must set the url.
This is only observable for blob:
URLs as parsing them involves the
+ structured clone algorithm.
An element implementing the HTMLHyperlinkElementUtils
mixin has an associated reinitialise url algorithm, which runs these steps:
If element's url is null or its + non-relative flag is set, terminate these steps.
Set the url.
To update href
, set the element's href
content attribute's value to the element's url, serialised.
The href
attribute's getter must run these
+ steps:
Reinitialise url.
Let url be this element's url.
If url is null and this element has no href
content attribute, return the empty string.
+
+
Otherwise, if url is null, return this element's href
content attribute's value.
Return url, serialised.
The href
attribute's setter must set this element's
+ href
content attribute's value to the given value.
+
+
The origin
attribute's getter must run
+ these steps:
Reinitialise url.
If this element's url is null, return the + empty string.
Return the Unicode serialization + of this element's url's origin.
It returns the Unicode rather than the ASCII serialisation for
+ compatibility with MessageEvent
.
The protocol
attribute's getter must
+ run these steps:
Reinitialise url.
If this element's url is null, return ":
".
Return this element's url's scheme, followed by ":
".
The protocol
attribute's setter must run these
+ steps:
Reinitialise url.
If this element's url is null, terminate these + steps.
Basic URL parse the given value, followed by :
", with this element's url as
+ url and scheme start state as state override.
Update href
.
The username
attribute's getter must
+ run these steps:
Reinitialise url.
If this element's url is null, return the + empty string.
Return this element's url's username.
The username
attribute's setter must run these
+ steps:
Reinitialise url.
Let url be this element's url.
If url or url's host is null, + or url's non-relative flag is set, terminate these steps.
Set the username, given url and the given value.
Update href
.
The password
attribute's getter must
+ run these steps:
Reinitialise url.
Let url be this element's url.
If url or url's password + is null, return the empty string.
Return url's password.
The password
attribute's setter must run these
+ steps:
Reinitialise url.
Let url be this element's url.
If url or url's host is null, + or url's non-relative flag is set, terminate these steps.
Set the password, given url and the given value.
Update href
.
The host
attribute's getter must run these
+ steps:
Reinitialise url.
Let url be this element's url.
If url or url's host is null, + return the empty string.
If url's port is null, return + url's host, serialised.
Return url's host, serialised, followed by ":
" and url's port, serialised.
The host
attribute's setter must run these steps:
Reinitialise url.
Let url be this element's url.
If url is null or url's non-relative flag is set, + terminate these steps.
Basic URL parse the given value, with + url as url and host state as state + override.
Update href
.
The hostname
attribute's getter must
+ run these steps:
Reinitialise url.
Let url be this element's url.
If url or url's host is null, + return the empty string.
Return url's host, serialised.
The hostname
attribute's setter must run these
+ steps:
Reinitialise url.
Let url be this element's url.
If url is null or url's non-relative flag is set, + terminate these steps.
Basic URL parse the given value, with + url as url and hostname state as state + override.
Update href
.
The port
attribute's getter must run these
+ steps:
Reinitialise url.
Let url be this element's url.
If url or url's port is null, + return the empty string.
Return url's port, serialised.
The port
attribute's setter must run these steps:
Reinitialise url.
Let url be this element's url.
If url or url's host is null,
+ url's non-relative flag is set, or url's scheme is "file
", terminate these
+ steps.
Basic URL parse the given value, with + url as url and port state as state + override.
Update href
.
The pathname
attribute's getter must
+ run these steps:
Reinitialise url.
Let url be this element's url.
If url is null, return the empty string.
If url's non-relative flag is set, return the first string in + url's path.
Return "/
", followed by the strings in url's path (including empty strings), separated from each other by
+ "/
".
The pathname
attribute's setter must run these
+ steps:
Reinitialise url.
Let url be this element's url.
If url is null or url's non-relative flag is set, + terminate these steps.
Set url's path to the empty + list.
Basic URL parse the given value, with + url as url and path start state as state + override.
Update href
.
The search
attribute's getter must run
+ these steps:
Reinitialise url.
Let url be this element's url.
If url is null, or url's query is either null or the empty string, return the empty + string.
Return "?
", followed by url's query.
The search
attribute's setter must run these
+ steps:
Reinitialise url.
Let url be this element's url.
If url is null, terminate these steps.
If the given value is the empty string, set url's query to null. + +
Otherwise, run these substeps:
+ +Let input be the given value with a single leading "?
"
+ removed, if any.
Set url's query to the empty + string.
Basic URL parse input, with + url as url and query state as state override, and + this element's node document's document's character encoding as + encoding override.
Update href
.
The hash
attribute's getter must run these
+ steps:
Reinitialise url.
Let url be this element's url.
If url is null, or url's fragment is either null or the empty string, return the + empty string.
Return "#
", followed by url's fragment.
The hash
attribute's setter must run these steps:
Reinitialise url.
Let url be this element's url.
If url is null or url's scheme is "javascript
", terminate these
+ steps.
If the given value is the empty string, set url's fragment to null. + +
Otherwise, run these substeps:
+ +Let input be the given value with a single leading "#
"
+ removed, if any.
Set url's fragment to the empty + string.
Basic URL parse input, with + url as url and fragment state as state + override.
Update href
.
When a user follows a hyperlink created by an element @@ -36269,7 +36781,7 @@ dictionary TrackEventInit : EventInit { attribute DOMString hreflang; attribute DOMString type; }; -HTMLAreaElement implements URLUtils; +HTMLAreaElement implements HTMLHyperlinkElementUtils; @@ -36447,28 +36959,6 @@ dictionary TrackEventInit : EventInit {
The IDL attribute relList
must
reflect the rel
content attribute.
The area
element also supports the URLUtils
interface.
When the element is created, and whenever the element's href
content attribute is set, changed, or removed, the user
- agent must invoke the element's URLUtils
interface's set the input algorithm with the value of the href
content attribute, if any, or the null value otherwise,
- as the given value.
The element's URLUtils
interface's get the
- base algorithm must simply return the element's base URL.
The element's URLUtils
interface's query
- encoding is the document's character encoding.
When the element's URLUtils
interface invokes its update steps with a string value, the user
- agent must set the element's href
content attribute to
- the string value.
Let port be the Let port be the associated WorkerGlobalScope
object's url's WorkerGlobalScope
object's
+ url's port.
If port is null, return the empty string.