Last modified: 2012-12-06 00:58:41 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 T43223, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41223 - VisualEditor: Emptying paragraph in Firefox with backspace adds <br _moz_dirty>
VisualEditor: Emptying paragraph in Firefox with backspace adds <br _moz_dirty>
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
ContentEditable (Other open bugs)
unspecified
All All
: Unprioritized normal
: VE-deploy-2012-12-10
Assigned To: Inez Korczyński
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-19 18:50 UTC by Christian Williams
Modified: 2012-12-06 00:58 UTC (History)
5 users (show)

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


Attachments

Description Christian Williams 2012-10-19 18:50:01 UTC
Firefox naturally leaves a <br _moz_dirty> when the contents of a paragraph has been deleted. There are 2 cases, deleting text in a paragraph and deleting text in a paragraph in a list item.

In the case of a paragraph NOT within a list item, the DOM is:
<p><br _moz_dirty></p>. ve.ce.TextNode onUpdate cleans the parent, removing the <br>. 

In the case of a paragraph WITHIN a list item, the DOM is:
<li><p></p><br _moz_dirty></li>. Cleaning the parent doesn't remove the br, but parent.parent does. Maybe this needs to traverse up to the highest splittable node? 

In both cases the focus does not return to the slug because the surface is locked, preventing showSelection (this is in the onChange method).
Comment 1 Inez Korczyński 2012-10-24 19:43:57 UTC
I already found a few slightly different ways to solve this problem. After I will choose the best one I will update this ticket and send it for review to gerrit.
Comment 2 Inez Korczyński 2012-12-06 00:58:41 UTC
Fixed here: https://gerrit.wikimedia.org/r/#/c/37162/

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


Navigation
Links