Use FocusEvent.relatedTarget in {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator.
https://bugs.webkit.org/show_bug.cgi?id=109650

Reviewed by Dimitri Glazkov.

Set FocusEvent.relatedTarget in its constructor so that each
EventDispatchMediator can use FocusEvent.relatedTarget rather than
its redundant m_{old,new}FocusedNode member variable.

I've also removed FIXME comments, mentioning bug 109261, since I
can not reproduce the issue.

No new tests. No change in functionality.

* dom/FocusEvent.cpp:
(WebCore::FocusEventDispatchMediator::create):
(WebCore::FocusEventDispatchMediator::FocusEventDispatchMediator):
(WebCore::FocusEventDispatchMediator::dispatchEvent):
(WebCore::BlurEventDispatchMediator::create):
(WebCore::BlurEventDispatchMediator::BlurEventDispatchMediator):
(WebCore::BlurEventDispatchMediator::dispatchEvent):
(WebCore::FocusInEventDispatchMediator::create):
(WebCore::FocusInEventDispatchMediator::FocusInEventDispatchMediator):
(WebCore::FocusInEventDispatchMediator::dispatchEvent):
(WebCore::FocusOutEventDispatchMediator::create):
(WebCore::FocusOutEventDispatchMediator::FocusOutEventDispatchMediator):
(WebCore::FocusOutEventDispatchMediator::dispatchEvent):
* dom/FocusEvent.h:
(FocusEventDispatchMediator):
(BlurEventDispatchMediator):
(FocusInEventDispatchMediator):
(FocusOutEventDispatchMediator):
* dom/Node.cpp:
(WebCore::Node::dispatchFocusInEvent):
(WebCore::Node::dispatchFocusOutEvent):
(WebCore::Node::dispatchFocusEvent):
(WebCore::Node::dispatchBlurEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
 AX: crash when accessing AccessibilityScrollbar after page has been unloaded
 https://bugs.webkit.org/show_bug.cgi?id=109524

 Reviewed by Ryosuke Niwa.

 AX clients can hold onto AccesibilityScrollbar references that reference parent
 AccessibilityScrollViews that have already gone away.

 AccessibilityScrollView is not calling detachFromParent after it is removed, which
 leads to a crash. The fix is to clearChildren() when an object is deallocated.

 I could not create a test because the crash only manifests over multiple page loads.

 * accessibility/AccessibilityObject.cpp:
 (WebCore::AccessibilityObject::detach):



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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142722 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Eradicate fast/js/dfg-poison-fuzz.html
https://bugs.webkit.org/show_bug.cgi?id=109660

Unreviewed.
        
I haven't seen this test fail in ages.  And I've seen a lot of DFG bugs!

This is a super expensive test for one bug that used to be in the DFG but that has
since been thoroughly eradicated. Likely the plethora of other DFG tests cover that
bug. Heck, I'm not even sure if the code that this covers is even in the repository
anymore.

In the spirit of not having super expensive and mostly useless tests, I'm removing
this test.

* fast/js/dfg-poison-fuzz-expected.txt: Removed.
* fast/js/dfg-poison-fuzz.html: Removed.
* fast/js/jsc-test-list:
* fast/js/script-tests/dfg-poison-fuzz.js: Removed.
* platform/chromium/TestExpectations:
* platform/gtk/TestExpectations:
* platform/qt-4.8/TestExpectations:
* platform/qt-mac/TestExpectations:
* platform/qt/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Remove the GLib unicode backend
https://bugs.webkit.org/show_bug.cgi?id=109627

Patch by Martin Robinson <mrobinson@igalia.com> on 2013-02-12
Reviewed by Benjamin Poulain.

.:

Remove references to the GLib unicode backend from configuration.

* Source/autotools/FindDependencies.m4:
* Source/autotools/ReadCommandLineArguments.m4:
* Source/autotools/SetupAutoconfHeader.m4:
* Source/autotools/SetupAutomake.m4:

Source/WebCore:

Remove references to the GLib unicode backend from WebCore.

* GNUmakefile.list.am: Update the source list.
* platform/text/gtk/TextBreakIteratorGtk.cpp: Removed.
* platform/text/gtk/TextCodecGtk.cpp: Removed.
* platform/text/gtk/TextCodecGtk.h: Removed.

Source/WTF:

Remove references to the GLib unicode backend from WTF.

* GNUmakefile.list.am: Remove GLib unicode files from the source list.
* wtf/unicode/glib/UnicodeGLib.cpp: Removed.
* wtf/unicode/glib/UnicodeGLib.h: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Introduce version controller to migrate settings versions.
https://bugs.webkit.org/show_bug.cgi?id=109553

Reviewed by Yury Semikhatsky.

Source/WebCore:

This patch introduces version controller that could be used to migrate inspector settings.

Test: inspector/version-controller.html

* inspector/front-end/Settings.js:
(WebInspector.Settings):
(WebInspector.VersionController):
(WebInspector.VersionController.prototype.set _methodsToRunToUpdateVersion):
(WebInspector.VersionController.prototype._updateVersionFrom0To1):
* inspector/front-end/inspector.js:

LayoutTests:

* inspector/version-controller-expected.txt: Added.
* inspector/version-controller.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Internals] setShadowDOMEnabled() shouldn't be used except a few tests.
https://bugs.webkit.org/show_bug.cgi?id=109642

Reviewed by Kent Tamura.

Source/WebCore:

InternalSettings.setShadowDOMEnabled() shouldn't be called after
any relevant DOM bindings are touched. However for fuzzers, it
isn't trivial to regulate its behavior.

This change whitelists the URL of running test for prevent
unintended API calls. This doesn't hurt the Internals usability
since the API is called from just a couple of tests and the number
isn't expected to grow.

Test: fast/dom/shadow/shadow-dom-enabled-flag-whitelist.html

* testing/InternalSettings.cpp:
(WebCore::urlIsWhitelisted):
(WebCore):
(WebCore::InternalSettings::setShadowDOMEnabled):

LayoutTests:

* fast/dom/shadow/shadow-dom-enabled-flag-whitelist-expected.txt: Added.
* fast/dom/shadow/shadow-dom-enabled-flag-whitelist.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] There is no XXXConstructor that requires a custom getter
https://bugs.webkit.org/show_bug.cgi?id=109667

Reviewed by Adam Barth.

Currently '[Custom] attribute XXXConstructor xxx' generates
XXXAttrGetter(). However, there is no XXXConstructor with [Custom].
In addition, it does make no sense to generate XXXAttrGetter() for such cases.
We can remove the logic from CodeGeneratorV8.pm.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateSingleBatchedAttribute):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r142611.
http://trac.webkit.org/changeset/142611
https://bugs.webkit.org/show_bug.cgi?id=109668

Suggest box is not shown anymore when user types "window." in
inspector console. (Requested by vsevik on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-13

* inspector/front-end/TextPrompt.js:
(WebInspector.TextPrompt.prototype.complete):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Skip failing tests.

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Generate wrapper methods for custom getters/setters
https://bugs.webkit.org/show_bug.cgi?id=109666

Reviewed by Adam Barth.

Currently V8 directly calls back custom getters/setters written
in custom binding files. This makes it impossible for code generators
to hook custom getters/setters (e.g. Code generators cannot insert a code
for FeatureObservation into custom getters/setters). We should generate
wrapper methods for custom getters/setters.

In the future, I will insert TRACE_EVENT() macros into these wrapper methods
to profile DOM getters/setters/methods.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateNormalAttrGetter):
(GenerateNormalAttrSetter):
(GenerateSingleBatchedAttribute):
(GenerateImplementation):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore::TestInterfaceV8Internal::supplementalStr3AttrGetter):
(TestInterfaceV8Internal):
(WebCore::TestInterfaceV8Internal::supplementalStr3AttrSetter):
(WebCore):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::customAttrAttrGetter):
(TestObjV8Internal):
(WebCore::TestObjV8Internal::customAttrAttrSetter):
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Chromium gyp-file cleanup after glib backend removal.
https://bugs.webkit.org/show_bug.cgi?id=109672

Removed references to GLib unicode backend:

Source/WebCore:

* WebCore.gypi:

Source/WebKit/gtk:

* gyp/Configuration.gypi.in:
* gyp/Dependencies.gyp:
* gyp/JavaScriptCore.gyp:
* gyp/WTF.gyp:

Source/WTF:

* WTF.gyp/WTF.gyp:
* WTF.gypi:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.
Rebaselining tests after the DOM4 Events constructors and CSS image-set
support were enabled.

* platform/gtk/fast/dom/constructed-objects-prototypes-expected.txt:
* platform/gtk/fast/events/constructors: Added.
* platform/gtk/fast/events/constructors/mouse-event-constructor-expected.txt: Added.
* platform/gtk/fast/events/constructors/wheel-event-constructor-expected.txt: Added.
* platform/gtk/fast/hidpi/image-set-border-image-comparison-expected.txt:
* platform/gtk/fast/hidpi/image-set-border-image-dynamic-expected.txt:
* platform/gtk/fast/hidpi/image-set-border-image-simple-expected.txt:
* platform/gtk/fast/hidpi/image-set-in-content-dynamic-expected.txt:
* platform/gtk/fast/hidpi/image-set-out-of-order-expected.txt:
* platform/gtk/fast/hidpi/image-set-simple-expected.txt:
* platform/gtk/fast/hidpi/image-set-without-specified-width-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed test fix: removed redundant testRunnet.notifyDone() call that was causing other test failures.

* inspector/script-execution-state-change-notification.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
location.href does not throw SECURITY_ERR when accessed across origins with JSC bindings
https://bugs.webkit.org/show_bug.cgi?id=43891

Reviewed by Adam Barth.

Source/WebCore:

Other browsers (IE, Firefox, and Opera) throw an exception when accessing
properties of a Location object across origins, as the spec suggests[1].
WebKit is currently the outlier.

This has a few negative effects: developers are forced to hack around
access violations in two ways rather than having a single code path, and
(more annoyingly) developers are unable to avoid generating the error
message. See every ad on the internet for the effect on the console. :)

This patch adds a SECURITY_ERR exception to these access violations,
which is the first step towards getting rid of the console spam. Getting
rid of the message entirely will require a solution to
http://wkbug.com/98050.

A fairly inconclusive thread[2] on webkit-dev popped up in 2010 and
trailed off without reaching conclusion. A more recent thread reached
agreement that this patch seems like a reasonable thing to do[3].

This is the JSC half of the patch. V8 is coming in http://wkbug.com/43892

[1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#security-location
[2]: https://lists.webkit.org/pipermail/webkit-dev/2010-August/013880.html
[2]: https://lists.webkit.org/pipermail/webkit-dev/2012-February/023636.html

* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertySlotDelegate):

LayoutTests:

* http/tests/plugins/resources/cross-frame-object-access.html:
* http/tests/security/cross-frame-access-callback-explicit-domain-DENY-expected.txt:
* http/tests/security/cross-frame-access-location-get-expected.txt:
* http/tests/security/cross-frame-access-location-get.html:
* http/tests/security/resources/cross-frame-access.js:
(accessThrowsException):
* http/tests/security/resources/cross-frame-iframe-callback-explicit-domain-DENY.html:
* http/tests/security/resources/cross-frame-iframe-for-location-get-test.html:
    Adjusting tests to check for exceptions, and adjusting expectations to match.
* platform/chromium/http/tests/security/cross-frame-access-callback-explicit-domain-DENY-expected.txt: Copied from LayoutTests/http/tests/security/cross-frame-access-callback-explicit-domain-DENY-expected.txt.
* platform/chromium/http/tests/security/cross-frame-access-location-get-expected.txt: Added.
* platform/chromium/http/tests/security/sandboxed-iframe-blocks-access-from-parent-expected.txt: Copied from LayoutTests/http/tests/security/sandboxed-iframe-blocks-access-from-parent-expected.txt.
    V8 fails at the moment: http://wkbug.com/43892


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
OpenCL implementation of Flood SVG filters.
https://bugs.webkit.org/show_bug.cgi?id=109580

Patch by Tamas Czene <tczene@inf.u-szeged.hu> on 2013-02-13
Reviewed by Zoltan Herczeg.

* Target.pri:
* platform/graphics/filters/FEFlood.h:
(FEFlood):
* platform/graphics/gpu/opencl/FilterContextOpenCL.cpp:
(WebCore):
(WebCore::PROGRAM_STR):
(WebCore::FilterContextOpenCL::compileFill):
(WebCore::FilterContextOpenCL::fill):
* platform/graphics/gpu/opencl/FilterContextOpenCL.h:
(WebCore::FilterContextOpenCL::FilterContextOpenCL):
(FilterContextOpenCL):
* platform/graphics/gpu/opencl/OpenCLFEFlood.cpp: Added.
(WebCore):
(WebCore::FEFlood::platformApplyOpenCL):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Remove web intents callbacks
https://bugs.webkit.org/show_bug.cgi?id=109654

Reviewed by Benjamin Poulain.

Web intents was removed by r142549.

Source/WebKit2:

* Shared/APIClientTraits.cpp:
(WebKit):
* Shared/APIClientTraits.h:
* UIProcess/API/C/WKPage.h:
* UIProcess/API/gtk/WebKitLoaderClient.cpp:
(attachLoaderClientToView):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/qt/QtBuiltinBundlePage.cpp:
(WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage):

Tools:

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r142730.
http://trac.webkit.org/changeset/142730
https://bugs.webkit.org/show_bug.cgi?id=109666

chromium browser tests are failing

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateNormalAttrGetter):
(GenerateNormalAttrSetter):
(GenerateSingleBatchedAttribute):
(GenerateImplementation):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(TestInterfaceV8Internal):
(WebCore):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Simplify SplitView to rely more on CSS
https://bugs.webkit.org/show_bug.cgi?id=109426

Patch by Vladislav Kaznacheev <kaznacheev@chromium.org> on 2013-02-13
Reviewed by Vsevolod Vlasov.

Simplified Javascript code by moving large part of the layout logic into CSS rules. The patch is larger than it
should be because one of the clients (TimelinePanel) is breaking SplitView incapsulation by reparenting its
resizer.

No new tests.

* inspector/front-end/SidebarView.js:
(WebInspector.SidebarView):
* inspector/front-end/SplitView.js:
(WebInspector.SplitView):
(WebInspector.SplitView.prototype._innerSetVertical):
(WebInspector.SplitView.prototype.setSecondIsSidebar):
(WebInspector.SplitView.prototype._showOnly):
(WebInspector.SplitView.prototype._removeAllLayoutProperties):
* inspector/front-end/TimelinePanel.js:
* inspector/front-end/cssNamedFlows.css:
(.css-named-flow-collections-view .split-view-sidebar):
(.css-named-flow-collections-view .split-view-sidebar .sidebar-content):
(.css-named-flow-collections-view .split-view-sidebar .selection):
(.css-named-flow-collections-view .split-view-sidebar .named-flow-overflow::before, .css-named-flow-collections-view .region-empty:before, .css-named-flow-collections-view .region-fit::before, .css-named-flow-collections-view .region-overset::before):
(.css-named-flow-collections-view .split-view-sidebar .named-flow-overflow::before):
* inspector/front-end/splitView.css:
(.split-view-contents.maximized):
(.split-view-vertical .split-view-contents):
(.split-view-vertical .split-view-contents-first):
(.split-view-vertical .split-view-contents-first.maximized):
(.split-view-vertical .split-view-contents-second):
(.split-view-vertical .split-view-contents-second.maximized):
(.split-view-horizontal .split-view-contents):
(.split-view-horizontal .split-view-contents-first):
(.split-view-horizontal .split-view-contents-first.maximized):
(.split-view-horizontal .split-view-contents-second):
(.split-view-horizontal .split-view-contents-second.maximized):
(.split-view-vertical .split-view-sidebar.split-view-contents-first:not(.maximized)):
(.split-view-vertical .split-view-sidebar.split-view-contents-second:not(.maximized)):
(.split-view-horizontal .split-view-sidebar.split-view-contents-first:not(.maximized)):
(.split-view-horizontal .split-view-sidebar.split-view-contents-second:not(.maximized)):
(.split-view-vertical .split-view-resizer):
(.split-view-horizontal .split-view-resizer):
* inspector/front-end/timelinePanel.css:
(.timeline.split-view-vertical .split-view-resizer):
(#timeline-container .split-view-sidebar):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement css-conditional's CSS.supports()
https://bugs.webkit.org/show_bug.cgi?id=100324

Patch by Pablo Flouret <pablof@motorola.com> on 2013-02-13
Reviewed by Antti Koivisto.

Source/WebCore:

http://dev.w3.org/csswg/css3-conditional/#the-css-interface

The supports() method provides the css @supports rule's corresponding
dom api.
The patch also adds the CSS interface on DOMWindow, which holds "useful
CSS-related functions that do not belong elsewhere". This is where
supports() lives.

Test: css3/supports-dom-api.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/gobject/GNUmakefile.am:
* bindings/scripts/CodeGeneratorGObject.pm:
(SkipFunction):
    Add DOMWindowCSS.* to the build systems.

* bindings/scripts/CodeGenerator.pm:
(WK_lcfirst):
    Handle CSS prefixes correctly (s/cSS/css/).

* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::CSSParser):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::detectAtToken):
* css/CSSParser.h:
    webkit_supports_condition parses just the condition part of an
    @supports rule and evaluates it, outputting whether the condition
    is supported or not.

* css/CSSAllInOne.cpp:
* css/DOMWindowCSS.cpp: Added.
* css/DOMWindowCSS.h: Added.
* css/DOMWindowCSS.idl: Added.
    The CSS interface object.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::css):
* page/DOMWindow.h:
* page/DOMWindow.idl:
    window.CSS

LayoutTests:

* css3/supports-dom-api-expected.txt: Added.
* css3/supports-dom-api.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wk2/TestExpectations:

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