Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutThemeDefault.cpp

Issue 2005093002: Remove non-standard 'results' attribute of INPUT element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. 2 * Copyright (C) 2007 Apple Inc.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2008 Collabora Ltd. 4 * Copyright (C) 2008 Collabora Ltd.
5 * Copyright (C) 2008, 2009 Google Inc. 5 * Copyright (C) 2008, 2009 Google Inc.
6 * Copyright (C) 2009 Kenneth Rohde Christiansen 6 * Copyright (C) 2009 Kenneth Rohde Christiansen
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 LeftPadding 44 LeftPadding
45 }; 45 };
46 46
47 static const int styledMenuListInternalPadding[4] = { 1, 4, 1, 4 }; 47 static const int styledMenuListInternalPadding[4] = { 1, 4, 1, 4 };
48 48
49 // These values all match Safari/Win. 49 // These values all match Safari/Win.
50 static const float defaultControlFontPixelSize = 13; 50 static const float defaultControlFontPixelSize = 13;
51 static const float defaultCancelButtonSize = 9; 51 static const float defaultCancelButtonSize = 9;
52 static const float minCancelButtonSize = 5; 52 static const float minCancelButtonSize = 5;
53 static const float maxCancelButtonSize = 21; 53 static const float maxCancelButtonSize = 21;
54 static const float defaultSearchFieldResultsDecorationSize = 13;
55 static const float minSearchFieldResultsDecorationSize = 9;
56 static const float maxSearchFieldResultsDecorationSize = 30;
57 static const int menuListArrowPaddingSize = 14; 54 static const int menuListArrowPaddingSize = 14;
58 55
59 static bool useMockTheme() 56 static bool useMockTheme()
60 { 57 {
61 return LayoutTestSupport::isMockThemeEnabledForTest(); 58 return LayoutTestSupport::isMockThemeEnabledForTest();
62 } 59 }
63 60
64 unsigned LayoutThemeDefault::m_activeSelectionBackgroundColor = 0xff1e90ff; 61 unsigned LayoutThemeDefault::m_activeSelectionBackgroundColor = 0xff1e90ff;
65 unsigned LayoutThemeDefault::m_activeSelectionForegroundColor = Color::black; 62 unsigned LayoutThemeDefault::m_activeSelectionForegroundColor = Color::black;
66 unsigned LayoutThemeDefault::m_inactiveSelectionBackgroundColor = 0xffc8c8c8; 63 unsigned LayoutThemeDefault::m_inactiveSelectionBackgroundColor = 0xffc8c8c8;
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 327
331 void LayoutThemeDefault::adjustSearchFieldCancelButtonStyle(ComputedStyle& style ) const 328 void LayoutThemeDefault::adjustSearchFieldCancelButtonStyle(ComputedStyle& style ) const
332 { 329 {
333 // Scale the button size based on the font size 330 // Scale the button size based on the font size
334 float fontScale = style.fontSize() / defaultControlFontPixelSize; 331 float fontScale = style.fontSize() / defaultControlFontPixelSize;
335 int cancelButtonSize = lroundf(std::min(std::max(minCancelButtonSize, defaul tCancelButtonSize * fontScale), maxCancelButtonSize)); 332 int cancelButtonSize = lroundf(std::min(std::max(minCancelButtonSize, defaul tCancelButtonSize * fontScale), maxCancelButtonSize));
336 style.setWidth(Length(cancelButtonSize, Fixed)); 333 style.setWidth(Length(cancelButtonSize, Fixed));
337 style.setHeight(Length(cancelButtonSize, Fixed)); 334 style.setHeight(Length(cancelButtonSize, Fixed));
338 } 335 }
339 336
340 void LayoutThemeDefault::adjustSearchFieldDecorationStyle(ComputedStyle& style) const
341 {
342 IntSize emptySize(1, 11);
343 style.setWidth(Length(emptySize.width(), Fixed));
344 style.setHeight(Length(emptySize.height(), Fixed));
345 }
346
347 void LayoutThemeDefault::adjustSearchFieldResultsDecorationStyle(ComputedStyle& style) const
348 {
349 // Scale the decoration size based on the font size
350 float fontScale = style.fontSize() / defaultControlFontPixelSize;
351 int magnifierSize = lroundf(std::min(std::max(minSearchFieldResultsDecoratio nSize, defaultSearchFieldResultsDecorationSize * fontScale),
352 maxSearchFieldResultsDecorationSize));
353 style.setWidth(Length(magnifierSize, Fixed));
354 style.setHeight(Length(magnifierSize, Fixed));
355 }
356
357 void LayoutThemeDefault::adjustMenuListStyle(ComputedStyle& style, Element*) con st 337 void LayoutThemeDefault::adjustMenuListStyle(ComputedStyle& style, Element*) con st
358 { 338 {
359 // Height is locked to auto on all browsers. 339 // Height is locked to auto on all browsers.
360 style.setLineHeight(ComputedStyle::initialLineHeight()); 340 style.setLineHeight(ComputedStyle::initialLineHeight());
361 } 341 }
362 342
363 void LayoutThemeDefault::adjustMenuListButtonStyle(ComputedStyle& style, Element * e) const 343 void LayoutThemeDefault::adjustMenuListButtonStyle(ComputedStyle& style, Element * e) const
364 { 344 {
365 adjustMenuListStyle(style, e); 345 adjustMenuListStyle(style, e);
366 } 346 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 { 399 {
420 return progressAnimationInterval; 400 return progressAnimationInterval;
421 } 401 }
422 402
423 double LayoutThemeDefault::animationDurationForProgressBar() const 403 double LayoutThemeDefault::animationDurationForProgressBar() const
424 { 404 {
425 return progressAnimationInterval * progressAnimationFrames * 2; // "2" for b ack and forth 405 return progressAnimationInterval * progressAnimationFrames * 2; // "2" for b ack and forth
426 } 406 }
427 407
428 } // namespace blink 408 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutThemeDefault.h ('k') | third_party/WebKit/Source/core/layout/LayoutThemeMac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698