Bug 8622

Summary: VisiblePositions aren't canonicalized in some cases
Product: WebKit Reporter: Justin Garcia <justin.garcia>
Component: HTML EditingAssignee: Justin Garcia <justin.garcia>
Status: RESOLVED FIXED    
Severity: Normal CC: ian
Priority: P2 Keywords: InRadar
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   

Justin Garcia
Reported 2006-04-26 22:02:57 PDT
In this example: <div>foo<br></div> VP(div, 2) != VP(br, 0) There are a couple of problems in initDeepPosition. First, in the fall through code, where neither upstream() nor downstream() are candidates, we canonicalize to next in most cases, whereas we claim that we always canonicalize to the candidate that appears first in the DOM. Second, in the fall through code, prev is just the first candidate found when going backward through the DOM. There may be another equivalent candidate if you go further, and we should canonicalize to that one. In the example above, VP(div, 2) gets into the fall through code, prev is [br, 0], which is equivalent to [foo, 3]. [foo, 3] should be used, but [br, 0] is used instead.
Attachments
Justin Garcia
Comment 1 2006-04-26 23:26:54 PDT
Note, remove the workaround in VisiblePosition::isEqualIgnoringAffinity when this is fixed.
David Harrison
Comment 2 2007-05-07 17:00:38 PDT
Justin says he thinks this sounds like rdar://5096134 is a result of the workaround not being in affect for WebKit Accessibility's TextMarkers.
Justin Garcia
Comment 3 2007-05-30 15:17:26 PDT
Note You need to log in before you can comment on or make changes to this bug.