Bug 144774 - ASSERTION when pasting text into the WebInspector console
Summary: ASSERTION when pasting text into the WebInspector console
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords:
: 144471 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-05-07 16:37 PDT by Sam Weinig
Modified: 2015-05-07 18:25 PDT (History)
3 users (show)

See Also:


Attachments
Crash log (80.40 KB, text/plain)
2015-05-07 16:37 PDT, Sam Weinig
no flags Details
Patch (2.70 KB, patch)
2015-05-07 18:14 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.