Last modified: 2014-02-26 23:07:36 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57510, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55510 - VisualEditor: Get rid of selection rendering on init
VisualEditor: Get rid of selection rendering on init
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
ContentEditable (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: Ed Sanders
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-09 13:16 UTC by Roan Kattouw
Modified: 2014-02-26 23:07 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Roan Kattouw 2013-10-09 13:16:58 UTC
Problems:
* The dm.Surface constructor initializes the selection at (1,1) because (0,0) is not a selection we can render in most documents
* ui.Surface.initialize has the following code:
// By re-asserting the current selection and forcing a poll we force selection to be something
// reasonable - otherwise in Firefox, the initial selection is (0,0), causing bug 42277
this.model.getFragment().select();
this.view.surfaceObserver.pollOnce();
* However, when VE loses focus then regains focus, we don't restore the selection

Issues caused:
* Selections of (1,1) don't play nice with documents that start with a FocusableNode
* The fact that ui.Surface.initialize reasserts the selection means that VisualEditor focuses itself on initialization, which Flow is now having to work around
* When ULS blurs then refocuses VE during its initialization, the selection jumps back to the top

What we should really be doing:
* Initialize the selection at the first content offset (this is 1 for most documents, but will be different for documents that start with a FocusableNode)
* Get rid of the model->view->model circular synchronization in ui.Surface.initialize and fix whatever problems it fixed differently
* Restore selection on focus
Comment 1 Krinkle 2013-10-29 19:32:54 UTC
Is this the bug that causes templates to be pre-selected upon loading the editor?

Is this the bug that is resolved when the editor just places the cursor ("collapsed" selection) at the visual start of the document (e.g. not selecting the first template or character, but before it, blinking on the top left).
Comment 2 James Forrester 2014-02-06 05:06:11 UTC
This was fixed some time ago by Ed.
Comment 3 Ed Sanders 2014-02-06 20:00:24 UTC
I certainly addressed point 1 of Roan's list of actions, he may want to follow up on 2 & 3.
Comment 4 Roan Kattouw 2014-02-26 23:05:53 UTC
(In reply to Ed Sanders from comment #3)
> I certainly addressed point 1 of Roan's list of actions, he may want to
> follow up on 2 & 3.
I did 3 a while ago. As for 2, I don't know how current that is, let me take a look.
Comment 5 Roan Kattouw 2014-02-26 23:07:36 UTC
(In reply to Roan Kattouw from comment #4)
> (In reply to Ed Sanders from comment #3)
> > I certainly addressed point 1 of Roan's list of actions, he may want to
> > follow up on 2 & 3.
> I did 3 a while ago. As for 2, I don't know how current that is, let me take
> a look.
Nope, 2 seems to be gone. So this bug is fixed completely then.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links