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 30 matching lines...) Expand all Loading... |
41 return view->mediaType(); | 41 return view->mediaType(); |
42 | 42 |
43 return nullAtom; | 43 return nullAtom; |
44 } | 44 } |
45 | 45 |
46 bool StyleMedia::matchMedium(const String& query) const { | 46 bool StyleMedia::matchMedium(const String& query) const { |
47 if (!frame()) | 47 if (!frame()) |
48 return false; | 48 return false; |
49 | 49 |
50 Document* document = frame()->document(); | 50 Document* document = frame()->document(); |
51 ASSERT(document); | 51 DCHECK(document); |
52 Element* documentElement = document->documentElement(); | 52 Element* documentElement = document->documentElement(); |
53 if (!documentElement) | 53 if (!documentElement) |
54 return false; | 54 return false; |
55 | 55 |
56 MediaQuerySet* media = MediaQuerySet::create(); | 56 MediaQuerySet* media = MediaQuerySet::create(); |
57 if (!media->set(query)) | 57 if (!media->set(query)) |
58 return false; | 58 return false; |
59 | 59 |
60 MediaQueryEvaluator screenEval(frame()); | 60 MediaQueryEvaluator screenEval(frame()); |
61 return screenEval.eval(media); | 61 return screenEval.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 |