This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13830 - "Delete the contents" has to be rewritten to delete the selection
Summary: "Delete the contents" has to be rewritten to delete the selection
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - HTML Editing APIs (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Aryeh Gregor
QA Contact: HTML Editing APIs spec bugbot
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-18 21:01 UTC by Aryeh Gregor
Modified: 2011-08-30 19:54 UTC (History)
2 users (show)

See Also:


Attachments

Description Aryeh Gregor 2011-08-18 21:01:15 UTC
Currently the "delete the contents" algorithm deletes any old range it's given.  Every caller except delete/forwardDelete actually deletes the active range.  The problem with deleting non-active ranges is it doesn't update the selection correctly.  Example: calling delete on

  <ol><li>foo</li></ol>{}<br>

produces

  <ol><li>foo</li></ol>{}

in the current spec because the selection doesn't get moved.  delete/forwardDelete can maybe be changed to change the selection before deleting.  Or maybe there's some other fix that's better.

(This is a minor bug in the current spec, not an issue implementers have to worry about.)
Comment 1 Aryeh Gregor 2011-08-30 16:52:08 UTC
This is turning out to be a surprisingly big headache.  Apparently my algorithms are so complicated and/or poorly documented that I can't understand them a month or two after writing them.  I'll have to add more comments and/or refactor -- but for now, at least I have a good test suite!
Comment 2 Aryeh Gregor 2011-08-30 19:54:50 UTC
http://aryeh.name/gitweb.cgi?p=editing;a=commitdiff;h=bc8218cc

Filed bug 13973 on refactoring this so it's less of a nightmare.