Changeset 157367 in webkit


Ignore:
Timestamp:
Oct 13, 2013 4:39:33 AM (10 years ago)
Author:
Antti Koivisto
Message:

Rename InlineBox::remove() to removeFromParent
https://bugs.webkit.org/show_bug.cgi?id=122725

Reviewed by Andreas Kling.

Also make it clear from the code that all InlineTextBoxes have behavesLikeText set.

Location:
trunk/Source/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r157366 r157367  
     12013-10-13  Antti Koivisto  <antti@apple.com>
     2
     3        Rename InlineBox::remove() to removeFromParent
     4        https://bugs.webkit.org/show_bug.cgi?id=122725
     5
     6        Reviewed by Andreas Kling.
     7
     8        Also make it clear from the code that all InlineTextBoxes have behavesLikeText set.
     9
    1102013-10-13  Antti Koivisto  <antti@apple.com>
    211
  • trunk/Source/WebCore/rendering/InlineBox.cpp

    r157342 r157367  
    6565#endif
    6666
    67 void InlineBox::remove()
     67void InlineBox::removeFromParent()
    6868{
    6969    if (parent())
  • trunk/Source/WebCore/rendering/InlineBox.h

    r157011 r157367  
    155155    bool isFirstLine() const { return m_bitfields.firstLine(); }
    156156
    157     void remove();
     157    void removeFromParent();
    158158
    159159    InlineBox* nextOnLine() const { return m_next; }
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r157362 r157367  
    100100int InlineTextBox::baselinePosition(FontBaseline baselineType) const
    101101{
    102     if (!behavesLikeText() || !parent())
     102    if (!parent())
    103103        return 0;
    104104    if (&parent()->renderer() == renderer().parent())
     
    109109LayoutUnit InlineTextBox::lineHeight() const
    110110{
    111     if (!behavesLikeText() || !renderer().parent())
     111    if (!renderer().parent())
    112112        return 0;
    113113    if (&parent()->renderer() == renderer().parent())
  • trunk/Source/WebCore/rendering/InlineTextBox.h

    r157362 r157367  
    5252        , m_truncation(cNoTruncation)
    5353    {
     54        setBehavesLikeText(true);
    5455    }
    5556
     
    161162    // Needs to be public, so the static paintTextWithShadows() function can use it.
    162163    static FloatSize applyShadowToGraphicsContext(GraphicsContext*, const ShadowData*, const FloatRect& textRect, bool stroked, bool opaque, bool horizontal);
    163 
    164 private:
    165     InlineTextBox* m_prevTextBox; // The previous box that also uses our RenderObject
    166     InlineTextBox* m_nextTextBox; // The next box that also uses our RenderObject
    167 
    168     int m_start;
    169     unsigned short m_len;
    170 
    171     unsigned short m_truncation; // Where to truncate when text overflow is applied.  We use special constants to
    172                       // denote no truncation (the whole run paints) and full truncation (nothing paints at all).
    173164
    174165protected:
     
    192183            | (expansion() && nextLeafChild() ? TextRun::AllowTrailingExpansion : TextRun::ForbidTrailingExpansion);
    193184    }
     185
     186    void behavesLikeText() const WTF_DELETED_FUNCTION;
     187
     188    InlineTextBox* m_prevTextBox; // The previous box that also uses our RenderObject
     189    InlineTextBox* m_nextTextBox; // The next box that also uses our RenderObject
     190
     191    int m_start;
     192    unsigned short m_len;
     193
     194    // Where to truncate when text overflow is applied. We use special constants to
     195    // denote no truncation (the whole run paints) and full truncation (nothing paints at all).
     196    unsigned short m_truncation;
    194197};
    195198
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r157330 r157367  
    235235            // children will be destroyed by the time we return from this function.
    236236            if (isAnonymousBlock()) {
    237                 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) {
    238                     while (InlineBox* childBox = box->firstChild())
    239                         childBox->remove();
     237                for (auto box = firstLineBox(); box; box = box->nextLineBox()) {
     238                    while (auto childBox = box->firstChild())
     239                        childBox->removeFromParent();
    240240                }
    241241            }
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r157309 r157367  
    19691969
    19701970        // Nuke the box.
    1971         box->remove();
     1971        box->removeFromParent();
    19721972        box->destroy(renderArena());
    19731973    } else if (isReplaced()) {
     
    19851985    if (m_inlineBoxWrapper) {
    19861986        if (!documentBeingDestroyed())
    1987             m_inlineBoxWrapper->remove();
     1987            m_inlineBoxWrapper->removeFromParent();
    19881988        m_inlineBoxWrapper->destroy(renderArena());
    19891989        m_inlineBoxWrapper = 0;
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r157144 r157367  
    108108            // root lines that can just be destroyed without disconnecting.
    109109            if (firstLineBox()->parent()) {
    110                 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
    111                     box->remove();
     110                for (auto box = firstLineBox(); box; box = box->nextLineBox())
     111                    box->removeFromParent();
    112112            }
    113113        } else if (parent())
  • trunk/Source/WebCore/rendering/RenderLineBreak.cpp

    r156738 r157367  
    9191        return;
    9292    if (!documentBeingDestroyed())
    93         m_inlineBoxWrapper->remove();
     93        m_inlineBoxWrapper->removeFromParent();
    9494    m_inlineBoxWrapper->destroy(renderArena());
    9595    m_inlineBoxWrapper = nullptr;
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r157366 r157367  
    10031003    if (!textBox->len()) {
    10041004        // We want the box to be destroyed.
    1005         textBox->remove();
     1005        textBox->removeFromParent();
    10061006        m_lineBoxes.remove(*textBox);
    10071007        textBox->destroy(renderArena());
  • trunk/Source/WebCore/rendering/RenderTextLineBoxes.cpp

    r157366 r157367  
    5252        m_last = textBox;
    5353    }
    54     textBox->setBehavesLikeText(true);
    5554    return textBox;
    5655}
     
    115114    }
    116115    for (auto box = m_first; box; box = box->nextTextBox())
    117         box->remove();
     116        box->removeFromParent();
    118117}
    119118
Note: See TracChangeset for help on using the changeset viewer.