[Webkit-unassigned] [Bug 61889] New: WebKit2: please expose additional editing commands in WKView

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 1 16:00:15 PDT 2011


           Summary: WebKit2: please expose additional editing commands in
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.6
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit2
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: justin at cam.org

Between NSResponder overrides and NSTextInputClient conformance, WKView has almost everything needed to control text editing.

I would find the following additional methods particularly useful:

- (void)setSelectedRange:(NSRange)charRange
    Can be simulated by using moveLeft:/moveRight: and moveLeft/RightAndModifySelection: but that is painful and slow.

- (void)centerSelectionInVisibleArea:(id)sender
    Helpful complement to setSelectedRange:, so the user can see what's going on.

- (NSInteger)length
    In Carbon's IMKInputSession protocol but not NSTextInputClient. Can be simulated by moveToEndOfDocument: followed by selectedRange, but that modifies the selection.
    Supply either this or

- (NSAttributedString *)attributedString
    If I can get the whole string, I can get its length. But once I have its length, I can use attributedSubstringForProposedRange:actualRange:

- (void)replaceCharactersInRange:(NSRange)aRange withAttributedString:(NSAttributedString *)attributedString
    Can be simulated with setMarkedText:selectedRange:replacementRange: followed by unmarkText, though I wonder about potential unwanted side effects.

The use for these is to implement a scripting extension allowing an editable WKView to be synchronized with and corrected by an external grammatical correction app. This works very nicely in classic WebKit, but WebKit 2 doesn't expose enough Objective-C methods or other hooks.

Accessibility interfaces might be an alternative way of achieving this, but impose a very different view of the editable document.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list