Просмотр исходного кода

fix: handle special case for allowfullscreen on <embed>

close #6202
Evan You 8 лет назад
Родитель
Сommit
d77b95317c
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      src/platforms/web/runtime/modules/attrs.js

+ 6 - 1
src/platforms/web/runtime/modules/attrs.js

@@ -64,7 +64,12 @@ function setAttr (el: Element, key: string, value: any) {
     if (isFalsyAttrValue(value)) {
       el.removeAttribute(key)
     } else {
-      el.setAttribute(key, key)
+      // technically allowfullscreen is a boolean attribute for <iframe>,
+      // but Flash expects a value of "true" when used on <embed> tag
+      value = key === 'allowfullscreen' && el.tagName === 'EMBED'
+        ? 'true'
+        : key
+      el.setAttribute(key, value)
     }
   } else if (isEnumeratedAttr(key)) {
     el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true')