MediaStreamRegistry should store MediaStreams instead of MediaStreamPrivates
https://bugs.webkit.org/show_bug.cgi?id=124860

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-11-25
Reviewed by Eric Carlson.

MediaStreamRegistry::lookup() should return a MediaStream instead of MediaStreamPrivate.

No new tests needed. No behavior changes.

* Modules/mediastream/MediaStreamRegistry.cpp:
(WebCore::MediaStreamRegistry::registerURL): m_privateStreams -> m_mediaStreams
(WebCore::MediaStreamRegistry::unregisterURL): Ditto.
(WebCore::MediaStreamRegistry::lookup): Override URLRegistry::lookup() instead of add a
new method MediaStream::lookupMediaStreamPrivate().
* Modules/mediastream/MediaStreamRegistry.h:
* html/HTMLMediaElement.cpp:
(HTMLMediaElement::loadResource): call lookup() instead of lookupMediaStreamPrivate()

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159767 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] WebKit version in user agent string is incorrect.
https://bugs.webkit.org/show_bug.cgi?id=124454

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-11-25
Reviewed by Brent Fulgham.

Source/WebKit:

Generate WebKitVersion.h file from mac's Version.xcconfig file.

* WebKit.vcxproj/WebKit/WebKit.vcxproj:
* WebKit.vcxproj/WebKit/WebKit.vcxproj.filters:
* WebKit.vcxproj/WebKit/WebKitVersion.cmd: Added.

Source/WebKit/win:

* WebView.cpp: Use WebKit version from WebKitVersion.h in user agent.
(webKitVersionString):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MediaStream] Use std::unique_ptr instead of OwnPtr/PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=124858

Patch by Sergio Correia <sergio.correia@openbossa.org> on 2013-11-25
Reviewed by Eric Carlson.

Another step of the OwnPtr/PassOwnPtr => std::unique_ptr conversion,
now targeting mediastream-related code.

No new tests, covered by existing ones.

* Modules/mediastream/RTCDTMFSender.cpp:
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCDataChannel.cpp:
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCPeerConnection.cpp:
* Modules/mediastream/RTCPeerConnection.h:
* platform/mediastream/MediaStreamSource.cpp:
* platform/mediastream/RTCPeerConnectionHandler.cpp:
* platform/mediastream/RTCPeerConnectionHandler.h:
* platform/mediastream/RTCPeerConnectionHandlerClient.h:
* platform/mock/RTCNotifiersMock.cpp:
* platform/mock/RTCPeerConnectionHandlerMock.cpp:
* platform/mock/RTCPeerConnectionHandlerMock.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Remove some indirection that was only necessary for supporting the legacy Objective-C runtime
https://bugs.webkit.org/show_bug.cgi?id=123065

Reviewed by Sam Weinig.

* UIProcess/API/mac/WKBrowsingContextController.h: Removed _data ivar and
WKBrowsingContextControllerData class declaration.
* UIProcess/API/mac/WKBrowsingContextController.mm:
(-[WKBrowsingContextController dealloc]): Removed
WKBrowsingContextControllerData class and moved ivars directly into
WKBrowsingContextController, declaring them in the @implementation. Removed ivar and
accessors for the delegate properties, letting the compiler synthesize them.
(-[WKBrowsingContextController _pageRef]): Removed indirection via _data.
(-[WKBrowsingContextController loadRequest:userData:]): Removed indirection via -_pageRef.
(-[WKBrowsingContextController loadFileURL:restrictToFilesWithin:userData:]): Ditto.
(-[WKBrowsingContextController loadHTMLString:baseURL:userData:]): Ditto.
(-[WKBrowsingContextController loadData:MIMEType:textEncodingName:baseURL:userData:]): Ditto.
(-[WKBrowsingContextController stopLoading]): Ditto.
(-[WKBrowsingContextController reload]): Ditto.
(-[WKBrowsingContextController reloadFromOrigin]): Ditto.
(-[WKBrowsingContextController goForward]): Ditto.
(-[WKBrowsingContextController canGoForward]): Ditto.
(-[WKBrowsingContextController goBack]): Ditto.
(-[WKBrowsingContextController canGoBack]): Ditto.
(-[WKBrowsingContextController goToBackForwardListItem:]): Ditto.
(-[WKBrowsingContextController backForwardList]): Ditto.
(-[WKBrowsingContextController activeURL]): Ditto.
(-[WKBrowsingContextController provisionalURL]): Ditto.
(-[WKBrowsingContextController committedURL]): Ditto.
(-[WKBrowsingContextController unreachableURL]): Removed idirection via _data.
(-[WKBrowsingContextController estimatedProgress]): Removed indirection via -_pageRef.
(-[WKBrowsingContextController title]): Ditto.
(-[WKBrowsingContextController textZoom]): Ditto.
(-[WKBrowsingContextController setTextZoom:]): Ditto.
(-[WKBrowsingContextController pageZoom]): Ditto.
(-[WKBrowsingContextController setPageZoom:]): Ditto.
(-[WKBrowsingContextController setPaginationMode:]): Ditto.
(-[WKBrowsingContextController paginationMode]): Ditto.
(-[WKBrowsingContextController setPaginationBehavesLikeColumns:]): Ditto.
(-[WKBrowsingContextController paginationBehavesLikeColumns]): Ditto.
(-[WKBrowsingContextController setPageLength:]): Ditto.
(-[WKBrowsingContextController pageLength]): Ditto.
(-[WKBrowsingContextController setGapBetweenPages:]): Ditto.
(-[WKBrowsingContextController gapBetweenPages]): Ditto.
(-[WKBrowsingContextController pageCount]): Ditto.
(-[WKBrowsingContextController handle]): Ditto.
(-[WKBrowsingContextController _initWithPageRef:]): Removed indirection via _data.

* UIProcess/API/mac/WKBrowsingContextGroup.h: Removed _data ivar and
WKBrowsingContextGroupData class declaration.
* UIProcess/API/mac/WKBrowsingContextGroup.mm: Removed WKBrowsingContextGroupData class and
moved _pageGroupRef ivar directly into WKBrowsingContextGroup, declaring it in the
@implementation.
(-[WKBrowsingContextGroup initWithIdentifier:]): Removed indirection via _data.
(-[WKBrowsingContextGroup allowsJavaScript]): Removed indirection via -_pageGroupRef.
(-[WKBrowsingContextGroup setAllowsJavaScript:]): Ditto.
(-[WKBrowsingContextGroup allowsJavaScriptMarkup]): Ditto.
(-[WKBrowsingContextGroup setAllowsJavaScriptMarkup:]): Ditto.
(-[WKBrowsingContextGroup allowsPlugIns]): Ditto.
(-[WKBrowsingContextGroup setAllowsPlugIns:]): Ditto.
(-[WKBrowsingContextGroup addUserStyleSheet:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:mainFrameOnly:]): Ditto.
(-[WKBrowsingContextGroup removeAllUserStyleSheets]): Ditto.
(-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]): Ditto.
(-[WKBrowsingContextGroup removeAllUserScripts]): Ditto.
(-[WKBrowsingContextGroup _pageGroupRef]): Removed indirection via _data.

* UIProcess/API/mac/WKConnection.h: Removed _data ivar and WKConnectionData class declaration.
* UIProcess/API/mac/WKConnection.mm: Removed WKConnectionData class and moved _connectionRef
ivar directly into WKConnection, declaring it in the @implementation. Removed ivar and
accessors for the delegate property, letting the compiler synthesize them.
(-[WKConnection dealloc]): Removed indirection via _data.
(-[WKConnection sendMessageWithName:body:]): Ditto.
(-[WKConnection remoteObjectRegistry]): Ditto.
(didReceiveMessage): Ditto.
(-[WKConnection _initWithConnectionRef:]): Ditto.

* UIProcess/API/mac/WKProcessGroup.h: Replaced forward declaration of WKConnection with an
import. Removed _data ivar and WKProcessGroupData class declaration.
* UIProcess/API/mac/WKProcessGroup.mm: Removed WKProcessGroupData class and moved
_contextRef ivar directly into WKProcessGroup, declaring it in the @implementation. Removed
ivar and accessors for the delegate property, letting the compiler synthesize them.
(-[WKProcessGroup initWithInjectedBundleURL:]): Removed indirection via _data.
(-[WKProcessGroup dealloc]): Ditto.
(-[WKProcessGroup _contextRef]): Ditto.
(-[WKProcessGroup _geolocationProvider]): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159770 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mark URLRegistry's lookup() as const and its child classes as final
https://bugs.webkit.org/show_bug.cgi?id=124865

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-11-25
Reviewed by Eric Carlson.

No new tests needed. No behavior changes.

* Modules/mediasource/MediaSourceRegistry.cpp:
(WebCore::MediaSourceRegistry::lookup): marked as const.
* Modules/mediasource/MediaSourceRegistry.h: MediaSourceRegistry
marked as final.
* Modules/mediastream/MediaStreamRegistry.cpp:
(WebCore::MediaStreamRegistry::lookup): marked as const.
* Modules/mediastream/MediaStreamRegistry.h: MediaStreamRegistry
marked as final.
* fileapi/Blob.cpp:
* html/URLRegistry.h: lookup() marked as const.
(WebCore::URLRegistry::lookup): marked as const.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159771 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] X11Helper::createPixmap doesn't initialise out value handleId
https://bugs.webkit.org/show_bug.cgi?id=124722

Reviewed by Gyuyoung Kim.

The overloaded functions X11Helper::createPixmap don't initialise out
value handleId, and they do early returns on error situations. Since
the functions are void and they don't communicate their failure in any
way, returning an out value without initialising it could make the
error go farther unnoticed. With the variable being initialised, it can
be reliably checked for errors when the function returns.

* platform/graphics/surfaces/glx/X11Helper.cpp:
(WebCore::X11Helper::createPixmap): Initialise handleId to 0.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed the iOS build.

* UIProcess/API/mac/WKBrowsingContextController.mm:
(-[WKBrowsingContextController loadDelegateInternal]):
(-[WKBrowsingContextController setLoadDelegateInternal:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Search functionality in MiniBrowser provides feedback on search fail
https://bugs.webkit.org/show_bug.cgi?id=122681

Patch by Andres Gomez <agomez@igalia.com> on 2013-11-25
Reviewed by Mario Sanchez Prada.

When using the search functionality in MiniBrowser, if the search
fails, the entry background color gets red to report the user
about the failing condition. When the entry is cleaned or the
search is again succesful the background turns back to its
original color.

* MiniBrowser/gtk/BrowserSearchBar.c:
(setFailedStyleForEntry): Added.
(doSearch): Sets the entry's background to its original style if
there is no text to search.
(findControllerFailedToFindTextCallback): Added.
(findControllerFoundTextCallback): Added.
(browser_search_bar_init): Creates and adds a new CSS provider to
the text entry so we can change its style based on the success
condition of the search.
(browserSearchBarFinalize): Frees the new CSS provider.
(browser_search_bar_new): Connects the two new handlers to the
"failed-to-find-text" and "found-text" signals emitted by the
WebKitFindController.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159774 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Use class extensions for IPI
https://bugs.webkit.org/show_bug.cgi?id=124870

Reviewed by Sam Weinig.

* UIProcess/API/mac/WKBrowsingContextController.mm: Reordered methods so that the Private
cateogry isn’t stuck between the API methods and the internal methods.
(-[WKBrowsingContextController setPaginationMode:]):
(-[WKBrowsingContextController paginationMode]):
(-[WKBrowsingContextController setPaginationBehavesLikeColumns:]):
(-[WKBrowsingContextController paginationBehavesLikeColumns]):
(-[WKBrowsingContextController setPageLength:]):
(-[WKBrowsingContextController pageLength]):
(-[WKBrowsingContextController setGapBetweenPages:]):
(-[WKBrowsingContextController gapBetweenPages]):
(-[WKBrowsingContextController pageCount]):
(-[WKBrowsingContextController handle]):
* UIProcess/API/mac/WKBrowsingContextControllerInternal.h: Changed Internal category into
a class extension.

* UIProcess/API/mac/WKConnection.mm:
* UIProcess/API/mac/WKConnectionInternal.h: Changed Internal category into a class
extension.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInInternal.h: Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159775 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Use Config mode of find_package for EFL 1.8
https://bugs.webkit.org/show_bug.cgi?id=124555

Reviewed by Gyuyoung Kim.

.:

EFL 1.8 changed VERSION macro so it's difficult to use tricky approach
which parses header files to know the version. Instead, EFL 1.8 supports
FooConfig.cmake such as EinaConfig.cmake.

This patch tries to use a config mode if it is available.
If config mode is not available with Eo, FindFoo.cmake will be used without
version requirement.

* Source/cmake/FindEo.cmake: Removed.
EoConfig.cmake is only preffered for EFL 1.8.
* Source/cmake/OptionsEfl.cmake:

Tools:

* MiniBrowser/efl/CMakeLists.txt:
Added optional config mode and made version requirement optional.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [CSS Regions] A page with many flows should collapse the resources tree
https://bugs.webkit.org/show_bug.cgi?id=122926

Reviewed by Timothy Hatcher.

Refactored the code in FrameTreeElement._shouldGroupIntoFolders to make it easy to track
more types of resources. Added the content flows as another type of resource that would trigger the
collapsing.

* UserInterface/DOMTreeManager.js:
(WebInspector.DOMTreeManager.prototype.namedFlowRemoved): Added code to remove the content nodes from
a flow that has been removed.
* UserInterface/FrameTreeElement.js:
(WebInspector.FrameTreeElement.prototype._shouldGroupIntoFolders.pushCategory):
(WebInspector.FrameTreeElement.prototype._shouldGroupIntoFolders.pushResourceType):
(WebInspector.FrameTreeElement.prototype._shouldGroupIntoFolders):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] E_DBus should be an optional
https://bugs.webkit.org/show_bug.cgi?id=124881

Reviewed by Gyuyoung Kim.

* Source/cmake/OptionsEfl.cmake:
Checked E_DBus when only ENABLE_BATTERY_STATUS is on.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159778 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Convert some Shape code to use references
https://bugs.webkit.org/show_bug.cgi?id=124876

Reviewed by Andreas Kling.

* inspector/InspectorOverlay.cpp:
* rendering/FloatingObjects.cpp:
* rendering/LayoutState.cpp:
* rendering/RenderBlock.cpp:
* rendering/RenderBlock.h:
* rendering/RenderBlockLineLayout.cpp:
* rendering/RenderBox.cpp:
* rendering/RenderBox.h:
* rendering/line/BreakingContextInlineHeaders.h:
* rendering/line/LineWidth.cpp:
* rendering/shapes/ShapeInfo.cpp:
* rendering/shapes/ShapeInfo.h:
* rendering/shapes/ShapeInsideInfo.cpp:
* rendering/shapes/ShapeInsideInfo.h:
* rendering/shapes/ShapeOutsideInfo.cpp:
* rendering/shapes/ShapeOutsideInfo.h:
Replace yet more pointers with references.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159779 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Allow showing a context menu on all mouse events.
https://bugs.webkit.org/show_bug.cgi?id=124747

Reviewed by Joseph Pecoraro.

Source/WebCore:

Add a new InspectorFrontendHost::dispatchEventAsContextMenuEvent(Event*) method
to let the inspector front-end dispatch a native contextmenu event that will allow
for a context menu to be shown from within a non-contextmenu event handler.

* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
Check that we're dealing with a mouse event, get the frame for the event target
and the event's location to call ContextMenuController::showContextMenuAt()
which will handle the new contextmenu event dispatch to the original event target.

* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:

Source/WebInspectorUI:

Automatically dispatch a contextmenu event in case WebInspector.ContextMenu.prototype.show()
is called outside of a contextmenu event handler and would therefore not show the expected
context menu (except in the Remote Web Inspector where this already works).

* UserInterface/ContextMenu.js:
(WebInspector.ContextMenu.prototype.show):
Check whether the event is a contextmenu event, and if not, add an event listener for a manually
dispatched contextmenu event such that we may then call InspectorFrontendHost.showContextMenu()
in a contextmenu event handler.

(WebInspector.ContextMenu.prototype.handleEvent):
Call InspectorFrontendHost.showContextMenu() now that we received the manually dispatched
contextmenu event.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed ATK gardening

Rebaseline accessibility tests after r159747.

* platform/efl-wk1/accessibility/table-detection-expected.txt:
* platform/efl-wk2/accessibility/table-detection-expected.txt:
* platform/gtk/accessibility/table-detection-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159781 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid unnecessary copy-on-write in FillLayer style application.
<https://webkit.org/b/124878>

We ended up with a lot of cloned StyleBackgroundData objects on
HTML5-8266. This happened because we always forced a copy-on-write
when applying background-image:inherit / background-image:initial.

This patch adds early returns to both functions. In the "inherit"
case, we bail early if the target style already has the same fill
layer data as its parent style.

In the "initial" case, we optimize for the single-FillLayer case
and add an early return if the relevant value is either unset or
equal to the templatized initial value.

2.46 MB progression on HTML5-8266 locally.

Reviewed by Antti Koivisto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Optimize away OR with zero - a common ASM.js pattern.
https://bugs.webkit.org/show_bug.cgi?id=124869

Reviewed by Filip Pizlo.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL gardening

Add test expectations for failing accessibility tests.

* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Updated Brazilian Portuguese translation of WebKitGTK+ - November 02, 2013
https://bugs.webkit.org/show_bug.cgi?id=123694

Patch by Enrico Nicoletto <liverig@gmail.com> on 2013-11-26
Reviewed by Gustavo Noronha.

* pt_BR.po: updated.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unnecessary webaudio include from MediaStreamSource header
https://bugs.webkit.org/show_bug.cgi?id=124897

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-11-26
Reviewed by Eric Carlson.

AudioDestinationConsumer.h is included but not used anywhere in
MediaStreamSource implementation.

* platform/mediastream/MediaStreamSource.h:

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