[Qt] REGRESSION(r125428): fast/profiler/nested-start-and-stop-profiler.html fails
https://bugs.webkit.org/show_bug.cgi?id=93897

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Before r125428 run-time methods (wrapped signals, slots or invokable functions) were subclasses of
JSInternalFunction and therefore real function objects in the JavaScript sense. r125428 changed them
to be just callable objects, but they did not have Function.prototype as prototype anymore for example
nor was their name correct (resulting in a layout test failure).

This patch changes run-time methods back to being real function objects that have a correct name and
have Function.prototype in their prototype change

The objects returned by JSObjectMakeFunctionWithCallbackInjected are light-weight internal function objects
that do not support JSObject{Set/Get}Private. Therefore we inject our own prototype right before the
Function.prototype prototype, which uses private data to store a pointer to our C++ QtRuntimeMethod object.
This complicates the retrieval of the pointer to that instance slightly, which is why this patch introduces
the toRuntimeMethod convenience function that looks up our prototype first and does a check for type-safety.

At the same time the patch removes the length properties from the run-time method itself as well as connect/disconnect.
The length property on a function signifies the number of arguments, but in all three cases that number is
actually variable, because of overloading. That is why we choose not to expose it in the first place.

* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::prototypeForSignalsAndSlots):
(JSC::Bindings::QtRuntimeMethod::call):
(JSC::Bindings::QtRuntimeMethod::jsObjectRef):
(JSC::Bindings::QtRuntimeMethod::toRuntimeMethod):
(Bindings):
(JSC::Bindings::QtRuntimeMethod::connectOrDisconnect):
* bridge/qt/qt_runtime.h:
(QtRuntimeMethod): Remove unused member variables.

Source/WebKit/qt:

Fixed some test expectations.

* tests/qobjectbridge/tst_qobjectbridge.cpp:
(tst_QObjectBridge::objectDeleted): Since runtime methods are real function objects again, we
can go back to testing Function.prototype.call, as it was done before r125428.
(tst_QObjectBridge::introspectQtMethods_data): Removed tests for the length property.
(tst_QObjectBridge::introspectQtMethods): Changed test expectation of the properties of
run-time methods back to being non-configurable, as before r125428.

LayoutTests:

* platform/qt/Skipped: Unskip test that is now passing.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2: Unreviewed build fix for newer Qt 5: QT += qmltest does not imply QT += testlib anymore, but
the code here needs QSignalSpy from QTestLib

* UIProcess/API/qt/tests/qmltests/DesktopBehavior.pro:
* UIProcess/API/qt/tests/qmltests/WebView.pro:

Tools: Unreviewed build fix for newer Qt 5: The meaning of private_includes changed to be fully
self-contained. The module name is not appended automatically anymore.

* qmake/qt_webkit.pri:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled DEPS.

* DEPS:

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

Reviewed Csaba Osztrogonác.

Patch by János Badics <jbadics@inf.u-szeged.hu> on 2012-08-21

* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Move String related code in V8Binding to a separate file
https://bugs.webkit.org/show_bug.cgi?id=94571

Reviewed by Adam Barth.

This patch moves V8Parameter, V8ParameterBase and String related code
in V8Binding to a separate file.

No tests. No change in behavior.

* UseV8.cmake:
* WebCore.gypi:
* bindings/v8/V8Binding.cpp:
* bindings/v8/V8Binding.h:
* bindings/v8/V8StringResource.cpp: Added.
* bindings/v8/V8StringResource.h: Added.
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix range-hit-test-with-padding.html by removing unnecessary part.

Unreviewed.

* fast/forms/range/range-hit-test-with-padding.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add destroy notify for register_uri_scheme
https://bugs.webkit.org/show_bug.cgi?id=94315

Reviewed by Philippe Normand.

For introspection to work correctly, a destroy notify needs to be
added to register_uri_scheme so that bindings know when to
finalize the user_data.

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_register_uri_scheme):
(webkitWebContextReceivedURIRequest):
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for COMPILER(MSVC) && !CPU(X86) after r126023.

* wtf/MathExtras.h:
(lrint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: NMI: rename addMember for strings and KURL to addInstrumentedMember.
https://bugs.webkit.org/show_bug.cgi?id=94580

Reviewed by Yury Semikhatsky.

Drive by fix: immutable ElementAttrybuteData uses the same trick with placement new as in StylePropertySet.

Source/WebCore:

* css/CSSCanvasValue.cpp:
(WebCore::CSSCanvasValue::reportDescendantMemoryUsage):
* css/CSSCharsetRule.cpp:
(WebCore::CSSCharsetRule::reportDescendantMemoryUsage):
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::reportDescendantMemoryUsage):
* css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::reportDescendantMemoryUsage):
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::ImageWithScale::reportMemoryUsage):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::reportDescendantMemoryUsage):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::reportDescendantMemoryUsage):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::reportMemoryUsage):
* css/CSSValue.cpp:
(WebCore::TextCloneCSSValue::reportDescendantMemoryUsage):
* css/CSSVariableValue.h:
(WebCore::CSSVariableValue::reportDescendantMemoryUsage):
* css/FontFeatureValue.cpp:
(WebCore::FontFeatureValue::reportDescendantMemoryUsage):
* css/MediaQuery.cpp:
(WebCore::MediaQuery::reportMemoryUsage):
* css/MediaQueryExp.cpp:
(WebCore::MediaQueryExp::reportMemoryUsage):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::reportDescendantMemoryUsage):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::reportMemoryUsage):
* css/WebKitCSSKeyframeRule.cpp:
(WebCore::StyleKeyframe::reportMemoryUsage):
* css/WebKitCSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::reportDescendantMemoryUsage):
* css/WebKitCSSSVGDocumentValue.cpp:
(WebCore::WebKitCSSSVGDocumentValue::reportDescendantMemoryUsage):
* css/WebKitCSSShaderValue.cpp:
(WebCore::WebKitCSSShaderValue::reportDescendantMemoryUsage):
* dom/Attribute.h:
(WebCore::Attribute::reportMemoryUsage):
* dom/CharacterData.cpp:
(WebCore::CharacterData::reportMemoryUsage):
* dom/Document.cpp:
(WebCore::Document::reportMemoryUsage):
* dom/ElementAttributeData.cpp:
(WebCore::immutableElementAttributeDataSize):
(WebCore):
(WebCore::ElementAttributeData::createImmutable):
(WebCore::ElementAttributeData::reportMemoryUsage):
* dom/Event.cpp:
(WebCore::Event::reportMemoryUsage):
* dom/MemoryInstrumentation.cpp:
(WebCore::MemoryInstrumentation::addInstrumentedObjectImpl):
* dom/MemoryInstrumentation.h:
(MemoryInstrumentation):
* dom/QualifiedName.h:
(WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::reportMemoryUsage):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::reportMemoryUsage):
* loader/SubstituteData.cpp:
(WebCore::SubstituteData::reportMemoryUsage):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::reportMemoryUsage):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::reportMemoryUsage):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::reportMemoryUsage):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::reportMemoryUsage):
* loader/cache/CachedShader.cpp:
(WebCore::CachedShader::reportMemoryUsage):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::reportMemoryUsage):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::reportMemoryUsage):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::reportMemoryUsage):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::reportMemoryUsage):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::reportMemoryUsage):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::reportMemoryUsage):
* svg/SVGPaint.cpp:
(WebCore::SVGPaint::reportDescendantMemoryUsage):

Source/WebKit/chromium:

* tests/MemoryInstrumentationTest.cpp:
(WebCore::TEST):
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126154 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for WinCE after r115348.

* Source/cmake/OptionsWindows.cmake: Removed duplicated WEBKIT_OPTION_DEFAULT_PORT_VALUE().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: NMI: OwnPtr<T> was counted as RefPtr<T>
https://bugs.webkit.org/show_bug.cgi?id=94599

Reviewed by Yury Semikhatsky.

* dom/MemoryInstrumentation.h:
(WebCore::MemoryObjectInfo::MemoryObjectInfo):
(WebCore::MemoryInstrumentation::addInstrumentedObjectImpl):
(WebCore::MemoryInstrumentation::addObjectImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Early returns in MediaPlayer setters
https://bugs.webkit.org/show_bug.cgi?id=87304

Calls to the MediaPlayerPrivate implementation can be avoided if
the value to set and the current value are equal.

Reviewed by Eric Carlson.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::loadWithNextMediaEngine): Once a new
MediaPlayerPrivate has been created propagate the playback rate
value to it, as it is done for some other attributes like preload
or preservePitch.
(WebCore::MediaPlayer::setVolume): Perform action only if current
and new values differ.
(WebCore::MediaPlayer::setMuted): Ditto.
(WebCore::MediaPlayer::setPreservesPitch): Ditto.
(WebCore::MediaPlayer::setSize): Ditto.
(WebCore::MediaPlayer::setVisible): Ditto.
(WebCore::MediaPlayer::setPreload): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
media/media-document-audio-repaint.html is racy
https://bugs.webkit.org/show_bug.cgi?id=94454

Reviewed by Eric Carlson.

* media/media-document-audio-repaint.html: Don't rely on the play
event. Trigger the display and seek upon receipt of the pause event.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r126150.
http://trac.webkit.org/changeset/126150
https://bugs.webkit.org/show_bug.cgi?id=94605

Breaks 73 layout tests on chromium.webkit builder (Requested
by pfeldman on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-08-21

* UseV8.cmake:
* WebCore.gypi:
* bindings/v8/V8Binding.cpp:
(StringTraits):
(WebCore):
(WebCore::v8StringToWebCoreString):
(WebCore::int32ToWebCoreStringFast):
(WebCore::int32ToWebCoreString):
* bindings/v8/V8Binding.h:
(WebCore):
(V8ParameterBase):
(WebCore::V8ParameterBase::operator String):
(WebCore::V8ParameterBase::operator AtomicString):
(WebCore::V8ParameterBase::V8ParameterBase):
(WebCore::V8ParameterBase::prepareBase):
(WebCore::V8ParameterBase::object):
(WebCore::V8ParameterBase::setString):
(WebCore::V8ParameterBase::toString):
(WebCore::::prepare):
* bindings/v8/V8StringResource.cpp: Removed.
* bindings/v8/V8StringResource.h: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MathML tests need rebaselining on Mac.
https://bugs.webkit.org/show_bug.cgi?id=94393

Reviewed by Dan Bernstein.

* platform/mac/mathml/presentation/attributes-expected.txt:
* platform/mac/mathml/presentation/fenced-mi-expected.txt:
* platform/mac/mathml/presentation/fractions-expected.txt:
* platform/mac/mathml/presentation/mo-expected.txt:
* platform/mac/mathml/presentation/over-expected.txt:
* platform/mac/mathml/presentation/roots-expected.txt:
* platform/mac/mathml/presentation/row-expected.txt:
* platform/mac/mathml/presentation/sub-expected.txt:
* platform/mac/mathml/presentation/tokenElements-expected.txt:
* platform/mac/mathml/presentation/underover-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r126146.
http://trac.webkit.org/changeset/126146
https://bugs.webkit.org/show_bug.cgi?id=94606

It made all tests assert (Requested by Ossy on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-08-21

Source/WebCore:

* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::prototypeForSignalsAndSlots):
(JSC::Bindings::QtRuntimeMethod::call):
(JSC::Bindings::QtRuntimeMethod::jsObjectRef):
(JSC::Bindings::QtRuntimeMethod::connectOrDisconnect):
* bridge/qt/qt_runtime.h:
(QtRuntimeMethod):

Source/WebKit/qt:

* tests/qobjectbridge/tst_qobjectbridge.cpp:
(tst_QObjectBridge::objectDeleted):
(tst_QObjectBridge::introspectQtMethods_data):
(tst_QObjectBridge::introspectQtMethods):

LayoutTests:

* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: break on exceptions decoration was lost, restoring.

Not reviewed - a follow up to 126012.

* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._pauseOnExceptionStateChanged.get switch):
(WebInspector.ScriptsPanel.prototype._pauseOnExceptionStateChanged):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WKTR doesn't implement dumpWillCacheResponse().
https://bugs.webkit.org/show_bug.cgi?id=94607

Unreviewed (Bot gardening)

* platform/wk2/Skipped: Skip http/tests/misc/willCacheResponse-delegate-callback.html

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/12104508> TextIterator takes O(n^2) to iterate over n empty blocks
https://bugs.webkit.org/show_bug.cgi?id=94429

Reviewed by Sam Weinig.

No new tests, because behavior is unchanged.

* editing/TextIterator.cpp:
(WebCore::TextIterator::shouldRepresentNodeOffsetZero): Enhanced the check for nodes that
cannot contain VisiblePosition to also check for zero-height blocks.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement JSDOMWindow*::allowsAccessFrom* in terms of BindingSecurity
https://bugs.webkit.org/show_bug.cgi?id=93407

Reviewed by Eric Seidel.

Source/WebCore: 

This patch removes allowsAccessFrom and implements the security checks
in terms of shouldAllowAccessToDOMWindow directly.

* bindings/generic/BindingSecurity.cpp:
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
(WebCore):
* bindings/generic/BindingSecurity.h:
(BindingSecurity):
* bindings/js/JSDOMBinding.cpp:
(WebCore::shouldAllowAccessToFrame):
(WebCore):
(WebCore::shouldAllowAccessToDOMWindow):
* bindings/js/JSDOMBinding.h:
(WebCore):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::shouldAllowAccessFrom):
(WebCore):
* bindings/js/JSDOMWindowBase.h:
(JSDOMWindowBase):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::namedItemGetter):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertyDescriptor):
(WebCore::JSDOMWindow::put):
(WebCore::JSDOMWindow::deleteProperty):
(WebCore::JSDOMWindow::getPropertyNames):
(WebCore::JSDOMWindow::getOwnPropertyNames):
(WebCore::JSDOMWindow::defineOwnProperty):
(WebCore::JSDOMWindow::setLocation):
* bindings/js/JSDOMWindowCustom.h:
* bindings/js/JSInjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::canAccessInspectedWindow):
* bindings/objc/WebScriptObject.mm:
(-[WebScriptObject _isSafeScript]):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertyDescriptorBody):
(GenerateImplementation):

LayoutTests: 

These test results are now more similar (although not identical) to the
results for the V8 bindings.

* http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener-expected.txt:
* http/tests/security/listener/xss-JSTargetNode-onclick-shortcut-expected.txt:
* http/tests/security/listener/xss-XMLHttpRequest-addEventListener-expected.txt:
* http/tests/security/listener/xss-XMLHttpRequest-shortcut-expected.txt:
* http/tests/security/listener/xss-window-onclick-addEventListener-expected.txt:
* http/tests/security/listener/xss-window-onclick-shortcut-expected.txt:


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