Bug 15847 - Some editing cleanup
Summary: Some editing cleanup
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P3 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-05 10:56 PST by Alexey Proskuryakov
Modified: 2007-11-06 08:45 PST (History)
0 users

See Also:


Attachments
proposed patch (12.99 KB, patch)
2007-11-05 11:10 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
updated patch (12.36 KB, patch)
2007-11-06 01:12 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
updated patch (13.02 KB, patch)
2007-11-06 01:35 PST, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!