Menu

#526 document.stylesheets not supported

closed
None
5
2012-10-21
2007-10-01
Matt Inger
No

It appears that the document.stylesheets collection is not supported. This is a valid property reference in both IE and Firefox, and has been for quite some time. Adding the collection seems trivial, as it's a another member variable and jsxGet method on the Document class, as well as a change to the configuration .xml file to add that property. However, properly implementing the underlying Stylesheet class might prove to be much more effort.

Discussion

  • Ahmed Ashour

    Ahmed Ashour - 2007-10-11

    Logged In: YES
    user_id=950730
    Originator: NO

    Primitive support for document.styleSheets has been added in SVN.

    If you need any specific properties/functions of StyleSheet, then please specify, many thanks.

     
  • Matt Inger

    Matt Inger - 2007-10-11

    Logged In: YES
    user_id=83032
    Originator: YES

    Realistically, we're using the entire stylesheet dom model. Mostly the "rules" and "cssRules" hashes, and it's child "style" object.

    some of the properties we access (probably having "rules" and "cssRules" would be a good idea, and have
    them point to the same collection):

    document.styleSheets[sheetIndex].rules[ruleName].style.borderTop;
    document.styleSheets[sheetIndex].rules[ruleName].style.borderBottom;
    document.styleSheets[sheetIndex].rules[ruleName].style.borderLeft;
    document.styleSheets[sheetIndex].rules[ruleName].style.borderRight;
    document.styleSheets[sheetIndex].rules[ruleName].style.paddingLeft;
    document.styleSheets[sheetIndex].rules[ruleName].style.paddingRight;
    document.styleSheets[sheetIndex].rules[ruleName].style.backgroundColor;
    document.styleSheets[sheetIndex].rules[ruleName].style.top;
    document.styleSheets[sheetIndex].rules[ruleName].style.zIndex;
    document.styleSheets[sheetIndex].rules[ruleName].style.padding;
    document.styleSheets[sheetIndex].rules[ruleName].style.fontSize;
    document.styleSheets[sheetIndex].rules[ruleName].style.position;

    Thanks.

     
  • Matt Inger

    Matt Inger - 2007-10-11

    Logged In: YES
    user_id=83032
    Originator: YES

    Realistically, we're using the entire stylesheet dom model. Mostly the "rules" and "cssRules" hashes, and it's child "style" object.

    some of the properties we access (probably having "rules" and "cssRules" would be a good idea, and have
    them point to the same collection):

    document.styleSheets[sheetIndex].rules[ruleName].style.borderTop;
    document.styleSheets[sheetIndex].rules[ruleName].style.borderBottom;
    document.styleSheets[sheetIndex].rules[ruleName].style.borderLeft;
    document.styleSheets[sheetIndex].rules[ruleName].style.borderRight;
    document.styleSheets[sheetIndex].rules[ruleName].style.paddingLeft;
    document.styleSheets[sheetIndex].rules[ruleName].style.paddingRight;
    document.styleSheets[sheetIndex].rules[ruleName].style.backgroundColor;
    document.styleSheets[sheetIndex].rules[ruleName].style.top;
    document.styleSheets[sheetIndex].rules[ruleName].style.zIndex;
    document.styleSheets[sheetIndex].rules[ruleName].style.padding;
    document.styleSheets[sheetIndex].rules[ruleName].style.fontSize;
    document.styleSheets[sheetIndex].rules[ruleName].style.position;

    Thanks.

     
  • Ahmed Ashour

    Ahmed Ashour - 2008-04-22

    Logged In: YES
    user_id=950730
    Originator: NO

    This has been fixed in SVN, please check http://build.canoo.com/htmlunit

     

Log in to post a comment.