class EventNames {
int dummy; // Needed to make initialization macro work.
-
- public:
+ // Private to prevent accidental call to EventNames() instead of eventNames()
EventNames();
+ friend class ThreadGlobalData;
+ public:
#define DOM_EVENT_NAMES_DECLARE(name) AtomicString name##Event;
DOM_EVENT_NAMES_FOR_EACH(DOM_EVENT_NAMES_DECLARE)
#undef DOM_EVENT_NAMES_DECLARE
// matches pageshowEvent as in Document::implicitClose()
m_document->dispatchWindowLoadEvent();
#endif
- m_document->dispatchWindowEvent(PageTransitionEvent::create(EventNames().pageshowEvent, true), m_document);
+ m_document->dispatchWindowEvent(PageTransitionEvent::create(eventNames().pageshowEvent, true), m_document);
}
CachedFrame::CachedFrame(Frame* frame)
bool HTMLFormControlElement::checkValidity()
{
if (willValidate() && !isValidFormControlElement()) {
- dispatchEvent(Event::create(EventNames().invalidEvent, false, true));
+ dispatchEvent(Event::create(eventNames().invalidEvent, false, true));
return false;
}
m_unloadEventBeingDispatched = true;
if (m_frame->domWindow()) {
if (unloadEventPolicy == UnloadEventPolicyUnloadAndPageHide)
- m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(EventNames().pagehideEvent, m_frame->document()->inPageCache()), m_frame->document());
+ m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, m_frame->document()->inPageCache()), m_frame->document());
#ifndef ANDROID_PAGE_CACHE_UNLOAD
if (!m_frame->document()->inPageCache())
#endif
{
m_unloadEventBeingDispatched = true;
if (m_frame->domWindow())
- m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(EventNames().pagehideEvent, true), m_frame->document());
+ m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, true), m_frame->document());
m_unloadEventBeingDispatched = false;
// Send pagehide event for subframes as well
if (!set.contains(window))
continue;
- window->dispatchEvent(PageTransitionEvent::create(EventNames().pagehideEvent, false), window->document());
+ window->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, false), window->document());
window->dispatchEvent(Event::create(eventNames().unloadEvent, false, false), window->document());
}