aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlimageelement.rs
diff options
context:
space:
mode:
authormrnayak <rmuddur@gmail.com>2017-01-13 23:35:00 +0530
committermrnayak <rmuddur@gmail.com>2017-01-13 23:35:00 +0530
commit3d9e44a8c497acd52b428dd02062a9c55a2efafc (patch)
treee62450e7f88ea8152da2d0f0276c25ad5402ed66 /components/script/dom/htmlimageelement.rs
parentdc93a72997aefaeb04cdc058b01fdd2eb14cef8f (diff)
downloadservo-3d9e44a8c497acd52b428dd02062a9c55a2efafc.tar.gz
servo-3d9e44a8c497acd52b428dd02062a9c55a2efafc.zip
Handle crossorigin in link and refactor crossorigin handling
Implemented Step three and handled step four of obtain the resource part of 4.2.4 The link element. Link to spec : https://html.spec.whatwg.org/multipage/semantics.html#concept-link-obtain Refactored crossOrigin handling in HTMLScriptElement, HTMLImageElement
Diffstat (limited to 'components/script/dom/htmlimageelement.rs')
-rw-r--r--components/script/dom/htmlimageelement.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index 29ddcd0a7c4..629d5d50fb6 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -19,6 +19,7 @@ use dom::bindings::refcounted::Trusted;
use dom::bindings::str::DOMString;
use dom::document::Document;
use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers};
+use dom::element::{reflect_cross_origin_attribute, set_cross_origin_attribute};
use dom::event::Event;
use dom::eventtarget::EventTarget;
use dom::htmlareaelement::HTMLAreaElement;
@@ -335,9 +336,14 @@ impl HTMLImageElementMethods for HTMLImageElement {
make_setter!(SetSrc, "src");
// https://html.spec.whatwg.org/multipage/#dom-img-crossOrigin
- make_enumerated_getter!(CrossOrigin, "crossorigin", "anonymous", "use-credentials");
+ fn GetCrossOrigin(&self) -> Option<DOMString> {
+ reflect_cross_origin_attribute(self.upcast::<Element>())
+ }
+
// https://html.spec.whatwg.org/multipage/#dom-img-crossOrigin
- make_setter!(SetCrossOrigin, "crossorigin");
+ fn SetCrossOrigin(&self, value: Option<DOMString>) {
+ set_cross_origin_attribute(self.upcast::<Element>(), value);
+ }
// https://html.spec.whatwg.org/multipage/#dom-img-usemap
make_getter!(UseMap, "usemap");