[GTK] gdk threads deprecated functions calls should be refactored
https://bugs.webkit.org/show_bug.cgi?id=120070

Patch by Anton Obzhirov <a.obzhirov@samsung.com> on 2013-09-03
Reviewed by Mario Sanchez Prada.

Removed deprecated functions gdk_threads_leave()/gdk_threads_enter() functions since
there is no more checks for threads lock in GTK 3.6.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewRunAsModal):
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::showPopupMenu):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Check WTF::VectorFiller template argument type size in compile time
https://bugs.webkit.org/show_bug.cgi?id=120631

Reviewed by Darin Adler.

The template argument's type size in WTF::VectorFiller 'memset' specialization
should be checked during compilation rather than in runtime.

* wtf/Vector.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154990 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r154881.
http://trac.webkit.org/changeset/154881
https://bugs.webkit.org/show_bug.cgi?id=120643

Crashes on macworld.com (Requested by kling on #webkit).

Source/WebCore:

* dom/Element.cpp:
(WebCore::Element::setAttributeInternal):

LayoutTests:

* fast/dom/Element/setAttributeNode-for-existing-attribute-expected.txt: Removed.
* fast/dom/Element/setAttributeNode-for-existing-attribute.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support the "json" responseType and JSON response entity in XHR
https://bugs.webkit.org/show_bug.cgi?id=73648

Reviewed by Oliver Hunt.

Source/JavaScriptCore: 

Based on the patch written by Jarred Nicholls.

Add JSC::JSONParse. This function will be used in XMLHttpRequest.response of type 'json'.

* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/JSONObject.cpp:
(JSC::JSONParse):
* runtime/JSONObject.h:

Source/WebCore: 

Based on the patch written by Jarred Nicholls.

Implement 'json' type for XMLHttpRequest.response. We cache the result on JSC side as a cached attribute
unlike other response types like 'document' and 'blob' for which the parsed response object is cached
in XMLHttpRequest itself. In the long run, we should do the same for other types of response types.

Also refactored the various code to share the code.

Tests: fast/xmlhttprequest/xmlhttprequest-responsetype-json-invalid.html
       fast/xmlhttprequest/xmlhttprequest-responsetype-json-utf16.html
       fast/xmlhttprequest/xmlhttprequest-responsetype-json-valid.html

* ForwardingHeaders/runtime/JSONObject.h: Added.

* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::visitChildren):
(WebCore::JSXMLHttpRequest::response): Use JSONParse to parse the response text and cache the result.
Call didCacheResponseJSON to set the cache status and clear the original response buffer.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::XMLHttpRequest): Added m_responseCacheIsValid to invalidate the cache of
a json response.
(WebCore::XMLHttpRequest::responseText):
(WebCore::XMLHttpRequest::didCacheResponseJSON): Added; Updates m_responseCacheIsValid and clears the
response buffer to save memory.
(WebCore::XMLHttpRequest::responseXML):
(WebCore::XMLHttpRequest::setResponseType):
(WebCore::XMLHttpRequest::responseType):
(WebCore::XMLHttpRequest::clearResponseBuffers):
(WebCore::XMLHttpRequest::didReceiveData):

* xml/XMLHttpRequest.h:
(WebCore::XMLHttpRequest::doneWithoutErrors): Extracted from responseXML.
(WebCore::XMLHttpRequest::responseTextIgnoringResponseType): Extracted from responseText.
(WebCore::XMLHttpRequest::responseCacheIsValid): Added.
(WebCore::XMLHttpRequest::shouldDecodeResponse): Extracted from didReceiveData.
Also modified to decode when the response type is ResponseTypeJSON.

* xml/XMLHttpRequest.idl: Added CachedAttribute IDL extention on response property. This cache is
used when the response type is 'json'.

LayoutTests: 

Add regression tests for XMLHttpRequest.response of type 'json'.

Two of these tests (valid & invalid) come from Jarred Nicholls's original patch.

* fast/xmlhttprequest/resources/xmlhttprequest-responsetype-json-utf-16.json: Added.
* fast/xmlhttprequest/resources/xmlhttprequest-responsetype-json.json: Added.
* fast/xmlhttprequest/xmlhttprequest-responsetype-json-invalid-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-responsetype-json-invalid.html: Added.
* fast/xmlhttprequest/xmlhttprequest-responsetype-json-utf16-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-responsetype-json-utf16.html: Added.
* fast/xmlhttprequest/xmlhttprequest-responsetype-json-valid-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-responsetype-json-valid.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Require layout when -webkit-overflow-scrolling changes
https://bugs.webkit.org/show_bug.cgi?id=120535

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/repaint/overflow-scroll-touch-repaint.html

We want to require a layout when the value of -webkit-overflow-scrolling changes
since -webkit-overflow-scrolling creates a stacking context.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):

LayoutTests:

Add a test to ensure we perform a layout and repaint when the
value of -webkit-overflow-scrolling changes on an element.

At the time of writing, the iOS port enables ACCELERATED_OVERFLOW_SCROLLING.

* fast/repaint/overflow-scroll-touch-repaint-expected.txt: Added.
* fast/repaint/overflow-scroll-touch-repaint.html: Added.
* platform/efl/TestExpectations: Skip test fast/repaint/overflow-scroll-touch-repaint.html
since this platform doesn't enable ACCELERATED_OVERFLOW_SCROLLING.
* platform/gtk/TestExpectations: Ditto.
* platform/mac/TestExpectations: Ditto.
* platform/qt/TestExpectations: Ditto.
* platform/win/TestExpectations: Ditto.
* platform/wincairo/TestExpectations: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154993 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][EFL] include missing localized strings for subtitle auto track
https://bugs.webkit.org/show_bug.cgi?id=120629

those methods are necessary to show the "Auto" track on webkitgtk

Patch by Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk> on 2013-09-03
Reviewed by Gustavo Noronha Silva.

* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::textTrackAutomaticMenuItemText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::textTrackAutomaticMenuItemText):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [Mac] Hyphenation respects regional format settings language instead of primary language
        https://bugs.webkit.org/show_bug.cgi?id=120641

        Reviewed by Dan Bernstein.

        Fixes hyphenation tests on my machine with non-English regional format settings.

        * platform/text/cf/HyphenationCF.cpp: (createValueForNullKey):
        Use primary UI language for hyphenation, not regional settings language.



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