| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 { | 486 { |
| 487 const Vector<HTMLElement*>& listItems = selectElement()->listItems(); | 487 const Vector<HTMLElement*>& listItems = selectElement()->listItems(); |
| 488 if (listIndex >= listItems.size()) { | 488 if (listIndex >= listItems.size()) { |
| 489 itemBackgroundColor = resolveColor(CSSPropertyBackgroundColor); | 489 itemBackgroundColor = resolveColor(CSSPropertyBackgroundColor); |
| 490 itemHasCustomBackgroundColor = false; | 490 itemHasCustomBackgroundColor = false; |
| 491 return; | 491 return; |
| 492 } | 492 } |
| 493 HTMLElement* element = listItems[listIndex]; | 493 HTMLElement* element = listItems[listIndex]; |
| 494 | 494 |
| 495 Color backgroundColor; | 495 Color backgroundColor; |
| 496 if (element->renderStyle()) { | 496 if (element->renderStyle()) |
| 497 backgroundColor = resolveColor(element->renderStyle(), CSSPropertyBackgr
oundColor); | 497 backgroundColor = resolveColor(element->renderStyle(), CSSPropertyBackgr
oundColor); |
| 498 itemHasCustomBackgroundColor = backgroundColor.alpha(); | 498 itemHasCustomBackgroundColor = backgroundColor.isValid() && backgroundColor.
alpha(); |
| 499 } else { | |
| 500 itemHasCustomBackgroundColor = false; | |
| 501 } | |
| 502 | |
| 503 // If the item has an opaque background color, return that. | 499 // If the item has an opaque background color, return that. |
| 504 if (!backgroundColor.hasAlpha()) { | 500 if (!backgroundColor.hasAlpha()) { |
| 505 itemBackgroundColor = backgroundColor; | 501 itemBackgroundColor = backgroundColor; |
| 506 return; | 502 return; |
| 507 } | 503 } |
| 508 | 504 |
| 509 // Otherwise, the item's background is overlayed on top of the menu backgrou
nd. | 505 // Otherwise, the item's background is overlayed on top of the menu backgrou
nd. |
| 510 backgroundColor = resolveColor(CSSPropertyBackgroundColor).blend(backgroundC
olor); | 506 backgroundColor = resolveColor(CSSPropertyBackgroundColor).blend(backgroundC
olor); |
| 511 if (!backgroundColor.hasAlpha()) { | 507 if (!backgroundColor.hasAlpha()) { |
| 512 itemBackgroundColor = backgroundColor; | 508 itemBackgroundColor = backgroundColor; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 { | 609 { |
| 614 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); | 610 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); |
| 615 } | 611 } |
| 616 | 612 |
| 617 FontSelector* RenderMenuList::fontSelector() const | 613 FontSelector* RenderMenuList::fontSelector() const |
| 618 { | 614 { |
| 619 return document().styleResolver()->fontSelector(); | 615 return document().styleResolver()->fontSelector(); |
| 620 } | 616 } |
| 621 | 617 |
| 622 } | 618 } |
| OLD | NEW |