[Qt] Port convertQVariantToValue to use the JSC C API
https://bugs.webkit.org/show_bug.cgi?id=93889

Reviewed by Kenneth Rohde Christiansen.

Based on patch by Noam Rosenthal.

This patch is another step towards reducing the use of internal JSC API
in the Qt bridge. Most of the conversion from QVariant to JS values is
straight-forward. The biggest behavioural change is that QVariant lists
are converted on-the-spot instead of lazily. Bug #94691 tracks fixing
that.

* bridge/qt/qt_instance.cpp:
(Bindings):
(JSC::Bindings::QtField::valueFromInstance):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::convertQVariantToValue):
(JSC::Bindings::QtRuntimeMethod::call):
(JSC::Bindings::QtConnectionObject::execute):
(JSC::Bindings::::valueAt):
* bridge/qt/qt_runtime.h:
(Bindings):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Optionally support smooth-scrolling on all platforms
https://bugs.webkit.org/show_bug.cgi?id=74926

Reviewed by Simon Hausmann.

Source/WebCore:

Make GestureAnimations depend on the GESTURE_ANIMATION feature flag,
since GestureAnimations are unused on some platforms.

* Target.pri:
* platform/ScrollAnimatorNone.cpp:
(WebCore::ScrollAnimatorNone::fireUpAnAnimation):
(WebCore::ScrollAnimatorNone::cancelAnimations):
(WebCore::ScrollAnimatorNone::animationTimerFired):
* platform/ScrollAnimatorNone.h:
(ScrollAnimatorNone):

Source/WebKit/qt:

Expose the enable scroll animator setting.

* Api/qwebsettings.cpp:
(QWebSettingsPrivate::apply):
(QWebSettings::QWebSettings):
* Api/qwebsettings.h:

Source/WebKit2:

Expose scroll-animator preference, but ensure animated smooth scrolling
on the web process side is disabled when scrolling has been delegated
to the UI process.

* Shared/WebPreferencesStore.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setResizesToContentsUsingLayoutSize):
(WebKit::WebPage::updatePreferences):

Source/WTF:

Initialize GESTURE_ANIMATION feature flag.

* wtf/Platform.h:

Tools:

Enabled SMOOTH_SCROLLING on Qt, and expose the enable scroll animator
setting in QtTestBrowser so it can be tested.

* QtTestBrowser/launcherwindow.cpp:
(LauncherWindow::createChrome):
(LauncherWindow::toggleScrollAnimator):
* QtTestBrowser/launcherwindow.h:
(WindowOptions::WindowOptions):
(WindowOptions):
(LauncherWindow):
* qmake/mkspecs/features/features.pri:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Support slider tick mark snapping
https://bugs.webkit.org/show_bug.cgi?id=94560

Patch by KwangYong Choi <ky0.choi@samsung.com> on 2012-08-22
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Increased the threshold for the EFL port. The value is snapped
when it clicked near tick mark.

No new tests. Covered by fast/forms/datalist/range-snap-to-datalist.html.

* platform/efl/RenderThemeEfl.cpp:
(WebCore):
(WebCore::RenderThemeEfl::sliderTickSnappingThreshold):
* platform/efl/RenderThemeEfl.h:
(RenderThemeEfl):

LayoutTests:

The expected result of fast/forms/datalist/range-snap-to-datalist.html
is updated because slider tick mark snapping threshold is changed.

* platform/efl/fast/forms/datalist/range-snap-to-datalist-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, build fixup for r126291.

* Shared/WebPreferencesStore.h:
(WebKit):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix JSC build when DFG-JIT is disabled
https://bugs.webkit.org/show_bug.cgi?id=94694

Patch by Gabor Ballabas <gaborb@inf.u-szeged.hu> on 2012-08-22
Reviewed by Csaba Osztrogonác.

Adding an appropriate guard for fixing the build.

* bytecode/ResolveGlobalStatus.cpp:
(JSC):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Wrong default for new ScrollAnimatorEnabled preference.

Reviewed by Simon Hausmann.

ScrollAnimatorEnabled introduced in r126291, should default to 'true'
to preserve existing behaviour on WK2 platforms that already enabled
SMOOTH_SCROLLING unconditionally.

* Shared/WebPreferencesStore.h:
(WebKit):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] Enable runtime enabled features: DeviceMotion and DeviceOrientation
https://bugs.webkit.org/show_bug.cgi?id=94692

Reviewed by Kenneth Rohde Christiansen.

* WebProcess/qt/WebProcessQt.cpp:
(WebKit::WebProcess::platformInitializeWebProcess):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: move NavigatorView and NavigatorOverlayController to ScriptsPanel module
https://bugs.webkit.org/show_bug.cgi?id=94693

Reviewed by Vsevolod Vlasov.

Loading them via importScript now.

* inspector/compile-front-end.py:
* inspector/front-end/ScriptsPanel.js:
* inspector/front-end/inspector.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Preferred languages and spellchecker APIs are not consistent in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=94683

Reviewed by Alejandro G. Castro.

Source/WebCore:

Use a Vector<String> instead of a comma-separated string to
get/set languages.

* platform/text/gtk/TextCheckerEnchant.cpp:
(TextCheckerEnchant::updateSpellCheckingLanguages):
(TextCheckerEnchant::getSpellCheckingLanguages):
* platform/text/gtk/TextCheckerEnchant.h:
(TextCheckerEnchant):

Source/WebKit/gtk:

* webkit/webkitspellcheckerenchant.cpp:
(updateSpellCheckingLanguages): Split the languages string to pass a
Vector to updateSpellCheckingLanguages().

Source/WebKit2:

Change spell-checker and preferred languages API to use a GStrv
instead of a comma-separated string and GList. This makes the API
more consistent and convenient to use.

* UIProcess/API/gtk/WebKitTextChecker.cpp:
(WebKitTextChecker::getSpellCheckingLanguages): Return a
Vector<String> instead of a String.
(WebKitTextChecker::setSpellCheckingLanguages): Receive a
Vector<String> instead of a String.
* UIProcess/API/gtk/WebKitTextChecker.h:
(WebKitTextChecker): Use a GPtrArray to cache languages.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkit_web_context_get_spell_checking_languages):
(webkit_web_context_set_spell_checking_languages):
(webkit_web_context_set_preferred_languages):
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/tests/TestWebKitWebContext.cpp:
(testWebContextSpellChecker):
(testWebContextLanguages):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed buildfix for Qt-minimal after r126291

Disable smooth scrolling when request-animation-frame has been disabled either
explicitly or as part of --minimal.

* qmake/mkspecs/features/features.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Not reviewed: follow up to r126297, fixing WebCore.gypi.

* WebCore.gypi:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r126287.
http://trac.webkit.org/changeset/126287
https://bugs.webkit.org/show_bug.cgi?id=94708

It made WK1 layout testing 3.7x slower (>1hours) (Requested by
ossy on #webkit).

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

Source/WebCore:

* bridge/qt/qt_instance.cpp:
(JSC::Bindings::unusedWeakObjectMapCallback):
(Bindings):
(JSC::Bindings::WeakMapImpl::WeakMapImpl):
(JSC::Bindings::WeakMapImpl::~WeakMapImpl):
(JSC::Bindings::WeakMap::~WeakMap):
(JSC::Bindings::WeakMap::set):
(JSC::Bindings::WeakMap::get):
(JSC::Bindings::WeakMap::remove):
* bridge/qt/qt_instance.h:
(QtInstance):
* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::prototypeForSignalsAndSlots):
(JSC::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
(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@126301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unused TextDrawingMode flags from GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=21898

Reviewed by Benjamin Poulain.

Remove TextModeClip and TextModeInvisible. These are not used by any port, and
according to https://bugs.webkit.org/show_bug.cgi?id=42110#c2 these were added
just to map CG existing flags, but are not used.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::setPlatformTextDrawingMode):
* platform/graphics/openvg/PainterOpenVG.cpp:
(WebCore::PainterOpenVG::drawText):
* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PlatformContextSkia::setTextDrawingMode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126302 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Add RSS content handling support
https://bugs.webkit.org/show_bug.cgi?id=93496

Reviewed by Yong Li.

Cleanup some more.

* platform/network/blackberry/rss/RSSFilterStream.cpp:
(WebCore):
(WebCore::createParser):
(WebCore::defaultEncodingForLanguage):
(WebCore::isTranscodingNeeded):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in WebCore::RenderBlock::removeChild
https://bugs.webkit.org/show_bug.cgi?id=93879

Patch by Raul Hudea <rhudea@adobe.com> on 2012-08-22
Reviewed by Abhishek Arya.

Source/WebCore:

By adding the lifetime state to the RenderNamedFlowThread (r122556), it become possible for the a RenderRegion object to delete its sibling,
the RenderNamedFlowThread. This is unexpected in the rendering world and cause problems in RenderBlock::removeChild where we retain previous
and next sibling pointers.
So, all the RenderNamedFlowThread are created under a RenderFlowThreadContainer object insted of the RenderView. The new object is created only
when the first named flow is created.

Test: fast/regions/remove-flow-thread-crash.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* rendering/FlowThreadController.cpp:
(WebCore::FlowThreadController::FlowThreadController): Added initialization for the new RenderFlowThreadContainer member
(WebCore::FlowThreadController::ensureRenderFlowThreadWithName): Added the creation of the RenderFlowThreadContainer object and use it as a parent for all RenderNamedFlowThreads
(WebCore::FlowThreadController::styleDidChange): Inform all the RenderNamedFlowThreads that the style changed in regions (initially this code was in RenderView, but now all RenderNamedFlowThreads are children of RenderFlowThreadContainer)
(WebCore):
* rendering/FlowThreadController.h:
(WebCore):
(FlowThreadController):
* rendering/RenderFlowThreadContainer.cpp: Added.
(WebCore):
(WebCore::RenderFlowThreadContainer::RenderFlowThreadContainer):
(WebCore::RenderFlowThreadContainer::layout):
* rendering/RenderFlowThreadContainer.h: Added.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::markContainingBlocksForLayout): Skip to RenderView if the current object is an RenderFlowThreadContainer.
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderFlowThreadContainer):
* rendering/RenderView.cpp:
(WebCore::RenderView::styleDidChange): Moved the code associated to RenderNamedFlowThreads to FlowThreadController:styleDidChange and call it instead.

LayoutTests:

Test the region-flow_thread sibling case

* fast/regions/remove-flow-thread-crash-expected.txt: Added.
* fast/regions/remove-flow-thread-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Build failures with harfbuzz outside standard locations
https://bugs.webkit.org/show_bug.cgi?id=93030

Reviewed by Rob Buis.

Add ${HARFBUZZ_INCLUDE_DIRS} to the list of included paths: so far
it was being implicitly pulled from evas's pkg-config file, and
used to work when WebKit-EFL's dependencies were built with
jhbuild -- in this case, harfbuzz is built before evas, which is
then built with harfbuzz support and adds the required paths to
its .pc file.

We need to include things directly to account for the case of
people not using jhbuild and thus not necessarily having harfbuzz
as an evas dependency.

* PlatformEfl.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Split WebCore/platform into a separate library
https://bugs.webkit.org/show_bug.cgi?id=94435

Reviewed by Martin Robinson.

More people have been reporting problems when linking WebCore because
the command line limit is being exceeded. Splitting WebCore a bit more
is in order.

.:

* GNUmakefile.am: add variable that will hold the list of source files
for libWebCorePlatform .

Source/WebCore:

* GNUmakefile.am: add new libWebCorePlatform convenience library.
* GNUmakefile.list.am: move list of platform/* files to its own variable.

Source/WebKit/gtk:

* GNUmakefile.am: link libWebCorePlatform into libwebkitgtk

Source/WebKit2:

* GNUmakefile.am: link libWebCorePlatform into libwebkit2gtk

Tools:

* GNUmakefile.am: link libWebCorePlatform into DRT

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Crash when finalizing WebKitWebView
https://bugs.webkit.org/show_bug.cgi?id=94699

Reviewed by Martin Robinson.

Create the offscreen window the first time accelerated compositing
is enabled, so that if it's never enabled the window won't be
created.

* WebCoreSupport/AcceleratedCompositingContextGL.cpp:
(WebKit::AcceleratedCompositingContext::AcceleratedCompositingContext):
(WebKit::AcceleratedCompositingContext::initialize):
(WebKit::AcceleratedCompositingContext::setRootCompositingLayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [WebGL] Support the communication protocol from the injected script
https://bugs.webkit.org/show_bug.cgi?id=94689

Patch by Andrey Adaikin <aandrey@chromium.org> on 2012-08-22
Reviewed by Pavel Feldman.

Support the WebGL communication protocol from the injected script module.

* inspector/InjectedScriptWebGLModuleSource.js:
(.):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r125710): accessibility/accessibility-node-reparent.html, accessibility/accessibility-node-memory-management.html failing on GTK Linux
https://bugs.webkit.org/show_bug.cgi?id=94200

Reviewed by Chris Fleizach.

Tools:

Adds reference counting for AtkObjects referenced by
AccessibilityUIElementGtk. This prevents bogus results and
assertion failures on AccessibilityUIElements whose underlying
object has been deleted (as opposed to just made defunct).

This fixes two tests that were previously failing because of this bug.

* DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
(AccessibilityUIElement::AccessibilityUIElement):
(AccessibilityUIElement::~AccessibilityUIElement):

LayoutTests:

This patch fixes two tests and removes them from gtk expectations.

* platform/gtk/TestExpectations:


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