Bug 96489
Summary: | Dynamically switching background-size doesn't work correctly | ||
---|---|---|---|
Product: | WebKit | Reporter: | laurent.mary.44 |
Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WORKSFORME | ||
Severity: | Normal | CC: | mitz, simon.fraser |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | Unspecified | ||
URL: | http://jsfiddle.net/B3dks/4/ |
laurent.mary.44
The javascript implementation of the background-size property for the values "cover" and "contain" is inverted with the CSS rendering.
- Css3 background-size:cover gives the same result that javascript document.getElementById("test").style.backgroundSize = "contain";
- Css3 background-size:contain gives the same result that javascript document.getElementById("test").style.backgroundSize = "cover";
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Simon Fraser (smfr)
Your JS is wrong in the fiddle:
document.getElementById(divJS).style.backgroundSize = "cover";
should be
document.getElementById('divJS').style.backgroundSize = "cover";