| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 void MediaQueryList::removeListener(PassRefPtrWillBeRawPtr<MediaQueryListListene
r> listener) | 59 void MediaQueryList::removeListener(PassRefPtrWillBeRawPtr<MediaQueryListListene
r> listener) |
| 60 { | 60 { |
| 61 if (!listener) | 61 if (!listener) |
| 62 return; | 62 return; |
| 63 | 63 |
| 64 m_matcher->removeListener(listener.get(), this); | 64 m_matcher->removeListener(listener.get(), this); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void MediaQueryList::evaluate(MediaQueryEvaluator* evaluator, bool& notification
Needed) | 67 bool MediaQueryList::evaluate(MediaQueryEvaluator* evaluator) |
| 68 { | 68 { |
| 69 if (m_evaluationRound != m_matcher->evaluationRound() && evaluator) | 69 if (m_evaluationRound != m_matcher->evaluationRound() && evaluator) |
| 70 setMatches(evaluator->eval(m_media.get())); | 70 setMatches(evaluator->eval(m_media.get())); |
| 71 notificationNeeded = m_changeRound == m_matcher->evaluationRound(); | 71 return m_changeRound == m_matcher->evaluationRound(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void MediaQueryList::setMatches(bool newValue) | 74 void MediaQueryList::setMatches(bool newValue) |
| 75 { | 75 { |
| 76 m_evaluationRound = m_matcher->evaluationRound(); | 76 m_evaluationRound = m_matcher->evaluationRound(); |
| 77 | 77 |
| 78 if (newValue == m_matches) | 78 if (newValue == m_matches) |
| 79 return; | 79 return; |
| 80 | 80 |
| 81 m_matches = newValue; | 81 m_matches = newValue; |
| 82 m_changeRound = m_evaluationRound; | 82 m_changeRound = m_evaluationRound; |
| 83 } | 83 } |
| 84 | 84 |
| 85 bool MediaQueryList::matches() | 85 bool MediaQueryList::matches() |
| 86 { | 86 { |
| 87 if (m_evaluationRound != m_matcher->evaluationRound()) | 87 if (m_evaluationRound != m_matcher->evaluationRound()) |
| 88 setMatches(m_matcher->evaluate(m_media.get())); | 88 setMatches(m_matcher->evaluate(m_media.get())); |
| 89 return m_matches; | 89 return m_matches; |
| 90 } | 90 } |
| 91 | 91 |
| 92 void MediaQueryList::trace(Visitor* visitor) | 92 void MediaQueryList::trace(Visitor* visitor) |
| 93 { | 93 { |
| 94 visitor->trace(m_matcher); | 94 visitor->trace(m_matcher); |
| 95 visitor->trace(m_media); | 95 visitor->trace(m_media); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } | 98 } |
| OLD | NEW |