Hello,
For diagnostics purposes, I need to fetch all css properties that come from
rules matching a specific element in the DOM in objective C. Its working
perfectly, except I'd like to know how I can get the matched css rules for
an elemnt with a specific pseudo-class (typically a:hover)...

My code, that's working fine without support for pseudo-classes, looks like
this:

@implementation DOMElement (LWCDExtension)

[...]

-(NSDictionary*) cssProperties

{

NSMutableDictionary* result = [NSMutableDictionary dictionaryWithCapacity:10
];

DOMCSSRuleList* cssRulesList = [self.ownerDocument getMatchedCSSRules:self
pseudoElement:@""];

int rulesLength = cssRulesList.length;

for (int i = 0 ; i < rulesLength ; i++)

{

DOMCSSRule* aRule = [cssRulesList item:i];

[result addEntriesFromDictionary:[aRule cssProperties]];

}

return result;

}

[...]

@end

Even if I know that pseudo-classes are different from pseudo-elements, and
given that I saw no other method that could potentially do the trick, I
tried something like [self.ownerDocument getMatchedCSSRules:self
pseudoElement:@"hover"]; which didn't work. Is there a way to achieve this?


Thanks,


Franck
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to