Web Inspector: remove extraObjectSize parameter from MemoryClassInfo constructor
https://bugs.webkit.org/show_bug.cgi?id=92981

Reviewed by Alexander Pavlov.

Refactored MemoryInstrumentation to get rid of extraSize parameter from
MemoryObjectInfo constructor and MemoryObjectInfo::reportObjectInfo. The
extra size should always be reported as an object that occupies these extra
bytes.

* dom/ElementAttributeData.cpp:
(WebCore::ElementAttributeData::reportMemoryUsage):
(WebCore):
* dom/ElementAttributeData.h:
(WebCore):
(ElementAttributeData):
* dom/MemoryInstrumentation.h:
(WebCore::MemoryObjectInfo::reportObjectInfo):
(WebCore::MemoryClassInfo::MemoryClassInfo):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] WTR is failing when X server is not running
https://bugs.webkit.org/show_bug.cgi?id=92719

Patch by Alexander Shalamov <alexander.shalamov@intel.com> on 2012-08-02
Reviewed by Hajime Morita.

EFL's WebKitTestRunner doesn't execute tests when X server is not running.
This patch fixes the problem by checking environment variable before ecore x initialization.

* Scripts/webkitpy/layout_tests/port/efl.py:
(EflPort.setup_environ_for_server):
* WebKitTestRunner/efl/main.cpp:
(main):

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

Updating baselines for fast/box-sizing/box-sizing.html after r124347
and fast/forms/basic-selects.html after r124416.

Also fix a bogus TestExpectations entry so fast/css/widget-region-parser.html
is properly skipped.

* platform/gtk/TestExpectations:
* platform/gtk/fast/box-sizing/box-sizing-expected.png:
* platform/gtk/fast/box-sizing/box-sizing-expected.txt: Added.
* platform/gtk/fast/forms/basic-selects-expected.png:
* platform/gtk/fast/forms/basic-selects-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] MSVC specific buildfix for DRT.
https://bugs.webkit.org/show_bug.cgi?id=92978

Patch by Zoltan Arvai <zarvai@inf.u-szeged.hu> on 2012-08-02
Reviewed by Simon Hausmann.

DumpRenderTree/qt subdirectory is missing from generated makefile under MSVC build, need to be added to the pro file.

* DumpRenderTree/qt/DumpRenderTree.pro:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124447 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed, mark accessibility/loading-iframe-updates-axtree.html as crashy on Mac.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] When farstream is not present do not enable MediaStream

Reviewed by Philippe Normand.

When farstream libraries are no present, simply do not build MediaStream
support.

* configure.ac:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124449 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Change return value of battey level
https://bugs.webkit.org/show_bug.cgi?id=92964

Patch by Kihong Kwon <kihong.kwon@samsung.com> on 2012-08-02
Reviewed by Simon Hausmann.

Change return value of navigator.webkitBattery.level from 0~100 to 0~1.0.
Battery level have to returns 0~1.0 by Battery Status API spec.

* platform/efl/BatteryProviderEfl.cpp:
(WebCore::BatteryProviderEfl::setBatteryClient):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: rename host->origin in the inspector protocol DOMStorage entry
https://bugs.webkit.org/show_bug.cgi?id=92979

Patch by Alexei Filippov <alexeif@chromium.org> on 2012-08-02
Reviewed by Yury Semikhatsky.

* inspector/Inspector.json:
* inspector/InspectorDOMStorageResource.cpp:
(WebCore::InspectorDOMStorageResource::bind):
* inspector/front-end/DOMStorage.js:
(WebInspector.DOMStorageDispatcher.prototype.addDOMStorage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: count RenderStyle objects in the native memory profiler
https://bugs.webkit.org/show_bug.cgi?id=91759

Patch by Alexei Filippov <alexeif@chromium.org> on 2012-08-02
Reviewed by Yury Semikhatsky.

Source/WebCore:

The patch adds instrumentation to the following classes:
  - RenderStyle
  - StyleRareInheritedData
  - StyleRareNonInheritedData

* bindings/js/ScriptWrappable.h:
* bindings/v8/ScriptWrappable.h:
* dom/MemoryInstrumentation.h:
(WebCore):
(WebCore::MemoryInstrumentation::OwningTraits::addObject):
(WebCore::MemoryInstrumentation::addInstrumentedObjectImpl):
(WebCore::MemoryInstrumentation::addObjectImpl):
* dom/Node.cpp:
(WebCore::Node::reportMemoryUsage):
* dom/Node.h:
(WebCore):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::reportMemoryUsage):
(WebCore):
* rendering/style/RenderStyle.h:
(WebCore):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::reportMemoryUsage):
(WebCore):
* rendering/style/StyleRareInheritedData.h:
(WebCore):
(StyleRareInheritedData):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::reportMemoryUsage):
(WebCore):
* rendering/style/StyleRareNonInheritedData.h:
(WebCore):
(StyleRareNonInheritedData):

Source/WebKit/chromium:

Add a test for DataRef<T> wrapped member instrumentation.

* tests/MemoryInstrumentationTest.cpp:
(WebCore::InstrumentedRefPtr::create):
(WebCore::TEST):
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Fix protocol version check.
https://bugs.webkit.org/show_bug.cgi?id=91497

Patch by Eugene Klyuchnikov <eustas.big@gmail.com> on 2012-08-02
Reviewed by Pavel Feldman.

Generated method 'supportsInspectorProtocolVersion' should return
false when requested  minor version is *greater* than actual
minor version.

* inspector/generate-inspector-protocol-version: Fixed stub text

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124453 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cairo] Add complex font drawing using HarfbuzzNG
https://bugs.webkit.org/show_bug.cgi?id=91864

Patch by Dominik Röttsches <dominik.rottsches@intel.com> on 2012-08-02
Reviewed by Martin Robinson.

Source/WebCore:

Unfortunately the Freetype based approach that avoids allocations and UTF8 conversion
fails to produce correct results for some tests.

No new tests, at least
  fast/dom/52776.html
  fast/text/atsui-negative-spacing-features.html
  fast/text/atsui-spacing-features.html
expose this problem.

* platform/graphics/harfbuzz/ng/HarfBuzzNGFaceCairo.cpp:
(WebCore::harfbuzzGetGlyph): Revert to initial cairo_scaled_font based approach.

LayoutTests:

Unskipping tests, now passing with valid complex font results.

* platform/efl/TestExpectations:
* platform/efl/fast/text/atsui-pointtooffset-calls-cg-expected.txt:
* platform/efl/fast/text/international/text-spliced-font-expected.png: Added.
* platform/efl/fast/text/international/text-spliced-font-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124454 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] Click, mouse and links rely on touch mocking.
https://bugs.webkit.org/show_bug.cgi?id=83091

Reviewed by Simon Hausmann.

Send the incoming mouse events directly to the gesture recognizers to make
the WebView behave consistent with other Flickables.
This patch unifies the code paths for input events and makes it possible
to enable mouse events on the flickable web view again, thus makes the
mobile-version of QQuickWebView usable on desktop.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::handleMouseEvent):
(QQuickWebViewFlickablePrivate::QQuickWebViewFlickablePrivate):
(QQuickWebViewFlickablePrivate::handleMouseEvent):
(QQuickWebView::mousePressEvent):
(QQuickWebView::mouseMoveEvent):
(QQuickWebView::mouseReleaseEvent):
(QQuickWebView::mouseDoubleClickEvent):
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):
(QQuickWebViewFlickablePrivate):
* UIProcess/qt/QtPanGestureRecognizer.cpp:
(WebKit::QtPanGestureRecognizer::update):
* UIProcess/qt/QtWebPageEventHandler.cpp:
(WebKit::QtWebPageEventHandler::QtWebPageEventHandler):
(WebKit::QtWebPageEventHandler::handleInputEvent):
(WebKit):
(WebKit::QtWebPageEventHandler::doneWithTouchEvent):
* UIProcess/qt/QtWebPageEventHandler.h:
(QtWebPageEventHandler):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124455 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] No main resource in WebView on load committed when page has been loaded from history cache
https://bugs.webkit.org/show_bug.cgi?id=91482

Reviewed by Martin Robinson.

We assume that on load committed, we already have a main resource
in the web view, and it has already received a response. This is
not true for pages loaded from the history cache, so when going
back/forward, we don't have a main resource when the
load-committed signal is emitted. We must ensure that the loading
process documented in the API is the same for pages loaded from
the history cache too.

* UIProcess/API/gtk/WebKitLoaderClient.cpp:
(didCommitLoadForFrame): Call webkitWebViewLoadChanged() and let
the web view handle the certificate.
* UIProcess/API/gtk/WebKitWebResource.cpp:
(webkitWebResourceGetFrame): Helper private function to easily get
the WKFrame associated with a WebResource.
* UIProcess/API/gtk/WebKitWebResourcePrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewDisconnectMainResourceResponseChangedSignalHandler):
Disconnect the notify::response signal of the main resource.
(webkitWebViewFinalize): Call
webkitWebViewDisconnectMainResourceResponseChangedSignalHandler().
(setCertificateToMainResource): Set the TLS certificate on the
response of the main resource.
(webkitWebViewEmitLoadChanged): Helper function to emit
load-chancged signal.
(webkitWebViewEmitDelayedLoadEvents): If we were waiting for the
main resource, emit the signals that were delayed.
(webkitWebViewLoadChanged): Do not emit committed or finished if
we are still waiting for the main resource. Set the TLS
certificate if we already have a main resource or wait until we
have the main resource with a response.
(mainResourceResponseChangedCallback): Emitted when the main
resource received the response. Set the certificate on the
response and emit load signals delayed.
(waitForMainResourceResponseIfWaitingForResource): If we are
waiting for the main resource, connect to the notify::response
signal of the WebResource to make sure it has a response already
when load signal delayed are emitted.
(webkitWebViewResourceLoadStarted): Call
waitForMainResourceResponseIfWaitingForResource().
* UIProcess/API/gtk/tests/LoadTrackingTest.cpp:
(loadChangedCallback):
(LoadTrackingTest::goBack):
(LoadTrackingTest::goForward):
* UIProcess/API/gtk/tests/LoadTrackingTest.h:
(LoadTrackingTest):
* UIProcess/API/gtk/tests/TestLoaderClient.cpp:
(testWebViewHistoryLoad):
(serverCallback):
(beforeAll):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124456 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Toggle the type of ant compile for webkit_unit_tests and TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=92858

Reviewed by Adam Barth.

Now that the sdk_build variable is available, we can remove these two differences
as well. This goes together with Adam's bug 90920.

After this patch, the whole Tools/ directory will be unforked :-).

Source/WebKit/chromium:

* WebKitUnitTests.gyp:

Tools:

* TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Move DOM breakpoints-related context menu items into a submenu
https://bugs.webkit.org/show_bug.cgi?id=92989

Reviewed by Vsevolod Vlasov.

A "Break on..." submenu is added to the element context menu, to host all DOM breakpoint items.

* English.lproj/localizedStrings.js:
* inspector/front-end/DOMBreakpointsSidebarPane.js:
(WebInspector.DOMBreakpointsSidebarPane):
(WebInspector.DOMBreakpointsSidebarPane.prototype.populateNodeContextMenu):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move number localization code in LocaleICU.cpp to new class
https://bugs.webkit.org/show_bug.cgi?id=92976

Reviewed by Kentaro Hara.

The number localization code by character mapping is usefull for non-ICU
platforms.

No new tests. This is just a refactoring, and is covered by
Source/WebKit/chromium/tests/LocalizedNumberICUTest.cpp.

* WebCore.gypi: Add NumberLocalizer.{cpp,h}.
* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::decimalSymbol):
Renamed from setDecimalSymbol. This function returns the resultant
string instead of setting it to a data member.
(WebCore::LocaleICU::decimalTextAttribute):
Renamed from setDecimalTextAttributel. This function returns the
resultant string instead of setting it to the specified string.
(WebCore::LocaleICU::initializeNumberLocalizerData):
Renamed from initializeDecimalFormat.
Calls NumberLocaizer::setNumberLocalizerData.
(WebCore::LocaleICU::localizedDecimalSeparator):
Rename initializeDecimalFormat to initializeNumberLocalizerData.
* platform/text/LocaleICU.h:
(LocaleICU): Remove some members, and inherit NumberLocalizer.
* platform/text/NumberLocalizer.cpp: Added. Move the code from LocaleICU.cpp
(WebCore):
(WebCore::NumberLocalizer::~NumberLocalizer):
(WebCore::NumberLocalizer::setNumberLocalizerData): Added.
(WebCore::NumberLocalizer::convertToLocalizedNumber):
(WebCore::matches):
(WebCore::NumberLocalizer::detectSignAndGetDigitRange):
(WebCore::NumberLocalizer::matchedDecimalSymbolIndex):
(WebCore::NumberLocalizer::convertFromLocalizedNumber):
(WebCore::NumberLocalizer::localizedDecimalSeparator):
* platform/text/NumberLocalizer.h: Added.
(NumberLocalizer):
(WebCore::NumberLocalizer::NumberLocalizer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaStream API: Add RTCPeerConnectionHandler infrastructure
https://bugs.webkit.org/show_bug.cgi?id=92866

Reviewed by Adam Barth.

Introducing RTCPeerConnectionHandler & RTCPeerConnectionHandlerClient,
together with the Chromium WebKit interface, following the pattern of
the previous PeerConnection00Handler but with the optimizations from MediaStreamCenter.

Source/Platform:

* Platform.gypi:
* chromium/public/Platform.h:
(WebKit):
(Platform):
(WebKit::Platform::createRTCPeerConnectionHandler):
* chromium/public/WebRTCPeerConnectionHandler.h: Added.
(WebKit):
(WebRTCPeerConnectionHandler):
(WebKit::WebRTCPeerConnectionHandler::~WebRTCPeerConnectionHandler):
* chromium/public/WebRTCPeerConnectionHandlerClient.h: Added.
(WebKit):
(WebRTCPeerConnectionHandlerClient):
(WebKit::WebRTCPeerConnectionHandlerClient::~WebRTCPeerConnectionHandlerClient):

Source/WebCore:

Not yet testable due to not enough code landed.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
(WebCore::RTCPeerConnection::RTCPeerConnection):
* Modules/mediastream/RTCPeerConnection.h:
(RTCPeerConnection):
* WebCore.gypi:
* platform/mediastream/RTCPeerConnectionHandler.cpp: Added.
(WebCore):
(RTCPeerConnectionHandlerDummy):
(WebCore::RTCPeerConnectionHandler::create):
(WebCore::RTCPeerConnectionHandlerDummy::RTCPeerConnectionHandlerDummy):
(WebCore::RTCPeerConnectionHandlerDummy::~RTCPeerConnectionHandlerDummy):
(WebCore::RTCPeerConnectionHandlerDummy::initialize):
* platform/mediastream/RTCPeerConnectionHandler.h: Copied from Source/WebCore/Modules/mediastream/RTCPeerConnection.h.
(WebCore):
(RTCPeerConnectionHandler):
(WebCore::RTCPeerConnectionHandler::~RTCPeerConnectionHandler):
(WebCore::RTCPeerConnectionHandler::RTCPeerConnectionHandler):
* platform/mediastream/RTCPeerConnectionHandlerClient.h: Copied from Source/WebCore/Modules/mediastream/RTCPeerConnection.h.
(WebCore):
(RTCPeerConnectionHandlerClient):
(WebCore::RTCPeerConnectionHandlerClient::~RTCPeerConnectionHandlerClient):
* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp: Added.
(WebCore):
(WebCore::RTCPeerConnectionHandler::create):
(WebCore::RTCPeerConnectionHandlerChromium::RTCPeerConnectionHandlerChromium):
(WebCore::RTCPeerConnectionHandlerChromium::~RTCPeerConnectionHandlerChromium):
(WebCore::RTCPeerConnectionHandlerChromium::initialize):
* platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h: Added.
(WebCore):
(RTCPeerConnectionHandlerChromium):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2]Add ewk_view_ui_client.
https://bugs.webkit.org/show_bug.cgi?id=89864

Patch by Hyerim Bae <hyerim.bae@samsung.com> on 2012-08-02
Reviewed by Kentaro Hara.

Add ewk_view_ui_client.h / cpp files for wrapping WKPageSetPageUIClient,
add close, createNewPage callback member to WKPageSetPageUIClient.

* PlatformEfl.cmake:
* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_base_add):
(ewk_view_page_close):
(ewk_view_page_create):
* UIProcess/API/efl/ewk_view.h:
* UIProcess/API/efl/ewk_view_private.h:
* UIProcess/API/efl/ewk_view_ui_client.cpp: Added.
(toEwkView):
(closePage):
(createNewPage):
(ewk_view_ui_client_attach):
* UIProcess/API/efl/ewk_view_ui_client_private.h: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix axis locking when panning on N9
https://bugs.webkit.org/show_bug.cgi?id=92394

Patch by Lauro Neto <lauro.neto@openbossa.org> on 2012-08-02
Reviewed by Simon Hausmann.

Make the QQuickWebView axis locker calculate the
time between events using QInputEvent.timestamp, which
is set from the native event when available.

Also use touchPoint.pos() instead of screenPos() to
correct the axis detection when running on N9, which
has a native landscape display and the applications usually
run in portrait mode.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::FlickableAxisLocker::FlickableAxisLocker):
(QQuickWebViewPrivate::FlickableAxisLocker::touchVelocity):
(QQuickWebViewPrivate::FlickableAxisLocker::update):
* UIProcess/API/qt/qquickwebview_p_p.h:
(FlickableAxisLocker):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Inline stylesheets can confuse style sharing
https://bugs.webkit.org/show_bug.cgi?id=92970

Reviewed by Dan Bernstein.

Source/WebCore: 

Consider document 
        
<div class="i30"></div>
<style>.i30 { background-color:green; }</style>
<div class="i30"></div>
        
When processing the <style> element the scope optimization marks the first div as needing style recalc. 
Next the parser adds the second div to the tree and immediately calculates its style. Since it looks exactly 
like the first div the style sharing optimization copies the style from there. The pending recalc of the
first div is resolved by a timer but the second div is left with the old style.
        
Fix by disallowing style sharing from elements with pending style recalc.

Test: fast/css/style-sharing-inline-stylesheet.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithElement):

LayoutTests: 

* fast/css/style-sharing-inline-stylesheet-expected.txt: Added.
* fast/css/style-sharing-inline-stylesheet.html: Added.



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