[Webkit-unassigned] [Bug 6359] New: - [DOMCSSStyleDeclaration cssText] returning empty string?

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Tue Jan 3 14:29:59 PST 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=6359

           Summary: - [DOMCSSStyleDeclaration cssText] returning empty
                    string?
           Product: WebKit
           Version: 412+
          Platform: Macintosh
               URL: http://ditchnet.org/styledeclaration/
        OS/Version: Mac OS X 10.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: todd at ditchnet.org


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!!!!

-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list