[Webkit-unassigned] [Bug 42958] Pasting should fire textInput event
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Aug 4 22:25:55 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=42958
--- Comment #4 from MORITA Hajime <morrita at google.com> 2010-08-04 22:25:55 PST ---
Hi Tony, thank you fro reviewing.
I updated the patch. Could you take a look at new one?
(In reply to comment #2)
> (From update of attachment 63440 [details])
> > diff --git a/LayoutTests/editing/pasteboard/script-tests/paste-text-events.js b/LayoutTests/editing/pasteboard/script-tests/paste-text-events.js
> Nit: Looks like a tab character got in here.
Oops. removed. (I should change a setting for my javascript-mode.)
>
> > +willCancelTextInput = false;
> > +for (var i = 0; i < proceedingTestCases.length; ++i)
> > + runSingleTest(proceedingTestCases[i]);
> > +shouldBe("textInputCount", "proceedingTestCases.length");
> > +
> > +textInputCount = 0;
> > +willCancelTextInput = true;
> > +for (var i = 0; i < cancelingTestCases.length; ++i)
> > + runSingleTest(cancelingTestCases[i]);
> > +shouldBe("textInputCount", "cancelingTestCases.length");
>
> These tests look great! Does this event fire for ontextinput declared in the HTML? If so, it'd be nice to add some tests for that too.
WebKit doesn't implement ontextinput yet.
Though I filed it to Bug 43538,
I noticed that there seems no standard that mentions about ontextinput.
I'm not sure if we should implement this. Any ideas?
>
> > diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
> > +void Editor::pasteAsPlainText(const String& pastingText, bool smartReplace)
> > +void Editor::pasteAsFragment(PassRefPtr<DocumentFragment> pastingFragment, bool smartReplace, bool matchStyle)
>
> These methods seem to have only one caller. Since they're pretty short, maybe we should just inline them? I think it's confusing to have pasteAsPlainText and pasteAsPlainTextWithPasteboard.
They are also called from WebHTMLView.mm.
(The problem is that there are 2 very similar pasting code,
one for WebCore and another for WebKit/mac.)
By the way, pasteXxWithoutSendingEvent() looks verbose and I removed them.
>
>
> > +class FragmentPasteTextEvent : public TextEvent {
> > +public:
> > + static PassRefPtr<FragmentPasteTextEvent> create(PassRefPtr<AbstractView> view, PassRefPtr<DocumentFragment> pastingData, bool smartReplace, bool matchStyle);
>
> Subclassing seems like overkill just to keep track of the type of event. Can we just add an argument to the TextEvent constructor that keeps track of the event type? The spec mentions an inputMode parameter to initTextEvent, but that should probably happen in a different patch.
Agreed and removed subclasses.
--
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