Add toSVGColor|Paint() to cleanup static_cast<>, and use it
https://bugs.webkit.org/show_bug.cgi?id=122630

Reviewed by Andreas Kling.

SVGColor and SVGPaint can't use CSS_VALUE_TYPE_CASTS(), this cl adds
toSVGColor() and toSVGPaint() manually. Those functions will help to
detect bad type cast.

* css/CSSValue.cpp:
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/SVGCSSStyleSelector.cpp:
(WebCore::StyleResolver::applySVGProperty):
* svg/SVGColor.h:
(WebCore::toSVGColor):
* svg/SVGPaint.h:
(WebCore::toSVGPaint):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r157205?): Leaks in XPath
https://bugs.webkit.org/show_bug.cgi?id=122609

Reviewed by Andreas Kling.

* xml/XPathGrammar.y: Fixed warnings by adding missing "$$ = $1" to various rules.
Added local unique_ptr for NodeTest and ArgumentList in three rules, so they
won't be leaked.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157287 268f45cc-cd09-0410-ab3c-d52691b4dbfc
EventContext should be used only in EventDispatcher.cpp
https://bugs.webkit.org/show_bug.cgi?id=122631

Reviewed by Anders Carlsson.

Merged WindowEventContext into EventDispatcher. Moved the code to avoid dispatching load event on
window into dispatchEventInDOM so that WindowEventContext's constructor doesn't need Event.

Also replaced DOMWindow, Node, and EventPath arguments to InspectorInstrumentation::willDispatchEvent
by a single boolean indicating whether window, the origin, or the event path has an event listener.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/EventDispatcher.cpp:
(WebCore::WindowEventContext::window): Moved from WindowEventContext.
(WebCore::WindowEventContext::target): Ditto.
(WebCore::WindowEventContext::WindowEventContext): Ditto; removed the code to avoid dispatching load
event on window since that's checked in dispatchEventInDOM now.
(WebCore::WindowEventContext::handleLocalEvents): Ditto.
(WebCore::dispatchEventInDOM): Avoid calling handleLocalEvent on a load event with WindowEventContext.
(WebCore::EventDispatcher::dispatchEvent): Pass a boolean to indicate whether window, the origin, or
the event path contains any event listener to InspectorInstrumentation::willDispatchEvent to hide
EventPath from the inspector code.
* dom/EventDispatcher.h:
* dom/Node.cpp:
* dom/Node.h:
* dom/WindowEventContext.cpp: Removed.
* dom/WindowEventContext.h: Removed.
* inspector/InspectorDOMAgent.cpp:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willDispatchEventImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willDispatchEvent):


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