Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Unified Diff: Source/core/css/MediaQueryListEvent.h

Issue 799733002: Use event init dictionaries in core/{css,html} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/MediaQueryListEvent.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaQueryListEvent.h
diff --git a/Source/core/css/MediaQueryListEvent.h b/Source/core/css/MediaQueryListEvent.h
index f5786bf246142f13e0829633ac2c0f5f610d83cd..ed185059cf95d5d8af7aee734f5cc48e08f3e5b8 100644
--- a/Source/core/css/MediaQueryListEvent.h
+++ b/Source/core/css/MediaQueryListEvent.h
@@ -6,17 +6,11 @@
#define MediaQueryListEvent_h
#include "core/css/MediaQueryList.h"
+#include "core/css/MediaQueryListEventInit.h"
#include "core/events/Event.h"
namespace blink {
-struct MediaQueryListEventInit : public EventInit {
- MediaQueryListEventInit() : matches(false) { }
-
- String media;
- bool matches;
-};
-
class MediaQueryListEvent final : public Event {
DEFINE_WRAPPERTYPEINFO();
public:
@@ -67,8 +61,13 @@ private:
MediaQueryListEvent(const AtomicString& eventType, const MediaQueryListEventInit& initializer)
: Event(eventType, initializer)
- , m_media(initializer.media)
- , m_matches(initializer.matches) { }
+ , m_matches(false)
+ {
+ if (initializer.hasMedia())
+ m_media = initializer.media();
+ if (initializer.hasMatches())
+ m_matches = initializer.matches();
+ }
// We have m_media/m_matches for JS-created events; we use m_mediaQueryList
// for events that blink generates.
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/css/MediaQueryListEvent.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698