OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
4 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
10 * | 10 * |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 setNeedsValidityCheck(); | 373 setNeedsValidityCheck(); |
374 | 374 |
375 HTMLFormControlElementWithState::childrenChanged(changedByParser, beforeChan
ge, afterChange, childCountDelta); | 375 HTMLFormControlElementWithState::childrenChanged(changedByParser, beforeChan
ge, afterChange, childCountDelta); |
376 } | 376 } |
377 | 377 |
378 void HTMLSelectElement::optionElementChildrenChanged() | 378 void HTMLSelectElement::optionElementChildrenChanged() |
379 { | 379 { |
380 setRecalcListItems(); | 380 setRecalcListItems(); |
381 setNeedsValidityCheck(); | 381 setNeedsValidityCheck(); |
382 | 382 |
383 if (renderer()) { | 383 if (AXObjectCache::accessibilityEnabled() && renderer()) |
384 if (AXObjectCache* cache = renderer()->document()->existingAXObjectCache
()) | 384 renderer()->document()->axObjectCache()->childrenChanged(this); |
385 cache->childrenChanged(this); | |
386 } | |
387 } | 385 } |
388 | 386 |
389 void HTMLSelectElement::accessKeyAction(bool sendMouseEvents) | 387 void HTMLSelectElement::accessKeyAction(bool sendMouseEvents) |
390 { | 388 { |
391 focus(); | 389 focus(); |
392 dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEv
ents); | 390 dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEv
ents); |
393 } | 391 } |
394 | 392 |
395 void HTMLSelectElement::setMultiple(bool multiple) | 393 void HTMLSelectElement::setMultiple(bool multiple) |
396 { | 394 { |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 m_activeSelectionAnchorIndex = -1; | 715 m_activeSelectionAnchorIndex = -1; |
718 setOptionsChangedOnRenderer(); | 716 setOptionsChangedOnRenderer(); |
719 setNeedsStyleRecalc(); | 717 setNeedsStyleRecalc(); |
720 if (!inDocument()) { | 718 if (!inDocument()) { |
721 if (HTMLCollection* collection = cachedHTMLCollection(SelectOptions)) | 719 if (HTMLCollection* collection = cachedHTMLCollection(SelectOptions)) |
722 collection->invalidateCache(); | 720 collection->invalidateCache(); |
723 } | 721 } |
724 if (!inDocument()) | 722 if (!inDocument()) |
725 invalidateSelectedItems(); | 723 invalidateSelectedItems(); |
726 | 724 |
727 if (renderer()) { | 725 if (AXObjectCache::accessibilityEnabled() && renderer()) |
728 if (AXObjectCache* cache = renderer()->document()->existingAXObjectCache
()) | 726 renderer()->document()->axObjectCache()->childrenChanged(this); |
729 cache->childrenChanged(this); | |
730 } | |
731 } | 727 } |
732 | 728 |
733 void HTMLSelectElement::recalcListItems(bool updateSelectedStates) const | 729 void HTMLSelectElement::recalcListItems(bool updateSelectedStates) const |
734 { | 730 { |
735 m_listItems.clear(); | 731 m_listItems.clear(); |
736 | 732 |
737 m_shouldRecalcListItems = false; | 733 m_shouldRecalcListItems = false; |
738 | 734 |
739 HTMLOptionElement* foundSelected = 0; | 735 HTMLOptionElement* foundSelected = 0; |
740 HTMLOptionElement* firstOption = 0; | 736 HTMLOptionElement* firstOption = 0; |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1548 const Vector<HTMLElement*>& items = listItems(); | 1544 const Vector<HTMLElement*>& items = listItems(); |
1549 for (unsigned i = 0; i < items.size(); ++i) { | 1545 for (unsigned i = 0; i < items.size(); ++i) { |
1550 if (items[i]->hasTagName(optionTag)) | 1546 if (items[i]->hasTagName(optionTag)) |
1551 ++options; | 1547 ++options; |
1552 } | 1548 } |
1553 | 1549 |
1554 return options; | 1550 return options; |
1555 } | 1551 } |
1556 | 1552 |
1557 } // namespace | 1553 } // namespace |
OLD | NEW |