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

Unified Diff: mouse_commands.cc

Issue 8905024: Fix ChromeDriver to support selecting option tags in optgroups (Closed) Base URL: http://src.chromium.org/svn/trunk/src/chrome/test/webdriver/commands/
Patch Set: Created 9 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mouse_commands.cc
===================================================================
--- mouse_commands.cc (revision 114114)
+++ mouse_commands.cc (working copy)
@@ -47,11 +47,15 @@
if (tag_name == "option") {
const char* kCanOptionBeToggledScript =
"function(option) {"
- " var select = option.parentElement;"
- " if (!select || select.tagName.toLowerCase() != 'select')"
- " throw new Error('Option element is not in a select');"
- " return select.multiple;"
- "}";
+ " for (var parent = option.parentElement;"
+ " parent;"
+ " parent = parent.parentElement) {"
+ " if (parent.tagName.toLowerCase() == 'select') {"
+ " return parent.multiple;"
+ " }"
+ " }"
+ " throw new Error('Option element is not in a select');"
+ "};";
bool can_be_toggled;
error = session_->ExecuteScriptAndParse(
session_->current_target(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698