Bug 84010

Summary: [GTK] atk/textChangedNotifications API test fails
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jiapu.mail, mario, morrita, mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch proposal none

Description Philippe Normand 2012-04-16 00:21:49 PDT
First failing build is http://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release/builds/22284
I suspect http://trac.webkit.org/changeset/114220 might be culprit.

I'll skip this test for now.
Comment 1 Mario Sanchez Prada 2012-04-16 07:32:45 PDT
Created attachment 137346 [details]
Patch proposal

It is segfaulting in WebCore::Editor, at Source/WebCore/editing/Editor.cpp:920. See the snippet:

   bool Editor::insertTextWithoutSendingTextEvent(const String& text, bool selectInsertedText, TextEvent* triggeringEvent)
   {
      [...]
       if (selection.isContentEditable()) {
           if (Node* selectionStart = selection.start().deprecatedNode()) {
               RefPtr<Document> document = selectionStart->document();

               // Insert the text
               if (triggeringEvent->isDictation())   <--- SEGV here, triggeringEvent might be NULL (see check in line below, in the else branch)
                   DictationCommand::insertText(document.get(), text, triggeringEvent->dictationAlternatives(), selection);
               else {
                   TypingCommand::Options options = 0;
                   if (selectInsertedText)
                       options |= TypingCommand::SelectInsertedText;
                   if (autocorrectionWasApplied)
                       options |= TypingCommand::RetainAutocorrectionIndicator;
                   TypingCommand::insertText(document.get(), text, selection, options, triggeringEvent && triggeringEvent->isComposition() ? TypingCommand::TextCompositionConfirm : TypingCommand::TextCompositionNone);
               }
   [...]
   }

So, the attached patch would fix the issue.
Comment 2 Martin Robinson 2012-04-16 08:21:31 PDT
Is Dictation a new feature? I'm surprised it isn't behind a compile-time flag.
Comment 3 Jia Pu 2012-04-16 18:23:22 PDT
(In reply to comment #2)
> Is Dictation a new feature? I'm surprised it isn't behind a compile-time flag.

Currently this is used only by OS X. I can certainly put it behind compile time flag, if that's desirable.
Comment 4 Jia Pu 2012-04-17 10:26:49 PDT
It seems http://trac.webkit.org/changeset/114311 has already fixed this.
Comment 5 Martin Robinson 2012-04-17 10:34:17 PDT
We just need to unskip the test now.
Comment 6 Mario Sanchez Prada 2012-04-18 00:37:49 PDT
Committed r114490: <http://trac.webkit.org/changeset/114490>
Comment 7 Eric Seidel (no email) 2012-04-19 15:56:50 PDT
Comment on attachment 137346 [details]
Patch proposal

Cleared review? from attachment 137346 [details] so that this bug does not appear in http://webkit.org/pending-review.  If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).