Changeset 200848 in webkit


Ignore:
Timestamp:
May 13, 2016, 5:33:19 AM (9 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r200301 - Some content causes deep recursion.
https://bugs.webkit.org/show_bug.cgi?id=157230
<rdar://problem/7694756>

Reviewed by Antti Koivisto.

This patch sets a limit(512) on content nesting for the render tree. Elements injected over the limit
are still accessible through DOM APIs but

  1. we stop generating renderers for them -they behave like display: none.
  2. their layout related computed style values are set to default (e.g. window.computedStyle(document.elementById("over512").width -> auto)

Source/WebCore:

Test: fast/block/nested-renderers.html

  • page/Settings.h:
  • style/StyleTreeResolver.cpp: Skip renderer constructing and continue with the sibling node.

(WebCore::Style::TreeResolver::resolveComposedTree):

LayoutTests:

  • fast/block/nested-renderers-expected.html: Added.
  • fast/block/nested-renderers.html: Added.
Location:
releases/WebKitGTK/webkit-2.12
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog

    r200847 r200848  
     12016-04-30  Zalan Bujtas  <zalan@apple.com>
     2
     3        Some content causes deep recursion.
     4        https://bugs.webkit.org/show_bug.cgi?id=157230
     5        <rdar://problem/7694756>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        This patch sets a limit(512) on content nesting for the render tree. Elements injected over the limit
     10        are still accessible through DOM APIs but
     11        1. we stop generating renderers for them -they behave like display: none.
     12        2. their layout related computed style values are set to default (e.g. window.computedStyle(document.elementById("over512").width -> auto)
     13
     14        * fast/block/nested-renderers-expected.html: Added.
     15        * fast/block/nested-renderers.html: Added.
     16
    1172016-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
    218
  • releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog

    r200847 r200848  
     12016-04-30  Zalan Bujtas  <zalan@apple.com>
     2
     3        Some content causes deep recursion.
     4        https://bugs.webkit.org/show_bug.cgi?id=157230
     5        <rdar://problem/7694756>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        This patch sets a limit(512) on content nesting for the render tree. Elements injected over the limit
     10        are still accessible through DOM APIs but
     11        1. we stop generating renderers for them -they behave like display: none.
     12        2. their layout related computed style values are set to default (e.g. window.computedStyle(document.elementById("over512").width -> auto)
     13
     14        Test: fast/block/nested-renderers.html
     15
     16        * page/Settings.h:
     17        * style/StyleTreeResolver.cpp: Skip renderer constructing and continue with the sibling node.
     18        (WebCore::Style::TreeResolver::resolveComposedTree):
     19
    1202016-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
    221
  • releases/WebKitGTK/webkit-2.12/Source/WebCore/page/Settings.h

    r197104 r200848  
    207207
    208208    static const unsigned defaultMaximumHTMLParserDOMTreeDepth = 512;
     209    static const unsigned defaultMaximumRenderTreeDepth = 512;
    209210
    210211    WEBCORE_EXPORT static void setMockScrollbarsEnabled(bool flag);
  • releases/WebKitGTK/webkit-2.12/Source/WebCore/style/StyleTreeResolver.cpp

    r199438 r200848  
    885885        auto& element = downcast<Element>(node);
    886886
     887        if (it.depth() > Settings::defaultMaximumRenderTreeDepth) {
     888            resetStyleForNonRenderedDescendants(element);
     889            element.clearChildNeedsStyleRecalc();
     890            it.traverseNextSkippingChildren();
     891            continue;
     892        }
     893
    887894        // FIXME: We should deal with this during style invalidation.
    888895        bool affectedByPreviousSibling = element.styleIsAffectedByPreviousSibling() && parent.elementNeedingStyleRecalcAffectsNextSiblingElementStyle;
Note: See TracChangeset for help on using the changeset viewer.