| Index: Source/core/rendering/RenderListBox.cpp
|
| diff --git a/Source/core/rendering/RenderListBox.cpp b/Source/core/rendering/RenderListBox.cpp
|
| index 2e8b3be39cafffe3b4205f1174e05cb6d9c08203..8918b0a8200027dea27a8e0d1087c181f9235315 100644
|
| --- a/Source/core/rendering/RenderListBox.cpp
|
| +++ b/Source/core/rendering/RenderListBox.cpp
|
| @@ -90,7 +90,7 @@ RenderListBox::RenderListBox(Element* element)
|
| {
|
| ASSERT(element);
|
| ASSERT(element->isHTMLElement());
|
| - ASSERT(element->hasTagName(HTMLNames::selectTag));
|
| + ASSERT(isHTMLSelectElement(element));
|
|
|
| if (FrameView* frameView = frame()->view())
|
| frameView->addScrollableArea(this);
|
| @@ -129,10 +129,10 @@ void RenderListBox::updateFromElement()
|
| HTMLElement* element = listItems[i];
|
| String text;
|
| Font itemFont = style()->font();
|
| - if (element->hasTagName(optionTag)) {
|
| - text = toHTMLOptionElement(element)->textIndentedToRespectGroupLabel();
|
| - } else if (element->hasTagName(optgroupTag)) {
|
| - text = toHTMLOptGroupElement(element)->groupLabelText();
|
| + if (isHTMLOptionElement(*element)) {
|
| + text = toHTMLOptionElement(*element).textIndentedToRespectGroupLabel();
|
| + } else if (isHTMLOptGroupElement(*element)) {
|
| + text = toHTMLOptGroupElement(*element).groupLabelText();
|
| FontDescription d = itemFont.fontDescription();
|
| d.setWeight(d.bolderWeight());
|
| itemFont = Font(d);
|
| @@ -352,7 +352,7 @@ void RenderListBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint&
|
| const Vector<HTMLElement*>& listItems = select->listItems();
|
| for (int i = 0; i < size; ++i) {
|
| HTMLElement* element = listItems[i];
|
| - if (element->hasTagName(optionTag) && !element->isDisabledFormControl()) {
|
| + if (isHTMLOptionElement(*element) && !element->isDisabledFormControl()) {
|
| rects.append(pixelSnappedIntRect(itemBoundingBoxRect(additionalOffset, i)));
|
| return;
|
| }
|
| @@ -418,15 +418,15 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
|
| return;
|
|
|
| String itemText;
|
| - bool isOptionElement = element->hasTagName(optionTag);
|
| + bool isOptionElement = isHTMLOptionElement(*element);
|
| if (isOptionElement)
|
| - itemText = toHTMLOptionElement(element)->textIndentedToRespectGroupLabel();
|
| - else if (element->hasTagName(optgroupTag))
|
| - itemText = toHTMLOptGroupElement(element)->groupLabelText();
|
| + itemText = toHTMLOptionElement(*element).textIndentedToRespectGroupLabel();
|
| + else if (isHTMLOptGroupElement(*element))
|
| + itemText = toHTMLOptGroupElement(*element).groupLabelText();
|
| applyTextTransform(style(), itemText, ' ');
|
|
|
| Color textColor = element->renderStyle() ? resolveColor(element->renderStyle(), CSSPropertyColor) : resolveColor(CSSPropertyColor);
|
| - if (isOptionElement && toHTMLOptionElement(element)->selected()) {
|
| + if (isOptionElement && toHTMLOptionElement(*element).selected()) {
|
| if (frame()->selection().isFocusedAndActive() && document().focusedElement() == node())
|
| textColor = RenderTheme::theme().activeListBoxSelectionForegroundColor();
|
| // Honor the foreground color for disabled items
|
| @@ -441,7 +441,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
|
| LayoutRect r = itemBoundingBoxRect(paintOffset, listIndex);
|
| r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
|
|
|
| - if (element->hasTagName(optgroupTag)) {
|
| + if (isHTMLOptGroupElement(*element)) {
|
| FontDescription d = itemFont.fontDescription();
|
| d.setWeight(d.bolderWeight());
|
| itemFont = Font(d);
|
| @@ -460,7 +460,7 @@ void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint&
|
| HTMLElement* element = listItems[listIndex];
|
|
|
| Color backColor;
|
| - if (element->hasTagName(optionTag) && toHTMLOptionElement(element)->selected()) {
|
| + if (isHTMLOptionElement(*element) && toHTMLOptionElement(*element).selected()) {
|
| if (frame()->selection().isFocusedAndActive() && document().focusedElement() == node())
|
| backColor = RenderTheme::theme().activeListBoxSelectionBackgroundColor();
|
| else
|
|
|