Reviewed by Darin Adler.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Nov 2008 10:46:13 +0000 (10:46 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Nov 2008 10:46:13 +0000 (10:46 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=22030
        Make EventNames usable from multiple threads

        * platform/text/AtomicString.cpp:
        (WebCore::stringTable):
        (WebCore::AtomicString::add):
        (WebCore::AtomicString::remove):
        (WebCore::AtomicString::find):
        (WebCore::AtomicString::init):
        * platform/text/AtomicString.h:
        Atomic string table is now per-thread. Individual strings cannot be shared between threads,
        so global AtomicString constants cannot be used from threads other than the main one.

        * dom/EventNames.cpp:
        (WebCore::EventNames::EventNames):
        (WebCore::eventNames):
        (WebCore::EventNames::init):
        * dom/EventNames.h:
        Made EventNames a ThreadSpecific struct. Individual event names are now accessed as
        eventNames().fooEvent, not EventNames::fooEvent. This makes EventNames usable from all
        threads.

        * <Many files>: Access event names via eventNames() function.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@38094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

103 files changed:
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/bindings/js/JSDOMWindowBase.cpp
WebCore/bindings/js/JSEventListener.cpp
WebCore/bindings/js/ScriptController.cpp
WebCore/dom/BeforeTextInsertedEvent.cpp
WebCore/dom/BeforeUnloadEvent.cpp
WebCore/dom/CharacterData.cpp
WebCore/dom/ContainerNode.cpp
WebCore/dom/DedicatedWorker.cpp
WebCore/dom/Document.cpp
WebCore/dom/EventNames.cpp
WebCore/dom/EventNames.h
WebCore/dom/EventTargetNode.cpp
WebCore/dom/KeyboardEvent.cpp
WebCore/dom/MessageEvent.cpp
WebCore/dom/MessagePort.cpp
WebCore/dom/MouseEvent.cpp
WebCore/dom/OverflowEvent.cpp
WebCore/dom/TextEvent.cpp
WebCore/dom/WebKitAnimationEvent.cpp
WebCore/dom/WebKitTransitionEvent.cpp
WebCore/dom/WheelEvent.cpp
WebCore/dom/XMLTokenizerLibxml2.cpp
WebCore/dom/XMLTokenizerQt.cpp
WebCore/editing/DeleteButton.cpp
WebCore/editing/EditCommand.cpp
WebCore/editing/Editor.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/editing/SelectionController.cpp
WebCore/html/HTMLAnchorElement.cpp
WebCore/html/HTMLBodyElement.cpp
WebCore/html/HTMLButtonElement.cpp
WebCore/html/HTMLElement.cpp
WebCore/html/HTMLFormControlElement.cpp
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLFrameElementBase.cpp
WebCore/html/HTMLFrameSetElement.cpp
WebCore/html/HTMLImageElement.cpp
WebCore/html/HTMLImageLoader.cpp
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLLabelElement.cpp
WebCore/html/HTMLMediaElement.cpp
WebCore/html/HTMLObjectElement.cpp
WebCore/html/HTMLOptionElement.cpp
WebCore/html/HTMLScriptElement.cpp
WebCore/html/HTMLSelectElement.cpp
WebCore/html/HTMLTextAreaElement.cpp
WebCore/html/HTMLTokenizer.cpp
WebCore/loader/FrameLoader.cpp
WebCore/loader/ImageDocument.cpp
WebCore/loader/ImageLoader.cpp
WebCore/loader/MediaDocument.cpp
WebCore/loader/appcache/DOMApplicationCache.cpp
WebCore/page/AccessibilityObject.cpp
WebCore/page/AccessibilityRenderObject.cpp
WebCore/page/ContextMenuController.cpp
WebCore/page/DOMWindow.cpp
WebCore/page/EventHandler.cpp
WebCore/page/FocusController.cpp
WebCore/page/Frame.cpp
WebCore/page/Page.cpp
WebCore/page/animation/AnimationBase.cpp
WebCore/page/animation/ImplicitAnimation.cpp
WebCore/page/animation/KeyframeAnimation.cpp
WebCore/page/gtk/EventHandlerGtk.cpp
WebCore/page/mac/EventHandlerMac.mm
WebCore/page/mac/FrameMac.mm
WebCore/page/qt/EventHandlerQt.cpp
WebCore/platform/text/AtomicString.cpp
WebCore/platform/text/AtomicString.h
WebCore/plugins/PluginView.cpp
WebCore/plugins/gtk/PluginViewGtk.cpp
WebCore/plugins/qt/PluginViewQt.cpp
WebCore/plugins/win/PluginViewWin.cpp
WebCore/rendering/MediaControlElements.cpp
WebCore/rendering/RenderFrameSet.cpp
WebCore/rendering/RenderLayer.cpp
WebCore/rendering/RenderListBox.cpp
WebCore/rendering/RenderMedia.cpp
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderSlider.cpp
WebCore/rendering/RenderTextControl.cpp
WebCore/rendering/RenderWidget.cpp
WebCore/rendering/TextControlInnerElements.cpp
WebCore/storage/LocalStorageArea.cpp
WebCore/storage/SessionStorageArea.cpp
WebCore/svg/SVGAElement.cpp
WebCore/svg/SVGDocument.cpp
WebCore/svg/SVGElement.cpp
WebCore/svg/SVGElementInstance.cpp
WebCore/svg/SVGImageLoader.cpp
WebCore/svg/SVGSVGElement.cpp
WebCore/svg/SVGScriptElement.cpp
WebCore/xml/XMLHttpRequest.cpp
WebCore/xml/XMLHttpRequestUpload.cpp
WebCore/xml/XPathResult.cpp
WebKit/mac/ChangeLog
WebKit/mac/Configurations/WebKit.xcconfig
WebKit/mac/WebView/WebHTMLView.mm
WebKit/mac/WebView/WebPDFView.mm
WebKit/win/ChangeLog
WebKit/win/WebView.cpp

index 4b7cee5..d9383fe 100644 (file)
@@ -1,3 +1,316 @@
+2008-11-01  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22030
+        Make EventNames usable from multiple threads
+
+        * platform/text/AtomicString.cpp:
+        (WebCore::stringTable):
+        (WebCore::AtomicString::add):
+        (WebCore::AtomicString::remove):
+        (WebCore::AtomicString::find):
+        (WebCore::AtomicString::init):
+        * platform/text/AtomicString.h:
+        Atomic string table is now per-thread. Individual strings cannot be shared between threads,
+        so global AtomicString constants cannot be used from threads other than the main one.
+
+        * dom/EventNames.cpp:
+        (WebCore::EventNames::EventNames):
+        (WebCore::eventNames):
+        (WebCore::EventNames::init):
+        * dom/EventNames.h:
+        Made EventNames a ThreadSpecific struct. Individual event names are now accessed as
+        eventNames().fooEvent, not EventNames::fooEvent. This makes EventNames usable from all
+        threads.
+
+        * WebCore.base.exp:
+        * bindings/js/JSDOMWindowBase.cpp:
+        * bindings/js/JSEventListener.cpp:
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::processingUserGesture):
+        * dom/BeforeTextInsertedEvent.cpp:
+        (WebCore::BeforeTextInsertedEvent::BeforeTextInsertedEvent):
+        * dom/BeforeUnloadEvent.cpp:
+        (WebCore::BeforeUnloadEvent::BeforeUnloadEvent):
+        * dom/CharacterData.cpp:
+        (WebCore::CharacterData::dispatchModifiedEvent):
+        * dom/ContainerNode.cpp:
+        (WebCore::dispatchChildInsertionEvents):
+        (WebCore::dispatchChildRemovalEvents):
+        * dom/DedicatedWorker.cpp:
+        (WebCore::DedicatedWorker::dispatchErrorEvent):
+        * dom/Document.cpp:
+        (WebCore::Document::implicitClose):
+        (WebCore::Document::setFocusedNode):
+        (WebCore::Document::addListenerTypeIfNeeded):
+        (WebCore::Document::removeWindowInlineEventListenerForType):
+        (WebCore::Document::addWindowEventListener):
+        (WebCore::Document::removeWindowEventListener):
+        (WebCore::Document::finishedParsing):
+        * dom/EventTargetNode.cpp:
+        (WebCore::EventTargetNode::dispatchGenericEvent):
+        (WebCore::EventTargetNode::dispatchSubtreeModifiedEvent):
+        (WebCore::EventTargetNode::dispatchWindowEvent):
+        (WebCore::EventTargetNode::dispatchUIEvent):
+        (WebCore::EventTargetNode::dispatchSimulatedClick):
+        (WebCore::EventTargetNode::dispatchMouseEvent):
+        (WebCore::EventTargetNode::dispatchFocusEvent):
+        (WebCore::EventTargetNode::dispatchBlurEvent):
+        (WebCore::EventTargetNode::defaultEventHandler):
+        (WebCore::EventTargetNode::on*): (multiple methods)
+        (WebCore::EventTargetNode::setOn*): (multiple methods)
+        * dom/KeyboardEvent.cpp:
+        (WebCore::eventTypeForKeyboardEventType):
+        (WebCore::KeyboardEvent::keyCode):
+        (WebCore::KeyboardEvent::charCode):
+        * dom/MessageEvent.cpp:
+        (WebCore::MessageEvent::MessageEvent):
+        * dom/MessagePort.cpp:
+        (WebCore::MessagePort::dispatchMessages):
+        (WebCore::MessagePort::dispatchCloseEvent):
+        * dom/MouseEvent.cpp:
+        (WebCore::MouseEvent::isDragEvent):
+        (WebCore::MouseEvent::toElement):
+        (WebCore::MouseEvent::fromElement):
+        * dom/OverflowEvent.cpp:
+        (WebCore::OverflowEvent::OverflowEvent):
+        * dom/TextEvent.cpp:
+        (WebCore::TextEvent::TextEvent):
+        * dom/WebKitAnimationEvent.cpp:
+        (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
+        (WebCore::WebKitAnimationEvent::~WebKitAnimationEvent):
+        (WebCore::WebKitAnimationEvent::initWebKitAnimationEvent):
+        (WebCore::WebKitAnimationEvent::animationName):
+        (WebCore::WebKitAnimationEvent::elapsedTime):
+        * dom/WebKitTransitionEvent.cpp:
+        (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
+        (WebCore::WebKitTransitionEvent::~WebKitTransitionEvent):
+        (WebCore::WebKitTransitionEvent::initWebKitTransitionEvent):
+        (WebCore::WebKitTransitionEvent::propertyName):
+        (WebCore::WebKitTransitionEvent::elapsedTime):
+        * dom/WheelEvent.cpp:
+        (WebCore::WheelEvent::WheelEvent):
+        (WebCore::WheelEvent::initWheelEvent):
+        * dom/XMLTokenizerLibxml2.cpp:
+        * dom/XMLTokenizerQt.cpp:
+        * editing/DeleteButton.cpp:
+        (WebCore::DeleteButton::defaultEventHandler):
+        * editing/EditCommand.cpp:
+        * editing/Editor.cpp:
+        (WebCore::Editor::canDHTMLCut):
+        (WebCore::Editor::canDHTMLCopy):
+        (WebCore::Editor::canDHTMLPaste):
+        (WebCore::Editor::tryDHTMLCopy):
+        (WebCore::Editor::tryDHTMLCut):
+        (WebCore::Editor::tryDHTMLPaste):
+        (WebCore::dispatchEditableContentChangedEvents):
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplacementFragment::ReplacementFragment):
+        * editing/SelectionController.cpp:
+        (WebCore::SelectionController::setFocused):
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::defaultEventHandler):
+        * html/HTMLBodyElement.cpp:
+        (WebCore::HTMLBodyElement::parseMappedAttribute):
+        * html/HTMLButtonElement.cpp:
+        (WebCore::HTMLButtonElement::parseMappedAttribute):
+        (WebCore::HTMLButtonElement::defaultEventHandler):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::parseMappedAttribute):
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::onChange):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::handleLocalEvents):
+        (WebCore::HTMLFormElement::prepareSubmit):
+        (WebCore::HTMLFormElement::reset):
+        (WebCore::HTMLFormElement::parseMappedAttribute):
+        * html/HTMLFrameElementBase.cpp:
+        (WebCore::HTMLFrameElementBase::parseMappedAttribute):
+        * html/HTMLFrameSetElement.cpp:
+        (WebCore::HTMLFrameSetElement::parseMappedAttribute):
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::parseMappedAttribute):
+        * html/HTMLImageLoader.cpp:
+        (WebCore::HTMLImageLoader::dispatchLoadEvent):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::parseMappedAttribute):
+        (WebCore::HTMLInputElement::setValueFromRenderer):
+        (WebCore::HTMLInputElement::preDispatchEventHandler):
+        (WebCore::HTMLInputElement::postDispatchEventHandler):
+        (WebCore::HTMLInputElement::defaultEventHandler):
+        (WebCore::HTMLInputElement::onSearch):
+        * html/HTMLLabelElement.cpp:
+        (WebCore::HTMLLabelElement::defaultEventHandler):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::load):
+        (WebCore::HTMLMediaElement::mediaPlayerNetworkStateChanged):
+        (WebCore::HTMLMediaElement::setReadyState):
+        (WebCore::HTMLMediaElement::progressEventTimerFired):
+        (WebCore::HTMLMediaElement::seek):
+        (WebCore::HTMLMediaElement::setDefaultPlaybackRate):
+        (WebCore::HTMLMediaElement::setPlaybackRate):
+        (WebCore::HTMLMediaElement::play):
+        (WebCore::HTMLMediaElement::pause):
+        (WebCore::HTMLMediaElement::setVolume):
+        (WebCore::HTMLMediaElement::setMuted):
+        (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
+        (WebCore::HTMLMediaElement::documentWillBecomeInactive):
+        * html/HTMLObjectElement.cpp:
+        (WebCore::HTMLObjectElement::parseMappedAttribute):
+        * html/HTMLOptionElement.cpp:
+        * html/HTMLScriptElement.cpp:
+        (WebCore::HTMLScriptElement::parseMappedAttribute):
+        (WebCore::HTMLScriptElement::dispatchLoadEvent):
+        (WebCore::HTMLScriptElement::dispatchErrorEvent):
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::parseMappedAttribute):
+        (WebCore::HTMLSelectElement::defaultEventHandler):
+        (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
+        (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::parseMappedAttribute):
+        (WebCore::HTMLTextAreaElement::defaultEventHandler):
+        * html/HTMLTokenizer.cpp:
+        (WebCore::HTMLTokenizer::notifyFinished):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::stopLoading):
+        (WebCore::FrameLoader::canCachePage):
+        * loader/ImageDocument.cpp:
+        (WebCore::ImageEventListener::handleEvent):
+        * loader/ImageLoader.cpp:
+        * loader/MediaDocument.cpp:
+        (WebCore::MediaDocument::defaultEventHandler):
+        * loader/appcache/DOMApplicationCache.cpp:
+        (WebCore::DOMApplicationCache::callCheckingListener):
+        (WebCore::DOMApplicationCache::callErrorListener):
+        (WebCore::DOMApplicationCache::callNoUpdateListener):
+        (WebCore::DOMApplicationCache::callDownloadingListener):
+        (WebCore::DOMApplicationCache::callProgressListener):
+        (WebCore::DOMApplicationCache::callUpdateReadyListener):
+        (WebCore::DOMApplicationCache::callCachedListener):
+        * page/AccessibilityObject.cpp:
+        * page/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::mouseButtonListener):
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::handleContextMenuEvent):
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::on*): (multiple methods)
+        (WebCore::DOMWindow::setOn*): (multiple methods)
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMousePressEvent):
+        (WebCore::EventHandler::handleMouseDoubleClickEvent):
+        (WebCore::EventHandler::handleMouseMoveEvent):
+        (WebCore::EventHandler::handleMouseReleaseEvent):
+        (WebCore::EventHandler::updateDragAndDrop):
+        (WebCore::EventHandler::cancelDragAndDrop):
+        (WebCore::EventHandler::performDragAndDrop):
+        (WebCore::EventHandler::updateMouseEventTargetNode):
+        (WebCore::EventHandler::dispatchMouseEvent):
+        (WebCore::EventHandler::sendContextMenuEvent):
+        (WebCore::EventHandler::canMouseDownStartSelect):
+        (WebCore::EventHandler::canMouseDragExtendSelect):
+        (WebCore::EventHandler::defaultKeyboardEventHandler):
+        (WebCore::EventHandler::dragSourceMovedTo):
+        (WebCore::EventHandler::dragSourceEndedAt):
+        (WebCore::EventHandler::handleDrag):
+        (WebCore::EventHandler::handleTextInputEvent):
+        * page/FocusController.cpp:
+        * page/Frame.cpp:
+        (WebCore::Frame::sendResizeEvent):
+        (WebCore::Frame::sendScrollEvent):
+        * page/Page.cpp:
+        (WebCore::networkStateChanged):
+        * page/animation/AnimationBase.cpp:
+        (WebCore::AnimationBase::updateStateMachine):
+        (WebCore::AnimationBase::animationTimerCallbackFired):
+        (WebCore::AnimationBase::primeEventTimers):
+        * page/animation/ImplicitAnimation.cpp:
+        (WebCore::ImplicitAnimation::onAnimationEnd):
+        (WebCore::ImplicitAnimation::sendTransitionEvent):
+        * page/animation/KeyframeAnimation.cpp:
+        (WebCore::KeyframeAnimation::onAnimationStart):
+        (WebCore::KeyframeAnimation::onAnimationIteration):
+        (WebCore::KeyframeAnimation::onAnimationEnd):
+        (WebCore::KeyframeAnimation::sendAnimationEvent):
+        * page/gtk/EventHandlerGtk.cpp:
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::isKeyboardOptionTab):
+        * page/mac/FrameMac.mm:
+        * page/qt/EventHandlerQt.cpp:
+        (WebCore::isKeyboardOptionTab):
+        * plugins/PluginView.cpp:
+        * plugins/gtk/PluginViewGtk.cpp:
+        * plugins/qt/PluginViewQt.cpp:
+        * plugins/win/PluginViewWin.cpp:
+        (WebCore::PluginView::handleKeyboardEvent):
+        (WebCore::PluginView::handleMouseEvent):
+        * rendering/MediaControlElements.cpp:
+        (WebCore::MediaControlMuteButtonElement::defaultEventHandler):
+        (WebCore::MediaControlPlayButtonElement::defaultEventHandler):
+        (WebCore::MediaControlSeekButtonElement::defaultEventHandler):
+        (WebCore::MediaControlTimelineElement::defaultEventHandler):
+        (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::userResize):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::scrollToOffset):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::valueChanged):
+        * rendering/RenderMedia.cpp:
+        (WebCore::RenderMedia::forwardEvent):
+        * rendering/RenderObject.cpp:
+        * rendering/RenderSlider.cpp:
+        (WebCore::HTMLSliderThumbElement::defaultEventHandler):
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::forwardEvent):
+        (WebCore::RenderTextControl::selectionChanged):
+        * rendering/RenderWidget.cpp:
+        * rendering/TextControlInnerElements.cpp:
+        (WebCore::TextControlInnerTextElement::defaultEventHandler):
+        (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
+        (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
+        * storage/LocalStorageArea.cpp:
+        (WebCore::LocalStorageArea::dispatchStorageEvent):
+        * storage/SessionStorageArea.cpp:
+        (WebCore::SessionStorageArea::dispatchStorageEvent):
+        * svg/SVGAElement.cpp:
+        (WebCore::SVGAElement::defaultEventHandler):
+        * svg/SVGDocument.cpp:
+        (WebCore::SVGDocument::dispatchZoomEvent):
+        (WebCore::SVGDocument::dispatchScrollEvent):
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::parseMappedAttribute):
+        (WebCore::hasLoadListener):
+        (WebCore::SVGElement::sendSVGLoadEventIfPossible):
+        * svg/SVGElementInstance.cpp:
+        (WebCore::SVGElementInstance::on*): (multiple methods)
+        (WebCore::SVGElementInstance::setOn*): (multiple methods)
+        * svg/SVGImageLoader.cpp:
+        (WebCore::SVGImageLoader::dispatchLoadEvent):
+        * svg/SVGSVGElement.cpp:
+        (WebCore::SVGSVGElement::parseMappedAttribute):
+        * svg/SVGScriptElement.cpp:
+        (WebCore::SVGScriptElement::dispatchErrorEvent):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::dispatchReadyStateChangeEvent):
+        (WebCore::XMLHttpRequest::dispatchAbortEvent):
+        (WebCore::XMLHttpRequest::dispatchErrorEvent):
+        (WebCore::XMLHttpRequest::dispatchLoadEvent):
+        (WebCore::XMLHttpRequest::dispatchLoadStartEvent):
+        (WebCore::XMLHttpRequest::dispatchProgressEvent):
+        * xml/XMLHttpRequestUpload.cpp:
+        (WebCore::XMLHttpRequestUpload::dispatchAbortEvent):
+        (WebCore::XMLHttpRequestUpload::dispatchErrorEvent):
+        (WebCore::XMLHttpRequestUpload::dispatchLoadEvent):
+        (WebCore::XMLHttpRequestUpload::dispatchLoadStartEvent):
+        (WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
+        * xml/XPathResult.cpp:
+        (WebCore::XPathResult::XPathResult):
+        (WebCore::XPathResult::~XPathResult):
+        (WebCore::XPathResult::invalidateIteratorState):
+        Access event names via eventNames() function.
+
 2008-11-04  Cameron Zwarich  <zwarich@apple.com>
 
         Reviewed by Mark Rowe.
index 0d07892..2119483 100644 (file)
@@ -127,14 +127,13 @@ __Z26ReportBlockedObjCExceptionP11NSException
 __ZN7WebCore10CachedPage14documentLoaderEv
 __ZN7WebCore10CachedPage22cachedPagePlatformDataEv
 __ZN7WebCore10CachedPage25setCachedPagePlatformDataEPNS_22CachedPagePlatformDataE
-__ZN7WebCore10EventNames10clickEventE
-__ZN7WebCore10EventNames12keydownEventE
 __ZN7WebCore10MouseEventC1ERKNS_12AtomicStringEbbN3WTF10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_15EventTargetNodeEEENS5_INS_9ClipboardEEEb
 __ZN7WebCore10ScrollView17setScrollbarModesENS_13ScrollbarModeES1_
 __ZN7WebCore10ScrollView20setCanHaveScrollbarsEb
 __ZN7WebCore10StringImpl7replaceEtt
 __ZN7WebCore10StringImplD1Ev
 __ZN7WebCore10StringImplcvP8NSStringEv
+__ZN7WebCore10eventNamesEv
 __ZN7WebCore11ContextMenu22setPlatformDescriptionEP14NSMutableArray
 __ZN7WebCore11EditCommand7reapplyEv
 __ZN7WebCore11EditCommand7unapplyEv
index 0c21492..0c1f90f 100644 (file)
@@ -28,7 +28,6 @@
 #include "DOMWindow.h"
 #include "Element.h"
 #include "EventListener.h"
-#include "EventNames.h"
 #include "ExceptionCode.h"
 #include "FloatRect.h"
 #include "Frame.h"
@@ -98,8 +97,6 @@ static void setJSDOMWindowBaseXSLTProcessor(ExecState*, JSObject*, JSValue*);
 
 namespace WebCore {
 
-using namespace EventNames;
-
 static int lastUsedTimeoutId;
 
 static int timerNestingLevel = 0;
index 948153e..e72af16 100644 (file)
@@ -25,7 +25,6 @@
 #include "DOMWindow.h"
 #include "Document.h"
 #include "Event.h"
-#include "EventNames.h"
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "JSDOMWindow.h"
@@ -41,8 +40,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-using namespace EventNames;
-
 ASSERT_CLASS_FITS_IN_CELL(JSAbstractEventListener)
 
 void JSAbstractEventListener::handleEvent(Event* event, bool isWindowEvent)
index 2860b27..e9291d5 100644 (file)
@@ -50,7 +50,6 @@
 #endif
 
 using namespace JSC;
-using namespace WebCore::EventNames;
 
 namespace WebCore {
 
@@ -184,15 +183,15 @@ bool ScriptController::processingUserGesture() const
     if (Event* event = m_windowShell->window()->currentEvent()) {
         const AtomicString& type = event->type();
         if ( // mouse events
-            type == clickEvent || type == mousedownEvent ||
-            type == mouseupEvent || type == dblclickEvent ||
+            type == eventNames().clickEvent || type == eventNames().mousedownEvent ||
+            type == eventNames().mouseupEvent || type == eventNames().dblclickEvent ||
             // keyboard events
-            type == keydownEvent || type == keypressEvent ||
-            type == keyupEvent ||
+            type == eventNames().keydownEvent || type == eventNames().keypressEvent ||
+            type == eventNames().keyupEvent ||
             // other accepted events
-            type == selectEvent || type == changeEvent ||
-            type == focusEvent || type == blurEvent ||
-            type == submitEvent)
+            type == eventNames().selectEvent || type == eventNames().changeEvent ||
+            type == eventNames().focusEvent || type == eventNames().blurEvent ||
+            type == eventNames().submitEvent)
             return true;
     } else { // no event
         if (m_sourceURL && m_sourceURL->isNull() && !m_processingTimerCallback) {
index be27adc..af86d66 100644 (file)
 
 namespace WebCore {
 
-using namespace EventNames;
-
 BeforeTextInsertedEvent::BeforeTextInsertedEvent(const String& text)
-    : Event(webkitBeforeTextInsertedEvent, false, true), m_text(text)
+    : Event(eventNames().webkitBeforeTextInsertedEvent, false, true), m_text(text)
 {
 }
 
index b1cafe1..2521aa1 100644 (file)
 
 namespace WebCore {
 
-using namespace EventNames;
-
 BeforeUnloadEvent::BeforeUnloadEvent()
-    : Event(beforeunloadEvent, false, true)
+    : Event(eventNames().beforeunloadEvent, false, true)
 {
 }
 
index d6eee51..247a5b6 100644 (file)
@@ -31,8 +31,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 CharacterData::CharacterData(Document *doc)
     : EventTargetNode(doc)
     , m_data(StringImpl::empty())
@@ -201,7 +199,7 @@ void CharacterData::dispatchModifiedEvent(StringImpl* prevValue)
         parentNode()->childrenChanged();
     if (document()->hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER)) {
         ExceptionCode ec;
-        dispatchEvent(MutationEvent::create(DOMCharacterDataModifiedEvent, true, false, 0, prevValue, m_data, String(), 0), ec);
+        dispatchEvent(MutationEvent::create(eventNames().DOMCharacterDataModifiedEvent, true, false, 0, prevValue, m_data, String(), 0), ec);
     }
     dispatchSubtreeModifiedEvent();
 }
index 83945c4..bcd54c1 100644 (file)
@@ -40,8 +40,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 static void dispatchChildInsertionEvents(Node*, ExceptionCode&);
 static void dispatchChildRemovalEvents(Node*, ExceptionCode&);
 
@@ -883,7 +881,7 @@ static void dispatchChildInsertionEvents(Node* child, ExceptionCode& ec)
         doc->hasListenerType(Document::DOMNODEINSERTED_LISTENER) &&
         c->isEventTargetNode()) {
         ec = 0;
-        EventTargetNodeCast(c.get())->dispatchEvent(MutationEvent::create(DOMNodeInsertedEvent, true, false,
+        EventTargetNodeCast(c.get())->dispatchEvent(MutationEvent::create(eventNames().DOMNodeInsertedEvent, true, false,
             c->parentNode(), String(), String(), String(), 0), ec);
         if (ec)
             return;
@@ -896,7 +894,7 @@ static void dispatchChildInsertionEvents(Node* child, ExceptionCode& ec)
                 continue;
           
             ec = 0;
-            EventTargetNodeCast(c.get())->dispatchEvent(MutationEvent::create(DOMNodeInsertedIntoDocumentEvent, false, false,
+            EventTargetNodeCast(c.get())->dispatchEvent(MutationEvent::create(eventNames().DOMNodeInsertedIntoDocumentEvent, false, false,
                 0, String(), String(), String(), 0), ec);
             if (ec)
                 return;
@@ -916,7 +914,7 @@ static void dispatchChildRemovalEvents(Node* child, ExceptionCode& ec)
         doc->hasListenerType(Document::DOMNODEREMOVED_LISTENER) &&
         c->isEventTargetNode()) {
         ec = 0;
-        EventTargetNodeCast(c.get())->dispatchEvent(MutationEvent::create(DOMNodeRemovedEvent, true, false,
+        EventTargetNodeCast(c.get())->dispatchEvent(MutationEvent::create(eventNames().DOMNodeRemovedEvent, true, false,
             c->parentNode(), String(), String(), String(), 0), ec);
         if (ec)
             return;
@@ -928,7 +926,7 @@ static void dispatchChildRemovalEvents(Node* child, ExceptionCode& ec)
             if (!c->isEventTargetNode())
                 continue;
             ec = 0;
-            EventTargetNodeCast(c.get())->dispatchEvent(MutationEvent::create(DOMNodeRemovedFromDocumentEvent, false, false,
+            EventTargetNodeCast(c.get())->dispatchEvent(MutationEvent::create(eventNames().DOMNodeRemovedFromDocumentEvent, false, false,
                 0, String(), String(), String(), 0), ec);
             if (ec)
                 return;
index 1fb0421..162fa9d 100644 (file)
@@ -141,7 +141,7 @@ void DedicatedWorker::notifyFinished(CachedResource* resource)
 void DedicatedWorker::dispatchErrorEvent()
 {
     if (m_onErrorListener) {
-        RefPtr<Event> evt = Event::create(EventNames::errorEvent, false, true);
+        RefPtr<Event> evt = Event::create(eventNames().errorEvent, false, true);
         // DedicatedWorker is not an EventTarget, so target and currentTarget remain null.
         m_onErrorListener->handleEvent(evt.release().get(), true);
     }
index 6419159..1d8de0a 100644 (file)
@@ -147,7 +147,6 @@ using namespace Unicode;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 // #define INSTRUMENT_LAYOUT_SCHEDULING 1
@@ -1547,7 +1546,7 @@ void Document::implicitClose()
         f->animation()->resumeAnimations(this);
 
     dispatchImageLoadEventsNow();
-    this->dispatchWindowEvent(loadEvent, false, false);
+    this->dispatchWindowEvent(eventNames().loadEvent, false, false);
     if (f)
         f->loader()->handledOnloadEvents();
 #ifdef INSTRUMENT_LAYOUT_SCHEDULING
@@ -2416,7 +2415,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
         // Dispatch a change event for text fields or textareas that have been edited
         RenderObject* r = static_cast<RenderObject*>(oldFocusedNode.get()->renderer());
         if (r && (r->isTextArea() || r->isTextField()) && r->isEdited()) {
-            EventTargetNodeCast(oldFocusedNode.get())->dispatchEventForType(changeEvent, true, false);
+            EventTargetNodeCast(oldFocusedNode.get())->dispatchEventForType(eventNames().changeEvent, true, false);
             if ((r = static_cast<RenderObject*>(oldFocusedNode.get()->renderer())))
                 r->setEdited(false);
         }
@@ -2429,7 +2428,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
             focusChangeBlocked = true;
             newFocusedNode = 0;
         }
-        EventTargetNodeCast(oldFocusedNode.get())->dispatchUIEvent(DOMFocusOutEvent);
+        EventTargetNodeCast(oldFocusedNode.get())->dispatchUIEvent(eventNames().DOMFocusOutEvent);
         if (m_focusedNode) {
             // handler shifted focus
             focusChangeBlocked = true;
@@ -2459,7 +2458,7 @@ bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
             focusChangeBlocked = true;
             goto SetFocusedNodeDone;
         }
-        EventTargetNodeCast(m_focusedNode.get())->dispatchUIEvent(DOMFocusInEvent);
+        EventTargetNodeCast(m_focusedNode.get())->dispatchUIEvent(eventNames().DOMFocusInEvent);
         if (m_focusedNode != newFocusedNode) { 
             // handler shifted focus
             focusChangeBlocked = true;
@@ -2644,29 +2643,29 @@ PassRefPtr<Event> Document::createEvent(const String& eventType, ExceptionCode&
 
 void Document::addListenerTypeIfNeeded(const AtomicString& eventType)
 {
-    if (eventType == DOMSubtreeModifiedEvent)
+    if (eventType == eventNames().DOMSubtreeModifiedEvent)
         addListenerType(DOMSUBTREEMODIFIED_LISTENER);
-    else if (eventType == DOMNodeInsertedEvent)
+    else if (eventType == eventNames().DOMNodeInsertedEvent)
         addListenerType(DOMNODEINSERTED_LISTENER);
-    else if (eventType == DOMNodeRemovedEvent)
+    else if (eventType == eventNames().DOMNodeRemovedEvent)
         addListenerType(DOMNODEREMOVED_LISTENER);
-    else if (eventType == DOMNodeRemovedFromDocumentEvent)
+    else if (eventType == eventNames().DOMNodeRemovedFromDocumentEvent)
         addListenerType(DOMNODEREMOVEDFROMDOCUMENT_LISTENER);
-    else if (eventType == DOMNodeInsertedIntoDocumentEvent)
+    else if (eventType == eventNames().DOMNodeInsertedIntoDocumentEvent)
         addListenerType(DOMNODEINSERTEDINTODOCUMENT_LISTENER);
-    else if (eventType == DOMAttrModifiedEvent)
+    else if (eventType == eventNames().DOMAttrModifiedEvent)
         addListenerType(DOMATTRMODIFIED_LISTENER);
-    else if (eventType == DOMCharacterDataModifiedEvent)
+    else if (eventType == eventNames().DOMCharacterDataModifiedEvent)
         addListenerType(DOMCHARACTERDATAMODIFIED_LISTENER);
-    else if (eventType == overflowchangedEvent)
+    else if (eventType == eventNames().overflowchangedEvent)
         addListenerType(OVERFLOWCHANGED_LISTENER);
-    else if (eventType == webkitAnimationStartEvent)
+    else if (eventType == eventNames().webkitAnimationStartEvent)
         addListenerType(ANIMATIONSTART_LISTENER);
-    else if (eventType == webkitAnimationEndEvent)
+    else if (eventType == eventNames().webkitAnimationEndEvent)
         addListenerType(ANIMATIONEND_LISTENER);
-    else if (eventType == webkitAnimationIterationEvent)
+    else if (eventType == eventNames().webkitAnimationIterationEvent)
         addListenerType(ANIMATIONITERATION_LISTENER);
-    else if (eventType == webkitTransitionEndEvent)
+    else if (eventType == eventNames().webkitTransitionEndEvent)
         addListenerType(TRANSITIONEND_LISTENER);
 }
 
@@ -2712,9 +2711,9 @@ void Document::removeWindowInlineEventListenerForType(const AtomicString& eventT
     RegisteredEventListenerList::iterator it = m_windowEventListeners.begin();
     for (; it != m_windowEventListeners.end(); ++it) {
         if ((*it)->eventType() == eventType && (*it)->listener()->isInline()) {
-            if (eventType == unloadEvent)
+            if (eventType == eventNames().unloadEvent)
                 removePendingFrameUnloadEventCount();
-            else if (eventType == beforeunloadEvent)
+            else if (eventType == eventNames().beforeunloadEvent)
                 removePendingFrameBeforeUnloadEventCount();
             m_windowEventListeners.remove(it);
             return;
@@ -2724,9 +2723,9 @@ void Document::removeWindowInlineEventListenerForType(const AtomicString& eventT
 
 void Document::addWindowEventListener(const AtomicString& eventType, PassRefPtr<EventListener> listener, bool useCapture)
 {
-    if (eventType == unloadEvent)
+    if (eventType == eventNames().unloadEvent)
         addPendingFrameUnloadEventCount();
-    else if (eventType == beforeunloadEvent)
+    else if (eventType == eventNames().beforeunloadEvent)
         addPendingFrameBeforeUnloadEventCount();
     // Remove existing identical listener set with identical arguments.
     // The DOM 2 spec says that "duplicate instances are discarded" in this case.
@@ -2740,9 +2739,9 @@ void Document::removeWindowEventListener(const AtomicString& eventType, EventLis
     for (; it != m_windowEventListeners.end(); ++it) {
         RegisteredEventListener& r = **it;
         if (r.eventType() == eventType && r.listener() == listener && r.useCapture() == useCapture) {
-            if (eventType == unloadEvent)
+            if (eventType == eventNames().unloadEvent)
                 removePendingFrameUnloadEventCount();
-            else if (eventType == beforeunloadEvent)
+            else if (eventType == eventNames().beforeunloadEvent)
                 removePendingFrameBeforeUnloadEventCount();
             m_windowEventListeners.remove(it);
             return;
@@ -3811,7 +3810,7 @@ void Document::finishedParsing()
     setParsing(false);
 
     ExceptionCode ec = 0;
-    dispatchEvent(Event::create(DOMContentLoadedEvent, true, false), ec);
+    dispatchEvent(Event::create(eventNames().DOMContentLoadedEvent, true, false), ec);
 
     if (Frame* f = frame())
         f->loader()->finishedParsing();
index 2937d81..22a716d 100644 (file)
  */
 
 #include "config.h"
+#include "EventNames.h"
+
+#include <wtf/Threading.h>
 
-#ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC
-#define DOM_EVENT_NAMES_HIDE_GLOBALS 1
+#if ENABLE(WORKERS)
+#include <wtf/ThreadSpecific.h>
+using namespace WTF;
 #endif
 
-#include "EventNames.h"
-#include "StaticConstructors.h"
+namespace WebCore {
 
-namespace WebCore { namespace EventNames {
+#if ENABLE(WORKERS)
+static ThreadSpecific<EventNames>* staticEventNames;
+#else
+static EventNames* staticEventNames;
+#endif
+
+#define INITIALIZE_EVENT_NAME(name) \
+    , name##Event(#name)
+EventNames::EventNames()
+    : dummy(0)
+DOM_EVENT_NAMES_FOR_EACH(INITIALIZE_EVENT_NAME)
+{
+}
 
-#define DEFINE_EVENT_GLOBAL(name) \
-    DEFINE_GLOBAL(AtomicString, name##Event, #name)
-DOM_EVENT_NAMES_FOR_EACH(DEFINE_EVENT_GLOBAL)
+EventNames& eventNames()
+{
+#if ENABLE(WORKERS)
+    return **staticEventNames;
+#else
+    return *staticEventNames;
+#endif
+}
 
-void init()
+void EventNames::init()
 {
-    static bool initialized;
-    if (!initialized) {
-        // Use placement new to initialize the globals.
-        
+    if (!staticEventNames) {
+        // Initialization is not thread safe, so this function must be called from the main thread first.
+        ASSERT(isMainThread());
+
         AtomicString::init();
-        #define INITIALIZE_GLOBAL(name) new ((void*)&name##Event) AtomicString(#name);
-        DOM_EVENT_NAMES_FOR_EACH(INITIALIZE_GLOBAL)
-        initialized = true;
+
+#if ENABLE(WORKERS)
+        staticEventNames = new ThreadSpecific<EventNames>;
+#else
+        staticEventNames = new EventNames;
+#endif
     }
 }
 
-} }
+}
index 784793c..f7bb950 100644 (file)
 
 #include "AtomicString.h"
 
-namespace WebCore { namespace EventNames {
+namespace WTF {
+    template<typename> class ThreadSpecific;
+}
+
+namespace WebCore {
 
 #define DOM_EVENT_NAMES_FOR_EACH(macro) \
     \
@@ -127,14 +131,22 @@ namespace WebCore { namespace EventNames {
     \
 // end of DOM_EVENT_NAMES_FOR_EACH
 
-#ifndef DOM_EVENT_NAMES_HIDE_GLOBALS
-    #define DOM_EVENT_NAMES_DECLARE(name) extern const AtomicString name##Event;
-    DOM_EVENT_NAMES_FOR_EACH(DOM_EVENT_NAMES_DECLARE)
-    #undef DOM_EVENT_NAMES_DECLARE
-#endif
+    class EventNames {
+        friend class WTF::ThreadSpecific<EventNames>;
+
+        EventNames();
+        int dummy; // Needed to make initialization macro work.
+
+    public:
+        static void init();
+
+        #define DOM_EVENT_NAMES_DECLARE(name) AtomicString name##Event;
+        DOM_EVENT_NAMES_FOR_EACH(DOM_EVENT_NAMES_DECLARE)
+        #undef DOM_EVENT_NAMES_DECLARE
+    };
 
-    void init();
+    EventNames& eventNames();
 
-} }
+}
 
 #endif
index 91de55f..8a16424 100644 (file)
@@ -57,8 +57,6 @@
 #endif
 
 namespace WebCore {
-
-using namespace EventNames;
     
 static HashSet<EventTargetNode*>* gNodesDispatchingSimulatedClicks = 0; 
 
@@ -299,7 +297,7 @@ bool EventTargetNode::dispatchGenericEvent(PassRefPtr<Event> e, ExceptionCode& e
 
     // Handle window events for capture phase, except load events, this quirk is needed
     // because Mozilla used to never propagate load events to the window object
-    if (evt->type() != loadEvent && it.current()->isDocumentNode() && !evt->propagationStopped())
+    if (evt->type() != eventNames().loadEvent && it.current()->isDocumentNode() && !evt->propagationStopped())
         static_cast<Document*>(it.current())->handleWindowEvent(evt.get(), true);
 
     EventTargetNode* eventTargetNode = 0;
@@ -354,7 +352,7 @@ bool EventTargetNode::dispatchGenericEvent(PassRefPtr<Event> e, ExceptionCode& e
 
         // Handle window events for bubbling phase, except load events, this quirk is needed
         // because Mozilla used to never propagate load events at all
-        if (evt->type() != loadEvent && it.current()->isDocumentNode() && !evt->propagationStopped() && !evt->cancelBubble()) {
+        if (evt->type() != eventNames().loadEvent && it.current()->isDocumentNode() && !evt->propagationStopped() && !evt->cancelBubble()) {
             evt->setCurrentTarget(EventTargetNodeCast(it.current()));
             static_cast<Document*>(it.current())->handleWindowEvent(evt.get(), false);
         } 
@@ -398,7 +396,7 @@ bool EventTargetNode::dispatchSubtreeModifiedEvent()
     if (!document()->hasListenerType(Document::DOMSUBTREEMODIFIED_LISTENER))
         return false;
     ExceptionCode ec = 0;
-    return dispatchEvent(MutationEvent::create(DOMSubtreeModifiedEvent, true, false, 0, String(), String(), String(), 0), ec);
+    return dispatchEvent(MutationEvent::create(eventNames().DOMSubtreeModifiedEvent, true, false, 0, String(), String(), String(), 0), ec);
 }
 
 void EventTargetNode::dispatchWindowEvent(PassRefPtr<Event> e)
@@ -417,7 +415,7 @@ void EventTargetNode::dispatchWindowEvent(const AtomicString& eventType, bool ca
     RefPtr<Document> doc = document();
     dispatchWindowEvent(Event::create(eventType, canBubbleArg, cancelableArg));
     
-    if (eventType == loadEvent) {
+    if (eventType == eventNames().loadEvent) {
         // For onload events, send a separate load event to the enclosing frame only.
         // This is a DOM extension and is independent of bubbling/capturing rules of
         // the DOM.
@@ -434,9 +432,9 @@ void EventTargetNode::dispatchWindowEvent(const AtomicString& eventType, bool ca
 bool EventTargetNode::dispatchUIEvent(const AtomicString& eventType, int detail, PassRefPtr<Event> underlyingEvent)
 {
     ASSERT(!eventDispatchForbidden());
-    ASSERT(eventType == DOMFocusInEvent || eventType == DOMFocusOutEvent || eventType == DOMActivateEvent);
+    ASSERT(eventType == eventNames().DOMFocusInEvent || eventType == eventNames().DOMFocusOutEvent || eventType == eventNames().DOMActivateEvent);
     
-    bool cancelable = eventType == DOMActivateEvent;
+    bool cancelable = eventType == eventNames().DOMActivateEvent;
     
     ExceptionCode ec = 0;
     RefPtr<UIEvent> evt = UIEvent::create(eventType, true, cancelable, document()->defaultView(), detail);
@@ -512,14 +510,14 @@ void EventTargetNode::dispatchSimulatedClick(PassRefPtr<Event> event, bool sendM
     
     // send mousedown and mouseup before the click, if requested
     if (sendMouseEvents)
-        dispatchSimulatedMouseEvent(mousedownEvent, event.get());
+        dispatchSimulatedMouseEvent(eventNames().mousedownEvent, event.get());
     setActive(true, showPressedLook);
     if (sendMouseEvents)
-        dispatchSimulatedMouseEvent(mouseupEvent, event.get());
+        dispatchSimulatedMouseEvent(eventNames().mouseupEvent, event.get());
     setActive(false);
 
     // always send click
-    dispatchSimulatedMouseEvent(clickEvent, event);
+    dispatchSimulatedMouseEvent(eventNames().clickEvent, event);
     
     gNodesDispatchingSimulatedClicks->remove(this);
 }
@@ -541,7 +539,7 @@ bool EventTargetNode::dispatchMouseEvent(const AtomicString& eventType, int butt
     // so the pointer will be good for the two subsequent ones.
     RefPtr<Node> protect(this);
     
-    bool cancelable = eventType != mousemoveEvent;
+    bool cancelable = eventType != eventNames().mousemoveEvent;
     
     ExceptionCode ec = 0;
     
@@ -576,8 +574,8 @@ bool EventTargetNode::dispatchMouseEvent(const AtomicString& eventType, int butt
     // Special case: If it's a double click event, we also send the dblclick event. This is not part
     // of the DOM specs, but is used for compatibility with the ondblclick="" attribute.  This is treated
     // as a separate event in other DOM-compliant browsers like Firefox, and so we do the same.
-    if (eventType == clickEvent && detail == 2) {
-        RefPtr<Event> doubleClickEvent = MouseEvent::create(dblclickEvent,
+    if (eventType == eventNames().clickEvent && detail == 2) {
+        RefPtr<Event> doubleClickEvent = MouseEvent::create(eventNames().dblclickEvent,
             true, cancelable, document()->defaultView(),
             detail, screenX, screenY, pageX, pageY,
             ctrlKey, altKey, shiftKey, metaKey, button,
@@ -642,12 +640,12 @@ bool EventTargetNode::dispatchWebKitTransitionEvent(const AtomicString& eventTyp
 
 void EventTargetNode::dispatchFocusEvent()
 {
-    dispatchEventForType(focusEvent, false, false);
+    dispatchEventForType(eventNames().focusEvent, false, false);
 }
 
 void EventTargetNode::dispatchBlurEvent()
 {
-    dispatchEventForType(blurEvent, false, false);
+    dispatchEventForType(eventNames().blurEvent, false, false);
 }
 
 bool EventTargetNode::dispatchEventForType(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg)
@@ -730,18 +728,18 @@ void EventTargetNode::defaultEventHandler(Event* event)
     if (event->target() != this)
         return;
     const AtomicString& eventType = event->type();
-    if (eventType == keydownEvent || eventType == keypressEvent) {
+    if (eventType == eventNames().keydownEvent || eventType == eventNames().keypressEvent) {
         if (event->isKeyboardEvent())
             if (Frame* frame = document()->frame())
                 frame->eventHandler()->defaultKeyboardEventHandler(static_cast<KeyboardEvent*>(event));
-    } else if (eventType == clickEvent) {
+    } else if (eventType == eventNames().clickEvent) {
         int detail = event->isUIEvent() ? static_cast<UIEvent*>(event)->detail() : 0;
-        dispatchUIEvent(DOMActivateEvent, detail, event);
-    } else if (eventType == contextmenuEvent) {
+        dispatchUIEvent(eventNames().DOMActivateEvent, detail, event);
+    } else if (eventType == eventNames().contextmenuEvent) {
         if (Frame* frame = document()->frame())
             if (Page* page = frame->page())
                 page->contextMenuController()->handleContextMenuEvent(event);
-    } else if (eventType == textInputEvent) {
+    } else if (eventType == eventNames().textInputEvent) {
         if (event->isTextEvent())
             if (Frame* frame = document()->frame())
                 frame->eventHandler()->defaultTextInputEventHandler(static_cast<TextEvent*>(event));
@@ -750,402 +748,402 @@ void EventTargetNode::defaultEventHandler(Event* event)
 
 EventListener* EventTargetNode::onabort() const
 {
-    return inlineEventListenerForType(abortEvent);
+    return inlineEventListenerForType(eventNames().abortEvent);
 }
 
 void EventTargetNode::setOnabort(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(abortEvent, eventListener);
+    setInlineEventListenerForType(eventNames().abortEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onblur() const
 {
-    return inlineEventListenerForType(blurEvent);
+    return inlineEventListenerForType(eventNames().blurEvent);
 }
 
 void EventTargetNode::setOnblur(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(blurEvent, eventListener);
+    setInlineEventListenerForType(eventNames().blurEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onchange() const
 {
-    return inlineEventListenerForType(changeEvent);
+    return inlineEventListenerForType(eventNames().changeEvent);
 }
 
 void EventTargetNode::setOnchange(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(changeEvent, eventListener);
+    setInlineEventListenerForType(eventNames().changeEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onclick() const
 {
-    return inlineEventListenerForType(clickEvent);
+    return inlineEventListenerForType(eventNames().clickEvent);
 }
 
 void EventTargetNode::setOnclick(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(clickEvent, eventListener);
+    setInlineEventListenerForType(eventNames().clickEvent, eventListener);
 }
 
 EventListener* EventTargetNode::oncontextmenu() const
 {
-    return inlineEventListenerForType(contextmenuEvent);
+    return inlineEventListenerForType(eventNames().contextmenuEvent);
 }
 
 void EventTargetNode::setOncontextmenu(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(contextmenuEvent, eventListener);
+    setInlineEventListenerForType(eventNames().contextmenuEvent, eventListener);
 }
 
 EventListener* EventTargetNode::ondblclick() const
 {
-    return inlineEventListenerForType(dblclickEvent);
+    return inlineEventListenerForType(eventNames().dblclickEvent);
 }
 
 void EventTargetNode::setOndblclick(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(dblclickEvent, eventListener);
+    setInlineEventListenerForType(eventNames().dblclickEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onerror() const
 {
-    return inlineEventListenerForType(errorEvent);
+    return inlineEventListenerForType(eventNames().errorEvent);
 }
 
 void EventTargetNode::setOnerror(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(errorEvent, eventListener);
+    setInlineEventListenerForType(eventNames().errorEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onfocus() const
 {
-    return inlineEventListenerForType(focusEvent);
+    return inlineEventListenerForType(eventNames().focusEvent);
 }
 
 void EventTargetNode::setOnfocus(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(focusEvent, eventListener);
+    setInlineEventListenerForType(eventNames().focusEvent, eventListener);
 }
 
 EventListener* EventTargetNode::oninput() const
 {
-    return inlineEventListenerForType(inputEvent);
+    return inlineEventListenerForType(eventNames().inputEvent);
 }
 
 void EventTargetNode::setOninput(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(inputEvent, eventListener);
+    setInlineEventListenerForType(eventNames().inputEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onkeydown() const
 {
-    return inlineEventListenerForType(keydownEvent);
+    return inlineEventListenerForType(eventNames().keydownEvent);
 }
 
 void EventTargetNode::setOnkeydown(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(keydownEvent, eventListener);
+    setInlineEventListenerForType(eventNames().keydownEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onkeypress() const
 {
-    return inlineEventListenerForType(keypressEvent);
+    return inlineEventListenerForType(eventNames().keypressEvent);
 }
 
 void EventTargetNode::setOnkeypress(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(keypressEvent, eventListener);
+    setInlineEventListenerForType(eventNames().keypressEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onkeyup() const
 {
-    return inlineEventListenerForType(keyupEvent);
+    return inlineEventListenerForType(eventNames().keyupEvent);
 }
 
 void EventTargetNode::setOnkeyup(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(keyupEvent, eventListener);
+    setInlineEventListenerForType(eventNames().keyupEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onload() const
 {
-    return inlineEventListenerForType(loadEvent);
+    return inlineEventListenerForType(eventNames().loadEvent);
 }
 
 void EventTargetNode::setOnload(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(loadEvent, eventListener);
+    setInlineEventListenerForType(eventNames().loadEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onmousedown() const
 {
-    return inlineEventListenerForType(mousedownEvent);
+    return inlineEventListenerForType(eventNames().mousedownEvent);
 }
 
 void EventTargetNode::setOnmousedown(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mousedownEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mousedownEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onmousemove() const
 {
-    return inlineEventListenerForType(mousemoveEvent);
+    return inlineEventListenerForType(eventNames().mousemoveEvent);
 }
 
 void EventTargetNode::setOnmousemove(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mousemoveEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mousemoveEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onmouseout() const
 {
-    return inlineEventListenerForType(mouseoutEvent);
+    return inlineEventListenerForType(eventNames().mouseoutEvent);
 }
 
 void EventTargetNode::setOnmouseout(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mouseoutEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mouseoutEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onmouseover() const
 {
-    return inlineEventListenerForType(mouseoverEvent);
+    return inlineEventListenerForType(eventNames().mouseoverEvent);
 }
 
 void EventTargetNode::setOnmouseover(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mouseoverEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mouseoverEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onmouseup() const
 {
-    return inlineEventListenerForType(mouseupEvent);
+    return inlineEventListenerForType(eventNames().mouseupEvent);
 }
 
 void EventTargetNode::setOnmouseup(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mouseupEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mouseupEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onmousewheel() const
 {
-    return inlineEventListenerForType(mousewheelEvent);
+    return inlineEventListenerForType(eventNames().mousewheelEvent);
 }
 
 void EventTargetNode::setOnmousewheel(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mousewheelEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mousewheelEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onbeforecut() const
 {
-    return inlineEventListenerForType(beforecutEvent);
+    return inlineEventListenerForType(eventNames().beforecutEvent);
 }
 
 void EventTargetNode::setOnbeforecut(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(beforecutEvent, eventListener);
+    setInlineEventListenerForType(eventNames().beforecutEvent, eventListener);
 }
 
 EventListener* EventTargetNode::oncut() const
 {
-    return inlineEventListenerForType(cutEvent);
+    return inlineEventListenerForType(eventNames().cutEvent);
 }
 
 void EventTargetNode::setOncut(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(cutEvent, eventListener);
+    setInlineEventListenerForType(eventNames().cutEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onbeforecopy() const
 {
-    return inlineEventListenerForType(beforecopyEvent);
+    return inlineEventListenerForType(eventNames().beforecopyEvent);
 }
 
 void EventTargetNode::setOnbeforecopy(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(beforecopyEvent, eventListener);
+    setInlineEventListenerForType(eventNames().beforecopyEvent, eventListener);
 }
 
 EventListener* EventTargetNode::oncopy() const
 {
-    return inlineEventListenerForType(copyEvent);
+    return inlineEventListenerForType(eventNames().copyEvent);
 }
 
 void EventTargetNode::setOncopy(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(copyEvent, eventListener);
+    setInlineEventListenerForType(eventNames().copyEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onbeforepaste() const
 {
-    return inlineEventListenerForType(beforepasteEvent);
+    return inlineEventListenerForType(eventNames().beforepasteEvent);
 }
 
 void EventTargetNode::setOnbeforepaste(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(beforepasteEvent, eventListener);
+    setInlineEventListenerForType(eventNames().beforepasteEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onpaste() const
 {
-    return inlineEventListenerForType(pasteEvent);
+    return inlineEventListenerForType(eventNames().pasteEvent);
 }
 
 void EventTargetNode::setOnpaste(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(pasteEvent, eventListener);
+    setInlineEventListenerForType(eventNames().pasteEvent, eventListener);
 }
 
 EventListener* EventTargetNode::ondragenter() const
 {
-    return inlineEventListenerForType(dragenterEvent);
+    return inlineEventListenerForType(eventNames().dragenterEvent);
 }
 
 void EventTargetNode::setOndragenter(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(dragenterEvent, eventListener);
+    setInlineEventListenerForType(eventNames().dragenterEvent, eventListener);
 }
 
 EventListener* EventTargetNode::ondragover() const
 {
-    return inlineEventListenerForType(dragoverEvent);
+    return inlineEventListenerForType(eventNames().dragoverEvent);
 }
 
 void EventTargetNode::setOndragover(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(dragoverEvent, eventListener);
+    setInlineEventListenerForType(eventNames().dragoverEvent, eventListener);
 }
 
 EventListener* EventTargetNode::ondragleave() const
 {
-    return inlineEventListenerForType(dragleaveEvent);
+    return inlineEventListenerForType(eventNames().dragleaveEvent);
 }
 
 void EventTargetNode::setOndragleave(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(dragleaveEvent, eventListener);
+    setInlineEventListenerForType(eventNames().dragleaveEvent, eventListener);
 }
 
 EventListener* EventTargetNode::ondrop() const
 {
-    return inlineEventListenerForType(dropEvent);
+    return inlineEventListenerForType(eventNames().dropEvent);
 }
 
 void EventTargetNode::setOndrop(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(dropEvent, eventListener);
+    setInlineEventListenerForType(eventNames().dropEvent, eventListener);
 }
 
 EventListener* EventTargetNode::ondragstart() const
 {
-    return inlineEventListenerForType(dragstartEvent);
+    return inlineEventListenerForType(eventNames().dragstartEvent);
 }
 
 void EventTargetNode::setOndragstart(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(dragstartEvent, eventListener);
+    setInlineEventListenerForType(eventNames().dragstartEvent, eventListener);
 }
 
 EventListener* EventTargetNode::ondrag() const
 {
-    return inlineEventListenerForType(dragEvent);
+    return inlineEventListenerForType(eventNames().dragEvent);
 }
 
 void EventTargetNode::setOndrag(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(dragEvent, eventListener);
+    setInlineEventListenerForType(eventNames().dragEvent, eventListener);
 }
 
 EventListener* EventTargetNode::ondragend() const
 {
-    return inlineEventListenerForType(dragendEvent);
+    return inlineEventListenerForType(eventNames().dragendEvent);
 }
 
 void EventTargetNode::setOndragend(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(dragendEvent, eventListener);
+    setInlineEventListenerForType(eventNames().dragendEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onreset() const
 {
-    return inlineEventListenerForType(resetEvent);
+    return inlineEventListenerForType(eventNames().resetEvent);
 }
 
 void EventTargetNode::setOnreset(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(resetEvent, eventListener);
+    setInlineEventListenerForType(eventNames().resetEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onresize() const
 {
-    return inlineEventListenerForType(resizeEvent);
+    return inlineEventListenerForType(eventNames().resizeEvent);
 }
 
 void EventTargetNode::setOnresize(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(resizeEvent, eventListener);
+    setInlineEventListenerForType(eventNames().resizeEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onscroll() const
 {
-    return inlineEventListenerForType(scrollEvent);
+    return inlineEventListenerForType(eventNames().scrollEvent);
 }
 
 void EventTargetNode::setOnscroll(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(scrollEvent, eventListener);
+    setInlineEventListenerForType(eventNames().scrollEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onsearch() const
 {
-    return inlineEventListenerForType(searchEvent);
+    return inlineEventListenerForType(eventNames().searchEvent);
 }
 
 void EventTargetNode::setOnsearch(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(searchEvent, eventListener);
+    setInlineEventListenerForType(eventNames().searchEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onselect() const
 {
-    return inlineEventListenerForType(selectEvent);
+    return inlineEventListenerForType(eventNames().selectEvent);
 }
 
 void EventTargetNode::setOnselect(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(selectEvent, eventListener);
+    setInlineEventListenerForType(eventNames().selectEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onselectstart() const
 {
-    return inlineEventListenerForType(selectstartEvent);
+    return inlineEventListenerForType(eventNames().selectstartEvent);
 }
 
 void EventTargetNode::setOnselectstart(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(selectstartEvent, eventListener);
+    setInlineEventListenerForType(eventNames().selectstartEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onsubmit() const
 {
-    return inlineEventListenerForType(submitEvent);
+    return inlineEventListenerForType(eventNames().submitEvent);
 }
 
 void EventTargetNode::setOnsubmit(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(submitEvent, eventListener);
+    setInlineEventListenerForType(eventNames().submitEvent, eventListener);
 }
 
 EventListener* EventTargetNode::onunload() const
 {
-    return inlineEventListenerForType(unloadEvent);
+    return inlineEventListenerForType(eventNames().unloadEvent);
 }
 
 void EventTargetNode::setOnunload(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(unloadEvent, eventListener);
+    setInlineEventListenerForType(eventNames().unloadEvent, eventListener);
 }
 
 } // namespace WebCore
index 0ee8cb5..6bc825f 100644 (file)
 
 namespace WebCore {
 
-using namespace EventNames;
-
 static inline const AtomicString& eventTypeForKeyboardEventType(PlatformKeyboardEvent::Type type)
 {
     switch (type) {
         case PlatformKeyboardEvent::KeyUp:
-            return keyupEvent;
+            return eventNames().keyupEvent;
         case PlatformKeyboardEvent::RawKeyDown:
-            return keydownEvent;
+            return eventNames().keydownEvent;
         case PlatformKeyboardEvent::Char:
-            return keypressEvent;
+            return eventNames().keypressEvent;
         case PlatformKeyboardEvent::KeyDown:
             // The caller should disambiguate the combined event into RawKeyDown or Char events.
             break;
     }
     ASSERT_NOT_REACHED();
-    return keydownEvent;
+    return eventNames().keydownEvent;
 }
 
 KeyboardEvent::KeyboardEvent()
@@ -123,7 +121,7 @@ int KeyboardEvent::keyCode() const
     // We match IE.
     if (!m_keyEvent)
         return 0;
-    if (type() == keydownEvent || type() == keyupEvent)
+    if (type() == eventNames().keydownEvent || type() == eventNames().keyupEvent)
         return m_keyEvent->windowsVirtualKeyCode();
     return charCode();
 }
@@ -137,7 +135,7 @@ int KeyboardEvent::charCode() const
     if (view())
         backwardCompatibilityMode = view()->frame()->eventHandler()->needsKeyboardEventDisambiguationQuirks();
 
-    if (!m_keyEvent || (type() != keypressEvent && !backwardCompatibilityMode))
+    if (!m_keyEvent || (type() != eventNames().keypressEvent && !backwardCompatibilityMode))
         return 0;
     String text = m_keyEvent->text();
     return static_cast<int>(text.characterStartingAt(0));
index 3957109..a0af32d 100644 (file)
 
 namespace WebCore {
 
-using namespace EventNames;
-
 MessageEvent::MessageEvent()
 {
 }
 
 MessageEvent::MessageEvent(const String& data, const String& origin, const String& lastEventId, PassRefPtr<DOMWindow> source, PassRefPtr<MessagePort> messagePort)
-    : Event(messageEvent, false, true)
+    : Event(eventNames().messageEvent, false, true)
     , m_data(data)
     , m_origin(origin)
     , m_lastEventId(lastEventId)
index f3fb045..58467af 100644 (file)
@@ -210,7 +210,7 @@ void MessagePort::dispatchMessages()
     RefPtr<Event> evt;
     while (m_messageQueue.tryGetMessage(evt)) {
 
-        ASSERT(evt->type() == EventNames::messageEvent);
+        ASSERT(evt->type() == eventNames().messageEvent);
 
         if (m_onMessageListener) {
             evt->setTarget(this);
@@ -238,7 +238,7 @@ void MessagePort::dispatchCloseEvent()
     ASSERT(m_pendingCloseEvent);
     m_pendingCloseEvent = false;
 
-    RefPtr<Event> evt = Event::create(EventNames::closeEvent, false, true);
+    RefPtr<Event> evt = Event::create(eventNames().closeEvent, false, true);
     if (m_onCloseListener) {
         evt->setTarget(this);
         evt->setCurrentTarget(this);
index c55093c..1c97522 100644 (file)
@@ -27,8 +27,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 MouseEvent::MouseEvent()
     : m_button(0)
     , m_buttonDown(false)
@@ -87,8 +85,8 @@ bool MouseEvent::isMouseEvent() const
 bool MouseEvent::isDragEvent() const
 {
     const AtomicString& t = type();
-    return t == dragenterEvent || t == dragoverEvent || t == dragleaveEvent || t == dropEvent
-               || t == dragstartEvent|| t == dragEvent || t == dragendEvent;
+    return t == eventNames().dragenterEvent || t == eventNames().dragoverEvent || t == eventNames().dragleaveEvent || t == eventNames().dropEvent
+               || t == eventNames().dragstartEvent|| t == eventNames().dragEvent || t == eventNames().dragendEvent;
 }
 
 int MouseEvent::which() const
@@ -102,7 +100,7 @@ int MouseEvent::which() const
 Node* MouseEvent::toElement() const
 {
     // MSIE extension - "the object toward which the user is moving the mouse pointer"
-    if (type() == mouseoutEvent) 
+    if (type() == eventNames().mouseoutEvent) 
         return relatedTarget();
     
     return target() ? target()->toNode() : 0;
@@ -111,7 +109,7 @@ Node* MouseEvent::toElement() const
 Node* MouseEvent::fromElement() const
 {
     // MSIE extension - "object from which activation or the mouse pointer is exiting during the event" (huh?)
-    if (type() != mouseoutEvent)
+    if (type() != eventNames().mouseoutEvent)
         return relatedTarget();
     
     return target() ? target()->toNode() : 0;
index b32213d..1626b67 100644 (file)
 #include "EventNames.h"
 
 namespace WebCore {
-    
-using namespace EventNames;
-    
+        
 OverflowEvent::OverflowEvent()
-    : Event(overflowchangedEvent, false, false)
+    : Event(eventNames().overflowchangedEvent, false, false)
     , m_orient(VERTICAL)
     , m_horizontalOverflow(false)
     , m_verticalOverflow(false)
@@ -41,7 +39,7 @@ OverflowEvent::OverflowEvent()
 }
 
 OverflowEvent::OverflowEvent(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow)
-    : Event(overflowchangedEvent, false, false)
+    : Event(eventNames().overflowchangedEvent, false, false)
     , m_horizontalOverflow(horizontalOverflow)
     , m_verticalOverflow(verticalOverflow)
 {
index 1343e6f..d282c13 100644 (file)
@@ -31,8 +31,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 TextEvent::TextEvent()
     : m_isLineBreak(false)
     , m_isBackTab(false)
@@ -40,7 +38,7 @@ TextEvent::TextEvent()
 }
 
 TextEvent::TextEvent(PassRefPtr<AbstractView> view, const String& data)
-    : UIEvent(textInputEvent, true, true, view, 0)
+    : UIEvent(eventNames().textInputEvent, true, true, view, 0)
     , m_data(data)
     , m_isLineBreak(false)
     , m_isBackTab(false)
index 4c84ec4..ddaaf64 100644 (file)
 #include "EventNames.h"
 
 namespace WebCore {
-    
-    using namespace EventNames;
-    
-    WebKitAnimationEvent::WebKitAnimationEvent()
+
+WebKitAnimationEvent::WebKitAnimationEvent()
     : m_elapsedTime(0.0)
-    {
-    }
-    
-    WebKitAnimationEvent::WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime)
+{
+}
+
+WebKitAnimationEvent::WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime)
     : Event(type, true, true)
     , m_animationName(animationName)
     , m_elapsedTime(elapsedTime)
-    {
-    }
-    
-    WebKitAnimationEvent::~WebKitAnimationEvent()
-    {
-    }
-    
-    void WebKitAnimationEvent::initWebKitAnimationEvent(const AtomicString& type, 
-                                            bool /*canBubbleArg*/,
-                                            bool /*cancelableArg*/,
-                                            const String& animationName,
-                                            double elapsedTime)
-    {
-        if (dispatched())
-            return;
-        
-        initEvent(type, false, true);
-        
-        m_animationName = animationName;
-    }
-    
-    const String& WebKitAnimationEvent::animationName() const
-    {
-        return m_animationName;
-    }
+{
+}
+
+WebKitAnimationEvent::~WebKitAnimationEvent()
+{
+}
+
+void WebKitAnimationEvent::initWebKitAnimationEvent(const AtomicString& type, 
+                                        bool /*canBubbleArg*/,
+                                        bool /*cancelableArg*/,
+                                        const String& animationName,
+                                        double elapsedTime)
+{
+    if (dispatched())
+        return;
     
-    double WebKitAnimationEvent::elapsedTime() const
-    {
-        return m_elapsedTime;
-    }
+    initEvent(type, false, true);
     
+    m_animationName = animationName;
+}
+
+const String& WebKitAnimationEvent::animationName() const
+{
+    return m_animationName;
+}
+
+double WebKitAnimationEvent::elapsedTime() const
+{
+    return m_elapsedTime;
+}
+
 } // namespace WebCore
index 29f3081..f4bdbf5 100644 (file)
 #include "EventNames.h"
 
 namespace WebCore {
-    
-    using namespace EventNames;
-    
-    WebKitTransitionEvent::WebKitTransitionEvent()
+        
+WebKitTransitionEvent::WebKitTransitionEvent()
     : m_propertyName()
     , m_elapsedTime(0.0)
-    {
-    }
-    
-    WebKitTransitionEvent::WebKitTransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime)
+{
+}
+
+WebKitTransitionEvent::WebKitTransitionEvent(const AtomicString& type, const String& propertyName, double elapsedTime)
     : Event(type, true, true)
     , m_propertyName(propertyName)
     , m_elapsedTime(elapsedTime)
-    {
-    }
-    
-    WebKitTransitionEvent::~WebKitTransitionEvent()
-    {
-    }
-    
-    void WebKitTransitionEvent::initWebKitTransitionEvent(const AtomicString& type, 
+{
+}
+
+WebKitTransitionEvent::~WebKitTransitionEvent()
+{
+}
+
+void WebKitTransitionEvent::initWebKitTransitionEvent(const AtomicString& type, 
                                             bool /*canBubbleArg*/,
                                             bool /*cancelableArg*/,
                                             const String& propertyName,
                                             double elapsedTime)
-    {
-        if (dispatched())
-            return;
-        
-        initEvent(type, false, true);
-        
-        m_propertyName = propertyName;
-    }
-    
-    const String& WebKitTransitionEvent::propertyName() const
-    {
-        return m_propertyName;
-    }
+{
+    if (dispatched())
+        return;
     
-    double WebKitTransitionEvent::elapsedTime() const
-    {
-        return m_elapsedTime;
-    }
+    initEvent(type, false, true);
     
+    m_propertyName = propertyName;
+}
+
+const String& WebKitTransitionEvent::propertyName() const
+{
+    return m_propertyName;
+}
+
+double WebKitTransitionEvent::elapsedTime() const
+{
+    return m_elapsedTime;
+}
+
 } // namespace WebCore
index 73e0d5e..a3c806e 100644 (file)
@@ -28,8 +28,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 WheelEvent::WheelEvent()
     : m_wheelDeltaX(0)
     , m_wheelDeltaY(0)
@@ -39,7 +37,7 @@ WheelEvent::WheelEvent()
 WheelEvent::WheelEvent(float wheelDeltaX, float wheelDeltaY, PassRefPtr<AbstractView> view,
                        int screenX, int screenY, int pageX, int pageY,
                        bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
-    : MouseRelatedEvent(mousewheelEvent,
+    : MouseRelatedEvent(eventNames().mousewheelEvent,
                         true, true, view, 0, screenX, screenY, pageX, pageY, 
                         ctrlKey, altKey, shiftKey, metaKey)
     , m_wheelDeltaX(lroundf(wheelDeltaX) * 120)
@@ -59,7 +57,7 @@ void WheelEvent::initWheelEvent(int wheelDeltaX, int wheelDeltaY, PassRefPtr<Abs
     if (dispatched())
         return;
     
-    initUIEvent(mousewheelEvent, true, true, view, 0);
+    initUIEvent(eventNames().mousewheelEvent, true, true, view, 0);
     
     m_screenX = screenX;
     m_screenY = screenY;
index 3efe478..8dfb682 100644 (file)
@@ -33,7 +33,6 @@
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "DocumentType.h"
-#include "EventNames.h"
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
@@ -64,8 +63,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
-
 class PendingCallbacks {
 public:
     PendingCallbacks()
index 44283e0..55cae00 100644 (file)
@@ -33,7 +33,6 @@
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "DocumentType.h"
-#include "EventNames.h"
 #include "Frame.h"
 #include "FrameLoader.h"
 #include "FrameView.h"
@@ -58,8 +57,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
-
 #if QT_VERSION >= 0x040400
 class EntityResolver : public QXmlStreamEntityResolver
 {
index 6d64fd1..449b5b2 100644 (file)
@@ -35,8 +35,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 DeleteButton::DeleteButton(Document* document)
     : HTMLImageElement(document)
 {
@@ -45,7 +43,7 @@ DeleteButton::DeleteButton(Document* document)
 void DeleteButton::defaultEventHandler(Event* event)
 {
     if (event->isMouseEvent()) {
-        if (event->type() == clickEvent) {
+        if (event->type() == eventNames().clickEvent) {
             document()->frame()->editor()->deleteButtonController()->deleteTarget();
             event->setDefaultHandled();
         }
index 8294c3e..f9f8b80 100644 (file)
@@ -41,8 +41,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 EditCommand::EditCommand(Document* document) 
     : m_document(document)
     , m_parent(0)
index ba6d6b9..1890338 100644 (file)
@@ -68,7 +68,6 @@
 namespace WebCore {
 
 using namespace std;
-using namespace EventNames;
 using namespace HTMLNames;
 
 // When an event handler has moved the selection outside of a text control
@@ -129,17 +128,17 @@ bool Editor::canEditRichly() const
 
 bool Editor::canDHTMLCut()
 {
-    return !m_frame->selection()->isInPasswordField() && !dispatchCPPEvent(beforecutEvent, ClipboardNumb);
+    return !m_frame->selection()->isInPasswordField() && !dispatchCPPEvent(eventNames().beforecutEvent, ClipboardNumb);
 }
 
 bool Editor::canDHTMLCopy()
 {
-    return !m_frame->selection()->isInPasswordField() && !dispatchCPPEvent(beforecopyEvent, ClipboardNumb);
+    return !m_frame->selection()->isInPasswordField() && !dispatchCPPEvent(eventNames().beforecopyEvent, ClipboardNumb);
 }
 
 bool Editor::canDHTMLPaste()
 {
-    return !dispatchCPPEvent(beforepasteEvent, ClipboardNumb);
+    return !dispatchCPPEvent(eventNames().beforepasteEvent, ClipboardNumb);
 }
 
 bool Editor::canCut() const
@@ -357,7 +356,7 @@ bool Editor::tryDHTMLCopy()
     // also done for security, as it erases data from the last copy/paste.
     Pasteboard::generalPasteboard()->clear();
 
-    return !dispatchCPPEvent(copyEvent, ClipboardWritable);
+    return !dispatchCPPEvent(eventNames().copyEvent, ClipboardWritable);
 }
 
 bool Editor::tryDHTMLCut()
@@ -369,12 +368,12 @@ bool Editor::tryDHTMLCut()
     // also done for security, as it erases data from the last copy/paste.
     Pasteboard::generalPasteboard()->clear();
 
-    return !dispatchCPPEvent(cutEvent, ClipboardWritable);
+    return !dispatchCPPEvent(eventNames().cutEvent, ClipboardWritable);
 }
 
 bool Editor::tryDHTMLPaste()
 {
-    return !dispatchCPPEvent(pasteEvent, ClipboardReadable);
+    return !dispatchCPPEvent(eventNames().pasteEvent, ClipboardReadable);
 }
 
 void Editor::writeSelectionToPasteboard(Pasteboard* pasteboard)
@@ -748,9 +747,9 @@ static void dispatchEditableContentChangedEvents(const EditCommand& command)
     Element* endRoot = command.endingRootEditableElement();
     ExceptionCode ec;
     if (startRoot)
-        startRoot->dispatchEvent(Event::create(webkitEditableContentChangedEvent, false, false), ec);
+        startRoot->dispatchEvent(Event::create(eventNames().webkitEditableContentChangedEvent, false, false), ec);
     if (endRoot && endRoot != startRoot)
-        endRoot->dispatchEvent(Event::create(webkitEditableContentChangedEvent, false, false), ec);
+        endRoot->dispatchEvent(Event::create(eventNames().webkitEditableContentChangedEvent, false, false), ec);
 }
 
 void Editor::appliedEditing(PassRefPtr<EditCommand> cmd)
index 2187998..4304af3 100644 (file)
@@ -51,7 +51,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 enum EFragmentType { EmptyFragment, SingleTextNodeFragment, TreeFragment };
@@ -123,7 +122,7 @@ ReplacementFragment::ReplacementFragment(Document* document, DocumentFragment* f
     
     Node* shadowAncestorNode = editableRoot->shadowAncestorNode();
     
-    if (!editableRoot->inlineEventListenerForType(webkitBeforeTextInsertedEvent) &&
+    if (!editableRoot->inlineEventListenerForType(eventNames().webkitBeforeTextInsertedEvent) &&
         // FIXME: Remove these checks once textareas and textfields actually register an event handler.
         !(shadowAncestorNode && shadowAncestorNode->renderer() && shadowAncestorNode->renderer()->isTextField()) &&
         !(shadowAncestorNode && shadowAncestorNode->renderer() && shadowAncestorNode->renderer()->isTextArea()) &&
index 15dce16..bf52be4 100644 (file)
@@ -57,7 +57,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 const int NoXPosForVerticalArrowNavigation = INT_MIN;
@@ -1148,7 +1147,7 @@ void SelectionController::setFocused(bool flag)
     focusedOrActiveStateChanged();
 
     if (Document* doc = m_frame->document())
-        doc->dispatchWindowEvent(flag ? focusEvent : blurEvent, false, false);
+        doc->dispatchWindowEvent(flag ? eventNames().focusEvent : eventNames().blurEvent, false, false);
 }
 
 bool SelectionController::isFocusedAndActive() const
index e4d10d1..0e09b5d 100644 (file)
@@ -48,7 +48,6 @@
 namespace WebCore {
 
 using namespace HTMLNames;
-using namespace EventNames;
 
 HTMLAnchorElement::HTMLAnchorElement(Document* doc)
     : HTMLElement(aTag, doc)
@@ -132,13 +131,13 @@ void HTMLAnchorElement::defaultEventHandler(Event* evt)
     // React on clicks and on keypresses.
     // Don't make this KEYUP_EVENT again, it makes khtml follow links it shouldn't,
     // when pressing Enter in the combo.
-    if (isLink() && (evt->type() == clickEvent || (evt->type() == keydownEvent && focused()))) {
+    if (isLink() && (evt->type() == eventNames().clickEvent || (evt->type() == eventNames().keydownEvent && focused()))) {
         MouseEvent* e = 0;
-        if (evt->type() == clickEvent && evt->isMouseEvent())
+        if (evt->type() == eventNames().clickEvent && evt->isMouseEvent())
             e = static_cast<MouseEvent*>(evt);
 
         KeyboardEvent* k = 0;
-        if (evt->type() == keydownEvent && evt->isKeyboardEvent())
+        if (evt->type() == eventNames().keydownEvent && evt->isKeyboardEvent())
             k = static_cast<KeyboardEvent*>(evt);
 
         if (e && e->button() == RightButton) {
@@ -224,12 +223,12 @@ void HTMLAnchorElement::defaultEventHandler(Event* evt)
     } else if (isLink() && isContentEditable()) {
         // This keeps track of the editable block that the selection was in (if it was in one) just before the link was clicked
         // for the LiveWhenNotFocused editable link behavior
-        if (evt->type() == mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() != RightButton && document()->frame() && document()->frame()->selection()) {
+        if (evt->type() == eventNames().mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() != RightButton && document()->frame() && document()->frame()->selection()) {
             MouseEvent* e = static_cast<MouseEvent*>(evt);
 
             m_rootEditableElementForSelectionOnMouseDown = document()->frame()->selection()->rootEditableElement();
             m_wasShiftKeyDownOnMouseDown = e && e->shiftKey();
-        } else if (evt->type() == mouseoverEvent) {
+        } else if (evt->type() == eventNames().mouseoverEvent) {
             // These are cleared on mouseover and not mouseout because their values are needed for drag events, but these happen
             // after mouse out events.
             m_rootEditableElementForSelectionOnMouseDown = 0;
index b6ec978..7dca064 100644 (file)
@@ -38,7 +38,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 HTMLBodyElement::HTMLBodyElement(Document* doc)
@@ -131,24 +130,24 @@ void HTMLBodyElement::parseMappedAttribute(MappedAttribute *attr)
         if (attached())
             document()->recalcStyle(Force);
     } else if (attr->name() == onloadAttr)
-        document()->setWindowInlineEventListenerForTypeAndAttribute(loadEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().loadEvent, attr);
     else if (attr->name() == onbeforeunloadAttr)
-        document()->setWindowInlineEventListenerForTypeAndAttribute(beforeunloadEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().beforeunloadEvent, attr);
     else if (attr->name() == onunloadAttr)
-        document()->setWindowInlineEventListenerForTypeAndAttribute(unloadEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().unloadEvent, attr);
     else if (attr->name() == onblurAttr)
-        document()->setWindowInlineEventListenerForTypeAndAttribute(blurEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().blurEvent, attr);
     else if (attr->name() == onfocusAttr)
-        document()->setWindowInlineEventListenerForTypeAndAttribute(focusEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().focusEvent, attr);
     else if (attr->name() == onresizeAttr)
-        document()->setWindowInlineEventListenerForTypeAndAttribute(resizeEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().resizeEvent, attr);
     else if (attr->name() == onscrollAttr)
-        document()->setWindowInlineEventListenerForTypeAndAttribute(scrollEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().scrollEvent, attr);
     else if (attr->name() == onstorageAttr) {
         // The HTML5 spec currently specifies that storage events are fired only at the body element of
         // an HTMLDocument, which is why the onstorage attribute differs from the ones before it.
         // The spec might change on this, and then so should we!
-        setInlineEventListenerForTypeAndAttribute(storageEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().storageEvent, attr);
     } else
         HTMLElement::parseMappedAttribute(attr);
 }
index 5caef6e..f65e748 100644 (file)
@@ -35,7 +35,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 HTMLButtonElement::HTMLButtonElement(Document* doc, HTMLFormElement* form)
@@ -88,16 +87,16 @@ void HTMLButtonElement::parseMappedAttribute(MappedAttribute* attr)
         // Don't map 'align' attribute.  This matches what Firefox and IE do, but not Opera.
         // See http://bugs.webkit.org/show_bug.cgi?id=12071
     } else if (attr->name() == onfocusAttr) {
-        setInlineEventListenerForTypeAndAttribute(focusEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().focusEvent, attr);
     } else if (attr->name() == onblurAttr) {
-        setInlineEventListenerForTypeAndAttribute(blurEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().blurEvent, attr);
     } else
         HTMLFormControlElement::parseMappedAttribute(attr);
 }
 
 void HTMLButtonElement::defaultEventHandler(Event* evt)
 {
-    if (evt->type() == DOMActivateEvent && !disabled()) {
+    if (evt->type() == eventNames().DOMActivateEvent && !disabled()) {
         if (form() && m_type == SUBMIT) {
             m_activeSubmit = true;
             form()->prepareSubmit(evt);
@@ -108,12 +107,12 @@ void HTMLButtonElement::defaultEventHandler(Event* evt)
     }
 
     if (evt->isKeyboardEvent()) {
-        if (evt->type() == keydownEvent && static_cast<KeyboardEvent*>(evt)->keyIdentifier() == "U+0020") {
+        if (evt->type() == eventNames().keydownEvent && static_cast<KeyboardEvent*>(evt)->keyIdentifier() == "U+0020") {
             setActive(true, true);
             // No setDefaultHandled() - IE dispatches a keypress in this case.
             return;
         }
-        if (evt->type() == keypressEvent) {
+        if (evt->type() == eventNames().keypressEvent) {
             switch (static_cast<KeyboardEvent*>(evt)->charCode()) {
                 case '\r':
                     dispatchSimulatedClick(evt);
@@ -127,7 +126,7 @@ void HTMLButtonElement::defaultEventHandler(Event* evt)
                     break;
             }
         }
-        if (evt->type() == keyupEvent && static_cast<KeyboardEvent*>(evt)->keyIdentifier() == "U+0020") {
+        if (evt->type() == eventNames().keyupEvent && static_cast<KeyboardEvent*>(evt)->keyIdentifier() == "U+0020") {
             if (active())
                 dispatchSimulatedClick(evt);
             evt->setDefaultHandled();
index cd0dd15..0f86a80 100644 (file)
@@ -46,7 +46,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 using std::min;
@@ -158,75 +157,75 @@ void HTMLElement::parseMappedAttribute(MappedAttribute *attr)
     }
 // standard events
     else if (attr->name() == onclickAttr) {
-        setInlineEventListenerForTypeAndAttribute(clickEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().clickEvent, attr);
     } else if (attr->name() == oncontextmenuAttr) {
-        setInlineEventListenerForTypeAndAttribute(contextmenuEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().contextmenuEvent, attr);
     } else if (attr->name() == ondblclickAttr) {
-        setInlineEventListenerForTypeAndAttribute(dblclickEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().dblclickEvent, attr);
     } else if (attr->name() == onmousedownAttr) {
-        setInlineEventListenerForTypeAndAttribute(mousedownEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mousedownEvent, attr);
     } else if (attr->name() == onmousemoveAttr) {
-        setInlineEventListenerForTypeAndAttribute(mousemoveEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mousemoveEvent, attr);
     } else if (attr->name() == onmouseoutAttr) {
-        setInlineEventListenerForTypeAndAttribute(mouseoutEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mouseoutEvent, attr);
     } else if (attr->name() == onmouseoverAttr) {
-        setInlineEventListenerForTypeAndAttribute(mouseoverEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mouseoverEvent, attr);
     } else if (attr->name() == onmouseupAttr) {
-        setInlineEventListenerForTypeAndAttribute(mouseupEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mouseupEvent, attr);
     } else if (attr->name() == onmousewheelAttr) {
-        setInlineEventListenerForTypeAndAttribute(mousewheelEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mousewheelEvent, attr);
     } else if (attr->name() == onfocusAttr) {
-        setInlineEventListenerForTypeAndAttribute(focusEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().focusEvent, attr);
     } else if (attr->name() == onblurAttr) {
-        setInlineEventListenerForTypeAndAttribute(blurEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().blurEvent, attr);
     } else if (attr->name() == onkeydownAttr) {
-        setInlineEventListenerForTypeAndAttribute(keydownEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().keydownEvent, attr);
     } else if (attr->name() == onkeypressAttr) {
-        setInlineEventListenerForTypeAndAttribute(keypressEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().keypressEvent, attr);
     } else if (attr->name() == onkeyupAttr) {
-        setInlineEventListenerForTypeAndAttribute(keyupEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().keyupEvent, attr);
     } else if (attr->name() == onscrollAttr) {
-        setInlineEventListenerForTypeAndAttribute(scrollEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().scrollEvent, attr);
     } else if (attr->name() == onbeforecutAttr) {
-        setInlineEventListenerForTypeAndAttribute(beforecutEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().beforecutEvent, attr);
     } else if (attr->name() == oncutAttr) {
-        setInlineEventListenerForTypeAndAttribute(cutEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().cutEvent, attr);
     } else if (attr->name() == onbeforecopyAttr) {
-        setInlineEventListenerForTypeAndAttribute(beforecopyEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().beforecopyEvent, attr);
     } else if (attr->name() == oncopyAttr) {
-        setInlineEventListenerForTypeAndAttribute(copyEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().copyEvent, attr);
     } else if (attr->name() == onbeforepasteAttr) {
-        setInlineEventListenerForTypeAndAttribute(beforepasteEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().beforepasteEvent, attr);
     } else if (attr->name() == onpasteAttr) {
-        setInlineEventListenerForTypeAndAttribute(pasteEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().pasteEvent, attr);
     } else if (attr->name() == ondragenterAttr) {
-        setInlineEventListenerForTypeAndAttribute(dragenterEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().dragenterEvent, attr);
     } else if (attr->name() == ondragoverAttr) {
-        setInlineEventListenerForTypeAndAttribute(dragoverEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().dragoverEvent, attr);
     } else if (attr->name() == ondragleaveAttr) {
-        setInlineEventListenerForTypeAndAttribute(dragleaveEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().dragleaveEvent, attr);
     } else if (attr->name() == ondropAttr) {
-        setInlineEventListenerForTypeAndAttribute(dropEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().dropEvent, attr);
     } else if (attr->name() == ondragstartAttr) {
-        setInlineEventListenerForTypeAndAttribute(dragstartEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().dragstartEvent, attr);
     } else if (attr->name() == ondragAttr) {
-        setInlineEventListenerForTypeAndAttribute(dragEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().dragEvent, attr);
     } else if (attr->name() == ondragendAttr) {
-        setInlineEventListenerForTypeAndAttribute(dragendEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().dragendEvent, attr);
     } else if (attr->name() == onselectstartAttr) {
-        setInlineEventListenerForTypeAndAttribute(selectstartEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().selectstartEvent, attr);
     } else if (attr->name() == onsubmitAttr) {
-        setInlineEventListenerForTypeAndAttribute(submitEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().submitEvent, attr);
     } else if (attr->name() == onerrorAttr) {
-        setInlineEventListenerForTypeAndAttribute(errorEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().errorEvent, attr);
     } else if (attr->name() == onwebkitanimationstartAttr) {
-        setInlineEventListenerForTypeAndAttribute(webkitAnimationStartEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().webkitAnimationStartEvent, attr);
     } else if (attr->name() == onwebkitanimationiterationAttr) {
-        setInlineEventListenerForTypeAndAttribute(webkitAnimationIterationEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().webkitAnimationIterationEvent, attr);
     } else if (attr->name() == onwebkitanimationendAttr) {
-        setInlineEventListenerForTypeAndAttribute(webkitAnimationEndEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().webkitAnimationEndEvent, attr);
     } else if (attr->name() == onwebkittransitionendAttr) {
-        setInlineEventListenerForTypeAndAttribute(webkitTransitionEndEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().webkitTransitionEndEvent, attr);
     }
 }
 
index 23f76ac..8e879fd 100644 (file)
@@ -39,7 +39,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f)
@@ -161,7 +160,7 @@ void HTMLFormControlElement::setName(const AtomicString &value)
 
 void HTMLFormControlElement::onChange()
 {
-    dispatchEventForType(changeEvent, true, false);
+    dispatchEventForType(eventNames().changeEvent, true, false);
 }
 
 bool HTMLFormControlElement::disabled() const
index ac05a84..0e4d88e 100644 (file)
@@ -60,7 +60,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 static const char hexDigits[17] = "0123456789ABCDEF";
@@ -123,7 +122,7 @@ void HTMLFormElement::removedFromDocument()
 void HTMLFormElement::handleLocalEvents(Event* event, bool useCapture)
 {
     EventTargetNode* targetNode = event->target()->toNode();
-    if (!useCapture && targetNode && targetNode != this && (event->type() == submitEvent || event->type() == resetEvent)) {
+    if (!useCapture && targetNode && targetNode != this && (event->type() == eventNames().submitEvent || event->type() == eventNames().resetEvent)) {
         event->stopPropagation();
         return;
     }
@@ -363,7 +362,7 @@ bool HTMLFormElement::prepareSubmit(Event* event)
     m_insubmit = true;
     m_doingsubmit = false;
 
-    if (dispatchEventForType(submitEvent, true, true) && !m_doingsubmit)
+    if (dispatchEventForType(eventNames().submitEvent, true, true) && !m_doingsubmit)
         m_doingsubmit = true;
 
     m_insubmit = false;
@@ -518,7 +517,7 @@ void HTMLFormElement::reset()
 
     // ### DOM2 labels this event as not cancelable, however
     // common browsers( sick! ) allow it be cancelled.
-    if ( !dispatchEventForType(resetEvent,true, true) ) {
+    if ( !dispatchEventForType(eventNames().resetEvent,true, true) ) {
         m_inreset = false;
         return;
     }
@@ -555,9 +554,9 @@ void HTMLFormElement::parseMappedAttribute(MappedAttribute* attr)
         else
             document()->unregisterForDocumentActivationCallbacks(this);
     } else if (attr->name() == onsubmitAttr)
-        setInlineEventListenerForTypeAndAttribute(submitEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().submitEvent, attr);
     else if (attr->name() == onresetAttr)
-        setInlineEventListenerForTypeAndAttribute(resetEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().resetEvent, attr);
     else if (attr->name() == nameAttr) {
         const AtomicString& newName = attr->value();
         if (inDocument() && document()->isHTMLDocument()) {
index 1711711..1c80155 100644 (file)
@@ -41,7 +41,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 HTMLFrameElementBase::HTMLFrameElementBase(const QualifiedName& tagName, Document *doc)
@@ -141,10 +140,10 @@ void HTMLFrameElementBase::parseMappedAttribute(MappedAttribute *attr)
         if (contentFrame())
             contentFrame()->setInViewSourceMode(viewSourceMode());
     } else if (attr->name() == onloadAttr) {
-        setInlineEventListenerForTypeAndAttribute(loadEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().loadEvent, attr);
     } else if (attr->name() == onbeforeunloadAttr) {
         // FIXME: should <frame> elements have beforeunload handlers?
-        setInlineEventListenerForTypeAndAttribute(beforeunloadEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().beforeunloadEvent, attr);
     } else
         HTMLFrameOwnerElement::parseMappedAttribute(attr);
 }
index 5b7d98f..a60ad86 100644 (file)
@@ -39,7 +39,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 HTMLFrameSetElement::HTMLFrameSetElement(Document *doc)
@@ -127,11 +126,11 @@ void HTMLFrameSetElement::parseMappedAttribute(MappedAttribute *attr)
             m_borderColorSet = true;
         }
     } else if (attr->name() == onloadAttr) {
-        document()->setWindowInlineEventListenerForTypeAndAttribute(loadEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().loadEvent, attr);
     } else if (attr->name() == onbeforeunloadAttr) {
-        document()->setWindowInlineEventListenerForTypeAndAttribute(beforeunloadEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().beforeunloadEvent, attr);
     } else if (attr->name() == onunloadAttr) {
-        document()->setWindowInlineEventListenerForTypeAndAttribute(unloadEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().unloadEvent, attr);
     } else
         HTMLElement::parseMappedAttribute(attr);
 }
index 37e10f0..ea05689 100644 (file)
@@ -36,7 +36,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 HTMLImageElement::HTMLImageElement(Document* doc, HTMLFormElement* f)
@@ -122,9 +121,9 @@ void HTMLImageElement::parseMappedAttribute(MappedAttribute* attr)
     } else if (attrName == ismapAttr)
         ismap = true;
     else if (attrName == onabortAttr)
-        setInlineEventListenerForTypeAndAttribute(abortEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().abortEvent, attr);
     else if (attrName == onloadAttr)
-        setInlineEventListenerForTypeAndAttribute(loadEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().loadEvent, attr);
     else if (attrName == compositeAttr) {
         if (!parseCompositeOperator(attr->value(), m_compositeOperator))
             m_compositeOperator = CompositeSourceOver;
index 1f736cb..22e3abc 100644 (file)
@@ -31,8 +31,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 HTMLImageLoader::HTMLImageLoader(Element* node)
     : ImageLoader(node)
 {
@@ -46,7 +44,7 @@ void HTMLImageLoader::dispatchLoadEvent()
 {
     if (!haveFiredLoadEvent() && image()) {
         setHaveFiredLoadEvent(true);
-        element()->dispatchEventForType(image()->errorOccurred() ? errorEvent : loadEvent, false, false);
+        element()->dispatchEventForType(image()->errorOccurred() ? eventNames().errorEvent : eventNames().loadEvent, false, false);
     }
 }
 
index fe3899f..50b7b7f 100644 (file)
@@ -61,7 +61,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 const int maxSavedResults = 256;
@@ -668,20 +667,20 @@ void HTMLInputElement::parseMappedAttribute(MappedAttribute *attr)
         if (respectHeightAndWidthAttrs())
             addCSSLength(attr, CSSPropertyHeight, attr->value());
     } else if (attr->name() == onfocusAttr) {
-        setInlineEventListenerForTypeAndAttribute(focusEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().focusEvent, attr);
     } else if (attr->name() == onblurAttr) {
-        setInlineEventListenerForTypeAndAttribute(blurEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().blurEvent, attr);
     } else if (attr->name() == onselectAttr) {
-        setInlineEventListenerForTypeAndAttribute(selectEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().selectEvent, attr);
     } else if (attr->name() == onchangeAttr) {
-        setInlineEventListenerForTypeAndAttribute(changeEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().changeEvent, attr);
     } else if (attr->name() == oninputAttr) {
-        setInlineEventListenerForTypeAndAttribute(inputEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().inputEvent, attr);
     }
     // Search field and slider attributes all just cause updateFromElement to be called through style
     // recalcing.
     else if (attr->name() == onsearchAttr) {
-        setInlineEventListenerForTypeAndAttribute(searchEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().searchEvent, attr);
     } else if (attr->name() == resultsAttr) {
         int oldResults = m_maxResults;
         m_maxResults = !attr->isNull() ? min(attr->value().toInt(), maxSavedResults) : -1;
@@ -1058,7 +1057,7 @@ void HTMLInputElement::setValueFromRenderer(const String& value)
     setValueMatchesRenderer();
 
     // Fire the "input" DOM event.
-    dispatchEventForType(inputEvent, true, false);
+    dispatchEventForType(eventNames().inputEvent, true, false);
 }
 
 void HTMLInputElement::setFileListFromRenderer(const Vector<String>& paths)
@@ -1099,7 +1098,7 @@ void* HTMLInputElement::preDispatchEventHandler(Event *evt)
     // This result gives us enough info to perform the "undo" in postDispatch of the action we take here.
     void* result = 0; 
     if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->isMouseEvent()
-            && evt->type() == clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+            && evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
         if (inputType() == CHECKBOX) {
             // As a way to store the state, we return 0 if we were unchecked, 1 if we were checked, and 2 for
             // indeterminate.
@@ -1137,7 +1136,7 @@ void* HTMLInputElement::preDispatchEventHandler(Event *evt)
 void HTMLInputElement::postDispatchEventHandler(Event *evt, void* data)
 {
     if ((inputType() == CHECKBOX || inputType() == RADIO) && evt->isMouseEvent()
-            && evt->type() == clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+            && evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
         if (inputType() == CHECKBOX) {
             // Reverse the checking we did in preDispatch.
             if (evt->defaultPrevented() || evt->defaultHandled()) {
@@ -1172,10 +1171,10 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
 {
     bool clickDefaultFormButton = false;
 
-    if (isTextField() && evt->type() == textInputEvent && evt->isTextEvent() && static_cast<TextEvent*>(evt)->data() == "\n")
+    if (isTextField() && evt->type() == eventNames().textInputEvent && evt->isTextEvent() && static_cast<TextEvent*>(evt)->data() == "\n")
         clickDefaultFormButton = true;
 
-    if (inputType() == IMAGE && evt->isMouseEvent() && evt->type() == clickEvent) {
+    if (inputType() == IMAGE && evt->isMouseEvent() && evt->type() == eventNames().clickEvent) {
         // record the mouse position for when we get the DOMActivate event
         MouseEvent* me = static_cast<MouseEvent*>(evt);
         // FIXME: We could just call offsetX() and offsetY() on the event,
@@ -1192,14 +1191,14 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
         }
     }
 
-    if (isTextField() && evt->type() == keydownEvent && evt->isKeyboardEvent() && focused() && document()->frame()
+    if (isTextField() && evt->type() == eventNames().keydownEvent && evt->isKeyboardEvent() && focused() && document()->frame()
                 && document()->frame()->doTextFieldCommandFromEvent(this, static_cast<KeyboardEvent*>(evt))) {
         evt->setDefaultHandled();
         return;
     }
 
     if (inputType() == RADIO && evt->isMouseEvent()
-            && evt->type() == clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+            && evt->type() == eventNames().clickEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
         evt->setDefaultHandled();
         return;
     }
@@ -1215,7 +1214,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
     // actually submitting the form. For reset inputs, the form is reset. These events are sent when the user clicks
     // on the element, or presses enter while it is the active element. JavaScript code wishing to activate the element
     // must dispatch a DOMActivate event - a click event will not do the job.
-    if (evt->type() == DOMActivateEvent && !disabled()) {
+    if (evt->type() == eventNames().DOMActivateEvent && !disabled()) {
         if (inputType() == IMAGE || inputType() == SUBMIT || inputType() == RESET) {
             if (!form())
                 return;
@@ -1239,7 +1238,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
 
     // Use key press event here since sending simulated mouse events
     // on key down blocks the proper sending of the key press event.
-    if (evt->type() == keypressEvent && evt->isKeyboardEvent()) {
+    if (evt->type() == eventNames().keypressEvent && evt->isKeyboardEvent()) {
         bool clickElement = false;
 
         int charCode = static_cast<KeyboardEvent*>(evt)->charCode();
@@ -1291,7 +1290,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
         }
     }
 
-    if (evt->type() == keydownEvent && evt->isKeyboardEvent()) {
+    if (evt->type() == eventNames().keydownEvent && evt->isKeyboardEvent()) {
         String key = static_cast<KeyboardEvent*>(evt)->keyIdentifier();
 
         if (key == "U+0020") {
@@ -1347,7 +1346,7 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
         }
     }
 
-    if (evt->type() == keyupEvent && evt->isKeyboardEvent()) {
+    if (evt->type() == eventNames().keyupEvent && evt->isKeyboardEvent()) {
         bool clickElement = false;
 
         String key = static_cast<KeyboardEvent*>(evt)->keyIdentifier();
@@ -1422,12 +1421,12 @@ void HTMLInputElement::defaultEventHandler(Event* evt)
         textEvent->setText(constrainValue(textEvent->text(), maxNewLen));
     }
 
-    if (isTextField() && renderer() && (evt->isMouseEvent() || evt->isDragEvent() || evt->isWheelEvent() || evt->type() == blurEvent || evt->type() == focusEvent))
+    if (isTextField() && renderer() && (evt->isMouseEvent() || evt->isDragEvent() || evt->isWheelEvent() || evt->type() == eventNames().blurEvent || evt->type() == eventNames().focusEvent))
         static_cast<RenderTextControl*>(renderer())->forwardEvent(evt);
 
     if (inputType() == RANGE && renderer()) {
         RenderSlider* slider = static_cast<RenderSlider*>(renderer());
-        if (evt->isMouseEvent() && evt->type() == mousedownEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+        if (evt->isMouseEvent() && evt->type() == eventNames().mousedownEvent && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
             MouseEvent* mEvt = static_cast<MouseEvent*>(evt);
             if (!slider->mouseEventIsInThumb(mEvt)) {
                 IntPoint eventOffset(mEvt->offsetX(), mEvt->offsetY());
@@ -1624,7 +1623,7 @@ void HTMLInputElement::onSearch()
     ASSERT(isSearchField());
     if (renderer())
         static_cast<RenderTextControl*>(renderer())->stopSearchEventTimer();
-    dispatchEventForType(searchEvent, true, false);
+    dispatchEventForType(eventNames().searchEvent, true, false);
 }
 
 Selection HTMLInputElement::selection() const
index b445888..6d97bc1 100644 (file)
@@ -34,7 +34,6 @@
 namespace WebCore {
 
 using namespace HTMLNames;
-using namespace EventNames;
 
 HTMLLabelElement::HTMLLabelElement(Document *doc)
     : HTMLElement(labelTag, doc)
@@ -103,7 +102,7 @@ void HTMLLabelElement::defaultEventHandler(Event* evt)
 {
     static bool processingClick = false;
 
-    if (evt->type() == clickEvent && !processingClick) {
+    if (evt->type() == eventNames().clickEvent && !processingClick) {
         RefPtr<HTMLElement> control = correspondingControl();
 
         // If we can't find a control or if the control received the click
index 6153fbf..f86c44d 100644 (file)
@@ -53,7 +53,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* doc)
@@ -286,7 +285,7 @@ void HTMLMediaElement::load(ExceptionCode& ec)
     if (m_begun) {
         m_begun = false;
         m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED);
-        initAndDispatchProgressEvent(abortEvent);
+        initAndDispatchProgressEvent(eventNames().abortEvent);
         if (m_loadNestingLevel < m_terminateLoadBelowNestingLevel)
             goto end;
     }
@@ -310,7 +309,7 @@ void HTMLMediaElement::load(ExceptionCode& ec)
             m_player->seek(0);
         }
         m_currentLoop = 0;
-        dispatchEventForType(emptiedEvent, false, true);
+        dispatchEventForType(eventNames().emptiedEvent, false, true);
         if (m_loadNestingLevel < m_terminateLoadBelowNestingLevel)
             goto end;
     }
@@ -330,7 +329,7 @@ void HTMLMediaElement::load(ExceptionCode& ec)
     
     // 9
     m_begun = true;        
-    dispatchProgressEvent(loadstartEvent, false, 0, 0);
+    dispatchProgressEvent(eventNames().loadstartEvent, false, 0, 0);
     if (m_loadNestingLevel < m_terminateLoadBelowNestingLevel)
         goto end;
     
@@ -376,7 +375,7 @@ void HTMLMediaElement::mediaPlayerNetworkStateChanged(MediaPlayer*)
         m_progressEventTimer.stop();
         m_bufferingRate = 0;
         
-        initAndDispatchProgressEvent(errorEvent); 
+        initAndDispatchProgressEvent(eventNames().errorEvent); 
         if (m_loadNestingLevel < m_terminateLoadBelowNestingLevel)
             return;
         
@@ -385,7 +384,7 @@ void HTMLMediaElement::mediaPlayerNetworkStateChanged(MediaPlayer*)
         if (isVideo())
             static_cast<HTMLVideoElement*>(this)->updatePosterImage();
 
-        dispatchEventForType(emptiedEvent, false, true);
+        dispatchEventForType(eventNames().emptiedEvent, false, true);
         return;
     }
     
@@ -396,11 +395,11 @@ void HTMLMediaElement::mediaPlayerNetworkStateChanged(MediaPlayer*)
         m_player->seek(effectiveStart());
         m_networkState = LOADED_METADATA;
         
-        dispatchEventForType(durationchangeEvent, false, true);
+        dispatchEventForType(eventNames().durationchangeEvent, false, true);
         if (m_loadNestingLevel < m_terminateLoadBelowNestingLevel)
             return;
         
-        dispatchEventForType(loadedmetadataEvent, false, true);
+        dispatchEventForType(eventNames().loadedmetadataEvent, false, true);
         if (m_loadNestingLevel < m_terminateLoadBelowNestingLevel)
             return;
     }
@@ -422,11 +421,11 @@ void HTMLMediaElement::mediaPlayerNetworkStateChanged(MediaPlayer*)
             static_cast<RenderVideo*>(renderer())->videoSizeChanged();
         }
         
-        dispatchEventForType(loadedfirstframeEvent, false, true);
+        dispatchEventForType(eventNames().loadedfirstframeEvent, false, true);
         if (m_loadNestingLevel < m_terminateLoadBelowNestingLevel)
             return;
         
-        dispatchEventForType(canshowcurrentframeEvent, false, true);
+        dispatchEventForType(eventNames().canshowcurrentframeEvent, false, true);
         if (m_loadNestingLevel < m_terminateLoadBelowNestingLevel)
             return;
     }
@@ -437,7 +436,7 @@ void HTMLMediaElement::mediaPlayerNetworkStateChanged(MediaPlayer*)
         m_networkState = LOADED;
         m_progressEventTimer.stop();
         m_bufferingRate = 0;
-        initAndDispatchProgressEvent(loadEvent); 
+        initAndDispatchProgressEvent(eventNames().loadEvent); 
     }
 }
 
@@ -463,25 +462,25 @@ void HTMLMediaElement::setReadyState(ReadyState state)
         return;
     
     if (state == DATA_UNAVAILABLE) {
-        dispatchEventForType(dataunavailableEvent, false, true);
+        dispatchEventForType(eventNames().dataunavailableEvent, false, true);
         if (wasActivelyPlaying) {
-            dispatchEventForType(timeupdateEvent, false, true);
-            dispatchEventForType(waitingEvent, false, true);
+            dispatchEventForType(eventNames().timeupdateEvent, false, true);
+            dispatchEventForType(eventNames().waitingEvent, false, true);
         }
     } else if (state == CAN_SHOW_CURRENT_FRAME) {
         if (m_loadedFirstFrame)
-            dispatchEventForType(canshowcurrentframeEvent, false, true);
+            dispatchEventForType(eventNames().canshowcurrentframeEvent, false, true);
         if (wasActivelyPlaying) {
-            dispatchEventForType(timeupdateEvent, false, true);
-            dispatchEventForType(waitingEvent, false, true);
+            dispatchEventForType(eventNames().timeupdateEvent, false, true);
+            dispatchEventForType(eventNames().waitingEvent, false, true);
         }
     } else if (state == CAN_PLAY) {
-        dispatchEventForType(canplayEvent, false, true);
+        dispatchEventForType(eventNames().canplayEvent, false, true);
     } else if (state == CAN_PLAY_THROUGH) {
-        dispatchEventForType(canplaythroughEvent, false, true);
+        dispatchEventForType(eventNames().canplaythroughEvent, false, true);
         if (m_autoplaying && m_paused && autoplay()) {
             m_paused = false;
-            dispatchEventForType(playEvent, false, true);
+            dispatchEventForType(eventNames().playEvent, false, true);
         }
     }
     updatePlayState();
@@ -499,11 +498,11 @@ void HTMLMediaElement::progressEventTimerFired(Timer<HTMLMediaElement>*)
     if (progress == m_previousProgress) {
         if (timedelta > 3.0 && !m_sentStalledEvent) {
             m_bufferingRate = 0;
-            initAndDispatchProgressEvent(stalledEvent);
+            initAndDispatchProgressEvent(eventNames().stalledEvent);
             m_sentStalledEvent = true;
         }
     } else {
-        initAndDispatchProgressEvent(progressEvent);
+        initAndDispatchProgressEvent(eventNames().progressEvent);
         m_previousProgress = progress;
         m_previousProgressTime = time;
         m_sentStalledEvent = false;
@@ -549,7 +548,7 @@ void HTMLMediaElement::seek(float time, ExceptionCode& ec)
     m_seeking = true;
     
     // 9
-    dispatchEventForType(timeupdateEvent, false, true);
+    dispatchEventForType(eventNames().timeupdateEvent, false, true);
     
     // 10
     // As soon as the user agent has established whether or not the media data for the new playback position is available, 
@@ -608,7 +607,7 @@ void HTMLMediaElement::setDefaultPlaybackRate(float rate, ExceptionCode& ec)
     }
     if (m_defaultPlaybackRate != rate) {
         m_defaultPlaybackRate = rate;
-        dispatchEventAsync(ratechangeEvent);
+        dispatchEventAsync(eventNames().ratechangeEvent);
     }
 }
 
@@ -625,7 +624,7 @@ void HTMLMediaElement::setPlaybackRate(float rate, ExceptionCode& ec)
     }
     if (m_player && m_player->rate() != rate) {
         m_player->setRate(rate);
-        dispatchEventAsync(ratechangeEvent);
+        dispatchEventAsync(eventNames().ratechangeEvent);
     }
 }
 
@@ -662,7 +661,7 @@ void HTMLMediaElement::play(ExceptionCode& ec)
     
     if (m_paused) {
         m_paused = false;
-        dispatchEventAsync(playEvent);
+        dispatchEventAsync(eventNames().playEvent);
     }
 
     m_autoplaying = false;
@@ -682,8 +681,8 @@ void HTMLMediaElement::pause(ExceptionCode& ec)
 
     if (!m_paused) {
         m_paused = true;
-        dispatchEventAsync(timeupdateEvent);
-        dispatchEventAsync(pauseEvent);
+        dispatchEventAsync(eventNames().timeupdateEvent);
+        dispatchEventAsync(eventNames().pauseEvent);
     }
 
     m_autoplaying = false;
@@ -787,7 +786,7 @@ void HTMLMediaElement::setVolume(float vol, ExceptionCode& ec)
     if (m_volume != vol) {
         m_volume = vol;
         updateVolume();
-        dispatchEventAsync(volumechangeEvent);
+        dispatchEventAsync(eventNames().volumechangeEvent);
     }
 }
 
@@ -801,7 +800,7 @@ void HTMLMediaElement::setMuted(bool muted)
     if (m_muted != muted) {
         m_muted = muted;
         updateVolume();
-        dispatchEventAsync(volumechangeEvent);
+        dispatchEventAsync(eventNames().volumechangeEvent);
     }
 }
 
@@ -890,12 +889,12 @@ void HTMLMediaElement::mediaPlayerTimeChanged(MediaPlayer*)
         ExceptionCode ec;
         seek(effectiveLoopStart(), ec);
         m_currentLoop++;
-        dispatchEventForType(timeupdateEvent, false, true);
+        dispatchEventForType(eventNames().timeupdateEvent, false, true);
     }
     
     if (m_currentLoop == playCount() - 1 && currentTime() >= effectiveEnd()) {
-        dispatchEventForType(timeupdateEvent, false, true);
-        dispatchEventForType(endedEvent, false, true);
+        dispatchEventForType(eventNames().timeupdateEvent, false, true);
+        dispatchEventForType(eventNames().endedEvent, false, true);
     }
 
     updatePlayState();
@@ -1018,11 +1017,11 @@ void HTMLMediaElement::documentWillBecomeInactive()
 
         m_error = MediaError::create(MediaError::MEDIA_ERR_ABORTED);
         m_begun = false;
-        initAndDispatchProgressEvent(abortEvent);
+        initAndDispatchProgressEvent(eventNames().abortEvent);
         if (m_networkState >= LOADING) {
             m_networkState = EMPTY;
             m_readyState = DATA_UNAVAILABLE;
-            dispatchEventForType(emptiedEvent, false, true);
+            dispatchEventForType(eventNames().emptiedEvent, false, true);
         }
     }
     m_inActiveDocument = false;
index 466b447..940d0b4 100644 (file)
@@ -42,7 +42,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 HTMLObjectElement::HTMLObjectElement(Document* doc, bool createdByParser) 
@@ -94,7 +93,7 @@ void HTMLObjectElement::parseMappedAttribute(MappedAttribute *attr)
         if (renderer())
           m_needWidgetUpdate = true;
     } else if (attr->name() == onloadAttr) {
-        setInlineEventListenerForTypeAndAttribute(loadEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().loadEvent, attr);
     } else if (attr->name() == nameAttr) {
         const AtomicString& newName = attr->value();
         if (isDocNamedItem() && inDocument() && document()->isHTMLDocument()) {
index c629f8d..887a4e5 100644 (file)
@@ -29,7 +29,6 @@
 
 #include "CSSStyleSelector.h"
 #include "Document.h"
-#include "EventNames.h"
 #include "ExceptionCode.h"
 #include "HTMLNames.h"
 #include "HTMLSelectElement.h"
@@ -41,7 +40,6 @@
 namespace WebCore {
 
 using namespace HTMLNames;
-using namespace EventNames;
 
 HTMLOptionElement::HTMLOptionElement(Document* doc, HTMLFormElement* f)
     : HTMLFormControlElement(optionTag, doc, f)
index ea30683..ce334d7 100644 (file)
@@ -31,7 +31,6 @@
 namespace WebCore {
 
 using namespace HTMLNames;
-using namespace EventNames;
 
 HTMLScriptElement::HTMLScriptElement(Document* doc)
     : HTMLElement(scriptTag, doc)
@@ -71,7 +70,7 @@ void HTMLScriptElement::parseMappedAttribute(MappedAttribute* attr)
     if (attrName == srcAttr)
         handleSourceAttribute(m_data, attr->value());
     else if (attrName == onloadAttr)
-        setInlineEventListenerForTypeAndAttribute(loadEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().loadEvent, attr);
     else
         HTMLElement::parseMappedAttribute(attr);
 }
@@ -217,12 +216,12 @@ void HTMLScriptElement::dispatchLoadEvent()
     ASSERT(!m_data.haveFiredLoadEvent());
     m_data.setHaveFiredLoadEvent(true);
 
-    dispatchEventForType(loadEvent, false, false);
+    dispatchEventForType(eventNames().loadEvent, false, false);
 }
 
 void HTMLScriptElement::dispatchErrorEvent()
 {
-    dispatchEventForType(errorEvent, true, false);
+    dispatchEventForType(eventNames().errorEvent, true, false);
 }
 
 }
index ec17fad..91cef6f 100644 (file)
@@ -58,7 +58,6 @@ using namespace Unicode;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 static const DOMTimeStamp typeAheadTimeout = 1000;
@@ -374,11 +373,11 @@ void HTMLSelectElement::parseMappedAttribute(MappedAttribute *attr)
         // Don't map 'align' attribute.  This matches what Firefox, Opera and IE do.
         // See http://bugs.webkit.org/show_bug.cgi?id=12072
     } else if (attr->name() == onfocusAttr) {
-        setInlineEventListenerForTypeAndAttribute(focusEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().focusEvent, attr);
     } else if (attr->name() == onblurAttr) {
-        setInlineEventListenerForTypeAndAttribute(blurEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().blurEvent, attr);
     } else if (attr->name() == onchangeAttr) {
-        setInlineEventListenerForTypeAndAttribute(changeEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().changeEvent, attr);
     } else
         HTMLFormControlElementWithState::parseMappedAttribute(attr);
 }
@@ -607,7 +606,7 @@ void HTMLSelectElement::defaultEventHandler(Event* evt)
     if (evt->defaultHandled())
         return;
 
-    if (evt->type() == keypressEvent && evt->isKeyboardEvent()) {
+    if (evt->type() == eventNames().keypressEvent && evt->isKeyboardEvent()) {
         KeyboardEvent* keyboardEvent = static_cast<KeyboardEvent*>(evt);
     
         if (!keyboardEvent->ctrlKey() && !keyboardEvent->altKey() && !keyboardEvent->metaKey() &&
@@ -625,7 +624,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* evt)
 {
     RenderMenuList* menuList = static_cast<RenderMenuList*>(renderer());
 
-    if (evt->type() == keydownEvent) {
+    if (evt->type() == eventNames().keydownEvent) {
         if (!renderer() || !evt->isKeyboardEvent())
             return;
         String keyIdentifier = static_cast<KeyboardEvent*>(evt)->keyIdentifier();
@@ -667,7 +666,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* evt)
 
     // Use key press event here since sending simulated mouse events
     // on key down blocks the proper sending of the key press event.
-    if (evt->type() == keypressEvent) {
+    if (evt->type() == eventNames().keypressEvent) {
         if (!renderer() || !evt->isKeyboardEvent())
             return;
         int keyCode = static_cast<KeyboardEvent*>(evt)->keyCode();
@@ -699,7 +698,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* evt)
             evt->setDefaultHandled();
     }
 
-    if (evt->type() == mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+    if (evt->type() == eventNames().mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
         focus();
         if (menuList->popupIsVisible())
             menuList->hidePopup();
@@ -715,7 +714,7 @@ void HTMLSelectElement::menuListDefaultEventHandler(Event* evt)
 
 void HTMLSelectElement::listBoxDefaultEventHandler(Event* evt)
 {
-    if (evt->type() == mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+    if (evt->type() == eventNames().mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
         focus();
         
         MouseEvent* mEvt = static_cast<MouseEvent*>(evt);
@@ -775,10 +774,10 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* evt)
 
             evt->setDefaultHandled();
         }
-    } else if (evt->type() == mouseupEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton && document()->frame()->eventHandler()->autoscrollRenderer() != renderer())
+    } else if (evt->type() == eventNames().mouseupEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton && document()->frame()->eventHandler()->autoscrollRenderer() != renderer())
         // This makes sure we fire onChange for a single click.  For drag selection, onChange will fire when the autoscroll timer stops.
         listBoxOnChange();
-    else if (evt->type() == keydownEvent) {
+    else if (evt->type() == eventNames().keydownEvent) {
         if (!evt->isKeyboardEvent())
             return;
         String keyIdentifier = static_cast<KeyboardEvent*>(evt)->keyIdentifier();
@@ -819,7 +818,7 @@ void HTMLSelectElement::listBoxDefaultEventHandler(Event* evt)
             listBoxOnChange();
             evt->setDefaultHandled();
         }
-    } else if (evt->type() == keypressEvent) {
+    } else if (evt->type() == eventNames().keypressEvent) {
         if (!evt->isKeyboardEvent())
             return;
         int keyCode = static_cast<KeyboardEvent*>(evt)->keyCode();
index 7897d8b..85da131 100644 (file)
@@ -41,7 +41,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 static const int defaultRows = 2;
@@ -168,13 +167,13 @@ void HTMLTextAreaElement::parseMappedAttribute(MappedAttribute* attr)
         // Don't map 'align' attribute.  This matches what Firefox, Opera and IE do.
         // See http://bugs.webkit.org/show_bug.cgi?id=7075
     } else if (attr->name() == onfocusAttr)
-        setInlineEventListenerForTypeAndAttribute(focusEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().focusEvent, attr);
     else if (attr->name() == onblurAttr)
-        setInlineEventListenerForTypeAndAttribute(blurEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().blurEvent, attr);
     else if (attr->name() == onselectAttr)
-        setInlineEventListenerForTypeAndAttribute(selectEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().selectEvent, attr);
     else if (attr->name() == onchangeAttr)
-        setInlineEventListenerForTypeAndAttribute(changeEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().changeEvent, attr);
     else
         HTMLFormControlElementWithState::parseMappedAttribute(attr);
 }
@@ -233,7 +232,7 @@ void HTMLTextAreaElement::updateFocusAppearance(bool restorePreviousSelection)
 
 void HTMLTextAreaElement::defaultEventHandler(Event* event)
 {
-    if (renderer() && (event->isMouseEvent() || event->isDragEvent() || event->isWheelEvent() || event->type() == blurEvent))
+    if (renderer() && (event->isMouseEvent() || event->isDragEvent() || event->isWheelEvent() || event->type() == eventNames().blurEvent))
         static_cast<RenderTextControl*>(renderer())->forwardEvent(event);
 
     HTMLFormControlElementWithState::defaultEventHandler(event);
index e20b7b8..627a3f5 100644 (file)
@@ -58,7 +58,6 @@ using namespace WTF;
 namespace WebCore {
 
 using namespace HTMLNames;
-using namespace EventNames;
 
 #if MOBILE
 // The mobile device needs to be responsive, as such the tokenizer chunk size is reduced.
@@ -2006,11 +2005,11 @@ void HTMLTokenizer::notifyFinished(CachedResource*)
 #endif
 
         if (errorOccurred)
-            EventTargetNodeCast(n.get())->dispatchEventForType(errorEvent, true, false);
+            EventTargetNodeCast(n.get())->dispatchEventForType(eventNames().errorEvent, true, false);
         else {
             if (static_cast<HTMLScriptElement*>(n.get())->shouldExecuteAsJavaScript())
                 m_state = scriptExecution(scriptSource, m_state, cachedScriptUrl);
-            EventTargetNodeCast(n.get())->dispatchEventForType(loadEvent, false, false);
+            EventTargetNodeCast(n.get())->dispatchEventForType(eventNames().loadEvent, false, false);
         }
 
         // The state of pendingScripts.isEmpty() can change inside the scriptExecution()
index bfa39e6..8516adf 100644 (file)
@@ -112,7 +112,6 @@ namespace WebCore {
 using namespace SVGNames;
 #endif
 using namespace HTMLNames;
-using namespace EventNames;
 
 #if USE(LOW_BANDWIDTH_DISPLAY)
 const unsigned int cMaxPendingSourceLengthInLowBandwidthDisplay = 128 * 1024;
@@ -592,7 +591,7 @@ void FrameLoader::stopLoading(bool sendUnload)
                 Node* currentFocusedNode = m_frame->document()->focusedNode();
                 if (currentFocusedNode)
                     currentFocusedNode->aboutToUnload();
-                m_frame->document()->dispatchWindowEvent(unloadEvent, false, false);
+                m_frame->document()->dispatchWindowEvent(eventNames().unloadEvent, false, false);
                 if (m_frame->document())
                     m_frame->document()->updateRendering();
                 m_wasUnloadEventEmitted = true;
@@ -1911,7 +1910,7 @@ bool FrameLoader::canCachePage()
         && !m_containsPlugIns
         && !m_URL.protocolIs("https")
         && m_frame->document()
-        && !m_frame->document()->hasWindowEventListener(unloadEvent)
+        && !m_frame->document()->hasWindowEventListener(eventNames().unloadEvent)
 #if ENABLE(DATABASE)
         && !m_frame->document()->hasOpenDatabases()
 #endif
index 15ae2b5..39b1db6 100644 (file)
@@ -47,7 +47,6 @@ using std::min;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 class ImageEventListener : public EventListener {
@@ -339,9 +338,9 @@ bool ImageDocument::shouldShrinkToFit() const
 
 void ImageEventListener::handleEvent(Event* event, bool isWindowEvent)
 {
-    if (event->type() == resizeEvent)
+    if (event->type() == eventNames().resizeEvent)
         m_doc->windowSizeChanged();
-    else if (event->type() == clickEvent) {
+    else if (event->type() == eventNames().clickEvent) {
         MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
         m_doc->imageClicked(mouseEvent->x(), mouseEvent->y());
     }
index acf6217..da159b4 100644 (file)
 #include "DocLoader.h"
 #include "Document.h"
 #include "Element.h"
-#include "EventNames.h"
 #include "RenderImage.h"
 
 namespace WebCore {
 
-using namespace EventNames;
-
 ImageLoader::ImageLoader(Element* elt)
     : m_element(elt)
     , m_image(0)
index 31da741..5689457 100644 (file)
@@ -47,7 +47,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 class MediaTokenizer : public Tokenizer {
@@ -151,12 +150,12 @@ void MediaDocument::defaultEventHandler(Event* event)
     if (targetNode && targetNode->hasTagName(videoTag)) {
         HTMLVideoElement* video = static_cast<HTMLVideoElement*>(targetNode);
         ExceptionCode ec;
-        if (event->type() == clickEvent) {
+        if (event->type() == eventNames().clickEvent) {
             if (!video->canPlay()) {
                 video->pause(ec);
                 event->setDefaultHandled();
             }
-        } else if (event->type() == dblclickEvent) {
+        } else if (event->type() == eventNames().dblclickEvent) {
             if (video->canPlay()) {
                 video->play(ec);
                 event->setDefaultHandled();
index ee6a7e7..f872a50 100644 (file)
@@ -40,8 +40,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 DOMApplicationCache::DOMApplicationCache(Frame* frame)
     : m_frame(frame)
 {
@@ -250,37 +248,37 @@ void DOMApplicationCache::callListener(const AtomicString& eventType, EventListe
 
 void DOMApplicationCache::callCheckingListener()
 {
-    callListener(checkingEvent, m_onCheckingListener.get());
+    callListener(eventNames().checkingEvent, m_onCheckingListener.get());
 }
 
 void DOMApplicationCache::callErrorListener()
 {
-    callListener(errorEvent, m_onErrorListener.get());
+    callListener(eventNames().errorEvent, m_onErrorListener.get());
 }
 
 void DOMApplicationCache::callNoUpdateListener()
 {
-    callListener(noupdateEvent, m_onNoUpdateListener.get());
+    callListener(eventNames().noupdateEvent, m_onNoUpdateListener.get());
 }
 
 void DOMApplicationCache::callDownloadingListener()
 {
-    callListener(downloadingEvent, m_onDownloadingListener.get());
+    callListener(eventNames().downloadingEvent, m_onDownloadingListener.get());
 }
 
 void DOMApplicationCache::callProgressListener()
 {
-    callListener(progressEvent, m_onProgressListener.get());
+    callListener(eventNames().progressEvent, m_onProgressListener.get());
 }
 
 void DOMApplicationCache::callUpdateReadyListener()
 {
-    callListener(updatereadyEvent, m_onUpdateReadyListener.get());
+    callListener(eventNames().updatereadyEvent, m_onUpdateReadyListener.get());
 }
 
 void DOMApplicationCache::callCachedListener()
 {
-    callListener(cachedEvent, m_onCachedListener.get());
+    callListener(eventNames().cachedEvent, m_onCachedListener.get());
 }
 
 } // namespace WebCore
index 2e21cf6..6be8c1a 100644 (file)
@@ -32,7 +32,6 @@
 #include "AccessibilityRenderObject.h"
 #include "AXObjectCache.h"
 #include "CharacterNames.h"
-#include "EventNames.h"
 #include "FloatRect.h"
 #include "FocusController.h"
 #include "Frame.h"
@@ -57,7 +56,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 AccessibilityObject::AccessibilityObject()
index 6a78889..144aab0 100644 (file)
@@ -75,7 +75,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 AccessibilityRenderObject::AccessibilityRenderObject(RenderObject* renderer)
@@ -505,7 +504,7 @@ Element* AccessibilityRenderObject::mouseButtonListener() const
     
     // FIXME: Do the continuation search like anchorElement does
     for (EventTargetNode* elt = static_cast<EventTargetNode*>(node); elt; elt = static_cast<EventTargetNode*>(elt->parentNode())) {
-        if (elt->inlineEventListenerForType(clickEvent) || elt->inlineEventListenerForType(mousedownEvent) || elt->inlineEventListenerForType(mouseupEvent))
+        if (elt->inlineEventListenerForType(eventNames().clickEvent) || elt->inlineEventListenerForType(eventNames().mousedownEvent) || elt->inlineEventListenerForType(eventNames().mouseupEvent))
             return static_cast<Element*>(elt);
     }
     
index c9345c2..813f8e2 100644 (file)
@@ -58,8 +58,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 ContextMenuController::ContextMenuController(Page* page, ContextMenuClient* client)
     : m_page(page)
     , m_client(client)
@@ -81,7 +79,7 @@ void ContextMenuController::clearContextMenu()
 
 void ContextMenuController::handleContextMenuEvent(Event* event)
 {
-    ASSERT(event->type() == contextmenuEvent);
+    ASSERT(event->type() == eventNames().contextmenuEvent);
     if (!event->isMouseEvent())
         return;
     MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
index 08615eb..90b98b3 100644 (file)
@@ -78,8 +78,6 @@ using std::max;
 
 namespace WebCore {
 
-using namespace EventNames;
-
 class PostMessageTimer : public TimerBase {
 public:
     PostMessageTimer(DOMWindow* window, PassRefPtr<MessageEvent> event, SecurityOrigin* targetOrigin)
@@ -941,292 +939,292 @@ inline EventListener* DOMWindow::inlineEventListenerForType(const AtomicString&
 
 EventListener* DOMWindow::onabort() const
 {
-    return inlineEventListenerForType(abortEvent);
+    return inlineEventListenerForType(eventNames().abortEvent);
 }
 
 void DOMWindow::setOnabort(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(abortEvent, eventListener);
+    setInlineEventListenerForType(eventNames().abortEvent, eventListener);
 }
 
 EventListener* DOMWindow::onblur() const
 {
-    return inlineEventListenerForType(blurEvent);
+    return inlineEventListenerForType(eventNames().blurEvent);
 }
 
 void DOMWindow::setOnblur(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(blurEvent, eventListener);
+    setInlineEventListenerForType(eventNames().blurEvent, eventListener);
 }
 
 EventListener* DOMWindow::onchange() const
 {
-    return inlineEventListenerForType(changeEvent);
+    return inlineEventListenerForType(eventNames().changeEvent);
 }
 
 void DOMWindow::setOnchange(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(changeEvent, eventListener);
+    setInlineEventListenerForType(eventNames().changeEvent, eventListener);
 }
 
 EventListener* DOMWindow::onclick() const
 {
-    return inlineEventListenerForType(clickEvent);
+    return inlineEventListenerForType(eventNames().clickEvent);
 }
 
 void DOMWindow::setOnclick(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(clickEvent, eventListener);
+    setInlineEventListenerForType(eventNames().clickEvent, eventListener);
 }
 
 EventListener* DOMWindow::ondblclick() const
 {
-    return inlineEventListenerForType(dblclickEvent);
+    return inlineEventListenerForType(eventNames().dblclickEvent);
 }
 
 void DOMWindow::setOndblclick(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(dblclickEvent, eventListener);
+    setInlineEventListenerForType(eventNames().dblclickEvent, eventListener);
 }
 
 EventListener* DOMWindow::onerror() const
 {
-    return inlineEventListenerForType(errorEvent);
+    return inlineEventListenerForType(eventNames().errorEvent);
 }
 
 void DOMWindow::setOnerror(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(errorEvent, eventListener);
+    setInlineEventListenerForType(eventNames().errorEvent, eventListener);
 }
 
 EventListener* DOMWindow::onfocus() const
 {
-    return inlineEventListenerForType(focusEvent);
+    return inlineEventListenerForType(eventNames().focusEvent);
 }
 
 void DOMWindow::setOnfocus(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(focusEvent, eventListener);
+    setInlineEventListenerForType(eventNames().focusEvent, eventListener);
 }
 
 EventListener* DOMWindow::onkeydown() const
 {
-    return inlineEventListenerForType(keydownEvent);
+    return inlineEventListenerForType(eventNames().keydownEvent);
 }
 
 void DOMWindow::setOnkeydown(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(keydownEvent, eventListener);
+    setInlineEventListenerForType(eventNames().keydownEvent, eventListener);
 }
 
 EventListener* DOMWindow::onkeypress() const
 {
-    return inlineEventListenerForType(keypressEvent);
+    return inlineEventListenerForType(eventNames().keypressEvent);
 }
 
 void DOMWindow::setOnkeypress(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(keypressEvent, eventListener);
+    setInlineEventListenerForType(eventNames().keypressEvent, eventListener);
 }
 
 EventListener* DOMWindow::onkeyup() const
 {
-    return inlineEventListenerForType(keyupEvent);
+    return inlineEventListenerForType(eventNames().keyupEvent);
 }
 
 void DOMWindow::setOnkeyup(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(keyupEvent, eventListener);
+    setInlineEventListenerForType(eventNames().keyupEvent, eventListener);
 }
 
 EventListener* DOMWindow::onload() const
 {
-    return inlineEventListenerForType(loadEvent);
+    return inlineEventListenerForType(eventNames().loadEvent);
 }
 
 void DOMWindow::setOnload(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(loadEvent, eventListener);
+    setInlineEventListenerForType(eventNames().loadEvent, eventListener);
 }
 
 EventListener* DOMWindow::onmousedown() const
 {
-    return inlineEventListenerForType(mousedownEvent);
+    return inlineEventListenerForType(eventNames().mousedownEvent);
 }
 
 void DOMWindow::setOnmousedown(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mousedownEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mousedownEvent, eventListener);
 }
 
 EventListener* DOMWindow::onmousemove() const
 {
-    return inlineEventListenerForType(mousemoveEvent);
+    return inlineEventListenerForType(eventNames().mousemoveEvent);
 }
 
 void DOMWindow::setOnmousemove(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mousemoveEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mousemoveEvent, eventListener);
 }
 
 EventListener* DOMWindow::onmouseout() const
 {
-    return inlineEventListenerForType(mouseoutEvent);
+    return inlineEventListenerForType(eventNames().mouseoutEvent);
 }
 
 void DOMWindow::setOnmouseout(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mouseoutEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mouseoutEvent, eventListener);
 }
 
 EventListener* DOMWindow::onmouseover() const
 {
-    return inlineEventListenerForType(mouseoverEvent);
+    return inlineEventListenerForType(eventNames().mouseoverEvent);
 }
 
 void DOMWindow::setOnmouseover(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mouseoverEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mouseoverEvent, eventListener);
 }
 
 EventListener* DOMWindow::onmouseup() const
 {
-    return inlineEventListenerForType(mouseupEvent);
+    return inlineEventListenerForType(eventNames().mouseupEvent);
 }
 
 void DOMWindow::setOnmouseup(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mouseupEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mouseupEvent, eventListener);
 }
 
 EventListener* DOMWindow::onmousewheel() const
 {
-    return inlineEventListenerForType(mousewheelEvent);
+    return inlineEventListenerForType(eventNames().mousewheelEvent);
 }
 
 void DOMWindow::setOnmousewheel(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(mousewheelEvent, eventListener);
+    setInlineEventListenerForType(eventNames().mousewheelEvent, eventListener);
 }
 
 EventListener* DOMWindow::onreset() const
 {
-    return inlineEventListenerForType(resetEvent);
+    return inlineEventListenerForType(eventNames().resetEvent);
 }
 
 void DOMWindow::setOnreset(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(resetEvent, eventListener);
+    setInlineEventListenerForType(eventNames().resetEvent, eventListener);
 }
 
 EventListener* DOMWindow::onresize() const
 {
-    return inlineEventListenerForType(resizeEvent);
+    return inlineEventListenerForType(eventNames().resizeEvent);
 }
 
 void DOMWindow::setOnresize(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(resizeEvent, eventListener);
+    setInlineEventListenerForType(eventNames().resizeEvent, eventListener);
 }
 
 EventListener* DOMWindow::onscroll() const
 {
-    return inlineEventListenerForType(scrollEvent);
+    return inlineEventListenerForType(eventNames().scrollEvent);
 }
 
 void DOMWindow::setOnscroll(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(scrollEvent, eventListener);
+    setInlineEventListenerForType(eventNames().scrollEvent, eventListener);
 }
 
 EventListener* DOMWindow::onsearch() const
 {
-    return inlineEventListenerForType(searchEvent);
+    return inlineEventListenerForType(eventNames().searchEvent);
 }
 
 void DOMWindow::setOnsearch(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(searchEvent, eventListener);
+    setInlineEventListenerForType(eventNames().searchEvent, eventListener);
 }
 
 EventListener* DOMWindow::onselect() const
 {
-    return inlineEventListenerForType(selectEvent);
+    return inlineEventListenerForType(eventNames().selectEvent);
 }
 
 void DOMWindow::setOnselect(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(selectEvent, eventListener);
+    setInlineEventListenerForType(eventNames().selectEvent, eventListener);
 }
 
 EventListener* DOMWindow::onsubmit() const
 {
-    return inlineEventListenerForType(submitEvent);
+    return inlineEventListenerForType(eventNames().submitEvent);
 }
 
 void DOMWindow::setOnsubmit(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(submitEvent, eventListener);
+    setInlineEventListenerForType(eventNames().submitEvent, eventListener);
 }
 
 EventListener* DOMWindow::onunload() const
 {
-    return inlineEventListenerForType(unloadEvent);
+    return inlineEventListenerForType(eventNames().unloadEvent);
 }
 
 void DOMWindow::setOnunload(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(unloadEvent, eventListener);
+    setInlineEventListenerForType(eventNames().unloadEvent, eventListener);
 }
 
 EventListener* DOMWindow::onbeforeunload() const
 {
-    return inlineEventListenerForType(beforeunloadEvent);
+    return inlineEventListenerForType(eventNames().beforeunloadEvent);
 }
 
 void DOMWindow::setOnbeforeunload(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(beforeunloadEvent, eventListener);
+    setInlineEventListenerForType(eventNames().beforeunloadEvent, eventListener);
 }
 
 EventListener* DOMWindow::onwebkitanimationstart() const
 {
-    return inlineEventListenerForType(webkitAnimationStartEvent);
+    return inlineEventListenerForType(eventNames().webkitAnimationStartEvent);
 }
 
 void DOMWindow::setOnwebkitanimationstart(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(webkitAnimationStartEvent, eventListener);
+    setInlineEventListenerForType(eventNames().webkitAnimationStartEvent, eventListener);
 }
 
 EventListener* DOMWindow::onwebkitanimationiteration() const
 {
-    return inlineEventListenerForType(webkitAnimationIterationEvent);
+    return inlineEventListenerForType(eventNames().webkitAnimationIterationEvent);
 }
 
 void DOMWindow::setOnwebkitanimationiteration(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(webkitAnimationIterationEvent, eventListener);
+    setInlineEventListenerForType(eventNames().webkitAnimationIterationEvent, eventListener);
 }
 
 EventListener* DOMWindow::onwebkitanimationend() const
 {
-    return inlineEventListenerForType(webkitAnimationEndEvent);
+    return inlineEventListenerForType(eventNames().webkitAnimationEndEvent);
 }
 
 void DOMWindow::setOnwebkitanimationend(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(webkitAnimationEndEvent, eventListener);
+    setInlineEventListenerForType(eventNames().webkitAnimationEndEvent, eventListener);
 }
 
 EventListener* DOMWindow::onwebkittransitionend() const
 {
-    return inlineEventListenerForType(webkitTransitionEndEvent);
+    return inlineEventListenerForType(eventNames().webkitTransitionEndEvent);
 }
 
 void DOMWindow::setOnwebkittransitionend(PassRefPtr<EventListener> eventListener)
 {
-    setInlineEventListenerForType(webkitTransitionEndEvent, eventListener);
+    setInlineEventListenerForType(eventNames().webkitTransitionEndEvent, eventListener);
 }
 
 } // namespace WebCore
index 1a69b23..e4fb54e 100644 (file)
@@ -73,7 +73,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 // The link drag hysteresis is much larger than the others because there
@@ -1066,7 +1065,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
         return true;
     }
 
-    bool swallowEvent = dispatchMouseEvent(mousedownEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
+    bool swallowEvent = dispatchMouseEvent(eventNames().mousedownEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
 
     // If the hit testing originally determined the event was in a scrollbar, refetch the MouseEventWithHitTestResults
     // in case the scrollbar widget was destroyed when the mouse event was handled.
@@ -1122,12 +1121,12 @@ bool EventHandler::handleMouseDoubleClickEvent(const PlatformMouseEvent& mouseEv
     }
 
     m_clickCount = mouseEvent.clickCount();
-    bool swallowMouseUpEvent = dispatchMouseEvent(mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
+    bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
 
     bool swallowClickEvent = false;
     // Don't ever dispatch click events for right clicks
     if (mouseEvent.button() != RightButton && mev.targetNode() == m_clickNode)
-        swallowClickEvent = dispatchMouseEvent(clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
+        swallowClickEvent = dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
 
     if (m_lastScrollbarUnderMouse)
         swallowMouseUpEvent = m_lastScrollbarUnderMouse->mouseUp();
@@ -1180,7 +1179,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
 #endif
 
     if (m_frameSetBeingResized)
-        return dispatchMouseEvent(mousemoveEvent, m_frameSetBeingResized.get(), false, 0, mouseEvent, false);
+        return dispatchMouseEvent(eventNames().mousemoveEvent, m_frameSetBeingResized.get(), false, 0, mouseEvent, false);
 
     // Send events right to a scrollbar if the mouse is pressed.
     if (m_lastScrollbarUnderMouse && m_mousePressed)
@@ -1241,7 +1240,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
     if (swallowEvent)
         return true;
     
-    swallowEvent = dispatchMouseEvent(mousemoveEvent, mev.targetNode(), false, 0, mouseEvent, true);
+    swallowEvent = dispatchMouseEvent(eventNames().mousemoveEvent, mev.targetNode(), false, 0, mouseEvent, true);
     if (!swallowEvent)
         swallowEvent = handleMouseDraggedEvent(mev);
 
@@ -1273,7 +1272,7 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
 #endif
 
     if (m_frameSetBeingResized)
-        return dispatchMouseEvent(mouseupEvent, m_frameSetBeingResized.get(), true, m_clickCount, mouseEvent, false);
+        return dispatchMouseEvent(eventNames().mouseupEvent, m_frameSetBeingResized.get(), true, m_clickCount, mouseEvent, false);
 
     if (m_lastScrollbarUnderMouse) {
         invalidateClick();
@@ -1287,12 +1286,12 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
         return true;
     }
 
-    bool swallowMouseUpEvent = dispatchMouseEvent(mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
+    bool swallowMouseUpEvent = dispatchMouseEvent(eventNames().mouseupEvent, mev.targetNode(), true, m_clickCount, mouseEvent, false);
 
     // Don't ever dispatch click events for right clicks
     bool swallowClickEvent = false;
     if (m_clickCount > 0 && mouseEvent.button() != RightButton && mev.targetNode() == m_clickNode)
-        swallowClickEvent = dispatchMouseEvent(clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
+        swallowClickEvent = dispatchMouseEvent(eventNames().clickEvent, mev.targetNode(), true, m_clickCount, mouseEvent, true);
 
     if (m_resizeLayer) {
         m_resizeLayer->setInResizeMode(false);
@@ -1350,7 +1349,7 @@ bool EventHandler::updateDragAndDrop(const PlatformMouseEvent& event, Clipboard*
             if (newTarget->hasTagName(frameTag) || newTarget->hasTagName(iframeTag))
                 accept = static_cast<HTMLFrameElementBase*>(newTarget)->contentFrame()->eventHandler()->updateDragAndDrop(event, clipboard);
             else
-                accept = dispatchDragEvent(dragenterEvent, newTarget, event, clipboard);
+                accept = dispatchDragEvent(eventNames().dragenterEvent, newTarget, event, clipboard);
         
         if (m_dragTarget) {
             Frame* frame = (m_dragTarget->hasTagName(frameTag) || m_dragTarget->hasTagName(iframeTag)) 
@@ -1358,14 +1357,14 @@ bool EventHandler::updateDragAndDrop(const PlatformMouseEvent& event, Clipboard*
             if (frame)
                 accept = frame->eventHandler()->updateDragAndDrop(event, clipboard);
             else
-                dispatchDragEvent(dragleaveEvent, m_dragTarget.get(), event, clipboard);
+                dispatchDragEvent(eventNames().dragleaveEvent, m_dragTarget.get(), event, clipboard);
         }
     } else {
         if (newTarget)
             if (newTarget->hasTagName(frameTag) || newTarget->hasTagName(iframeTag))
                 accept = static_cast<HTMLFrameElementBase*>(newTarget)->contentFrame()->eventHandler()->updateDragAndDrop(event, clipboard);
             else
-                accept = dispatchDragEvent(dragoverEvent, newTarget, event, clipboard);
+                accept = dispatchDragEvent(eventNames().dragoverEvent, newTarget, event, clipboard);
     }
     m_dragTarget = newTarget;
 
@@ -1380,7 +1379,7 @@ void EventHandler::cancelDragAndDrop(const PlatformMouseEvent& event, Clipboard*
         if (frame)
             frame->eventHandler()->cancelDragAndDrop(event, clipboard);
         else
-            dispatchDragEvent(dragleaveEvent, m_dragTarget.get(), event, clipboard);
+            dispatchDragEvent(eventNames().dragleaveEvent, m_dragTarget.get(), event, clipboard);
     }
     clearDragState();
 }
@@ -1394,7 +1393,7 @@ bool EventHandler::performDragAndDrop(const PlatformMouseEvent& event, Clipboard
         if (frame)
             accept = frame->eventHandler()->performDragAndDrop(event, clipboard);
         else
-            accept = dispatchDragEvent(dropEvent, m_dragTarget.get(), event, clipboard);
+            accept = dispatchDragEvent(eventNames().dropEvent, m_dragTarget.get(), event, clipboard);
     }
     clearDragState();
     return accept;
@@ -1505,10 +1504,10 @@ void EventHandler::updateMouseEventTargetNode(Node* targetNode, const PlatformMo
         if (m_lastNodeUnderMouse != m_nodeUnderMouse) {
             // send mouseout event to the old node
             if (m_lastNodeUnderMouse)
-                EventTargetNodeCast(m_lastNodeUnderMouse.get())->dispatchMouseEvent(mouseEvent, mouseoutEvent, 0, m_nodeUnderMouse.get());
+                EventTargetNodeCast(m_lastNodeUnderMouse.get())->dispatchMouseEvent(mouseEvent, eventNames().mouseoutEvent, 0, m_nodeUnderMouse.get());
             // send mouseover event to the new node
             if (m_nodeUnderMouse)
-                EventTargetNodeCast(m_nodeUnderMouse.get())->dispatchMouseEvent(mouseEvent, mouseoverEvent, 0, m_lastNodeUnderMouse.get());
+                EventTargetNodeCast(m_nodeUnderMouse.get())->dispatchMouseEvent(mouseEvent, eventNames().mouseoverEvent, 0, m_lastNodeUnderMouse.get());
         }
         m_lastNodeUnderMouse = m_nodeUnderMouse;
 #if ENABLE(SVG)
@@ -1526,7 +1525,7 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe
     if (m_nodeUnderMouse)
         swallowEvent = EventTargetNodeCast(m_nodeUnderMouse.get())->dispatchMouseEvent(mouseEvent, eventType, clickCount);
     
-    if (!swallowEvent && eventType == mousedownEvent) {
+    if (!swallowEvent && eventType == eventNames().mousedownEvent) {
         // Blur current focus node when a link/button is clicked; this
         // is expected by some sites that rely on onChange handlers running
         // from form fields before the button click is processed.
@@ -1640,7 +1639,7 @@ bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event)
     }
 #endif
 
-    swallowEvent = dispatchMouseEvent(contextmenuEvent, mev.targetNode(), true, 0, event, true);
+    swallowEvent = dispatchMouseEvent(eventNames().contextmenuEvent, mev.targetNode(), true, 0, event, true);
     
     return swallowEvent;
 }
@@ -1663,7 +1662,7 @@ bool EventHandler::canMouseDownStartSelect(Node* node)
             
     for (RenderObject* curr = node->renderer(); curr; curr = curr->parent())    
         if (Node* node = curr->element())
-            return EventTargetNodeCast(node)->dispatchEventForType(selectstartEvent, true, true);
+            return EventTargetNodeCast(node)->dispatchEventForType(eventNames().selectstartEvent, true, true);
     
     return true;
 }
@@ -1675,7 +1674,7 @@ bool EventHandler::canMouseDragExtendSelect(Node* node)
             
     for (RenderObject* curr = node->renderer(); curr; curr = curr->parent())    
         if (Node* node = curr->element())
-            return EventTargetNodeCast(node)->dispatchEventForType(selectstartEvent, true, true);
+            return EventTargetNodeCast(node)->dispatchEventForType(eventNames().selectstartEvent, true, true);
     
     return true;
 }
@@ -1866,7 +1865,7 @@ void EventHandler::handleKeyboardSelectionMovement(KeyboardEvent* event)
     
 void EventHandler::defaultKeyboardEventHandler(KeyboardEvent* event)
 {
-   if (event->type() == keydownEvent) {
+   if (event->type() == eventNames().keydownEvent) {
         m_frame->editor()->handleKeyboardEvent(event);
         if (event->defaultHandled())
             return;
@@ -1877,7 +1876,7 @@ void EventHandler::defaultKeyboardEventHandler(KeyboardEvent* event)
        if (AXObjectCache::accessibilityEnhancedUserInterfaceEnabled())
            handleKeyboardSelectionMovement(event);       
    }
-   if (event->type() == keypressEvent) {
+   if (event->type() == eventNames().keypressEvent) {
         m_frame->editor()->handleKeyboardEvent(event);
         if (event->defaultHandled())
             return;
@@ -1924,7 +1923,7 @@ void EventHandler::dragSourceMovedTo(const PlatformMouseEvent& event)
 {
     if (dragState().m_dragSrc && dragState().m_dragSrcMayBeDHTML)
         // for now we don't care if event handler cancels default behavior, since there is none
-        dispatchDragSrcEvent(dragEvent, event);
+        dispatchDragSrcEvent(eventNames().dragEvent, event);
 }
     
 void EventHandler::dragSourceEndedAt(const PlatformMouseEvent& event, DragOperation operation)
@@ -1932,7 +1931,7 @@ void EventHandler::dragSourceEndedAt(const PlatformMouseEvent& event, DragOperat
     if (dragState().m_dragSrc && dragState().m_dragSrcMayBeDHTML) {
         dragState().m_dragClipboard->setDestinationOperation(operation);
         // for now we don't care if event handler cancels default behavior, since there is none
-        dispatchDragSrcEvent(dragendEvent, event);
+        dispatchDragSrcEvent(eventNames().dragendEvent, event);
     }
     freeClipboard();
     dragState().m_dragSrc = 0;
@@ -2037,7 +2036,7 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event)
             }
         } 
         
-        m_mouseDownMayStartDrag = dispatchDragSrcEvent(dragstartEvent, m_mouseDown)
+        m_mouseDownMayStartDrag = dispatchDragSrcEvent(eventNames().dragstartEvent, m_mouseDown)
             && !m_frame->selection()->isInPasswordField();
         
         // Invalidate clipboard here against anymore pasteboard writing for security.  The drag
@@ -2060,7 +2059,7 @@ bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event)
         bool startedDrag = dragController && dragController->startDrag(m_frame, dragState().m_dragClipboard.get(), srcOp, event.event(), m_mouseDownPos, dragState().m_dragSrcIsDHTML);
         if (!startedDrag && dragState().m_dragSrcMayBeDHTML) {
             // Drag was canned at the last minute - we owe m_dragSrc a DRAGEND event
-            dispatchDragSrcEvent(dragendEvent, event.event());
+            dispatchDragSrcEvent(eventNames().dragendEvent, event.event());
             m_mouseDownMayStartDrag = false;
         }
     } 
@@ -2085,7 +2084,7 @@ bool EventHandler::handleTextInputEvent(const String& text, Event* underlyingEve
     // Platforms should differentiate real commands like selectAll from text input in disguise (like insertNewline),
     // and avoid dispatching text input events from keydown default handlers.
     if (underlyingEvent && underlyingEvent->isKeyboardEvent())
-        ASSERT(static_cast<KeyboardEvent*>(underlyingEvent)->type() == keypressEvent);
+        ASSERT(static_cast<KeyboardEvent*>(underlyingEvent)->type() == eventNames().keypressEvent);
 #endif
     EventTarget* target;
     if (underlyingEvent)
index 4d0deeb..9b30362 100644 (file)
@@ -34,7 +34,6 @@
 #include "Element.h"
 #include "Event.h"
 #include "EventHandler.h"
-#include "EventNames.h"
 #include "Frame.h"
 #include "FrameView.h"
 #include "FrameTree.h"
@@ -51,7 +50,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 FocusController::FocusController(Page* page)
index b490f8d..bd08e58 100644 (file)
@@ -92,7 +92,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 #ifndef NDEBUG    
@@ -1314,7 +1313,7 @@ void Frame::forceLayoutWithPageWidthRange(float minPageWidth, float maxPageWidth
 void Frame::sendResizeEvent()
 {
     if (Document* doc = document())
-        doc->dispatchWindowEvent(EventNames::resizeEvent, false, false);
+        doc->dispatchWindowEvent(eventNames().resizeEvent, false, false);
 }
 
 void Frame::sendScrollEvent()
@@ -1326,7 +1325,7 @@ void Frame::sendScrollEvent()
     Document* doc = document();
     if (!doc)
         return;
-    doc->dispatchEventForType(scrollEvent, true, false);
+    doc->dispatchEventForType(eventNames().scrollEvent, true, false);
 }
 
 void Frame::clearTimers(FrameView *view, Document *document)
index 3d77018..3c573d6 100644 (file)
@@ -67,8 +67,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 static HashSet<Page*>* allPages;
 
 #ifndef NDEBUG
@@ -86,7 +84,7 @@ static void networkStateChanged()
             frames.append(frame);
     }
 
-    AtomicString eventName = networkStateNotifier().onLine() ? onlineEvent : offlineEvent;
+    AtomicString eventName = networkStateNotifier().onLine() ? eventNames().onlineEvent : eventNames().offlineEvent;
     
     for (unsigned i = 0; i < frames.size(); i++) {
         Document* document = frames[i]->document();
index d2b29b0..fc28469 100644 (file)
@@ -554,7 +554,7 @@ void AnimationBase::updateStateMachine(AnimStateInput input, double param)
                 // Set the start timer to the initial delay (0 if no delay)
                 m_waitedForResponse = false;
                 m_animState = AnimationStateStartWaitTimer;
-                m_animationTimerCallback.startTimer(m_animation->delay(), EventNames::webkitAnimationStartEvent, m_animation->delay());
+                m_animationTimerCallback.startTimer(m_animation->delay(), eventNames().webkitAnimationStartEvent, m_animation->delay());
             }
             break;
         case AnimationStateStartWaitTimer:
@@ -718,11 +718,11 @@ void AnimationBase::animationTimerCallbackFired(const AtomicString& eventType, d
     ASSERT(m_object->document() && !m_object->document()->inPageCache());
 
     // FIXME: use an enum
-    if (eventType == EventNames::webkitAnimationStartEvent)
+    if (eventType == eventNames().webkitAnimationStartEvent)
         updateStateMachine(AnimationStateInputStartTimerFired, elapsedTime);
-    else if (eventType == EventNames::webkitAnimationIterationEvent)
+    else if (eventType == eventNames().webkitAnimationIterationEvent)
         updateStateMachine(AnimationStateInputLoopTimerFired, elapsedTime);
-    else if (eventType == EventNames::webkitAnimationEndEvent) {
+    else if (eventType == eventNames().webkitAnimationEndEvent) {
         updateStateMachine(AnimationStateInputEndTimerFired, elapsedTime);
         // |this| may be deleted here
     }
@@ -804,11 +804,11 @@ void AnimationBase::primeEventTimers()
         // We are not at the end yet, send a loop event
         ASSERT(nextIterationTime > 0);
         m_animState = AnimationStateLooping;
-        m_animationTimerCallback.startTimer(durationLeft, EventNames::webkitAnimationIterationEvent, nextIterationTime);
+        m_animationTimerCallback.startTimer(durationLeft, eventNames().webkitAnimationIterationEvent, nextIterationTime);
     } else {
         // We are at the end, send an end event
         m_animState = AnimationStateEnding;
-        m_animationTimerCallback.startTimer(durationLeft, EventNames::webkitAnimationEndEvent, nextIterationTime);
+        m_animationTimerCallback.startTimer(durationLeft, eventNames().webkitAnimationEndEvent, nextIterationTime);
     }
 }
   
index 3024ce4..4d470e4 100644 (file)
@@ -82,7 +82,7 @@ void ImplicitAnimation::animate(CompositeAnimation* animation, RenderObject* ren
 
 void ImplicitAnimation::onAnimationEnd(double elapsedTime)
 {
-    if (!sendTransitionEvent(EventNames::webkitTransitionEndEvent, elapsedTime)) {
+    if (!sendTransitionEvent(eventNames().webkitTransitionEndEvent, elapsedTime)) {
         // We didn't dispatch an event, which would call endAnimation(), so we'll just call it here.
         endAnimation(true);
     }
@@ -90,7 +90,7 @@ void ImplicitAnimation::onAnimationEnd(double elapsedTime)
 
 bool ImplicitAnimation::sendTransitionEvent(const AtomicString& eventType, double elapsedTime)
 {
-    if (eventType == EventNames::webkitTransitionEndEvent) {
+    if (eventType == eventNames().webkitTransitionEndEvent) {
         Document::ListenerType listenerType = Document::TRANSITIONEND_LISTENER;
 
         if (shouldSendEventForListener(listenerType)) {
@@ -114,7 +114,7 @@ bool ImplicitAnimation::sendTransitionEvent(const AtomicString& eventType, doubl
             element->dispatchWebKitTransitionEvent(eventType, propertyName, elapsedTime);
 
             // Restore the original (unanimated) style
-            if (eventType == EventNames::webkitAnimationEndEvent && element->renderer())
+            if (eventType == eventNames().webkitAnimationEndEvent && element->renderer())
                 setChanged(element.get());
 
             return true; // Did dispatch an event
index b7e6966..69fdd11 100644 (file)
@@ -162,17 +162,17 @@ bool KeyframeAnimation::shouldSendEventForListener(Document::ListenerType listen
 
 void KeyframeAnimation::onAnimationStart(double elapsedTime)
 {
-    sendAnimationEvent(EventNames::webkitAnimationStartEvent, elapsedTime);
+    sendAnimationEvent(eventNames().webkitAnimationStartEvent, elapsedTime);
 }
 
 void KeyframeAnimation::onAnimationIteration(double elapsedTime)
 {
-    sendAnimationEvent(EventNames::webkitAnimationIterationEvent, elapsedTime);
+    sendAnimationEvent(eventNames().webkitAnimationIterationEvent, elapsedTime);
 }
 
 void KeyframeAnimation::onAnimationEnd(double elapsedTime)
 {
-    if (!sendAnimationEvent(EventNames::webkitAnimationEndEvent, elapsedTime)) {
+    if (!sendAnimationEvent(eventNames().webkitAnimationEndEvent, elapsedTime)) {
         // We didn't dispatch an event, which would call endAnimation(), so we'll just call it here.
         endAnimation(true);
     }
@@ -181,12 +181,12 @@ void KeyframeAnimation::onAnimationEnd(double elapsedTime)
 bool KeyframeAnimation::sendAnimationEvent(const AtomicString& eventType, double elapsedTime)
 {
     Document::ListenerType listenerType;
-    if (eventType == EventNames::webkitAnimationIterationEvent)
+    if (eventType == eventNames().webkitAnimationIterationEvent)
         listenerType = Document::ANIMATIONITERATION_LISTENER;
-    else if (eventType == EventNames::webkitAnimationEndEvent)
+    else if (eventType == eventNames().webkitAnimationEndEvent)
         listenerType = Document::ANIMATIONEND_LISTENER;
     else {
-        ASSERT(eventType == EventNames::webkitAnimationStartEvent);
+        ASSERT(eventType == eventNames().webkitAnimationStartEvent);
         listenerType = Document::ANIMATIONSTART_LISTENER;
     }
 
@@ -207,7 +207,7 @@ bool KeyframeAnimation::sendAnimationEvent(const AtomicString& eventType, double
         element->dispatchWebKitAnimationEvent(eventType, m_keyframes.animationName(), elapsedTime);
 
         // Restore the original (unanimated) style
-        if (eventType == EventNames::webkitAnimationEndEvent && element->renderer())
+        if (eventType == eventNames().webkitAnimationEndEvent && element->renderer())
             setChanged(element.get());
 
         return true; // Did dispatch an event
index e908d50..bb650b4 100644 (file)
@@ -27,7 +27,6 @@
 #include "EventHandler.h"
 
 #include "ClipboardGtk.h"
-#include "EventNames.h"
 #include "FloatPoint.h"
 #include "FocusController.h"
 #include "Frame.h"
@@ -43,8 +42,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 unsigned EventHandler::s_accessKeyModifiers = PlatformKeyboardEvent::AltKey;
 
 const double EventHandler::TextDragDelay = 0.0;
index 32b20ba..562c1dd 100644 (file)
@@ -45,8 +45,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 unsigned EventHandler::s_accessKeyModifiers = PlatformKeyboardEvent::CtrlKey | PlatformKeyboardEvent::AltKey;
 
 const double EventHandler::TextDragDelay = 0.15;
@@ -97,7 +95,7 @@ PassRefPtr<KeyboardEvent> EventHandler::currentKeyboardEvent() const
 static inline bool isKeyboardOptionTab(KeyboardEvent* event)
 {
     return event
-        && (event->type() == keydownEvent || event->type() == keypressEvent)
+        && (event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent)
         && event->altKey()
         && event->keyIdentifier() == "U+0009";    
 }
index 706bc92..66e2d04 100644 (file)
@@ -35,7 +35,6 @@
 #import "DocumentLoader.h"
 #import "EditorClient.h"
 #import "Event.h"
-#import "EventNames.h"
 #import "FrameLoaderClient.h"
 #import "FramePrivate.h"
 #import "FrameView.h"
@@ -75,7 +74,6 @@ using JSC::JSLock;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 // Either get cached regexp or build one that matches any of the labels.
index 5113ea8..421caaf 100644 (file)
@@ -56,8 +56,6 @@ QT_END_NAMESPACE
 
 namespace WebCore {
 
-using namespace EventNames;
-
 unsigned EventHandler::s_accessKeyModifiers = PlatformKeyboardEvent::CtrlKey;
 
 const double EventHandler::TextDragDelay = 0.0;
@@ -65,7 +63,7 @@ const double EventHandler::TextDragDelay = 0.0;
 static bool isKeyboardOptionTab(KeyboardEvent* event)
 {
     return event
-        && (event->type() == keydownEvent || event->type() == keypressEvent)
+        && (event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent)
         && event->altKey()
         && event->keyIdentifier() == "U+0009";
 }
index 5bc7284..dc573e1 100644 (file)
 #include "StaticConstructors.h"
 #include "StringHash.h"
 #include <kjs/identifier.h>
+#include <wtf/Threading.h>
 #include <wtf/HashSet.h>
 
+#if ENABLE(WORKERS)
+#include <wtf/ThreadSpecific.h>
+using namespace WTF;
+#endif
+
 #if USE(JSC)
 using JSC::Identifier;
 using JSC::UString;
@@ -38,7 +44,20 @@ using JSC::UString;
 
 namespace WebCore {
 
-static HashSet<StringImpl*>* stringTable;
+#if ENABLE(WORKERS)
+static ThreadSpecific<HashSet<StringImpl*> >* staticStringTable;
+#else
+static HashSet<StringImpl*>* staticStringTable;
+#endif
+
+static inline HashSet<StringImpl*>* stringTable()
+{
+#if ENABLE(WORKERS)
+    return *staticStringTable;
+#else
+    return staticStringTable;
+#endif
+}
 
 struct CStringTranslator {
     static unsigned hash(const char* c)
@@ -80,7 +99,7 @@ PassRefPtr<StringImpl> AtomicString::add(const char* c)
         return 0;
     if (!*c)
         return StringImpl::empty();    
-    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable->add<const char*, CStringTranslator>(c);
+    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable()->add<const char*, CStringTranslator>(c);
     if (!addResult.second)
         return *addResult.first;
     return adoptRef(*addResult.first);
@@ -172,7 +191,7 @@ PassRefPtr<StringImpl> AtomicString::add(const UChar* s, int length)
         return StringImpl::empty();
     
     UCharBuffer buf = { s, length }; 
-    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable->add<UCharBuffer, UCharBufferTranslator>(buf);
+    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable()->add<UCharBuffer, UCharBufferTranslator>(buf);
     if (!addResult.second)
         return *addResult.first;
     return adoptRef(*addResult.first);
@@ -191,7 +210,7 @@ PassRefPtr<StringImpl> AtomicString::add(const UChar* s)
         return StringImpl::empty();
 
     UCharBuffer buf = {s, length}; 
-    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable->add<UCharBuffer, UCharBufferTranslator>(buf);
+    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable()->add<UCharBuffer, UCharBufferTranslator>(buf);
     if (!addResult.second)
         return *addResult.first;
     return adoptRef(*addResult.first);
@@ -205,7 +224,7 @@ PassRefPtr<StringImpl> AtomicString::add(StringImpl* r)
     if (r->length() == 0)
         return StringImpl::empty();
     
-    StringImpl* result = *stringTable->add(r).first;
+    StringImpl* result = *stringTable()->add(r).first;
     if (result == r)
         r->m_inTable = true;
     return result;
@@ -213,7 +232,7 @@ PassRefPtr<StringImpl> AtomicString::add(StringImpl* r)
 
 void AtomicString::remove(StringImpl* r)
 {
-    stringTable->remove(r);
+    stringTable()->remove(r);
 }
 
 #if USE(JSC)
@@ -228,7 +247,7 @@ PassRefPtr<StringImpl> AtomicString::add(const JSC::Identifier& identifier)
         return StringImpl::empty();
 
     HashAndCharacters buffer = { string->computedHash(), string->data(), length }; 
-    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable->add<HashAndCharacters, HashAndCharactersTranslator>(buffer);
+    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable()->add<HashAndCharacters, HashAndCharactersTranslator>(buffer);
     if (!addResult.second)
         return *addResult.first;
     return adoptRef(*addResult.first);
@@ -245,7 +264,7 @@ PassRefPtr<StringImpl> AtomicString::add(const JSC::UString& ustring)
         return StringImpl::empty();
 
     HashAndCharacters buffer = { string->hash(), string->data(), length }; 
-    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable->add<HashAndCharacters, HashAndCharactersTranslator>(buffer);
+    pair<HashSet<StringImpl*>::iterator, bool> addResult = stringTable()->add<HashAndCharacters, HashAndCharactersTranslator>(buffer);
     if (!addResult.second)
         return *addResult.first;
     return adoptRef(*addResult.first);
@@ -263,8 +282,8 @@ AtomicStringImpl* AtomicString::find(const JSC::Identifier& identifier)
         return static_cast<AtomicStringImpl*>(StringImpl::empty());
 
     HashAndCharacters buffer = { string->computedHash(), string->data(), length }; 
-    HashSet<StringImpl*>::iterator iterator = stringTable->find<HashAndCharacters, HashAndCharactersTranslator>(buffer);
-    if (iterator == stringTable->end())
+    HashSet<StringImpl*>::iterator iterator = stringTable()->find<HashAndCharacters, HashAndCharactersTranslator>(buffer);
+    if (iterator == stringTable()->end())
         return 0;
     return static_cast<AtomicStringImpl*>(*iterator);
 }
@@ -284,7 +303,14 @@ void AtomicString::init()
 {
     static bool initialized;
     if (!initialized) {
-        stringTable = new HashSet<StringImpl*>;
+        // Initialization is not thread safe, so this function must be called from the main thread first.
+        ASSERT(isMainThread());
+
+#if ENABLE(WORKERS)
+        staticStringTable = new ThreadSpecific<HashSet<StringImpl*> >;
+#else
+        staticStringTable = new HashSet<StringImpl*>;
+#endif
 
         // Use placement new to initialize the globals.
         new ((void*)&nullAtom) AtomicString;
index a19c8d0..ad034d9 100644 (file)
@@ -134,6 +134,7 @@ inline bool equalIgnoringCase(const char* a, const AtomicString& b) { return equ
 inline bool equalIgnoringCase(const String& a, const AtomicString& b) { return equalIgnoringCase(a.impl(), b.impl()); }
 
 // Define external global variables for the commonly used atomic strings.
+// These are only usable from the main thread.
 #ifndef ATOMICSTRING_HIDE_GLOBALS
     extern const AtomicString nullAtom;
     extern const AtomicString emptyAtom;
index c3657aa..55bd3ae 100644 (file)
@@ -30,7 +30,6 @@
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "Element.h"
-#include "EventNames.h"
 #include "FrameLoader.h"
 #include "FrameTree.h"
 #include "Frame.h"
@@ -79,7 +78,6 @@ using namespace WTF;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 static int s_callingPlugin;
index a61e5c1..904e935 100644 (file)
@@ -30,7 +30,6 @@
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "Element.h"
-#include "EventNames.h"
 #include "FrameLoader.h"
 #include "FrameLoadRequest.h"
 #include "FrameTree.h"
@@ -81,7 +80,6 @@ using namespace WTF;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 void PluginView::updatePluginWidget() const
index 6a64095..819fd36 100644 (file)
@@ -45,7 +45,6 @@
 #include "Document.h"
 #include "DocumentLoader.h"
 #include "Element.h"
-#include "EventNames.h"
 #include "FrameLoader.h"
 #include "FrameLoadRequest.h"
 #include "FrameTree.h"
@@ -74,7 +73,6 @@ using namespace WTF;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 void PluginView::updatePluginWidget() const
index 50ec965..127d3fc 100644 (file)
@@ -92,7 +92,6 @@ using namespace WTF;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 const LPCWSTR kWebPluginViewdowClassName = L"WebPluginView";
@@ -397,10 +396,10 @@ void PluginView::handleKeyboardEvent(KeyboardEvent* event)
 
     npEvent.wParam = event->keyCode();    
 
-    if (event->type() == keydownEvent) {
+    if (event->type() == eventNames().keydownEvent) {
         npEvent.event = WM_KEYDOWN;
         npEvent.lParam = 0;
-    } else if (event->type() == keyupEvent) {
+    } else if (event->type() == eventNames().keyupEvent) {
         npEvent.event = WM_KEYUP;
         npEvent.lParam = 0x8000;
     }
@@ -427,9 +426,9 @@ void PluginView::handleMouseEvent(MouseEvent* event)
     if (event->shiftKey())
         npEvent.wParam |= MK_SHIFT;
 
-    if (event->type() == mousemoveEvent ||
-        event->type() == mouseoutEvent || 
-        event->type() == mouseoverEvent) {
+    if (event->type() == eventNames().mousemoveEvent ||
+        event->type() == eventNames().mouseoutEvent || 
+        event->type() == eventNames().mouseoverEvent) {
         npEvent.event = WM_MOUSEMOVE;
         if (event->buttonDown())
             switch (event->button()) {
@@ -444,7 +443,7 @@ void PluginView::handleMouseEvent(MouseEvent* event)
                 break;
             }
     }
-    else if (event->type() == mousedownEvent) {
+    else if (event->type() == eventNames().mousedownEvent) {
         // Focus the plugin
         if (Page* page = m_parentFrame->page())
             page->focusController()->setFocusedFrame(m_parentFrame);
@@ -460,7 +459,7 @@ void PluginView::handleMouseEvent(MouseEvent* event)
                 npEvent.event = WM_RBUTTONDOWN;
                 break;
         }
-    } else if (event->type() == mouseupEvent) {
+    } else if (event->type() == eventNames().mouseupEvent) {
         switch (event->button()) {
             case 0:
                 npEvent.event = WM_LBUTTONUP;
index 95a1aeb..6164585 100644 (file)
@@ -42,7 +42,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 // FIXME: These constants may need to be tweaked to better match the seeking in the QT plugin
@@ -104,7 +103,7 @@ MediaControlMuteButtonElement::MediaControlMuteButtonElement(Document* doc, HTML
 
 void MediaControlMuteButtonElement::defaultEventHandler(Event* event)
 {
-    if (event->type() == clickEvent) {
+    if (event->type() == eventNames().clickEvent) {
         m_mediaElement->setMuted(!m_mediaElement->muted());
         event->setDefaultHandled();
     }
@@ -120,7 +119,7 @@ MediaControlPlayButtonElement::MediaControlPlayButtonElement(Document* doc, HTML
 
 void MediaControlPlayButtonElement::defaultEventHandler(Event* event)
 {
-    if (event->type() == clickEvent) {
+    if (event->type() == eventNames().clickEvent) {
         ExceptionCode ec;
         if (m_mediaElement->canPlay())
             m_mediaElement->play(ec);
@@ -144,7 +143,7 @@ MediaControlSeekButtonElement::MediaControlSeekButtonElement(Document* doc, HTML
 
 void MediaControlSeekButtonElement::defaultEventHandler(Event* event)
 {
-    if (event->type() == mousedownEvent) {
+    if (event->type() == eventNames().mousedownEvent) {
         if (Frame* frame = document()->frame()) {
             m_capturing = true;
             frame->eventHandler()->setCapturingMouseEventsNode(this);
@@ -153,7 +152,7 @@ void MediaControlSeekButtonElement::defaultEventHandler(Event* event)
         m_mediaElement->pause(ec);
         m_seekTimer.startRepeating(cSeekRepeatDelay);
         event->setDefaultHandled();
-    } else if (event->type() == mouseupEvent) {
+    } else if (event->type() == eventNames().mouseupEvent) {
         if (m_capturing)
             if (Frame* frame = document()->frame()) {
                 m_capturing = false;
@@ -199,7 +198,7 @@ void MediaControlTimelineElement::defaultEventHandler(Event* event)
     HTMLInputElement::defaultEventHandler(event);
 
     float time = narrowPrecisionToFloat(value().toDouble());
-    if (oldTime != time || event->type() == inputEvent) {
+    if (oldTime != time || event->type() == eventNames().inputEvent) {
         ExceptionCode ec;
         m_mediaElement->setCurrentTime(time, ec);
     }
@@ -234,7 +233,7 @@ MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(Documen
 
 void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event)
 {
-    if (event->type() == clickEvent) {
+    if (event->type() == eventNames().clickEvent) {
         event->setDefaultHandled();
     }
     HTMLInputElement::defaultEventHandler(event);
index 2d49c59..425add0 100644 (file)
@@ -41,8 +41,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 RenderFrameSet::RenderFrameSet(HTMLFrameSetElement* frameSet)
     : RenderContainer(frameSet)
     , m_isResizing(false)
@@ -565,7 +563,7 @@ bool RenderFrameSet::userResize(MouseEvent* evt)
     if (!m_isResizing) {
         if (needsLayout())
             return false;
-        if (evt->type() == mousedownEvent && evt->button() == LeftButton) {
+        if (evt->type() == eventNames().mousedownEvent && evt->button() == LeftButton) {
             startResizing(m_cols, evt->pageX() - xPos());
             startResizing(m_rows, evt->pageY() - yPos());
             if (m_cols.m_splitBeingResized != noSplit || m_rows.m_splitBeingResized != noSplit) {
@@ -574,10 +572,10 @@ bool RenderFrameSet::userResize(MouseEvent* evt)
             }
         }
     } else {
-        if (evt->type() == mousemoveEvent || (evt->type() == mouseupEvent && evt->button() == LeftButton)) {
+        if (evt->type() == eventNames().mousemoveEvent || (evt->type() == eventNames().mouseupEvent && evt->button() == LeftButton)) {
             continueResizing(m_cols, evt->pageX() - xPos());
             continueResizing(m_rows, evt->pageY() - yPos());
-            if (evt->type() == mouseupEvent && evt->button() == LeftButton) {
+            if (evt->type() == eventNames().mouseupEvent && evt->button() == LeftButton) {
                 setIsResizing(false);
                 return true;
             }
index 3a82494..93efde1 100644 (file)
@@ -85,7 +85,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 const RenderLayer::ScrollAlignment RenderLayer::gAlignCenterIfNeeded = { RenderLayer::noScroll, RenderLayer::alignCenter, RenderLayer::alignToClosestEdge };
@@ -841,7 +840,7 @@ void RenderLayer::scrollToOffset(int x, int y, bool updateScrollbars, bool repai
     // Schedule the scroll DOM event.
     if (view) {
         if (FrameView* frameView = view->frameView())
-            frameView->scheduleEvent(Event::create(scrollEvent, false, false), EventTargetNodeCast(renderer()->element()));
+            frameView->scheduleEvent(Event::create(eventNames().scrollEvent, false, false), EventTargetNodeCast(renderer()->element()));
     }
 }
 
index 3bffc47..c435ff4 100644 (file)
@@ -58,7 +58,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
  
 const int rowSpacing = 1;
@@ -528,7 +527,7 @@ void RenderListBox::valueChanged(Scrollbar*)
         m_indexOffset = newOffset;
         repaint();
         // Fire the scroll DOM event.
-        EventTargetNodeCast(node())->dispatchEventForType(scrollEvent, false, false);
+        EventTargetNodeCast(node())->dispatchEventForType(eventNames().scrollEvent, false, false);
     }
 }
 
index e1d7bcc..4953a35 100644 (file)
@@ -46,8 +46,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
-
 static const double cTimeUpdateRepeatDelay = 0.2;
 static const double cOpacityAnimationRepeatDelay = 0.05;
 // FIXME get this from style
@@ -376,11 +374,11 @@ void RenderMedia::forwardEvent(Event* event)
         if (m_fullscreenButton && m_fullscreenButton->renderer() && m_fullscreenButton->renderer()->absoluteBoundingBoxRect().contains(point))
             m_fullscreenButton->defaultEventHandler(event);
         
-        if (event->type() == mouseoverEvent) {
+        if (event->type() == eventNames().mouseoverEvent) {
             m_mouseOver = true;
             updateControlVisibility();
         }
-        if (event->type() == mouseoutEvent) {
+        if (event->type() == eventNames().mouseoutEvent) {
             // FIXME: moving over scrollbar thumb generates mouseout for the ancestor media element for some reason
             m_mouseOver = absoluteBoundingBoxRect().contains(point);
             updateControlVisibility();
index 0c850c6..e03fb66 100644 (file)
@@ -34,7 +34,6 @@
 #include "Document.h"
 #include "Element.h"
 #include "EventHandler.h"
-#include "EventNames.h"
 #include "FloatRect.h"
 #include "Frame.h"
 #include "FrameView.h"
@@ -69,7 +68,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 #ifndef NDEBUG
index 7d8b0b0..0afde49 100644 (file)
@@ -39,7 +39,6 @@ using std::min;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 const int defaultTrackLength = 129;
@@ -72,7 +71,7 @@ HTMLSliderThumbElement::HTMLSliderThumbElement(Document* doc, Node* shadowParent
 void HTMLSliderThumbElement::defaultEventHandler(Event* event)
 {
     const AtomicString& eventType = event->type();
-    if (eventType == mousedownEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) {
+    if (eventType == eventNames().mousedownEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) {
         MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
         if (document()->frame() && renderer() && renderer()->parent()
                 && static_cast<RenderSlider*>(renderer()->parent())->mouseEventIsInThumb(mouseEvent)) {
@@ -87,7 +86,7 @@ void HTMLSliderThumbElement::defaultEventHandler(Event* event)
             event->setDefaultHandled();
             return;
         }
-    } else if (eventType == mouseupEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) {
+    } else if (eventType == eventNames().mouseupEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) {
         if (m_inDragMode) {
             if (Frame* frame = document()->frame())
                 frame->eventHandler()->setCapturingMouseEventsNode(0);      
@@ -95,7 +94,7 @@ void HTMLSliderThumbElement::defaultEventHandler(Event* event)
             event->setDefaultHandled();
             return;
         }
-    } else if (eventType == mousemoveEvent && event->isMouseEvent()) {
+    } else if (eventType == eventNames().mousemoveEvent && event->isMouseEvent()) {
         if (m_inDragMode && renderer() && renderer()->parent()) {
             // Move the slider
             MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
index 2d7bd78..fe266ad 100644 (file)
@@ -56,7 +56,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
 using namespace HTMLNames;
 
 // Value chosen by observation.  This can be tweaked.
@@ -842,7 +841,7 @@ void RenderTextControl::calcPrefWidths()
 
 void RenderTextControl::forwardEvent(Event* evt)
 {
-    if (evt->type() == blurEvent) {
+    if (evt->type() == eventNames().blurEvent) {
         RenderObject* innerRenderer = m_innerText->renderer();
         if (innerRenderer) {
             RenderLayer* innerLayer = innerRenderer->layer();
@@ -850,7 +849,7 @@ void RenderTextControl::forwardEvent(Event* evt)
                 innerLayer->scrollToOffset(style()->direction() == RTL ? innerLayer->scrollWidth() : 0, 0);
         }
         capsLockStateMayHaveChanged();
-    } else if (evt->type() == focusEvent)
+    } else if (evt->type() == eventNames().focusEvent)
         capsLockStateMayHaveChanged();
     else {
         if (evt->isMouseEvent() && m_resultsButton && static_cast<MouseEvent*>(evt)->x() < m_innerText->renderer()->absoluteBoundingBoxRect().x())
@@ -871,7 +870,7 @@ void RenderTextControl::selectionChanged(bool userTriggered)
         static_cast<HTMLInputElement*>(element)->cacheSelection(selectionStart(), selectionEnd());
     if (Frame* frame = document()->frame())
         if (frame->selection()->isRange() && userTriggered)
-            element->dispatchEventForType(selectEvent, true, false);
+            element->dispatchEventForType(eventNames().selectEvent, true, false);
 }
 
 void RenderTextControl::autoscroll()
index 8243995..57b8722 100644 (file)
@@ -30,7 +30,6 @@
 #include "Document.h"
 #include "Element.h"
 #include "Event.h"
-#include "EventNames.h"
 #include "FrameView.h"
 #include "GraphicsContext.h"
 #include "HitTestResult.h"
@@ -41,8 +40,6 @@ using namespace std;
 
 namespace WebCore {
 
-using namespace EventNames;
-
 static HashMap<const Widget*, RenderWidget*>& widgetRendererMap()
 {
     static HashMap<const Widget*, RenderWidget*>* staticWidgetRendererMap = new HashMap<const Widget*, RenderWidget*>;
index 26571b8..f14480f 100644 (file)
@@ -38,8 +38,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 class RenderTextControlInnerBlock : public RenderBlock {
 public:
     RenderTextControlInnerBlock(Node* node) : RenderBlock(node) { }
@@ -100,7 +98,7 @@ void TextControlInnerTextElement::defaultEventHandler(Event* evt)
                 static_cast<HTMLInputElement*>(shadowAncestor)->defaultEventHandler(evt);
             else
                 static_cast<HTMLTextAreaElement*>(shadowAncestor)->defaultEventHandler(evt);
-        if (evt->type() == webkitEditableContentChangedEvent)
+        if (evt->type() == eventNames().webkitEditableContentChangedEvent)
             static_cast<RenderTextControl*>(shadowAncestor->renderer())->subtreeHasChanged();
     }
     if (!evt->defaultHandled())
@@ -121,7 +119,7 @@ void SearchFieldResultsButtonElement::defaultEventHandler(Event* evt)
 {
     // On mousedown, bring up a menu, if needed
     HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
-    if (evt->type() == mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+    if (evt->type() == eventNames().mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
         input->focus();
         input->select();
         if (input && input->renderer() && static_cast<RenderTextControl*>(input->renderer())->popupIsVisible())
@@ -144,7 +142,7 @@ void SearchFieldCancelButtonElement::defaultEventHandler(Event* evt)
 {
     // If the element is visible, on mouseup, clear the value, and set selection
     HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
-    if (evt->type() == mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+    if (evt->type() == eventNames().mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
         input->focus();
         input->select();
         evt->setDefaultHandled();
@@ -153,7 +151,7 @@ void SearchFieldCancelButtonElement::defaultEventHandler(Event* evt)
                 frame->eventHandler()->setCapturingMouseEventsNode(this);
                 m_capturing = true;
             }
-    } else if (evt->type() == mouseupEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
+    } else if (evt->type() == eventNames().mouseupEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
         if (m_capturing && renderer() && renderer()->style()->visibility() == VISIBLE) {
             if (hovered()) {
                 input->setValue("");
index 8837dd5..56dc246 100644 (file)
@@ -227,7 +227,7 @@ void LocalStorageArea::dispatchStorageEvent(const String& key, const String& old
 
     for (unsigned i = 0; i < frames.size(); ++i) {
         if (HTMLElement* body = frames[i]->document()->body())
-            body->dispatchStorageEvent(EventNames::storageEvent, key, oldValue, newValue, sourceFrame);        
+            body->dispatchStorageEvent(eventNames().storageEvent, key, oldValue, newValue, sourceFrame);        
     }
 }
 
index bee3bf3..048c488 100644 (file)
@@ -82,7 +82,7 @@ void SessionStorageArea::dispatchStorageEvent(const String& key, const String& o
         
     for (unsigned i = 0; i < frames.size(); ++i) {
         if (HTMLElement* body = frames[i]->document()->body())
-            body->dispatchStorageEvent(EventNames::storageEvent, key, oldValue, newValue, sourceFrame);        
+            body->dispatchStorageEvent(eventNames().storageEvent, key, oldValue, newValue, sourceFrame);        
     }
 }
 
index 37bba9e..9236af4 100644 (file)
@@ -45,8 +45,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 SVGAElement::SVGAElement(const QualifiedName& tagName, Document *doc)
     : SVGStyledTransformableElement(tagName, doc)
     , SVGURIReference()
@@ -108,13 +106,13 @@ RenderObject* SVGAElement::createRenderer(RenderArena* arena, RenderStyle* style
 
 void SVGAElement::defaultEventHandler(Event* evt)
 {
-    if (isLink() && (evt->type() == clickEvent || (evt->type() == keydownEvent && focused()))) {
+    if (isLink() && (evt->type() == eventNames().clickEvent || (evt->type() == eventNames().keydownEvent && focused()))) {
         MouseEvent* e = 0;
-        if (evt->type() == clickEvent && evt->isMouseEvent())
+        if (evt->type() == eventNames().clickEvent && evt->isMouseEvent())
             e = static_cast<MouseEvent*>(evt);
         
         KeyboardEvent* k = 0;
-        if (evt->type() == keydownEvent && evt->isKeyboardEvent())
+        if (evt->type() == eventNames().keydownEvent && evt->isKeyboardEvent())
             k = static_cast<KeyboardEvent*>(evt);
         
         if (e && e->button() == RightButton) {
index ca76656..9244873 100644 (file)
@@ -57,7 +57,7 @@ void SVGDocument::dispatchZoomEvent(float prevScale, float newScale)
 {
     ExceptionCode ec = 0;
     RefPtr<SVGZoomEvent> event = static_pointer_cast<SVGZoomEvent>(createEvent("SVGZoomEvents", ec));
-    event->initEvent(EventNames::zoomEvent, true, false);
+    event->initEvent(eventNames().zoomEvent, true, false);
     event->setPreviousScale(prevScale);
     event->setNewScale(newScale);
     rootElement()->dispatchEvent(event.release(), ec);
@@ -67,7 +67,7 @@ void SVGDocument::dispatchScrollEvent()
 {
     ExceptionCode ec = 0;
     RefPtr<Event> event = createEvent("SVGEvents", ec);
-    event->initEvent(EventNames::scrollEvent, true, false);
+    event->initEvent(eventNames().scrollEvent, true, false);
     rootElement()->dispatchEvent(event.release(), ec);
 }
 
index 2de83ea..9ecfe7d 100644 (file)
@@ -47,7 +47,6 @@
 namespace WebCore {
 
 using namespace HTMLNames;
-using namespace EventNames;
 
 SVGElement::SVGElement(const QualifiedName& tagName, Document* doc)
     : StyledElement(tagName, doc)
@@ -143,25 +142,25 @@ void SVGElement::parseMappedAttribute(MappedAttribute* attr)
 {
     // standard events
     if (attr->name() == onloadAttr)
-        setInlineEventListenerForTypeAndAttribute(loadEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().loadEvent, attr);
     else if (attr->name() == onclickAttr)
-        setInlineEventListenerForTypeAndAttribute(clickEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().clickEvent, attr);
     else if (attr->name() == onmousedownAttr)
-        setInlineEventListenerForTypeAndAttribute(mousedownEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mousedownEvent, attr);
     else if (attr->name() == onmousemoveAttr)
-        setInlineEventListenerForTypeAndAttribute(mousemoveEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mousemoveEvent, attr);
     else if (attr->name() == onmouseoutAttr)
-        setInlineEventListenerForTypeAndAttribute(mouseoutEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mouseoutEvent, attr);
     else if (attr->name() == onmouseoverAttr)
-        setInlineEventListenerForTypeAndAttribute(mouseoverEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mouseoverEvent, attr);
     else if (attr->name() == onmouseupAttr)
-        setInlineEventListenerForTypeAndAttribute(mouseupEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().mouseupEvent, attr);
     else if (attr->name() == SVGNames::onfocusinAttr)
-        setInlineEventListenerForTypeAndAttribute(DOMFocusInEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().DOMFocusInEvent, attr);
     else if (attr->name() == SVGNames::onfocusoutAttr)
-        setInlineEventListenerForTypeAndAttribute(DOMFocusOutEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().DOMFocusOutEvent, attr);
     else if (attr->name() == SVGNames::onactivateAttr)
-        setInlineEventListenerForTypeAndAttribute(DOMActivateEvent, attr);
+        setInlineEventListenerForTypeAndAttribute(eventNames().DOMActivateEvent, attr);
     else
         StyledElement::parseMappedAttribute(attr);
 }
@@ -185,7 +184,7 @@ static bool hasLoadListener(SVGElement* node)
         if (list) {
             RegisteredEventListenerList::Iterator end = list->end();
             for (RegisteredEventListenerList::Iterator it = list->begin(); it != end; ++it)
-                if ((*it)->eventType() == loadEvent &&
+                if ((*it)->eventType() == eventNames().loadEvent &&
                     (*it)->useCapture() == true || currentNode == node)
                     return true;
         }
@@ -203,7 +202,7 @@ void SVGElement::sendSVGLoadEventIfPossible(bool sendParentLoadEvents)
         if (sendParentLoadEvents)
             parent = currentTarget->parentNode(); // save the next parent to dispatch too incase dispatching the event changes the tree
         if (hasLoadListener(currentTarget.get())) {
-            RefPtr<Event> event = Event::create(loadEvent, false, false);
+            RefPtr<Event> event = Event::create(eventNames().loadEvent, false, false);
             event->setTarget(currentTarget);
             ExceptionCode ignored = 0;
             currentTarget->dispatchGenericEvent(event.release(), ignored);
index 6afc9ba..e548900 100644 (file)
@@ -39,8 +39,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 #ifndef NDEBUG
 static WTF::RefCountedLeakCounter instanceCounter("WebCoreSVGElementInstance");
 #endif
@@ -171,402 +169,402 @@ bool SVGElementInstance::dispatchEvent(PassRefPtr<Event> e, ExceptionCode& ec)
 
 EventListener* SVGElementInstance::onabort() const
 {
-    return correspondingElement()->inlineEventListenerForType(abortEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().abortEvent);
 }
 
 void SVGElementInstance::setOnabort(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(abortEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().abortEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onblur() const
 {
-    return correspondingElement()->inlineEventListenerForType(blurEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().blurEvent);
 }
 
 void SVGElementInstance::setOnblur(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(blurEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().blurEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onchange() const
 {
-    return correspondingElement()->inlineEventListenerForType(changeEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().changeEvent);
 }
 
 void SVGElementInstance::setOnchange(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(changeEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().changeEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onclick() const
 {
-    return correspondingElement()->inlineEventListenerForType(clickEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().clickEvent);
 }
 
 void SVGElementInstance::setOnclick(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(clickEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().clickEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::oncontextmenu() const
 {
-    return correspondingElement()->inlineEventListenerForType(contextmenuEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().contextmenuEvent);
 }
 
 void SVGElementInstance::setOncontextmenu(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(contextmenuEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().contextmenuEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::ondblclick() const
 {
-    return correspondingElement()->inlineEventListenerForType(dblclickEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().dblclickEvent);
 }
 
 void SVGElementInstance::setOndblclick(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(dblclickEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().dblclickEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onerror() const
 {
-    return correspondingElement()->inlineEventListenerForType(errorEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().errorEvent);
 }
 
 void SVGElementInstance::setOnerror(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(errorEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().errorEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onfocus() const
 {
-    return correspondingElement()->inlineEventListenerForType(focusEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().focusEvent);
 }
 
 void SVGElementInstance::setOnfocus(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(focusEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().focusEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::oninput() const
 {
-    return correspondingElement()->inlineEventListenerForType(inputEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().inputEvent);
 }
 
 void SVGElementInstance::setOninput(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(inputEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().inputEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onkeydown() const
 {
-    return correspondingElement()->inlineEventListenerForType(keydownEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().keydownEvent);
 }
 
 void SVGElementInstance::setOnkeydown(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(keydownEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().keydownEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onkeypress() const
 {
-    return correspondingElement()->inlineEventListenerForType(keypressEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().keypressEvent);
 }
 
 void SVGElementInstance::setOnkeypress(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(keypressEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().keypressEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onkeyup() const
 {
-    return correspondingElement()->inlineEventListenerForType(keyupEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().keyupEvent);
 }
 
 void SVGElementInstance::setOnkeyup(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(keyupEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().keyupEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onload() const
 {
-    return correspondingElement()->inlineEventListenerForType(loadEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().loadEvent);
 }
 
 void SVGElementInstance::setOnload(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(loadEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().loadEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onmousedown() const
 {
-    return correspondingElement()->inlineEventListenerForType(mousedownEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().mousedownEvent);
 }
 
 void SVGElementInstance::setOnmousedown(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(mousedownEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().mousedownEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onmousemove() const
 {
-    return correspondingElement()->inlineEventListenerForType(mousemoveEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().mousemoveEvent);
 }
 
 void SVGElementInstance::setOnmousemove(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(mousemoveEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().mousemoveEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onmouseout() const
 {
-    return correspondingElement()->inlineEventListenerForType(mouseoutEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().mouseoutEvent);
 }
 
 void SVGElementInstance::setOnmouseout(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(mouseoutEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().mouseoutEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onmouseover() const
 {
-    return correspondingElement()->inlineEventListenerForType(mouseoverEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().mouseoverEvent);
 }
 
 void SVGElementInstance::setOnmouseover(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(mouseoverEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().mouseoverEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onmouseup() const
 {
-    return correspondingElement()->inlineEventListenerForType(mouseupEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().mouseupEvent);
 }
 
 void SVGElementInstance::setOnmouseup(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(mouseupEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().mouseupEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onmousewheel() const
 {
-    return correspondingElement()->inlineEventListenerForType(mousewheelEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().mousewheelEvent);
 }
 
 void SVGElementInstance::setOnmousewheel(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(mousewheelEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().mousewheelEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onbeforecut() const
 {
-    return correspondingElement()->inlineEventListenerForType(beforecutEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().beforecutEvent);
 }
 
 void SVGElementInstance::setOnbeforecut(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(beforecutEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().beforecutEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::oncut() const
 {
-    return correspondingElement()->inlineEventListenerForType(cutEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().cutEvent);
 }
 
 void SVGElementInstance::setOncut(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(cutEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().cutEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onbeforecopy() const
 {
-    return correspondingElement()->inlineEventListenerForType(beforecopyEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().beforecopyEvent);
 }
 
 void SVGElementInstance::setOnbeforecopy(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(beforecopyEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().beforecopyEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::oncopy() const
 {
-    return correspondingElement()->inlineEventListenerForType(copyEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().copyEvent);
 }
 
 void SVGElementInstance::setOncopy(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(copyEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().copyEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onbeforepaste() const
 {
-    return correspondingElement()->inlineEventListenerForType(beforepasteEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().beforepasteEvent);
 }
 
 void SVGElementInstance::setOnbeforepaste(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(beforepasteEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().beforepasteEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onpaste() const
 {
-    return correspondingElement()->inlineEventListenerForType(pasteEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().pasteEvent);
 }
 
 void SVGElementInstance::setOnpaste(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(pasteEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().pasteEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::ondragenter() const
 {
-    return correspondingElement()->inlineEventListenerForType(dragenterEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().dragenterEvent);
 }
 
 void SVGElementInstance::setOndragenter(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(dragenterEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().dragenterEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::ondragover() const
 {
-    return correspondingElement()->inlineEventListenerForType(dragoverEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().dragoverEvent);
 }
 
 void SVGElementInstance::setOndragover(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(dragoverEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().dragoverEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::ondragleave() const
 {
-    return correspondingElement()->inlineEventListenerForType(dragleaveEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().dragleaveEvent);
 }
 
 void SVGElementInstance::setOndragleave(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(dragleaveEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().dragleaveEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::ondrop() const
 {
-    return correspondingElement()->inlineEventListenerForType(dropEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().dropEvent);
 }
 
 void SVGElementInstance::setOndrop(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(dropEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().dropEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::ondragstart() const
 {
-    return correspondingElement()->inlineEventListenerForType(dragstartEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().dragstartEvent);
 }
 
 void SVGElementInstance::setOndragstart(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(dragstartEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().dragstartEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::ondrag() const
 {
-    return correspondingElement()->inlineEventListenerForType(dragEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().dragEvent);
 }
 
 void SVGElementInstance::setOndrag(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(dragEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().dragEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::ondragend() const
 {
-    return correspondingElement()->inlineEventListenerForType(dragendEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().dragendEvent);
 }
 
 void SVGElementInstance::setOndragend(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(dragendEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().dragendEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onreset() const
 {
-    return correspondingElement()->inlineEventListenerForType(resetEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().resetEvent);
 }
 
 void SVGElementInstance::setOnreset(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(resetEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().resetEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onresize() const
 {
-    return correspondingElement()->inlineEventListenerForType(resizeEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().resizeEvent);
 }
 
 void SVGElementInstance::setOnresize(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(resizeEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().resizeEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onscroll() const
 {
-    return correspondingElement()->inlineEventListenerForType(scrollEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().scrollEvent);
 }
 
 void SVGElementInstance::setOnscroll(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(scrollEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().scrollEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onsearch() const
 {
-    return correspondingElement()->inlineEventListenerForType(searchEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().searchEvent);
 }
 
 void SVGElementInstance::setOnsearch(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(searchEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().searchEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onselect() const
 {
-    return correspondingElement()->inlineEventListenerForType(selectEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().selectEvent);
 }
 
 void SVGElementInstance::setOnselect(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(selectEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().selectEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onselectstart() const
 {
-    return correspondingElement()->inlineEventListenerForType(selectstartEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().selectstartEvent);
 }
 
 void SVGElementInstance::setOnselectstart(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(selectstartEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().selectstartEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onsubmit() const
 {
-    return correspondingElement()->inlineEventListenerForType(submitEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().submitEvent);
 }
 
 void SVGElementInstance::setOnsubmit(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(submitEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().submitEvent, eventListener);
 }
 
 EventListener* SVGElementInstance::onunload() const
 {
-    return correspondingElement()->inlineEventListenerForType(unloadEvent);
+    return correspondingElement()->inlineEventListenerForType(eventNames().unloadEvent);
 }
 
 void SVGElementInstance::setOnunload(PassRefPtr<EventListener> eventListener)
 {
-    correspondingElement()->setInlineEventListenerForType(unloadEvent, eventListener);
+    correspondingElement()->setInlineEventListenerForType(eventNames().unloadEvent, eventListener);
 }
 
 }
index a886663..6e0915d 100644 (file)
@@ -46,7 +46,7 @@ void SVGImageLoader::dispatchLoadEvent()
         setHaveFiredLoadEvent(true);
         
         if (image()->errorOccurred())
-            element()->dispatchEventForType(EventNames::errorEvent, false, false);
+            element()->dispatchEventForType(eventNames().errorEvent, false, false);
         else {
             SVGImageElement* imageElement = static_cast<SVGImageElement*>(element());
             if (imageElement->externalResourcesRequiredBaseValue())
index 77046e9..23a1fd9 100644 (file)
@@ -51,7 +51,6 @@
 namespace WebCore {
 
 using namespace HTMLNames;
-using namespace EventNames;
 using namespace SVGNames;
 
 SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document* doc)
@@ -220,13 +219,13 @@ void SVGSVGElement::parseMappedAttribute(MappedAttribute* attr)
 
         // Only handle events if we're the outermost <svg> element
         if (attr->name() == onunloadAttr)
-            document()->setWindowInlineEventListenerForTypeAndAttribute(unloadEvent, attr);
+            document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().unloadEvent, attr);
         else if (attr->name() == onresizeAttr)
-            document()->setWindowInlineEventListenerForTypeAndAttribute(resizeEvent, attr);
+            document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().resizeEvent, attr);
         else if (attr->name() == onscrollAttr)
-            document()->setWindowInlineEventListenerForTypeAndAttribute(scrollEvent, attr);
+            document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().scrollEvent, attr);
         else if (attr->name() == SVGNames::onzoomAttr)
-            document()->setWindowInlineEventListenerForTypeAndAttribute(zoomEvent, attr);
+            document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().zoomEvent, attr);
         else
             setListener = false;
  
@@ -235,9 +234,9 @@ void SVGSVGElement::parseMappedAttribute(MappedAttribute* attr)
     }
 
     if (attr->name() == onabortAttr)
-        document()->setWindowInlineEventListenerForTypeAndAttribute(abortEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().abortEvent, attr);
     else if (attr->name() == onerrorAttr)
-        document()->setWindowInlineEventListenerForTypeAndAttribute(errorEvent, attr);
+        document()->setWindowInlineEventListenerForTypeAndAttribute(eventNames().errorEvent, attr);
     else if (attr->name() == SVGNames::xAttr)
         setXBaseValue(SVGLength(LengthModeWidth, attr->value()));
     else if (attr->name() == SVGNames::yAttr)
index 5a5fe9c..3c3a7a3 100644 (file)
@@ -204,7 +204,7 @@ void SVGScriptElement::dispatchLoadEvent()
 
 void SVGScriptElement::dispatchErrorEvent()
 {
-    dispatchEventForType(EventNames::errorEvent, true, false);
+    dispatchEventForType(eventNames().errorEvent, true, false);
 }
 
 }
index 9182399..67aba0b 100644 (file)
@@ -51,8 +51,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 struct PreflightResultCacheItem {
     PreflightResultCacheItem(unsigned expiryDelta, bool credentials, HashSet<String>* methods, HashSet<String, CaseFoldingHash>* headers)
         : m_absoluteExpiryTime(currentTime() + expiryDelta)
@@ -1248,7 +1246,7 @@ void XMLHttpRequest::updateAndDispatchOnProgress(unsigned int len)
 
 void XMLHttpRequest::dispatchReadyStateChangeEvent()
 {
-    RefPtr<Event> evt = Event::create(readystatechangeEvent, false, false);
+    RefPtr<Event> evt = Event::create(eventNames().readystatechangeEvent, false, false);
     if (m_onReadyStateChangeListener) {
         evt->setTarget(this);
         evt->setCurrentTarget(this);
@@ -1276,27 +1274,27 @@ void XMLHttpRequest::dispatchXMLHttpRequestProgressEvent(EventListener* listener
 
 void XMLHttpRequest::dispatchAbortEvent()
 {
-    dispatchXMLHttpRequestProgressEvent(m_onAbortListener.get(), abortEvent, false, 0, 0);
+    dispatchXMLHttpRequestProgressEvent(m_onAbortListener.get(), eventNames().abortEvent, false, 0, 0);
 }
 
 void XMLHttpRequest::dispatchErrorEvent()
 {
-    dispatchXMLHttpRequestProgressEvent(m_onErrorListener.get(), errorEvent, false, 0, 0);
+    dispatchXMLHttpRequestProgressEvent(m_onErrorListener.get(), eventNames().errorEvent, false, 0, 0);
 }
 
 void XMLHttpRequest::dispatchLoadEvent()
 {
-    dispatchXMLHttpRequestProgressEvent(m_onLoadListener.get(), loadEvent, false, 0, 0);
+    dispatchXMLHttpRequestProgressEvent(m_onLoadListener.get(), eventNames().loadEvent, false, 0, 0);
 }
 
 void XMLHttpRequest::dispatchLoadStartEvent()
 {
-    dispatchXMLHttpRequestProgressEvent(m_onLoadStartListener.get(), loadstartEvent, false, 0, 0);
+    dispatchXMLHttpRequestProgressEvent(m_onLoadStartListener.get(), eventNames().loadstartEvent, false, 0, 0);
 }
 
 void XMLHttpRequest::dispatchProgressEvent(long long expectedLength)
 {
-    dispatchXMLHttpRequestProgressEvent(m_onProgressListener.get(), progressEvent, expectedLength && m_receivedLength <= expectedLength, 
+    dispatchXMLHttpRequestProgressEvent(m_onProgressListener.get(), eventNames().progressEvent, expectedLength && m_receivedLength <= expectedLength, 
                                         static_cast<unsigned>(m_receivedLength), static_cast<unsigned>(expectedLength));
 }
 
index 7744007..cef1798 100644 (file)
@@ -37,8 +37,6 @@
 
 namespace WebCore {
 
-using namespace EventNames;
-
 XMLHttpRequestUpload::XMLHttpRequestUpload(XMLHttpRequest* xmlHttpRequest)
     : m_xmlHttpRequest(xmlHttpRequest)
 {
@@ -120,27 +118,27 @@ void XMLHttpRequestUpload::dispatchXMLHttpRequestProgressEvent(EventListener* li
 
 void XMLHttpRequestUpload::dispatchAbortEvent()
 {
-    dispatchXMLHttpRequestProgressEvent(m_onAbortListener.get(), abortEvent, false, 0, 0);
+    dispatchXMLHttpRequestProgressEvent(m_onAbortListener.get(), eventNames().abortEvent, false, 0, 0);
 }
 
 void XMLHttpRequestUpload::dispatchErrorEvent()
 {
-    dispatchXMLHttpRequestProgressEvent(m_onErrorListener.get(), errorEvent, false, 0, 0);
+    dispatchXMLHttpRequestProgressEvent(m_onErrorListener.get(), eventNames().errorEvent, false, 0, 0);
 }
 
 void XMLHttpRequestUpload::dispatchLoadEvent()
 {
-    dispatchXMLHttpRequestProgressEvent(m_onLoadListener.get(), loadEvent, false, 0, 0);
+    dispatchXMLHttpRequestProgressEvent(m_onLoadListener.get(), eventNames().loadEvent, false, 0, 0);
 }
 
 void XMLHttpRequestUpload::dispatchLoadStartEvent()
 {
-    dispatchXMLHttpRequestProgressEvent(m_onLoadStartListener.get(), loadstartEvent, false, 0, 0);
+    dispatchXMLHttpRequestProgressEvent(m_onLoadStartListener.get(), eventNames().loadstartEvent, false, 0, 0);
 }
 
 void XMLHttpRequestUpload::dispatchProgressEvent(long long bytesSent, long long totalBytesToBeSent)
 {
-    dispatchXMLHttpRequestProgressEvent(m_onProgressListener.get(), progressEvent, true, static_cast<unsigned>(bytesSent), static_cast<unsigned>(totalBytesToBeSent));
+    dispatchXMLHttpRequestProgressEvent(m_onProgressListener.get(), eventNames().progressEvent, true, static_cast<unsigned>(bytesSent), static_cast<unsigned>(totalBytesToBeSent));
 }
 
 } // namespace WebCore
index da377f7..285350e 100644 (file)
@@ -55,7 +55,7 @@ XPathResult::XPathResult(EventTargetNode* eventTarget, const Value& value)
     , m_eventTarget(eventTarget)
 {
     m_eventListener = InvalidatingEventListener::create(this);
-    m_eventTarget->addEventListener(EventNames::DOMSubtreeModifiedEvent, m_eventListener, false);
+    m_eventTarget->addEventListener(eventNames().DOMSubtreeModifiedEvent, m_eventListener, false);
     switch (m_value.type()) {
         case Value::BooleanValue:
             m_resultType = BOOLEAN_TYPE;
@@ -79,7 +79,7 @@ XPathResult::XPathResult(EventTargetNode* eventTarget, const Value& value)
 XPathResult::~XPathResult()
 {
     if (m_eventTarget)
-        m_eventTarget->removeEventListener(EventNames::DOMSubtreeModifiedEvent, m_eventListener.get(), false);
+        m_eventTarget->removeEventListener(eventNames().DOMSubtreeModifiedEvent, m_eventListener.get(), false);
 }
 
 void XPathResult::convertTo(unsigned short type, ExceptionCode& ec)
@@ -181,7 +181,7 @@ void XPathResult::invalidateIteratorState()
     ASSERT(m_eventTarget);
     ASSERT(m_eventListener);
     
-    m_eventTarget->removeEventListener(EventNames::DOMSubtreeModifiedEvent, m_eventListener.get(), false);
+    m_eventTarget->removeEventListener(eventNames().DOMSubtreeModifiedEvent, m_eventListener.get(), false);
     
     m_eventTarget = 0;
 }
index cc98a7b..78db0ab 100644 (file)
@@ -1,3 +1,15 @@
+2008-11-01  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22030
+        Make EventNames usable from multiple threads
+
+        * WebView/WebHTMLView.mm:
+        * WebView/WebPDFView.mm:
+        (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
+        Access event names via eventNames() function.
+
 2008-11-04  Cameron Zwarich  <zwarich@apple.com>
 
         Reviewed by Mark Rowe.
index e502f59..8deb186 100644 (file)
@@ -18,4 +18,4 @@ WEBCORE_PRIVATE_HEADERS_DIR = $(UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/Priva
 OTHER_LDFLAGS = -sub_umbrella WebCore $(OTHER_LDFLAGS);
 
 // This needs to be kept sorted, and in sync with FEATURE_DEFINES in JavaScriptCore.xcconfig, WebCore.xcconfig and the default settings of build-webkit.
-FEATURE_DEFINES = ENABLE_DATABASE ENABLE_DOM_STORAGE ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_XPATH ENABLE_XSLT;
+FEATURE_DEFINES = ENABLE_DATABASE ENABLE_DOM_STORAGE ENABLE_ICONDATABASE ENABLE_OFFLINE_WEB_APPLICATIONS ENABLE_SVG ENABLE_SVG_ANIMATION ENABLE_SVG_AS_IMAGE ENABLE_SVG_FONTS ENABLE_SVG_FOREIGN_OBJECT ENABLE_SVG_USE ENABLE_VIDEO ENABLE_WORKER_THREADS ENABLE_XPATH ENABLE_XSLT;
index 3f3726f..4d9b3a8 100644 (file)
@@ -83,7 +83,6 @@
 #import <WebCore/EditorDeleteAction.h>
 #import <WebCore/Element.h>
 #import <WebCore/EventHandler.h>
-#import <WebCore/EventNames.h>
 #import <WebCore/ExceptionHandlers.h>
 #import <WebCore/DragController.h>
 #import <WebCore/FloatRect.h>
index 1cec9c0..1009cdd 100644 (file)
@@ -57,7 +57,6 @@
 #import <wtf/Assertions.h>
 
 using namespace WebCore;
-using namespace EventNames;
 
 // Redeclarations of PDFKit notifications. We can't use the API since we use a weak link to the framework.
 #define _webkit_PDFViewDisplayModeChangedNotification @"PDFViewDisplayModeChanged"
@@ -935,7 +934,7 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
         case NSKeyDown: {
             PlatformKeyboardEvent pe(nsEvent);
             pe.disambiguateKeyDownEvent(PlatformKeyboardEvent::RawKeyDown);
-            event = KeyboardEvent::create(keydownEvent, true, true, 0,
+            event = KeyboardEvent::create(eventNames().keydownEvent, true, true, 0,
                 pe.keyIdentifier(), pe.windowsVirtualKeyCode(),
                 pe.ctrlKey(), pe.altKey(), pe.shiftKey(), pe.metaKey(), false);
         }
@@ -943,7 +942,7 @@ static BOOL _PDFSelectionsAreEqual(PDFSelection *selectionA, PDFSelection *selec
             break;
     }
     if (button != noButton)
-        event = MouseEvent::create(clickEvent, true, true, 0, [nsEvent clickCount], 0, 0, 0, 0,
+        event = MouseEvent::create(eventNames().clickEvent, true, true, 0, [nsEvent clickCount], 0, 0, 0, 0,
             [nsEvent modifierFlags] & NSControlKeyMask,
             [nsEvent modifierFlags] & NSAlternateKeyMask,
             [nsEvent modifierFlags] & NSShiftKeyMask,
index 2ad783a..ae26480 100644 (file)
@@ -1,3 +1,12 @@
+2008-11-01  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22030
+        Make EventNames usable from multiple threads
+
+        * WebView.cpp: (WebView::interpretKeyEvent): Access event names via eventNames() function.
+
 2008-11-03  Cameron Zwarich  <zwarich@apple.com>
 
         Rubber-stamped by Maciej Stachowiak.
index d2f8c7e..273d626 100644 (file)
 #include <windowsx.h>
 
 using namespace WebCore;
-using namespace WebCore::EventNames;
 using JSC::JSLock;
 using std::min;
 using std::max;
@@ -1436,7 +1435,7 @@ static const KeyPressEntry keyPressEntries[] = {
 
 const char* WebView::interpretKeyEvent(const KeyboardEvent* evt)
 {
-    ASSERT(evt->type() == keydownEvent || evt->type() == keypressEvent);
+    ASSERT(evt->type() == eventNames().keydownEvent || evt->type() == eventNames().keypressEvent);
 
     static HashMap<int, const char*>* keyDownCommandsMap = 0;
     static HashMap<int, const char*>* keyPressCommandsMap = 0;
@@ -1460,7 +1459,7 @@ const char* WebView::interpretKeyEvent(const KeyboardEvent* evt)
     if (evt->ctrlKey())
         modifiers |= CtrlKey;
 
-    if (evt->type() == keydownEvent) {
+    if (evt->type() == eventNames().keydownEvent) {
         int mapKey = modifiers << 16 | evt->keyCode();
         return mapKey ? keyDownCommandsMap->get(mapKey) : 0;
     }