Bug 6359
Summary: | - [DOMCSSStyleDeclaration cssText] returning empty string? | ||
---|---|---|---|
Product: | WebKit | Reporter: | Todd Ditchendorf <todd> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | ||
Priority: | P2 | ||
Version: | 420+ | ||
Hardware: | Mac | ||
OS: | OS X 10.4 | ||
URL: | http://ditchnet.org/styledeclaration/ |
Todd Ditchendorf
What is described here is a possible bug in Web Kit. I'm running Mac OS X Tiger v10.4.3 on a 1.5Ghz 15
inch powerbook. Safari reports version number 416.13.
I've also posted this, and a Sample Xcode project/Reduction available for download (48kb) <a
href="http://ditchnet.org/styledeclaration/">here</a>.
The method in which the suspected bug appears involves two methods in Web Kit:
WebView.h:
@interface WebView (WebViewCSS)
- (DOMCSSStyleDeclaration *)computedStyleForElement:(DOMElement *)element pseudoElement:
(NSString *)pseudoElement;
@end
DOMCSS.h:
@interface DOMCSSStyleDeclaration : DOMObject
- (NSString *)cssText;
The DOMCSSStyleDeclaration being returned is behaving unexpectedly... the return value of its cssText
method appears to always be an empty string. Is that expected?
However, accessing individual style properties DOES return expected values correctly.
Shouldn't the cssText method return a string containing the entire computed style of the given
element?
===============================================
For example, the following HTML:
=================================================
<html>
<head>
<title>Test</title>
<style type="text/css">
div {
height:200px;
background-color:orange;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
==========================================
is Inspected via a WebUIDelegate:
===========================================
- (void)webView:(WebView *)sender mouseDidMoveOverElement:(NSDictionary *)elementInfo
modifierFlags:(unsigned int)modifierFlags
{
DOMElement *el = [elementInfo objectForKey:WebElementDOMNodeKey];
DOMCSSStyleDeclaration *decl = [webView computedStyleForElement:el pseudoElement:nil];
NSLog(@"decl : %@", decl);
NSLog(@"css text : %@",[decl cssText]);
NSLog(@"height: %@",[decl getPropertyValue:@"height"]);
NSLog(@"background-color: %@",[decl getPropertyValue:@"background-color"]);
}
===============================================
results in :
===============================================
2006-01-03 13:40:15.574 ComputedStyleTest[10038] decl : DOMCSSStyleDeclaration:
2006-01-03 13:40:15.574 ComputedStyleTest[10038] css text :
2006-01-03 13:40:15.574 ComputedStyleTest[10038] height: 200px
2006-01-03 13:40:15.574 ComputedStyleTest[10038] background-color: rgb(255, 165, 0)
================================================
See that empty css text value? Is that expected?
Thanks again!!!!
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
mitz
This is fixed in TOT.
*** This bug has been marked as a duplicate of 3893 ***