Closed
Bug 754772
Opened 12 years ago
Closed 7 years ago
CSS rules are recognized as CSSNameSpaceRule
Categories
(Core :: DOM: CSS Object Model, defect)
Core
DOM: CSS Object Model
Tracking
()
VERIFIED
FIXED
People
(Reporter: sebo, Unassigned)
References
Details
Attachments
(1 file)
2.22 KB,
text/html
|
Details |
Testing a MozCSSKeyframesRule for "instanceof CSSNameSpaceRule" returns true. See the attached test case for more info. Sebastian
Reporter | ||
Comment 1•12 years ago
|
||
Reporter | ||
Comment 2•12 years ago
|
||
Btw. MozCSSKeyframeRules are also recognized as CSSNameSpaceRules. Sebastian
Attachment #623587 -
Attachment mime type: text/plain → text/html
I'm guessing this is because CSSNameSpaceRule doesn't have any of its own interfaces; it just implements the generic CSS rule interface.
Reporter | ||
Comment 4•12 years ago
|
||
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); do { if (proto === constructor) return true; proto = Object.getPrototypeOf(proto); } while (proto !== null); return false; } isInstanceOf(document.styleSheets[1].cssRules[0], CSSNameSpaceRule.prototype); Sebastian
Comment 5•12 years ago
|
||
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.
Depends on: ParisBindings
Reporter | ||
Comment 6•11 years ago
|
||
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[2].cssRules[1] instanceof CSSNameSpaceRule will incorrectly return true. Sebastian
Reporter | ||
Comment 7•10 years ago
|
||
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. Sebastian
Summary: MozCSSKeyframesRule is recognized as CSSNameSpaceRule → CSS rules are recognized as CSSNameSpaceRule
Comment 9•9 years ago
|
||
Looks like I forgot to cc Peter. Anyway, the right fix here is the webidl conversion.
Flags: needinfo?(bzbarsky)
Comment 10•7 years ago
|
||
Fixed in bug 851892.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 11•7 years ago
|
||
I can confirm that it works in Nightly 53.0a1 2017-01-21. Thank you, Boris! Sebastian
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•