Opened 6 years ago

Last modified 5 years ago

#16583 open defect

dojo/window::scrollIntoView needs dojo.withGlobal() call sometimes

Reported by: bill Owned by:
Priority: undecided Milestone: 2.0
Component: Core Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description

See dojo/tests/test_scroll.html. If you change the _scrollIntoView code to call winUtils.scrollIntoView(node) directly, the test mostly works but fails one time on IE8.

Since scrollIntoView() takes a pointer to a node (which has an ownerDocument), seems like you shouldn't need to call win.withGlobal() in order to use it.

I'm guessing it's from isIE getting a different value with and without with withGlobal() call.

Attachments (1)

noWithGlobal.patch (586 bytes) - added by bill 6 years ago.
removing the dojo.withGlobal() call, gets failure on IE8 in test_tooBig

Download all attachments as: .zip

Change History (5)

comment:1 Changed 6 years ago by bill

Owner: set to Douglas Hays
Status: newassigned

Hopefully your feature testing changes fix this?

Changed 6 years ago by bill

Attachment: noWithGlobal.patch added

removing the dojo.withGlobal() call, gets failure on IE8 in test_tooBig

comment:2 Changed 6 years ago by Douglas Hays

Milestone: tbd2.0

Starting with 2.0, withGlobal will be gone and so will IE 6-8 support so there won't be any need for large feature detection chunks for older IE nuances.

comment:3 Changed 6 years ago by bill

The test has an iframe with a <meta> tag setting it to IE7 compatibility mode. scrollIntoView(node) calls has("ie") and it needs to return 7 (the IE version of the iframe), but it returns 8, since that's the version of the main window.

So a simple fixes is theoretically instead of calling has("ie"), do

has("ie") ? parseFloat(window.get(doc).navigator.appVersion.split("MSIE ")[1]) : undefined

The downside is that it duplicates the IE sniffing "formula" from dojo/sniff.js.

Like Doug said this will no longer be an issue if/when we drop IE8 support, but unfortunately it's still a (small) issue even if we drop IE6 and IE7 support.

comment:4 Changed 5 years ago by Douglas Hays

Owner: Douglas Hays deleted
Status: assignedopen
Note: See TracTickets for help on using tickets.