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.
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
;
10 parent
= parent
.parentElement
) {
11 if (parent
.tagName
.toLowerCase() == 'select') {
12 return parent
.multiple
;
15 throw new Error('option element is not in a select');