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