Commit db0516ee authored by keishi@chromium.org's avatar keishi@chromium.org

Oilpan: Prepare to move select and option elements to Oilpan heap.

BUG=357163

Review URL: https://codereview.chromium.org/275573003

git-svn-id: svn://svn.chromium.org/blink/trunk@173745 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 97b62704
...@@ -61,7 +61,7 @@ void AXListBox::addChildren() ...@@ -61,7 +61,7 @@ void AXListBox::addChildren()
m_haveChildren = true; m_haveChildren = true;
const Vector<HTMLElement*>& listItems = toHTMLSelectElement(selectNode)->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = toHTMLSelectElement(selectNode)->listItems();
unsigned length = listItems.size(); unsigned length = listItems.size();
for (unsigned i = 0; i < length; i++) { for (unsigned i = 0; i < length; i++) {
// The cast to HTMLElement below is safe because the only other possible listItem type // The cast to HTMLElement below is safe because the only other possible listItem type
......
...@@ -209,7 +209,7 @@ int AXListBoxOption::listBoxOptionIndex() const ...@@ -209,7 +209,7 @@ int AXListBoxOption::listBoxOptionIndex() const
if (!selectElement) if (!selectElement)
return -1; return -1;
const Vector<HTMLElement*>& listItems = selectElement->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement->listItems();
unsigned length = listItems.size(); unsigned length = listItems.size();
for (unsigned i = 0; i < length; i++) { for (unsigned i = 0; i < length; i++) {
if (listItems[i] == m_optionElement) if (listItems[i] == m_optionElement)
......
...@@ -99,7 +99,7 @@ void AXMenuListPopup::addChildren() ...@@ -99,7 +99,7 @@ void AXMenuListPopup::addChildren()
m_haveChildren = true; m_haveChildren = true;
const Vector<HTMLElement*>& listItems = toHTMLSelectElement(selectNode)->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = toHTMLSelectElement(selectNode)->listItems();
unsigned length = listItems.size(); unsigned length = listItems.size();
for (unsigned i = 0; i < length; i++) { for (unsigned i = 0; i < length; i++) {
AXMenuListOption* option = menuListOptionAXObject(listItems[i]); AXMenuListOption* option = menuListOptionAXObject(listItems[i]);
......
...@@ -1013,7 +1013,7 @@ String AXNodeObject::stringValue() const ...@@ -1013,7 +1013,7 @@ String AXNodeObject::stringValue() const
if (isHTMLSelectElement(*node)) { if (isHTMLSelectElement(*node)) {
HTMLSelectElement& selectElement = toHTMLSelectElement(*node); HTMLSelectElement& selectElement = toHTMLSelectElement(*node);
int selectedIndex = selectElement.selectedIndex(); int selectedIndex = selectElement.selectedIndex();
const Vector<HTMLElement*> listItems = selectElement.listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement.listItems();
if (selectedIndex >= 0 && static_cast<size_t>(selectedIndex) < listItems.size()) { if (selectedIndex >= 0 && static_cast<size_t>(selectedIndex) < listItems.size()) {
const AtomicString& overriddenDescription = listItems[selectedIndex]->fastGetAttribute(aria_labelAttr); const AtomicString& overriddenDescription = listItems[selectedIndex]->fastGetAttribute(aria_labelAttr);
if (!overriddenDescription.isNull()) if (!overriddenDescription.isNull())
......
...@@ -876,7 +876,7 @@ String AXRenderObject::stringValue() const ...@@ -876,7 +876,7 @@ String AXRenderObject::stringValue() const
// This has to be overridden in the case where the selected item has an ARIA label. // This has to be overridden in the case where the selected item has an ARIA label.
HTMLSelectElement* selectElement = toHTMLSelectElement(m_renderer->node()); HTMLSelectElement* selectElement = toHTMLSelectElement(m_renderer->node());
int selectedIndex = selectElement->selectedIndex(); int selectedIndex = selectElement->selectedIndex();
const Vector<HTMLElement*> listItems = selectElement->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement->listItems();
if (selectedIndex >= 0 && static_cast<size_t>(selectedIndex) < listItems.size()) { if (selectedIndex >= 0 && static_cast<size_t>(selectedIndex) < listItems.size()) {
const AtomicString& overriddenDescription = listItems[selectedIndex]->fastGetAttribute(aria_labelAttr); const AtomicString& overriddenDescription = listItems[selectedIndex]->fastGetAttribute(aria_labelAttr);
if (!overriddenDescription.isNull()) if (!overriddenDescription.isNull())
......
...@@ -57,10 +57,10 @@ void HTMLKeygenElement::didAddUserAgentShadowRoot(ShadowRoot& root) ...@@ -57,10 +57,10 @@ void HTMLKeygenElement::didAddUserAgentShadowRoot(ShadowRoot& root)
getSupportedKeySizes(locale(), keys); getSupportedKeySizes(locale(), keys);
// Create a select element with one option element for each key size. // Create a select element with one option element for each key size.
RefPtr<HTMLSelectElement> select = HTMLSelectElement::create(document()); RefPtrWillBeRawPtr<HTMLSelectElement> select = HTMLSelectElement::create(document());
select->setShadowPseudoId(keygenSelectPseudoId); select->setShadowPseudoId(keygenSelectPseudoId);
for (size_t i = 0; i < keys.size(); ++i) { for (size_t i = 0; i < keys.size(); ++i) {
RefPtr<HTMLOptionElement> option = HTMLOptionElement::create(document()); RefPtrWillBeRawPtr<HTMLOptionElement> option = HTMLOptionElement::create(document());
option->appendChild(Text::create(document(), keys[i])); option->appendChild(Text::create(document(), keys[i]));
select->appendChild(option); select->appendChild(option);
} }
......
...@@ -162,12 +162,12 @@ int HTMLOptionElement::index() const ...@@ -162,12 +162,12 @@ int HTMLOptionElement::index() const
int optionIndex = 0; int optionIndex = 0;
const Vector<HTMLElement*>& items = selectElement->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& items = selectElement->listItems();
size_t length = items.size(); size_t length = items.size();
for (size_t i = 0; i < length; ++i) { for (size_t i = 0; i < length; ++i) {
if (!isHTMLOptionElement(*items[i])) if (!isHTMLOptionElement(*items[i]))
continue; continue;
if (items[i] == this) if (items[i].get() == this)
return optionIndex; return optionIndex;
++optionIndex; ++optionIndex;
} }
......
...@@ -69,12 +69,12 @@ PassRefPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(ContainerNode& s ...@@ -69,12 +69,12 @@ PassRefPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(ContainerNode& s
return adoptRef(new HTMLOptionsCollection(select)); return adoptRef(new HTMLOptionsCollection(select));
} }
void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, ExceptionState& exceptionState) void HTMLOptionsCollection::add(PassRefPtrWillBeRawPtr<HTMLOptionElement> element, ExceptionState& exceptionState)
{ {
add(element, length(), exceptionState); add(element, length(), exceptionState);
} }
void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index, ExceptionState& exceptionState) void HTMLOptionsCollection::add(PassRefPtrWillBeRawPtr<HTMLOptionElement> element, int index, ExceptionState& exceptionState)
{ {
HTMLOptionElement* newOption = element.get(); HTMLOptionElement* newOption = element.get();
...@@ -142,7 +142,7 @@ void HTMLOptionsCollection::namedGetter(const AtomicString& name, bool& returnVa ...@@ -142,7 +142,7 @@ void HTMLOptionsCollection::namedGetter(const AtomicString& name, bool& returnVa
returnValue0 = NamedNodesCollection::create(namedItems); returnValue0 = NamedNodesCollection::create(namedItems);
} }
bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtr<HTMLOptionElement> value, ExceptionState& exceptionState) bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtrWillBeRawPtr<HTMLOptionElement> value, ExceptionState& exceptionState)
{ {
HTMLSelectElement& base = toHTMLSelectElement(ownerNode()); HTMLSelectElement& base = toHTMLSelectElement(ownerNode());
if (!value) { // undefined or null if (!value) { // undefined or null
......
...@@ -36,8 +36,8 @@ class HTMLOptionsCollection FINAL : public HTMLCollection { ...@@ -36,8 +36,8 @@ class HTMLOptionsCollection FINAL : public HTMLCollection {
public: public:
static PassRefPtr<HTMLOptionsCollection> create(ContainerNode&, CollectionType); static PassRefPtr<HTMLOptionsCollection> create(ContainerNode&, CollectionType);
void add(PassRefPtr<HTMLOptionElement>, ExceptionState&); void add(PassRefPtrWillBeRawPtr<HTMLOptionElement>, ExceptionState&);
void add(PassRefPtr<HTMLOptionElement>, int index, ExceptionState&); void add(PassRefPtrWillBeRawPtr<HTMLOptionElement>, int index, ExceptionState&);
void remove(int index); void remove(int index);
void remove(HTMLOptionElement*); void remove(HTMLOptionElement*);
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
void setLength(unsigned, ExceptionState&); void setLength(unsigned, ExceptionState&);
void namedGetter(const AtomicString& name, bool&, RefPtr<NodeList>&, bool&, RefPtr<Element>&); void namedGetter(const AtomicString& name, bool&, RefPtr<NodeList>&, bool&, RefPtr<Element>&);
bool anonymousIndexedSetter(unsigned, PassRefPtr<HTMLOptionElement>, ExceptionState&); bool anonymousIndexedSetter(unsigned, PassRefPtrWillBeRawPtr<HTMLOptionElement>, ExceptionState&);
private: private:
explicit HTMLOptionsCollection(ContainerNode&); explicit HTMLOptionsCollection(ContainerNode&);
......
...@@ -82,7 +82,7 @@ public: ...@@ -82,7 +82,7 @@ public:
void invalidateSelectedItems(); void invalidateSelectedItems();
void updateListItemSelectedStates(); void updateListItemSelectedStates();
const Vector<HTMLElement*>& listItems() const; const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems() const;
virtual void accessKeyAction(bool sendMouseEvents) OVERRIDE; virtual void accessKeyAction(bool sendMouseEvents) OVERRIDE;
void accessKeySetSelectedIndex(int); void accessKeySetSelectedIndex(int);
...@@ -114,9 +114,12 @@ public: ...@@ -114,9 +114,12 @@ public:
// For use in the implementation of HTMLOptionElement. // For use in the implementation of HTMLOptionElement.
void optionSelectionStateChanged(HTMLOptionElement*, bool optionIsSelected); void optionSelectionStateChanged(HTMLOptionElement*, bool optionIsSelected);
bool anonymousIndexedSetter(unsigned, PassRefPtr<HTMLOptionElement>, ExceptionState&); bool anonymousIndexedSetter(unsigned, PassRefPtrWillBeRawPtr<HTMLOptionElement>, ExceptionState&);
void updateListOnRenderer(); void updateListOnRenderer();
virtual void trace(Visitor*) OVERRIDE;
protected: protected:
HTMLSelectElement(Document&, HTMLFormElement*); HTMLSelectElement(Document&, HTMLFormElement*);
...@@ -198,7 +201,7 @@ private: ...@@ -198,7 +201,7 @@ private:
virtual String optionAtIndex(int index) const OVERRIDE; virtual String optionAtIndex(int index) const OVERRIDE;
// m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHRElement objects. // m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHRElement objects.
mutable Vector<HTMLElement*> m_listItems; mutable WillBeHeapVector<RawPtrWillBeMember<HTMLElement> > m_listItems;
Vector<bool> m_lastOnChangeSelection; Vector<bool> m_lastOnChangeSelection;
Vector<bool> m_cachedStateForActiveSelection; Vector<bool> m_cachedStateForActiveSelection;
TypeAhead m_typeAhead; TypeAhead m_typeAhead;
......
...@@ -120,7 +120,7 @@ void RenderListBox::updateFromElement() ...@@ -120,7 +120,7 @@ void RenderListBox::updateFromElement()
{ {
FontCachePurgePreventer fontCachePurgePreventer; FontCachePurgePreventer fontCachePurgePreventer;
if (m_optionsChanged) { if (m_optionsChanged) {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
int size = static_cast<int>(listItems.size()); int size = static_cast<int>(listItems.size());
float width = 0; float width = 0;
...@@ -373,7 +373,7 @@ void RenderListBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& ...@@ -373,7 +373,7 @@ void RenderListBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint&
// No selected items, find the first non-disabled item. // No selected items, find the first non-disabled item.
int size = numItems(); int size = numItems();
const Vector<HTMLElement*>& listItems = select->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = select->listItems();
for (int i = 0; i < size; ++i) { for (int i = 0; i < size; ++i) {
HTMLElement* element = listItems[renderListBoxIndexToListIndex(i)]; HTMLElement* element = listItems[renderListBoxIndexToListIndex(i)];
if (isHTMLOptionElement(*element) && !element->isDisabledFormControl()) { if (isHTMLOptionElement(*element) && !element->isDisabledFormControl()) {
...@@ -431,7 +431,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint& ...@@ -431,7 +431,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
HTMLSelectElement* select = selectElement(); HTMLSelectElement* select = selectElement();
const Vector<HTMLElement*>& listItems = select->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = select->listItems();
HTMLElement* element = listItems[renderListBoxIndexToListIndex(listIndex)]; HTMLElement* element = listItems[renderListBoxIndexToListIndex(listIndex)];
RenderStyle* itemStyle = element->renderStyle(); RenderStyle* itemStyle = element->renderStyle();
...@@ -480,7 +480,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint& ...@@ -480,7 +480,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, const LayoutPoint&
void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset, int listIndex) void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset, int listIndex)
{ {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
HTMLElement* element = listItems[renderListBoxIndexToListIndex(listIndex)]; HTMLElement* element = listItems[renderListBoxIndexToListIndex(listIndex)];
Color backColor; Color backColor;
...@@ -736,7 +736,7 @@ bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re ...@@ -736,7 +736,7 @@ bool RenderListBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
{ {
if (!RenderBlockFlow::nodeAtPoint(request, result, locationInContainer, accumulatedOffset, hitTestAction)) if (!RenderBlockFlow::nodeAtPoint(request, result, locationInContainer, accumulatedOffset, hitTestAction))
return false; return false;
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
int size = numItems(); int size = numItems();
LayoutPoint adjustedLocation = accumulatedOffset + location(); LayoutPoint adjustedLocation = accumulatedOffset + location();
...@@ -975,7 +975,7 @@ void RenderListBox::setHasVerticalScrollbar(bool hasScrollbar) ...@@ -975,7 +975,7 @@ void RenderListBox::setHasVerticalScrollbar(bool hasScrollbar)
int RenderListBox::renderListBoxIndexToListIndex(int index) const int RenderListBox::renderListBoxIndexToListIndex(int index) const
{ {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
const int size = static_cast<int>(listItems.size()); const int size = static_cast<int>(listItems.size());
if (size == numItems()) if (size == numItems())
...@@ -998,7 +998,7 @@ int RenderListBox::renderListBoxIndexToListIndex(int index) const ...@@ -998,7 +998,7 @@ int RenderListBox::renderListBoxIndexToListIndex(int index) const
int RenderListBox::listIndexToRenderListBoxIndex(int index) const int RenderListBox::listIndexToRenderListBoxIndex(int index) const
{ {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
const int size = static_cast<int>(listItems.size()); const int size = static_cast<int>(listItems.size());
if (size == numItems()) if (size == numItems())
......
...@@ -162,7 +162,7 @@ void RenderMenuList::styleDidChange(StyleDifference diff, const RenderStyle* old ...@@ -162,7 +162,7 @@ void RenderMenuList::styleDidChange(StyleDifference diff, const RenderStyle* old
void RenderMenuList::updateOptionsWidth() void RenderMenuList::updateOptionsWidth()
{ {
float maxOptionWidth = 0; float maxOptionWidth = 0;
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
int size = listItems.size(); int size = listItems.size();
FontCachePurgePreventer fontCachePurgePreventer; FontCachePurgePreventer fontCachePurgePreventer;
...@@ -214,7 +214,7 @@ void RenderMenuList::updateFromElement() ...@@ -214,7 +214,7 @@ void RenderMenuList::updateFromElement()
void RenderMenuList::setTextFromOption(int optionIndex) void RenderMenuList::setTextFromOption(int optionIndex)
{ {
HTMLSelectElement* select = selectElement(); HTMLSelectElement* select = selectElement();
const Vector<HTMLElement*>& listItems = select->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = select->listItems();
int size = listItems.size(); int size = listItems.size();
int i = select->optionToListIndex(optionIndex); int i = select->optionToListIndex(optionIndex);
...@@ -398,7 +398,7 @@ void RenderMenuList::didUpdateActiveOption(int optionIndex) ...@@ -398,7 +398,7 @@ void RenderMenuList::didUpdateActiveOption(int optionIndex)
String RenderMenuList::itemText(unsigned listIndex) const String RenderMenuList::itemText(unsigned listIndex) const
{ {
HTMLSelectElement* select = selectElement(); HTMLSelectElement* select = selectElement();
const Vector<HTMLElement*>& listItems = select->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = select->listItems();
if (listIndex >= listItems.size()) if (listIndex >= listItems.size())
return String(); return String();
...@@ -416,7 +416,7 @@ String RenderMenuList::itemText(unsigned listIndex) const ...@@ -416,7 +416,7 @@ String RenderMenuList::itemText(unsigned listIndex) const
String RenderMenuList::itemAccessibilityText(unsigned listIndex) const String RenderMenuList::itemAccessibilityText(unsigned listIndex) const
{ {
// Allow the accessible name be changed if necessary. // Allow the accessible name be changed if necessary.
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
if (listIndex >= listItems.size()) if (listIndex >= listItems.size())
return String(); return String();
return listItems[listIndex]->fastGetAttribute(aria_labelAttr); return listItems[listIndex]->fastGetAttribute(aria_labelAttr);
...@@ -424,7 +424,7 @@ String RenderMenuList::itemAccessibilityText(unsigned listIndex) const ...@@ -424,7 +424,7 @@ String RenderMenuList::itemAccessibilityText(unsigned listIndex) const
String RenderMenuList::itemToolTip(unsigned listIndex) const String RenderMenuList::itemToolTip(unsigned listIndex) const
{ {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
if (listIndex >= listItems.size()) if (listIndex >= listItems.size())
return String(); return String();
return listItems[listIndex]->title(); return listItems[listIndex]->title();
...@@ -432,7 +432,7 @@ String RenderMenuList::itemToolTip(unsigned listIndex) const ...@@ -432,7 +432,7 @@ String RenderMenuList::itemToolTip(unsigned listIndex) const
bool RenderMenuList::itemIsEnabled(unsigned listIndex) const bool RenderMenuList::itemIsEnabled(unsigned listIndex) const
{ {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
if (listIndex >= listItems.size()) if (listIndex >= listItems.size())
return false; return false;
HTMLElement* element = listItems[listIndex]; HTMLElement* element = listItems[listIndex];
...@@ -452,7 +452,7 @@ bool RenderMenuList::itemIsEnabled(unsigned listIndex) const ...@@ -452,7 +452,7 @@ bool RenderMenuList::itemIsEnabled(unsigned listIndex) const
PopupMenuStyle RenderMenuList::itemStyle(unsigned listIndex) const PopupMenuStyle RenderMenuList::itemStyle(unsigned listIndex) const
{ {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
if (listIndex >= listItems.size()) { if (listIndex >= listItems.size()) {
// If we are making an out of bounds access, then we want to use the style // If we are making an out of bounds access, then we want to use the style
// of a different option element (index 0). However, if there isn't an option element // of a different option element (index 0). However, if there isn't an option element
...@@ -477,7 +477,7 @@ PopupMenuStyle RenderMenuList::itemStyle(unsigned listIndex) const ...@@ -477,7 +477,7 @@ PopupMenuStyle RenderMenuList::itemStyle(unsigned listIndex) const
void RenderMenuList::getItemBackgroundColor(unsigned listIndex, Color& itemBackgroundColor, bool& itemHasCustomBackgroundColor) const void RenderMenuList::getItemBackgroundColor(unsigned listIndex, Color& itemBackgroundColor, bool& itemHasCustomBackgroundColor) const
{ {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
if (listIndex >= listItems.size()) { if (listIndex >= listItems.size()) {
itemBackgroundColor = resolveColor(CSSPropertyBackgroundColor); itemBackgroundColor = resolveColor(CSSPropertyBackgroundColor);
itemHasCustomBackgroundColor = false; itemHasCustomBackgroundColor = false;
...@@ -553,19 +553,19 @@ void RenderMenuList::popupDidHide() ...@@ -553,19 +553,19 @@ void RenderMenuList::popupDidHide()
bool RenderMenuList::itemIsSeparator(unsigned listIndex) const bool RenderMenuList::itemIsSeparator(unsigned listIndex) const
{ {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
return listIndex < listItems.size() && isHTMLHRElement(*listItems[listIndex]); return listIndex < listItems.size() && isHTMLHRElement(*listItems[listIndex]);
} }
bool RenderMenuList::itemIsLabel(unsigned listIndex) const bool RenderMenuList::itemIsLabel(unsigned listIndex) const
{ {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
return listIndex < listItems.size() && isHTMLOptGroupElement(*listItems[listIndex]); return listIndex < listItems.size() && isHTMLOptGroupElement(*listItems[listIndex]);
} }
bool RenderMenuList::itemIsSelected(unsigned listIndex) const bool RenderMenuList::itemIsSelected(unsigned listIndex) const
{ {
const Vector<HTMLElement*>& listItems = selectElement()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = selectElement()->listItems();
if (listIndex >= listItems.size()) if (listIndex >= listItems.size())
return false; return false;
HTMLElement* element = listItems[listIndex]; HTMLElement* element = listItems[listIndex];
......
...@@ -99,9 +99,9 @@ HTMLFormControlElement* GetButtonToActivate(HTMLFormElement* form) ...@@ -99,9 +99,9 @@ HTMLFormControlElement* GetButtonToActivate(HTMLFormElement* form)
// selected state. // selected state.
bool IsSelectInDefaultState(HTMLSelectElement* select) bool IsSelectInDefaultState(HTMLSelectElement* select)
{ {
const Vector<HTMLElement*>& listItems = select->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = select->listItems();
if (select->multiple() || select->size() > 1) { if (select->multiple() || select->size() > 1) {
for (Vector<HTMLElement*>::const_iterator i(listItems.begin()); i != listItems.end(); ++i) { for (WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >::const_iterator i(listItems.begin()); i != listItems.end(); ++i) {
if (!(*i)->hasLocalName(HTMLNames::optionTag)) if (!(*i)->hasLocalName(HTMLNames::optionTag))
continue; continue;
HTMLOptionElement* optionElement = toHTMLOptionElement(*i); HTMLOptionElement* optionElement = toHTMLOptionElement(*i);
...@@ -114,7 +114,7 @@ bool IsSelectInDefaultState(HTMLSelectElement* select) ...@@ -114,7 +114,7 @@ bool IsSelectInDefaultState(HTMLSelectElement* select)
// The select is rendered as a combobox (called menulist in WebKit). At // The select is rendered as a combobox (called menulist in WebKit). At
// least one item is selected, determine which one. // least one item is selected, determine which one.
HTMLOptionElement* initialSelected = 0; HTMLOptionElement* initialSelected = 0;
for (Vector<HTMLElement*>::const_iterator i(listItems.begin()); i != listItems.end(); ++i) { for (WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >::const_iterator i(listItems.begin()); i != listItems.end(); ++i) {
if (!(*i)->hasLocalName(HTMLNames::optionTag)) if (!(*i)->hasLocalName(HTMLNames::optionTag))
continue; continue;
HTMLOptionElement* optionElement = toHTMLOptionElement(*i); HTMLOptionElement* optionElement = toHTMLOptionElement(*i);
......
...@@ -43,10 +43,10 @@ namespace blink { ...@@ -43,10 +43,10 @@ namespace blink {
WebVector<WebElement> WebSelectElement::listItems() const WebVector<WebElement> WebSelectElement::listItems() const
{ {
const Vector<HTMLElement*>& sourceItems = constUnwrap<HTMLSelectElement>()->listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& sourceItems = constUnwrap<HTMLSelectElement>()->listItems();
WebVector<WebElement> items(sourceItems.size()); WebVector<WebElement> items(sourceItems.size());
for (size_t i = 0; i < sourceItems.size(); ++i) for (size_t i = 0; i < sourceItems.size(); ++i)
items[i] = WebElement(sourceItems[i]); items[i] = WebElement(sourceItems[i].get());
return items; return items;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment