clone.test.js 890 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. test("clone", function(){
  2. var css = {
  3. cssRules: {
  4. 0: {
  5. cssText: "* {background: #fff !important; color: #000 !important}",
  6. parentRule: null,
  7. selectorText: "body",
  8. type: 1,
  9. style: {
  10. 0: "background",
  11. 1: "color",
  12. background: "#fff",
  13. color: "#000",
  14. cssText: "background: #fff !important; color: #000 !important",
  15. length: 2,
  16. getPropertyPriority: function(){
  17. return "important";
  18. }
  19. }
  20. },
  21. length: 1
  22. },
  23. disabled: false,
  24. href: "http://usercss.ru/black-on-white.css",
  25. media: {
  26. length: 0,
  27. mediaText: ""
  28. },
  29. ownerRule: null,
  30. parentStyleSheet: null,
  31. title: null,
  32. type: "text/css"
  33. };
  34. css.rule = css.cssRules;
  35. css.cssRules[0].parentStyleSheet = css;
  36. css.cssRules[0].style.parentRule = css.cssRules[0];
  37. hasOwnProperties(css, CSSOM.clone(css), "Should be at least a subset of original object");
  38. });