This does not work due to click-jacking vulnerability.
Example:
Found at: http://www.bioinformatics.org/phplabware/forum/viewtopic.php?id=164
The code would be perfectly validated but it may cause serious damage.
So - rule of thumb use very strict white list or do not allow style attributes.