DTCSSStylesheet Class Reference
Inherits from | NSObject |
Conforms to | NSCopying |
Declared in | DTCSSStylesheet.h |
Overview
This class represents a CSS style sheet used for specifying formatting for certain CSS selectors.
It supports matching styles by class, by id or by tag name. Hierarchy matching is not supported yet.
Class Methods
defaultStyleSheet
Creates the default stylesheet.
+ (DTCSSStylesheet *)defaultStyleSheet
Discussion
This stylesheet is based on the standard styles that Webkit provides for these tags. This stylesheet is loaded from an embedded copy of default.css.
Declared In
DTCSSStylesheet.h
Instance Methods
initWithStyleBlock:
Creates a stylesheet with a given style block
- (id)initWithStyleBlock:(NSString *)css
Parameters
- css
The CSS string for the style block
Declared In
DTCSSStylesheet.h
mergeStylesheet:
Merges styles from given stylesheet into the receiver
- (void)mergeStylesheet:(DTCSSStylesheet *)stylesheet
Parameters
- stylesheet
the stylesheet to merge
Declared In
DTCSSStylesheet.h
mergedStyleDictionaryForElement:matchedSelectors:ignoreInlineStyle:
Returns a dictionary that contains the merged style for a given element and the applicable style rules from the receiver.
- (NSDictionary *)mergedStyleDictionaryForElement:(DTHTMLElement *)element matchedSelectors:(NSSet *__autoreleasing *)matchedSelectors ignoreInlineStyle:(BOOL)ignoreInlineStyle
Parameters
- element
The HTML element.
- matchedSelectors
The CSS selectors that caused a match
Return Value
The merged style dictionary containing only styles which selector matches the element
Declared In
DTCSSStylesheet.h
orderedSelectors
Returns an ordered (by declaration) set of the selectors for all of the styles.
- (NSArray *)orderedSelectors
Declared In
DTCSSStylesheet.h