| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #ifndef HTMLSourceElement_h | 26 #ifndef HTMLSourceElement_h |
| 27 #define HTMLSourceElement_h | 27 #define HTMLSourceElement_h |
| 28 | 28 |
| 29 #include "core/css/MediaQueryListListener.h" | 29 #include "core/css/MediaQueryListListener.h" |
| 30 #include "core/html/HTMLElement.h" | 30 #include "core/html/HTMLElement.h" |
| 31 #include "platform/Timer.h" | 31 #include "platform/Timer.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 template <typename T> | |
| 36 class EventSender; | |
| 37 using SourceEventSender = EventSender<HTMLSourceElement>; | |
| 38 | |
| 39 class HTMLSourceElement final : public HTMLElement { | 35 class HTMLSourceElement final : public HTMLElement { |
| 40 DEFINE_WRAPPERTYPEINFO(); | 36 DEFINE_WRAPPERTYPEINFO(); |
| 41 | 37 |
| 42 public: | 38 public: |
| 43 class Listener; | 39 class Listener; |
| 44 | 40 |
| 45 DECLARE_NODE_FACTORY(HTMLSourceElement); | 41 DECLARE_NODE_FACTORY(HTMLSourceElement); |
| 46 ~HTMLSourceElement() override; | 42 ~HTMLSourceElement() override; |
| 47 | 43 |
| 48 const AtomicString& type() const; | 44 const AtomicString& type() const; |
| 49 void setSrc(const String&); | 45 void setSrc(const String&); |
| 50 void setType(const AtomicString&); | 46 void setType(const AtomicString&); |
| 51 | 47 |
| 52 void scheduleErrorEvent(); | 48 void scheduleErrorEvent(); |
| 53 void cancelPendingErrorEvent(); | 49 void cancelPendingErrorEvent(); |
| 54 | 50 |
| 55 void dispatchPendingEvent(SourceEventSender*); | |
| 56 | |
| 57 bool mediaQueryMatches() const; | 51 bool mediaQueryMatches() const; |
| 58 | 52 |
| 59 void removeMediaQueryListListener(); | 53 void removeMediaQueryListListener(); |
| 60 void addMediaQueryListListener(); | 54 void addMediaQueryListListener(); |
| 61 | 55 |
| 62 DECLARE_VIRTUAL_TRACE(); | 56 DECLARE_VIRTUAL_TRACE(); |
| 63 | 57 |
| 64 private: | 58 private: |
| 65 explicit HTMLSourceElement(Document&); | 59 explicit HTMLSourceElement(Document&); |
| 66 | 60 |
| 61 void dispatchPendingEvent(); |
| 62 |
| 67 void didMoveToNewDocument(Document& oldDocument) override; | 63 void didMoveToNewDocument(Document& oldDocument) override; |
| 68 | 64 |
| 69 InsertionNotificationRequest insertedInto(ContainerNode*) override; | 65 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 70 void removedFrom(ContainerNode*) override; | 66 void removedFrom(ContainerNode*) override; |
| 71 bool isURLAttribute(const Attribute&) const override; | 67 bool isURLAttribute(const Attribute&) const override; |
| 72 void parseAttribute(const QualifiedName&, | 68 void parseAttribute(const QualifiedName&, |
| 73 const AtomicString&, | 69 const AtomicString&, |
| 74 const AtomicString&) override; | 70 const AtomicString&) override; |
| 75 | 71 |
| 76 void notifyMediaQueryChanged(); | 72 void notifyMediaQueryChanged(); |
| 77 void createMediaQueryList(const AtomicString& media); | 73 void createMediaQueryList(const AtomicString& media); |
| 78 | 74 |
| 79 Member<MediaQueryList> m_mediaQueryList; | 75 Member<MediaQueryList> m_mediaQueryList; |
| 80 Member<Listener> m_listener; | 76 Member<Listener> m_listener; |
| 77 TaskHandle m_pendingErrorEvent; |
| 81 }; | 78 }; |
| 82 | 79 |
| 83 } // namespace blink | 80 } // namespace blink |
| 84 | 81 |
| 85 #endif // HTMLSourceElement_h | 82 #endif // HTMLSourceElement_h |
| OLD | NEW |