Use EventPathWalker rather than parentNode() to normalize event targets in EventHandler.
https://bugs.webkit.org/show_bug.cgi?id=110037

Reviewed by Ryosuke Niwa.

Source/WebCore:

We need to teach EventHandler about Shadow DOM in a few places in order
to ensure that we properly target events dispatched upon text nodes.
Rather than naively grabbing the text node's direct parent via
parentNode(), we need to account for the case in which the text node is
distributed[1] to an insertion point inside a shadow host.
EventPathWalker::parent understands these relationships, and should
be used when dealing with mouse, drag, and touch events.

[1]: http://www.w3.org/TR/shadow-dom/#dfn-distribution

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseDraggedEvent):
(WebCore::EventHandler::handleTouchEvent):
(WebCore::EventHandler::passGestureEventToWidgetIfPossible):
(WebCore::EventHandler::updateDragAndDrop):
    Refactor parentNode callsites to use EventPathWalker::parent().

LayoutTests:

* fast/dom/shadow/resources/event-dispatching.js:
(scrollMouseWheel):
(addEventListeners):
    Add MouseWheel, Drag, and Touch support to the event-dispatching
    tests in Shadow DOM.
* fast/dom/shadow/shadow-dom-event-dispatching-distributed-text-node.html:
* fast/dom/shadow/shadow-dom-event-dispatching-text-node-in-shadow-root.html:
    Scroll the mouse wheel, drag a bit, and touch before leaving the
    text node, and record the generated events.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: highlight undefined word in JavaScript
https://bugs.webkit.org/show_bug.cgi?id=109585

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-02-20
Reviewed by Vsevolod Vlasov.

Source/WebCore:

Test enhancement: inspector/syntax-highlight-javascript.html

Add global object value properties to tokenizer and add a css style
class to highlight "undefined" with gray color.

* inspector/front-end/SourceJavaScriptTokenizer.js:
(WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
* inspector/front-end/SourceJavaScriptTokenizer.re2js:
* inspector/front-end/inspectorSyntaxHighlight.css:
(.webkit-javascript-undef):

LayoutTests:

Enhance layout test to verify highlighting of global object value properties.

* inspector/syntax-highlight-javascript-expected.txt:
* inspector/syntax-highlight-javascript.html:

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