Merge r170423 - [GTK] Windowed plugins visibility doesn't work
https://bugs.webkit.org/show_bug.cgi?id=131487

Reviewed by Anders Carlsson.

Implement plugins visibility changes and add a new message to
notify the UI process when a windowed plugin is shown/hidden to
show/hide the plugin widget.

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::visibilityDidChange): Add
implementation to notify the plugin about visibility change.
(WebKit::PluginControllerProxy::windowedPluginVisibilityDidChange):
Send WindowedPluginVisibilityDidChange to the plugin proxy.
* PluginProcess/PluginControllerProxy.h:
* PluginProcess/PluginControllerProxy.messages.in: Add VisibilityDidChange message.
* UIProcess/WebPageProxy.h: Add windowedPluginVisibilityDidChange
to handle WindowedPluginVisibilityDidChange message.
* UIProcess/WebPageProxy.messages.in: Add WindowedPluginVisibilityDidChange message.
* UIProcess/efl/WebPageProxyEfl.cpp:
(WebKit::WebPageProxy::windowedPluginVisibilityDidChange):
* UIProcess/gtk/WebPageProxyGtk.cpp:
(WebKit::WebPageProxy::createPluginContainer): Do not show the
plugins by default.
(WebKit::WebPageProxy::windowedPluginVisibilityDidChange): Show or hide the plugin widget.
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::NetscapePlugin): Initialize m_isVisible.
(WebKit::NetscapePlugin::visibilityDidChange): Add visible parameter and save it in m_isVisible
member, calling platformVisibilityDidChange() only when it has actually changed.
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
(WebKit::NetscapePlugin::platformVisibilityDidChange): Notify the controller about visibility change.
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/Plugin.h:
* WebProcess/Plugins/PluginController.h:
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::visibilityDidChange): Send VisibilityDidChange message to the plugin controller proxy.
(WebKit::PluginProxy::windowedPluginVisibilityDidChange): Notify the controller about visibility change.
* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Plugins/PluginProxy.messages.in: Add WindowedPluginVisibilityDidChange message.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::didInitializePlugin): Also call viewVisibilityDidChange() when the plugin is initialized.
(WebKit::PluginView::setParentVisible): Override this Widget method to update the plugin visibility when parent
widget is shown/hidden.
(WebKit::PluginView::viewVisibilityDidChange): Pass visible parameter to visibilityDidChange().
(WebKit::PluginView::windowedPluginVisibilityDidChange): Send WindowedPluginVisibilityDidChange message to the UI process.
* WebProcess/Plugins/PluginView.h:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@170790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r169483 - Tools: [ATK] Added new accessibility signal: text-caret-moved.
Make AccessibilityUIElement.setSelectedTextRange work
as atk_text_set_caret_offset when given offset == 0.
https://bugs.webkit.org/show_bug.cgi?id=132527

Patch by Jarek Czekalski <jarekczek@poczta.onet.pl> on 2014-05-30
Reviewed by Mario Sanchez Prada.

text-caret-moved signal in accessibilityController is needed to
implement tests from Tools/TestWebKitAPI/Tests/WebKitGtk/testatk.c
as LayoutTests. Add the signal to the controller.

* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(setSelectedTextRange): Change return type to bool.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(setSelectedTextRange): Call atk_text_set_caret_offset and return bool.
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
(axObjectEventListener): Add notification name AXTextCaretMoved, allow
for extra arguments passed to handler and use it for text-caret-moved offset.
(WTR::AccessibilityNotificationHandler::connectAccessibilityCallbacks):
Connect callback to new listener for ATK:AtkText:text-caret-moved.
Refactor so that failures be reported.
Initialize atk interfaces before trying to connect to them, see
https://bugzilla.gnome.org/show_bug.cgi?id=729922
(WTR::AccessibilityNotificationHandler::disconnectAccessibilityCallbacks):
Simplify code by using a vector in place of dozen variables.
* DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp:
Comment about not synchronizing with accessibilityController.

LayoutTests: [ATK] Convert caret offset tests from testatk.c.
https://bugs.webkit.org/show_bug.cgi?id=132527

Patch by Jarek Czekalski <jarekczek@poczta.onet.pl> on 2014-05-30
Reviewed by Mario Sanchez Prada.

The tests are replicated from testatk.c file, functions
    testWebkitAtkCaretOffsets()
    testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces()
The file was present in webkit1. Removed from trunk in r166977, so
the last version was
https://trac.webkit.org/browser/trunk/Tools/TestWebKitAPI/Tests/WebKitGtk/testatk.c?rev=166976
What could not be verified in the same way:

1. Whether element implements ATK_TEXT. If setCaretOffset
succeeds, it confirms that element is text as well. But in cases
when setCaretOffset must fail I see no way to confirm it is text
element.

2. Whether position is correct through a call to
atk_text_get_caret_offset.  text-caret-moved signal value is
tested instead.

Anyway these cases don't look crucial, so they are skipped.

* platform/gtk/resources/atk-helpers.js: Added.
(setCaretOffset): Added.
* platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces-expected.txt: Added.
* platform/gtk/accessibility/caret-offsets-and-extraneous-white-spaces.html: Added.
* platform/gtk/accessibility/caret-offsets-expected.txt: Added.
* platform/gtk/accessibility/caret-offsets.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@170791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r169936 - Source/WebCore: [ATK] Fix text inside "span" block in "a" block was not accessible.
https://bugs.webkit.org/show_bug.cgi?id=132349

Patch by Jarek Czekalski <jarekczek@poczta.onet.pl> on 2014-06-13
Reviewed by Mario Sanchez Prada.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp: Add link role
  to the list of roles whose objects always expose atk_text interface.

LayoutTests: [ATK] Add test for accessibility of text inside "span" block in "a" block.
https://bugs.webkit.org/show_bug.cgi?id=132349

Patch by Jarek Czekalski <jarekczek@poczta.onet.pl> on 2014-06-13
Reviewed by Mario Sanchez Prada.

* platform/gtk/accessibility/text-in-span-block-in-a-block-expected.txt: Added.
* platform/gtk/accessibility/text-in-span-block-in-a-block.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@170792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r170359 - Source/WebCore: [ATK] Don't ignore links rendered as blocks.
https://bugs.webkit.org/show_bug.cgi?id=130941

Patch by Jarek Czekalski <jarekczek@poczta.onet.pl> on 2014-06-24
Reviewed by Mario Sanchez Prada.

* /m/usr/src/webkit-trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(WebCore::AccessibilityObject::objectFocusedAndCaretOffsetUnignored): Don't ignore links
when they are renderered with display:block.

LayoutTests: [ATK] Extended the test for accessibility of text inside "span" block in "a" block
with the tests for caret movements in these cases.
https://bugs.webkit.org/show_bug.cgi?id=130941

Patch by Jarek Czekalski <jarekczek@poczta.onet.pl> on 2014-06-24
Reviewed by Mario Sanchez Prada.

* platform/gtk/accessibility/text-in-span-block-in-a-block-expected.txt:
* platform/gtk/accessibility/text-in-span-block-in-a-block.html:
Added testing for text-caret-moved signal. Added one more "a" element to the set.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@170793 268f45cc-cd09-0410-ab3c-d52691b4dbfc