mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #10287 - Ms2ger:domain, r=jdm
Include square brackets for IPv6 addresses in Document::domain. The specification changed out from under us. It's unfortunately impossible to write a test for this right now. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10287) <!-- Reviewable:end -->
This commit is contained in:
commit
af06d32628
1 changed files with 0 additions and 6 deletions
|
@ -1767,12 +1767,6 @@ impl DocumentMethods for Document {
|
||||||
fn Domain(&self) -> DOMString {
|
fn Domain(&self) -> DOMString {
|
||||||
// TODO: This should use the effective script origin when it exists
|
// TODO: This should use the effective script origin when it exists
|
||||||
let origin = self.window.get_url();
|
let origin = self.window.get_url();
|
||||||
|
|
||||||
if let Some(&Host::Ipv6(ipv6)) = origin.host() {
|
|
||||||
// Omit square brackets for IPv6 addresses.
|
|
||||||
return DOMString::from(ipv6.to_string());
|
|
||||||
}
|
|
||||||
|
|
||||||
DOMString::from(origin.serialize_host().unwrap_or_else(|| "".to_owned()))
|
DOMString::from(origin.serialize_host().unwrap_or_else(|| "".to_owned()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue