The My Opera forums have been replaced with forums.opera.com. Please head over there to discuss Opera's products and features
See the new ForumsYou need to be logged in to post in the forums. If you do not have an account, please sign up first.
getComputedStyle not being returned at all for CSS properties that have the -o- vendor prefix
Hi,I'm using Opera 11.50 (build 1074) on OSX 10.6.8, and have run into a problem: It seems that window.getComputedStyle fails to work for CSS properties that start with Opera's -o- vendor prefix. Specifically, I'm looking to get access to the -o-transition-* property values.
I've searched on this forum for "getComputedStyle" but no posts were returned, so Im guessing it's not something that has been noticed before. I'm using the HTML 5 doctype, so I'd have thought that everything should work nicely... I know the CSS is being applied from looking at the element using Opera's inspector.
I've even tried a cut-down test, as follows, which shows it working for properties without the prefix:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Opera getComputedStyle test</title>
<style type="text/css">
body {
-o-transition-property: width;
border: 17px solid red;
}
</style>
<script type="text/javascript">
window.onload = function() {
var s1 = window.getComputedStyle(document.body, null).getPropertyValue('-o-transition-property');
var s2 = window.getComputedStyle(document.body, null).getPropertyValue('border-width');
alert(
'-o-transition-property style is set to [' + s1 + ']'
+ '\n\n' +
'border-width style is set to [' + s2 + ']'
);
}
</script>
</head>
<body>
<p>Opera getComputedStyle test</p>
</body>
</html>
Am I missing something obvious, or is this a bug that needs reporting?
Thanks!
Dan