mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
script: implement HTMLHyperlinkElementUtils for HTMLAreaElement (#35482)
This makes some common functionality in HTMLAreaElement and HTMLAnchorElement shared code. Signed-off-by: Shane Handley <shanehandley@fastmail.com>
This commit is contained in:
parent
6d6070242b
commit
5ab3641a8e
16 changed files with 701 additions and 1924 deletions
|
@ -6,7 +6,7 @@ use std::cell::Cell;
|
|||
use std::default::Default;
|
||||
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
|
||||
use html5ever::{local_name, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use num_traits::ToPrimitive;
|
||||
use servo_atoms::Atom;
|
||||
|
@ -28,10 +28,10 @@ use crate::dom::element::{reflect_referrer_policy_attribute, AttributeMutation,
|
|||
use crate::dom::event::Event;
|
||||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::dom::htmlelement::HTMLElement;
|
||||
use crate::dom::htmlhyperlinkelementutils::{HyperlinkElement, HyperlinkElementTraits};
|
||||
use crate::dom::htmlimageelement::HTMLImageElement;
|
||||
use crate::dom::mouseevent::MouseEvent;
|
||||
use crate::dom::node::{BindContext, Node, NodeTraits};
|
||||
use crate::dom::urlhelper::UrlHelper;
|
||||
use crate::dom::node::{BindContext, Node};
|
||||
use crate::dom::virtualmethods::VirtualMethods;
|
||||
use crate::links::{follow_hyperlink, LinkRelations};
|
||||
use crate::script_runtime::CanGc;
|
||||
|
@ -40,7 +40,6 @@ use crate::script_runtime::CanGc;
|
|||
pub(crate) struct HTMLAnchorElement {
|
||||
htmlelement: HTMLElement,
|
||||
rel_list: MutNullableDom<DOMTokenList>,
|
||||
|
||||
#[no_trace]
|
||||
relations: Cell<LinkRelations>,
|
||||
#[no_trace]
|
||||
|
@ -78,48 +77,11 @@ impl HTMLAnchorElement {
|
|||
can_gc,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#concept-hyperlink-url-set>
|
||||
fn set_url(&self) {
|
||||
// Step 1. Set this element's url to null.
|
||||
*self.url.borrow_mut() = None;
|
||||
|
||||
// Step 2. If this element's href content attribute is absent, then return.
|
||||
let attribute = self
|
||||
.upcast::<Element>()
|
||||
.get_attribute(&ns!(), &local_name!("href"));
|
||||
|
||||
let Some(attribute) = attribute else {
|
||||
return;
|
||||
};
|
||||
|
||||
// Step 3. Let url be the result of encoding-parsing a URL given this element's
|
||||
// href content attribute's value, relative to this element's node document.
|
||||
let document = self.owner_document();
|
||||
let url = document.encoding_parse_a_url(&attribute.value());
|
||||
|
||||
// Step 4. If url is not failure, then set this element's url to url.
|
||||
if let Ok(url) = url {
|
||||
*self.url.borrow_mut() = Some(url);
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#reinitialise-url
|
||||
fn reinitialize_url(&self) {
|
||||
// Step 1.
|
||||
match *self.url.borrow() {
|
||||
Some(ref url) if url.scheme() == "blob" && url.cannot_be_a_base() => return,
|
||||
_ => (),
|
||||
}
|
||||
|
||||
// Step 2.
|
||||
self.set_url();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#update-href
|
||||
fn update_href(&self, url: DOMString, can_gc: CanGc) {
|
||||
self.upcast::<Element>()
|
||||
.set_string_attribute(&local_name!("href"), url, can_gc);
|
||||
impl HyperlinkElement for HTMLAnchorElement {
|
||||
fn get_url(&self) -> &DomRefCell<Option<ServoUrl>> {
|
||||
&self.url
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,362 +187,109 @@ impl HTMLAnchorElementMethods<crate::DomTypeHolder> for HTMLAnchorElement {
|
|||
// https://html.spec.whatwg.org/multipage/#attr-hyperlink-target
|
||||
make_setter!(SetTarget, "target");
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-hash
|
||||
fn Hash(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.url.borrow() {
|
||||
// Step 3.
|
||||
None => USVString(String::new()),
|
||||
Some(ref url) => {
|
||||
// Steps 3-4.
|
||||
UrlHelper::Hash(url)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-hash
|
||||
fn SetHash(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2.
|
||||
let url = match self.url.borrow_mut().as_mut() {
|
||||
// Step 3.
|
||||
Some(ref url) if url.scheme() == "javascript" => return,
|
||||
None => return,
|
||||
// Steps 4-5.
|
||||
Some(url) => {
|
||||
UrlHelper::SetHash(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
// Step 6.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-host
|
||||
fn Host(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.url.borrow() {
|
||||
// Step 3.
|
||||
None => USVString(String::new()),
|
||||
Some(ref url) => {
|
||||
if url.host().is_none() {
|
||||
USVString(String::new())
|
||||
} else {
|
||||
// Steps 4-5.
|
||||
UrlHelper::Host(url)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-host
|
||||
fn SetHost(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2.
|
||||
let url = match self.url.borrow_mut().as_mut() {
|
||||
// Step 3.
|
||||
Some(ref url) if url.cannot_be_a_base() => return,
|
||||
None => return,
|
||||
// Step 4.
|
||||
Some(url) => {
|
||||
UrlHelper::SetHost(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
// Step 5.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-hostname
|
||||
fn Hostname(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.url.borrow() {
|
||||
// Step 3.
|
||||
None => USVString(String::new()),
|
||||
Some(ref url) => {
|
||||
// Step 4.
|
||||
UrlHelper::Hostname(url)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-hostname
|
||||
fn SetHostname(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2.
|
||||
let url = match self.url.borrow_mut().as_mut() {
|
||||
// Step 3.
|
||||
Some(ref url) if url.cannot_be_a_base() => return,
|
||||
None => return,
|
||||
// Step 4.
|
||||
Some(url) => {
|
||||
UrlHelper::SetHostname(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
// Step 5.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-href
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-href>
|
||||
fn Href(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
USVString(match *self.url.borrow() {
|
||||
None => {
|
||||
match self
|
||||
.upcast::<Element>()
|
||||
.get_attribute(&ns!(), &local_name!("href"))
|
||||
{
|
||||
// Step 3.
|
||||
None => String::new(),
|
||||
// Step 4.
|
||||
Some(attribute) => (**attribute.value()).to_owned(),
|
||||
}
|
||||
},
|
||||
// Step 5.
|
||||
Some(ref url) => url.as_str().to_owned(),
|
||||
})
|
||||
self.get_href()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-href
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-href>
|
||||
fn SetHref(&self, value: USVString, can_gc: CanGc) {
|
||||
self.upcast::<Element>().set_string_attribute(
|
||||
&local_name!("href"),
|
||||
DOMString::from_string(value.0),
|
||||
can_gc,
|
||||
);
|
||||
self.set_url();
|
||||
self.set_href(value, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-origin
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-origin>
|
||||
fn Origin(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
USVString(match *self.url.borrow() {
|
||||
None => {
|
||||
// Step 2.
|
||||
"".to_owned()
|
||||
},
|
||||
Some(ref url) => {
|
||||
// Step 3.
|
||||
url.origin().ascii_serialization()
|
||||
},
|
||||
})
|
||||
self.get_origin()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-password
|
||||
fn Password(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.url.borrow() {
|
||||
// Step 3.
|
||||
None => USVString(String::new()),
|
||||
// Steps 3-4.
|
||||
Some(ref url) => UrlHelper::Password(url),
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-password
|
||||
fn SetPassword(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2.
|
||||
let url = match self.url.borrow_mut().as_mut() {
|
||||
// Step 3.
|
||||
Some(ref url) if url.host().is_none() || url.cannot_be_a_base() => return,
|
||||
None => return,
|
||||
// Step 4.
|
||||
Some(url) => {
|
||||
UrlHelper::SetPassword(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
// Step 5.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-pathname
|
||||
fn Pathname(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.url.borrow() {
|
||||
// Step 3.
|
||||
None => USVString(String::new()),
|
||||
// Steps 4-5.
|
||||
Some(ref url) => UrlHelper::Pathname(url),
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-pathname
|
||||
fn SetPathname(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2.
|
||||
let url = match self.url.borrow_mut().as_mut() {
|
||||
// Step 3.
|
||||
Some(ref url) if url.cannot_be_a_base() => return,
|
||||
None => return,
|
||||
// Step 5.
|
||||
Some(url) => {
|
||||
UrlHelper::SetPathname(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
// Step 6.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-port
|
||||
fn Port(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.url.borrow() {
|
||||
// Step 3.
|
||||
None => USVString(String::new()),
|
||||
// Step 4.
|
||||
Some(ref url) => UrlHelper::Port(url),
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-port
|
||||
fn SetPort(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 3.
|
||||
let url = match self.url.borrow_mut().as_mut() {
|
||||
Some(ref url)
|
||||
if url.host().is_none() || url.cannot_be_a_base() || url.scheme() == "file" =>
|
||||
{
|
||||
return;
|
||||
},
|
||||
None => return,
|
||||
// Step 4.
|
||||
Some(url) => {
|
||||
UrlHelper::SetPort(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
// Step 5.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-protocol
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-protocol>
|
||||
fn Protocol(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.url.borrow() {
|
||||
// Step 2.
|
||||
None => USVString(":".to_owned()),
|
||||
// Step 3.
|
||||
Some(ref url) => UrlHelper::Protocol(url),
|
||||
}
|
||||
self.get_protocol()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-protocol
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-protocol>
|
||||
fn SetProtocol(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
let url = match self.url.borrow_mut().as_mut() {
|
||||
// Step 2.
|
||||
None => return,
|
||||
// Step 3.
|
||||
Some(url) => {
|
||||
UrlHelper::SetProtocol(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
// Step 4.
|
||||
self.update_href(url, can_gc);
|
||||
self.set_protocol(value, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-search
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-password>
|
||||
fn Password(&self) -> USVString {
|
||||
self.get_password()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-password>
|
||||
fn SetPassword(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_password(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hash>
|
||||
fn Hash(&self) -> USVString {
|
||||
self.get_hash()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hash>
|
||||
fn SetHash(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_hash(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-host>
|
||||
fn Host(&self) -> USVString {
|
||||
self.get_host()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-host>
|
||||
fn SetHost(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_host(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hostname>
|
||||
fn Hostname(&self) -> USVString {
|
||||
self.get_hostname()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hostname>
|
||||
fn SetHostname(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_hostname(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-port>
|
||||
fn Port(&self) -> USVString {
|
||||
self.get_port()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-port>
|
||||
fn SetPort(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_port(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-pathname>
|
||||
fn Pathname(&self) -> USVString {
|
||||
self.get_pathname()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-pathname>
|
||||
fn SetPathname(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_pathname(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-search>
|
||||
fn Search(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.url.borrow() {
|
||||
// Step 2.
|
||||
None => USVString(String::new()),
|
||||
// Step 3.
|
||||
Some(ref url) => UrlHelper::Search(url),
|
||||
}
|
||||
self.get_search()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-search
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-search>
|
||||
fn SetSearch(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2.
|
||||
let url = match self.url.borrow_mut().as_mut() {
|
||||
// Step 3.
|
||||
None => return,
|
||||
// Steps 4-5.
|
||||
// TODO add this element's node document character encoding as
|
||||
// encoding override (as described in the spec)
|
||||
Some(url) => {
|
||||
UrlHelper::SetSearch(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
// Step 6.
|
||||
self.update_href(url, can_gc);
|
||||
self.set_search(value, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-username
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-username>
|
||||
fn Username(&self) -> USVString {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.url.borrow() {
|
||||
// Step 2.
|
||||
None => USVString(String::new()),
|
||||
// Step 3.
|
||||
Some(ref url) => UrlHelper::Username(url),
|
||||
}
|
||||
self.get_username()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-hyperlink-username
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-username>
|
||||
fn SetUsername(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2.
|
||||
let url = match self.url.borrow_mut().as_mut() {
|
||||
// Step 3.
|
||||
Some(ref url) if url.host().is_none() || url.cannot_be_a_base() => return,
|
||||
None => return,
|
||||
// Step 4.
|
||||
Some(url) => {
|
||||
UrlHelper::SetUsername(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
// Step 5.
|
||||
self.update_href(url, can_gc);
|
||||
self.set_username(value, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-a-referrerpolicy
|
||||
|
|
|
@ -12,20 +12,23 @@ use euclid::default::Point2D;
|
|||
use html5ever::{local_name, LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use servo_atoms::Atom;
|
||||
use servo_url::ServoUrl;
|
||||
use style::attr::AttrValue;
|
||||
|
||||
use crate::dom::activation::Activatable;
|
||||
use crate::dom::attr::Attr;
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::codegen::Bindings::HTMLAreaElementBinding::HTMLAreaElementMethods;
|
||||
use crate::dom::bindings::inheritance::Castable;
|
||||
use crate::dom::bindings::root::{DomRoot, MutNullableDom};
|
||||
use crate::dom::bindings::str::DOMString;
|
||||
use crate::dom::bindings::str::{DOMString, USVString};
|
||||
use crate::dom::document::Document;
|
||||
use crate::dom::domtokenlist::DOMTokenList;
|
||||
use crate::dom::element::{reflect_referrer_policy_attribute, AttributeMutation, Element};
|
||||
use crate::dom::event::Event;
|
||||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::dom::htmlelement::HTMLElement;
|
||||
use crate::dom::htmlhyperlinkelementutils::{HyperlinkElement, HyperlinkElementTraits};
|
||||
use crate::dom::node::{BindContext, Node};
|
||||
use crate::dom::virtualmethods::VirtualMethods;
|
||||
use crate::links::{follow_hyperlink, LinkRelations};
|
||||
|
@ -107,7 +110,7 @@ impl Area {
|
|||
index += 1;
|
||||
}
|
||||
|
||||
// The input does not consist any valid charecters
|
||||
// The input does not consist any valid characters
|
||||
if array.is_empty() {
|
||||
break;
|
||||
}
|
||||
|
@ -240,9 +243,10 @@ impl Area {
|
|||
pub(crate) struct HTMLAreaElement {
|
||||
htmlelement: HTMLElement,
|
||||
rel_list: MutNullableDom<DOMTokenList>,
|
||||
|
||||
#[no_trace]
|
||||
relations: Cell<LinkRelations>,
|
||||
#[no_trace]
|
||||
url: DomRefCell<Option<ServoUrl>>,
|
||||
}
|
||||
|
||||
impl HTMLAreaElement {
|
||||
|
@ -255,6 +259,7 @@ impl HTMLAreaElement {
|
|||
htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
|
||||
rel_list: Default::default(),
|
||||
relations: Cell::new(LinkRelations::empty()),
|
||||
url: DomRefCell::new(None),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,6 +300,12 @@ impl HTMLAreaElement {
|
|||
}
|
||||
}
|
||||
|
||||
impl HyperlinkElement for HTMLAreaElement {
|
||||
fn get_url(&self) -> &DomRefCell<Option<ServoUrl>> {
|
||||
&self.url
|
||||
}
|
||||
}
|
||||
|
||||
impl VirtualMethods for HTMLAreaElement {
|
||||
fn super_type(&self) -> Option<&dyn VirtualMethods> {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
|
@ -348,7 +359,7 @@ impl HTMLAreaElementMethods<crate::DomTypeHolder> for HTMLAreaElement {
|
|||
.set_tokenlist_attribute(&local_name!("rel"), rel, can_gc);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-area-rellist
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-area-rellist>
|
||||
fn RelList(&self) -> DomRoot<DOMTokenList> {
|
||||
self.rel_list.or_init(|| {
|
||||
DOMTokenList::new(
|
||||
|
@ -370,6 +381,111 @@ impl HTMLAreaElementMethods<crate::DomTypeHolder> for HTMLAreaElement {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#attr-iframe-referrerpolicy
|
||||
make_setter!(SetReferrerPolicy, "referrerpolicy");
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-href>
|
||||
fn Href(&self) -> USVString {
|
||||
self.get_href()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-href>
|
||||
fn SetHref(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_href(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-origin>
|
||||
fn Origin(&self) -> USVString {
|
||||
self.get_origin()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-protocol>
|
||||
fn Protocol(&self) -> USVString {
|
||||
self.get_protocol()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-protocol>
|
||||
fn SetProtocol(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_protocol(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-password>
|
||||
fn Password(&self) -> USVString {
|
||||
self.get_password()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-password>
|
||||
fn SetPassword(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_password(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hash>
|
||||
fn Hash(&self) -> USVString {
|
||||
self.get_hash()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hash>
|
||||
fn SetHash(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_hash(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-host>
|
||||
fn Host(&self) -> USVString {
|
||||
self.get_host()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-host>
|
||||
fn SetHost(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_host(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hostname>
|
||||
fn Hostname(&self) -> USVString {
|
||||
self.get_hostname()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hostname>
|
||||
fn SetHostname(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_hostname(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-port>
|
||||
fn Port(&self) -> USVString {
|
||||
self.get_port()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-port>
|
||||
fn SetPort(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_port(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-pathname>
|
||||
fn Pathname(&self) -> USVString {
|
||||
self.get_pathname()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-pathname>
|
||||
fn SetPathname(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_pathname(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-search>
|
||||
fn Search(&self) -> USVString {
|
||||
self.get_search()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-search>
|
||||
fn SetSearch(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_search(value, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-username>
|
||||
fn Username(&self) -> USVString {
|
||||
self.get_username()
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-username>
|
||||
fn SetUsername(&self, value: USVString, can_gc: CanGc) {
|
||||
self.set_username(value, can_gc);
|
||||
}
|
||||
}
|
||||
|
||||
impl Activatable for HTMLAreaElement {
|
||||
|
|
493
components/script/dom/htmlhyperlinkelementutils.rs
Normal file
493
components/script/dom/htmlhyperlinkelementutils.rs
Normal file
|
@ -0,0 +1,493 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use html5ever::{local_name, namespace_url, ns};
|
||||
use servo_url::ServoUrl;
|
||||
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::conversions::DerivedFrom;
|
||||
use crate::dom::bindings::inheritance::Castable;
|
||||
use crate::dom::bindings::str::{DOMString, USVString};
|
||||
use crate::dom::element::Element;
|
||||
use crate::dom::node::NodeTraits;
|
||||
use crate::dom::urlhelper::UrlHelper;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
pub(crate) trait HyperlinkElement {
|
||||
fn get_url(&self) -> &DomRefCell<Option<ServoUrl>>;
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#htmlhyperlinkelementutils>
|
||||
pub(crate) trait HyperlinkElementTraits {
|
||||
fn get_hash(&self) -> USVString;
|
||||
fn set_hash(&self, value: USVString, can_gc: CanGc);
|
||||
fn get_host(&self) -> USVString;
|
||||
fn set_host(&self, value: USVString, can_gc: CanGc);
|
||||
fn get_hostname(&self) -> USVString;
|
||||
fn set_hostname(&self, value: USVString, can_gc: CanGc);
|
||||
fn get_href(&self) -> USVString;
|
||||
fn set_href(&self, value: USVString, can_gc: CanGc);
|
||||
fn get_origin(&self) -> USVString;
|
||||
fn get_password(&self) -> USVString;
|
||||
fn set_password(&self, value: USVString, can_gc: CanGc);
|
||||
fn get_pathname(&self) -> USVString;
|
||||
fn set_pathname(&self, value: USVString, can_gc: CanGc);
|
||||
fn get_port(&self) -> USVString;
|
||||
fn set_port(&self, value: USVString, can_gc: CanGc);
|
||||
fn get_protocol(&self) -> USVString;
|
||||
fn set_protocol(&self, value: USVString, can_gc: CanGc);
|
||||
fn get_search(&self) -> USVString;
|
||||
fn set_search(&self, value: USVString, can_gc: CanGc);
|
||||
fn get_username(&self) -> USVString;
|
||||
fn set_url(&self);
|
||||
fn set_username(&self, value: USVString, can_gc: CanGc);
|
||||
fn update_href(&self, url: DOMString, can_gc: CanGc);
|
||||
fn reinitialize_url(&self);
|
||||
}
|
||||
|
||||
impl<T: HyperlinkElement + DerivedFrom<Element> + Castable + NodeTraits> HyperlinkElementTraits
|
||||
for T
|
||||
{
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hash>
|
||||
fn get_hash(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
match *self.get_url().borrow() {
|
||||
// Step 3. If url is null, or url's fragment is either null or the empty string, return
|
||||
// the empty string.
|
||||
None => USVString(String::new()),
|
||||
Some(ref url) if url.fragment().is_none() || url.fragment() == Some("") => {
|
||||
USVString(String::new())
|
||||
},
|
||||
Some(ref url) => {
|
||||
// Step 4. Return "#", followed by url's fragment.
|
||||
UrlHelper::Hash(url)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hash>
|
||||
fn set_hash(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
let url = match self.get_url().borrow_mut().as_mut() {
|
||||
// Step 3. If url is null, then return.
|
||||
None => return,
|
||||
// Step 4. If the given value is the empty string, set url's fragment to null.
|
||||
// Note this step is taken care of by UrlHelper::SetHash when the value is Some
|
||||
// Steps 5. Otherwise:
|
||||
Some(url) => {
|
||||
// Step 5.1. Let input be the given value with a single leading "#" removed, if any.
|
||||
// Step 5.2. Set url's fragment to the empty string.
|
||||
// Note these steps are taken care of by UrlHelper::SetHash
|
||||
UrlHelper::SetHash(url, value);
|
||||
|
||||
// Step 5.4. Basic URL parse input, with url as url and fragment state as state
|
||||
// override.
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
|
||||
// Step 6. Update href.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-host>
|
||||
fn get_host(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
match *self.get_url().borrow() {
|
||||
// Step 3. If url or url's host is null, return the empty string.
|
||||
None => USVString(String::new()),
|
||||
Some(ref url) => {
|
||||
if url.host().is_none() {
|
||||
USVString(String::new())
|
||||
} else {
|
||||
// Step 4. If url's port is null, return url's host, serialized.
|
||||
// Step 5. Return url's host, serialized, followed by ":" and url's port,
|
||||
// serialized.
|
||||
UrlHelper::Host(url)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-host>
|
||||
fn set_host(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
let url = match self.get_url().borrow_mut().as_mut() {
|
||||
// Step 3. If url or url's host is null, return the empty string.
|
||||
Some(ref url) if url.cannot_be_a_base() => return,
|
||||
None => return,
|
||||
// Step 4. Basic URL parse the given value, with url as url and host state as state
|
||||
// override.
|
||||
Some(url) => {
|
||||
UrlHelper::SetHost(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
|
||||
// Step 5. Update href.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hostname>
|
||||
fn get_hostname(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
match *self.get_url().borrow() {
|
||||
// Step 3. If url or url's host is null, return the empty string.
|
||||
None => USVString(String::new()),
|
||||
Some(ref url) => {
|
||||
// Step 4. Return url's host, serialized.
|
||||
UrlHelper::Hostname(url)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-hostname>
|
||||
fn set_hostname(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
let url = match self.get_url().borrow_mut().as_mut() {
|
||||
// Step 3. If url is null or url has an opaque path, then return.
|
||||
None => return,
|
||||
Some(ref url) if url.cannot_be_a_base() => return,
|
||||
// Step 4. Basic URL parse the given value, with url as url and hostname state as state
|
||||
// override.
|
||||
Some(url) => {
|
||||
UrlHelper::SetHostname(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
|
||||
// Step 5. Update href.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-href>
|
||||
fn get_href(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
USVString(match *self.get_url().borrow() {
|
||||
None => {
|
||||
match self
|
||||
.upcast::<Element>()
|
||||
.get_attribute(&ns!(), &local_name!("href"))
|
||||
{
|
||||
// Step 3. If url is null and this has no href content attribute, return the
|
||||
// empty string.
|
||||
None => String::new(),
|
||||
|
||||
// Step 4. Otherwise, if url is null, return this's href content attribute's value.
|
||||
Some(attribute) => (**attribute.value()).to_owned(),
|
||||
}
|
||||
},
|
||||
// Step 5. Return url, serialized.
|
||||
Some(ref url) => url.as_str().to_owned(),
|
||||
})
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-href
|
||||
fn set_href(&self, value: USVString, can_gc: CanGc) {
|
||||
self.upcast::<Element>().set_string_attribute(
|
||||
&local_name!("href"),
|
||||
DOMString::from_string(value.0),
|
||||
can_gc,
|
||||
);
|
||||
|
||||
self.set_url();
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-origin>
|
||||
fn get_origin(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
USVString(match *self.get_url().borrow() {
|
||||
// Step 2. If this's url is null, return the empty string.
|
||||
None => "".to_owned(),
|
||||
// Step 3. Return the serialization of this's url's origin.
|
||||
Some(ref url) => url.origin().ascii_serialization(),
|
||||
})
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-password>
|
||||
fn get_password(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
match *self.get_url().borrow() {
|
||||
// Step 3. If url is null, then return the empty string.
|
||||
None => USVString(String::new()),
|
||||
// Steps 4. Return url's password.
|
||||
Some(ref url) => UrlHelper::Password(url),
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-password>
|
||||
fn set_password(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
let url = match self.get_url().borrow_mut().as_mut() {
|
||||
// Step 3. If url is null or url cannot have a username/password/port, then return.
|
||||
None => return,
|
||||
Some(ref url) if url.host().is_none() || url.cannot_be_a_base() => return,
|
||||
// Step 4. Set the password, given url and the given value.
|
||||
Some(url) => {
|
||||
UrlHelper::SetPassword(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
|
||||
// Step 5. Update href.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-pathname>
|
||||
fn get_pathname(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
match *self.get_url().borrow() {
|
||||
// Step 3. If url is null, then return the empty string.
|
||||
None => USVString(String::new()),
|
||||
// Steps 4. Return the result of URL path serializing url.
|
||||
Some(ref url) => UrlHelper::Pathname(url),
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-pathname>
|
||||
fn set_pathname(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
let url = match self.get_url().borrow_mut().as_mut() {
|
||||
// Step 3. If url is null or url has an opaque path, then return.
|
||||
None => return,
|
||||
Some(ref url) if url.cannot_be_a_base() => return,
|
||||
// Step 4. Set url's path to the empty list.
|
||||
// Step 5. Basic URL parse the given value, with url as url and path start state as state override.
|
||||
Some(url) => {
|
||||
UrlHelper::SetPathname(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
|
||||
// Step 6. Update href.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-port>
|
||||
fn get_port(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
match *self.get_url().borrow() {
|
||||
// Step 3. If url or url's port is null, return the empty string.
|
||||
None => USVString(String::new()),
|
||||
// Step 4. Return url's port, serialized.
|
||||
Some(ref url) => UrlHelper::Port(url),
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-port>
|
||||
fn set_port(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
let url = match self.get_url().borrow_mut().as_mut() {
|
||||
// Step 3. If url is null or url cannot have a username/password/port, then return.
|
||||
None => return,
|
||||
Some(ref url)
|
||||
// https://url.spec.whatwg.org/#cannot-have-a-username-password-port
|
||||
if url.host().is_none() || url.cannot_be_a_base() || url.scheme() == "file" =>
|
||||
{
|
||||
return;
|
||||
},
|
||||
// Step 4. If the given value is the empty string, then set url's port to null.
|
||||
// Step 5. Otherwise, basic URL parse the given value, with url as url and port state as
|
||||
// state override.
|
||||
Some(url) => {
|
||||
UrlHelper::SetPort(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
|
||||
// Step 6. Update href.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-protocol>
|
||||
fn get_protocol(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.get_url().borrow() {
|
||||
// Step 2. If this's url is null, return ":".
|
||||
None => USVString(":".to_owned()),
|
||||
// Step 3. Return this's url's scheme, followed by ":".
|
||||
Some(ref url) => UrlHelper::Protocol(url),
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-protocol>
|
||||
fn set_protocol(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
let url = match self.get_url().borrow_mut().as_mut() {
|
||||
// Step 2. If this's url is null, then return.
|
||||
None => return,
|
||||
// Step 3. Basic URL parse the given value, followed by ":", with this's url as url and
|
||||
// scheme start state as state override.
|
||||
Some(url) => {
|
||||
UrlHelper::SetProtocol(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
|
||||
// Step 4. Update href.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-search>
|
||||
fn get_search(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
match *self.get_url().borrow() {
|
||||
// Step 3. If url is null, or url's query is either null or the empty string, return the
|
||||
// empty string.
|
||||
// Step 4. Return "?", followed by url's query.
|
||||
// Note: This is handled in UrlHelper::Search
|
||||
None => USVString(String::new()),
|
||||
Some(ref url) => UrlHelper::Search(url),
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-search>
|
||||
fn set_search(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
let url = match self.get_url().borrow_mut().as_mut() {
|
||||
// Step 3. If url is null, terminate these steps.
|
||||
None => return,
|
||||
// Step 4. If the given value is the empty string, set url's query to null.
|
||||
// Step 5. Otherwise:
|
||||
Some(url) => {
|
||||
// Note: Inner steps are handled by UrlHelper::SetSearch
|
||||
UrlHelper::SetSearch(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
|
||||
// Step 6. Update href.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-username>
|
||||
fn get_username(&self) -> USVString {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
match *self.get_url().borrow() {
|
||||
// Step 2. If this's url is null, return the empty string.
|
||||
None => USVString(String::new()),
|
||||
// Step 3. Return this's url's username.
|
||||
Some(ref url) => UrlHelper::Username(url),
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#concept-hyperlink-url-set>
|
||||
fn set_url(&self) {
|
||||
// Step 1. Set this element's url to null.
|
||||
*self.get_url().borrow_mut() = None;
|
||||
|
||||
let attribute = self
|
||||
.upcast::<Element>()
|
||||
.get_attribute(&ns!(), &local_name!("href"));
|
||||
|
||||
// Step 2. If this element's href content attribute is absent, then return.
|
||||
let Some(attribute) = attribute else {
|
||||
return;
|
||||
};
|
||||
|
||||
let document = self.owner_document();
|
||||
|
||||
// Step 3. Let url be the result of encoding-parsing a URL given this element's href content
|
||||
// attribute's value, relative to this element's node document.
|
||||
let url = document.encoding_parse_a_url(&attribute.value());
|
||||
|
||||
// Step 4. If url is not failure, then set this element's url to url.
|
||||
if let Ok(url) = url {
|
||||
*self.get_url().borrow_mut() = Some(url);
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-hyperlink-username>
|
||||
fn set_username(&self, value: USVString, can_gc: CanGc) {
|
||||
// Step 1. Reinitialize url.
|
||||
self.reinitialize_url();
|
||||
|
||||
// Step 2. Let url be this's url.
|
||||
let url = match self.get_url().borrow_mut().as_mut() {
|
||||
// Step 3. If url is null or url cannot have a username/password/port, then return.
|
||||
None => return,
|
||||
Some(ref url) if url.host().is_none() || url.cannot_be_a_base() => return,
|
||||
// Step 4. Set the username, given url and the given value.
|
||||
Some(url) => {
|
||||
UrlHelper::SetUsername(url, value);
|
||||
DOMString::from(url.as_str())
|
||||
},
|
||||
};
|
||||
|
||||
// Step 5. Update href.
|
||||
self.update_href(url, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#update-href>
|
||||
fn update_href(&self, url: DOMString, can_gc: CanGc) {
|
||||
self.upcast::<Element>()
|
||||
.set_string_attribute(&local_name!("href"), url, can_gc);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#reinitialise-url>
|
||||
fn reinitialize_url(&self) {
|
||||
// Step 1. If the element's url is non-null, its scheme is "blob", and it has an opaque
|
||||
// path, then terminate these steps.
|
||||
match *self.get_url().borrow() {
|
||||
Some(ref url) if url.scheme() == "blob" && url.cannot_be_a_base() => return,
|
||||
_ => (),
|
||||
}
|
||||
|
||||
// Step 2. Set the url.
|
||||
self.set_url();
|
||||
}
|
||||
}
|
|
@ -370,6 +370,7 @@ pub(crate) mod htmlheadelement;
|
|||
pub(crate) mod htmlheadingelement;
|
||||
pub(crate) mod htmlhrelement;
|
||||
pub(crate) mod htmlhtmlelement;
|
||||
pub(crate) mod htmlhyperlinkelementutils;
|
||||
pub(crate) mod htmliframeelement;
|
||||
pub(crate) mod htmlimageelement;
|
||||
pub(crate) mod htmlinputelement;
|
||||
|
|
|
@ -232,7 +232,7 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
"HTMLAreaElement": {
|
||||
"canGc": ["SetRel"]
|
||||
"canGc": ['SetText', 'SetRel', 'SetHref', 'SetHash', 'SetHost', 'SetHostname', 'SetPassword', 'SetPathname', 'SetPort', 'SetProtocol', 'SetSearch', 'SetUsername']
|
||||
},
|
||||
|
||||
"HTMLBodyElement": {
|
||||
|
|
|
@ -25,7 +25,7 @@ interface HTMLAreaElement : HTMLElement {
|
|||
[CEReactions] attribute DOMString referrerPolicy;
|
||||
// hreflang and type are not reflected
|
||||
};
|
||||
//HTMLAreaElement includes HTMLHyperlinkElementUtils;
|
||||
HTMLAreaElement includes HTMLHyperlinkElementUtils;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#HTMLAreaElement-partial
|
||||
partial interface HTMLAreaElement {
|
||||
|
|
|
@ -44,9 +44,6 @@
|
|||
[When clicking child <AREA></AREA> of parent <FORM><BUTTON type=reset></BUTTON></FORM>, only child should be activated.]
|
||||
expected: FAIL
|
||||
|
||||
[When clicking child <AREA></AREA> of parent <A></A>, only child should be activated.]
|
||||
expected: FAIL
|
||||
|
||||
[When clicking child <AREA></AREA> of parent <DETAILS><SUMMARY></SUMMARY></DETAILS>, only child should be activated.]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -6685,42 +6685,6 @@
|
|||
[HTMLAreaElement interface: attribute noHref]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute href]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: stringifier]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute origin]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute protocol]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute username]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute password]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute host]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute hostname]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute port]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute pathname]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute search]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: attribute hash]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "alt" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -6739,39 +6703,6 @@
|
|||
[HTMLAreaElement interface: document.createElement("area") must inherit property "noHref" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "href" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "origin" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "protocol" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "username" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "password" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "host" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "hostname" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "port" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "pathname" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "search" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement interface: document.createElement("area") must inherit property "hash" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLTableElement interface: attribute align]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
[dynamic-urls.sub.html]
|
||||
[The 'href' attribute of the 'area' element]
|
||||
expected: FAIL
|
||||
|
||||
[The 'cite' attribute of the 'ins' element]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
[historical.sub.xhtml]
|
||||
[The 'href' attribute of the 'area' element]
|
||||
expected: FAIL
|
||||
|
||||
[The 'cite' attribute of the 'ins' element]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
[area-stringifier.html]
|
||||
[HTMLAreaElement stringifier 1]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement stringifier 2]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement stringifier 4]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement stringifier 5]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement stringifier 6]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement stringifier 7]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement stringifier 9]
|
||||
expected: FAIL
|
||||
|
||||
[HTMLAreaElement stringifier 10]
|
||||
expected: FAIL
|
|
@ -1,57 +0,0 @@
|
|||
[non-parsable-url-getter-setter.window.html]
|
||||
[<area href="http://test:test/">.origin getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.protocol getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.protocol setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.username getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.username setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.password getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.password setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.host getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.host setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.hostname getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.hostname setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.port getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.port setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.pathname getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.pathname setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.search getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.search setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.hash getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="http://test:test/">.hash setter]
|
||||
expected: FAIL
|
|
@ -1,57 +0,0 @@
|
|||
[non-special-opaque-path-url-getter-setter.window.html]
|
||||
[<area href="non-special:opaque">.origin getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.protocol getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.protocol setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.username getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.username setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.password getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.password setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.host getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.host setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.hostname getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.hostname setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.port getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.port setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.pathname getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.pathname setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.search getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.search setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.hash getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special:opaque">.hash setter]
|
||||
expected: FAIL
|
|
@ -1,45 +0,0 @@
|
|||
[non-special-url-getter-setter.window.html]
|
||||
[<area href="non-special://test:9001/">.origin getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.protocol getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.protocol setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.username getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.password getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.host getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.host setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.hostname getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.port getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.pathname getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.pathname setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.search getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.search setter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.hash getter]
|
||||
expected: FAIL
|
||||
|
||||
[<area href="non-special://test:9001/">.hash setter]
|
||||
expected: FAIL
|
522
tests/wpt/meta/url/toascii.window.js.ini
vendored
522
tests/wpt/meta/url/toascii.window.js.ini
vendored
|
@ -11,39 +11,9 @@
|
|||
[a%C2%ADb (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[ab (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[<5B>.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[x01234567890123456789012345678901234567890123456789012345678901† (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn-- (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[<5B>.com (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[x01234567890123456789012345678901234567890123456789012345678901† (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a-yoc (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[<5B>.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[%C2%AD (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -56,90 +26,36 @@
|
|||
[x-.β (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--zn7c.com (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--zn7c.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a.β (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a-yoc (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--1ug.example (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--zn7c.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[.example (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a-yoc (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.β (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[.example (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[xn-- (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--1ug.example (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.β (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[يa (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a.xn--nxa (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[ab (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a.xn--nxa (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -152,12 +68,6 @@
|
|||
[xn--a.β (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[يa (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[x01234567890123456789012345678901234567890123456789012345678901x.β (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -170,446 +80,14 @@
|
|||
[xn-- (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[يa (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[.example (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a.β (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[%C2%AD (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--1ug.example (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[%C2%AD (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--nxa.β (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.ß (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.ß (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.ß (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.ß (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[x..ß (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[x..ß (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a.xn--zca (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a.xn--zca (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a.xn--zca (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a.ß (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a.ß (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--a.ß (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--tešla (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--tešla (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--tešla (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--zca.ß (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--zca.ß (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ab--c.ß (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ab--c.ß (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[x01234567890123456789012345678901234567890123456789012345678901x.ß (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[x01234567890123456789012345678901234567890123456789012345678901x.ß (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.ß (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.ß (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--ls8h= (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--ls8h= (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--ls8h= (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[≠ (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[≠ (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[≮ (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[≮ (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[≯ (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[≯ (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[≠ (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[≠ (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[≮ (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[≮ (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[≯ (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[≯ (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[≠ (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[≠ (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[≮ (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[≮ (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[≯ (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[≯ (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[faß.de (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[faß.de (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[βόλος.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[βόλος.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[www.looĸout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[www.looĸout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ᗯᗯᗯ.lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ᗯᗯᗯ.lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[www.lookout.сом (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[www.lookout.сом (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[www‥lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[www‥lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[www‥lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[www.lookout‧net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[www.lookout‧net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[www.lookout.net⩴80 (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[www.lookout.net⩴80 (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[www.lookout.net⩴80 (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[www .lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[www .lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[www .lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[ lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[\x1flookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[\x1flookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[\x1flookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[look⿰out.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[look⿰out.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[look⿰out.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[looḱout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[looḱout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[lookout.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[look־out.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[look־out.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[look־out.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[Bücher.de (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[Bücher.de (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[♥.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[♥.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[.net (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[Ӏ.com (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[Ӏ.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[Ӏ.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[㛼.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[㛼.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[Ↄ.com (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[Ↄ.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[Ↄ.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[look͏out.net (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[look͏out.net (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[gOoGle.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[gOoGle.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ড়.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ড়.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ẞ.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ẞ.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ẞ.foo.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ẞ.foo.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--0.com (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--0.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[xn--0.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[foò.bar.com (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[foò.bar.com (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
|
759
tests/wpt/meta/url/url-setters-a-area.window.js.ini
vendored
759
tests/wpt/meta/url/url-setters-a-area.window.js.ini
vendored
|
@ -1,101 +1,11 @@
|
|||
[url-setters-a-area.window.html?include=javascript]
|
||||
[<area>: Setting <javascript:alert(1)>.protocol = 'defuse']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <javascript:alert(1)>.username = 'wario']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <javascript://x/>.username = 'wario']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <javascript://x/>.password = 'bowser']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <javascript://x/>.port = '12']
|
||||
expected: FAIL
|
||||
|
||||
[<a>: Setting <javascript:alert(1)>.hash = 'castle']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <javascript:alert(1)>.hash = 'castle']
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[url-setters-a-area.window.html?include=mailto]
|
||||
[<area>: Setting <mailto:me@example.net>.protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <mailto:you@example.net>.username = 'me' Cannot-be-a-base means no username]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <mailto:me@example.net>.password = 'secret' Cannot-be-a-base means no password]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <mailto:me@example.net>.host = 'example.com' Cannot-be-a-base means no host]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <mailto:me@example.net>.hostname = 'example.com' Cannot-be-a-base means no host]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <mailto:me@example.net>.pathname = '/foo' Cannot-be-a-base don’t have a path]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <mailto:me@example.net>.pathname = '/foo' Opaque paths cannot be set]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[url-setters-a-area.window.html?include=file]
|
||||
[<area>: Setting <file://localhost/>.protocol = 'http' Can’t switch from file URL with no host]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file:///test>.protocol = 'https']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file:>.protocol = 'wss']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://hi/path>.protocol = 's']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file:///home/you/index.html>.username = 'me' No host means no username]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://test/>.username = 'test']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file:///home/me/index.html>.password = 'secret' No host means no password]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://test/>.password = 'test']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://y/>.host = 'x:123']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://y/>.host = 'loc%41lhost']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://hi/x>.host = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://y/>.hostname = 'x:123']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://y/>.hostname = 'loc%41lhost']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://hi/x>.hostname = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://test/>.port = '12']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file://localhost/>.port = '12']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file:///some/path>.pathname = '' Special URLs cannot have their paths erased]
|
||||
expected: FAIL
|
||||
|
||||
[<a>: Setting <file://monkey/>.pathname = '\\\\' File URLs and (back)slashes]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -114,320 +24,8 @@
|
|||
[<area>: Setting <file:///unicorn>.pathname = '//monkey/..//' File URLs and (back)slashes]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <file:///var/log/system.log>.href = 'http://0300.168.0xF0']
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[url-setters-a-area.window.html?exclude=(file|javascript|mailto)]
|
||||
[<area>: Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a://example.net>.protocol = 'b']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a://example.net>.protocol = 'B' Upper-case ASCII is lower-cased]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a://example.net>.protocol = 'é' Non-ASCII is rejected]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a://example.net>.protocol = '0b' No leading digit]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a://example.net>.protocol = '+b' No leading punctuation]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a://example.net>.protocol = 'bC0+-.']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a://example.net>.protocol = 'b,c' Only some punctuation is acceptable]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a://example.net>.protocol = 'bé' Non-ASCII is rejected]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://test@example.net>.protocol = 'file' Can’t switch from URL containing username/password/port to file]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net:1234>.protocol = 'file']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <wss://x:x@example.net:1234>.protocol = 'file']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.protocol = 'b' Can’t switch from special scheme to non-special]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net>.protocol = 's']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <ftp://example.net>.protocol = 'test']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <ssh://me@example.net>.protocol = 'http' Can’t switch from non-special scheme to special]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <ssh://me@example.net>.protocol = 'https']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <ssh://me@example.net>.protocol = 'file']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <ssh://example.net>.protocol = 'file']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <nonsense:///test>.protocol = 'https']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.protocol = 'https:foo : bar' Stuff after the first ':' is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <data:text/html,<p>Test>.protocol = 'view-source+data:foo : bar' Stuff after the first ':' is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://foo.com:443/>.protocol = 'https' Port is set to null if it is the default for new scheme.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <unix:/run/foo.socket>.username = 'me' No host means no username]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.username = 'me']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://:secret@example.net>.username = 'me']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://me@example.net>.username = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://me:secret@example.net>.username = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.username = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.username = '%c3%89té' Bytes already percent-encoded are left as-is.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc:///>.username = 'x']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <unix:/run/foo.socket>.password = 'secret' No host means no password]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.password = 'secret']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://me@example.net>.password = 'secret']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://:secret@example.net>.password = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://me:secret@example.net>.password = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.password = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.password = '%c3%89té' Bytes already percent-encoded are left as-is.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc:///>.password = 'x']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.host = '\x00' Non-special scheme]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.host = '\t']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.host = '\n']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.host = '\r']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.host = ' ']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.host = '#']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.host = '/']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.host = '?']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.host = '@']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.host = 'ß']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://x/>.host = 'ß' IDNA Nontransitional_Processing]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <data:text/plain,Stuff>.host = 'example.net' Cannot-be-a-base means no host]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.host = 'example.com:8080']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080>.host = 'example.com' Port number is unchanged if not specified in the new value]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080>.host = 'example.com:' Port number is unchanged if not specified]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.host = '' The empty host is not valid for special schemes]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <view-source+http://example.net/foo>.host = '' The empty host is OK for non-special schemes]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a:/foo>.host = 'example.net' Path-only URLs can gain a host]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.host = '0x7F000001:8080' IPv4 address syntax is normalized]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.host = '[::0:01\]:2' IPv6 address syntax is normalized]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.host = '[2001:db8::2\]:4002' IPv6 literal address with port, crbug.com/1012416]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.host = 'example.com:80' Default port number is removed]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net>.host = 'example.com:443' Default port number is removed]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net>.host = 'example.com:80' Default port number is only removed for the relevant scheme]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080>.host = 'example.com:80' Port number is removed if new port is scheme default and existing URL has a non-default port]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com/stuff' Stuff after a / delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com:8080/stuff' Stuff after a / delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com?stuff' Stuff after a ? delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com:8080?stuff' Stuff after a ? delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com#stuff' Stuff after a # delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com:8080#stuff' Stuff after a # delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com\\stuff' Stuff after a \\ delimiter is ignored for special schemes]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com:8080\\stuff' Stuff after a \\ delimiter is ignored for special schemes]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <view-source+http://example.net/path>.host = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, but still forbidden in hosts]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <view-source+http://example.net/path>.host = 'example.com:8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com:8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com:8080+2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com:65535' Port numbers are 16 bit integers]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com:65536' Port numbers are 16 bit integers, overflowing is an error. Hostname is still set, though.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/>.host = '[google.com\]' Broken IPv6]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/>.host = '[::1.2.3.4x\]']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/>.host = '[::1.2.3.\]']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/>.host = '[::1.2.\]']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/>.host = '[::1.\]']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://test@test/>.host = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://test:12/>.host = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.com/>.host = '///bad.com' Leading / is not stripped]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://example.com/>.host = '///bad.com' Leading / is not stripped]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.hostname = '\x00' Non-special scheme]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.hostname = '\t']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.hostname = '\n']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.hostname = '\r']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.hostname = ' ']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.hostname = '#']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.hostname = '/']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.hostname = '?']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.hostname = '@']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <data:text/plain,Stuff>.hostname = 'example.net' Cannot-be-a-base means no host]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080>.hostname = 'example.com']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hostname = '' The empty host is not valid for special schemes]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <view-source+http://example.net/foo>.hostname = '' The empty host is OK for non-special schemes]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a:/foo>.hostname = 'example.net' Path-only URLs can gain a host]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080>.hostname = '0x7F000001' IPv4 address syntax is normalized]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hostname = '[::0:01\]' IPv6 address syntax is normalized]
|
||||
expected: FAIL
|
||||
|
||||
[<a>: Setting <http://example.net/path>.hostname = 'example.com:8080' : delimiter invalidates entire value]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -440,365 +38,8 @@
|
|||
[<area>: Setting <http://example.net:8080/path>.hostname = 'example.com:' : delimiter invalidates entire value]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.hostname = 'example.com/stuff' Stuff after a / delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.hostname = 'example.com?stuff' Stuff after a ? delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.hostname = 'example.com#stuff' Stuff after a # delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.hostname = 'example.com\\stuff' Stuff after a \\ delimiter is ignored for special schemes]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <view-source+http://example.net/path>.hostname = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, but still forbidden in hosts]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/>.hostname = '[google.com\]' Broken IPv6]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/>.hostname = '[::1.2.3.4x\]']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/>.hostname = '[::1.2.3.\]']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/>.hostname = '[::1.2.\]']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/>.hostname = '[::1.\]']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://test@test/>.hostname = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://test:12/>.hostname = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <non-spec:/.//p>.hostname = 'h' Drop /. from path]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <non-spec:/.//p>.hostname = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.com/>.hostname = '///bad.com' Leading / is not stripped]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://example.com/>.hostname = '///bad.com' Leading / is not stripped]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.port = '8080']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080>.port = '' Port number is removed if empty is the new value]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080>.port = '80' Default port number is removed]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net:4433>.port = '443' Default port number is removed]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net>.port = '80' Default port number is only removed for the relevant scheme]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.port = '8080/stuff' Stuff after a / delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.port = '8080?stuff' Stuff after a ? delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.port = '8080#stuff' Stuff after a # delimiter is ignored]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.port = '8080\\stuff' Stuff after a \\ delimiter is ignored for special schemes]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <view-source+http://example.net/path>.port = '8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.port = '8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.port = '8080+2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.port = '65535' Port numbers are 16 bit integers]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080/path>.port = '65536' Port numbers are 16 bit integers, overflowing is an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <non-special://example.net:8080/path>.port = '65536' Port numbers are 16 bit integers, overflowing is an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <non-base:value>.port = '12']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc:///>.port = '12']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://x/>.port = '12']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <foo://somehost/some/path>.pathname = '' Non-special URLs can have their paths erased]
|
||||
expected: FAIL
|
||||
|
||||
[<a>: Setting <foo:///some/path>.pathname = '' Non-special URLs with an empty host can have their paths erased]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <foo:///some/path>.pathname = '' Non-special URLs with an empty host can have their paths erased]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <foo:/some/path>.pathname = '' Path-only URLs cannot have their paths erased]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <foo:/some/path>.pathname = 'test' Path-only URLs always have an initial slash]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <unix:/run/foo.socket?timeout=10>.pathname = '/var/log/../run/bar.socket']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net#nav>.pathname = 'home']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net#nav>.pathname = '../home']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/home?lang=fr#nav>.pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is a segment delimiter for 'special' URLs]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is *not* a segment delimiter for non-'special' URLs]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a:/>.pathname = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, including %2E outside dotted segments.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.pathname = '?' ? needs to be encoded]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.pathname = '#' # needs to be encoded]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://example.net>.pathname = '?' ? needs to be encoded, non-special scheme]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc://example.net>.pathname = '#' # needs to be encoded, non-special scheme]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.pathname = '/?é' ? doesn't mess up encoding]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.pathname = '/#é' # doesn't mess up encoding]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <non-spec:/>.pathname = '/.//p' Serialize /. in path]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <non-spec:/>.pathname = '/..//p']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <non-spec:/>.pathname = '//p']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <non-spec:/.//>.pathname = 'p' Drop /. from path]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net#nav>.search = 'lang=fr']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net?lang=en-US#nav>.search = 'lang=fr']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net?lang=en-US#nav>.search = '?lang=fr']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net?lang=en-US#nav>.search = '??lang=fr']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net?lang=en-US#nav>.search = '?']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net?lang=en-US#nav>.search = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net?lang=en-US>.search = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net>.search = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a:/>.search = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the query encode set. Tabs and newlines are removed.]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.search = '%c3%89té' Bytes already percent-encoded are left as-is]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net>.hash = 'main']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net#nav>.hash = 'main']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net?lang=en-US>.hash = '##nav']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net?lang=en-US#nav>.hash = '#main']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net?lang=en-US#nav>.hash = '#']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.net?lang=en-US#nav>.hash = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hash = '#foo bar']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hash = '#foo"bar']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hash = '#foo<bar']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hash = '#foo>bar']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hash = '#foo`bar']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <a:/>.hash = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' Simple percent-encoding; tabs and newlines are removed]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hash = 'a\x00b' Percent-encode NULLs in fragment]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <non-spec:/>.hash = 'a\x00b' Percent-encode NULLs in fragment]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hash = '%c3%89té' Bytes already percent-encoded are left as-is]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <data:original>.pathname = 'new value']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc:original>.pathname = 'new value']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <data:/nospace>.pathname = 'space ' Non-special URLs with non-opaque paths percent-encode U+0020]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc:/nospace>.pathname = 'space ']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <data:space ?query>.search = '' Drop trailing spaces from trailing opaque paths]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc:space ?query>.search = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <data:space ?query#fragment>.search = '' Do not drop trailing spaces from non-trailing opaque paths]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc:space ?query#fragment>.search = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <data:space #fragment>.hash = '' Drop trailing spaces from trailing opaque paths]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc:space #fragment>.hash = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <data:space ?query#fragment>.hash = '' Do not drop trailing spaces from non-trailing opaque paths]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <sc:space ?query#fragment>.hash = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://test/>.protocol = 'h\r\ntt\tps' Tab and newline are stripped]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://test/>.protocol = 'https\r']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://test/>.protocol = 'https\x00' Non-tab/newline C0 controls result in no-op]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://test/>.protocol = 'https\x0c']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://test/>.protocol = 'https\x0e']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://test/>.protocol = 'https ']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.com/>.host = 'a%C2%ADb']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.com/>.host = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.com/>.host = '%C2%AD']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.com/>.host = 'xn--']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.com/>.hostname = 'a%C2%ADb']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.com/>.hostname = '']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.com/>.hostname = '%C2%AD']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://example.com/>.hostname = 'xn--']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080/path>.port = 'randomstring' Setting port to a string that doesn't parse as a number]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://domain.com:443>.port = '\t8080' Leading u0009 on special scheme]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <wpt++://domain.com:443>.port = '\t8080' Leading u0009 on non-special scheme]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://www.google.com:4343>.port = '4wpt' Should use all ascii prefixed characters as port]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.pathname = ' ' Trailing space should be encoded]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.pathname = '\x00' Trailing C0 control should be encoded]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.search = ' ' Trailing space should be encoded]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.search = '\x00' Trailing C0 control should be encoded]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hash = ' ' Trailing space should be encoded]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net>.hash = '\x00' Trailing C0 control should be encoded]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net/path>.host = 'example.com?stuff:8080' Stuff after a ? delimiter is ignored, trailing 'port']
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080>.host = 'example.com:invalid' Anything other than ASCII digit stops the port parser in a setter but is not an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080/test>.host = '[::1\]:invalid' Anything other than ASCII digit stops the port parser in a setter but is not an error]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <http://example.net:8080/test>.host = '[::1\]' IPv6 without port]
|
||||
expected: FAIL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue