[haiku-webkit-commits] r564 - in webkit/trunk/WebKit/haiku/WebPositive: . autocompletion

  • From: noreply@xxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Thu, 30 Dec 2010 02:31:42 +0100 (CET)

Author: leavengood
Date: Thu Dec 30 02:31:41 2010
New Revision: 564
URL: http://webpositive.haiku-os.org/changeset/564

Log:
Mostly revert r563 and fix it properly. The ESC key should be dispatched to the
text view from the filter as well as from the browser window.

Modified:
   webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp
   webkit/trunk/WebKit/haiku/WebPositive/autocompletion/TextViewCompleter.cpp
   webkit/trunk/WebKit/haiku/WebPositive/autocompletion/TextViewCompleter.h

Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp     Wed Dec 29 
23:51:13 2010        (r563)
+++ webkit/trunk/WebKit/haiku/WebPositive/BrowserWindow.cpp     Thu Dec 30 
02:31:41 2010        (r564)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2007 Andrea Anzani <andrea.anzani@xxxxxxxxx>
- * Copyright (C) 2007 Ryan Leavengood <leavengood@xxxxxxxxx>
+ * Copyright (C) 2007, 2010 Ryan Leavengood <leavengood@xxxxxxxxx>
  * Copyright (C) 2009 Maxime Simon <simon.maxime@xxxxxxxxx>
  * Copyright (C) 2010 Stephan Aßmus <superstippi@xxxxxx>
  * Copyright (C) 2010 Michael Lotz <mmlr@xxxxxxxx>
@@ -546,8 +546,12 @@
                        PostMessage(GO_FORWARD);
                        return;
                } else if (bytes[0] == B_ESCAPE) {
-                       PostMessage(STOP);
-                       return;
+                       // Let the URL input handle escape when it is the target
+                       if (target != fURLInputGroup->TextView()) {
+                               // Otherwise do a stop
+                               PostMessage(STOP);
+                               return;
+                       }
                } else if (bytes[0] == B_FUNCTION_KEY) {
                        // Some function key Firefox compatibility
                        int32 key;

Modified: 
webkit/trunk/WebKit/haiku/WebPositive/autocompletion/TextViewCompleter.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/autocompletion/TextViewCompleter.cpp  
Wed Dec 29 23:51:13 2010        (r563)
+++ webkit/trunk/WebKit/haiku/WebPositive/autocompletion/TextViewCompleter.cpp  
Thu Dec 30 02:31:41 2010        (r564)
@@ -73,8 +73,7 @@
                new BDefaultChoiceView(), patternSelector),
        BMessageFilter(B_KEY_DOWN),
        fTextView(textView),
-       fModificationsReported(false),
-       fOriginalTextSaved(false)
+       fModificationsReported(false)
 {
        fTextView->AddFilter(this);
 }
@@ -103,11 +102,6 @@
 filter_result
 TextViewCompleter::Filter(BMessage* message, BHandler** target)
 {
-       if (!fOriginalTextSaved) {
-               fOriginalText = fTextView->Text();
-               fOriginalTextSaved = true;
-       }
-
        const char* bytes;
        int32 modifiers;
        if (!target || message->FindString("bytes", &bytes) != B_OK
@@ -146,14 +140,8 @@
                }
 
                case B_ESCAPE:
-                       if (fOriginalText != fTextView->Text()) {
-                               fModificationsReported = false;
-                               fTextView->SetText(fOriginalText.String());
-                               fTextView->SelectAll();
-                               fModificationsReported = true;
-                               CancelChoice();
-                       }
-                       return B_SKIP_MESSAGE;
+                       CancelChoice();
+                       return B_DISPATCH_MESSAGE;
                case B_RETURN:
                        if (IsChoiceSelected()) {
                                ApplyChoice();

Modified: 
webkit/trunk/WebKit/haiku/WebPositive/autocompletion/TextViewCompleter.h
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/autocompletion/TextViewCompleter.h    
Wed Dec 29 23:51:13 2010        (r563)
+++ webkit/trunk/WebKit/haiku/WebPositive/autocompletion/TextViewCompleter.h    
Thu Dec 30 02:31:41 2010        (r564)
@@ -43,8 +43,6 @@
 private:
                        BTextView*                      fTextView;
                        bool                            fModificationsReported;
-                       BString                         fOriginalText;
-                       bool                            fOriginalTextSaved;
 };
 
 #endif // TEXT_CONTROL_COMPLETER_H

Other related posts:

  • » [haiku-webkit-commits] r564 - in webkit/trunk/WebKit/haiku/WebPositive: . autocompletion - noreply