| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute)
; | 154 return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute)
; |
| 155 } | 155 } |
| 156 | 156 |
| 157 void HTMLSourceElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) | 157 void HTMLSourceElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) |
| 158 { | 158 { |
| 159 HTMLElement::parseAttribute(name, value); | 159 HTMLElement::parseAttribute(name, value); |
| 160 if (name == mediaAttr) { | 160 if (name == mediaAttr) { |
| 161 if (m_mediaQueryList) | 161 if (m_mediaQueryList) |
| 162 m_mediaQueryList->removeListener(m_listener); | 162 m_mediaQueryList->removeListener(m_listener); |
| 163 RefPtrWillBeRawPtr<MediaQuerySet> set = MediaQuerySet::create(value); | 163 RefPtrWillBeRawPtr<MediaQuerySet> set = MediaQuerySet::create(value); |
| 164 m_mediaQueryList = MediaQueryList::create(&document().mediaQueryMatcher(
), set.release()); | 164 m_mediaQueryList = MediaQueryList::create(&document(), &document().media
QueryMatcher(), set.release()); |
| 165 m_mediaQueryList->addListener(m_listener); | 165 m_mediaQueryList->addListener(m_listener); |
| 166 } | 166 } |
| 167 if (name == srcsetAttr || name == sizesAttr || name == mediaAttr || name ==
typeAttr) { | 167 if (name == srcsetAttr || name == sizesAttr || name == mediaAttr || name ==
typeAttr) { |
| 168 Element* parent = parentElement(); | 168 Element* parent = parentElement(); |
| 169 if (isHTMLPictureElement(parent)) | 169 if (isHTMLPictureElement(parent)) |
| 170 toHTMLPictureElement(parent)->sourceOrMediaChanged(); | 170 toHTMLPictureElement(parent)->sourceOrMediaChanged(); |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 void HTMLSourceElement::notifyMediaQueryChanged() | 174 void HTMLSourceElement::notifyMediaQueryChanged() |
| 175 { | 175 { |
| 176 Element* parent = parentElement(); | 176 Element* parent = parentElement(); |
| 177 if (isHTMLPictureElement(parent)) | 177 if (isHTMLPictureElement(parent)) |
| 178 toHTMLPictureElement(parent)->sourceOrMediaChanged(); | 178 toHTMLPictureElement(parent)->sourceOrMediaChanged(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void HTMLSourceElement::trace(Visitor* visitor) | 181 void HTMLSourceElement::trace(Visitor* visitor) |
| 182 { | 182 { |
| 183 visitor->trace(m_mediaQueryList); | 183 visitor->trace(m_mediaQueryList); |
| 184 visitor->trace(m_listener); | 184 visitor->trace(m_listener); |
| 185 HTMLElement::trace(visitor); | 185 HTMLElement::trace(visitor); |
| 186 } | 186 } |
| 187 | 187 |
| 188 } | 188 } |
| OLD | NEW |