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

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

Issue 2050923002: Merge "SELECT popup: Fix a crash by DOM mutation during opening popup." to M52 branch. (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 | « third_party/WebKit/LayoutTests/fast/forms/select/menulist-popup-mutation-crash.html ('k') | 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 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/select/menulist-popup-mutation-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698