Title: [274526] trunk
Revision
274526
Author
commit-qu...@webkit.org
Date
2021-03-16 15:45:00 -0700 (Tue, 16 Mar 2021)

Log Message

ASSERTION FAILED: m_state == State::Committed in WebKit::FrameLoadState::didFailLoad()
https://bugs.webkit.org/show_bug.cgi?id=221783

Patch by Julian Gonzalez <julian_a_gonza...@apple.com> on 2021-03-16
Reviewed by Ryosuke Niwa.

Source/WebCore:

Don't attempt to update layout while in the FrameSelection constructor -
otherwise, we can break the order of operations of the loader.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::focusedOrActiveStateChanged):
(WebCore::FrameSelection::setCaretVisibility):
* editing/FrameSelection.h:
(WebCore::FrameSelection::setCaretVisible):

LayoutTests:

Stop skipping loader/change-src-during-iframe-load-crash.html on Debug bots.

* platform/wk2/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (274525 => 274526)


--- trunk/LayoutTests/ChangeLog	2021-03-16 22:43:46 UTC (rev 274525)
+++ trunk/LayoutTests/ChangeLog	2021-03-16 22:45:00 UTC (rev 274526)
@@ -1,3 +1,14 @@
+2021-03-16  Julian Gonzalez  <julian_a_gonza...@apple.com>
+
+        ASSERTION FAILED: m_state == State::Committed in WebKit::FrameLoadState::didFailLoad()
+        https://bugs.webkit.org/show_bug.cgi?id=221783
+
+        Reviewed by Ryosuke Niwa.
+
+        Stop skipping loader/change-src-during-iframe-load-crash.html on Debug bots.
+
+        * platform/wk2/TestExpectations:
+
 2021-03-16  Robert Jenner  <jen...@apple.com>
 
         REGRESSION (r274461): [ macOS wk1 ]fast/repaint/canvas-object-fit.html is flakey text failing

Modified: trunk/LayoutTests/platform/wk2/TestExpectations (274525 => 274526)


--- trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-16 22:43:46 UTC (rev 274525)
+++ trunk/LayoutTests/platform/wk2/TestExpectations	2021-03-16 22:45:00 UTC (rev 274526)
@@ -244,8 +244,6 @@
 
 webkit.org/b/221819 imported/w3c/web-platform-tests/webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html [ Failure ]
 
-webkit.org/b/221783 [ Debug ] loader/change-src-during-iframe-load-crash.html [ Skip ]
-
 webkit.org/b/222569 fast/mediastream/media-stream-track-interrupted.html [ Crash Pass ]
 
 ### END OF (1) Classified failures with bug reports

Modified: trunk/Source/WebCore/ChangeLog (274525 => 274526)


--- trunk/Source/WebCore/ChangeLog	2021-03-16 22:43:46 UTC (rev 274525)
+++ trunk/Source/WebCore/ChangeLog	2021-03-16 22:45:00 UTC (rev 274526)
@@ -1,3 +1,20 @@
+2021-03-16  Julian Gonzalez  <julian_a_gonza...@apple.com>
+
+        ASSERTION FAILED: m_state == State::Committed in WebKit::FrameLoadState::didFailLoad()
+        https://bugs.webkit.org/show_bug.cgi?id=221783
+
+        Reviewed by Ryosuke Niwa.
+
+        Don't attempt to update layout while in the FrameSelection constructor -
+        otherwise, we can break the order of operations of the loader.
+
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::FrameSelection):
+        (WebCore::FrameSelection::focusedOrActiveStateChanged):
+        (WebCore::FrameSelection::setCaretVisibility):
+        * editing/FrameSelection.h:
+        (WebCore::FrameSelection::setCaretVisible):
+
 2021-03-16  Devin Rousso  <drou...@apple.com>
 
         [macOS] change for the language/subtitle tracks button to use an `NSMenu` instead of web content

Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (274525 => 274526)


--- trunk/Source/WebCore/editing/FrameSelection.cpp	2021-03-16 22:43:46 UTC (rev 274525)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp	2021-03-16 22:45:00 UTC (rev 274526)
@@ -181,7 +181,7 @@
     // Caret blinking (blinks | does not blink)
     setCaretVisible(activeAndFocused);
 #else
-    setCaretVisibility(activeAndFocused ? Visible : Hidden);
+    setCaretVisibility(activeAndFocused ? Visible : Hidden, ShouldUpdateAppearance::No);
 #endif
 }
 
@@ -2063,7 +2063,7 @@
     // Caret appears in the active frame.
     if (activeAndFocused)
         setSelectionFromNone();
-    setCaretVisibility(activeAndFocused ? Visible : Hidden);
+    setCaretVisibility(activeAndFocused ? Visible : Hidden, ShouldUpdateAppearance::Yes);
 
     // Because Style::Resolver::checkOneSelector() and
     // RenderTheme::isFocused() check if the frame is active, we have to
@@ -2182,13 +2182,13 @@
     }
 }
 
-void FrameSelection::setCaretVisibility(CaretVisibility visibility)
+void FrameSelection::setCaretVisibility(CaretVisibility visibility, ShouldUpdateAppearance doAppearanceUpdate)
 {
     if (caretVisibility() == visibility)
         return;
 
     // FIXME: We shouldn't trigger a synchronous layout here.
-    if (m_document)
+    if (doAppearanceUpdate == ShouldUpdateAppearance::Yes && m_document)
         updateSelectionByUpdatingLayoutOrStyle(*m_document);
 
 #if ENABLE(TEXT_CARET)
@@ -2199,7 +2199,8 @@
     CaretBase::setCaretVisibility(visibility);
 #endif
 
-    updateAppearance();
+    if (doAppearanceUpdate == ShouldUpdateAppearance::Yes)
+        updateAppearance();
 }
 
 void FrameSelection::caretBlinkTimerFired()

Modified: trunk/Source/WebCore/editing/FrameSelection.h (274525 => 274526)


--- trunk/Source/WebCore/editing/FrameSelection.h	2021-03-16 22:43:46 UTC (rev 274525)
+++ trunk/Source/WebCore/editing/FrameSelection.h	2021-03-16 22:45:00 UTC (rev 274526)
@@ -186,7 +186,7 @@
     void nodeWillBeRemoved(Node&);
     void textWasReplaced(CharacterData*, unsigned offset, unsigned oldLength, unsigned newLength);
 
-    void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisible ? Visible : Hidden); }
+    void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisible ? Visible : Hidden, ShouldUpdateAppearance::Yes); }
     void paintCaret(GraphicsContext&, const LayoutPoint&, const LayoutRect& clipRect);
 
     // Used to suspend caret blinking while the mouse is down.
@@ -299,7 +299,9 @@
     void updateAppearanceAfterLayoutOrStyleChange();
     void appearanceUpdateTimerFired();
 
-    WEBCORE_EXPORT void setCaretVisibility(CaretVisibility);
+    enum class ShouldUpdateAppearance : bool { No, Yes };
+    WEBCORE_EXPORT void setCaretVisibility(CaretVisibility, ShouldUpdateAppearance);
+
     bool recomputeCaretRect();
     void invalidateCaretRect();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to