Commit c9504a9b authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Commit Bot

Use new downcast helper for blink::HTMLMenuElement

This CL has goal to Use IsA<HTMLMenuElement>(element) in place of
IsHTMLMenuElement(element)

Bug: 891908
Change-Id: Ia9c016f9c23481a60db63ee00ead1361090de3a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1930541
Commit-Queue: Abhijeet | Igalia <abhijeet@igalia.com>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718996}
parent 8b6950bd
...@@ -191,7 +191,7 @@ static bool PlanCounter(LayoutObject& object, ...@@ -191,7 +191,7 @@ static bool PlanCounter(LayoutObject& object,
is_reset = true; is_reset = true;
return true; return true;
} }
if (IsA<HTMLUListElement>(*e) || IsHTMLMenuElement(*e) || if (IsA<HTMLUListElement>(*e) || IsA<HTMLMenuElement>(*e) ||
IsA<HTMLDirectoryElement>(*e)) { IsA<HTMLDirectoryElement>(*e)) {
value = 0; value = 0;
is_reset = true; is_reset = true;
......
...@@ -421,7 +421,7 @@ static bool IsRequiredOwnedElement(AXObject* parent, ...@@ -421,7 +421,7 @@ static bool IsRequiredOwnedElement(AXObject* parent,
if (current_role == ax::mojom::Role::kMenuItemCheckBox || if (current_role == ax::mojom::Role::kMenuItemCheckBox ||
current_role == ax::mojom::Role::kMenuItem || current_role == ax::mojom::Role::kMenuItem ||
current_role == ax::mojom::Role::kMenuItemRadio) current_role == ax::mojom::Role::kMenuItemRadio)
return IsHTMLMenuElement(*parent_node); return IsA<HTMLMenuElement>(*parent_node);
if (!current_element) if (!current_element)
return false; return false;
...@@ -653,7 +653,7 @@ ax::mojom::Role AXNodeObject::NativeRoleIgnoringAria() const { ...@@ -653,7 +653,7 @@ ax::mojom::Role AXNodeObject::NativeRoleIgnoringAria() const {
return ax::mojom::Role::kTextFieldWithComboBox; return ax::mojom::Role::kTextFieldWithComboBox;
if (type == input_type_names::kButton) { if (type == input_type_names::kButton) {
if ((GetNode()->parentNode() && if ((GetNode()->parentNode() &&
IsHTMLMenuElement(GetNode()->parentNode())) || IsA<HTMLMenuElement>(GetNode()->parentNode())) ||
(ParentObject() && (ParentObject() &&
ParentObject()->RoleValue() == ax::mojom::Role::kMenu)) ParentObject()->RoleValue() == ax::mojom::Role::kMenu))
return ax::mojom::Role::kMenuItem; return ax::mojom::Role::kMenuItem;
...@@ -661,7 +661,7 @@ ax::mojom::Role AXNodeObject::NativeRoleIgnoringAria() const { ...@@ -661,7 +661,7 @@ ax::mojom::Role AXNodeObject::NativeRoleIgnoringAria() const {
} }
if (type == input_type_names::kCheckbox) { if (type == input_type_names::kCheckbox) {
if ((GetNode()->parentNode() && if ((GetNode()->parentNode() &&
IsHTMLMenuElement(GetNode()->parentNode())) || IsA<HTMLMenuElement>(GetNode()->parentNode())) ||
(ParentObject() && (ParentObject() &&
ParentObject()->RoleValue() == ax::mojom::Role::kMenu)) ParentObject()->RoleValue() == ax::mojom::Role::kMenu))
return ax::mojom::Role::kMenuItemCheckBox; return ax::mojom::Role::kMenuItemCheckBox;
...@@ -677,7 +677,7 @@ ax::mojom::Role AXNodeObject::NativeRoleIgnoringAria() const { ...@@ -677,7 +677,7 @@ ax::mojom::Role AXNodeObject::NativeRoleIgnoringAria() const {
return ax::mojom::Role::kButton; return ax::mojom::Role::kButton;
if (type == input_type_names::kRadio) { if (type == input_type_names::kRadio) {
if ((GetNode()->parentNode() && if ((GetNode()->parentNode() &&
IsHTMLMenuElement(GetNode()->parentNode())) || IsA<HTMLMenuElement>(GetNode()->parentNode())) ||
(ParentObject() && (ParentObject() &&
ParentObject()->RoleValue() == ax::mojom::Role::kMenu)) ParentObject()->RoleValue() == ax::mojom::Role::kMenu))
return ax::mojom::Role::kMenuItemRadio; return ax::mojom::Role::kMenuItemRadio;
......
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