Changeset 56641 in webkit


Ignore:
Timestamp:
Mar 26, 2010 1:44:45 PM (14 years ago)
Author:
Joseph Pecoraro
Message:

2010-03-26 Joseph Pecoraro <Joseph Pecoraro>

Reviewed by Dave Hyatt.

Generated run-in Content is Mistakenly Getting Deleted
https://bugs.webkit.org/show_bug.cgi?id=36505
<rdar://problem/7767161>

Test: fast/runin/generated2.html
Test: fast/runin/generated3.html
Test: fast/runin/generated4.html

Do not destroy :before/:after generated content with display run-in
when relaying out different nodes. Have their real owners correctly
handle them.

  • rendering/RenderObjectChildList.cpp: (WebCore::RenderObjectChildList::updateBeforeAfterContent): simplified logic (WebCore::RenderObjectChildList::beforeAfterContainer): skip generated run-ins when checking children, check for them in grandchildren

2010-03-26 Joseph Pecoraro <Joseph Pecoraro>

Reviewed by Dave Hyatt.

Generated run-in Content is Mistakenly Getting Deleted
https://bugs.webkit.org/show_bug.cgi?id=36505
<rdar://problem/7767161>

Test dynamic update of the inner block, containing the generated
run-in, but not owning it with the :before rule, and owners.

  • fast/runin/generated2.html: Added.
  • platform/mac/fast/runin/generated2-expected.txt: Added.

Test dynamic update of the outer block, this block owns the
generated run-in, but it is actually contained in a child block.

  • fast/runin/generated3.html: Added.
  • platform/mac/fast/runin/generated3-expected.txt: Added.

Test dynamic updates affecting generated run-ins both
in relation to and not in relation to list markers.

  • fast/runin/generated4.html: Added.
  • platform/mac/fast/runin/generated4-expected.txt: Added.
Location:
trunk
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r56639 r56641  
     12010-03-26  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        Generated run-in Content is Mistakenly Getting Deleted
     6        https://bugs.webkit.org/show_bug.cgi?id=36505
     7        <rdar://problem/7767161>
     8
     9          Test dynamic update of the inner block, containing the generated
     10          run-in, but not owning it with the :before rule, and owners.
     11
     12        * fast/runin/generated2.html: Added.
     13        * platform/mac/fast/runin/generated2-expected.txt: Added.
     14
     15          Test dynamic update of the outer block, this block owns the
     16          generated run-in, but it is actually contained in a child block.
     17
     18        * fast/runin/generated3.html: Added.
     19        * platform/mac/fast/runin/generated3-expected.txt: Added.
     20
     21          Test dynamic updates affecting generated run-ins both
     22          in relation to and not in relation to list markers.
     23
     24        * fast/runin/generated4.html: Added.
     25        * platform/mac/fast/runin/generated4-expected.txt: Added.
     26
    1272010-03-25  Ojan Vafai  <ojan@chromium.org>
    228
  • trunk/WebCore/ChangeLog

    r56639 r56641  
     12010-03-26  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        Generated run-in Content is Mistakenly Getting Deleted
     6        https://bugs.webkit.org/show_bug.cgi?id=36505
     7        <rdar://problem/7767161>
     8
     9        Test: fast/runin/generated2.html
     10        Test: fast/runin/generated3.html
     11        Test: fast/runin/generated4.html
     12
     13        Do not destroy :before/:after generated content with display run-in
     14        when relaying out different nodes. Have their real owners correctly
     15        handle them.
     16
     17        * rendering/RenderObjectChildList.cpp:
     18        (WebCore::RenderObjectChildList::updateBeforeAfterContent): simplified logic
     19        (WebCore::RenderObjectChildList::beforeAfterContainer): skip generated run-ins when checking children, check for them in grandchildren
     20
    1212010-03-25  Ojan Vafai  <ojan@chromium.org>
    222
  • trunk/WebCore/rendering/RenderObjectChildList.cpp

    r50960 r56641  
    235235{
    236236    if (type == BEFORE) {
     237        // An anonymous (generated) inline run-in that has PseudoId BEFORE must come from a grandparent.
     238        // Therefore we should skip these generated run-ins when checking our immediate children.
     239        // If we don't find our :before child immediately, then we should check if we own a
     240        // generated inline run-in in the next level of children.
    237241        RenderObject* first = container;
    238242        do {
    239             // Skip list markers.
     243            // Skip list markers and generated run-ins
    240244            first = first->firstChild();
     245            while (first && (first->isListMarker() || (first->isRenderInline() && first->isRunIn() && first->isAnonymous())))
     246                first = first->nextSibling();
     247        } while (first && first->isAnonymous() && first->style()->styleType() == NOPSEUDO);
     248
     249        if (!first)
     250            return 0;
     251
     252        if (first->style()->styleType() == type)
     253            return first;
     254
     255        // Check for a possible generated run-in, using run-in positioning rules.
     256        // Skip inlines and floating / positioned blocks, and place as the first child.
     257        first = container->firstChild();
     258        if (!first->isRenderBlock())
     259            return 0;
     260        while (first && first->isFloatingOrPositioned())
     261            first = first->nextSibling();
     262        if (first) {
     263            first = first->firstChild();
     264            // We still need to skip any list markers that could exist before the run-in.
    241265            while (first && first->isListMarker())
    242266                first = first->nextSibling();
    243         } while (first && first->isAnonymous() && first->style()->styleType() == NOPSEUDO);
    244         if (first && first->style()->styleType() != type)
    245             return 0;
    246         return first;
    247     }
     267            if (first && first->style()->styleType() == type && first->isRenderInline() && first->isRunIn() && first->isAnonymous())
     268                return first;
     269        }
     270        return 0;
     271    }
     272
    248273    if (type == AFTER) {
    249274        RenderObject* last = container;
     
    315340    bool oldContentPresent = child;
    316341
    317     // Whether or not we now want generated content. 
     342    // Whether or not we now want generated content.
    318343    bool newContentWanted = pseudoElementStyle && pseudoElementStyle->display() != NONE;
    319344
     
    331356    // identical to the new content data we want to build render objects for, then we nuke all
    332357    // of the old generated content.
    333     if (!newContentWanted || (oldContentPresent && Node::diff(child->style(), pseudoElementStyle) == Node::Detach)) {
     358    if (oldContentPresent && (!newContentWanted || Node::diff(child->style(), pseudoElementStyle) == Node::Detach)) {
    334359        // Nuke the child.
    335         if (child && child->style()->styleType() == type) {
     360        if (child->style()->styleType() == type) {
    336361            oldContentPresent = false;
    337362            child->destroy();
Note: See TracChangeset for help on using the changeset viewer.