Changeset 24083 in webkit
- Timestamp:
- Jul 6, 2007 7:35:07 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r24081 r24083 1 2007-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 1 18 2007-07-06 Brady Eidson <beidson@apple.com> 2 19 -
trunk/WebCore/rendering/RenderTextControl.cpp
r23880 r24083 83 83 { 84 84 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()); 86 90 m_innerBlock->renderer()->setStyle(createInnerBlockStyle(style)); 91 } 87 92 88 93 if (m_innerText) { 89 94 RenderBlock* textBlockRenderer = static_cast<RenderBlock*>(m_innerText->renderer()); 90 95 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()); 91 100 textBlockRenderer->setStyle(textBlockStyle); 92 101 for (Node* n = m_innerText->firstChild(); n; n = n->traverseNextNode(m_innerText.get())) { … … 666 675 int textBlockHeight = m_height - paddingTop() - paddingBottom() - borderTop() - borderBottom(); 667 676 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; 669 680 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; 671 685 m_innerBlock->renderer()->style()->setHeight(Length(textBlockHeight, Fixed)); 686 } 672 687 673 688 int oldWidth = m_width; … … 689 704 int textBlockWidth = m_width - paddingLeft() - paddingRight() - borderLeft() - borderRight() - 690 705 m_innerText->renderer()->paddingLeft() - m_innerText->renderer()->paddingRight() - searchExtrasWidth; 706 if (textBlockWidth != m_innerText->renderer()->width()) 707 relayoutChildren = true; 691 708 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 } 694 715 695 716 RenderBlock::layoutBlock(relayoutChildren);
Note: See TracChangeset
for help on using the changeset viewer.