Bug 17856

Summary: Computed Style for WebkitBorderRadius in unimplemented
Product: WebKit Reporter: Garrett Smith <xk1t>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: menard, webkit
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: All   
OS: All   
Attachments:
Description Flags
test case
none
Updated version to use border-radius. none

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.