Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
Merge branch 'jcutrell-sourcesrc-notification'
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilto committed Jul 15, 2014
2 parents cdf8e64 + 750fca1 commit a3b3c30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/picturefill.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@
if ( source.nodeName.toUpperCase() !== "SOURCE" ) {
continue;
}
// if it's a source element that has the `src` property set, throw a warning in the console
if ( source.getAttribute( "src" ) !== null && typeof console !== undefined ){
console.warn("The `src` attribute is invalid on `picture` `source` element; instead, use `srcset`.");
}

var media = source.getAttribute( "media" );

Expand Down
6 changes: 6 additions & 0 deletions tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
<source srcset="bar"/>
</picture>

<div class="src-source-check">
<picture>
<source src="foo"/>
</picture>
</div>

</div>

<script src="../src/picturefill.js"></script>
Expand Down

0 comments on commit a3b3c30

Please sign in to comment.