OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the select element renderer in WebCore. | 2 * This file is part of the select element renderer in WebCore. |
3 * | 3 * |
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
6 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 6 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "core/HTMLNames.h" | 28 #include "core/HTMLNames.h" |
29 #include "core/accessibility/AXMenuList.h" | 29 #include "core/accessibility/AXMenuList.h" |
30 #include "core/accessibility/AXObjectCache.h" | 30 #include "core/accessibility/AXObjectCache.h" |
31 #include "core/css/CSSFontSelector.h" | 31 #include "core/css/CSSFontSelector.h" |
32 #include "core/css/resolver/StyleResolver.h" | 32 #include "core/css/resolver/StyleResolver.h" |
33 #include "core/dom/NodeRenderStyle.h" | 33 #include "core/dom/NodeRenderStyle.h" |
34 #include "core/frame/FrameHost.h" | 34 #include "core/frame/FrameHost.h" |
35 #include "core/frame/FrameView.h" | 35 #include "core/frame/FrameView.h" |
36 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
| 37 #include "core/frame/Settings.h" |
37 #include "core/html/HTMLOptGroupElement.h" | 38 #include "core/html/HTMLOptGroupElement.h" |
38 #include "core/html/HTMLOptionElement.h" | 39 #include "core/html/HTMLOptionElement.h" |
39 #include "core/html/HTMLSelectElement.h" | 40 #include "core/html/HTMLSelectElement.h" |
40 #include "core/page/Chrome.h" | 41 #include "core/page/Chrome.h" |
41 #include "core/rendering/RenderBR.h" | 42 #include "core/rendering/RenderBR.h" |
42 #include "core/rendering/RenderScrollbar.h" | 43 #include "core/rendering/RenderScrollbar.h" |
43 #include "core/rendering/RenderTheme.h" | 44 #include "core/rendering/RenderTheme.h" |
44 #include "core/rendering/RenderView.h" | 45 #include "core/rendering/RenderView.h" |
45 #include "platform/fonts/FontCache.h" | 46 #include "platform/fonts/FontCache.h" |
46 #include "platform/geometry/IntSize.h" | 47 #include "platform/geometry/IntSize.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 return selectElement()->multiple(); | 419 return selectElement()->multiple(); |
419 } | 420 } |
420 | 421 |
421 void RenderMenuList::didSetSelectedIndex(int listIndex) | 422 void RenderMenuList::didSetSelectedIndex(int listIndex) |
422 { | 423 { |
423 didUpdateActiveOption(selectElement()->listToOptionIndex(listIndex)); | 424 didUpdateActiveOption(selectElement()->listToOptionIndex(listIndex)); |
424 } | 425 } |
425 | 426 |
426 void RenderMenuList::didUpdateActiveOption(int optionIndex) | 427 void RenderMenuList::didUpdateActiveOption(int optionIndex) |
427 { | 428 { |
428 if (!AXObjectCache::accessibilityEnabled() || !document().existingAXObjectCa
che()) | 429 if (!document().existingAXObjectCache()) |
429 return; | 430 return; |
430 | 431 |
431 if (m_lastActiveIndex == optionIndex) | 432 if (m_lastActiveIndex == optionIndex) |
432 return; | 433 return; |
433 m_lastActiveIndex = optionIndex; | 434 m_lastActiveIndex = optionIndex; |
434 | 435 |
435 HTMLSelectElement* select = selectElement(); | 436 HTMLSelectElement* select = selectElement(); |
436 int listIndex = select->optionToListIndex(optionIndex); | 437 int listIndex = select->optionToListIndex(optionIndex); |
437 if (listIndex < 0 || listIndex >= static_cast<int>(select->listItems().size(
))) | 438 if (listIndex < 0 || listIndex >= static_cast<int>(select->listItems().size(
))) |
438 return; | 439 return; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 HTMLElement* element = listItems[listIndex]; | 618 HTMLElement* element = listItems[listIndex]; |
618 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); | 619 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); |
619 } | 620 } |
620 | 621 |
621 void RenderMenuList::setTextFromItem(unsigned listIndex) | 622 void RenderMenuList::setTextFromItem(unsigned listIndex) |
622 { | 623 { |
623 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); | 624 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); |
624 } | 625 } |
625 | 626 |
626 } // namespace blink | 627 } // namespace blink |
OLD | NEW |