- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / chromedriver / js / is_option_element_toggleable.js
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 function isOptionElementToggleable(option) {
6   if (option.tagName.toLowerCase() != 'option')
7     throw new Error('element is not an option');
8   for (var parent = option.parentElement;
9        parent;
10        parent = parent.parentElement) {
11     if (parent.tagName.toLowerCase() == 'select') {
12       return parent.multiple;
13     }
14   }
15   throw new Error('option element is not in a select');
16 }