| 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #include "config.h" | 20 #include "config.h" |
| 21 #include "core/css/MediaQueryList.h" | 21 #include "core/css/MediaQueryList.h" |
| 22 | 22 |
| 23 #include "core/css/MediaList.h" | 23 #include "core/css/MediaList.h" |
| 24 #include "core/css/MediaQueryEvaluator.h" | 24 #include "core/css/MediaQueryEvaluator.h" |
| 25 #include "core/css/MediaQueryListListener.h" | 25 #include "core/css/MediaQueryListListener.h" |
| 26 #include "core/css/MediaQueryMatcher.h" | 26 #include "core/css/MediaQueryMatcher.h" |
| 27 | 27 |
| 28 namespace WebCore { | 28 namespace WebCore { |
| 29 | 29 |
| 30 PassRefPtr<MediaQueryList> MediaQueryList::create(PassRefPtr<MediaQueryMatcher>
vector, PassRefPtr<MediaQuerySet> media, bool matches) | 30 PassRefPtr<MediaQueryList> MediaQueryList::create(PassRefPtr<MediaQueryMatcher>
vector, PassRefPtrWillBeRawPtr<MediaQuerySet> media, bool matches) |
| 31 { | 31 { |
| 32 return adoptRef(new MediaQueryList(vector, media, matches)); | 32 return adoptRef(new MediaQueryList(vector, media, matches)); |
| 33 } | 33 } |
| 34 | 34 |
| 35 MediaQueryList::MediaQueryList(PassRefPtr<MediaQueryMatcher> vector, PassRefPtr<
MediaQuerySet> media, bool matches) | 35 MediaQueryList::MediaQueryList(PassRefPtr<MediaQueryMatcher> vector, PassRefPtrW
illBeRawPtr<MediaQuerySet> media, bool matches) |
| 36 : m_matcher(vector) | 36 : m_matcher(vector) |
| 37 , m_media(media) | 37 , m_media(media) |
| 38 , m_evaluationRound(m_matcher->evaluationRound()) | 38 , m_evaluationRound(m_matcher->evaluationRound()) |
| 39 , m_changeRound(m_evaluationRound - 1) // m_evaluationRound and m_changeRoun
d initial values must be different. | 39 , m_changeRound(m_evaluationRound - 1) // m_evaluationRound and m_changeRoun
d initial values must be different. |
| 40 , m_matches(matches) | 40 , m_matches(matches) |
| 41 { | 41 { |
| 42 } | 42 } |
| 43 | 43 |
| 44 MediaQueryList::~MediaQueryList() | 44 MediaQueryList::~MediaQueryList() |
| 45 { | 45 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 bool MediaQueryList::matches() | 87 bool MediaQueryList::matches() |
| 88 { | 88 { |
| 89 if (m_evaluationRound != m_matcher->evaluationRound()) | 89 if (m_evaluationRound != m_matcher->evaluationRound()) |
| 90 setMatches(m_matcher->evaluate(m_media.get())); | 90 setMatches(m_matcher->evaluate(m_media.get())); |
| 91 return m_matches; | 91 return m_matches; |
| 92 } | 92 } |
| 93 | 93 |
| 94 } | 94 } |
| OLD | NEW |