| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 if (!m_document) | 112 if (!m_document) |
| 113 return; | 113 return; |
| 114 m_viewportListeners.remove(listener); | 114 m_viewportListeners.remove(listener); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void MediaQueryMatcher::mediaFeaturesChanged() | 117 void MediaQueryMatcher::mediaFeaturesChanged() |
| 118 { | 118 { |
| 119 if (!m_document) | 119 if (!m_document) |
| 120 return; | 120 return; |
| 121 | 121 |
| 122 WillBeHeapVector<RefPtrWillBeMember<MediaQueryListListener> > listenersToNot
ify; | 122 WillBeHeapVector<RefPtrWillBeMember<MediaQueryListListener>> listenersToNoti
fy; |
| 123 for (const auto& list : m_mediaLists) { | 123 for (const auto& list : m_mediaLists) { |
| 124 if (list->mediaFeaturesChanged(&listenersToNotify)) { | 124 if (list->mediaFeaturesChanged(&listenersToNotify)) { |
| 125 RefPtrWillBeRawPtr<Event> event(MediaQueryListEvent::create(list)); | 125 RefPtrWillBeRawPtr<Event> event(MediaQueryListEvent::create(list)); |
| 126 event->setTarget(list); | 126 event->setTarget(list); |
| 127 m_document->enqueueUniqueAnimationFrameEvent(event); | 127 m_document->enqueueUniqueAnimationFrameEvent(event); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 m_document->enqueueMediaQueryChangeListeners(listenersToNotify); | 130 m_document->enqueueMediaQueryChangeListeners(listenersToNotify); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void MediaQueryMatcher::viewportChanged() | 133 void MediaQueryMatcher::viewportChanged() |
| 134 { | 134 { |
| 135 if (!m_document) | 135 if (!m_document) |
| 136 return; | 136 return; |
| 137 | 137 |
| 138 WillBeHeapVector<RefPtrWillBeMember<MediaQueryListListener> > listenersToNot
ify; | 138 WillBeHeapVector<RefPtrWillBeMember<MediaQueryListListener>> listenersToNoti
fy; |
| 139 for (const auto& listener : m_viewportListeners) | 139 for (const auto& listener : m_viewportListeners) |
| 140 listenersToNotify.append(listener); | 140 listenersToNotify.append(listener); |
| 141 | 141 |
| 142 m_document->enqueueMediaQueryChangeListeners(listenersToNotify); | 142 m_document->enqueueMediaQueryChangeListeners(listenersToNotify); |
| 143 } | 143 } |
| 144 | 144 |
| 145 DEFINE_TRACE(MediaQueryMatcher) | 145 DEFINE_TRACE(MediaQueryMatcher) |
| 146 { | 146 { |
| 147 #if ENABLE(OILPAN) | 147 #if ENABLE(OILPAN) |
| 148 visitor->trace(m_document); | 148 visitor->trace(m_document); |
| 149 visitor->trace(m_mediaLists); | 149 visitor->trace(m_mediaLists); |
| 150 visitor->trace(m_viewportListeners); | 150 visitor->trace(m_viewportListeners); |
| 151 #endif | 151 #endif |
| 152 } | 152 } |
| 153 | 153 |
| 154 } | 154 } |
| OLD | NEW |