Test case for issues:

3046 - closestEnabledButton() conflicts with OpenLayers
3054 - RC3 - button conflicts with svg element, throws error: Uncaught TypeError: Object #<SVGAnimatedString> has no method 'split'
This commit is contained in:
jblas@adobe.com 2011-11-15 10:22:36 -08:00
parent ba8458daef
commit afb7bab90f
2 changed files with 21 additions and 0 deletions

View file

@ -26,4 +26,22 @@
ok(!group.find('[data-iconshadow=false] .ui-icon').hasClass("ui-icon-shadow"),
"buttons with data-iconshadow=false should not have the ui-icon-shadow class on their icons");
});
// Test for issue #3046 and #3054:
test( "mousedown on SVG elements should not throw an exception", function(){
var svg = $("#embedded-svg"),
success = true,
rect;
ok(svg.length > 0, "found embedded svg document" );
if ( svg.length > 0 ) {
rect = $( "rect", svg );
ok(rect.length > 0, "found rect" );
try {
rect.trigger("mousedown");
} catch ( ex ) {
success = false;
}
ok( success, "mousedown executed without exception");
}
});
})(jQuery);

View file

@ -30,6 +30,9 @@
<a href="index.html" data-role="button" data-shadow="false" data-corners="false">No shadow or corners</a>
<a href="index.html" data-role="button" data-icon="delete" data-iconshadow="false">No iconshadow</a>
<button data-shadow="false" data-corners="false" data-icon="delete" data-iconshadow="false">None of the above</button>
<svg id="embedded-svg" width="120" height="120" viewPort="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="10" width="100" height="100"/>
</svg>
</div>
<div data-role="footer" id="control-group-footer" class="ui-bar" data-position="inline">
<div data-role="controlgroup" data-type="horizontal">