[BlackBerry] Really fix bug 95488 that user can get the authentication challenge dialog while the other tab has focus.
https://bugs.webkit.org/show_bug.cgi?id=97348
Internal PR: 186597.

Internally reviewed by Yong Li, Joe Mason.
Patch by Lianghui Chen <liachen@rim.com> on 2012-09-21
Reviewed by Yong Li.

Source/WebCore:

Add a singleton AuthenticationChallengeManager to manage authentication
challenge dialog. It does following things:
Record page creation/deletion, so it knows what page is present or not.
Record page visibility change so it knows when to display a dialog or not.
Accept authentication challenge, and decide whether to postpone the
    challenge dialog based on whether there is active authentication challenge
    dialog already and whether its page is visible or not.
When a challenge result comes back, notify the result to all clients
    authenticating for the same protection space, and then start the next
    authentication challenge from the same page, if there is one.
When a page becomes visible, start the first authentication challenge
    dialog that has been blocked before.

And to support this new AuthenticationChallengeManager, and making the
    challenge really asynchronous, NetworkJob has been updated to support
    the concept of "freeze", which means buffering all network loading status
    change but don't send them to NetworkJob clients.
This is necessary when authentication challenge is asynchronous, as the
    previous network loading status will likely come before user make any
    decision.

No new tests for platform specific internal change.

* PlatformBlackBerry.cmake:
* platform/blackberry/AuthenticationChallengeManager.cpp: Added.
(WebCore):
(ChallengeInfo):
(WebCore::ChallengeInfo::ChallengeInfo):
(AuthenticationChallengeManagerPrivate):
(WebCore::AuthenticationChallengeManagerPrivate::AuthenticationChallengeManagerPrivate):
(WebCore::AuthenticationChallengeManagerPrivate::resumeAuthenticationChallenge):
(WebCore::AuthenticationChallengeManagerPrivate::startAuthenticationChallenge):
(WebCore::AuthenticationChallengeManagerPrivate::pageExists):
(WebCore::AuthenticationChallengeManager::AuthenticationChallengeManager):
(WebCore::AuthenticationChallengeManager::pageCreated):
(WebCore::AuthenticationChallengeManager::pageDeleted):
(WebCore::AuthenticationChallengeManager::pageVisibilityChanged):
(WebCore::AuthenticationChallengeManager::authenticationChallenge):
(WebCore::AuthenticationChallengeManager::cancelAuthenticationChallenge):
(WebCore::AuthenticationChallengeManager::notifyChallengeResult):
(WebCore::AuthenticationChallengeManager::instance):
(WebCore::AuthenticationChallengeManager::init):
* platform/blackberry/AuthenticationChallengeManager.h:
(WebCore):
(AuthenticationChallengeManager):
* platform/blackberry/PageClientBlackBerry.h:
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
(WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
(WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
(WebCore::MediaPlayerPrivate::onAuthenticationNeeded):
(WebCore::MediaPlayerPrivate::notifyChallengeResult):
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
(MediaPlayerPrivate):
* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::NetworkJob):
(WebCore::NetworkJob::~NetworkJob):
(WebCore):
(WebCore::NetworkJob::handleNotifyStatusReceived):
(WebCore::NetworkJob::handleNotifyClose):
(WebCore::NetworkJob::sendRequestWithCredentials):
(WebCore::NetworkJob::notifyChallengeResult):
* platform/network/blackberry/NetworkJob.h:
(NetworkJob):

Source/WebKit/blackberry:

Update WebPage to use new AuthenticationChallengeManager.
Register page creation/deletion and visibility change to the new
    AuthenticationChallengeManager.
Initialize AuthenticationChallengeManager in GlobalInitialize() function.

* Api/BlackBerryGlobal.cpp:
(BlackBerry::WebKit::globalInitialize):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::~WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::authenticationChallenge):
(BlackBerry::WebKit::WebPage::setVisible):
* Api/WebPage_p.h:
(WebPagePrivate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Add basic testing support for Geolocation
https://bugs.webkit.org/show_bug.cgi?id=97278

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2: 

* Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :)

* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
* WebProcess/InjectedBundle/InjectedBundle.h:
(InjectedBundle):
Remove the code forcing the Geolocation permissions. It was working around the normal
Geolocation code and updating all the GeolocationController, which is a terrible idea.

Tools: 

Update the Geolocation testing to use the proper API in the UIProcess.

* WebKitTestRunner/CMakeLists.txt:
* WebKitTestRunner/GNUmakefile.am:

* WebKitTestRunner/GeolocationProviderMock.cpp: Added.
(WTR::startUpdatingCallback):
(WTR::stopUpdatingCallback):
(WTR::GeolocationProviderMock::GeolocationProvierMock):
(WTR::GeolocationProviderMock::setMockGeolocationPosition):
(WTR::GeolocationProviderMock::startUpdating):
(WTR::GeolocationProviderMock::stopUpdating):
(GeolocationProviderMock):
The GeolocationProvider store the location update and deliver them as needed.

WebCore GeolocationController do not support asynchronous update on start/stop. This is not
a problem in this case because all the messages between the WebProcess and the UIProcess are
asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event
delivery.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::setGeolocationPermission):
(WTR::InjectedBundle::setMockGeolocationPosition):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(InjectedBundle):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setGeolocationPermission):
(WTR::TestRunner::setMockGeolocationPosition):
From the InjectedBundle, we now pass the information to the UIProcess so that
GeolocationProvider and the TestController can respond appropriately.

* WebKitTestRunner/InjectedBundle/TestRunner.h:
(TestRunner):
* WebKitTestRunner/Target.pri:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::TestController):
(WTR::decidePolicyForGeolocationPermissionRequest):
(WTR::TestController::createOtherPage):
(WTR::TestController::initialize):
(WTR::TestController::setMockGeolocationPosition):
* WebKitTestRunner/TestController.h:
(TestController):
(WTR::TestController::setGeolocationPermission):
(WTR::TestController::isGeolocationPermissionAllowed):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/win/WebKitTestRunner.vcproj:

LayoutTests: 

* platform/wk2/Skipped: Unskip the passing tests.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: AX: WebKit exposes incorrect bounds for embedded SVG in HTML
https://bugs.webkit.org/show_bug.cgi?id=96168

Reviewed by Eric Seidel.

Override absoluteFocusRingQuads() for SVG objects because the default
implementation relies on addFocusRingRects(). In addFocusRingRects(), SVG 
objects adds local positions for its rects instead of absolute positions.

Test: accessibility/svg-bounds.html

* rendering/RenderObject.h:
(RenderObject):
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore):
(WebCore::RenderSVGModelObject::absoluteFocusRingQuads):
* rendering/svg/RenderSVGModelObject.h:
(RenderSVGModelObject):

LayoutTests: WebKit exposes incorrect bounds for embedded SVG in HTML
https://bugs.webkit.org/show_bug.cgi?id=96168

Reviewed by Eric Seidel.

* accessibility/svg-bounds.html: Added.
* platform/chromium/TestExpectations:
* platform/mac/accessibility/svg-bounds-expected.txt: Added.



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