| 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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 if (!selectedOption && firstOption && !m_multiple && m_size <= 1) | 1058 if (!selectedOption && firstOption && !m_multiple && m_size <= 1) |
| 1059 firstOption->setSelectedState(true); | 1059 firstOption->setSelectedState(true); |
| 1060 | 1060 |
| 1061 setOptionsChangedOnRenderer(); | 1061 setOptionsChangedOnRenderer(); |
| 1062 setNeedsStyleRecalc(); | 1062 setNeedsStyleRecalc(); |
| 1063 setNeedsValidityCheck(); | 1063 setNeedsValidityCheck(); |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 #if (!PLATFORM(WIN) && !(OS(WINDOWS))) | 1066 #if !OS(WINDOWS) |
| 1067 bool HTMLSelectElement::platformHandleKeydownEvent(KeyboardEvent* event) | 1067 bool HTMLSelectElement::platformHandleKeydownEvent(KeyboardEvent* event) |
| 1068 { | 1068 { |
| 1069 const Page* page = document()->page(); | 1069 const Page* page = document()->page(); |
| 1070 RefPtr<RenderTheme> renderTheme = page ? page->theme() : RenderTheme::defaul
tTheme(); | 1070 RefPtr<RenderTheme> renderTheme = page ? page->theme() : RenderTheme::defaul
tTheme(); |
| 1071 | 1071 |
| 1072 if (!renderTheme->popsMenuByArrowKeys()) | 1072 if (!renderTheme->popsMenuByArrowKeys()) |
| 1073 return false; | 1073 return false; |
| 1074 | 1074 |
| 1075 if (!isSpatialNavigationEnabled(document()->frame())) { | 1075 if (!isSpatialNavigationEnabled(document()->frame())) { |
| 1076 if (event->keyIdentifier() == "Down" || event->keyIdentifier() == "Up")
{ | 1076 if (event->keyIdentifier() == "Down" || event->keyIdentifier() == "Up")
{ |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1293 // Calling focus() may cause us to lose our renderer, in which case do n
ot want to handle the event. | 1293 // Calling focus() may cause us to lose our renderer, in which case do n
ot want to handle the event. |
| 1294 if (!renderer()) | 1294 if (!renderer()) |
| 1295 return; | 1295 return; |
| 1296 | 1296 |
| 1297 // Convert to coords relative to the list box if needed. | 1297 // Convert to coords relative to the list box if needed. |
| 1298 MouseEvent* mouseEvent = static_cast<MouseEvent*>(event); | 1298 MouseEvent* mouseEvent = static_cast<MouseEvent*>(event); |
| 1299 IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouse
Event->absoluteLocation(), UseTransforms)); | 1299 IntPoint localOffset = roundedIntPoint(renderer()->absoluteToLocal(mouse
Event->absoluteLocation(), UseTransforms)); |
| 1300 int listIndex = toRenderListBox(renderer())->listIndexAtOffset(toIntSize
(localOffset)); | 1300 int listIndex = toRenderListBox(renderer())->listIndexAtOffset(toIntSize
(localOffset)); |
| 1301 if (listIndex >= 0) { | 1301 if (listIndex >= 0) { |
| 1302 if (!isDisabledFormControl()) { | 1302 if (!isDisabledFormControl()) { |
| 1303 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) | 1303 #if OS(DARWIN) |
| 1304 updateSelectedState(listIndex, mouseEvent->metaKey(), mouseEvent
->shiftKey()); | 1304 updateSelectedState(listIndex, mouseEvent->metaKey(), mouseEvent
->shiftKey()); |
| 1305 #else | 1305 #else |
| 1306 updateSelectedState(listIndex, mouseEvent->ctrlKey(), mouseEvent
->shiftKey()); | 1306 updateSelectedState(listIndex, mouseEvent->ctrlKey(), mouseEvent
->shiftKey()); |
| 1307 #endif | 1307 #endif |
| 1308 } | 1308 } |
| 1309 if (Frame* frame = document()->frame()) | 1309 if (Frame* frame = document()->frame()) |
| 1310 frame->eventHandler()->setMouseDownMayStartAutoscroll(); | 1310 frame->eventHandler()->setMouseDownMayStartAutoscroll(); |
| 1311 | 1311 |
| 1312 event->setDefaultHandled(); | 1312 event->setDefaultHandled(); |
| 1313 } | 1313 } |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1555 const Vector<HTMLElement*>& items = listItems(); | 1555 const Vector<HTMLElement*>& items = listItems(); |
| 1556 for (unsigned i = 0; i < items.size(); ++i) { | 1556 for (unsigned i = 0; i < items.size(); ++i) { |
| 1557 if (items[i]->hasTagName(optionTag)) | 1557 if (items[i]->hasTagName(optionTag)) |
| 1558 ++options; | 1558 ++options; |
| 1559 } | 1559 } |
| 1560 | 1560 |
| 1561 return options; | 1561 return options; |
| 1562 } | 1562 } |
| 1563 | 1563 |
| 1564 } // namespace | 1564 } // namespace |
| OLD | NEW |