| 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 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2026 } | 2026 } |
| 2027 | 2027 |
| 2028 Member<HTMLSelectElement> m_select; | 2028 Member<HTMLSelectElement> m_select; |
| 2029 Member<MutationObserver> m_observer; | 2029 Member<MutationObserver> m_observer; |
| 2030 }; | 2030 }; |
| 2031 | 2031 |
| 2032 HTMLSelectElement::PopupUpdater::PopupUpdater(HTMLSelectElement& select) | 2032 HTMLSelectElement::PopupUpdater::PopupUpdater(HTMLSelectElement& select) |
| 2033 : m_select(select) | 2033 : m_select(select) |
| 2034 { | 2034 { |
| 2035 m_observer = MutationObserver::create(this); | 2035 m_observer = MutationObserver::create(this); |
| 2036 Vector<String> filter; |
| 2037 filter.reserveCapacity(4); |
| 2038 // Observe only attributes which affect popup content. |
| 2039 filter.append(String("disabled")); |
| 2040 filter.append(String("label")); |
| 2041 filter.append(String("selected")); |
| 2042 filter.append(String("value")); |
| 2036 MutationObserverInit init; | 2043 MutationObserverInit init; |
| 2037 init.setAttributes(true); | 2044 init.setAttributes(true); |
| 2045 init.setAttributeFilter(filter); |
| 2038 init.setCharacterData(true); | 2046 init.setCharacterData(true); |
| 2039 init.setChildList(true); | 2047 init.setChildList(true); |
| 2040 init.setSubtree(true); | 2048 init.setSubtree(true); |
| 2041 m_observer->observe(&select, init, ASSERT_NO_EXCEPTION); | 2049 m_observer->observe(&select, init, ASSERT_NO_EXCEPTION); |
| 2042 } | 2050 } |
| 2043 | 2051 |
| 2044 DEFINE_TRACE(HTMLSelectElement::PopupUpdater) | 2052 DEFINE_TRACE(HTMLSelectElement::PopupUpdater) |
| 2045 { | 2053 { |
| 2046 visitor->trace(m_select); | 2054 visitor->trace(m_select); |
| 2047 visitor->trace(m_observer); | 2055 visitor->trace(m_observer); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2063 } | 2071 } |
| 2064 | 2072 |
| 2065 void HTMLSelectElement::didMutateSubtree() | 2073 void HTMLSelectElement::didMutateSubtree() |
| 2066 { | 2074 { |
| 2067 DCHECK(popupIsVisible()); | 2075 DCHECK(popupIsVisible()); |
| 2068 DCHECK(m_popup); | 2076 DCHECK(m_popup); |
| 2069 m_popup->updateFromElement(PopupMenu::ByDOMChange); | 2077 m_popup->updateFromElement(PopupMenu::ByDOMChange); |
| 2070 } | 2078 } |
| 2071 | 2079 |
| 2072 } // namespace blink | 2080 } // namespace blink |
| OLD | NEW |