OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the select element renderer in WebCore. | 2 * This file is part of the select element renderer in WebCore. |
3 * | 3 * |
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
6 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 6 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 { | 484 { |
485 const Vector<HTMLElement*>& listItems = selectElement()->listItems(); | 485 const Vector<HTMLElement*>& listItems = selectElement()->listItems(); |
486 if (listIndex >= listItems.size()) { | 486 if (listIndex >= listItems.size()) { |
487 itemBackgroundColor = resolveColor(CSSPropertyBackgroundColor); | 487 itemBackgroundColor = resolveColor(CSSPropertyBackgroundColor); |
488 itemHasCustomBackgroundColor = false; | 488 itemHasCustomBackgroundColor = false; |
489 return; | 489 return; |
490 } | 490 } |
491 HTMLElement* element = listItems[listIndex]; | 491 HTMLElement* element = listItems[listIndex]; |
492 | 492 |
493 Color backgroundColor; | 493 Color backgroundColor; |
494 if (element->renderStyle()) | 494 if (element->renderStyle()) { |
495 backgroundColor = resolveColor(element->renderStyle(), CSSPropertyBackgr
oundColor); | 495 backgroundColor = resolveColor(element->renderStyle(), CSSPropertyBackgr
oundColor); |
496 itemHasCustomBackgroundColor = backgroundColor.isValid() && backgroundColor.
alpha(); | 496 itemHasCustomBackgroundColor = backgroundColor.alpha(); |
| 497 } else { |
| 498 itemHasCustomBackgroundColor = false; |
| 499 } |
| 500 |
497 // If the item has an opaque background color, return that. | 501 // If the item has an opaque background color, return that. |
498 if (!backgroundColor.hasAlpha()) { | 502 if (!backgroundColor.hasAlpha()) { |
499 itemBackgroundColor = backgroundColor; | 503 itemBackgroundColor = backgroundColor; |
500 return; | 504 return; |
501 } | 505 } |
502 | 506 |
503 // Otherwise, the item's background is overlayed on top of the menu backgrou
nd. | 507 // Otherwise, the item's background is overlayed on top of the menu backgrou
nd. |
504 backgroundColor = resolveColor(CSSPropertyBackgroundColor).blend(backgroundC
olor); | 508 backgroundColor = resolveColor(CSSPropertyBackgroundColor).blend(backgroundC
olor); |
505 if (!backgroundColor.hasAlpha()) { | 509 if (!backgroundColor.hasAlpha()) { |
506 itemBackgroundColor = backgroundColor; | 510 itemBackgroundColor = backgroundColor; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 { | 611 { |
608 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); | 612 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); |
609 } | 613 } |
610 | 614 |
611 FontSelector* RenderMenuList::fontSelector() const | 615 FontSelector* RenderMenuList::fontSelector() const |
612 { | 616 { |
613 return document()->styleResolver()->fontSelector(); | 617 return document()->styleResolver()->fontSelector(); |
614 } | 618 } |
615 | 619 |
616 } | 620 } |
OLD | NEW |