Changeset 96258 in webkit


Ignore:
Timestamp:
Sep 28, 2011 1:55:50 PM (13 years ago)
Author:
Dimitri Glazkov
Message:

REGRESSION(r95573): Crash when loading SVG documents in a flattened frame or any SVG document in Chromium/Mac.
https://bugs.webkit.org/show_bug.cgi?id=68938

Source/WebCore:

Reviewed by David Hyatt.

Test: all svg tests in LayoutTests.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::computeBlockPreferredLogicalWidths): Added a null-check for containingBlock.

Tools:

Made Chromium/Mac DRT better match how Chromium/Mac queries WebKit.

Reviewed by David Hyatt.

  • DumpRenderTree/chromium/WebViewHost.cpp:

(WebViewHost::didUpdateLayout): Added width/height queries.

  • DumpRenderTree/chromium/WebViewHost.h: Updated defs.

LayoutTests:

Reviewed by David Hyatt.

  • fast/frames/flattening/crash-svg-document-expected.txt: Added.
  • fast/frames/flattening/crash-svg-document.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96257 r96258  
     12011-09-28  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        REGRESSION(r95573): Crash when loading SVG documents in a flattened frame or any SVG document in Chromium/Mac.
     4        https://bugs.webkit.org/show_bug.cgi?id=68938
     5
     6        Reviewed by David Hyatt.
     7
     8        * fast/frames/flattening/crash-svg-document-expected.txt: Added.
     9        * fast/frames/flattening/crash-svg-document.html: Added.
     10
    1112011-09-28 Una Sabovic  <una.sabovic@palm.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r96257 r96258  
     12011-09-27  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        REGRESSION(r95573): Crash when loading SVG documents in a flattened frame or any SVG document in Chromium/Mac.
     4        https://bugs.webkit.org/show_bug.cgi?id=68938
     5
     6        Reviewed by David Hyatt.
     7
     8        Test: all svg tests in LayoutTests.
     9
     10        * rendering/RenderBlock.cpp:
     11        (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): Added a null-check for containingBlock.
     12
    1132011-09-28  Una Sabovic  <una.sabovic@palm.com>
    214
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r95856 r96258  
    48884888    float inlineMin = 0;
    48894889
    4890     LayoutUnit cw = containingBlock()->contentLogicalWidth();
     4890    RenderBlock* containingBlock = this->containingBlock();
     4891    LayoutUnit cw = containingBlock ? containingBlock->contentLogicalWidth() : 0;
    48914892
    48924893    // If we are at the start of a line, we want to ignore all white-space.
     
    51535154
    51545155    RenderObject *child = firstChild();
     5156    RenderBlock* containingBlock = this->containingBlock();
    51555157    LayoutUnit floatLeftWidth = 0, floatRightWidth = 0;
    51565158    while (child) {
     
    52015203                // margins of the object.  For negative margins, we will attempt to overlap the float if the negative margin
    52025204                // is smaller than the float width.
    5203                 bool ltr = containingBlock()->style()->isLeftToRightDirection();
     5205                bool ltr = containingBlock ? containingBlock->style()->isLeftToRightDirection() : style()->isLeftToRightDirection();
    52045206                LayoutUnit marginLogicalLeft = ltr ? marginStart : marginEnd;
    52055207                LayoutUnit marginLogicalRight = ltr ? marginEnd : marginStart;
     
    52355237        // We can achieve this effect by making the maxwidth of blocks that contain tables
    52365238        // with percentage widths be infinite (as long as they are not inside a table cell).
    5237         if (document()->inQuirksMode() && child->style()->logicalWidth().isPercent() &&
    5238             !isTableCell() && child->isTable() && m_maxPreferredLogicalWidth < BLOCK_MAX_WIDTH) {
    5239             RenderBlock* cb = containingBlock();
     5239        if (containingBlock && document()->inQuirksMode() && child->style()->logicalWidth().isPercent()
     5240            && !isTableCell() && child->isTable() && m_maxPreferredLogicalWidth < BLOCK_MAX_WIDTH) {
     5241            RenderBlock* cb = containingBlock;
    52405242            while (!cb->isRenderView() && !cb->isTableCell())
    52415243                cb = cb->containingBlock();
  • trunk/Tools/ChangeLog

    r96252 r96258  
     12011-09-27  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        REGRESSION(r95573): Crash when loading SVG documents in a flattened frame or any SVG document in Chromium/Mac.
     4        https://bugs.webkit.org/show_bug.cgi?id=68938
     5
     6        Made Chromium/Mac DRT better match how Chromium/Mac queries WebKit.
     7
     8        Reviewed by David Hyatt.
     9
     10        * DumpRenderTree/chromium/WebViewHost.cpp:
     11        (WebViewHost::didUpdateLayout): Added width/height queries.
     12        * DumpRenderTree/chromium/WebViewHost.h: Updated defs.
     13
    1142011-09-28  Mihai Parparita  <mihaip@chromium.org>
    215
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp

    r95085 r96258  
    795795}
    796796
     797void WebViewHost::didUpdateLayout(WebFrame*)
     798{
     799#if OS(MAC_OS_X)
     800    static bool queryingPreferredSize = false;
     801    if (queryingPreferredSize)
     802        return;
     803
     804    queryingPreferredSize = true;
     805    // Query preferred width to emulate the same functionality in Chromium:
     806    // see RenderView::CheckPreferredSize (src/content/renderer/render_view.cc)
     807    // and TabContentsViewMac::RenderViewCreated (src/chrome/browser/tab_contents/tab_contents_view_mac.mm)
     808    webView()->mainFrame()->contentsPreferredWidth();
     809    webView()->mainFrame()->documentElementScrollHeight();
     810    queryingPreferredSize = false;
     811#endif
     812}
     813
     814
    797815void WebViewHost::loadURLExternally(WebFrame* frame, const WebURLRequest& request, WebNavigationPolicy policy)
    798816{
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.h

    r95085 r96258  
    172172    virtual WebKit::WebMediaPlayer* createMediaPlayer(WebKit::WebFrame*, WebKit::WebMediaPlayerClient*);
    173173    virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(WebKit::WebFrame*, WebKit::WebApplicationCacheHostClient*);
     174    virtual void didUpdateLayout(WebKit::WebFrame*);
    174175    virtual void loadURLExternally(WebKit::WebFrame*, const WebKit::WebURLRequest&, WebKit::WebNavigationPolicy);
    175176    virtual void loadURLExternally(WebKit::WebFrame*, const WebKit::WebURLRequest&, WebKit::WebNavigationPolicy, const WebKit::WebString& downloadName);
Note: See TracChangeset for help on using the changeset viewer.