Bug 24621 - PositionIterator doesn't iterate "after last child" positions when going backwards
Summary: PositionIterator doesn't iterate "after last child" positions when going back...
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks: 24576
  Show dependency treegraph
 
Reported: 2009-03-16 09:08 PDT by Darin Adler
Modified: 2012-05-29 23:47 PDT (History)
6 users (show)

See Also:


Attachments
patch (3.64 KB, patch)
2009-03-16 14:52 PDT, Darin Adler
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2009-03-16 09:08:27 PDT
For example, consider a <table> element with these children:

    text node
    <tbody>
    text node

The PositionIterator won't iterate to the <table> element position offset 3.

This is causing various editing bugs, including problems uncovered by my changes for bug 24576.
Comment 1 Darin Adler 2009-03-16 14:48:09 PDT
The problem was narrower in scope than I thought, and only affects backwards iteration; without my other changes I couldn’t find any behavior changes.
Comment 2 Darin Adler 2009-03-16 14:52:27 PDT
Created attachment 28660 [details]
patch
Comment 3 Adele Peterson 2009-03-24 15:42:12 PDT
Is it possible to make a layout test for this?
Comment 4 Darin Adler 2009-03-24 15:59:31 PDT
(In reply to comment #3)
> Is it possible to make a layout test for this?

No. There’s no direct effect of this change alone. It simply prevents certain other changes from causing bugs.
Comment 5 Darin Adler 2009-03-28 12:48:00 PDT
This seems like the kind of patch Eric might want to review.
Comment 6 Eric Seidel (no email) 2009-03-30 09:12:42 PDT
Comment on attachment 28660 [details]
patch

Sigh.  We really need a way to add c++ unit tests to WebCore.  Also, I'm about to re-write increment and decrement as part of bug 24854.  Still debugging why my (obsoleted) change on that bug causes regressions.
Comment 7 Eric Seidel (no email) 2009-03-30 09:15:16 PDT
Comment on attachment 28660 [details]
patch

Yup, looks fine.
Comment 8 Eric Seidel (no email) 2009-03-30 09:16:37 PDT
Nevermind, the interesting parts of bug 24854 haven't been posted from my git repo yet, even in obsoleted form.
Comment 9 Darin Adler 2009-03-31 21:42:01 PDT
http://trac.webkit.org/changeset/42147
Comment 10 Darin Adler 2009-03-31 23:43:54 PDT
Seems to have caused regression test failures. Reopening the bug for now.
Comment 11 Darin Adler 2009-03-31 23:44:14 PDT
Comment on attachment 28660 [details]
patch

Clearing the review flag until I find out what's wrong.
Comment 12 Eric Seidel (no email) 2009-04-01 00:03:15 PDT
I had the same PositionIterator constructor change in my recent PositionIterator re-write and also saw lots of regressions.  I think that might have been the source of the regression.
Comment 13 Darin Adler 2012-05-27 21:51:25 PDT
Thought the modern day editing experts might be interested in my struggle from three years ago. This was never resolved.