⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 183969 in webkit


Ignore:
Timestamp:
May 7, 2015, 6:23:49 PM (11 years ago)
Author:
Chris Dumez
Message:

ASSERTION when pasting text into the WebInspector console
https://bugs.webkit.org/show_bug.cgi?id=144774

Reviewed by Ryosuke Niwa.

Fix assertion in didChangeSelection() meant to check that calling
editorState() does not cause a synchronous layout. The assertion
was not correct as it was relying on FrameView::needsLayout() and
we would hit it if calling editorState() would schedule a layout.
Instead, the new assertion relies on FrameView::layoutCount(),
which is more accurate.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::didChangeSelection):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r183961 r183969  
     12015-05-07  Chris Dumez  <cdumez@apple.com>
     2
     3        ASSERTION when pasting text into the WebInspector console
     4        https://bugs.webkit.org/show_bug.cgi?id=144774
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Fix assertion in didChangeSelection() meant to check that calling
     9        editorState() does not cause a synchronous layout. The assertion
     10        was not correct as it was relying on FrameView::needsLayout() and
     11        we would hit it if calling editorState() would schedule a layout.
     12        Instead, the new assertion relies on FrameView::layoutCount(),
     13        which is more accurate.
     14
     15        * WebProcess/WebPage/WebPage.cpp:
     16        (WebKit::WebPage::didChangeSelection):
     17
    1182015-05-07  Andreas Kling  <akling@apple.com>
    219
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r183841 r183969  
    44194419    Frame& frame = m_page->focusController().focusedOrMainFrame();
    44204420    FrameView* view = frame.view();
    4421     bool needsLayout = view && view->needsLayout();
     4421#if PLATFORM(COCOA) && !defined(NDEBUG)
     4422    int layoutCount = view ? view->layoutCount() : 0;
     4423#endif
    44224424
    44234425    // If there is a layout pending, we should avoid populating EditorState that require layout to be done or it will
    44244426    // trigger a synchronous layout every time the selection changes. sendPostLayoutEditorStateIfNeeded() will be called
    44254427    // to send the full editor state after layout is done if we send a partial editor state here.
    4426     auto editorState = this->editorState(needsLayout ? IncludePostLayoutDataHint::No : IncludePostLayoutDataHint::Yes);
    4427 #if PLATFORM(COCOA)
    4428     ASSERT_WITH_MESSAGE(needsLayout == (view && view->needsLayout()), "Calling editorState() should not cause a synchronous layout.");
     4428    auto editorState = this->editorState(view && view->needsLayout() ? IncludePostLayoutDataHint::No : IncludePostLayoutDataHint::Yes);
     4429#if PLATFORM(COCOA) && !defined(NDEBUG)
     4430    if (view)
     4431        ASSERT_WITH_MESSAGE(layoutCount == view->layoutCount(), "Calling editorState() should not cause a synchronous layout.");
    44294432#endif
    44304433    m_isEditorStateMissingPostLayoutData = editorState.isMissingPostLayoutData;
Note: See TracChangeset for help on using the changeset viewer.