Changeset 24083 in webkit


Ignore:
Timestamp:
Jul 6, 2007 7:35:07 PM (17 years ago)
Author:
bdash
Message:

2007-07-06 Mitz Pettel <mitz@webkit.org>

Reviewed by Beth.

No test possible because there is no change in functionality.

  • rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::setStyle): Reset the height and the width in the old style to avoid getting a layout hint as a result of having mutated the old style during layout. (WebCore::RenderTextControl::layout): Update children's layout if an inner block's dimensions should change. This need for layout was previously masked by the bug.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r24081 r24083  
     12007-07-06  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Beth.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=14536
     6          Unnecessary layout done when mousing down in text field
     7
     8        No test possible because there is no change in functionality.
     9
     10        * rendering/RenderTextControl.cpp:
     11        (WebCore::RenderTextControl::setStyle): Reset the height and the width in
     12        the old style to avoid getting a layout hint as a result of having mutated
     13        the old style during layout.
     14        (WebCore::RenderTextControl::layout): Update children's layout if an inner
     15        block's dimensions should change. This need for layout was previously masked
     16        by the bug.
     17
    1182007-07-06  Brady Eidson  <beidson@apple.com>
    219
  • trunk/WebCore/rendering/RenderTextControl.cpp

    r23880 r24083  
    8383{
    8484    RenderBlock::setStyle(style);
    85     if (m_innerBlock)
     85    if (m_innerBlock) {
     86        // We may have set the width and the height in the old style in layout(). Reset them now to avoid
     87        // getting a spurious layout hint.
     88        m_innerBlock->renderer()->style()->setHeight(Length());
     89        m_innerBlock->renderer()->style()->setWidth(Length());
    8690        m_innerBlock->renderer()->setStyle(createInnerBlockStyle(style));
     91    }
    8792
    8893    if (m_innerText) {
    8994        RenderBlock* textBlockRenderer = static_cast<RenderBlock*>(m_innerText->renderer());
    9095        RenderStyle* textBlockStyle = createInnerTextStyle(style);
     96        // We may have set the width and the height in the old style in layout(). Reset them now to avoid
     97        // getting a spurious layout hint.
     98        textBlockRenderer->style()->setHeight(Length());
     99        textBlockRenderer->style()->setWidth(Length());
    91100        textBlockRenderer->setStyle(textBlockStyle);
    92101        for (Node* n = m_innerText->firstChild(); n; n = n->traverseNextNode(m_innerText.get())) {
     
    666675    int textBlockHeight = m_height - paddingTop() - paddingBottom() - borderTop() - borderBottom();
    667676    int currentTextBlockHeight = m_innerText->renderer()->height();
    668     if (m_multiLine || m_innerBlock || currentTextBlockHeight > m_height)
     677    if (m_multiLine || m_innerBlock || currentTextBlockHeight > m_height) {
     678        if (textBlockHeight != currentTextBlockHeight)
     679            relayoutChildren = true;
    669680        m_innerText->renderer()->style()->setHeight(Length(textBlockHeight, Fixed));
    670     if (m_innerBlock)
     681    }
     682    if (m_innerBlock) {
     683        if (textBlockHeight != m_innerBlock->renderer()->height())
     684            relayoutChildren = true;
    671685        m_innerBlock->renderer()->style()->setHeight(Length(textBlockHeight, Fixed));
     686    }
    672687
    673688    int oldWidth = m_width;
     
    689704    int textBlockWidth = m_width - paddingLeft() - paddingRight() - borderLeft() - borderRight() -
    690705                         m_innerText->renderer()->paddingLeft() - m_innerText->renderer()->paddingRight() - searchExtrasWidth;
     706    if (textBlockWidth != m_innerText->renderer()->width())
     707        relayoutChildren = true;
    691708    m_innerText->renderer()->style()->setWidth(Length(textBlockWidth, Fixed));
    692     if (m_innerBlock)
    693         m_innerBlock->renderer()->style()->setWidth(Length(m_width - paddingLeft() - paddingRight() - borderLeft() - borderRight(), Fixed));
     709    if (m_innerBlock) {
     710        int innerBlockWidth = m_width - paddingLeft() - paddingRight() - borderLeft() - borderRight();
     711        if (innerBlockWidth != m_innerBlock->renderer()->width())
     712            relayoutChildren = true;
     713        m_innerBlock->renderer()->style()->setWidth(Length(innerBlockWidth, Fixed));
     714    }
    694715
    695716    RenderBlock::layoutBlock(relayoutChildren);
Note: See TracChangeset for help on using the changeset viewer.