Bug 25204 - Create a fast path for ReplaceSelectionCommand that merges text nodes
Summary: Create a fast path for ReplaceSelectionCommand that merges text nodes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Justin Garcia
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2009-04-15 00:53 PDT by Justin Garcia
Modified: 2009-04-15 11:37 PDT (History)
4 users (show)

See Also:


Attachments
patch (26.25 KB, patch)
2009-04-15 01:23 PDT, Justin Garcia
no flags Details | Formatted Diff | Diff
patch (26.56 KB, patch)
2009-04-15 01:30 PDT, Justin Garcia
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Garcia 2009-04-15 00:53:24 PDT
During simple pastes (just pasting a text node) into a run of text, we don't just insert the text into the text node that holds the selection, we split and insert the fragment.  This is slow and we run into this problem:

https://bugs.webkit.org/show_bug.cgi?id=6148

in the layout and rendering code where adjacent text nodes don't shape correctly in Arabic.

<rdar://problem/6758795>
Comment 1 Justin Garcia 2009-04-15 01:23:49 PDT
Created attachment 29492 [details]
patch
Comment 2 Justin Garcia 2009-04-15 01:30:23 PDT
Created attachment 29495 [details]
patch

updated changelog
Comment 3 mitz 2009-04-15 08:30:35 PDT
Comment on attachment 29495 [details]
patch

r=me. You can move the definition of textNode and text after the last early return.
Comment 4 Justin Garcia 2009-04-15 11:37:34 PDT
http://trac.webkit.org/changeset/42549

Checked in a fast path that works for plain text regions and rich text regions when pasting plain text.  Still need to handle rich text (fragments that are wrapped in style spans but doing so will necessitate using positions instead of nodes to track the start/end of inserted content.