CSSKeyframeRule.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //.CommonJS
  2. var CSSOM = {
  3. CSSRule: require("./CSSRule").CSSRule,
  4. CSSStyleDeclaration: require('./CSSStyleDeclaration').CSSStyleDeclaration
  5. };
  6. ///CommonJS
  7. /**
  8. * @constructor
  9. * @see http://www.w3.org/TR/css3-animations/#DOM-CSSKeyframeRule
  10. */
  11. CSSOM.CSSKeyframeRule = function CSSKeyframeRule() {
  12. CSSOM.CSSRule.call(this);
  13. this.keyText = '';
  14. this.style = new CSSOM.CSSStyleDeclaration();
  15. this.style.parentRule = this;
  16. };
  17. CSSOM.CSSKeyframeRule.prototype = new CSSOM.CSSRule();
  18. CSSOM.CSSKeyframeRule.prototype.constructor = CSSOM.CSSKeyframeRule;
  19. CSSOM.CSSKeyframeRule.prototype.type = 9;
  20. //FIXME
  21. //CSSOM.CSSKeyframeRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;
  22. //CSSOM.CSSKeyframeRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;
  23. // http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSKeyframeRule.cpp
  24. Object.defineProperty(CSSOM.CSSKeyframeRule.prototype, "cssText", {
  25. get: function() {
  26. return this.keyText + " {" + this.style.cssText + "} ";
  27. }
  28. });
  29. //.CommonJS
  30. exports.CSSKeyframeRule = CSSOM.CSSKeyframeRule;
  31. ///CommonJS