Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ie7 Style Attributes don't register #4

Closed
megawac opened this issue Apr 7, 2014 · 1 comment
Closed

ie7 Style Attributes don't register #4

megawac opened this issue Apr 7, 2014 · 1 comment

Comments

@megawac
Copy link
Owner

megawac commented Apr 7, 2014

Quirksmode calls .attributes compat "A bloody mess." We use indexed attributes (relevant section)... Here's some highlights of problems to address

  • Do yourself a favour and don't use the indexed attributes array.
  • IE7 and lower don't return the value of a style attribute.
  • IE 5.5 doesn't return custom attributes, and initially gives the attribute value instead of an attribute object.
  • IE7 and lower give null for style values.
  • IE 5.5 initially gives the value of the attribute; not the attribute object.
//Issue
var attributeTest = document.createElement("i");
attributeTest.style.width = "140px";
attributeTest.attributes.style.value ~~ "width: 140px;" //normally (browser dependent case, semi etc)
//ie<7
attributeTest.attributes.style.value === "null" //shit...
@megawac megawac added the bug label Apr 7, 2014
megawac added a commit that referenced this issue Apr 7, 2014
@megawac
Copy link
Owner Author

megawac commented Apr 8, 2014

Hacky solution:

Replace this equality test with something like

if (attr.value !== $oldstate[name] || 
    //handle ie7 inline style attribute
    (attr.name === "style" && attr.value != "null" &&
        $target.outerHTML.match(/style=["'].*["']/)[0] !== $oldstate[name]
    )
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant