Bug 144774

Summary: ASSERTION when pasting text into the WebInspector console
Product: WebKit Reporter: Sam Weinig <sam>
Component: HTML EditingAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, joepeck, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=144471
Attachments:
Description Flags
Crash log
none
Patch none

Description Sam Weinig 2015-05-07 16:37:01 PDT
Created attachment 252647 [details]
Crash log

I am consistently hitting the assertion, ASSERT_WITH_MESSAGE(needsLayout == (view && view->needsLayout()), "Calling editorState() should not cause a synchronous layout.") under WebPage::didChangeSelection() when pasting text into the WebInspector console. Crash log attached.
Comment 1 Chris Dumez 2015-05-07 16:42:02 PDT
I am able to reproduce.
Comment 2 Chris Dumez 2015-05-07 16:50:01 PDT
Looks like what's causing the sync layout is one of these:
    result.selectionIsNone = selection.isNone();
    result.selectionIsRange = selection.isRange();
    result.isContentEditable = selection.isContentEditable();
    result.isContentRichlyEditable = selection.isContentRichlyEditable();
    result.isInPasswordField = selection.isInPasswordField();
    result.hasComposition = frame.editor().hasComposition();
    result.shouldIgnoreCompositionSelectionChange = frame.editor().ignoreCompositionSelectionChange();

Not something in platformEditorState.
Comment 3 Chris Dumez 2015-05-07 16:55:50 PDT
What happens is actually that needsLayout is false but (view && view->needsLayout()) is true. This case is fine as we merely scheduled a layout, we did not cause a sync layout. We need to tweak the assertion accordingly.
Comment 4 Chris Dumez 2015-05-07 18:14:10 PDT
Created attachment 252669 [details]
Patch
Comment 5 Chris Dumez 2015-05-07 18:14:50 PDT
*** Bug 144471 has been marked as a duplicate of this bug. ***
Comment 6 Chris Dumez 2015-05-07 18:25:12 PDT
Comment on attachment 252669 [details]
Patch

Clearing flags on attachment: 252669

Committed r183969: <http://trac.webkit.org/changeset/183969>
Comment 7 Chris Dumez 2015-05-07 18:25:18 PDT
All reviewed patches have been landed.  Closing bug.