Bug 870021 - Part 1.3 - Add srcset to HTMLImageElement & atoms. r=jst, sr=jst

This commit is contained in:
John Schoenick 2014-03-19 14:18:24 -07:00
parent 1a9d741d4f
commit 5024f327e2
6 changed files with 14 additions and 3 deletions

View File

@ -1044,6 +1044,7 @@ GK_ATOM(spring, "spring")
GK_ATOM(src, "src")
GK_ATOM(srcdoc, "srcdoc")
GK_ATOM(srclang, "srclang")
GK_ATOM(srcset, "srcset")
GK_ATOM(stack, "stack")
GK_ATOM(standalone, "standalone")
GK_ATOM(standby, "standby")

View File

@ -86,6 +86,7 @@ NS_IMPL_BOOL_ATTR(HTMLImageElement, IsMap, ismap)
NS_IMPL_URI_ATTR(HTMLImageElement, LongDesc, longdesc)
NS_IMPL_STRING_ATTR(HTMLImageElement, Lowsrc, lowsrc)
NS_IMPL_URI_ATTR(HTMLImageElement, Src, src)
NS_IMPL_STRING_ATTR(HTMLImageElement, Srcset, srcset)
NS_IMPL_STRING_ATTR(HTMLImageElement, UseMap, usemap)
NS_IMPL_INT_ATTR(HTMLImageElement, Vspace, vspace)

View File

@ -132,6 +132,10 @@ public:
{
SetHTMLAttr(nsGkAtoms::src, aSrc, aError);
}
void SetSrcset(const nsAString& aSrcset, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::srcset, aSrcset, aError);
}
void SetCrossOrigin(const nsAString& aCrossOrigin, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::crossorigin, aCrossOrigin, aError);

View File

@ -16,11 +16,12 @@
* http://www.whatwg.org/specs/web-apps/current-work/
*/
[uuid(d3e488b9-3b29-410a-bcf4-18fb874c170a)]
[uuid(cb5140c8-1df7-41eb-a70e-927283ac0990)]
interface nsIDOMHTMLImageElement : nsISupports
{
attribute DOMString alt;
attribute DOMString src;
attribute DOMString srcset;
attribute DOMString crossOrigin;
attribute DOMString useMap;
attribute boolean isMap;

View File

@ -23,7 +23,8 @@ interface HTMLImageElement : HTMLElement {
attribute DOMString alt;
[SetterThrows]
attribute DOMString src;
// attribute DOMString srcset;
[SetterThrows, Pref="dom.image.srcset.enabled"]
attribute DOMString srcset;
[SetterThrows]
attribute DOMString crossOrigin;
[SetterThrows]

View File

@ -3897,6 +3897,9 @@ pref("dom.vibrator.max_vibrate_list_len", 128);
// Battery API
pref("dom.battery.enabled", true);
// Image srcset
pref("dom.image.srcset.enabled", false);
// WebSMS
pref("dom.sms.enabled", false);
// Enable Latin characters replacement with corresponding ones in GSM SMS