Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (97719 => 97720)
--- trunk/Source/WebCore/CMakeLists.txt 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/CMakeLists.txt 2011-10-18 05:39:34 UTC (rev 97720)
@@ -566,7 +566,6 @@
dom/NodeRenderingContext.cpp
dom/Notation.cpp
dom/OptionElement.cpp
- dom/OptionGroupElement.cpp
dom/OverflowEvent.cpp
dom/PageTransitionEvent.cpp
dom/PendingScript.cpp
Modified: trunk/Source/WebCore/ChangeLog (97719 => 97720)
--- trunk/Source/WebCore/ChangeLog 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/ChangeLog 2011-10-18 05:39:34 UTC (rev 97720)
@@ -1,3 +1,44 @@
+2011-10-17 Kent Tamura <[email protected]>
+
+ Remove OptionGroupElement
+ https://bugs.webkit.org/show_bug.cgi?id=70220
+
+ Reviewed by Darin Adler.
+
+ No new tests, just a refactoring.
+
+ * CMakeLists.txt: Remove OptionGroupElement.cpp and/or OptionGroupElement.h.
+ * GNUMakefile.am.list: ditto.
+ * WebCore.gypi: ditto.
+ * WebCore.pro: ditto.
+ * WebCore.vcproj/WebCore.vcproj: ditto.
+ * WebCore.xcodeproj/project.pbxproj: ditto.
+ * dom/DOMAllInOne.cpp: ditto.
+ * dom/OptionElement.cpp:
+ (WebCore::OptionElement::collectOptionTextRespectingGroupLabel):
+ Use hasTagName(optgroupTag) and static_cast<> instead of toOptionGroupElement().
+ * dom/OptionGroupElement.cpp: Removed.
+ * dom/OptionGroupElement.h: Removed.
+ * html/HTMLOptGroupElement.cpp:
+ (WebCore::isHTMLOptGroupElement): Added.
+ * html/HTMLOptGroupElement.h:
+ - Don't inherit OptionGroupElement.
+ - Make groupLabelText() non-virtual.
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::recalcListItems):
+ Use Use hasTagName(optgroupTag) instead of isOptionGroupElement().
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::updateFromElement):
+ Use hasTagName(optgroupTag) and static_cast<> instead of toOptionGroupElement().
+ (WebCore::RenderListBox::paintItemForeground):
+ Use hasTagName(optgroupTag) instead of isOptionGroupElement().
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::itemText):
+ Use hasTagName(optgroupTag) and static_cast<> instead of toOptionGroupElement().
+ (WebCore::RenderMenuList::itemIsEnabled):
+ Use Use hasTagName(optgroupTag) instead of isOptionGroupElement().
+ (WebCore::RenderMenuList::itemIsLabel): ditto.
+
2011-10-17 Huang Dongsung <[email protected]>
[TexMap][QT] TexMapGL renders a strange one-pixel border of BitmapTexture.
Modified: trunk/Source/WebCore/GNUmakefile.list.am (97719 => 97720)
--- trunk/Source/WebCore/GNUmakefile.list.am 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2011-10-18 05:39:34 UTC (rev 97720)
@@ -1261,8 +1261,6 @@
Source/WebCore/dom/Notation.h \
Source/WebCore/dom/OptionElement.cpp \
Source/WebCore/dom/OptionElement.h \
- Source/WebCore/dom/OptionGroupElement.cpp \
- Source/WebCore/dom/OptionGroupElement.h \
Source/WebCore/dom/OverflowEvent.cpp \
Source/WebCore/dom/OverflowEvent.h \
Source/WebCore/dom/PageTransitionEvent.cpp \
Modified: trunk/Source/WebCore/WebCore.gypi (97719 => 97720)
--- trunk/Source/WebCore/WebCore.gypi 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/WebCore.gypi 2011-10-18 05:39:34 UTC (rev 97720)
@@ -5248,8 +5248,6 @@
'dom/Notation.h',
'dom/OptionElement.cpp',
'dom/OptionElement.h',
- 'dom/OptionGroupElement.cpp',
- 'dom/OptionGroupElement.h',
'dom/OverflowEvent.cpp',
'dom/OverflowEvent.h',
'dom/PageTransitionEvent.cpp',
Modified: trunk/Source/WebCore/WebCore.pro (97719 => 97720)
--- trunk/Source/WebCore/WebCore.pro 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/WebCore.pro 2011-10-18 05:39:34 UTC (rev 97720)
@@ -529,7 +529,6 @@
dom/NodeIterator.cpp \
dom/NodeRenderingContext.cpp \
dom/Notation.cpp \
- dom/OptionGroupElement.cpp \
dom/OptionElement.cpp \
dom/StaticHashSetNodeList.cpp \
dom/OverflowEvent.cpp \
@@ -1565,7 +1564,6 @@
dom/NodeRenderingContext.h \
dom/Notation.h \
dom/OptionElement.h \
- dom/OptionGroupElement.h \
dom/StaticHashSetNodeList.h \
dom/OverflowEvent.h \
dom/PageTransitionEvent.h \
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (97719 => 97720)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2011-10-18 05:39:34 UTC (rev 97720)
@@ -47897,62 +47897,6 @@
>
</File>
<File
- RelativePath="..\dom\OptionGroupElement.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo_CFLite|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo_CFLite|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Production|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\dom\OptionGroupElement.h"
- >
- </File>
- <File
RelativePath="..\dom\OverflowEvent.cpp"
>
<FileConfiguration
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (97719 => 97720)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2011-10-18 05:39:34 UTC (rev 97720)
@@ -133,8 +133,6 @@
086BBD0F136039C2008B15D8 /* Glyph.h in Headers */ = {isa = PBXBuildFile; fileRef = 086BBD0E136039C2008B15D8 /* Glyph.h */; settings = {ATTRIBUTES = (Private, ); }; };
087281550F26B9B600AFC596 /* OptionElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087281510F26B9B600AFC596 /* OptionElement.cpp */; };
087281560F26B9B600AFC596 /* OptionElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 087281520F26B9B600AFC596 /* OptionElement.h */; };
- 087281570F26B9B600AFC596 /* OptionGroupElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087281530F26B9B600AFC596 /* OptionGroupElement.cpp */; };
- 087281580F26B9B600AFC596 /* OptionGroupElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 087281540F26B9B600AFC596 /* OptionGroupElement.h */; };
0873B86B136064EA00A522C2 /* GlyphPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0873B86A136064EA00A522C2 /* GlyphPage.h */; settings = {ATTRIBUTES = (Private, ); }; };
087558C513B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087558C313B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp */; };
087558C613B4A57D00F49307 /* SurrogatePairAwareTextIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 087558C413B4A57D00F49307 /* SurrogatePairAwareTextIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -7157,8 +7155,6 @@
086BBD0E136039C2008B15D8 /* Glyph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Glyph.h; sourceTree = "<group>"; };
087281510F26B9B600AFC596 /* OptionElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionElement.cpp; sourceTree = "<group>"; };
087281520F26B9B600AFC596 /* OptionElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionElement.h; sourceTree = "<group>"; };
- 087281530F26B9B600AFC596 /* OptionGroupElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionGroupElement.cpp; sourceTree = "<group>"; };
- 087281540F26B9B600AFC596 /* OptionGroupElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionGroupElement.h; sourceTree = "<group>"; };
0873B86A136064EA00A522C2 /* GlyphPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlyphPage.h; sourceTree = "<group>"; };
087558C313B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SurrogatePairAwareTextIterator.cpp; sourceTree = "<group>"; };
087558C413B4A57D00F49307 /* SurrogatePairAwareTextIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurrogatePairAwareTextIterator.h; sourceTree = "<group>"; };
@@ -21157,8 +21153,6 @@
93EEC1F409C2877700C515D1 /* Notation.idl */,
087281510F26B9B600AFC596 /* OptionElement.cpp */,
087281520F26B9B600AFC596 /* OptionElement.h */,
- 087281530F26B9B600AFC596 /* OptionGroupElement.cpp */,
- 087281540F26B9B600AFC596 /* OptionGroupElement.h */,
1A0D57340A5C77FE007EDD4C /* OverflowEvent.cpp */,
1A0D57350A5C77FE007EDD4C /* OverflowEvent.h */,
1A0D57380A5C7812007EDD4C /* OverflowEvent.idl */,
@@ -23685,7 +23679,6 @@
F4EAF4AF10C742B1009100D3 /* OpenTypeSanitizer.h in Headers */,
2E2445F71395893A004B6C19 /* OperationNotAllowedException.h in Headers */,
087281560F26B9B600AFC596 /* OptionElement.h in Headers */,
- 087281580F26B9B600AFC596 /* OptionGroupElement.h in Headers */,
0014628B103CD1DE000B20DB /* OriginAccessEntry.h in Headers */,
51A9267D0D53F0570063ECC2 /* OriginQuotaManager.h in Headers */,
51A9267F0D53F0570063ECC2 /* OriginUsageRecord.h in Headers */,
@@ -26736,7 +26729,6 @@
FDA3E95B134A49EF008D4B5A /* OfflineAudioDestinationNode.cpp in Sources */,
F4EAF4AE10C742B1009100D3 /* OpenTypeSanitizer.cpp in Sources */,
087281550F26B9B600AFC596 /* OptionElement.cpp in Sources */,
- 087281570F26B9B600AFC596 /* OptionGroupElement.cpp in Sources */,
0014628A103CD1DE000B20DB /* OriginAccessEntry.cpp in Sources */,
51A9267C0D53F0570063ECC2 /* OriginQuotaManager.cpp in Sources */,
51A9267E0D53F0570063ECC2 /* OriginUsageRecord.cpp in Sources */,
Modified: trunk/Source/WebCore/dom/DOMAllInOne.cpp (97719 => 97720)
--- trunk/Source/WebCore/dom/DOMAllInOne.cpp 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/dom/DOMAllInOne.cpp 2011-10-18 05:39:34 UTC (rev 97720)
@@ -98,7 +98,6 @@
#include "NodeRenderingContext.cpp"
#include "Notation.cpp"
#include "OptionElement.cpp"
-#include "OptionGroupElement.cpp"
#include "OverflowEvent.cpp"
#include "PageTransitionEvent.cpp"
#include "PendingScript.cpp"
Modified: trunk/Source/WebCore/dom/OptionElement.cpp (97719 => 97720)
--- trunk/Source/WebCore/dom/OptionElement.cpp 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/dom/OptionElement.cpp 2011-10-18 05:39:34 UTC (rev 97720)
@@ -24,15 +24,17 @@
#include "Document.h"
#include "Element.h"
#include "HTMLNames.h"
+#include "HTMLOptGroupElement.h"
#include "HTMLOptionElement.h"
#include "HTMLParserIdioms.h"
#include "HTMLSelectElement.h"
-#include "OptionGroupElement.h"
#include "ScriptElement.h"
#include <wtf/Assertions.h>
namespace WebCore {
+using namespace HTMLNames;
+
void OptionElement::setSelectedState(OptionElementData& data, Element* element, bool selected)
{
if (data.selected() == selected)
@@ -109,7 +111,7 @@
String OptionElement::collectOptionTextRespectingGroupLabel(const OptionElementData& data, const Element* element)
{
Element* parentElement = static_cast<Element*>(element->parentNode());
- if (parentElement && toOptionGroupElement(parentElement))
+ if (parentElement && parentElement->hasTagName(optgroupTag))
return " " + collectOptionLabelOrText(data, element);
return collectOptionLabelOrText(data, element);
Deleted: trunk/Source/WebCore/dom/OptionGroupElement.cpp (97719 => 97720)
--- trunk/Source/WebCore/dom/OptionGroupElement.cpp 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/dom/OptionGroupElement.cpp 2011-10-18 05:39:34 UTC (rev 97720)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-#include "OptionGroupElement.h"
-
-#include "Element.h"
-#include "HTMLNames.h"
-#include "HTMLOptGroupElement.h"
-#include <wtf/Assertions.h>
-
-namespace WebCore {
-
-OptionGroupElement* toOptionGroupElement(Element* element)
-{
- if (element->isHTMLElement() && element->hasTagName(HTMLNames::optgroupTag))
- return static_cast<HTMLOptGroupElement*>(element);
- return 0;
-}
-
-bool isOptionGroupElement(Element* element)
-{
- return element->hasLocalName(HTMLNames::optgroupTag);
-}
-
-}
Deleted: trunk/Source/WebCore/dom/OptionGroupElement.h (97719 => 97720)
--- trunk/Source/WebCore/dom/OptionGroupElement.h 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/dom/OptionGroupElement.h 2011-10-18 05:39:34 UTC (rev 97720)
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef OptionGroupElement_h
-#define OptionGroupElement_h
-
-#include <wtf/Forward.h>
-
-namespace WebCore {
-
-class Element;
-
-class OptionGroupElement {
-public:
- virtual ~OptionGroupElement() { }
-
- virtual String groupLabelText() const = 0;
-};
-
-OptionGroupElement* toOptionGroupElement(Element*);
-bool isOptionGroupElement(Element*);
-
-}
-
-#endif
Modified: trunk/Source/WebCore/html/HTMLOptGroupElement.cpp (97719 => 97720)
--- trunk/Source/WebCore/html/HTMLOptGroupElement.cpp 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/html/HTMLOptGroupElement.cpp 2011-10-18 05:39:34 UTC (rev 97720)
@@ -141,5 +141,5 @@
if (select && !select->focused())
select->accessKeyAction(false);
}
-
+
} // namespace
Modified: trunk/Source/WebCore/html/HTMLOptGroupElement.h (97719 => 97720)
--- trunk/Source/WebCore/html/HTMLOptGroupElement.h 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/html/HTMLOptGroupElement.h 2011-10-18 05:39:34 UTC (rev 97720)
@@ -25,19 +25,18 @@
#define HTMLOptGroupElement_h
#include "HTMLFormControlElement.h"
-#include "OptionGroupElement.h"
namespace WebCore {
class HTMLSelectElement;
-class HTMLOptGroupElement : public HTMLFormControlElement, public OptionGroupElement {
+class HTMLOptGroupElement : public HTMLFormControlElement {
public:
static PassRefPtr<HTMLOptGroupElement> create(const QualifiedName&, Document*, HTMLFormElement*);
HTMLSelectElement* ownerSelectElement() const;
- virtual String groupLabelText() const;
+ String groupLabelText() const;
private:
HTMLOptGroupElement(const QualifiedName&, Document*, HTMLFormElement*);
Modified: trunk/Source/WebCore/html/HTMLSelectElement.cpp (97719 => 97720)
--- trunk/Source/WebCore/html/HTMLSelectElement.cpp 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/html/HTMLSelectElement.cpp 2011-10-18 05:39:34 UTC (rev 97720)
@@ -37,11 +37,11 @@
#include "Frame.h"
#include "HTMLFormElement.h"
#include "HTMLNames.h"
+#include "HTMLOptGroupElement.h"
#include "HTMLOptionElement.h"
#include "HTMLOptionsCollection.h"
#include "KeyboardEvent.h"
#include "MouseEvent.h"
-#include "OptionGroupElement.h"
#include "Page.h"
#include "RenderListBox.h"
#include "RenderMenuList.h"
@@ -679,7 +679,7 @@
// optgroup tags may not nest. However, both FireFox and IE will
// flatten the tree automatically, so we follow suit.
// (http://www.w3.org/TR/html401/interact/forms.html#h-17.6)
- if (isOptionGroupElement(current)) {
+ if (current->hasTagName(optgroupTag)) {
m_listItems.append(current);
if (current->firstChild()) {
currentNode = current->firstChild();
Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (97719 => 97720)
--- trunk/Source/WebCore/rendering/RenderListBox.cpp 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp 2011-10-18 05:39:34 UTC (rev 97720)
@@ -43,10 +43,10 @@
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLNames.h"
+#include "HTMLOptGroupElement.h"
#include "HTMLSelectElement.h"
#include "HitTestResult.h"
#include "NodeRenderStyle.h"
-#include "OptionGroupElement.h"
#include "OptionElement.h"
#include "Page.h"
#include "PaintInfo.h"
@@ -116,8 +116,8 @@
Font itemFont = style()->font();
if (OptionElement* optionElement = toOptionElement(element))
text = optionElement->textIndentedToRespectGroupLabel();
- else if (OptionGroupElement* optionGroupElement = toOptionGroupElement(element)) {
- text = optionGroupElement->groupLabelText();
+ else if (element->hasTagName(optgroupTag)) {
+ text = static_cast<const HTMLOptGroupElement*>(element)->groupLabelText();
FontDescription d = itemFont.fontDescription();
d.setWeight(d.bolderWeight());
itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
@@ -384,8 +384,8 @@
String itemText;
if (optionElement)
itemText = optionElement->textIndentedToRespectGroupLabel();
- else if (OptionGroupElement* optionGroupElement = toOptionGroupElement(element))
- itemText = optionGroupElement->groupLabelText();
+ else if (element->hasTagName(optgroupTag))
+ itemText = static_cast<const HTMLOptGroupElement*>(element)->groupLabelText();
applyTextTransform(style(), itemText, ' ');
Color textColor = element->renderStyle() ? element->renderStyle()->visitedDependentColor(CSSPropertyColor) : style()->visitedDependentColor(CSSPropertyColor);
@@ -407,7 +407,7 @@
LayoutRect r = itemBoundingBoxRect(paintOffset, listIndex);
r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
- if (isOptionGroupElement(element)) {
+ if (element->hasTagName(optgroupTag)) {
FontDescription d = itemFont.fontDescription();
d.setWeight(d.bolderWeight());
itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (97719 => 97720)
--- trunk/Source/WebCore/rendering/RenderMenuList.cpp 2011-10-18 05:32:55 UTC (rev 97719)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp 2011-10-18 05:39:34 UTC (rev 97720)
@@ -375,8 +375,8 @@
String itemString;
Element* element = listItems[listIndex];
- if (OptionGroupElement* optionGroupElement = toOptionGroupElement(element))
- itemString = optionGroupElement->groupLabelText();
+ if (element->hasTagName(optgroupTag))
+ itemString = static_cast<const HTMLOptGroupElement*>(element)->groupLabelText();
else if (OptionElement* optionElement = toOptionElement(element))
itemString = optionElement->textIndentedToRespectGroupLabel();
@@ -420,7 +420,7 @@
bool groupEnabled = true;
if (Element* parentElement = element->parentElement()) {
- if (isOptionGroupElement(parentElement))
+ if (parentElement->hasTagName(optgroupTag))
groupEnabled = !static_cast<HTMLOptGroupElement*>(parentElement)->disabled();
}
if (!groupEnabled)
@@ -549,7 +549,7 @@
bool RenderMenuList::itemIsLabel(unsigned listIndex) const
{
const Vector<HTMLElement*>& listItems = toHTMLSelectElement(node())->listItems();
- return listIndex < listItems.size() && isOptionGroupElement(listItems[listIndex]);
+ return listIndex < listItems.size() && listItems[listIndex]->hasTagName(optgroupTag);
}
bool RenderMenuList::itemIsSelected(unsigned listIndex) const