Opened 6 years ago

Last modified 6 years ago

#18726 closed defect

scrollIntoView() suspicious code for IE8 — at Initial Version

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

Description

Both test_scroll.html and window.js are accidentally including IE8, because the has("trident") flag is actually truthy for IE8 - IE11, not just IE11. This code from windows.js:

if(elPos.x < 0 || !isIE || isIE >= 9 || has("trident")){ elPos.x = 0; } // older IE can have values > 0
if(elPos.y < 0 || !isIE || isIE >= 9 || has("trident")){ elPos.y = 0; }

The expression of isIE >= 9 || has("trident") is surely a mistake. But if the current code is working correctly on IE8, then the expression above can be simplified to:

elPos.x = elPos.y = 0;

Relatedly, this code from test_scroll.html (deleted in master branch but in 1.10 and earlier) is inadvertently (and unnecessarily) skipping most of the tests on IE8:

var modes = (has("ie") >= 9 || has("trident")) ? ["_strict"] :
      ["_strict", "_quirks", "_loose_rtl", "_quirks_rtl" ];

Change History (0)

Note: See TracTickets for help on using tickets.