Lines Matching +full:whatwg +full:- +full:url
1 // Copyright 2016 The rust-url developers.
3 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
11 use crate::Url;
14 pub fn url_origin(url: &Url) -> Origin { in url_origin()
15 let scheme = url.scheme(); in url_origin()
18 let result = Url::parse(url.path()); in url_origin()
20 Ok(ref url) => url_origin(url), in url_origin()
26 url.host().unwrap().to_owned(), in url_origin()
27 url.port_or_known_default().unwrap(), in url_origin()
35 /// The origin of an URL
43 /// - If the scheme is "blob" the origin is the origin of the
44 /// URL contained in the path component. If parsing fails,
46 /// - If the scheme is "ftp", "http", "https", "ws", or "wss",
48 /// - If the scheme is anything else, the origin is opaque, meaning
49 /// the URL does not have the same origin as any other URL.
51 /// For more information see <https://url.spec.whatwg.org/#origin>
57 /// Consists of the URL's scheme, host and port
63 pub fn new_opaque() -> Origin { in new_opaque()
70 pub fn is_tuple(&self) -> bool { in is_tuple()
74 /// <https://html.spec.whatwg.org/multipage/#ascii-serialisation-of-an-origin>
75 pub fn ascii_serialization(&self) -> String { in ascii_serialization()
88 /// <https://html.spec.whatwg.org/multipage/#unicode-serialisation-of-an-origin>
89 pub fn unicode_serialization(&self) -> String { in unicode_serialization()