[V8] Implement V8Proxy::registerExtensionIfNeeded() and remove redundant methods
https://bugs.webkit.org/show_bug.cgi?id=93209

Reviewed by Adam Barth.

By implementing V8Proxy::registerExtensionIfNeeded(), we can remove
registeredExtensionWithV8() and registerExtension().

No tests. No change in behavior.

Source/WebCore:

* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::createNewContext):
* bindings/v8/V8Proxy.cpp:
(WebCore::V8Proxy::registerExtensionIfNeeded):
* bindings/v8/V8Proxy.h:
(V8Proxy):

Source/WebKit/chromium:

* src/WebScriptController.cpp:
(WebKit::WebScriptController::registerExtension):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Create a MediaSource object.
https://bugs.webkit.org/show_bug.cgi?id=91773

Reviewed by Eric Carlson.

MediaSource object is needed in order to implement the new
object-oriented MediaSource API:
http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html

No new tests - will be able to test after landing:
https://bugs.webkit.org/show_bug.cgi?id=91775

Adding new files to build files:
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:

New MediaSource object:
* Modules/mediasource/MediaSource.cpp: Added.
* Modules/mediasource/MediaSource.h: Added.
* Modules/mediasource/MediaSource.idl: Added.

Create a registry for the blob storage and lookup:
* Modules/mediasource/MediaSourceRegistry.cpp: Added.
* Modules/mediasource/MediaSourceRegistry.h: Added.

Connect SourceBuffer to MediaSource:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer):
(WebCore::SourceBuffer::buffered): Forward call to MediaSource.
(WebCore::SourceBuffer::append): Ditto.
(WebCore::SourceBuffer::abort): Ditto.
* Modules/mediasource/SourceBuffer.h:
(WebCore::SourceBuffer::create): Add a MediaSource to the constructor.
(WebCore::SourceBuffer::clear): Clear the MediaSource.
(SourceBuffer):
* Modules/mediasource/SourceBufferList.cpp: include SourceBuffer.h
* Modules/mediasource/SourceBufferList.h:

Make MediaSource an EventTarget:
* dom/EventTarget.h:
(WebCore):
* dom/EventTargetFactory.in:

Enable creation of MediaSource object URL from JavaScript:
* html/DOMURL.cpp:
(WebCore):
(WebCore::DOMURL::createObjectURL):
(WebCore::DOMURL::revokeObjectURL):
* html/DOMURL.h:
(WebCore):
(DOMURL):
* html/DOMURL.idl:
* html/PublicURLManager.h: create a new sourceURLs list for storing
    reigstered MediaSource URLS.
(WebCore::PublicURLManager::contextDestroyed): make sure everything is
    removed from the sourceURLs list upon destruction.
(PublicURLManager):
(WebCore::PublicURLManager::sourceURLs): getter for the sourceURLs list.

New MediaSource constructor:
* page/DOMWindow.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow plugins to decide whether they are keyboard focusable
https://bugs.webkit.org/show_bug.cgi?id=88958

Reviewed by Anders Carlsson.

Source/WebCore:

* dom/Node.h:
(WebCore::Node::isPluginElement):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::renderWidgetForJSBindings):
* html/HTMLEmbedElement.h:
(HTMLEmbedElement):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::renderWidgetForJSBindings):
* html/HTMLObjectElement.h:
(HTMLObjectElement):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::pluginWidget):
(WebCore::HTMLPlugInElement::isKeyboardFocusable):
(WebCore):
(WebCore::HTMLPlugInElement::isPluginElement):
* html/HTMLPlugInElement.h:
(HTMLPlugInElement):
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusInDocumentOrder):
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::supportsKeyboardFocus):

Source/WebKit/chromium:

* public/WebPlugin.h:
(WebKit::WebPlugin::supportsKeyboardFocus):
* src/WebInputEventConversion.cpp:
(WebKit::WebKeyboardEventBuilder::WebKeyboardEventBuilder):
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::supportsKeyboardFocus):
(WebKit):
* src/WebPluginContainerImpl.h:
(WebPluginContainerImpl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Replace throwError(ExceptionCode, Isolate*) with
setDOMException(ExceptionCode, Isolate*) in CodeGeneratorV8.pm
https://bugs.webkit.org/show_bug.cgi?id=93223

Reviewed by Adam Barth.

Now throwError(ExceptionCode, Isolate*) is equivalent to
setDOMException(ExceptionCode, Isolate*). We can replace the former
with the latter. After this replacement, the rule becomes simple
and sane: "Use throwError() for throwing JavaScript errors, use
setDOMException() for throwing DOM exceptions".

Test: bindings/scripts/test/TestObj.idl

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateParametersCheck):
(GenerateConstructorCallback):
(GenerateNamedConstructorCallback):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore::V8TestInterface::constructorCallback):
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
(WebCore::V8TestNamedConstructorConstructorCallback):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::methodWithCallbackArgCallback):
(WebCore::TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgCallback):
(WebCore::TestObjV8Internal::methodWithCallbackAndOptionalArgCallback):
(WebCore::TestObjV8Internal::overloadedMethod5Callback):
(WebCore::V8TestObj::constructorCallback):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nrwt: --no-build isn't working
https://bugs.webkit.org/show_bug.cgi?id=93415

Reviewed by Ryosuke Niwa.

Turns out our optimization to avoid calling
webkit-build-directory N times for each worker broke --no-build.

Fixing, and adding a test.

Also, the gtk port wasn't using the default check_build() logic,
but I don't know why not. Removing their custom hook and will
verify that this is okay in the review ...

* Scripts/webkitpy/layout_tests/port/base.py:
(Port.__init__):
(Port.check_build):
(Port._build_path):
* Scripts/webkitpy/layout_tests/port/gtk.py:
(GtkPort._path_to_image_diff):
* Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py:
(MockDRTPortTest.test_check_build):
* Scripts/webkitpy/layout_tests/port/port_testcase.py:
(test_path_to_apache_config_file):
(test_check_build):
(test_check_build.build_driver_called):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nrwt: handle errors from image diff better
https://bugs.webkit.org/show_bug.cgi?id=92934

Reviewed by Ojan Vafai.

Re-land the change in r124801 with a fix ... in the case where
the ImageDiff is passed a tolerance and passes the fuzzy check,
we were returning the wrong value (missing an empty error
string) and crashing; this patch fixes that and adds a test for
that case (TestImageDiffer.test_image_diff_passed).

* Scripts/webkitpy/layout_tests/controllers/single_test_runner.py:
(SingleTestRunner._compare_image):
(SingleTestRunner._compare_output_with_reference):
* Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:
(write_test_result):
* Scripts/webkitpy/layout_tests/controllers/test_result_writer_unittest.py:
(TestResultWriterTest.test_reftest_diff_image.ImageDiffTestPort.diff_image):
(TestResultWriterTest):
* Scripts/webkitpy/layout_tests/port/base.py:
(Port.diff_image):
* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumPort.diff_image):
* Scripts/webkitpy/layout_tests/port/chromium_port_testcase.py:
(ChromiumPortTestCase.test_diff_image_crashed):
* Scripts/webkitpy/layout_tests/port/image_diff.py:
(ImageDiffer.diff_image):
(ImageDiffer._read):
* Scripts/webkitpy/layout_tests/port/image_diff_unittest.py:
(TestImageDiffer.test_diff_image):
* Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py:
(MockDRTPortTest.test_diff_image_crashed):
* Scripts/webkitpy/layout_tests/port/port_testcase.py:
(PortTestCase.test_diff_image):
(PortTestCase.test_diff_image_crashed):
(PortTestCase.test_diff_image_crashed.make_proc):
* Scripts/webkitpy/layout_tests/port/server_process_mock.py:
(MockServerProcess.__init__):
* Scripts/webkitpy/layout_tests/port/test.py:
(TestPort.diff_image):
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(MainTest.test_tolerance.ImageDiffTestPort.diff_image):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
translateZ(0) shifts file name in file input
https://bugs.webkit.org/show_bug.cgi?id=69248

Reviewed by Simon Fraser.

Source/WebCore:

This patch changes to use relative y-coordinate rather than absolute
y-coordinate for baseline of text of input type "file" what we've already
done for file icon y-coordinate.

Test: file-appearance-transform-no-effects.html

* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject): Changed to use paintOffset
instead of absoluteBoundingBoxRectIgnoringTransforms().

LayoutTests:

This patch introduces a new test for input type "file" with CSS transform
translate(0).

* fast/forms/file/file-appearance-transform-no-effects-expected.html: Added. "-webkit-transform: translate(0)" should not have visual effects.
* fast/forms/file/file-appearance-transform-no-effects.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Move setIsolatedWorldSecurityOrigin() from V8Proxy to ScriptController
https://bugs.webkit.org/show_bug.cgi?id=93334

Reviewed by Adam Barth.

The goal is to move factor out V8Proxy methods to ScriptController.
As a starting point, this patch moves setIsolatedWorldSecurityOrigin().

isolatedWorlds() and isolatedWorldSecurityOrigins() are temporary methods.
They will be soon removed after moving all related methods
and m_isolatedWorlds and m_isolatedWorldSecurityOrigins.

No tests. No change in behavior.

* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::setIsolatedWorldSecurityOrigin):
* bindings/v8/V8Proxy.cpp:
* bindings/v8/V8Proxy.h:
(WebCore):
(V8Proxy):
(WebCore::V8Proxy::isolatedWorlds):
(WebCore::V8Proxy::isolatedWorldSecurityOrigins):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix for Mac port after http://trac.webkit.org/changeset/124954

* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::isKeyboardFocusable):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fix chromium win build after r124945
https://bugs.webkit.org/show_bug.cgi?id=93421

Unreviewed, build fix.

Two Efl files were removed in r124945 but we forgot to remove
them from WebCore.gypi.

* WebCore.gypi:

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