Changeset 120477 in webkit


Ignore:
Timestamp:
Jun 15, 2012 10:57:57 AM (12 years ago)
Author:
inferno@chromium.org
Message:

Cleanup empty anonymous block continuation.
https://bugs.webkit.org/show_bug.cgi?id=74976

Reviewed by Julien Chaffraix.

Source/WebCore:

Fix rendering on http://docs.google.com/demo.

Test: fast/inline/inline-empty-block-continuation-remove.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::removeChild): If we are removing our last child,
and are an anonymous block which is part of a continuation chain, then
we need to first fix our continuation chain by setting our previous
continuation renderer to point to the next continuation renderer. Then,
we reset our continuation pointer and destroy ourselves. Since we no
longer are part of continuation chain, we will be removed and previous
and next anonymous block will be merged automatically.

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::previousInPreOrder): add an argument to previousInOrder

  • stayWithin.

(WebCore):

  • rendering/RenderObject.h:

(RenderObject):

LayoutTests:

  • fast/inline/inline-empty-block-continuation-remove-expected.html: Added.
  • fast/inline/inline-empty-block-continuation-remove.html: Added.

and a bunch of rebaselines in existing tests.

Location:
trunk
Files:
2 added
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r120476 r120477  
     12012-06-15  Abhishek Arya  <inferno@chromium.org>
     2
     3        Cleanup empty anonymous block continuation.
     4        https://bugs.webkit.org/show_bug.cgi?id=74976
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        * fast/inline/inline-empty-block-continuation-remove-expected.html: Added.
     9        * fast/inline/inline-empty-block-continuation-remove.html: Added.
     10        and a bunch of rebaselines in existing tests.
     11
    1122012-06-15  Zan Dobersek  <zandobersek@gmail.com>
    213
  • trunk/LayoutTests/platform/mac/editing/deleting/delete-3800834-fix-expected.txt

    r96264 r120477  
    3232    RenderBody {BODY} at (8,8) size 784x584
    3333      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
    34         RenderBlock (anonymous) at (14,14) size 756x28
    35           RenderInline {SPAN} at (0,0) size 37x28
    36             RenderText {#text} at (0,0) size 37x28
    37               text run at (0,0) width 37: "Foo"
    38         RenderBlock (anonymous) at (14,42) size 756x0
    39         RenderBlock (anonymous) at (14,42) size 756x0
    40           RenderInline {SPAN} at (0,0) size 0x0
     34        RenderInline {SPAN} at (0,0) size 37x28
     35          RenderText {#text} at (14,14) size 37x28
     36            text run at (14,14) width 37: "Foo"
     37        RenderInline {SPAN} at (0,0) size 0x28
    4138caret: position 3 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of body
  • trunk/LayoutTests/platform/mac/fast/dynamic/011-expected.txt

    r63403 r120477  
    44  RenderBlock {HTML} at (0,0) size 800x600
    55    RenderBody {BODY} at (8,8) size 784x584
    6       RenderBlock (anonymous) at (0,0) size 784x0
     6      RenderBlock (anonymous) at (0,0) size 784x36
    77        RenderInline {SPAN} at (0,0) size 0x0
    8       RenderBlock (anonymous) at (0,0) size 784x0
    9       RenderBlock (anonymous) at (0,0) size 784x36
    108        RenderInline {SPAN} at (0,0) size 781x36
    119          RenderInline {SPAN} at (0,0) size 781x36
  • trunk/LayoutTests/platform/mac/fast/forms/formmove3-expected.txt

    r66306 r120477  
    77        RenderInline {A} at (0,0) size 0x0
    88          RenderText {#text} at (0,0) size 0x0
    9       RenderBlock (anonymous) at (0,0) size 784x0
    10       RenderBlock (anonymous) at (0,0) size 784x0
    119        RenderInline {A} at (0,0) size 0x0
    1210      RenderBlock {DIV} at (0,0) size 784x28
  • trunk/LayoutTests/platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt

    r66306 r120477  
    77        RenderInline {FONT} at (0,0) size 0x0
    88          RenderText {#text} at (0,0) size 0x0
    9       RenderBlock (anonymous) at (0,0) size 784x0
    10       RenderBlock (anonymous) at (0,0) size 784x0
    119        RenderInline {FONT} at (0,0) size 0x0
    1210      RenderBlock {CENTER} at (0,0) size 784x25
  • trunk/LayoutTests/platform/mac/fast/invalid/001-expected.txt

    r25970 r120477  
    66      RenderBlock (anonymous) at (0,0) size 784x0
    77        RenderInline {B} at (0,0) size 0x0
    8       RenderBlock (anonymous) at (0,0) size 784x0
    9       RenderBlock (anonymous) at (0,0) size 784x0
    108        RenderInline {B} at (0,0) size 0x0
    119      RenderBlock {P} at (0,0) size 784x18
  • trunk/LayoutTests/platform/mac/fast/invalid/003-expected.txt

    r64954 r120477  
    99            RenderText {#text} at (0,0) size 89x18
    1010              text run at (0,0) width 89: "Italic and Red"
    11       RenderBlock (anonymous) at (0,18) size 784x0 [color=#FF0000]
    12       RenderBlock (anonymous) at (0,18) size 784x0
    13         RenderInline {FONT} at (0,0) size 0x0 [color=#FF0000]
    14           RenderInline {I} at (0,0) size 0x0
    15         RenderInline {I} at (0,0) size 0x0
     11        RenderInline {FONT} at (0,0) size 0x18 [color=#FF0000]
     12          RenderInline {I} at (0,0) size 0x18
     13        RenderInline {I} at (0,0) size 0x18
    1614      RenderBlock (anonymous) at (0,34) size 784x18
    1715        RenderBlock {P} at (0,0) size 784x18
     
    4038          RenderInline {I} at (0,0) size 0x0
    4139            RenderText {#text} at (0,0) size 0x0
    42       RenderBlock (anonymous) at (0,136) size 784x0 [color=#FF0000]
    43       RenderBlock (anonymous) at (0,136) size 784x0
    4440        RenderInline {FONT} at (0,0) size 0x0 [color=#FF0000]
    4541          RenderInline {I} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/invalid/004-expected.txt

    r64712 r120477  
    1919        RenderText {#text} at (0,0) size 0x0
    2020        RenderInline {B} at (0,0) size 0x0
    21       RenderBlock (anonymous) at (0,206) size 784x0
    22       RenderBlock (anonymous) at (0,206) size 784x0
    2321        RenderInline {B} at (0,0) size 0x0
    2422      RenderBlock {P} at (0,206) size 784x18
  • trunk/LayoutTests/platform/mac/fast/invalid/007-expected.txt

    r64712 r120477  
    77        RenderInline {LABEL} at (0,0) size 0x0
    88          RenderInline {A} at (0,0) size 0x0
    9       RenderBlock (anonymous) at (0,0) size 784x0
    10       RenderBlock (anonymous) at (0,0) size 784x0
    119        RenderInline {LABEL} at (0,0) size 0x0
    1210          RenderInline {A} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/invalid/019-expected.txt

    r64954 r120477  
    77        RenderInline {B} at (0,0) size 0x0
    88          RenderInline {NOBR} at (0,0) size 0x0
    9       RenderBlock (anonymous) at (0,0) size 784x0
    10       RenderBlock (anonymous) at (0,0) size 784x0
    119        RenderInline {B} at (0,0) size 0x0
    1210          RenderInline {NOBR} at (0,0) size 0x0
  • trunk/LayoutTests/platform/mac/fast/multicol/span/clone-anonymous-block-non-inline-child-crash-expected.txt

    r109192 r120477  
    1010        RenderText {#text} at (0,0) size 102x18
    1111          text run at (0,0) width 102: "Some inline text"
     12      RenderInline {LABEL} at (0,0) size 0x0
    1213    RenderBlock (anonymous) at (5,23) size 379x285
    1314      RenderBlock {SUMMARY} at (0,0) size 379x285
  • trunk/LayoutTests/platform/mac/tables/mozilla/bugs/bug647-expected.txt

    r78910 r120477  
    1919                          RenderInline {FONT} at (0,0) size 0x0
    2020                            RenderText {#text} at (0,0) size 0x0
    21                         RenderBlock (anonymous) at (2,2) size 90x0
    22                         RenderBlock (anonymous) at (2,2) size 90x0
    2321                          RenderInline {FONT} at (0,0) size 0x0
    2422                        RenderBlock {CENTER} at (2,2) size 90x13
  • trunk/Source/WebCore/ChangeLog

    r120475 r120477  
     12012-06-15  Abhishek Arya  <inferno@chromium.org>
     2
     3        Cleanup empty anonymous block continuation.
     4        https://bugs.webkit.org/show_bug.cgi?id=74976
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        Fix rendering on http://docs.google.com/demo.
     9
     10        Test: fast/inline/inline-empty-block-continuation-remove.html
     11
     12        * rendering/RenderBlock.cpp:
     13        (WebCore::RenderBlock::removeChild): If we are removing our last child,
     14        and are an anonymous block which is part of a continuation chain, then
     15        we need to first fix our continuation chain by setting our previous
     16        continuation renderer to point to the next continuation renderer. Then,
     17        we reset our continuation pointer and destroy ourselves. Since we no
     18        longer are part of continuation chain, we will be removed and previous
     19        and next anonymous block will be merged automatically.
     20        * rendering/RenderObject.cpp:
     21        (WebCore::RenderObject::previousInPreOrder): add an argument to previousInOrder
     22        - stayWithin.
     23        (WebCore):
     24        * rendering/RenderObject.h:
     25        (RenderObject):
     26
    1272012-06-15  Taiju Tsuiki  <tzik@chromium.org>
    228
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r120265 r120477  
    12341234        if (childrenInline())
    12351235            deleteLineBoxTree();
     1236
     1237        // If we are an empty anonymous block in the continuation chain,
     1238        // we need to remove ourself and fix the continuation chain.
     1239        if (!beingDestroyed() && isAnonymousBlockContinuation()) {
     1240            for (RenderObject* curr = this; curr; curr = curr->previousInPreOrder(parent())) {
     1241                if (curr->virtualContinuation() != this)
     1242                    continue;
     1243
     1244                // Found our previous continuation. We just need to point it to
     1245                // |this|'s next continuation.
     1246                RenderBoxModelObject* nextContinuation = continuation();
     1247                if (curr->isRenderInline())
     1248                    toRenderInline(curr)->setContinuation(nextContinuation);
     1249                else if (curr->isRenderBlock())
     1250                    toRenderBlock(curr)->setContinuation(nextContinuation);
     1251                else
     1252                    ASSERT_NOT_REACHED();
     1253
     1254                break;
     1255            }
     1256            setContinuation(0);
     1257            destroy();
     1258        }
    12361259    }
    12371260}
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r120119 r120477  
    388388
    389389    return parent();
     390}
     391
     392RenderObject* RenderObject::previousInPreOrder(const RenderObject* stayWithin) const
     393{
     394    if (this == stayWithin)
     395        return 0;
     396
     397    return previousInPreOrder();
    390398}
    391399
  • trunk/Source/WebCore/rendering/RenderObject.h

    r120119 r120477  
    194194    RenderObject* nextInPreOrderAfterChildren(const RenderObject* stayWithin) const;
    195195    RenderObject* previousInPreOrder() const;
     196    RenderObject* previousInPreOrder(const RenderObject* stayWithin) const;
    196197    RenderObject* childAt(unsigned) const;
    197198
Note: See TracChangeset for help on using the changeset viewer.