Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1639)

Unified Diff: Source/modules/accessibility/AXMenuListOption.cpp

Issue 1059503002: Re-land: Don't keep recreating AXMenuListPopup (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@suppress_extra_events
Patch Set: Fix optgroup Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/accessibility/AXMenuListOption.h ('k') | Source/modules/accessibility/AXMenuListPopup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXMenuListOption.cpp
diff --git a/Source/modules/accessibility/AXMenuListOption.cpp b/Source/modules/accessibility/AXMenuListOption.cpp
index d6ee7be4c0485cc6b70362f98e81d5e3feb2e036..ac9822fe77c9b91447e8b4239ddb6ee1cfd59b57 100644
--- a/Source/modules/accessibility/AXMenuListOption.cpp
+++ b/Source/modules/accessibility/AXMenuListOption.cpp
@@ -26,7 +26,6 @@
#include "config.h"
#include "modules/accessibility/AXMenuListOption.h"
-#include "core/html/HTMLOptionElement.h"
#include "modules/accessibility/AXMenuListPopup.h"
#include "modules/accessibility/AXObjectCacheImpl.h"
@@ -34,27 +33,28 @@ namespace blink {
using namespace HTMLNames;
-AXMenuListOption::AXMenuListOption(AXObjectCacheImpl* axObjectCache)
+AXMenuListOption::AXMenuListOption(HTMLOptionElement* element, AXObjectCacheImpl* axObjectCache)
: AXMockObject(axObjectCache)
+ , m_element(element)
{
}
-void AXMenuListOption::setElement(HTMLElement* element)
+void AXMenuListOption::detach()
{
- ASSERT_ARG(element, isHTMLOptionElement(element));
- m_element = element;
+ m_element = nullptr;
+ AXMockObject::detach();
}
Element* AXMenuListOption::actionElement() const
{
- return m_element.get();
+ return m_element;
}
bool AXMenuListOption::isEnabled() const
{
// isDisabledFormControl() returns true if the parent <select> element is disabled,
// which we don't want.
- return !toHTMLOptionElement(m_element)->ownElementDisabled();
+ return !m_element->ownElementDisabled();
}
bool AXMenuListOption::isVisible() const
@@ -78,7 +78,7 @@ bool AXMenuListOption::isSelected() const
AXMenuListPopup* parent = static_cast<AXMenuListPopup*>(parentObject());
if (parent && !parent->isOffScreen())
return parent->activeChild() == this;
- return toHTMLOptionElement(m_element)->selected();
+ return m_element->selected();
}
void AXMenuListOption::setSelected(bool b)
@@ -86,7 +86,7 @@ void AXMenuListOption::setSelected(bool b)
if (!canSetSelectedAttribute())
return;
- toHTMLOptionElement(m_element)->setSelected(b);
+ m_element->setSelected(b);
}
bool AXMenuListOption::canSetSelectedAttribute() const
@@ -112,7 +112,7 @@ LayoutRect AXMenuListOption::elementRect() const
String AXMenuListOption::stringValue() const
{
- return toHTMLOptionElement(m_element)->text();
+ return m_element->text();
}
} // namespace blink
« no previous file with comments | « Source/modules/accessibility/AXMenuListOption.h ('k') | Source/modules/accessibility/AXMenuListPopup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698