Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSelectElement.cpp

Issue 2012943002: Merge "SELECT popup: Do not update popup content for arbitrary attribute change." to M52. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698