| Index: Source/core/html/HTMLSourceElement.h
|
| diff --git a/Source/core/html/HTMLSourceElement.h b/Source/core/html/HTMLSourceElement.h
|
| index 339c12a99af11064554671698340eb12d8e6fb4a..30a5b49639db62b04ea1851c5e8485308ee432a0 100644
|
| --- a/Source/core/html/HTMLSourceElement.h
|
| +++ b/Source/core/html/HTMLSourceElement.h
|
| @@ -26,6 +26,7 @@
|
| #ifndef HTMLSourceElement_h
|
| #define HTMLSourceElement_h
|
|
|
| +#include "core/css/MediaQueryListListener.h"
|
| #include "core/html/HTMLElement.h"
|
| #include "platform/Timer.h"
|
|
|
| @@ -36,6 +37,20 @@ typedef EventSender<HTMLSourceElement> SourceEventSender;
|
|
|
| class HTMLSourceElement FINAL : public HTMLElement {
|
| public:
|
| + class Listener : public MediaQueryListListener {
|
| + public:
|
| + explicit Listener(HTMLSourceElement* element) : m_element(element) { }
|
| + virtual void call() OVERRIDE
|
| + {
|
| + if (m_element)
|
| + m_element->notifyMediaQueryChanged();
|
| + }
|
| +
|
| + void clearElement() { m_element = nullptr; }
|
| + private:
|
| + HTMLSourceElement* m_element;
|
| + };
|
| +
|
| DECLARE_NODE_FACTORY(HTMLSourceElement);
|
| virtual ~HTMLSourceElement();
|
|
|
| @@ -48,6 +63,8 @@ public:
|
|
|
| void dispatchPendingEvent(SourceEventSender*);
|
|
|
| + bool mediaQueryMatches() const;
|
| +
|
| private:
|
| explicit HTMLSourceElement(Document&);
|
|
|
| @@ -55,6 +72,11 @@ private:
|
| virtual void removedFrom(ContainerNode*) OVERRIDE;
|
| virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
|
| virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
|
| +
|
| + void notifyMediaQueryChanged();
|
| +
|
| + RefPtrWillBeRawPtr<MediaQueryList> m_mediaQueryList;
|
| + RefPtrWillBeRawPtr<Listener> m_listener;
|
| };
|
|
|
| } // namespace WebCore
|
|
|