| 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 26 matching lines...) Expand all Loading... |
| 37 class MediaQueryMatcher; | 37 class MediaQueryMatcher; |
| 38 class MediaQuerySet; | 38 class MediaQuerySet; |
| 39 | 39 |
| 40 // MediaQueryList interface is specified at http://dev.w3.org/csswg/cssom-view/#
the-mediaquerylist-interface | 40 // MediaQueryList interface is specified at http://dev.w3.org/csswg/cssom-view/#
the-mediaquerylist-interface |
| 41 // The objects of this class are returned by window.matchMedia. They may be used
to | 41 // The objects of this class are returned by window.matchMedia. They may be used
to |
| 42 // retrieve the current value of the given media query and to add/remove listene
rs that | 42 // retrieve the current value of the given media query and to add/remove listene
rs that |
| 43 // will be called whenever the value of the query changes. | 43 // will be called whenever the value of the query changes. |
| 44 | 44 |
| 45 class MediaQueryList FINAL : public RefCountedWillBeGarbageCollectedFinalized<Me
diaQueryList>, public EventTargetWithInlineData, public ActiveDOMObject { | 45 class MediaQueryList FINAL : public RefCountedWillBeGarbageCollectedFinalized<Me
diaQueryList>, public EventTargetWithInlineData, public ActiveDOMObject { |
| 46 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCounted<MediaQueryList>); | 46 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCounted<MediaQueryList>); |
| 47 DEFINE_WRAPPERTYPEINFO(); |
| 47 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaQueryList); | 48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaQueryList); |
| 48 public: | 49 public: |
| 49 static PassRefPtrWillBeRawPtr<MediaQueryList> create(ExecutionContext*, Pass
RefPtrWillBeRawPtr<MediaQueryMatcher>, PassRefPtrWillBeRawPtr<MediaQuerySet>); | 50 static PassRefPtrWillBeRawPtr<MediaQueryList> create(ExecutionContext*, Pass
RefPtrWillBeRawPtr<MediaQueryMatcher>, PassRefPtrWillBeRawPtr<MediaQuerySet>); |
| 50 virtual ~MediaQueryList(); | 51 virtual ~MediaQueryList(); |
| 51 | 52 |
| 52 String media() const; | 53 String media() const; |
| 53 bool matches(); | 54 bool matches(); |
| 54 | 55 |
| 55 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); | 56 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); |
| 56 | 57 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 81 bool updateMatches(); | 82 bool updateMatches(); |
| 82 | 83 |
| 83 RefPtrWillBeMember<MediaQueryMatcher> m_matcher; | 84 RefPtrWillBeMember<MediaQueryMatcher> m_matcher; |
| 84 RefPtrWillBeMember<MediaQuerySet> m_media; | 85 RefPtrWillBeMember<MediaQuerySet> m_media; |
| 85 typedef WillBeHeapListHashSet<RefPtrWillBeMember<MediaQueryListListener> > L
istenerList; | 86 typedef WillBeHeapListHashSet<RefPtrWillBeMember<MediaQueryListListener> > L
istenerList; |
| 86 ListenerList m_listeners; | 87 ListenerList m_listeners; |
| 87 bool m_matchesDirty; | 88 bool m_matchesDirty; |
| 88 bool m_matches; | 89 bool m_matches; |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 } | 92 } // namespace blink |
| 92 | 93 |
| 93 #endif // MediaQueryList_h | 94 #endif // MediaQueryList_h |
| OLD | NEW |