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

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

Issue 2012653002: SELECT popup: Do not update popup content for arbitrary attribute change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 2014 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 } 2025 }
2026 2026
2027 Member<HTMLSelectElement> m_select; 2027 Member<HTMLSelectElement> m_select;
2028 Member<MutationObserver> m_observer; 2028 Member<MutationObserver> m_observer;
2029 }; 2029 };
2030 2030
2031 HTMLSelectElement::PopupUpdater::PopupUpdater(HTMLSelectElement& select) 2031 HTMLSelectElement::PopupUpdater::PopupUpdater(HTMLSelectElement& select)
2032 : m_select(select) 2032 : m_select(select)
2033 { 2033 {
2034 m_observer = MutationObserver::create(this); 2034 m_observer = MutationObserver::create(this);
2035 Vector<String> filter;
2036 filter.reserveCapacity(4);
2037 // Observe only attributes which affect popup content.
2038 filter.append(String("disabled"));
2039 filter.append(String("label"));
2040 filter.append(String("selected"));
2041 filter.append(String("value"));
2035 MutationObserverInit init; 2042 MutationObserverInit init;
2036 init.setAttributes(true); 2043 init.setAttributes(true);
2044 init.setAttributeFilter(filter);
2037 init.setCharacterData(true); 2045 init.setCharacterData(true);
2038 init.setChildList(true); 2046 init.setChildList(true);
2039 init.setSubtree(true); 2047 init.setSubtree(true);
2040 m_observer->observe(&select, init, ASSERT_NO_EXCEPTION); 2048 m_observer->observe(&select, init, ASSERT_NO_EXCEPTION);
2041 } 2049 }
2042 2050
2043 DEFINE_TRACE(HTMLSelectElement::PopupUpdater) 2051 DEFINE_TRACE(HTMLSelectElement::PopupUpdater)
2044 { 2052 {
2045 visitor->trace(m_select); 2053 visitor->trace(m_select);
2046 visitor->trace(m_observer); 2054 visitor->trace(m_observer);
(...skipping 15 matching lines...) Expand all
2062 } 2070 }
2063 2071
2064 void HTMLSelectElement::didMutateSubtree() 2072 void HTMLSelectElement::didMutateSubtree()
2065 { 2073 {
2066 DCHECK(popupIsVisible()); 2074 DCHECK(popupIsVisible());
2067 DCHECK(m_popup); 2075 DCHECK(m_popup);
2068 m_popup->updateFromElement(PopupMenu::ByDOMChange); 2076 m_popup->updateFromElement(PopupMenu::ByDOMChange);
2069 } 2077 }
2070 2078
2071 } // namespace blink 2079 } // 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