Skip to content

Commit f2ea60c

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 (cherry-picked from 0c46643) Fixes gh-1981 Ref 4ab8603
1 parent 939e755 commit f2ea60c

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
@@ -552,11 +552,14 @@ test("iframe scrollTop/Left (see gh-1945)", function() {
552552

553553
var ifDoc = jQuery( "#iframe" )[ 0 ].contentDocument;
554554

555-
// iPhone resize the iframe by its content
556-
// meaning it's not possible to scroll the iframe only its parent element
557-
if ( /iphone os/i.test( navigator.userAgent ) ) {
558-
equal( true, true, "iPhone doesn't scroll the iframes" );
559-
equal( true, true, "iPhone doesn't scroll the iframes" );
555+
// Mobile Safari and Android 2.3 resize the iframe by its content
556+
// meaning it's not possible to scroll the iframe only its parent element.
557+
// It seems (not confirmed) in android 4.0 it's not possible to scroll iframes from the code.
558+
if ( /iphone os/i.test( navigator.userAgent ) ||
559+
/android 2\.3/i.test( navigator.userAgent ) ||
560+
/android 4\.0/i.test( navigator.userAgent ) ) {
561+
equal( true, true, "Can't scroll iframes in this environment" );
562+
equal( true, true, "Can't scroll iframes in this environment" );
560563

561564
} else {
562565
// Tests scrollTop/Left with iframes

0 commit comments

Comments
 (0)