| 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 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 RefPtrWillBeRawPtr<MediaQueryList> protect(this); | 96 RefPtrWillBeRawPtr<MediaQueryList> protect(this); |
| 97 m_listeners.clear(); | 97 m_listeners.clear(); |
| 98 removeAllEventListeners(); | 98 removeAllEventListeners(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool MediaQueryList::mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<Me
diaQueryListListener> >* listenersToNotify) | 101 bool MediaQueryList::mediaFeaturesChanged(WillBeHeapVector<RefPtrWillBeMember<Me
diaQueryListListener> >* listenersToNotify) |
| 102 { | 102 { |
| 103 m_matchesDirty = true; | 103 m_matchesDirty = true; |
| 104 if (!updateMatches()) | 104 if (!updateMatches()) |
| 105 return false; | 105 return false; |
| 106 for (ListenerList::const_iterator it = m_listeners.begin(), end = m_listener
s.end(); it != end; ++it) { | 106 for (const auto& listener : m_listeners) { |
| 107 listenersToNotify->append(*it); | 107 listenersToNotify->append(listener); |
| 108 } | 108 } |
| 109 return hasEventListeners(EventTypeNames::change); | 109 return hasEventListeners(EventTypeNames::change); |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool MediaQueryList::updateMatches() | 112 bool MediaQueryList::updateMatches() |
| 113 { | 113 { |
| 114 m_matchesDirty = false; | 114 m_matchesDirty = false; |
| 115 if (m_matches != m_matcher->evaluate(m_media.get())) { | 115 if (m_matches != m_matcher->evaluate(m_media.get())) { |
| 116 m_matches = !m_matches; | 116 m_matches = !m_matches; |
| 117 return true; | 117 return true; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 139 { | 139 { |
| 140 return EventTargetNames::MediaQueryList; | 140 return EventTargetNames::MediaQueryList; |
| 141 } | 141 } |
| 142 | 142 |
| 143 ExecutionContext* MediaQueryList::executionContext() const | 143 ExecutionContext* MediaQueryList::executionContext() const |
| 144 { | 144 { |
| 145 return ActiveDOMObject::executionContext(); | 145 return ActiveDOMObject::executionContext(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } | 148 } |
| OLD | NEW |