Changeset 58313 in webkit
- Timestamp:
- Apr 27, 2010 10:19:47 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r58304 r58313 1 2010-04-27 Joseph Pecoraro <joepeck@webkit.org> 2 3 Reviewed by Dan Bernstein. 4 5 <input type="search"> with uneven padding causes text clipping 6 https://bugs.webkit.org/show_bug.cgi?id=38160 7 8 * fast/css/input-search-padding.html: Added. 9 * platform/mac/fast/css/input-search-padding-expected.checksum: Added. 10 * platform/mac/fast/css/input-search-padding-expected.png: Added. 11 * platform/mac/fast/css/input-search-padding-expected.txt: Added. 12 1 13 2010-04-27 Jeremy Orlow <jorlow@chromium.org> 2 14 -
trunk/WebCore/ChangeLog
r58310 r58313 1 2010-04-27 Joseph Pecoraro <joepeck@webkit.org> 2 3 Reviewed by Dan Bernstein. 4 5 <input type="search"> with uneven padding causes text clipping 6 https://bugs.webkit.org/show_bug.cgi?id=38160 7 8 Test: fast/css/input-search-padding.html 9 10 An <input type="search"> contains an inner block, which is explicitly 11 centered in RenderTextControlSingleLine based on the height of the element. 12 However, the clipping rect was not using the set location, and instead 13 calculated off of the top border and padding alone. This also vertically 14 centers the Caps Lock indicator. 15 16 * rendering/RenderTextControl.cpp: moved controlClipRect implementation to RenderTextControlSingleLine 17 * rendering/RenderTextControl.h: allow a subclass implementation of controlClipRect, removed redundant hasControlClip implementation, and moved controlClipRect 18 * rendering/RenderTextControlSingleLine.cpp: 19 (WebCore::RenderTextControlSingleLine::paint): vertically center the Caps Lock indicator 20 (WebCore::RenderTextControlSingleLine::controlClipRect): use the set location of the anonymous inner block instead 21 * rendering/RenderTextControlSingleLine.h: allow for an implementation of controlClipRect for <input type="search"> 22 1 23 2010-04-27 Thomas Zander <t.zander@nokia.com> 2 24 -
trunk/WebCore/rendering/RenderTextControl.cpp
r58177 r58313 432 432 return; 433 433 m_innerText->defaultEventHandler(event); 434 }435 436 IntRect RenderTextControl::controlClipRect(int tx, int ty) const437 {438 IntRect clipRect = contentBoxRect();439 clipRect.move(tx, ty);440 return clipRect;441 434 } 442 435 -
trunk/WebCore/rendering/RenderTextControl.h
r54748 r58313 96 96 virtual const char* renderName() const { return "RenderTextControl"; } 97 97 virtual bool isTextControl() const { return true; } 98 virtual bool hasControlClip() const { return false; }99 virtual IntRect controlClipRect(int tx, int ty) const;100 98 virtual void calcPrefWidths(); 101 99 virtual void removeLeftoverAnonymousBlock(RenderBlock*) { } -
trunk/WebCore/rendering/RenderTextControlSingleLine.cpp
r58177 r58313 1 1 /** 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved. 3 3 * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) 4 4 * … … 186 186 IntRect contentsRect = contentBoxRect(); 187 187 188 // Center vertically like the text. 189 contentsRect.setY((height() - contentsRect.height()) / 2); 190 188 191 // Convert the rect into the coords used for painting the content 189 192 contentsRect.move(tx + x(), ty + y()); … … 357 360 repaint(); 358 361 } 362 } 363 364 IntRect RenderTextControlSingleLine::controlClipRect(int tx, int ty) const 365 { 366 // This should only get called for search inputs, which have an innerBlock. 367 ASSERT(hasControlClip()); 368 ASSERT(m_innerBlock); 369 370 RenderBox* renderBox = m_innerBlock->renderBox(); 371 IntRect clipRect = IntRect(renderBox->x(), renderBox->y(), contentWidth(), contentHeight()); 372 clipRect.move(tx, ty); 373 return clipRect; 359 374 } 360 375 -
trunk/WebCore/rendering/RenderTextControlSingleLine.h
r55425 r58313 56 56 private: 57 57 virtual bool hasControlClip() const { return m_cancelButton; } 58 virtual IntRect controlClipRect(int tx, int ty) const; 58 59 virtual bool isTextField() const { return true; } 59 60
Note: See TracChangeset
for help on using the changeset viewer.