| 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 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2014 } | 2014 } |
| 2015 | 2015 |
| 2016 void HTMLSelectElement::showPopup() | 2016 void HTMLSelectElement::showPopup() |
| 2017 { | 2017 { |
| 2018 if (popupIsVisible()) | 2018 if (popupIsVisible()) |
| 2019 return; | 2019 return; |
| 2020 if (document().frameHost()->chromeClient().hasOpenedPopup()) | 2020 if (document().frameHost()->chromeClient().hasOpenedPopup()) |
| 2021 return; | 2021 return; |
| 2022 if (!layoutObject() || !layoutObject()->isMenuList()) | 2022 if (!layoutObject() || !layoutObject()->isMenuList()) |
| 2023 return; | 2023 return; |
| 2024 // Disable visibility check on Android. elementRectRelativeToViewport() |
| 2025 // doesn't work well on Android WebView. crbug.com/632561 |
| 2026 #if !OS(ANDROID) |
| 2024 if (elementRectRelativeToViewport().isEmpty()) | 2027 if (elementRectRelativeToViewport().isEmpty()) |
| 2025 return; | 2028 return; |
| 2029 #endif |
| 2026 | 2030 |
| 2027 if (!m_popup) | 2031 if (!m_popup) |
| 2028 m_popup = document().frameHost()->chromeClient().openPopupMenu(*document
().frame(), *this); | 2032 m_popup = document().frameHost()->chromeClient().openPopupMenu(*document
().frame(), *this); |
| 2029 m_popupIsVisible = true; | 2033 m_popupIsVisible = true; |
| 2030 observeTreeMutation(); | 2034 observeTreeMutation(); |
| 2031 | 2035 |
| 2032 LayoutMenuList* menuList = toLayoutMenuList(layoutObject()); | 2036 LayoutMenuList* menuList = toLayoutMenuList(layoutObject()); |
| 2033 m_popup->show(); | 2037 m_popup->show(); |
| 2034 if (AXObjectCache* cache = document().existingAXObjectCache()) | 2038 if (AXObjectCache* cache = document().existingAXObjectCache()) |
| 2035 cache->didShowMenuListPopup(menuList); | 2039 cache->didShowMenuListPopup(menuList); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2136 } | 2140 } |
| 2137 | 2141 |
| 2138 void HTMLSelectElement::didMutateSubtree() | 2142 void HTMLSelectElement::didMutateSubtree() |
| 2139 { | 2143 { |
| 2140 DCHECK(popupIsVisible()); | 2144 DCHECK(popupIsVisible()); |
| 2141 DCHECK(m_popup); | 2145 DCHECK(m_popup); |
| 2142 m_popup->updateFromElement(PopupMenu::ByDOMChange); | 2146 m_popup->updateFromElement(PopupMenu::ByDOMChange); |
| 2143 } | 2147 } |
| 2144 | 2148 |
| 2145 } // namespace blink | 2149 } // namespace blink |
| OLD | NEW |