CSSFontFaceRule.js 1.0 KB

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