Testing a MozCSSKeyframesRule for "instanceof CSSNameSpaceRule" returns true.
See the attached test case for more info.
Created attachment 623587 [details]
Btw. MozCSSKeyframeRules are also recognized as CSSNameSpaceRules.
I'm guessing this is because CSSNameSpaceRule doesn't have any of its own interfaces; it just implements the generic CSS rule interface.
Though a MozCSSKeyframeRule isn't an instance of a CSSNameSpaceRule.
I tried the following (via Firebug's Command Editor) to verify that:
function isInstanceOf(object, constructor)
var proto = Object.getPrototypeOf(object);
if (proto === constructor)
proto = Object.getPrototypeOf(proto);
} while (proto !== null);
This is a bit weird. CSSNameSpaceRule.prototype.__proto__ == CSSRule.prototype. That part is fine.
Peter, is the issues that we end up QIing to nsIDOMCSSRule in some xpconnect hasInstance hook here?
In any case, new bindings, when they happen, will fix this.
Note that this problem also occurs for the new CSSPageRule.
A test case can be found at https://getfirebug.com/tests/manual/issues/6282/issue6282.html.
Executing document.styleSheets.cssRules instanceof CSSNameSpaceRule will incorrectly return true.
Just stumbled over this again when trying to check an CSSCounterStyleRule.
As David and Boris indicate this actually happens for all types of CSS rules.
> Peter, is the issues that we end up QIing to nsIDOMCSSRule in some xpconnect hasInstance hook here?
@Boris, could it be that Peter didn't get this message? At least there's no Peter in the CC list.
Also you marked this issue being blocked by the big Paris Bindings issue. I guess the more specific issue this depends on is bug 851892, so I replaced the bug number. Please correct me if that's wrong.
ni'ing regarding comment 7.
Looks like I forgot to cc Peter. Anyway, the right fix here is the webidl conversion.