Bug 17856 - Computed Style for WebkitBorderRadius in unimplemented
Summary: Computed Style for WebkitBorderRadius in unimplemented
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-14 15:23 PDT by Garrett Smith
Modified: 2012-01-13 10:40 PST (History)
2 users (show)

See Also:


Attachments
test case (1.87 KB, text/html)
2009-01-06 04:42 PST, Robert Blaut
no flags Details
Updated version to use border-radius. (1.69 KB, text/html)
2012-01-13 10:40 PST, Alexis Menard (darktears)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Garrett Smith 2008-03-14 15:23:23 PDT
getComputedStyle doesn't work with webkitBorderRadius (among others)

I need this for animation. Currently, this fails in webkit.

The following works in Mozilla:
javascript:alert(getComputedStyle(document.body,'').MozBorderRadiusTopright);

The following does not work in Mozilla because Mozilla does not return shorthand values:
javascript:alert(getComputedStyle(document.body,'').MozBorderRadius)

Both should work in webkit:
javascript:alert(getComputedStyle(document.body,''). WebkitBorderRadius sTopright); // "0px"
javascript:alert(getComputedStyle(document.body,''). WebkitBorderRadius); // "0px"

The first one is pretty straightforward.

The second one is a shorthand value, which falls under another category. FF2 and Safari3 return the empty string for:


AFAIK  - Shorthand values are not guaranteed to return any specific format. Is there a spec reference for this? For example, what format should the following return:

getComputedStyle(document.body,'').margin

 "0px" or "0px 0px 0px 0px"? 
 Preferrably a shorthand would return 1 or 4 values, never "0px 0px" or "0px 0px 0px" -- that would complicate scripts.
Comment 1 Robert Blaut 2009-01-06 04:38:13 PST
WebkitBorderRadius is actually unimplemented in CSSComputedStyleDeclaration::getPropertyCSSValue 

other properties are currently implemented but you should notice differences between Gecko and Webkit:

-moz-border-radius-topleft / -webkit-border-top-left-radius
-moz-border-radius-topright / -webkit-border-top-right-radius
-moz-border-radius-bottomleft / -webkit-border-bottom-left-radius
-moz-border-radius-bottomright / -webkit-border-bottom-right-radius

So WebkitBorderRadiusTopleft doesn't work but WebkitBorderTopLeftRadius works correctly. Check attached test case.
Comment 2 Robert Blaut 2009-01-06 04:42:41 PST
Created attachment 26456 [details]
test case
Comment 3 Alexis Menard (darktears) 2012-01-13 10:40:25 PST
Created attachment 122452 [details]
Updated version to use border-radius.
Comment 4 Alexis Menard (darktears) 2012-01-13 10:40:39 PST
I strongly encourage to use border-radius CSS property rather the vendor prefixed version. I attached a modified version of the test case which output the result as expected. It's almost a simple search and replace.