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

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

Issue 1474233002: Don't set internal paddings for menulist SELECT with -webkit-appearance:none. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/popup-menu-appearance-rtl-expected.png ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 LayoutThemeFontProvider::setDefaultFontSize(fontSize); 388 LayoutThemeFontProvider::setDefaultFontSize(fontSize);
389 } 389 }
390 390
391 int LayoutThemeDefault::menuListArrowPadding() const 391 int LayoutThemeDefault::menuListArrowPadding() const
392 { 392 {
393 return ScrollbarTheme::theme()->scrollbarThickness(); 393 return ScrollbarTheme::theme()->scrollbarThickness();
394 } 394 }
395 395
396 int LayoutThemeDefault::menuListInternalPadding(const ComputedStyle& style, int paddingType) const 396 int LayoutThemeDefault::menuListInternalPadding(const ComputedStyle& style, int paddingType) const
397 { 397 {
398 if (style.appearance() == NoControlPart)
399 return 0;
398 // This internal padding is in addition to the user-supplied padding. 400 // This internal padding is in addition to the user-supplied padding.
399 // Matches the FF behavior. 401 // Matches the FF behavior.
400 int padding = styledMenuListInternalPadding[paddingType]; 402 int padding = styledMenuListInternalPadding[paddingType];
401 403
402 // Reserve the space for right arrow here. The rest of the padding is 404 // Reserve the space for right arrow here. The rest of the padding is
403 // set by adjustMenuListStyle, since PopMenuWin.cpp uses the padding from 405 // set by adjustMenuListStyle, since PopMenuWin.cpp uses the padding from
404 // LayoutMenuList to lay out the individual items in the popup. 406 // LayoutMenuList to lay out the individual items in the popup.
405 // If the MenuList actually has appearance "NoAppearance", then that means
406 // we don't draw a button, so don't reserve space for it.
407 const int barType = style.direction() == LTR ? RightPadding : LeftPadding; 407 const int barType = style.direction() == LTR ? RightPadding : LeftPadding;
408 if (paddingType == barType && style.appearance() != NoControlPart) 408 if (paddingType == barType)
409 padding += menuListArrowPadding(); 409 padding += menuListArrowPadding();
410 410
411 return padding * style.effectiveZoom(); 411 return padding * style.effectiveZoom();
412 } 412 }
413 413
414 // 414 //
415 // Following values are come from default of GTK+ 415 // Following values are come from default of GTK+
416 // 416 //
417 static const int progressAnimationFrames = 10; 417 static const int progressAnimationFrames = 10;
418 static const double progressAnimationInterval = 0.125; 418 static const double progressAnimationInterval = 0.125;
419 419
420 double LayoutThemeDefault::animationRepeatIntervalForProgressBar() const 420 double LayoutThemeDefault::animationRepeatIntervalForProgressBar() const
421 { 421 {
422 return progressAnimationInterval; 422 return progressAnimationInterval;
423 } 423 }
424 424
425 double LayoutThemeDefault::animationDurationForProgressBar() const 425 double LayoutThemeDefault::animationDurationForProgressBar() const
426 { 426 {
427 return progressAnimationInterval * progressAnimationFrames * 2; // "2" for b ack and forth 427 return progressAnimationInterval * progressAnimationFrames * 2; // "2" for b ack and forth
428 } 428 }
429 429
430 } // namespace blink 430 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/popup-menu-appearance-rtl-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698