Changeset 56555 in webkit
- Timestamp:
- Mar 25, 2010 10:30:23 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r56550 r56555 1 2010-03-25 Jakub Wieczorek <jwieczorek@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 [Qt] RenderTheme: fix size adjustment for text fields 6 https://bugs.webkit.org/show_bug.cgi?id=36413 7 8 Update test results after RenderTheme changes. 9 10 * platform/qt/fast/forms/textarea-placeholder-pseudo-style-expected.txt: 11 * platform/qt/fast/forms/textarea-placeholder-set-attribute-expected.txt: 12 * platform/qt/fast/forms/textarea-placeholder-set-value-expected.txt: 13 1 14 2010-03-25 Julien Chaffraix <jchaffraix@webkit.org> 2 15 -
trunk/LayoutTests/platform/qt/fast/forms/textarea-placeholder-pseudo-style-expected.txt
r50878 r56555 14 14 text run at (548,48) width 4: " " 15 15 RenderText {#text} at (0,0) size 0x0 16 layer at (10,30) size 1 76x4017 RenderTextControl {TEXTAREA} at (2,22) size 1 76x4018 RenderBlock {DIV} at ( 0,0) size 176x20 [color=#640000]16 layer at (10,30) size 180x44 17 RenderTextControl {TEXTAREA} at (2,22) size 180x44 18 RenderBlock {DIV} at (2,2) size 176x20 [color=#640000] 19 19 RenderText {#text} at (0,0) size 25x20 20 20 text run at (0,0) width 25: "text" 21 layer at (19 4,30) size 176x4022 RenderTextControl {TEXTAREA} at (1 86,22) size 176x4023 RenderBlock {DIV} at ( 0,0) size 176x20 [color=#640000]21 layer at (198,30) size 180x44 22 RenderTextControl {TEXTAREA} at (190,22) size 180x44 23 RenderBlock {DIV} at (2,2) size 176x20 [color=#640000] 24 24 RenderText {#text} at (0,0) size 90x20 25 25 text run at (0,0) width 90: "disabled text" 26 layer at (3 78,30) size 176x4027 RenderTextControl {TEXTAREA} at (37 0,22) size 176x4028 RenderBlock {DIV} at ( 0,0) size 176x20 [color=#A9A9A9]26 layer at (386,30) size 180x44 27 RenderTextControl {TEXTAREA} at (378,22) size 180x44 28 RenderBlock {DIV} at (2,2) size 176x20 [color=#A9A9A9] 29 29 RenderText {#text} at (0,0) size 48x20 30 30 text run at (0,0) width 48: "default" 31 layer at (5 62,30) size 176x4032 RenderTextControl {TEXTAREA} at (5 54,22) size 176x4033 RenderBlock {DIV} at ( 0,0) size 176x20 [color=#555555]31 layer at (574,30) size 180x44 32 RenderTextControl {TEXTAREA} at (566,22) size 180x44 33 RenderBlock {DIV} at (2,2) size 176x20 [color=#555555] 34 34 RenderText {#text} at (0,0) size 113x20 35 35 text run at (0,0) width 113: "default disabled" -
trunk/LayoutTests/platform/qt/fast/forms/textarea-placeholder-set-attribute-expected.txt
r50878 r56555 8 8 text run at (0,0) width 486: "If you can see the word \"Placeholder\" in the text area, then all is well." 9 9 RenderBlock {P} at (0,36) size 784x44 10 layer at (10,46) size 1 76x4011 RenderTextControl {TEXTAREA} at (2,2) size 1 76x4012 RenderBlock {DIV} at ( 0,0) size 176x20 [color=#A9A9A9]10 layer at (10,46) size 180x44 11 RenderTextControl {TEXTAREA} at (2,2) size 180x44 12 RenderBlock {DIV} at (2,2) size 176x20 [color=#A9A9A9] 13 13 RenderText {#text} at (0,0) size 86x20 14 14 text run at (0,0) width 86: "Placeholder" -
trunk/LayoutTests/platform/qt/fast/forms/textarea-placeholder-set-value-expected.txt
r50878 r56555 16 16 RenderText {#text} at (0,0) size 0x0 17 17 RenderText {#text} at (0,0) size 0x0 18 layer at (10,46) size 1 76x4019 RenderTextControl {TEXTAREA} at (2,2) size 1 76x4020 RenderBlock {DIV} at ( 0,0) size 176x2018 layer at (10,46) size 180x44 19 RenderTextControl {TEXTAREA} at (2,2) size 180x44 20 RenderBlock {DIV} at (2,2) size 176x20 21 21 RenderText {#text} at (0,0) size 62x20 22 22 text run at (0,0) width 62: "New text" -
trunk/WebCore/ChangeLog
r56552 r56555 1 2010-03-25 Jakub Wieczorek <jwieczorek@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 [Qt] RenderTheme: fix size adjustment for text fields 6 https://bugs.webkit.org/show_bug.cgi?id=36413 7 8 To match other ports, remove the hardcoded dimensions for text fields so that 9 the default ones from WebCore can be used. 10 Properly apply the correct padding to text areas - this fixes their appearance 11 with the Oxygen style. 12 13 * platform/qt/RenderThemeQt.cpp: 14 (WebCore::RenderThemeQt::computeSizeBasedOnStyle): 15 1 16 2010-03-25 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 2 17 -
trunk/WebCore/platform/qt/RenderThemeQt.cpp
r56343 r56555 314 314 void RenderThemeQt::computeSizeBasedOnStyle(RenderStyle* renderStyle) const 315 315 { 316 QSize size(0, 0); 317 const QFontMetrics fm(renderStyle->font().font()); 318 QStyle* style = qStyle(); 319 320 switch (renderStyle->appearance()) { 321 case TextAreaPart: 322 case TextFieldPart: { 323 int padding = findFrameLineWidth(style); 324 325 renderStyle->setPaddingLeft(Length(padding, Fixed)); 326 renderStyle->setPaddingRight(Length(padding, Fixed)); 327 renderStyle->setPaddingTop(Length(padding, Fixed)); 328 renderStyle->setPaddingBottom(Length(padding, Fixed)); 329 break; 330 } 331 default: 332 break; 333 } 334 316 335 // If the width and height are both specified, then we have nothing to do. 317 336 if (!renderStyle->width().isIntrinsicOrAuto() && !renderStyle->height().isAuto()) 318 337 return; 319 320 QSize size(0, 0);321 const QFontMetrics fm(renderStyle->font().font());322 QStyle* style = qStyle();323 338 324 339 switch (renderStyle->appearance()) { … … 364 379 &styleOption, QSize(0, contentHeight), 0); 365 380 size.setHeight(menuListSize.height()); 366 break;367 }368 case TextFieldPart: {369 const int verticalMargin = 1;370 const int horizontalMargin = 2;371 int h = qMax(fm.lineSpacing(), 14) + 2*verticalMargin;372 int w = fm.width(QLatin1Char('x')) * 17 + 2*horizontalMargin;373 QStyleOptionFrameV2 opt;374 opt.lineWidth = findFrameLineWidth(style);375 QSize sz = style->sizeFromContents(QStyle::CT_LineEdit,376 &opt,377 QSize(w, h).expandedTo(QApplication::globalStrut()),378 0);379 size.setHeight(sz.height());380 381 renderStyle->setPaddingLeft(Length(opt.lineWidth, Fixed));382 renderStyle->setPaddingRight(Length(opt.lineWidth, Fixed));383 381 break; 384 382 }
Note: See TracChangeset
for help on using the changeset viewer.