Merge pull request #5104 from Rob--W/crx-contentscript-fix

Use CSS.supports instead of '..' in ....style
This commit is contained in:
Tim van der Meij 2014-07-30 23:43:45 +02:00
commit 1911bb28bb

View File

@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* globals chrome */ /* globals chrome, CSS */
'use strict'; 'use strict';
@ -45,7 +45,7 @@ if (typeof Element.prototype.createShadowRoot !== 'undefined') {
// Only observe the document if we can make use of Shadow DOM. // Only observe the document if we can make use of Shadow DOM.
if (createShadowRoot) { if (createShadowRoot) {
if ('animation' in document.documentElement.style) { if (CSS.supports('animation', '0s')) {
document.addEventListener('animationstart', onAnimationStart, true); document.addEventListener('animationstart', onAnimationStart, true);
} else { } else {
document.addEventListener('webkitAnimationStart', onAnimationStart, true); document.addEventListener('webkitAnimationStart', onAnimationStart, true);