X Tutup
Skip to content

Commit 0c46643

Browse files
committed
Offset: don't run scrollTop/scrollLeft iframe test in Android 2.3 & 4.0
Android 2.3 resize the iframe by its content meaning it's not possible to scroll the iframe only its parent element. It seems (not confirmed) in android 4.0 it's not possible to scroll iframes from the code Fixes jquerygh-1981 Ref 4ab8603
1 parent e984d1c commit 0c46643

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/unit/offset.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,14 @@ test("iframe scrollTop/Left (see gh-1945)", function() {
536536

537537
var ifDoc = jQuery( "#iframe" )[ 0 ].contentDocument;
538538

539-
// iPhone resize the iframe by its content
540-
// meaning it's not possible to scroll the iframe only its parent element
541-
if ( /iphone os/i.test( navigator.userAgent ) ) {
542-
equal( true, true, "iPhone doesn't scroll the iframes" );
543-
equal( true, true, "iPhone doesn't scroll the iframes" );
539+
// Mobile Safari and Android 2.3 resize the iframe by its content
540+
// meaning it's not possible to scroll the iframe only its parent element.
541+
// It seems (not confirmed) in android 4.0 it's not possible to scroll iframes from the code.
542+
if ( /iphone os/i.test( navigator.userAgent ) ||
543+
/android 2\.3/i.test( navigator.userAgent ) ||
544+
/android 4\.0/i.test( navigator.userAgent ) ) {
545+
equal( true, true, "Can't scroll iframes in this environment" );
546+
equal( true, true, "Can't scroll iframes in this environment" );
544547

545548
} else {
546549
// Tests scrollTop/Left with iframes

0 commit comments

Comments
 (0)
X Tutup