Title: [221344] trunk
Revision
221344
Author
carlo...@webkit.org
Date
2017-08-29 23:59:57 -0700 (Tue, 29 Aug 2017)

Log Message

REGRESSION(r221064): [GTK] Editor not correctly working after r221064
https://bugs.webkit.org/show_bug.cgi?id=176052

Reviewed by Michael Catanzaro.

Source/WebKit:

Since r221064 we are not always notified about typing attributes when editor state changes. didChangeSelection
no longer includes the typing attributes in EditorStateChange message, it's scheduled to be sent after the
compositing layer have been flushed, but that part is not implemented for GTK+ port.

Fixes test /webkit2/WebKitWebView/editor-state/typing-attributes.

* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::updateBackingStoreState): Call WebPage::flushPendingEditorStateUpdate() after
the layout.
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): Call WebPage::flushPendingEditorStateUpdate() after
the display sync.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::display): Call WebPage::flushPendingEditorStateUpdate() after the layout.
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformEditorState const): Also return early, setting isMissingPostLayoutData to true, when
there's no frame view, the view needs a layout or the result is not for editable content.

Tools:

Run the test inside a window to ensure display updates happen.

* TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp:
(testWebViewEditorEditorStateTypingAttributes):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (221343 => 221344)


--- trunk/Source/WebKit/ChangeLog	2017-08-30 05:09:23 UTC (rev 221343)
+++ trunk/Source/WebKit/ChangeLog	2017-08-30 06:59:57 UTC (rev 221344)
@@ -1,3 +1,28 @@
+2017-08-29  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        REGRESSION(r221064): [GTK] Editor not correctly working after r221064
+        https://bugs.webkit.org/show_bug.cgi?id=176052
+
+        Reviewed by Michael Catanzaro.
+
+        Since r221064 we are not always notified about typing attributes when editor state changes. didChangeSelection
+        no longer includes the typing attributes in EditorStateChange message, it's scheduled to be sent after the
+        compositing layer have been flushed, but that part is not implemented for GTK+ port.
+
+        Fixes test /webkit2/WebKitWebView/editor-state/typing-attributes.
+
+        * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
+        (WebKit::AcceleratedDrawingArea::updateBackingStoreState): Call WebPage::flushPendingEditorStateUpdate() after
+        the layout.
+        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+        (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired): Call WebPage::flushPendingEditorStateUpdate() after
+        the display sync.
+        * WebProcess/WebPage/DrawingAreaImpl.cpp:
+        (WebKit::DrawingAreaImpl::display): Call WebPage::flushPendingEditorStateUpdate() after the layout.
+        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+        (WebKit::WebPage::platformEditorState const): Also return early, setting isMissingPostLayoutData to true, when
+        there's no frame view, the view needs a layout or the result is not for editable content.
+
 2017-08-29  Brent Fulgham  <bfulg...@apple.com>
 
         ResourceLoadStatistics logic does not understand custom WebsiteData stores

Modified: trunk/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp (221343 => 221344)


--- trunk/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp	2017-08-30 05:09:23 UTC (rev 221343)
+++ trunk/Source/WebKit/WebProcess/WebPage/AcceleratedDrawingArea.cpp	2017-08-30 06:59:57 UTC (rev 221344)
@@ -246,6 +246,7 @@
         m_webPage.setDeviceScaleFactor(deviceScaleFactor);
         m_webPage.setSize(size);
         m_webPage.layoutIfNeeded();
+        m_webPage.flushPendingEditorStateUpdate();
         m_webPage.scrollMainFrameIfNotAtMaxScrollPosition(scrollOffset);
 
         if (m_layerTreeHost)

Modified: trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp (221343 => 221344)


--- trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2017-08-30 05:09:23 UTC (rev 221343)
+++ trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp	2017-08-30 06:59:57 UTC (rev 221344)
@@ -192,6 +192,7 @@
         return;
 
     m_coordinator.syncDisplayState();
+    m_webPage.flushPendingEditorStateUpdate();
 
     if (!m_isValid || !m_coordinator.rootCompositingLayer())
         return;

Modified: trunk/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp (221343 => 221344)


--- trunk/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp	2017-08-30 05:09:23 UTC (rev 221343)
+++ trunk/Source/WebKit/WebProcess/WebPage/DrawingAreaImpl.cpp	2017-08-30 06:59:57 UTC (rev 221344)
@@ -400,6 +400,7 @@
     ASSERT(!m_webPage.size().isEmpty());
 
     m_webPage.layoutIfNeeded();
+    m_webPage.flushPendingEditorStateUpdate();
 
     // The layout may have put the page into accelerated compositing mode. If the LayerTreeHost is
     // in charge of displaying, we have nothing more to do.

Modified: trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp (221343 => 221344)


--- trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp	2017-08-30 05:09:23 UTC (rev 221343)
+++ trunk/Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp	2017-08-30 06:59:57 UTC (rev 221344)
@@ -74,7 +74,7 @@
 
 void WebPage::platformEditorState(Frame& frame, EditorState& result, IncludePostLayoutDataHint shouldIncludePostLayoutData) const
 {
-    if (shouldIncludePostLayoutData == IncludePostLayoutDataHint::No) {
+    if (shouldIncludePostLayoutData == IncludePostLayoutDataHint::No || !frame.view() || frame.view()->needsLayout() || !result.isContentEditable) {
         result.isMissingPostLayoutData = true;
         return;
     }

Modified: trunk/Tools/ChangeLog (221343 => 221344)


--- trunk/Tools/ChangeLog	2017-08-30 05:09:23 UTC (rev 221343)
+++ trunk/Tools/ChangeLog	2017-08-30 06:59:57 UTC (rev 221344)
@@ -1,3 +1,15 @@
+2017-08-29  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        REGRESSION(r221064): [GTK] Editor not correctly working after r221064
+        https://bugs.webkit.org/show_bug.cgi?id=176052
+
+        Reviewed by Michael Catanzaro.
+
+        Run the test inside a window to ensure display updates happen.
+
+        * TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp:
+        (testWebViewEditorEditorStateTypingAttributes):
+
 2017-08-29  Don Olmstead  <don.olmst...@sony.com>
 
         [CMake] Use find_package for zlib

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp (221343 => 221344)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp	2017-08-30 05:09:23 UTC (rev 221343)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebViewEditor.cpp	2017-08-30 06:59:57 UTC (rev 221344)
@@ -293,6 +293,7 @@
         "<b><i>boldanditalic </i></b>"
         "</body></html>";
 
+    test->showInWindowAndWaitUntilMapped();
     test->loadHtml(typingAttributesHTML, nullptr);
     test->waitUntilLoadFinished();
     test->setEditable(true);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to