Bug 8622
| Summary: | VisiblePositions aren't canonicalized in some cases | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Justin Garcia <justin.garcia> |
| Component: | HTML Editing | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Justin Garcia
Note, remove the workaround in VisiblePosition::isEqualIgnoringAffinity when this is fixed.
David Harrison
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
r21904