[Mac] Observe the activeURL property to keep the MiniBrowser URL field up to date
https://bugs.webkit.org/show_bug.cgi?id=125579

Reviewed by Anders Carlsson.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController dealloc]): Stop observing the activeURL property.
(-[WK2BrowserWindowController observeValueForKeyPath:ofObject:change:context:]): When the
activeURL property changes, update the URL field with its value.
(-[WK2BrowserWindowController awakeFromNib]): Start observing the activeURL property.
(-[WK2BrowserWindowController browsingContextControllerDidStartProvisionalLoad:]): Just log.
(-[WK2BrowserWindowController browsingContextControllerDidReceiveServerRedirectForProvisionalLoad:]):
Ditto.
(-[WK2BrowserWindowController browsingContextController:didFailProvisionalLoadWithError:]):
Ditto.
(-[WK2BrowserWindowController browsingContextControllerDidCommitLoad:]): Ditto.
(-[WK2BrowserWindowController browsingContextController:didFailLoadWithError:]): Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add "enable-mediasource" property to WebKitWebSettings
https://bugs.webkit.org/show_bug.cgi?id=125566

Patch by Brendan Long <b.long@cablelabs.com> on 2013-12-11
Reviewed by Philippe Normand.

Source/WebKit/gtk:

* tests/testwebsettings.c:
(test_webkit_web_settings_copy):
* webkit/webkitwebsettings.cpp:
(webkit_web_settings_class_init):
(webkit_web_settings_set_property):
(webkit_web_settings_get_property):
* webkit/webkitwebsettingsprivate.h:
* webkit/webkitwebview.cpp:
(webkit_web_view_update_settings):
(webkit_web_view_settings_notify):

Source/WebKit2:

* UIProcess/API/gtk/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_mediasource):
(webkit_settings_set_enable_mediasource):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
* UIProcess/API/gtk/tests/TestWebKitSettings.cpp:
(testWebKitSettings):

Tools:

* DumpRenderTree/gtk/DumpRenderTree.cpp:
(resetDefaultsToConsistentValues): Turn MediaSource on by default for easier testing.
* DumpRenderTree/gtk/TestRunnerGtk.cpp:
(TestRunner::overridePreference): Allow overriding WebKitMediaSourceEnabled.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Support right-side attachment of the inspector
https://bugs.webkit.org/show_bug.cgi?id=124126

Reviewed by Carlos Garcia Campos.

* UIProcess/API/C/gtk/WKInspectorClientGtk.h: add changed attached width callback.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseAddWebInspector): take attachment side parameter into account when adding the
inspector view.
(webkitWebViewBaseContainerRemove): renamed inspectorViewHeight to inspectorViewSize.
(resizeWebKitWebViewBaseFromAllocation): take attachment side into account when allocating the
sizes for the inspector view and the inspected view.
(webkitWebViewBaseSetInspectorViewSize): renamed from webkitWebViewBaseSetInspectorViewHeight.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/gtk/WebInspectorClientGtk.cpp:
(WebKit::WebInspectorClientGtk::didChangeAttachedWidth): notify client that view width has changed.
* UIProcess/gtk/WebInspectorClientGtk.h:
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformAttach): use attachment side for setting the default size
for the inspector view.
(WebKit::WebInspectorProxy::platformSetAttachedWindowHeight): use the new generic SetInspectorViewSize.
(WebKit::WebInspectorProxy::platformSetAttachedWindowWidth): allow setting the inspector view width.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Improving createOffer and createAnswer LayoutTests
https://bugs.webkit.org/show_bug.cgi?id=125568

Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-12-11
Reviewed by Philippe Normand.

The constraints parameter should be optional in both. Also adding tests to check if we already have a local SDP
when creating an answer.

Source/WebCore:

Existing tests were updated.

* platform/mock/RTCPeerConnectionHandlerMock.cpp:
(WebCore::RTCPeerConnectionHandlerMock::createOffer):

LayoutTests:

* fast/mediastream/RTCPeerConnection-createAnswer-expected.txt:
* fast/mediastream/RTCPeerConnection-createAnswer.html:
* fast/mediastream/RTCPeerConnection-createOffer-expected.txt:
* fast/mediastream/RTCPeerConnection-createOffer.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][WK1] Add an empty BatteryClientGtk
https://bugs.webkit.org/show_bug.cgi?id=115628

Reviewed by Martin Robinson.

Add an empty BatteryClientGtk, implementing the WebCore's BatteryClient interface.
The implementation is left empty intentionally as the WebKit1 port is now in maintenance
mode and there's no desire to support new features under it. It's still required as the
WebCore implementation of the Battery Status API expects an existing BatteryClient, even
if the latter does not set up a provider that would then serve information about the battery
state.

* GNUmakefile.am: Add the BatteryClientGtk source files to the build.
* WebCoreSupport/BatteryClientGtk.cpp: Added.
(WebKit):
(WebKit::BatteryClientGtk::BatteryClientGtk):
(WebKit::BatteryClientGtk::startUpdating):
(WebKit::BatteryClientGtk::stopUpdating):
(WebKit::BatteryClientGtk::batteryControllerDestroyed):
* WebCoreSupport/BatteryClientGtk.h: Added.
(WebKit):
(BatteryClientGtk):
* webkit/webkitwebview.cpp:
(webkit_web_view_init): Set up the BatteryClientGtk for the new WebCore::Page object.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/125562> Remove a Leopard-specific check from WebKit.xcodeproj

Reviewed by Anders Carlsson.

* WebKit.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/125563> Remove the DumpRenderTree Perl Support module

Now that old-run-webkit-tests is not used on OS X it's not worth the time and effort
to build and maintain this custom Perl module.

Reviewed by Anders Carlsson.

* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Remove the target.
* DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport.c: Removed.
* DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportPregenerated.pm: Removed.
* DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport_wrapPregenerated.c: Removed.
* DumpRenderTree/mac/PerlSupport/Makefile: Removed.
* Scripts/old-run-webkit-tests: Update a comment that referred to DumpRenderTreeSupport as a reason to
build DumpRenderTree.
(dumpToolDidCrash): Stop importing and using the module.
* Scripts/webkitpy/port/base.py:
(Port._build_driver): Update a comment in the same manner as in old-run-webkit-tests.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Arithmetic overflow when computing max-height CSS property with subpixel layout
https://bugs.webkit.org/show_bug.cgi?id=119273

Patch by Javier Fernandez <jfernandez@igalia.com> on 2013-12-11
Reviewed by Martin Robinson.

Enabled SATURATED_LAYOUT_ARITHMETIC for the gtk+ port.

.:

* Source/autotools/SetupWebKitFeatures.m4:

LayoutTests:

* platform/gtk/TestExpectations: Removed failure expectation for autoheight-correct-region-for-lines-2.html

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add a UPower-based BatteryProvider
https://bugs.webkit.org/show_bug.cgi?id=115719

Reviewed by Martin Robinson.

Source/Platform: 

* GNUmakefile.am: Add the Source/WebCore/platform/glib directory to the list of directories searched
for header inclusion. Add the upower-glib dependency CFLAGS to the list of libPlatform's CPPFLAGS.

Source/WebCore: 

Introduce the BatteryProviderUPower, a provider of the system's battery status that produces the information
using the upower-glib library.

The BatteryProviderUPower creates a new UPower client when the provider should start emitting updates and hooks
up to device alteration signals. These only fire recalculation of the battery status when a battery device is altered.

When recalculating, every battery device is taken into account, accumulating the energy capacities when both empty
and full, the current rate of energy charging/discharging, and the battery status (whether the device is charging or
discharging). This gives a set of data that covers the overall battery status of the system.

This data is then used to calculate the battery status as perceived by the WebCore implementation. Charging is determined
by examining the integral sign of the current combined energy rate. Charging and discharging times are calculated, when
appropriate, by dividing the chargable/dischargable capacity with the current combined energy rate. The battery level is
calculated by dividing the current energy capacity with the full energy capacity (i.e. the combined capacity of all
the batteries that the system possesses). The status is (indirectly) passed onto BatteryManager by invoking the
updateBatteryStatus method on the client, with the first parameter representing the battery charging/discharging state,
the second parameter representing the time left until the battery is fully charged (when charging) or fully
depleted (when discharging), and the third parameter representing the current battery level.

Whenever the implementation cannot provide any information about the battery status of the system, the client's
updateBatteryStatus method is invoked with the first parameter reporting the unavailability of any information
about the battery status. The other two parameters can be omitted as they default to 0 when not given and are neither
available nor useful in such circumstances. The client should handle such an update by reporting the 'default' battery
status - charging, the battery level being at 1.0 and both the charging and discharging time having the value of
the positive infinity (as per the Battery Status API specification).

The implementation is heavily inspired by a similar approach to calculating battery status in GNOME Settings Daemon.

No new tests - no new functionality. The feature is not yet enabled. When enabled, the relevant tests pass.

* GNUmakefile.list.am: Add the BatteryProviderUPower(Client) build targets.
* platform/glib/BatteryProviderUPower.cpp: Added.
(powerDeviceAlterationCallback):
(BatteryProviderUPower::BatteryProviderUPower):
(BatteryProviderUPower::startUpdating):
(BatteryProviderUPower::stopUpdating):
(BatteryProviderUPower::updateBatteryStatus):
* platform/glib/BatteryProviderUPower.h: Added.
(WebCore):
(BatteryProviderUPower):
* platform/glib/BatteryProviderUPowerClient.h: Added.
(WebCore):
(BatteryProviderUPowerClient):

Source/WebKit/gtk: 

* GNUmakefile.am: Link the libwebkigtk library against the upower-glib library.

Source/WebKit2: 

* GNUmakefile.am: Link the libwebkit2gtk library against the upower-glib library.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][WK2] Add the WebKitBatteryProvider class
https://bugs.webkit.org/show_bug.cgi?id=115720

Reviewed by Martin Robinson.

Source/WebKit2: 

This patch adds the WebKitBatteryProvider class which sets up a BatteryProviderUPower instance,
controlling the provider's activity when instrumented to do so by the WebBatteryManagerProxy
and relaying the battery status updates from the battery provider to the battery manager.

* GNUmakefile.list.am: Add the build targets for the new source files.
* UIProcess/API/gtk/WebKitBatteryProvider.cpp: Added.
(toBatteryProvider): A helper inline method that casts the client info to the battery provider instance.
(startUpdatingCallback): Relays the instruction to the WebKitBattery instance.
(stopUpdatingCallback): Ditto.
(WebKitBatteryProvider::create):
(WebKitBatteryProvider::WebKitBatteryProvider): Set up a WKBatteryProvider and set it to the passed-in battery manager.
(WebKitBatteryProvider::~WebKitBatteryProvider): Force the BatteryProviderUPower to stop updating.
(WebKitBatteryProvider::startUpdating): Relays the instruction to the BatteryProviderUPower instance.
(WebKitBatteryProvider::stopUpdating): Ditto.
(WebKitBatteryProvider::notifyBatteryStatusUnavailable): Update the battery manager with the new status that
has the default values that are to be used when the implementation cannot determine the battery status (as per
the Battery Status API specification).
(WebKitBatteryProvider::notifyBatteryStatusUpdated): Update the battery status.
* UIProcess/API/gtk/WebKitBatteryProvider.h: Added.
(WebKitBatteryProvider): Define the WebKitBatteryProvider reference-counted interface that also inherits from the
BatteryProviderUPowerClient interface.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(_WebKitWebContextPrivate): Add a WebKitBatteryProvider member variable to the struct.
(createDefaultWebContext): Create a new battery provider when initializing the default web context.

Tools: 

* gtk/generate-gtkdoc:
(get_webkit2_options): Ignore the WebKitBatteryProvider source files when generating the documentation.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Enable Battery Status API
https://bugs.webkit.org/show_bug.cgi?id=125453

Reviewed by Martin Robinson.

Tools: 

* Scripts/webkitperl/FeatureList.pm: Enable the Battery Status API feature for the GTK port.

LayoutTests: 

* platform/gtk/TestExpectations: Remove expectations for the Battery Status API layout tests
since all the tests pass now that the feature is enabled.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ATK] Add new layout test to check ATK roles in a central place
https://bugs.webkit.org/show_bug.cgi?id=125525

Reviewed by Chris Fleizach.

New test added, with some skipped tests already present in
platform/mac/accessibility/role-subrole-roledescription.html (this
test is based in that one) as well as some issues specific to ATK
that have been reported in bugs, for traceability.

* platform/gtk/accessibility/roles-exposed-expected.txt: Added.
* platform/gtk/accessibility/roles-exposed.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Avoid double quotations when passing parameters to valgrind in gtk.py
https://bugs.webkit.org/show_bug.cgi?id=125441

Patch by Alejandro G. Castro <alex@igalia.com> on 2013-12-11
Reviewed by Martin Robinson.

Just avoid the double quotations when building the parameter
because some versions of valgrind are not handling it correctly.

* Scripts/webkitpy/port/gtk.py:
(GtkPort.setup_environ_for_server):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove platform specific gunk from WebURLRequest and WebURLResponse
https://bugs.webkit.org/show_bug.cgi?id=125589

Reviewed by Andreas Kling.

* Shared/API/c/WKURLRequest.cpp:
(WKURLRequestCopyURL):
* Shared/API/c/mac/WKURLRequestNS.mm:
(WKURLRequestCopyNSURLRequest):
* Shared/API/c/mac/WKURLResponseNS.mm:
(WKURLResponseCopyNSURLResponse):
* Shared/WebURLRequest.cpp:
* Shared/WebURLRequest.h:
* Shared/WebURLResponse.h:
* Shared/mac/WebURLRequestMac.mm: Removed.
* Shared/mac/WebURLResponseMac.mm: Removed.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::isMainInspectorPage):
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ATK] Expose accessibility objects WAI-ARIA landmark roles
https://bugs.webkit.org/show_bug.cgi?id=125584

Reviewed by Chris Fleizach.

Source/WebCore:

Exposed accessibility objects with landmark roles with the proper
AtkRole, to be provided by the next stable release of ATK.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):
(atkRole):

Tools:

Add mappings to DRT & WKTR for landmark roles.

* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(AccessibilityUIElement::role):
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::role):
* gtk/jhbuild.modules:

LayoutTests:

Update test to unskip landmark elements and update expectations.

* platform/gtk/accessibility/roles-exposed-expected.txt:
* platform/gtk/accessibility/roles-exposed.html:

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