Bug 35330
| Summary: | TextIterator::range tries to return a range based on displayed characters rather than characters from the DOM | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Tony Chang <tony> |
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ap, mitz, rolandsteiner |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | PC | ||
| OS: | OS X 10.5 | ||
Tony Chang
In the attached example, the displayed text is:
GRÖSSTEN
The source html has:
<span style="text-transform:uppercase;">größten</span>
If you call WebCore::findPlainText and try to find the letter "n" we hit an assert. This happens because TextIterator finds the N with an offset of 8 (based on what is displayed). When it tries to convert that to a DOM Range, it tries to set an end offset of 8, which is beyond the end of the actual HTML. This triggers an assert at WebCore/dom/Range.cpp:87.
Is there a helper method for converting between offsets in the rendered text and the source text? I didn't see one in RenderText.
I see a similar bug when trying to select the word using double click (it doesn't select the last character of the word).
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
This might be close enough to bug 8854 to be called duplicate. There are a few more tangentially related bugs filed earlier.