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 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2008 DECLARE_VIRTUAL_TRACE(); | 2008 DECLARE_VIRTUAL_TRACE(); |
2009 | 2009 |
2010 void dispose() | 2010 void dispose() |
2011 { | 2011 { |
2012 m_observer->disconnect(); | 2012 m_observer->disconnect(); |
2013 } | 2013 } |
2014 | 2014 |
2015 private: | 2015 private: |
2016 void call(const HeapVector<Member<MutationRecord>>&, MutationObserver*) over
ride | 2016 void call(const HeapVector<Member<MutationRecord>>&, MutationObserver*) over
ride |
2017 { | 2017 { |
| 2018 // We disconnect the MutationObserver when a popuup is closed. However |
| 2019 // MutationObserver can call back after disconnection. |
| 2020 if (!m_select->popupIsVisible()) |
| 2021 return; |
2018 m_select->didMutateSubtree(); | 2022 m_select->didMutateSubtree(); |
2019 } | 2023 } |
2020 | 2024 |
2021 ExecutionContext* getExecutionContext() const override | 2025 ExecutionContext* getExecutionContext() const override |
2022 { | 2026 { |
2023 return &m_select->document(); | 2027 return &m_select->document(); |
2024 } | 2028 } |
2025 | 2029 |
2026 Member<HTMLSelectElement> m_select; | 2030 Member<HTMLSelectElement> m_select; |
2027 Member<MutationObserver> m_observer; | 2031 Member<MutationObserver> m_observer; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2069 } | 2073 } |
2070 | 2074 |
2071 void HTMLSelectElement::didMutateSubtree() | 2075 void HTMLSelectElement::didMutateSubtree() |
2072 { | 2076 { |
2073 DCHECK(popupIsVisible()); | 2077 DCHECK(popupIsVisible()); |
2074 DCHECK(m_popup); | 2078 DCHECK(m_popup); |
2075 m_popup->updateFromElement(PopupMenu::ByDOMChange); | 2079 m_popup->updateFromElement(PopupMenu::ByDOMChange); |
2076 } | 2080 } |
2077 | 2081 |
2078 } // namespace blink | 2082 } // namespace blink |
OLD | NEW |