OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 bool StyleMedia::matchMedium(const String& query) const { | 46 bool StyleMedia::matchMedium(const String& query) const { |
47 if (!GetFrame()) | 47 if (!GetFrame()) |
48 return false; | 48 return false; |
49 | 49 |
50 Document* document = GetFrame()->GetDocument(); | 50 Document* document = GetFrame()->GetDocument(); |
51 DCHECK(document); | 51 DCHECK(document); |
52 Element* document_element = document->documentElement(); | 52 Element* document_element = document->documentElement(); |
53 if (!document_element) | 53 if (!document_element) |
54 return false; | 54 return false; |
55 | 55 |
56 MediaQuerySet* media = MediaQuerySet::Create(); | 56 RefPtr<MediaQuerySet> media = MediaQuerySet::Create(); |
57 if (!media->Set(query)) | 57 if (!media->Set(query)) |
58 return false; | 58 return false; |
59 | 59 |
60 MediaQueryEvaluator screen_eval(GetFrame()); | 60 MediaQueryEvaluator screen_eval(GetFrame()); |
61 return screen_eval.Eval(media); | 61 return screen_eval.Eval(*media); |
62 } | 62 } |
63 | 63 |
64 DEFINE_TRACE(StyleMedia) { | 64 DEFINE_TRACE(StyleMedia) { |
65 ContextClient::Trace(visitor); | 65 ContextClient::Trace(visitor); |
66 } | 66 } |
67 | 67 |
68 } // namespace blink | 68 } // namespace blink |
OLD | NEW |