Changes between Initial Version and Version 2 of Ticket #11614


Ignore:
Timestamp:
Jan 22, 2011, 2:34:06 PM (11 years ago)
Author:
dante
Comment:

going to make a note of this for has.js, seems a good thing to have a test for.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11614

    • Property Owner changed from anonymous to sjmiles
    • Property Component changed from General to HTML
    • Property Milestone changed from tbd to 2.0
  • Ticket #11614 – Description

    initial v2  
    33Clearly the underlying bug is in IE6 and IE7, but handling the error more gracefully would prevent a broken page.
    44
    5 {{{
    6 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    7 <html xmlns="http://www.w3.org/1999/xhtml">
    8 <head>
    9 <title>dojo.style(node, 'display', 'inherit') fails in IE6 and IE7</title>
    10 <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" type="text/javascript"></script>
    11 <script type="text/javascript">
    12     function callStyleInTryCatch(elementID, styleProp, value) {
    13         try {
    14             //this is the line where the reported bug behavior happens:
    15             dojo.style(elementID, styleProp, value);
    16             //next two lines are just decoration cleanup:
    17             dojo.byId('errorReport').innerHTML = "";
    18             dojo.removeClass(elementID, 'errorBlock');
    19         } catch (e) {
    20             //next lines are just decoration to make it easy to see the bug behavior:
    21             var innerHTML = "<div><code>dojo.style('" + elementID + "', '" + styleProp + "', '" + value + "')</code></div>"  +
    22                 "<div>error description = <span>" +e.description + "</span></div>";
    23             var errNode = dojo.byId('errorReport');
    24             errNode.innerHTML = innerHTML;
    25             dojo.addClass(elementID, 'errorBlock');
    26         }
    27     }
    28 </script>
    29 <style type="text/css">
    30 .block
    31 {
    32     height: 100px;
    33     width: 100px;
    34     background-color: blue;
    35 }
    36 .errorBlock
    37 {
    38     background-color: red;
    39 }
    40 #errorReport
    41 {
    42     color: Red;
    43 }
    44 </style>
    45 </head>
    46 <body>
    47     <h2>dojo.style(node, 'display', 'inherit') fails in IE6 and IE7</code></h2>
    48     <button onclick="callStyleInTryCatch('displayTest','display','none')">display: none</button>
    49     <button onclick="callStyleInTryCatch('displayTest','display','')">display: ""</button>
    50     <button onclick="callStyleInTryCatch('displayTest','display','block')">display: block</button>
    51     <button onclick="callStyleInTryCatch('displayTest','display','inline')">display: inline</button>
    52     <button style="border: thin solid red" onclick="callStyleInTryCatch('displayTest','display','inherit')">display: inherit</button>
    53     <div>
    54         <div class="block" id="displayTest">DISPLAY</div>
    55     </div>
    56     <h2>Errors:</h2>
    57     <div id="errorReport" />
    58 </body>
    59 </html>
    60 
    61 }}}
    62 
    635This problem seems to exist in previous versions of Dojo also.