| OLD | NEW |
| 1 /* | 1 /* |
| 2 * CSS Media Query | 2 * CSS Media Query |
| 3 * | 3 * |
| 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. | 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. |
| 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include <utility> | 38 #include <utility> |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 class MediaQueryExp; | 41 class MediaQueryExp; |
| 42 | 42 |
| 43 using ExpressionHeapVector = WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp>>
; | 43 using ExpressionHeapVector = WillBeHeapVector<OwnPtrWillBeMember<MediaQueryExp>>
; |
| 44 | 44 |
| 45 class CORE_EXPORT MediaQuery : public NoBaseWillBeGarbageCollectedFinalized<Medi
aQuery> { | 45 class CORE_EXPORT MediaQuery : public NoBaseWillBeGarbageCollectedFinalized<Medi
aQuery> { |
| 46 USING_FAST_MALLOC_WILL_BE_REMOVED(MediaQuery); | 46 USING_FAST_MALLOC_WILL_BE_REMOVED(MediaQuery); |
| 47 public: | 47 public: |
| 48 enum Restrictor { | 48 enum RestrictorType { |
| 49 Only, Not, None | 49 Only, Not, None |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 static PassOwnPtrWillBeRawPtr<MediaQuery> create(Restrictor, String mediaTyp
e, ExpressionHeapVector); | 52 static PassOwnPtrWillBeRawPtr<MediaQuery> create(RestrictorType, String medi
aType, ExpressionHeapVector); |
| 53 static PassOwnPtrWillBeRawPtr<MediaQuery> createNotAll(); | 53 static PassOwnPtrWillBeRawPtr<MediaQuery> createNotAll(); |
| 54 | 54 |
| 55 ~MediaQuery(); | 55 ~MediaQuery(); |
| 56 | 56 |
| 57 Restrictor restrictor() const { return m_restrictor; } | 57 RestrictorType restrictor() const { return m_restrictor; } |
| 58 const ExpressionHeapVector& expressions() const { return m_expressions; } | 58 const ExpressionHeapVector& expressions() const { return m_expressions; } |
| 59 const String& mediaType() const { return m_mediaType; } | 59 const String& mediaType() const { return m_mediaType; } |
| 60 bool operator==(const MediaQuery& other) const; | 60 bool operator==(const MediaQuery& other) const; |
| 61 String cssText() const; | 61 String cssText() const; |
| 62 | 62 |
| 63 PassOwnPtrWillBeRawPtr<MediaQuery> copy() const { return adoptPtrWillBeNoop(
new MediaQuery(*this)); } | 63 PassOwnPtrWillBeRawPtr<MediaQuery> copy() const { return adoptPtrWillBeNoop(
new MediaQuery(*this)); } |
| 64 | 64 |
| 65 DECLARE_TRACE(); | 65 DECLARE_TRACE(); |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 MediaQuery(Restrictor, String mediaType, ExpressionHeapVector); | 68 MediaQuery(RestrictorType, String mediaType, ExpressionHeapVector); |
| 69 MediaQuery(const MediaQuery&); | 69 MediaQuery(const MediaQuery&); |
| 70 | 70 |
| 71 MediaQuery& operator=(const MediaQuery&) = delete; | 71 MediaQuery& operator=(const MediaQuery&) = delete; |
| 72 | 72 |
| 73 Restrictor m_restrictor; | 73 RestrictorType m_restrictor; |
| 74 String m_mediaType; | 74 String m_mediaType; |
| 75 ExpressionHeapVector m_expressions; | 75 ExpressionHeapVector m_expressions; |
| 76 String m_serializationCache; | 76 String m_serializationCache; |
| 77 | 77 |
| 78 String serialize() const; | 78 String serialize() const; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace blink | 81 } // namespace blink |
| 82 | 82 |
| 83 #endif | 83 #endif |
| OLD | NEW |