OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. |
7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved. | 8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
320 ContainerNode* parent = parentNode(); | 320 ContainerNode* parent = parentNode(); |
321 if (parent && parent->hasTagName(optgroupTag)) | 321 if (parent && parent->hasTagName(optgroupTag)) |
322 return " " + text(); | 322 return " " + text(); |
323 return text(); | 323 return text(); |
324 } | 324 } |
325 | 325 |
326 bool HTMLOptionElement::isDisabledFormControl() const | 326 bool HTMLOptionElement::isDisabledFormControl() const |
327 { | 327 { |
328 if (ownElementDisabled()) | 328 if (ownElementDisabled()) |
329 return true; | 329 return true; |
330 bool status = false; | |
331 ContainerNode* select = parentNode(); | |
330 if (Element* parent = parentElement()) | 332 if (Element* parent = parentElement()) |
331 return parent->hasTagName(optgroupTag) && parent->isDisabledFormControl( ); | 333 status = parent->hasTagName(optgroupTag) && parent->isDisabledFormContro l(); |
332 return false; | 334 if (!status && select && select->hasTagName(selectTag)) |
335 status = ownerSelectElement()->isDisabledOrReadOnly(); | |
tkent
2014/02/12 08:15:43
We can't do this change. This function should mat
| |
336 return status; | |
333 } | 337 } |
334 | 338 |
335 Node::InsertionNotificationRequest HTMLOptionElement::insertedInto(ContainerNode * insertionPoint) | 339 Node::InsertionNotificationRequest HTMLOptionElement::insertedInto(ContainerNode * insertionPoint) |
336 { | 340 { |
337 if (HTMLSelectElement* select = ownerSelectElement()) { | 341 if (HTMLSelectElement* select = ownerSelectElement()) { |
338 select->setRecalcListItems(); | 342 select->setRecalcListItems(); |
339 // Do not call selected() since calling updateListItemSelectedStates() | 343 // Do not call selected() since calling updateListItemSelectedStates() |
340 // at this time won't do the right thing. (Why, exactly?) | 344 // at this time won't do the right thing. (Why, exactly?) |
341 // FIXME: Might be better to call this unconditionally, always passing m _isSelected, | 345 // FIXME: Might be better to call this unconditionally, always passing m _isSelected, |
342 // rather than only calling it if we are selected. | 346 // rather than only calling it if we are selected. |
(...skipping 22 matching lines...) Expand all Loading... | |
365 | 369 |
366 HTMLFormElement* HTMLOptionElement::form() const | 370 HTMLFormElement* HTMLOptionElement::form() const |
367 { | 371 { |
368 if (HTMLSelectElement* selectElement = ownerSelectElement()) | 372 if (HTMLSelectElement* selectElement = ownerSelectElement()) |
369 return selectElement->formOwner(); | 373 return selectElement->formOwner(); |
370 | 374 |
371 return 0; | 375 return 0; |
372 } | 376 } |
373 | 377 |
374 } // namespace WebCore | 378 } // namespace WebCore |
OLD | NEW |