aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmliframeelement.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-10-10 16:14:40 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-10-11 13:56:07 +0200
commit605c679fee29302321878a74b88aa7165519b516 (patch)
treec52ffde5e21c61b3a5cbdc5aa308247741bb708d /components/script/dom/htmliframeelement.rs
parent826352ab4cae13f5154d13ab53885d80a8057337 (diff)
downloadservo-605c679fee29302321878a74b88aa7165519b516.tar.gz
servo-605c679fee29302321878a74b88aa7165519b516.zip
Fix URL attributes
URL attributes should always use AttrValue::Url, and the input should be resolved against the document's base URL at setting time always.
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r--components/script/dom/htmliframeelement.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 245d61a8d63..2346358aabd 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -568,14 +568,10 @@ pub fn Navigate(iframe: &HTMLIFrameElement, direction: TraversalDirection) -> Er
impl HTMLIFrameElementMethods for HTMLIFrameElement {
// https://html.spec.whatwg.org/multipage/#dom-iframe-src
- fn Src(&self) -> DOMString {
- self.upcast::<Element>().get_string_attribute(&local_name!("src"))
- }
+ make_url_getter!(Src, "src");
// https://html.spec.whatwg.org/multipage/#dom-iframe-src
- fn SetSrc(&self, src: DOMString) {
- self.upcast::<Element>().set_url_attribute(&local_name!("src"), src)
- }
+ make_url_setter!(SetSrc, "src");
// https://html.spec.whatwg.org/multipage/#dom-iframe-sandbox
fn Sandbox(&self) -> DomRoot<DOMTokenList> {
@@ -765,6 +761,7 @@ impl VirtualMethods for HTMLIFrameElement {
fn parse_plain_attribute(&self, name: &LocalName, value: DOMString) -> AttrValue {
match name {
+ &local_name!("src") => AttrValue::from_url(document_from_node(self).base_url(), value.into()),
&local_name!("sandbox") => AttrValue::from_serialized_tokenlist(value.into()),
&local_name!("width") => AttrValue::from_dimension(value.into()),
&local_name!("height") => AttrValue::from_dimension(value.into()),