https://bugzilla.wikimedia.org/show_bug.cgi?id=55510

       Web browser: ---
            Bug ID: 55510
           Summary: VisualEditor: Get rid of selection rendering on init
           Product: VisualEditor
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: General
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
    Classification: Unclassified
   Mobile Platform: ---

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to