Bug 15847

Summary: Some editing cleanup
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: HTML EditingAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
proposed patch
none
updated patch
none
updated patch darin: review+

Description Alexey Proskuryakov 2007-11-05 10:56:48 PST
Some minor modifications I wanted to make while studying editing code. Patch forthcoming.
Comment 1 Alexey Proskuryakov 2007-11-05 11:10:55 PST
Created attachment 17048 [details]
proposed patch
Comment 2 Alexey Proskuryakov 2007-11-06 01:12:47 PST
Created attachment 17057 [details]
updated patch

Removed a change to m_starting/endingSelection - I realized that m_starting/endingRootEditableElement depended on it. The constructor still looks wrong, but I don't understand the concepts well enough to suggest a fix.
Comment 3 Alexey Proskuryakov 2007-11-06 01:35:12 PST
Created attachment 17058 [details]
updated patch

Hmm, on the other hand, m_starting/engingRootEditableElement gets immediately overwritten, too.
Comment 4 Darin Adler 2007-11-06 07:38:05 PST
Comment on attachment 17058 [details]
updated patch

+        return (NSString *)plainText(makeRange(startVisiblePosition, endVisiblePosition).get());

Why is that typecast needed?

r=me

Another kind of editing cleanup we need is to move as much as possible of the Mac-specific editing code in WebHTMLView into Editor and make it platform-independent. There's some truly-platform-specific code there, but there's more code that is there simply for historic reasons.
Comment 5 Alexey Proskuryakov 2007-11-06 08:12:02 PST
> +        return (NSString *)plainText(makeRange(startVisiblePosition,
> endVisiblePosition).get());
> 
> Why is that typecast needed?

I thought it was needed because the function returned an id - but looks like Objective-C++ somehow guesses that a conversion to NSString * is implied here!

Committed revision 27477.

Comment 6 Darin Adler 2007-11-06 08:45:25 PST
(In reply to comment #5)
> I thought it was needed because the function returned an id - but looks like
> Objective-C++ somehow guesses that a conversion to NSString * is implied here!

Bizarre!