RESOLVED FIXED Bug 14646
WebKit border radius properties are unavailable via JavaScript
https://bugs.webkit.org/show_bug.cgi?id=14646
Summary WebKit border radius properties are unavailable via JavaScript
David Harrison
Reported 2007-07-17 12:25:05 PDT
* SUMMARY Webkit-specific CSS properties such as -webkit-border-top-right-radius (whether set via shorthand or not) are not retrievable in the DOM. They can be set in the DOM, but their computed style values cannot be retrieved. * STEPS TO REPRODUCE See attached zipfile containing a webkit.html demo file of the problem (see source for specifics of how the calls are made), along with a jQuery .js file and a .css file for some basic styling as taken from the dev page I discovered the bug on. * RESULTS Using the DOM to retrieve the computed style of these properties returns null. EXPECTED: the computed style value should be returned. * NOTES Tested in the latest nightly of Webkit (July 14, 2007)
Attachments
test case (21.70 KB, application/zip)
2007-07-17 12:28 PDT, David Harrison
no flags
patch (8.47 KB, patch)
2007-07-18 21:02 PDT, Sam Weinig
no flags
patch (8.47 KB, patch)
2007-07-18 21:02 PDT, Sam Weinig
no flags
patch (8.47 KB, patch)
2007-07-18 21:02 PDT, Sam Weinig
oliver: review+
David Harrison
Comment 1 2007-07-17 12:28:01 PDT
Created attachment 15548 [details] test case Attached webkit-test.zip rdar://5340449
Sam Weinig
Comment 2 2007-07-17 14:32:47 PDT
One of the issues that needs to be assessed first is how we want to represent the computed value of a border-radius. Should we always return a pair? Should we we only return 1 value if the vertical and horizontal values are the same?
Faruk Ates
Comment 3 2007-07-18 09:13:47 PDT
Sam, how shorthands are to be treated is a separate issue. When making a call to retrieve the computed style of -webkit-border-top-right-radius (i.e. a non-shorthand, explicit property), it still returns null, when the value is a very simple, straightforward "50px" for instance.
Sam Weinig
Comment 4 2007-07-18 20:59:14 PDT
Faruk, the value of -webkit-border-top-right-radius is actually not that simple as it is a pair of two values, width and height radii for that corner. So if you wanted an oblong corner you could use -webkit-border-top-right-radius: 10px 20px;. That said, I have a fix that returns a primitive value if the width and height are equal and Pair if they differ. I will post the patch shortlty.
Sam Weinig
Comment 5 2007-07-18 21:02:41 PDT
Sam Weinig
Comment 6 2007-07-18 21:02:42 PDT
Sam Weinig
Comment 7 2007-07-18 21:02:47 PDT
Sam Weinig
Comment 8 2007-07-18 21:14:25 PDT
Landed in r24436.
Faruk Ates
Comment 9 2007-07-19 10:27:57 PDT
Sam, fantastic, thanks! I didn't know that oblong corners were supported, that's very cool.
Sam Weinig
Comment 10 2007-07-20 13:39:20 PDT
Landed update to the patch in r24486 which uses a CSSValueList instead of a CSSPrimitiveValue with a Pair for radii with unique values.
Note You need to log in before you can comment on or make changes to this bug.