Title: [223835] trunk/Source/WebCore
- Revision
- 223835
- Author
- [email protected]
- Date
- 2017-10-23 08:57:51 -0700 (Mon, 23 Oct 2017)
Log Message
Call FrameView::scheduleSelectionUpdate when selection needs repainting after layout instead of setting the RenderView dirty.
https://bugs.webkit.org/show_bug.cgi?id=178651
<rdar://problem/35117448>
Reviewed by Antti Koivisto.
Calling setNeedsLayout() on the RenderView to trigger selection update is problematic in 2 different ways:
1. marking the root renderer dirty does not trigger layout (this is very specific to the root,
other renderers do trigger layout). It means that it works as long as someone else schedules a layout.
2. when a subtree layout is already scheduled and we mark the root renderer dirty, the root gets stuck with
the dirty flag (since the entry point for the subsequent layout is a descendant of the root and not the root itself).
This patch addresses these issues by scheduling/converting subtree layout when needed.
Covered by fast/dynamic/remove-invisible-node-inside-selection.html/remove-node-inside-selection.html
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::respondToNodeModification):
* page/FrameView.cpp:
(WebCore::FrameView::scheduleSelectionUpdate):
* page/FrameView.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (223834 => 223835)
--- trunk/Source/WebCore/ChangeLog 2017-10-23 11:50:21 UTC (rev 223834)
+++ trunk/Source/WebCore/ChangeLog 2017-10-23 15:57:51 UTC (rev 223835)
@@ -1,3 +1,27 @@
+2017-10-23 Zalan Bujtas <[email protected]>
+
+ Call FrameView::scheduleSelectionUpdate when selection needs repainting after layout instead of setting the RenderView dirty.
+ https://bugs.webkit.org/show_bug.cgi?id=178651
+ <rdar://problem/35117448>
+
+ Reviewed by Antti Koivisto.
+
+ Calling setNeedsLayout() on the RenderView to trigger selection update is problematic in 2 different ways:
+ 1. marking the root renderer dirty does not trigger layout (this is very specific to the root,
+ other renderers do trigger layout). It means that it works as long as someone else schedules a layout.
+ 2. when a subtree layout is already scheduled and we mark the root renderer dirty, the root gets stuck with
+ the dirty flag (since the entry point for the subsequent layout is a descendant of the root and not the root itself).
+
+ This patch addresses these issues by scheduling/converting subtree layout when needed.
+
+ Covered by fast/dynamic/remove-invisible-node-inside-selection.html/remove-node-inside-selection.html
+
+ * editing/FrameSelection.cpp:
+ (WebCore::FrameSelection::respondToNodeModification):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scheduleSelectionUpdate):
+ * page/FrameView.h:
+
2017-10-23 Miguel Gomez <[email protected]>
[TexMap] Remove GraphicsContext3D usage from TextureMapperShaderProgram
Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (223834 => 223835)
--- trunk/Source/WebCore/editing/FrameSelection.cpp 2017-10-23 11:50:21 UTC (rev 223834)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp 2017-10-23 15:57:51 UTC (rev 223835)
@@ -510,7 +510,7 @@
// Trigger a selection update so the selection will be set again.
m_pendingSelectionUpdate = true;
- renderView->setNeedsLayout();
+ renderView->frameView().scheduleSelectionUpdate();
}
}
Modified: trunk/Source/WebCore/page/FrameView.cpp (223834 => 223835)
--- trunk/Source/WebCore/page/FrameView.cpp 2017-10-23 11:50:21 UTC (rev 223834)
+++ trunk/Source/WebCore/page/FrameView.cpp 2017-10-23 15:57:51 UTC (rev 223835)
@@ -3184,6 +3184,16 @@
m_delayedLayout = false;
}
+void FrameView::scheduleSelectionUpdate()
+{
+ if (needsLayout())
+ return;
+ // FIXME: We should not need to go through the layout process since selection update does not change dimension/geometry.
+ // However we can't tell at this point if the tree is stable yet, so let's just schedule a root only layout for now.
+ setNeedsLayout();
+ scheduleRelayout();
+}
+
void FrameView::serviceScriptedAnimations()
{
for (auto* frame = m_frame.ptr(); frame; frame = frame->tree().traverseNext()) {
Modified: trunk/Source/WebCore/page/FrameView.h (223834 => 223835)
--- trunk/Source/WebCore/page/FrameView.h 2017-10-23 11:50:21 UTC (rev 223834)
+++ trunk/Source/WebCore/page/FrameView.h 2017-10-23 15:57:51 UTC (rev 223835)
@@ -128,6 +128,8 @@
WEBCORE_EXPORT bool renderedCharactersExceed(unsigned threshold);
+ void scheduleSelectionUpdate();
+
#if PLATFORM(IOS)
bool useCustomFixedPositionLayoutRect() const;
IntRect customFixedPositionLayoutRect() const { return m_customFixedPositionLayoutRect; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes