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

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

Issue 1061063004: Revert of Don't keep recreating AXMenuListPopup (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@suppress_extra_events
Patch Set: 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 ac9822fe77c9b91447e8b4239ddb6ee1cfd59b57..d6ee7be4c0485cc6b70362f98e81d5e3feb2e036 100644
--- a/Source/modules/accessibility/AXMenuListOption.cpp
+++ b/Source/modules/accessibility/AXMenuListOption.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "modules/accessibility/AXMenuListOption.h"
+#include "core/html/HTMLOptionElement.h"
#include "modules/accessibility/AXMenuListPopup.h"
#include "modules/accessibility/AXObjectCacheImpl.h"
@@ -33,28 +34,27 @@
using namespace HTMLNames;
-AXMenuListOption::AXMenuListOption(HTMLOptionElement* element, AXObjectCacheImpl* axObjectCache)
+AXMenuListOption::AXMenuListOption(AXObjectCacheImpl* axObjectCache)
: AXMockObject(axObjectCache)
- , m_element(element)
{
}
-void AXMenuListOption::detach()
+void AXMenuListOption::setElement(HTMLElement* element)
{
- m_element = nullptr;
- AXMockObject::detach();
+ ASSERT_ARG(element, isHTMLOptionElement(element));
+ m_element = element;
}
Element* AXMenuListOption::actionElement() const
{
- return m_element;
+ return m_element.get();
}
bool AXMenuListOption::isEnabled() const
{
// isDisabledFormControl() returns true if the parent <select> element is disabled,
// which we don't want.
- return !m_element->ownElementDisabled();
+ return !toHTMLOptionElement(m_element)->ownElementDisabled();
}
bool AXMenuListOption::isVisible() const
@@ -78,7 +78,7 @@
AXMenuListPopup* parent = static_cast<AXMenuListPopup*>(parentObject());
if (parent && !parent->isOffScreen())
return parent->activeChild() == this;
- return m_element->selected();
+ return toHTMLOptionElement(m_element)->selected();
}
void AXMenuListOption::setSelected(bool b)
@@ -86,7 +86,7 @@
if (!canSetSelectedAttribute())
return;
- m_element->setSelected(b);
+ toHTMLOptionElement(m_element)->setSelected(b);
}
bool AXMenuListOption::canSetSelectedAttribute() const
@@ -112,7 +112,7 @@
String AXMenuListOption::stringValue() const
{
- return m_element->text();
+ return toHTMLOptionElement(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