Skip to content
Permalink
Browse files
Merge branch 'fix_suite_fails' of https://github.com/timmywil/jquery
…into timmywil-fix_suite_fails
  • Loading branch information
dmethvin committed Apr 12, 2011
2 parents 0032e30 + 69866fd commit f7f4ef91cf38b3c00414d3ebdb706fc04a8e17c0
Showing 4 changed files with 14 additions and 12 deletions.
@@ -109,3 +109,6 @@ div#show-tests * { display: none; }
#nothiddendiv { font-size: 16px; }
#nothiddendivchild.em { font-size: 2em; }
#nothiddendivchild.prct { font-size: 150%; }

/* For testing type on vml in IE #7071 */
v\:oval { behavior:url(#default#VML); display:inline-block; }
@@ -45,10 +45,6 @@
<script src="unit/effects.js"></script>
<script src="unit/offset.js"></script>
<script src="unit/dimensions.js"></script>

<!-- For testing http://bugs.jquery.com/ticket/7071 -->
<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />
<style>v\:oval { behavior:url(#default#VML); display:inline-block; }</style>
</head>

<body id="body">
@@ -151,7 +147,6 @@ <h2 id="qunit-userAgent"></h2>
<span id="test.foo[5]bar" class="test.foo[5]bar"></span>

<foo_bar id="foobar">test element</foo_bar>
<v:oval id="oval" style="width:100pt;height:75pt;" fillcolor="red"> </v:oval>
</form>
<b id="floatTest">Float test.</b>
<iframe id="iframe" name="iframe"></iframe>
@@ -492,6 +492,7 @@ test("val()", function() {
var testVal = function(valueObj) {
expect(8);

QUnit.reset();
jQuery("#text1").val(valueObj( "test" ));
equals( document.getElementById("text1").value, "test", "Check for modified (via val(String)) value of input element" );

@@ -504,15 +505,16 @@ var testVal = function(valueObj) {
jQuery("#text1").val(valueObj( null ));
equals( document.getElementById("text1").value, "", "Check for modified (via val(null)) value of input element" );

jQuery("#select1").val(valueObj( "3" ));
equals( jQuery("#select1").val(), "3", "Check for modified (via val(String)) value of select element" );
var $select1 = jQuery("#select1");
$select1.val(valueObj( "3" ));
equals( $select1.val(), "3", "Check for modified (via val(String)) value of select element" );

jQuery("#select1").val(valueObj( 2 ));
equals( jQuery("#select1").val(), "2", "Check for modified (via val(Number)) value of select element" );
$select1.val(valueObj( 2 ));
equals( $select1.val(), "2", "Check for modified (via val(Number)) value of select element" );

jQuery("#select1").append("<option value='4'>four</option>");
jQuery("#select1").val(valueObj( 4 ));
equals( jQuery("#select1").val(), "4", "Should be possible to set the val() to a newly created option" );
$select1.append("<option value='4'>four</option>");
$select1.val(valueObj( 4 ));
equals( $select1.val(), "4", "Should be possible to set the val() to a newly created option" );

// using contents will get comments regular, text, and comment nodes
var j = jQuery("#nonnodes").contents();
@@ -778,6 +778,8 @@ test("trigger() shortcuts", function() {
elem.remove();

// test that special handlers do not blow up with VML elements (#7071)
jQuery('<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />').appendTo('head');
jQuery('<v:oval id="oval" style="width:100pt;height:75pt;" fillcolor="red"> </v:oval>').appendTo('#form');
jQuery("#oval").click().keydown();
});

5 comments on commit f7f4ef9

@jfirebaugh
Copy link

@jfirebaugh jfirebaugh commented on f7f4ef9 Apr 13, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was intended that the VML element be present for all tests. If it causes failures, that indicates additional places where jQuery needs to apply workarounds.

@dmethvin
Copy link
Member Author

@dmethvin dmethvin commented on f7f4ef9 Apr 13, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfirebaugh, I'm not clear on your comment. Are these changes not correct? I haven't been following the history of this patch.

@jeresig
Copy link
Member

@jeresig jeresig commented on f7f4ef9 Apr 13, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfirebaugh: It's more that he was hoping to catch other weird edge cases by having the VML element in the DOM - but this probably wouldn't happen because we don't touch the whole DOM on every test. I think what you've done is probably fine for this specific test.

@timmywil
Copy link
Member

@timmywil timmywil commented on f7f4ef9 Apr 13, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfirebaugh: If you can think of other use cases where it might fail, those should be separate tests so that we can always tell that it's related to vml. Adding any more to the head, and adding the oval where you did, caused other tests to fail that specifically check the number of elements returned, html strings, etc.

@jfirebaugh
Copy link

@jfirebaugh jfirebaugh commented on f7f4ef9 Apr 13, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timmywil Ah, gotcha. I will circle back and see if some more targeted tests can be added.

Please sign in to comment.