Changeset 77988 in webkit


Ignore:
Timestamp:
Feb 8, 2011 4:25:53 PM (13 years ago)
Author:
yael.aharon@nokia.com
Message:

2011-02-08 Yael Aharon <yael.aharon@nokia.com>

Reviewed by Antti Koivisto.

Crash when logging into gmail.com with frame flattening turned on.
https://bugs.webkit.org/show_bug.cgi?id=52449

  • fast/frames/flattening/iframe-flattening-crash-expected.txt: Added.
  • fast/frames/flattening/iframe-flattening-crash.html: Added.
  • fast/frames/flattening/iframe-flattening-selection-crash-expected.txt: Added.
  • fast/frames/flattening/iframe-flattening-selection-crash.html: Added.
  • fast/frames/flattening/resources/iframe-flattening-crash.html: Added.

2011-02-08 Yael Aharon <yael.aharon@nokia.com>

Reviewed by Antti Koivisto.

Crash when logging into gmail.com with frame flattening turned on.
https://bugs.webkit.org/show_bug.cgi?id=52449

Frame flattening algorithm requires that layout always starts from the main frame, since layout of
subframes impacts the layout of their parents.
There are places in the code that call view->layout() not on the main frame.
Instead of changing all the callsites, I changed FrameView::layout()
to force layout from the main frame if frame flattening is enabled.
In addition, postLayoutTasks can trigger relayout, so make it use the timer even more.
Move the call to SelectionController::updateAppearance() to performPostLayoutTasks(),
because calling the from layout() leads to a crash in pages that have a selection in an iframe.

Tests: fast/frames/flattening/iframe-flattening-crash.html

fast/frames/flattening/iframe-flattening-selection-crash.html

  • page/FrameView.cpp: (WebCore::FrameView::layout): (WebCore::FrameView::performPostLayoutTasks):
Location:
trunk
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r77986 r77988  
     12011-02-08  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Crash when logging into gmail.com with frame flattening turned on.
     6        https://bugs.webkit.org/show_bug.cgi?id=52449
     7
     8        * fast/frames/flattening/iframe-flattening-crash-expected.txt: Added.
     9        * fast/frames/flattening/iframe-flattening-crash.html: Added.
     10        * fast/frames/flattening/iframe-flattening-selection-crash-expected.txt: Added.
     11        * fast/frames/flattening/iframe-flattening-selection-crash.html: Added.
     12        * fast/frames/flattening/resources/iframe-flattening-crash.html: Added.
     13
    1142011-02-08  Andy Estes  <aestes@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r77986 r77988  
     12011-02-08  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Crash when logging into gmail.com with frame flattening turned on.
     6        https://bugs.webkit.org/show_bug.cgi?id=52449
     7
     8        Frame flattening algorithm requires that layout always starts from the main frame, since layout of
     9        subframes impacts the layout of their parents.
     10        There are places in the code that call view->layout() not on the main frame.
     11        Instead of changing all the callsites, I changed FrameView::layout()
     12        to force layout from the main frame if frame flattening is enabled.
     13        In addition, postLayoutTasks can trigger relayout, so make it use the timer even more.
     14        Move the call to SelectionController::updateAppearance() to performPostLayoutTasks(),
     15        because calling the from layout() leads to a crash in pages that have a selection in an iframe.
     16
     17        Tests: fast/frames/flattening/iframe-flattening-crash.html
     18               fast/frames/flattening/iframe-flattening-selection-crash.html
     19
     20        * page/FrameView.cpp:
     21        (WebCore::FrameView::layout):
     22        (WebCore::FrameView::performPostLayoutTasks):
     23
    1242011-02-08  Andy Estes  <aestes@apple.com>
    225
  • trunk/Source/WebCore/page/FrameView.cpp

    r77706 r77988  
    726726        return;
    727727
     728    bool inSubframeLayoutWithFrameFlattening = parent() && m_frame->settings() && m_frame->settings()->frameFlatteningEnabled();
     729
     730    if (inSubframeLayoutWithFrameFlattening) {
     731        if (parent()->isFrameView()) {
     732            FrameView* parentView =   static_cast<FrameView*>(parent());
     733            if (!parentView->m_nestedLayoutCount) {
     734                while (parentView->parent() && parentView->parent()->isFrameView())
     735                    parentView = static_cast<FrameView*>(parentView->parent());
     736                parentView->layout(allowSubtree);
     737                return;
     738            }
     739        }
     740    }
     741
    728742    m_layoutTimer.stop();
    729743    m_delayedLayout = false;
     
    758772    m_layoutSchedulingEnabled = false;
    759773
    760     if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_hasPendingPostLayoutTasks) {
     774    if (!m_nestedLayoutCount && !m_inSynchronousPostLayout && m_hasPendingPostLayoutTasks && !inSubframeLayoutWithFrameFlattening) {
    761775        // This is a new top-level layout. If there are any remaining tasks from the previous
    762776        // layout, finish them now.
     
    896910    m_layoutRoot = 0;
    897911
    898     m_frame->selection()->setCaretRectNeedsUpdate();
    899     m_frame->selection()->updateAppearance();
    900    
    901912    m_layoutSchedulingEnabled = true;
    902913
     
    937948
    938949    if (!m_hasPendingPostLayoutTasks) {
    939         if (!m_inSynchronousPostLayout) {
     950        if (!m_inSynchronousPostLayout && !inSubframeLayoutWithFrameFlattening) {
    940951            m_inSynchronousPostLayout = true;
    941952            // Calls resumeScheduledEvents()
     
    944955        }
    945956
    946         if (!m_hasPendingPostLayoutTasks && (needsLayout() || m_inSynchronousPostLayout)) {
     957        if (!m_hasPendingPostLayoutTasks && (needsLayout() || m_inSynchronousPostLayout || inSubframeLayoutWithFrameFlattening)) {
    947958            // If we need layout or are already in a synchronous call to postLayoutTasks(),
    948959            // defer widget updates and event dispatch until after we return. postLayoutTasks()
     
    18491860{
    18501861    m_hasPendingPostLayoutTasks = false;
     1862
     1863    m_frame->selection()->setCaretRectNeedsUpdate();
     1864    m_frame->selection()->updateAppearance();
    18511865
    18521866    if (m_firstLayoutCallbackPending) {
Note: See TracChangeset for help on using the changeset viewer.