Get rid of useless forward declaration.
https://bugs.webkit.org/show_bug.cgi?id=112449

Patch by Konrad Piascik <kpiascik@blackberry.com> on 2013-03-15
Reviewed by Stephen Chenney.

No behavioural change

* svg/SVGRectElement.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: [Texmap] REGRESSION (r144190): Failure at style with preserve-3d and opacity
https://bugs.webkit.org/show_bug.cgi?id=112370

According to spec, we avoid masking and clipping when preserves-3d is enabled.
However, opacity should still work.
Allowing opacity when preserves-3d is on.

Patch by No'am Rosenthal <noam@webkit.org> on 2013-03-15
Reviewed by Caio Marcelo de Oliveira Filho.

Test: compositing/overlap-blending/preserves3d-opacity.html

* platform/graphics/texmap/TextureMapperGL.cpp:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintRecursive):

LayoutTests: [Texmap] REGRESSION (r144190): Failure at style with webkit-transform and opacity
https://bugs.webkit.org/show_bug.cgi?id=112370

Patch by No'am Rosenthal <noam@webkit.org> on 2013-03-15
Reviewed by Caio Marcelo de Oliveira Filho.

New ref-test for opacity+preserves-3d.

* compositing/overlap-blending/preserves3d-opacity-expected.html: Added.
* compositing/overlap-blending/preserves3d-opacity.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] acceleration_backend_description does not concatenate "(gles2"
https://bugs.webkit.org/show_bug.cgi?id=112405

Patch by Jae Hyun Park <jae.park@company100.net> on 2013-03-15
Reviewed by Martin Robinson.

In FindDependencies.m4, acceleration_backend_description string does not
concatenate if there is a space between the operator and the operand.

* Source/autotools/FindDependencies.m4:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace static_casts with to* helper functions.
https://bugs.webkit.org/show_bug.cgi?id=112401

Reviewed by Stephen Chenney.

to* helper functions are preferred over static_cast calls since they
help to catch bad casts easily on the testing infrastructure.

Source/WebCore:

* accessibility/AccessibilityObject.cpp:
(WebCore::appendAccessibilityObject):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::visiblePositionForPoint):
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::webAreaObject):
(WebCore::AccessibilityScrollView::documentFrameView):
(WebCore::AccessibilityScrollView::parentObject):
(WebCore::AccessibilityScrollView::parentObjectIfExists):
* accessibility/chromium/AXObjectCacheChromium.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginScriptObjectFromPluginViewBase):
* bindings/js/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::createScriptInstanceForWidget):
* bindings/js/ScriptControllerQt.cpp:
(WebCore::ScriptController::createScriptInstanceForWidget):
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::createScriptInstanceForWidget):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::appendFormData):
* page/EventHandler.cpp:
(WebCore::EventHandler::subframeForTargetNode):
(WebCore::EventHandler::passGestureEventToWidget):
* page/Frame.cpp:
(WebCore::Frame::frameForWidget):
* page/FrameView.cpp:
(WebCore::collectFrameViewChildren):
(WebCore::FrameView::hasCustomScrollbars):
(WebCore::FrameView::convertToContainingView):
(WebCore::FrameView::convertFromContainingView):
(WebCore::FrameView::removeChild):
* page/FrameView.h:
(WebCore::toFrameView):
(WebCore):
* page/Page.cpp:
(WebCore::Page::collectPluginViews):
* page/chromium/EventHandlerChromium.cpp:
(WebCore::EventHandler::passWheelEventToWidget):
* page/efl/EventHandlerEfl.cpp:
(WebCore::EventHandler::passWheelEventToWidget):
* page/gtk/EventHandlerGtk.cpp:
(WebCore::EventHandler::passWheelEventToWidget):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::passWheelEventToWidget):
* page/qt/EventHandlerQt.cpp:
(WebCore::EventHandler::passWheelEventToWidget):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::passWheelEventToWidget):
* page/wx/EventHandlerWx.cpp:
(WebCore::EventHandler::passWheelEventToWidget):
* platform/ScrollView.h:
(WebCore::toScrollView):
(WebCore):
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::isScrollViewScrollbar):
(WebCore::Scrollbar::mouseUp):
(WebCore::Scrollbar::axObjectCache):
* platform/Widget.h:
(WebCore::Widget::isScrollView):
* platform/blackberry/PlatformScreenBlackBerry.cpp:
(WebCore::toUserSpace):
* platform/efl/ScrollbarEfl.cpp:
(ScrollbarEfl::setParent):
* platform/qt/PlatformSupportQt.cpp:
(WebCore::PlatformSupport::popupsAllowed):
(WebCore::PlatformSupport::pluginScriptableObject):
* plugins/IFrameShimSupport.cpp:
(WebCore::getPluginOcclusions):
* plugins/PluginView.h:
(WebCore::toPluginView):
(WebCore):
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::isPluginViewBase):
(PluginViewBase):
(WebCore::toPluginViewBase):
(WebCore):
* plugins/blackberry/PluginViewBlackBerry.cpp:
(WebCore::PluginView::updatePluginWidget):
(WebCore::PluginView::updateBuffer):
(WebCore::PluginView::paint):
(WebCore::PluginView::handleScrollEvent):
(WebCore::PluginView::calculateClipRect):
(WebCore::PluginView::handleFullScreenAllowedEvent):
(WebCore::PluginView::handleFullScreenExitEvent):
(WebCore::PluginView::setParent):
(WebCore::PluginView::setNPWindowIfNeeded):
(WebCore::PluginView::platformGetValue):
(WebCore::PluginView::platformStart):
(WebCore::PluginView::platformDestroy):
(WebCore::PluginView::setBackgroundPlay):
* plugins/blackberry/PluginViewPrivateBlackBerry.cpp:
(WebCore::PluginViewPrivate::setVisibleRects):
(WebCore::PluginViewPrivate::showKeyboard):
(WebCore::PluginViewPrivate::requestFullScreen):
(WebCore::PluginViewPrivate::requestCenterFitZoom):
(WebCore::PluginViewPrivate::lockOrientation):
(WebCore::PluginViewPrivate::unlockOrientation):
(WebCore::PluginViewPrivate::preventIdle):
* plugins/gtk/PluginViewGtk.cpp:
(WebCore::PluginView::updatePluginWidget):
* plugins/mac/PluginViewMac.mm:
(WebCore::PluginView::platformStart):
* plugins/qt/PluginViewQt.cpp:
(WebCore::PluginView::updatePluginWidget):
* plugins/win/PluginViewWin.cpp:
(WebCore::PluginView::updatePluginWidget):
(WebCore::PluginView::paintIntoTransformedContext):
(WebCore::PluginView::paintWindowedPluginIntoContext):
(WebCore::PluginView::paint):
(WebCore::PluginView::handleMouseEvent):
(WebCore::PluginView::setNPWindowRect):
(WebCore::PluginView::snapshot):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::addLayoutOverflow):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing):
(WebCore::RenderEmbeddedObject::viewCleared):
(WebCore::RenderEmbeddedObject::nodeAtPoint):
(WebCore::RenderEmbeddedObject::scroll):
* rendering/RenderFlexibleBox.h:
(WebCore::toRenderFlexibleBox):
(WebCore):
* rendering/RenderFrame.cpp:
(WebCore::RenderFrame::viewCleared):
* rendering/RenderFrameBase.cpp:
(WebCore::RenderFrameBase::layoutWithFlattening):
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::contentRootRenderer):
(WebCore::RenderIFrame::layoutSeamlessly):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame):
* rendering/RenderPart.cpp:
(WebCore::RenderPart::requiresAcceleratedCompositing):
(WebCore::RenderPart::embeddedContentBox):
(WebCore::RenderPart::nodeAtPoint):
* rendering/RenderRuby.cpp:
(WebCore::rubyBeforeBlock):
(WebCore::rubyAfterBlock):
(WebCore::lastRubyRun):
(WebCore::findRubyRunParent):
* rendering/RenderTreeAsText.cpp:
(WebCore::write):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paintContents):
(WebCore::RenderWidget::setOverlapTestResult):
(WebCore::RenderWidget::updateWidgetPosition):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::frameForNode):
(BlackBerry::WebKit::needsLayoutRecursive):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::redirectDataToPlugin):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::ensureFocusPluginElementVisible):

Source/WebKit/chromium:

* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::scrollRect):
(WebKit::WebPluginContainerImpl::setWantsWheelEvents):
(WebKit::WebPluginContainerImpl::handleMouseEvent):
* tests/ScrollingCoordinatorChromiumTest.cpp:
(WebKit::TEST_F):

Source/WebKit/efl:

* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::redirectDataToPlugin):

Source/WebKit/gtk:

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::redirectDataToPlugin):

Source/WebKit/mac:

* WebView/WebRenderNode.mm:
(copyRenderNode):
* WebView/WebView.mm:
(-[WebView _addScrollerDashboardRegionsForFrameView:dashboardRegions:]):

Source/WebKit/qt:

* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::redirectDataToPlugin):

Source/WebKit/win:

* WebCoreSupport/EmbeddedWidget.cpp:
(EmbeddedWidget::frameRectsChanged):
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::redirectDataToPlugin):

Source/WebKit/wince:

* WebCoreSupport/FrameLoaderClientWinCE.cpp:
(WebKit::FrameLoaderClientWinCE::redirectDataToPlugin):

Source/WebKit/wx:

* WebKitSupport/FrameLoaderClientWx.cpp:
(WebCore::FrameLoaderClientWx::redirectDataToPlugin):

Source/WebKit2:

* Shared/WebRenderObject.cpp:
(WebKit::WebRenderObject::WebRenderObject):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Hide MainResourceLoader from the outside world
https://bugs.webkit.org/show_bug.cgi?id=109971

Reviewed by Adam Barth.

Source/WebCore:

No new tests, refactor only.

* WebCore.exp.in:
* dom/Document.cpp:
* html/HTMLEmbedElement.cpp:
* html/MediaDocument.cpp:
* html/PluginDocument.cpp:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::mainResourceLoader):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::receivedData):
(WebCore::DocumentLoader::setMainResourceDataBufferingPolicy):
* loader/DocumentLoader.h:
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
* loader/FrameLoaderClient.h:
* loader/MainResourceLoader.cpp:
* loader/appcache/ApplicationCacheGroup.cpp:
* loader/appcache/ApplicationCacheHost.cpp:

Source/WebKit/blackberry:

* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::convertMainResourceLoadToDownload):
* WebCoreSupport/FrameLoaderClientBlackBerry.h:
(FrameLoaderClientBlackBerry):

Source/WebKit/chromium:

* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::convertMainResourceLoadToDownload):
* src/FrameLoaderClientImpl.h:
(FrameLoaderClientImpl):

Source/WebKit/efl:

* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::convertMainResourceLoadToDownload):
* WebCoreSupport/FrameLoaderClientEfl.h:
(FrameLoaderClientEfl):

Source/WebKit/gtk:

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::convertMainResourceLoadToDownload):
* WebCoreSupport/FrameLoaderClientGtk.h:
(FrameLoaderClient):

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient):
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::convertMainResourceLoadToDownload):

Source/WebKit/qt:

* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::convertMainResourceLoadToDownload):
* WebCoreSupport/FrameLoaderClientQt.h:
(FrameLoaderClientQt):

Source/WebKit/win:

* WebFrame.cpp:
(WebFrame::convertMainResourceLoadToDownload):
* WebFrame.h:

Source/WebKit/wince:

* WebCoreSupport/FrameLoaderClientWinCE.cpp:
(WebKit::FrameLoaderClientWinCE::convertMainResourceLoadToDownload):
* WebCoreSupport/FrameLoaderClientWinCE.h:
(FrameLoaderClientWinCE):

Source/WebKit/wx:

* WebKitSupport/FrameLoaderClientWx.cpp:
(WebCore::FrameLoaderClientWx::convertMainResourceLoadToDownload):
* WebKitSupport/FrameLoaderClientWx.h:
(FrameLoaderClientWx):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::convertMainResourceLoadToDownload):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::convertMainResourceLoadToDownload):
* WebProcess/WebPage/WebFrame.h:
(WebFrame):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: -webkit-box-reflect does not show on video elements
https://bugs.webkit.org/show_bug.cgi?id=112397

Reviewed by Simon Fraser.

Source/WebCore:

Test: compositing/video/video-reflection.html

Support cloning specific CALayer subtypes in PlatformCALayer,
which allows reflections to work correctly for those layer types.
Specifically, add support for cloning AVPlayerLayer layers.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::cloneLayer): Moved most of the
    implementation to PlatformCALayer::clone().
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayer::PlatformCALayer): Set the layerType to
    LayerTypeAVPlayerLayer if the PlatformLayer parameter is an
    AVPlayerLayer.
(PlatformCALayer::clone): Moved from GraphicsLayerCA::cloneLayer().
    Copy the player value to the new layer, if the current layer is
    a LayerTypeAVPlayerLayer.
(PlatformCALayer::playerLayer):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayer::clone): Moved from GraphicsLayerCA::cloneLayer().
    May want to add support for AVCFPlayerLayers in the future.

LayoutTests:

* compositing/video/video-reflection-expected.png: Added.
* compositing/video/video-reflection-expected.txt: Added.
* compositing/video/video-reflection.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Collect samples for unresponsive web processes
https://bugs.webkit.org/show_bug.cgi?id=112409

Tools:

Reviewed by Tim Horton.

When we detect that a subprocess was unresponsive, run the 'sample'
tool on that process, for the Mac port.

The sample will be linked to from the results.html page, next
to the crash log link.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._look_for_new_crash_logs): Before looking for crash logs,
look for samples on disk.
* Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:
(TestResultWriter):
(TestResultWriter.copy_sample_file): Teach TestResultWriter about
-sample.txt files, and have it copy their contents to a new file
next to the test that spawned them (as we do for crash logs).
* Scripts/webkitpy/layout_tests/port/base.py:
(Port.look_for_new_samples): Base class does nothing for sampling.
* Scripts/webkitpy/layout_tests/port/driver.py:
(Driver._check_for_driver_crash): Kick off a sample if we detected
that the subprocess was unresponsive.
* Scripts/webkitpy/layout_tests/port/mac.py:
(MacPort.sample_file_path): Utility to generate the file path
to the generated sample files at the top level of layout-test-results.
(MacPort.look_for_new_crash_logs): Fix typo
(MacPort.look_for_new_samples): New function to find sample files.
(MacPort.sample_process): Use the utility function to get the file path.

LayoutTests:

Reviewed by Tim Horton.

Add links for samples, which some platforms will show for unresponsive WebProcess timeouts.

* fast/harness/results.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Handle success events arriving after context stopped
https://bugs.webkit.org/show_bug.cgi?id=112451

Reviewed by Tony Chang.

Source/WebCore:

In multiprocess ports, events from the back-end can arrive in the form of
onXXX() calls after the script execution context has stopped. These need to
be ignored. This was already done in most cases, but missing for two overloads
of IDBRequest::onSuccess() - void and int64_t.

Test: webkit_unit_test IDBRequestTest.EventsAfterStopping

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::onSuccess): Early return if context has stopped.
(WebCore::IDBRequest::onSuccessInternal): ASSERT() that callers have checked context.

Source/WebKit/chromium:

* tests/IDBRequestTest.cpp:
(WebKit::TEST_F): Add cases for onSuccess() and onSuccess(int64_t)


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix. Rename local variable which was colliding with class method.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayer::clone):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[JSC] Remove custom WebAudio mark functions that we can generate instead.
<http://webkit.org/b/110976>

Reviewed by Eric Carlson.

Remove custom JSC mark functions for AudioContext and ScriptProcessorNode since they
are trivial to generate.

* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/ScriptProcessorNode.idl:
* GNUmakefile.list.am:
* UseJSC.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSAudioContextCustom.cpp:
* bindings/js/JSScriptProcessorNodeCustom.cpp: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled Chromium DEPS to r188418.  Requested by
"Adam Barth" <abarth@webkit.org> via sheriffbot.

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

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r127277): CSS URIs with multi-byte Unicode escape sequences fail to parse
https://bugs.webkit.org/show_bug.cgi?id=112436

Reviewed by Michael Saboff.

Source/WebCore:

r127277 modified the CSS parser to use 8-bit strings when possible.
However, it failed to handle URIs that contain Unicode escape sequences
that expand to multi-byte characters. Not only would the URI fail to
parse, but so would the remainder of the input string.

Fix this by producing a 16-bit result when we detect a URI with a
multi-byte Unicode escape, like we do for identifiers and other strings.

Test: fast/css/url-with-multi-byte-unicode-escape.html

* css/CSSParser.cpp:
(WebCore::checkAndSkipString): Changed to be a free function since it
doesn't access CSSParser's internal state.
(WebCore::CSSParser::findURI): Added a function that consolidates the
logic of finding the start and end pointers of the URI and the quote
character (if encountered), starting at the current character.
(WebCore::CSSParser::parseURIInternal): Removed duplicated logic for
finding the URI bounds (this now lives in findURI()) and logic for
setting the token type and updating the current character (this now
lives in parseURI()).
(WebCore::CSSParser::parseURI): Find the URI and parse it. If a
multi-byte Unicode escape is encountered, rewind to the beginning of
the URI and re-parse with a 16-bit string as the destination.
* css/CSSParser.h:

LayoutTests:

* fast/css/url-with-multi-byte-unicode-escape-expected.txt: Added.
* fast/css/url-with-multi-byte-unicode-escape.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the stupid unit tests.

* Scripts/webkitpy/layout_tests/port/mac_unittest.py:
(test_sample_process):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Network] Refine JSDocs in NetworkRequest.js
https://bugs.webkit.org/show_bug.cgi?id=112412

Reviewed by Vsevolod Vlasov.

Return types for some members are confusing (Object).

* inspector/front-end/NetworkManager.js: Fixed JSDocs.
* inspector/front-end/NetworkRequest.js: Ditto. Plus minor refactorings.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Marking sputnik/Conformance/10_Execution_Contexts/10.1_Definitions/10.1.8_Arguments_Object/S10.1.8_A3_T2.html
as a Slow test.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Binding: Implement EnforceRange IDL Attribute for long long conversions
https://bugs.webkit.org/show_bug.cgi?id=96798

Reviewed by Kentaro Hara.

Source/WebCore:

Implement [EnforceRange] attribute for V8 bindings, which specifies throwing behavior
on conversions outside int/uint 32/64 ranges and edge cases like NaNs and Infinities.
Conversely, conversions without this attribute should *not* throw.

Tests: fast/js/webidl-type-mapping.html:
       fast/dom/non-numeric-values-numeric-parameters.html
       fast/js/script-tests/select-options-add.html
       storage/indexeddb/intversion-bad-parameters.html

* Modules/indexeddb/IDBCursor.cpp: Remove custom range enforcement for advance()
* Modules/indexeddb/IDBCursor.h: Adjust type to match WebIDL.
* Modules/indexeddb/IDBCursor.idl: Specify [EnforceRange] and type matches spec WebIDL.
* Modules/indexeddb/IDBFactory.cpp: Remove custom range enforcement for open()
* Modules/indexeddb/IDBFactory.h: Adjust type to match WebIDL.
* Modules/indexeddb/IDBFactory.idl: Specify [EnforceRange] and type matches spec WebIDL.
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative): Add FIXME to support [EnforceRange]
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateNormalAttrSetter): Handle [EnforceRange] in attribute setters
(GenerateParametersCheck): Handle [EnforceRange] in parameters.
(JSValueToNative): Pass EnforceRange to toInt() functions as appropriate.
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/TestObj.idl: Tests w/ [EnforceRange]
* bindings/scripts/test/V8/V8TestObj.cpp: Updated expectations
* bindings/scripts/test/V8/V8TestTypedefs.cpp: Updated expectations.
* bindings/v8/V8Binding.cpp: Overloads for toInt() variants that handle constraints.
(WebCore::toInt32):
(WebCore::toUInt32):
(WebCore::toInt64):
(WebCore::toUInt64):
* bindings/v8/V8Binding.h: Ditto, plus helpers for callers not expecting errors.
(WebCore::toInt32):
(WebCore::toUInt32):
(WebCore::toInt64):
(WebCore::toUInt64):
* bindings/v8/V8BindingMacros.h: Helper macros for type conversions that may throw.
* testing/TypeConversions.h: Added new members with EnforceRange constraint.
* testing/TypeConversions.idl: Ditto.

LayoutTests:

Some of the tests for HTMLOptionsCollection.add() assumed it should throw for
Infinities and NaNs, but this is not what the DOM+WebIDL specs say. (Firefox doesn't throw
so this does not appear to be a web-compat issue.) This updates the tests/expectations so
that V8 passes. JSC expectations are FAIL in a few places since it still incorrectly throws
on Infinity/NaN -> int32 conversion (existing tests) and does not implement EnforceRange
(new tests).

Tne non-numeric-values-numeric-parameters test was also broken for NaN testing, reporting
incorrect results which hid some of this behavior.

* fast/dom/non-numeric-values-numeric-parameters-expected.txt: Failing behavior for JSC.
* fast/dom/script-tests/non-numeric-values-numeric-parameters.js: HTMLOptionsCollection.add()
should not throw on NaNs/Infinities.
* fast/js/script-tests/select-options-add.js: Ditto.
* fast/js/select-options-add-expected.txt: Failing behavior for JSC.
* fast/js/webidl-type-mapping-expected.txt: Ditto.
* fast/js/webidl-type-mapping.html: Added test cases for [EnforceRange]
* platform/chromium/fast/dom/non-numeric-values-numeric-parameters-expected.txt: Added - passing behavior for V8.
* platform/chromium/fast/js/select-options-add-expected.txt: Ditto.
* platform/chromium/fast/js/webidl-type-mapping-expected.txt: Added.
* storage/indexeddb/intversion-bad-parameters-expected.txt: Added non-finite test cases.
* storage/indexeddb/resources/intversion-bad-parameters.js: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Minor cleanup in worker code
        https://bugs.webkit.org/show_bug.cgi?id=112455

        Reviewed by Anders Carlsson.

        - Added OVERRIDE keywords.
        - Toned down FIXMEs about single MessagePort versions of functions. It's not a given
        that we'll want to get rid of them even when implementing array versions.
        - Explicitly marked virtual destructors as virtual.

        * dom/MessageEvent.cpp:
        * dom/MessageEvent.h:
        * workers/Worker.cpp:
        * workers/Worker.h:
        Removed an unused version of postMessage() that took no MessagePorts. This makes
        it less confusing why MessagePortArray is passed by pointer, and not by reference.

        * workers/DedicatedWorkerContext.cpp:
        (WebCore::DedicatedWorkerContext::~DedicatedWorkerContext):
        * workers/DedicatedWorkerContext.h:
        Added a destructor instead of an implicit one.
        Removed an unused version of postMessage() that took no MessagePorts.

        * workers/SharedWorker.h: Removed an unused virtual function (thank you OVERRIDE!)

        * dom/MessagePort.cpp:
        * dom/MessagePort.h:
        * loader/WorkerThreadableLoader.h:
        * page/DOMWindow.h:
        * workers/AbstractWorker.h:
        * workers/DedicatedWorkerThread.h:
        * workers/SharedWorkerContext.h:
        * workers/SharedWorkerThread.h:
        * workers/WorkerContext.h:
        * workers/WorkerMessagingProxy.h:
        * workers/WorkerObjectProxy.h:
        * workers/WorkerScriptLoader.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add runtime check for improper register allocations in DFG
https://bugs.webkit.org/show_bug.cgi?id=112380

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

Added framework to check for register allocation within a branch source - target range.  All register allocations
are saved using the offset in the code stream where the allocation occurred.  Later when a jump is linked, the
currently saved register allocations are checked to make sure that they didn't occur in the range of code that was
jumped over.  This protects against the case where an allocation could have spilled register contents to free up 
a register and that spill only occurs on one path of a many through the code.  A subsequent fill of the spilled
register may load garbage.  See https://bugs.webkit.org/show_bug.cgi?id=111777 for one such bug.
This code is protected by the compile time check of #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION).
The check is only done during the processing of SpeculativeJIT::compile(Node* node) and its callees.
 
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::Jump::link): Invoke register allocation checks using source and target of link.
(JSC::AbstractMacroAssembler::Jump::linkTo): Invoke register allocation checks using source and target of link.
(AbstractMacroAssembler):
(RegisterAllocationOffset): New helper class to store the instruction stream offset and compare against a 
jump range.
(JSC::AbstractMacroAssembler::RegisterAllocationOffset::RegisterAllocationOffset):
(JSC::AbstractMacroAssembler::RegisterAllocationOffset::check):
(JSC::AbstractMacroAssembler::addRegisterAllocationAtOffset):
(JSC::AbstractMacroAssembler::clearRegisterAllocationOffsets): 
(JSC::AbstractMacroAssembler::checkRegisterAllocationAgainstBranchRange):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::allocate):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

Source/WTF: 

* wtf/Platform.h: Added new ENABLE_DFG_REGISTER_ALLOCATION_VALIDATION compilation flag to
enable generation of register allocation checking.  This is on for debug builds.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145931 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Custom Elements] Any HTMLElement subclass should become a superclass of custom element
https://bugs.webkit.org/show_bug.cgi?id=110436

Reviewed by Dimitri Glazkov.

Source/WebCore:

This change introduces "type extension" concept of custom elements.
With the type extension, each custom elements are able to inherit
from not only HTMLElement, but also any HTML element. To make it work,
this change extends the plumbing.

This change does following changes:

= Data structure:

- Let CustomElementConstructor objects being keyed by pair of (element
  name, local name) as the standard requries, instead of just using
  single name. See CustomElementRegistry::ConstructorMap and CustomElementRegistry::find().

- Creates mapping from WrapperTypeInfo to element name.  This map
  can be looked-up by generated functions like
  findHTMLTagNameOfV8Type().  With this table, WebKit can determine
  the custom element local name of given prototype object. See  make_names.pl.
  Note that V8 prototype object knows associated WrapperTypeInfo. See r144865.

= Hooking up element lifecyle:

- Create appropriate C++ instance for each custom element.  Before
  this change, the C++ backend of custom elements were always
  HTMLUnknownElements or HTMLElement.  See
  CustomElementConstructor::createElement() and ElementFactories in
  make_names.pl.

- Hooks up element construction and element wrapper creation for
  custom element "before" non-custom case instead of "after"
  that. We do this because custom element needs to
  override non-custom case when @is attribute is given for
  otherwise-non-custom elements like <div is=x-bar>.
  See make_names.pl.

- Gives @is attributes to elements if needed. See setTypeExtension() call sites
  like Document::createElement(), Document::createElementtNS() and CustomElementConstructor::createElementt()

Test: fast/dom/custom/document-register-type-extensions.html

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):
* bindings/scripts/test/V8/V8Float64Array.h:
* bindings/scripts/test/V8/V8TestActiveDOMObject.h:
* bindings/scripts/test/V8/V8TestCustomNamedGetter.h:
* bindings/scripts/test/V8/V8TestEventConstructor.h:
* bindings/scripts/test/V8/V8TestEventTarget.h:
* bindings/scripts/test/V8/V8TestException.h:
* bindings/scripts/test/V8/V8TestInterface.h:
* bindings/scripts/test/V8/V8TestMediaQueryListListener.h:
* bindings/scripts/test/V8/V8TestNamedConstructor.h:
* bindings/scripts/test/V8/V8TestNode.h:
* bindings/scripts/test/V8/V8TestObj.h:
* bindings/scripts/test/V8/V8TestOverloadedConstructors.h:
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:
* bindings/scripts/test/V8/V8TestTypedefs.h:
* bindings/v8/CustomElementHelpers.cpp:
(WebCore::hasValidPrototypeChain):
(WebCore::CustomElementHelpers::isValidPrototypeParameter):
(WebCore::CustomElementHelpers::findLocalName):
(WebCore):
(WebCore::CustomElementHelpers::findWrapperType):
* bindings/v8/CustomElementHelpers.h:
(CustomElementHelpers):
* bindings/v8/V8CustomElement.cpp:
(WebCore::V8CustomElement::createWrapper):
* bindings/v8/V8CustomElement.h:
(V8CustomElement):
(WebCore::V8CustomElement::wrap):
(WebCore::V8CustomElement::constructorOf):
* bindings/v8/WrapperTypeInfo.h:
(WrapperTypeTraits): Added.
* bindings/v8/custom/V8CustomElementConstructorCustom.cpp:
(WebCore::V8CustomElementConstructor::callAsFunctionCallback):
* dom/CustomElementConstructor.cpp:
(WebCore::CustomElementConstructor::create):
(WebCore::CustomElementConstructor::CustomElementConstructor):
(WebCore::CustomElementConstructor::createElement):
(WebCore::setTypeExtension):
* dom/CustomElementConstructor.h:
(CustomElementConstructor):
(WebCore::CustomElementConstructor::document):
(WebCore::CustomElementConstructor::typeName):
(WebCore::CustomElementConstructor::localName):
* dom/CustomElementRegistry.cpp:
(WebCore::nameIncludesHyphen):
(WebCore::CustomElementRegistry::isValidName):
(WebCore::CustomElementRegistry::registerElement):
(WebCore::CustomElementRegistry::findFor):
(WebCore::CustomElementRegistry::find):
(WebCore::CustomElementRegistry::createElement):
* dom/CustomElementRegistry.h:
(CustomElementRegistry):
* dom/Document.cpp:
(WebCore::Document::createElement):
(WebCore::Document::createElementNS):
(WebCore::Document::registerElement):
* dom/Document.h:
(Document):
(WebCore::Document::registry): Moved from Document.cpp to be inlined.
* dom/Document.idl:
* dom/make_names.pl:
(printFactoryCppFile):
(printWrapperFactoryCppFile):
(printWrapperFactoryHeaderFile):
* html/HTMLAttributeNames.in: Added @is attribute

LayoutTests:

* fast/dom/custom/document-register-basic-expected.txt:
* fast/dom/custom/document-register-basic.html:
* fast/dom/custom/document-register-type-extensions-expected.txt: Added.
* fast/dom/custom/document-register-type-extensions.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cleanup of DFG and Baseline JIT debugging code
https://bugs.webkit.org/show_bug.cgi?id=111871

Reviewed by Geoffrey Garen.

Fixed various debug related issue in baseline and DFG JITs. See below.

* dfg/DFGRepatch.cpp:
(JSC::DFG::dfgLinkClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
* dfg/DFGScratchRegisterAllocator.h: Now use ScratchBuffer::activeLengthPtr() to get
pointer to scratch register length.
(JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
(JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::checkConsistency): Added missing case labels for DataFormatOSRMarker,
DataFormatDead, and DataFormatArguments and made them RELEASE_ASSERT_NOT_REACHED();
* jit/JITCall.cpp:
(JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
* jit/JITCall32_64.cpp:
(JSC::JIT::privateCompileClosureCall): Used pointerDump() to handle when calleeCodeBlock is NULL.
* runtime/JSGlobalData.h:
(JSC::ScratchBuffer::ScratchBuffer): Fixed buffer allocation alignment to
be on a double boundary.
(JSC::ScratchBuffer::setActiveLength):
(JSC::ScratchBuffer::activeLength):
(JSC::ScratchBuffer::activeLengthPtr):


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