Title: [205092] trunk/Source
Revision
205092
Author
[email protected]
Date
2016-08-27 17:36:05 -0700 (Sat, 27 Aug 2016)

Log Message

Add more Editing logging
https://bugs.webkit.org/show_bug.cgi?id=161287

Reviewed by Darin Adler.

Add logging which tracks how key events get from the UI process to the
web process, and down to form fields.

* editing/Editor.cpp:
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::appliedEditing):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::insertTextAndNotifyAccessibility):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent):
(WebCore::EventHandler::handleTextInputEvent):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (205091 => 205092)


--- trunk/Source/WebCore/ChangeLog	2016-08-28 00:15:53 UTC (rev 205091)
+++ trunk/Source/WebCore/ChangeLog	2016-08-28 00:36:05 UTC (rev 205092)
@@ -1,3 +1,25 @@
+2016-08-27  Simon Fraser  <[email protected]>
+
+        Add more Editing logging
+        https://bugs.webkit.org/show_bug.cgi?id=161287
+
+        Reviewed by Darin Adler.
+
+        Add logging which tracks how key events get from the UI process to the
+        web process, and down to form fields.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::handleTextEvent):
+        (WebCore::Editor::appliedEditing):
+        * editing/TypingCommand.cpp:
+        (WebCore::TypingCommand::insertText):
+        (WebCore::TypingCommand::insertTextAndNotifyAccessibility):
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::keyEvent):
+        (WebCore::EventHandler::handleTextInputEvent):
+
 2016-08-27  Sam Weinig  <[email protected]>
 
         Remove more custom _javascript_ bindings

Modified: trunk/Source/WebCore/editing/Editor.cpp (205091 => 205092)


--- trunk/Source/WebCore/editing/Editor.cpp	2016-08-28 00:15:53 UTC (rev 205091)
+++ trunk/Source/WebCore/editing/Editor.cpp	2016-08-28 00:36:05 UTC (rev 205092)
@@ -62,6 +62,7 @@
 #include "InsertListCommand.h"
 #include "KeyboardEvent.h"
 #include "KillRing.h"
+#include "Logging.h"
 #include "MainFrame.h"
 #include "ModifySelectionListLevel.h"
 #include "NodeList.h"
@@ -197,6 +198,8 @@
 
 bool Editor::handleTextEvent(TextEvent* event)
 {
+    LOG(Editing, "Editor %p handleTextEvent (data %s)", this, event->data().utf8().data());
+
     // Default event handling for Drag and Drop will be handled by DragController
     // so we leave the event for it.
     if (event->isDrop())
@@ -1033,6 +1036,8 @@
 
 void Editor::appliedEditing(PassRefPtr<CompositeEditCommand> cmd)
 {
+    LOG(Editing, "Editor %p appliedEditing", this);
+
     document().updateLayout();
 
     EditCommandComposition* composition = cmd->composition();

Modified: trunk/Source/WebCore/editing/TypingCommand.cpp (205091 => 205092)


--- trunk/Source/WebCore/editing/TypingCommand.cpp	2016-08-28 00:15:53 UTC (rev 205091)
+++ trunk/Source/WebCore/editing/TypingCommand.cpp	2016-08-28 00:36:05 UTC (rev 205092)
@@ -38,6 +38,7 @@
 #include "InsertLineBreakCommand.h"
 #include "InsertParagraphSeparatorCommand.h"
 #include "InsertTextCommand.h"
+#include "Logging.h"
 #include "MathMLElement.h"
 #include "RenderElement.h"
 #include "TextIterator.h"
@@ -167,6 +168,8 @@
     RefPtr<Frame> frame = document.frame();
     ASSERT(frame);
 
+    LOG(Editing, "TypingCommand::insertText (text %s)", text.utf8().data());
+
     VisibleSelection currentSelection = frame->selection().selection();
 
     String newText = dispatchBeforeTextInsertedEvent(text, selectionForInsertion, compositionType == TextCompositionUpdate);
@@ -380,6 +383,8 @@
 
 void TypingCommand::insertTextAndNotifyAccessibility(const String &text, bool selectInsertedText)
 {
+    LOG(Editing, "TypingCommand %p insertTextAndNotifyAccessibility (text %s, selectInsertedText %d)", this, text.utf8().data(), selectInsertedText);
+
     AccessibilityReplacedText replacedText(frame().selection().selection());
     insertText(text, selectInsertedText);
     replacedText.postTextStateChangeNotification(document().existingAXObjectCache(), AXTextEditTypeTyping, text, frame().selection().selection());

Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (205091 => 205092)


--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2016-08-28 00:15:53 UTC (rev 205091)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2016-08-28 00:36:05 UTC (rev 205092)
@@ -38,6 +38,7 @@
 #include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "HTMLParserIdioms.h"
+#include "Logging.h"
 #include "NodeTraversal.h"
 #include "Page.h"
 #include "RenderBlockFlow.h"
@@ -109,6 +110,8 @@
     if (!isTextFormControl())
         return;
 
+    LOG(Editing, "HTMLTextFormControlElement %p didEditInnerTextValue", this);
+
     m_lastChangeWasUserEdit = true;
     subtreeHasChanged();
 }

Modified: trunk/Source/WebCore/page/EventHandler.cpp (205091 => 205092)


--- trunk/Source/WebCore/page/EventHandler.cpp	2016-08-28 00:15:53 UTC (rev 205091)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2016-08-28 00:36:05 UTC (rev 205092)
@@ -63,6 +63,7 @@
 #include "Image.h"
 #include "InspectorInstrumentation.h"
 #include "KeyboardEvent.h"
+#include "Logging.h"
 #include "MainFrame.h"
 #include "MouseEvent.h"
 #include "MouseEventWithHitTestResults.h"
@@ -3013,6 +3014,8 @@
 {
     RefPtr<FrameView> protector(m_frame.view());
 
+    LOG(Editing, "EventHandler %p keyEvent (text %s keyIdentifier %s)", this, initialKeyEvent.text().utf8().data(), initialKeyEvent.keyIdentifier().utf8().data());
+
 #if ENABLE(FULLSCREEN_API)
     if (m_frame.document()->webkitIsFullScreen() && !isKeyEventAllowedInFullScreen(initialKeyEvent))
         return false;
@@ -3536,6 +3539,8 @@
 
 bool EventHandler::handleTextInputEvent(const String& text, Event* underlyingEvent, TextEventInputType inputType)
 {
+    LOG(Editing, "EventHandler %p handleTextInputEvent (text %s)", this, text.utf8().data());
+
     // Platforms should differentiate real commands like selectAll from text input in disguise (like insertNewline),
     // and avoid dispatching text input events from keydown default handlers.
     ASSERT(!is<KeyboardEvent>(underlyingEvent) || downcast<KeyboardEvent>(*underlyingEvent).type() == eventNames().keypressEvent);

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (205091 => 205092)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-08-28 00:15:53 UTC (rev 205091)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-08-28 00:36:05 UTC (rev 205092)
@@ -1958,8 +1958,10 @@
     m_keyEventQueue.append(event);
 
     m_process->responsivenessTimer().start();
-    if (m_keyEventQueue.size() == 1) // Otherwise, sent from DidReceiveEvent message handler.
+    if (m_keyEventQueue.size() == 1) { // Otherwise, sent from DidReceiveEvent message handler.
+        LOG(KeyHandling, " UI process: sent keyEvent from handleKeyboardEvent");
         m_process->send(Messages::WebPage::KeyEvent(event), m_pageID);
+    }
 }
 
 WebPreferencesStore WebPageProxy::preferencesStore() const
@@ -4857,7 +4859,7 @@
     case WebEvent::KeyUp:
     case WebEvent::RawKeyDown:
     case WebEvent::Char: {
-        LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s", webKeyboardEventTypeString(type));
+        LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s (queue empty %d)", webKeyboardEventTypeString(type), m_keyEventQueue.isEmpty());
 
         MESSAGE_CHECK(!m_keyEventQueue.isEmpty());
         NativeWebKeyboardEvent event = m_keyEventQueue.takeFirst();
@@ -4864,9 +4866,10 @@
 
         MESSAGE_CHECK(type == event.type());
 
-        if (!m_keyEventQueue.isEmpty())
+        if (!m_keyEventQueue.isEmpty()) {
+            LOG(KeyHandling, " UI process: sent keyEvent from didReceiveEvent");
             m_process->send(Messages::WebPage::KeyEvent(m_keyEventQueue.first()), m_pageID);
-        else {
+        } else {
             if (auto* automationSession = process().processPool().automationSession())
                 automationSession->keyboardEventsFlushedForPage(*this);
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to