WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 3893
6359
- [DOMCSSStyleDeclaration cssText] returning empty string?
https://bugs.webkit.org/show_bug.cgi?id=6359
Summary
- [DOMCSSStyleDeclaration cssText] returning empty string?
Todd Ditchendorf
Reported
2006-01-03 14:29:58 PST
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
Comment 1
2006-02-18 11:53:33 PST
This is fixed in TOT. *** This bug has been marked as a duplicate of
3893
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug