Page MenuHomePhabricator

Clicking off a focusable node in IE<=11 throws a 'Nested change of newModelSelection' exception
Closed, ResolvedPublic8 Estimated Story Points

Description

Just re-tested against https://en.wikipedia.org/w/index.php?oldid=678508180 ([[Ray County, Missouri]]) and drag-n-drop of images didn't work on IE still. It did work on FF and Chrome, though.

In IE, clicking on the Route 13 sign ([[File:MO-13.svg]]) shows the Media highlight. Click off of that and you get the following exception:

SCRIPT5022: Nested change of newModelSelection File: load.php, Line: 832, Column: 517

IE's debugger has this call stack:

ve.ce.Surface.prototype.changeModel [Line: 832, Col: 517], load.php
ve.ce.Surface.prototype.handleObservedChanges [Line: 819, Col: 510], load.php
ve.ce.SurfaceObserver.prototype.pollOnceInternal [Line: 836, Col: 73], load.php
ve.ce.SurfaceObserver.prototype.pollOnceSelection [Line: 835, Col: 625], load.php
ve.ce.Surface.prototype.onDocumentSelectionChange [Line: 791, Col: 569], load.php
jQuery.event.dispatch [Line: 65, Col: 907], load.php
elemData.handle [Line: 60, Col: 384], load.php
ve.selectElement [Line: 62, Col: 281], eval code (48)
ve.ce.Surface.prototype.preparePasteTargetForCopy [Line: 816, Col: 530], load.php
ve.ce.Surface.prototype.onModelSelect [Line: 815, Col: 591], load.php
oo.EventEmitter.prototype.emit [Line: 65, Col: 545], eval code (46)
ve.dm.Surface.prototype.setSelection [Line: 578, Col: 532], load.php
ve.dm.Surface.prototype.changeInternal [Line: 580, Col: 371], load.php
ve.dm.Surface.prototype.change [Line: 579, Col: 351], load.php
ve.ce.Surface.prototype.changeModel [Line: 832, Col: 609], load.php
ve.ce.Surface.prototype.handleObservedChanges [Line: 819, Col: 510], load.php
ve.ce.SurfaceObserver.prototype.pollOnceInternal [Line: 836, Col: 73], load.php
ve.ce.SurfaceObserver.prototype.pollOnceSelection [Line: 835, Col: 625], load.php
ve.ce.Surface.prototype.onDocumentSelectionChange [Line: 791, Col: 569], load.php
jQuery.event.dispatch [Line: 65, Col: 907], load.php
elemData.handle [Line: 60, Col: 384], load.php
ve.ui.LinearContext.prototype.onContextChange [Line: 904, Col: 976], load.php
oo.EventEmitter.prototype.emit [Line: 65, Col: 545], eval code (46)
ve.dm.Surface.prototype.emitContextChange [Line: 575, Col: 206], load.php
ve.dm.Surface.prototype.setSelection [Line: 578, Col: 682], load.php
ve.dm.SurfaceFragment.prototype.select [Line: 590, Col: 861], load.php
Anonymous function [Line: 760, Col: 529], load.php
ve.ce.FocusableNode.prototype.onFocusableMouseDown [Line: 760, Col: 436], load.php
jQuery.event.dispatch [Line: 65, Col: 907], load.php
elemData.handle [Line: 60, Col: 384], load.php

Event Timeline

Esanders created this task.Apr 19 2016, 8:51 PM
Restricted Application added subscribers: TerraCodes, Aklapper. · View Herald TranscriptApr 19 2016, 8:51 PM
Esanders renamed this task from Clicking off a focusable node in IE11 throws a 'Nested change of newModelSelection' exception to Clicking off a focusable node in IE<=11 throws a 'Nested change of newModelSelection' exception.Apr 19 2016, 8:53 PM

Confirmed on IE11/10/9. No issue in Edge.

Jdforrester-WMF triaged this task as Medium priority.Apr 20 2016, 12:08 AM
Jdforrester-WMF set the point value for this task to 8.
Esanders reopened this task as Open.Apr 20 2016, 10:39 AM
Esanders raised the priority of this task from Medium to High.
Esanders closed this task as a duplicate of T133094: Support MSIE 9.
Esanders added a parent task: T133094: Support MSIE 9.

It seems that when moving the native selection from the focus node (paste target) to the document, it goes via the top of the document (branch slug) triggering two selection change events, so it tries to set the selection to (0,0) then (N,N) in the same cycle.

Change 284445 had a related patch set uploaded (by Esanders):
Debounce selection change events to avoid nested model changes

https://gerrit.wikimedia.org/r/284445

Change 284445 merged by jenkins-bot:
Debounce selection change events to avoid nested model changes

https://gerrit.wikimedia.org/r/284445

Jdforrester-WMF closed this task as Resolved.Apr 25 2016, 7:08 PM
Jdforrester-WMF assigned this task to Esanders.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.