Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting CSS string from DIV element?



Well, this has been driving me crazy. I've got a DOMHTMLDivElement* referencing a DIV element for which I'd like to get the CSS definition (by id or class) -- just an NSString* with the raw CSS text would do.

I thought it would be as easy as calling DOMElement (DOMElementCSSInlineStyle):style and using DOMCSSStyleDeclaration:cssText and then recursively walk up the parent nodes, looking for inherited CSS properties. However, :style seems to return only inline (?) CSS definitions.

Am I approaching this from the wrong direction? Should I be walking the document's stylesheet instead? Is there an easy way to get the CSS definition text for a given DIV element?

Thanks!
Danny
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webcore-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webcore-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.