OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2010 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 HTMLSourceElement::~HTMLSourceElement() {} | 69 HTMLSourceElement::~HTMLSourceElement() {} |
70 | 70 |
71 void HTMLSourceElement::createMediaQueryList(const AtomicString& media) { | 71 void HTMLSourceElement::createMediaQueryList(const AtomicString& media) { |
72 removeMediaQueryListListener(); | 72 removeMediaQueryListListener(); |
73 if (media.isEmpty()) { | 73 if (media.isEmpty()) { |
74 m_mediaQueryList = nullptr; | 74 m_mediaQueryList = nullptr; |
75 return; | 75 return; |
76 } | 76 } |
77 | 77 |
78 MediaQuerySet* set = MediaQuerySet::create(media); | 78 RefPtr<MediaQuerySet> set = MediaQuerySet::create(media); |
79 m_mediaQueryList = | 79 m_mediaQueryList = |
80 MediaQueryList::create(&document(), &document().mediaQueryMatcher(), set); | 80 MediaQueryList::create(&document(), &document().mediaQueryMatcher(), set); |
81 addMediaQueryListListener(); | 81 addMediaQueryListListener(); |
82 } | 82 } |
83 | 83 |
84 void HTMLSourceElement::didMoveToNewDocument(Document& oldDocument) { | 84 void HTMLSourceElement::didMoveToNewDocument(Document& oldDocument) { |
85 createMediaQueryList(fastGetAttribute(mediaAttr)); | 85 createMediaQueryList(fastGetAttribute(mediaAttr)); |
86 HTMLElement::didMoveToNewDocument(oldDocument); | 86 HTMLElement::didMoveToNewDocument(oldDocument); |
87 } | 87 } |
88 | 88 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 toHTMLPictureElement(parent)->sourceOrMediaChanged(); | 184 toHTMLPictureElement(parent)->sourceOrMediaChanged(); |
185 } | 185 } |
186 | 186 |
187 DEFINE_TRACE(HTMLSourceElement) { | 187 DEFINE_TRACE(HTMLSourceElement) { |
188 visitor->trace(m_mediaQueryList); | 188 visitor->trace(m_mediaQueryList); |
189 visitor->trace(m_listener); | 189 visitor->trace(m_listener); |
190 HTMLElement::trace(visitor); | 190 HTMLElement::trace(visitor); |
191 } | 191 } |
192 | 192 |
193 } // namespace blink | 193 } // namespace blink |
OLD | NEW |