Almost all image reorderer unit tests are failing: IE 9
Description
Environment
Attachments
Activity

Justin Obara June 2, 2011 at 8:13 PM
Pushed antranig's fix at ca843c2cffac362c095ffdf00f8e6529336b9a6d

Justin Obara May 30, 2011 at 1:12 PM
Antranig has made a pull request for a potential fix.
https://github.com/fluid-project/infusion/pull/57

Harris Wong May 26, 2011 at 7:25 PMEdited
==== Brief ====
It seems like rsf:id + IE9 Document mode is the cause of this problem. The details on the differences between IE8 and IE9 that causes this failure are uncertain. I have tried using different doctypes, and the result is not consistent. I have also tried using HTML5's doctype, still no luck.
==== Steps to Reproduce ====
1. create an HTML page that loads jquery.js and fluid.js
2. create 2 divs,
<div id="test-no-rsf-id">No rsf:id</div>
<div id="test-with-rsf-id" rsf:id="apple">with rsf:id</div>
3. run fluid.jById('test-with-rsf-id'); on IE9, it will fail.
4. run fluid.jById('test-no-rsf-id'); on IE9, it should pass.
==== More Details ====
If we run document.getElementById('test-with-rsf-id').getAttribute('id'), it will return null.
If we try to get the list of attributes,
document.getElementById('test-with-rsf-id').attributes[0].name --> 'rsf:id'
document.getElementById('test-with-rsf-id').attributes[1].name --> 'rsf:id'
It seems like the attribute "id" is overwrote by rsf:id in IE9's DOM. Where as in FF and Chrome, it's
document.getElementById('test-with-rsf-id').attributes[0].name --> 'id'
document.getElementById('test-with-rsf-id').attributes[1].name --> 'rsf:id'
Note: This is true even without both jQuery and Fluid libraries.
==== Unit test ====
I have added a unit test for this, https://github.com/harriswong/infusion/commit/c254cc75d213b534f3898e07c96525e590d84339
==== Suggested Fix ====
There are a few options to address this problem:
1. Remove rsf:id, since image reorderer doesn't need rsf:id.
2. Add meta-data to force IE9 to use other document mode. <meta http-equiv="X-UA-Compatible" content="IE=xxx" >, http://msdn.microsoft.com/en-us/library/cc288325%28v=vs.85%29.aspx
3. This could be an IE9 bug since it makes no sense to overwrite the "id" attribute with our custom attribute "rsf:id". We may want to mark this test case as "expected to fail with IE9" and wait till it's fixed, then re-test it again.
==== Additional info ====
Posted a thread in MSDN, http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/dca80bb2-20b2-4029-8600-cd363cc64ddd

Harris Wong May 26, 2011 at 2:54 PM
Seems to be related to document mode in IE9. If we switch Ducument Mode to IE8 and below, the tests will pass.

Harris Wong May 20, 2011 at 7:56 PM
Added unit tests for IE9 and attributes with both "id" and "rsf:id", https://github.com/harriswong/infusion/tree/FLUID-3953
Almost all of the Image Reorderer unit tests are failing in Win7 of IE9.
The failing tests all have errors like.
1.Died on test #1: Problem in document structure - picked up element [object HTMLDivElement] for id gallery:::gallery-thumbs::: without this id - most likely the element has a name which conflicts with this id
Steps to reproduce:
1) Run the image reorderer unit tests
http://build.fluidproject.org/infusion/tests/component-tests/reorderer/html/ImageReorderer-test.html