Page MenuHomePhabricator

VisualEditor: document.activeElement can change unexpectedly while typing in VE editor
Closed, DeclinedPublicBUG REPORT


Author: jhall

After observing some strange results from an automated Ruby test for cursor movement in the Visual Editor CE surface, we did some digging, and it appears that while a user is typing away happily and making and edit, the document.activeElement flip-flop several times.

I'm assuming this is unintentional behavior, thus the bug ticket.

Repro steps:

  1. Visit this page:
  2. Click into VE editing mode.
  3. With cursor placed immediately in front of the letter "a" in the word "after", press the right arrow key several times in succession.
  4. When your right-arrow-clicking brings you to the reference, the document.activeElement switches from "ve-ce-documentNode ve-ce-branchNode noime" to "ve-ce-surface-paste"

I'm assuming that when the user is typing in the "editing box", the document.activeElement should not be changing.

Version: unspecified
Severity: major
See Also:



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:28 AM
bzimport set Reference to bz58998.

jhall wrote:

Blow-by-blow of document.activeElement as right arrow key is pressed many times in succession


jhall wrote:

Java program used to generate the blow-by-blow in the previous attachment


Jdforrester-WMF lowered the priority of this task from High to Medium.Jan 9 2015, 10:55 PM
Jdforrester-WMF set Security to None.
Deskana lowered the priority of this task from Medium to Low.May 3 2018, 8:16 AM
Aklapper changed the subtype of this task from "Task" to "Bug Report".Feb 15 2022, 9:39 PM
Esanders subscribed.

This is intentional. We move the selection the paste target so we can intercept copy events. Users should not care what document.activeElement is set to.