[X11][BlackBerry] Check if MOZ_X11 is defined instead of XP_UNIX npruntime_internal.h
https://bugs.webkit.org/show_bug.cgi?id=113687

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-05-07
Reviewed by Anders Carlsson.

It's assumed that all UNIX platforms use X11 for plugins, which is
not the case of BlackBerry.

* bridge/npruntime_internal.h: Use MOZ_X11 instead of XP_UNIX.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149669 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add ewk APIs for setting and getting user agent
https://bugs.webkit.org/show_bug.cgi?id=114429

Patch by Jinwoo Song <jinwoo7.song@samsung.com> on 2013-05-07
Reviewed by Andreas Kling.

Provide ewk_view_user_agent_get/set APIs which wraps WK APIs.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::EwkView):
(EwkView::setUserAgent):
* UIProcess/API/efl/EwkView.h:
(EwkView::userAgent):
(EwkView):
* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_user_agent_get):
(ewk_view_user_agent_set):
* UIProcess/API/efl/ewk_view.h:
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash when calling QWebFrame::evaluateJavaScript
https://bugs.webkit.org/show_bug.cgi?id=113434

Reviewed by Simon Hausmann.

Ensure we hold the JSLock when converting JSValue to JSValueRef.

* Api/qwebelement.cpp:
(setupScriptContext):
(QWebElement::evaluateJavaScript):
* WebCoreSupport/QWebFrameAdapter.cpp:
(QWebFrameAdapter::evaluateJavaScript):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Curl] POST requests sometimes fail.
https://bugs.webkit.org/show_bug.cgi?id=111844

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-05-07
Reviewed by Brent Fulgham.

Curl adds the header 'Expect: 100-Continue' when sending a POST request.
When we receive the header 'HTTP/1.1 100 Continue', we should not call
ResourceHandleClient::didReceiveResponse(), as this will cancel the request,
because the MIME type is empty in this case, causing the POST request to fail.
This header is only sent as an info header, or provisional response.

In addition, this patch changes the classification of http code 304 (Not modified).
It is not reported as a redirect anymore, but as a response
(ResourceHandleClient::didReceiveResponse() is called.

* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::isHttpInfo): Added helper method to determine if http code is http info.
(WebCore::isHttpRedirect): Added helper method to determine if http code is http redirect.
(WebCore::headerCallback): Just return when receiving the header'HTTP/1.1 100 Continue'.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove AlwaysInline.h from WTF
https://bugs.webkit.org/show_bug.cgi?id=115727

Reviewed by Brent Fulgham.

The macro that used to be in AlwaysInline.h is now in Compiler.h so there's no reason
to keep AlwaysInline.h around anymore.

Source/JavaScriptCore:

* jit/JSInterfaceJIT.h:
* parser/Lexer.h:
* runtime/JSCJSValue.h:
* runtime/SymbolTable.h:

Source/WebCore:

* WebCore.vcproj/WebCore.vcproj:
* bindings/js/JSDOMWindowCustom.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* platform/graphics/filters/FEConvolveMatrix.h:
* rendering/InlineIterator.h:
* rendering/InlineTextBox.cpp:
* rendering/RenderBlockLineLayout.cpp:
* rendering/RenderText.cpp:

Source/WTF:

* WTF.vcproj/WTF.vcproj:
* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/AlwaysInline.h: Removed.
* wtf/BloomFilter.h:
* wtf/FastMalloc.cpp:
* wtf/PassRefPtr.h:
* wtf/dtoa.cpp:
* wtf/gobject/GRefPtr.h:

Tools:

* DumpRenderTree/qt/DumpRenderTreeMain.cpp:
* WebKitTestRunner/InjectedBundle/qt/InjectedBundleQt.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Expand spellcheck logging
https://bugs.webkit.org/show_bug.cgi?id=115482

Patch by Nima Ghanavatian <nghanavatian@blackberry.com> on 2013-05-07
Reviewed by Rob Buis.

Internally reviewed by Mike Fenton.

Fix some build errors when SpellingLog was turned on and expand on the debug
statements to be more verbose. Set up timers and print the duration of each
iteration as we traverse the text to create a range to send out for checking.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::spellCheckingRequestCancelled):
(BlackBerry::WebKit::InputHandler::spellCheckingRequestProcessed):
(BlackBerry::WebKit::InputHandler::setElementFocused):
(WebKit):
(BlackBerry::WebKit::InputHandler::spellCheckTextBlock):
* WebKitSupport/SpellingHandler.cpp:
(BlackBerry::WebKit::SpellingHandler::spellCheckTextBlock):
(BlackBerry::WebKit::SpellingHandler::parseBlockForSpellChecking):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Read-only fields should not get keyboard focus
https://bugs.webkit.org/show_bug.cgi?id=115725

Patch by Nima Ghanavatian <nghanavatian@blackberry.com> on 2013-05-07
Reviewed by Rob Buis.

Internally reviewed by Mike Fenton.

PR332887
Prevent keyboard focus and FCC from displaying when the user taps on a
read-only field. Further, ensure form controls skip over these fields
with the next/previous buttons.

* WebKitSupport/DOMSupport.cpp:
(BlackBerry::WebKit::DOMSupport::elementIsReadOnly):
(DOMSupport):
* WebKitSupport/DOMSupport.h:
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::focusedNodeChanged):
(BlackBerry::WebKit::InputHandler::setInputModeEnabled):
(BlackBerry::WebKit::InputHandler::notifyClientOfKeyboardVisibilityChange):
(BlackBerry::WebKit::InputHandler::isActiveTextEdit):
(WebKit):
* WebKitSupport/InputHandler.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Take advantage of pre-decrement and post-increment opcodes for sh4 base JIT.
https://bugs.webkit.org/show_bug.cgi?id=115722

Patch by Julien Brianceau <jbrianceau@nds.com> on 2013-05-07
Reviewed by Oliver Hunt.

* assembler/MacroAssemblerSH4.h:
(JSC::MacroAssemblerSH4::load8PostInc):
(MacroAssemblerSH4):
(JSC::MacroAssemblerSH4::load16Unaligned):
(JSC::MacroAssemblerSH4::load16PostInc):
(JSC::MacroAssemblerSH4::storeDouble):
(JSC::MacroAssemblerSH4::load32WithUnalignedHalfWords):
* assembler/SH4Assembler.h:
(JSC::SH4Assembler::movwMemRegIn):
(SH4Assembler):
(JSC::SH4Assembler::movbMemRegIn):
(JSC::SH4Assembler::printInstr):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use OwnPtr instead of deleteAllValues in SMILTimeContainer
https://bugs.webkit.org/show_bug.cgi?id=115730

Reviewed by Geoffrey Garen.

* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::~SMILTimeContainer): Removed call to deleteAllValues.
(WebCore::SMILTimeContainer::schedule): Use add instead of get/set to put a new
AnimationsVector into the map as needed.
(WebCore::SMILTimeContainer::setElapsed): Added get since values are OwnPtr now.
(WebCore::SMILTimeContainer::updateAnimations): Ditto.

* svg/animation/SMILTimeContainer.h: Changed value type of GroupedAnimationsMap
to OwnPtr instead of raw pointer.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove some unnecessary soft linking in NetworkProcess. (Take 2)
<rdar://problem/13821779> and https://bugs.webkit.org/show_bug.cgi?id=115683

Reviewed by Dean Jackson and owned by Andreas Kling.

As a followup to r149651, include the private headers conditionally.
Also, fix a bug introduced with r149651 (bool vs CFBooleanRef).

* NetworkProcess/mac/DiskCacheMonitor.mm:
* NetworkProcess/mac/NetworkResourceLoaderMac.mm:
(WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add an 'isReadOnly' member to IDL parse tree structure
https://bugs.webkit.org/show_bug.cgi?id=115704

Reviewed by Kentaro Hara.

Source/WebCore: 

Add an 'isReadOnly' member to IDL parse tree structure by merging
https://chromium.googlesource.com/chromium/blink/+/d6add80ecd08bcd88a6ae0e1698d929830b3bd8b
and update Objective-C, C++, and GObject binding generators to use isReadOnly.

* bindings/scripts/CodeGeneratorCPP.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/CodeGeneratorGObject.pm:
(GetWriteableProperties):
(GenerateProperty):
(GenerateFunctions):
* bindings/scripts/CodeGeneratorJS.pm:
(IsReadonly):
* bindings/scripts/CodeGeneratorObjC.pm:
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/IDLParser.pm:
(parseAttributeRest):
(parseExceptionField):
(parseAttributeRestOld):

Tools: 

Use newly added isReadOnly attribute.

* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
(_generateHeaderFile):
(_generateImplementationFile):
(_staticValuesGetterImplementation):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Each local storage database should know its origin
https://bugs.webkit.org/show_bug.cgi?id=115737

Reviewed by Andreas Kling.

Store the security origin in a member variable. It'll be used to communicate database state changes to the tracker.

* UIProcess/Storage/LocalStorageDatabase.cpp:
(WebKit::LocalStorageDatabase::create):
(WebKit::LocalStorageDatabase::LocalStorageDatabase):
* UIProcess/Storage/LocalStorageDatabase.h:
(LocalStorageDatabase):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Combine html and js parts fast/url script-tests
        https://bugs.webkit.org/show_bug.cgi?id=115739

        Rubber-stamped by Brady Eidson.

        * fast/url/anchor.html:
        * fast/url/file-http-base.html:
        * fast/url/file.html:
        * fast/url/host-lowercase-per-scheme.html:
        * fast/url/host.html:
        * fast/url/idna2003.html:
        * fast/url/idna2008.html:
        * fast/url/invalid-urls-utf8.html:
        * fast/url/ipv4.html:
        * fast/url/ipv6.html:
        * fast/url/mailto.html:
        * fast/url/path-url.html:
        * fast/url/path.html:
        * fast/url/port.html:
        * fast/url/query.html:
        * fast/url/relative-unix.html:
        * fast/url/relative-win.html:
        * fast/url/relative.html:
        * fast/url/safari-extension.html:
        * fast/url/scheme.html:
        * fast/url/script-tests: Removed.
        * fast/url/script-tests/TEMPLATE.html: Removed.
        * fast/url/script-tests/anchor.js: Removed.
        * fast/url/script-tests/file-http-base.js: Removed.
        * fast/url/script-tests/file.js: Removed.
        * fast/url/script-tests/host.js: Removed.
        * fast/url/script-tests/idna2003.js: Removed.
        * fast/url/script-tests/idna2008.js: Removed.
        * fast/url/script-tests/ipv4.js: Removed.
        * fast/url/script-tests/ipv6.js: Removed.
        * fast/url/script-tests/mailto.js: Removed.
        * fast/url/script-tests/path-url.js: Removed.
        * fast/url/script-tests/path.js: Removed.
        * fast/url/script-tests/port.js: Removed.
        * fast/url/script-tests/query.js: Removed.
        * fast/url/script-tests/relative-unix.js: Removed.
        * fast/url/script-tests/relative-win.js: Removed.
        * fast/url/script-tests/relative.js: Removed.
        * fast/url/script-tests/scheme.js: Removed.
        * fast/url/script-tests/segments-from-data-url.js: Removed.
        * fast/url/script-tests/segments.js: Removed.
        * fast/url/script-tests/standard-url.js: Removed.
        * fast/url/script-tests/trivial-segments.js: Removed.
        * fast/url/script-tests/trivial.js: Removed.
        * fast/url/segments-from-data-url.html:
        * fast/url/segments.html:
        * fast/url/standard-url.html:
        * fast/url/trivial-segments.html:
        * fast/url/trivial.html:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Re-establish autostart timeout extension on user interaction
https://bugs.webkit.org/show_bug.cgi?id=113232

Change WebProcess::pluginDidReceiveUserInteraction to use a tuple of
(pluginOrigin, pageOrigin, mimeType) arguments like the other similar
WebProcess methods and gather these arguments from the PlugInView's
plug-in element.

Reviewed by Dean Jackson.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::pluginDidReceiveUserInteraction):
Cast the m_pluginElement to a HTMLPlugInImageElement so we can obtain the
tuple of (pluginOrigin, pageOrigin, mimeType) to pass to pluginDidReceiveUserInteraction().

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::plugInDidReceiveUserInteraction):
* WebProcess/WebProcess.h:
(WebProcess):
Update method signature to a tuple of (pluginOrigin, pageOrigin, mimeType)
and obtain the plug-in origin hash from that.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r149647): Assertion failure in LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal
https://bugs.webkit.org/show_bug.cgi?id=115711

Reviewed by Andreas Kling.

Source/WebCore:

Export SQLiteDatabase::close.

* WebCore.exp.in:

Source/WebKit2:

Handle setting the local storage directory more than once.

* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal):
Close the database (if necessary) and clear the origins map before importing the origin identifiers.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use OwnPtr instead of deleteAllValues in SVGResourcesCache
https://bugs.webkit.org/show_bug.cgi?id=115729

Reviewed by Benjamin Poulain.

* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::~SVGResourcesCache): Removed call to deleteAllValues.
(WebCore::SVGResourcesCache::addResourcesFromRenderObject): Use adoptPtr and release
to create new SVGResources object.
(WebCore::SVGResourcesCache::removeResourcesFromRenderObject): Use take to remove
the SVGResources from the map rather than a get combined with delete/take.
(WebCore::SVGResourcesCache::cachedResourcesForRenderObject): Removed unneeded
call to contains, since get already returns 0 if there is no item in the map.
(WebCore::SVGResourcesCache::resourceDestroyed): Use typedef for the map type so
we don't have to repeat the type.

* rendering/svg/SVGResourcesCache.h: Added typedef CacheMap, and changed value
type to OwnPtr.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Maintain touch event state throughout processing
https://bugs.webkit.org/show_bug.cgi?id=115663

Patch by Nima Ghanavatian <nghanavatian@blackberry.com> on 2013-05-07
Reviewed by Rob Buis.

Internally reviewed by Otto Cheung and Genevieve Mak.

PR 297691
By maintaining our touch event state, we can get a better idea
of what triggered an update to selection and respond appropriately.
On touch press we set userTouchTriggered to give the UI thread
some context.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
(BlackBerry::WebKit::WebPage::setExtraPluginDirectory):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Updated style of WebArchiveDumpSupport before putting it into WebKitTestRunner.
https://bugs.webkit.org/show_bug.cgi?id=115745

Patch by Alex Christensen <achristensen@apple.com> on 2013-05-07
Reviewed by Tim Horton.

* DumpRenderTree/cf/WebArchiveDumpSupport.cpp:
(compareResourceURLs):
Updated style.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add JoinExistingSession to the Networking XPC.
<rdar://problem/12902288> and https://bugs.webkit.org/show_bug.cgi?id=114991

Reviewed by Sam Weinig.

* NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
The storage database tracker should know when databases come and go
https://bugs.webkit.org/show_bug.cgi?id=115748

Reviewed by Andreas Kling.

Source/WebCore:

Export symbol needed by WebKit2.

* WebCore.exp.in:

Source/WebKit2:

* UIProcess/Storage/LocalStorageDatabase.cpp:
(WebKit::LocalStorageDatabase::openDatabase):
If we've opened the database successfully, call LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin.

(WebKit::LocalStorageDatabase::tryToOpenDatabase):
Remove a FIXME; we run all storage related things on the same thread.

(WebKit::LocalStorageDatabase::close):
Close the database. If it's empty, call LocalStorageDatabaseTracker::deleteEmptyDatabaseWithOrigin.

(WebKit::LocalStorageDatabase::databaseIsEmpty):
Helper function for determining whether a database is empty.

* UIProcess/Storage/LocalStorageDatabase.h:
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::databaseFilename):
Add ".localstorage" to the filename.

(WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
(WebKit::LocalStorageDatabaseTracker::deleteEmptyDatabaseWithOrigin):
Add empty stubs.

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