Title: [187336] trunk/Source/WebKit2
Revision
187336
Author
carlo...@webkit.org
Date
2015-07-24 04:27:32 -0700 (Fri, 24 Jul 2015)

Log Message

REGRESSION(r187100): [GTK] ASSERTION FAILED: Attempt to access post layout data before receiving it when typing backspace
https://bugs.webkit.org/show_bug.cgi?id=147196

Reviewed by Žan Doberšek.

Do not try to use the PostLayoutData from EditorState when
isMissingPostLayoutData is true. That happens when there's a
layout pending, and EditorStateChanged is sent again after that
layout with the post layout data. So we can just return early and
wait until the second message.

* UIProcess/API/gtk/WebKitEditorState.cpp:
(webkitEditorStateChanged):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseUpdateTextInputState):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (187335 => 187336)


--- trunk/Source/WebKit2/ChangeLog	2015-07-24 08:48:44 UTC (rev 187335)
+++ trunk/Source/WebKit2/ChangeLog	2015-07-24 11:27:32 UTC (rev 187336)
@@ -1,3 +1,21 @@
+2015-07-24  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        REGRESSION(r187100): [GTK] ASSERTION FAILED: Attempt to access post layout data before receiving it when typing backspace
+        https://bugs.webkit.org/show_bug.cgi?id=147196
+
+        Reviewed by Žan Doberšek.
+
+        Do not try to use the PostLayoutData from EditorState when
+        isMissingPostLayoutData is true. That happens when there's a
+        layout pending, and EditorStateChanged is sent again after that
+        layout with the post layout data. So we can just return early and
+        wait until the second message.
+
+        * UIProcess/API/gtk/WebKitEditorState.cpp:
+        (webkitEditorStateChanged):
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseUpdateTextInputState):
+
 2015-07-23  Alex Christensen  <achristen...@webkit.org>
 
         Fix 32-bit build after r187272.

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitEditorState.cpp (187335 => 187336)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitEditorState.cpp	2015-07-24 08:48:44 UTC (rev 187335)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitEditorState.cpp	2015-07-24 11:27:32 UTC (rev 187336)
@@ -106,6 +106,9 @@
 
 void webkitEditorStateChanged(WebKitEditorState* editorState, const EditorState& newState)
 {
+    if (newState.isMissingPostLayoutData)
+        return;
+
     unsigned typingAttributes = WEBKIT_EDITOR_TYPING_ATTRIBUTE_NONE;
     const auto& postLayoutData = newState.postLayoutData();
     if (postLayoutData.typingAttributes & AttributeBold)

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (187335 => 187336)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp	2015-07-24 08:48:44 UTC (rev 187335)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp	2015-07-24 11:27:32 UTC (rev 187336)
@@ -1321,7 +1321,9 @@
 
 void webkitWebViewBaseUpdateTextInputState(WebKitWebViewBase* webkitWebViewBase)
 {
-    webkitWebViewBase->priv->inputMethodFilter.setCursorRect(webkitWebViewBase->priv->pageProxy->editorState().postLayoutData().caretRectAtStart);
+    const auto& editorState = webkitWebViewBase->priv->pageProxy->editorState();
+    if (!editorState.isMissingPostLayoutData)
+        webkitWebViewBase->priv->inputMethodFilter.setCursorRect(editorState.postLayoutData().caretRectAtStart);
 }
 
 void webkitWebViewBaseResetClickCounter(WebKitWebViewBase* webkitWebViewBase)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to