Move fastlog2() to WTF/MathExtras.h so it can be used from multiple projects.

Rubberstamped by Geoff Garen.

Source/WebCore:

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::lruListFor): Remove the inline fastlog2 and use WTF::fastlog2.

Source/WTF:

* wtf/MathExtras.h:
(WTF::fastLog2):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow to retrieve the request data from abstract TextCheckingRequest to be accessible for WK2
https://bugs.webkit.org/show_bug.cgi?id=110208

Reviewed by Hajime Morrita.

Source/WebCore:

The WebCore changes are required to implement asynchronous spell checking in WK2.
The idea of asynchronous spell checking in WK1 is to pass the pointer to the abstract object
to the client who is able to verify the given text and notify the WebCore about results.
WK2 will extract the request data and pass it (with additional information) to the UIProcess.

No new tests, covered by editing/spelling tests.

* editing/Editor.cpp:
(WebCore::Editor::markAndReplaceFor):
Extract the request data as it is the member of 'TextCheckingRequest'.

* editing/SpellChecker.cpp:
(WebCore):
(WebCore::SpellCheckRequest::didCancel):
(WebCore::SpellCheckRequest::setCheckerAndSequence):
(WebCore::SpellChecker::requestCheckingFor):
(WebCore::SpellChecker::enqueueRequest):
(WebCore::SpellChecker::didCheck):
(WebCore::SpellChecker::didCheckSucceed):
* platform/text/TextChecking.h:
(WebCore):
(TextCheckingRequestData):
Introduce a new 'TextCheckingRequestData' class to keep the request data and to
easy extract it from the 'TextCheckingRequest'.

(WebCore::TextCheckingRequestData::TextCheckingRequestData):
(TextCheckingRequest):
(WebCore::TextCheckingRequest::~TextCheckingRequest):

Source/WebKit/blackberry:

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::requestCheckingOfString):
Extract the request data as it is the member of 'TextCheckingRequest'.

Source/WebKit/chromium:

* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::requestCheckingOfString):
Extract the request data as it is the member of 'TextCheckingRequest'.

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::didCheckSucceed):
(WebEditorClient::requestCheckingOfString):
Extract the request data as it is the member of 'TextCheckingRequest'.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add failing test expectations for bugs 110554 and 110555.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderTable::paintBoxDecorations sometimes draws box-shadow twice.
https://bugs.webkit.org/show_bug.cgi?id=110196

Reviewed by Simon Fraser.

Source/WebCore:

When RenderTable::paintBoxDecorations draws box-shadow, paintBackground
should not draw box-shadow. So we have to provide bleedAvoidance
parameter for RenderBox::paintBackground.

Test: fast/css/table-border-radius-with-box-shadow.html

* rendering/RenderTable.cpp:
(WebCore::RenderTable::paintBoxDecorations):
Provide bleedAvoidance, which determineBackgroundBleedAvoidance
returns, for paintBackground.

LayoutTests:

* fast/css/table-border-radius-with-box-shadow-expected.html: Added.
* fast/css/table-border-radius-with-box-shadow.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Expose a list of all reasons that qualify a RenderLayer to be composited
https://bugs.webkit.org/show_bug.cgi?id=110505

Expose the various reasons that can qualify a RenderLayer to be composited
via a new bitmask returned by the reasonForCompositing() method on
RenderLayerCompositor. This method already existed and was used for logging
purposes, but the previous functionality is now accessed via the
logReasonForCompositing() method.

This will allow the the InspectorLayerTreeAgent to provide this information
to the front-end on a per-layer basis as requested by the front-end.

Reviewed by Simon Fraser.

No new tests.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove deep copy of ImageBuffer in tiled SVG backgrounds
https://bugs.webkit.org/show_bug.cgi?id=110549

Reviewed by Dirk Schulze.

SVGImage::drawPatternForContainer creates a temporary ImageBuffer for stamping out tiled
backgrounds. Previously this ImageBuffer was unnecessarily deep-copied! This patch uses a
shallow copy, taking advantage of the fact that the temporary ImageBuffer is never modified.

This patch is covered with existing tests.

* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawPatternForContainer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143692 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r143691.
http://trac.webkit.org/changeset/143691
https://bugs.webkit.org/show_bug.cgi?id=110559

Breaks compilation on mac. (Requested by vsevik on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-21

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore):
(WebCore::RenderLayerCompositor::reasonForCompositing):
* rendering/RenderLayerCompositor.h:
(RenderLayerCompositor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143693 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Implement SharedBuffer version of put() / onSuccess()
https://bugs.webkit.org/show_bug.cgi?id=110398

Reviewed by Tony Chang.

Source/WebCore:

This avoids all unnecessary data copies within the context of
IndexedDB proper, and removes all references to
SerializedScriptValue from the IndexedDB "backend".

No new tests because this is just a refactor.

* bindings/v8/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueBuffer): New version of deserializeIDBValue which takes SharedBuffer.

Source/WebKit/chromium:

Proxy new SharedBuffer calls to WebIDBCallbacks through
to the new SharedBuffer-based IDBCallbacks.

* public/WebIDBCursor.h:
* src/IDBCallbacksProxy.cpp:
(WebKit::IDBCallbacksProxy::onSuccess):
(WebKit::IDBCallbacksProxy::onSuccessWithPrefetch):
* src/IDBCallbacksProxy.h:
(IDBCallbacksProxy):
* src/WebIDBCallbacksImpl.cpp:
(WebKit::WebIDBCallbacksImpl::onSuccess):
* src/WebIDBCallbacksImpl.h:
(WebIDBCallbacksImpl):
* tests/IDBAbortOnCorruptTest.cpp:
(WebCore::MockIDBCallbacks::onSuccess):
(WebCore::MockIDBCallbacks::onSuccessWithPrefetch):
* tests/IDBDatabaseBackendTest.cpp:
* tests/IDBRequestTest.cpp:
(WebKit::TEST_F):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r143664, r143681): http/tests/security/feed-urls-from-remote.html fails
https://bugs.webkit.org/show_bug.cgi?id=110554

Reviewed by Ryosuke Niwa.

Will fix http/tests/security/feed-urls-from-remote.html for Mac WK1.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::isLoading):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Control+Shift+Up/Down selection works backwards
https://bugs.webkit.org/show_bug.cgi?id=110459

Reviewed by Martin Robinson.

* platform/gtk/KeyBindingTranslator.cpp:
(WebCore): The translation table for paragraph selection
commands is backwards, fix it.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] DomSupport: use NodeTraversal APIs
https://bugs.webkit.org/show_bug.cgi?id=110467

Patch by Xan Lopez <xlopez@rim.com> on 2013-02-22
Reviewed by Antonio Gomes.

* WebKitSupport/DOMSupport.cpp:
(BlackBerry::WebKit::DOMSupport::visibleTextQuads):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed tests rebaseline.

* platform/chromium-linux-x86/fast/images/favicon-as-image-expected.png: Added.
* platform/chromium-linux/fast/images/favicon-as-image-expected.png:
* platform/chromium-linux/http/tests/misc/favicon-as-image-expected.png: Added.
* platform/chromium-linux/http/tests/misc/favicon-as-image-expected.txt: Added.
* platform/chromium-linux/platform/chromium/virtual/deferred/fast/images/favicon-as-image-expected.png: Added.
* platform/chromium-mac-lion/fast/images/favicon-as-image-expected.png:
* platform/chromium-mac-lion/fast/images/favicon-as-image-expected.txt: Copied from LayoutTests/platform/chromium-mac/fast/images/favicon-as-image-expected.txt.
* platform/chromium-mac-lion/platform/chromium/virtual/deferred/fast/images/favicon-as-image-expected.png:
* platform/chromium-mac-snowleopard/fast/images/favicon-as-image-expected.png:
* platform/chromium-mac-snowleopard/platform/chromium/virtual/deferred/fast/images/favicon-as-image-expected.png: Added.
* platform/chromium-mac/fast/images/favicon-as-image-expected.png:
* platform/chromium-mac/fast/images/favicon-as-image-expected.txt:
* platform/chromium-mac/platform/chromium/virtual/deferred/fast/images/favicon-as-image-expected.png:
* platform/chromium-mac/platform/chromium/virtual/deferred/fast/images/favicon-as-image-expected.txt: Copied from LayoutTests/platform/chromium-mac/fast/images/favicon-as-image-expected.txt.
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][EFL] Move AC code from EwkView to WebView
https://bugs.webkit.org/show_bug.cgi?id=110216

Reviewed by Anders Carlsson.

Accelerated compositing code is moved from EwkView to WebView.
Added new WKView API to be used from EwkView instead of direct accessing
to coordinated graphics scene.

* UIProcess/API/C/efl/WKView.cpp:
(WKViewSetUserViewportTranslation):
(WKViewUserViewportToContents):
(WKViewPaintToCurrentGLContext):
(WKViewPaintToCairoSurface):
* UIProcess/API/C/efl/WKView.h:

    Added WKView API functions.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::EwkView):
(EwkView::displayTimerFired):
(EwkView::feedTouchEvent):
(EwkView::createGLSurface):
(EwkView::handleEvasObjectCalculate):
(EwkView::handleEwkViewMouseWheel):
(EwkView::handleEwkViewMouseDown):
(EwkView::handleEwkViewMouseUp):
(EwkView::handleEwkViewMouseMove):
* UIProcess/API/efl/EwkView.h:
(EwkView):

    Using new WKView API.

* UIProcess/efl/WebView.cpp:
(WebKit::WebView::initialize):
(WebKit):
(WebKit::WebView::paintToCurrentGLContext):
(WebKit::WebView::paintToCairoSurface):
(WebKit::WebView::userViewportToContents):
(WebKit::WebView::transformFromScene):
(WebKit::WebView::transformToScene):
(WebKit::WebView::coordinatedGraphicsScene):
(WebKit::WebView::enterAcceleratedCompositingMode):
(WebKit::WebView::exitAcceleratedCompositingMode):
* UIProcess/efl/WebView.h:
(WebCore):
(WebKit::WebView::setUserViewportTranslation):
(WebView):

    Added WebView methods to support new WKView API.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][EFL][GTK][Qt] Add context menu item tags for C API
https://bugs.webkit.org/show_bug.cgi?id=109815

Patch by Michał Pakuła vel Rutka <m.pakula@samsung.com> on 2013-02-22
Reviewed by Anders Carlsson.

This patch adds context menu item tags used by EFL, GTK and Qt ports, defined in
WebCore to WK2 C API.

* Shared/API/c/WKContextMenuItemTypes.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
(WebKit::toImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: allow opting out from vertical split in the dock-to-right mode
https://bugs.webkit.org/show_bug.cgi?id=110564

Reviewed by Vsevolod Vlasov.

* English.lproj/localizedStrings.js:
* inspector/front-end/ElementsPanel.js:
(WebInspector.ElementsPanel.prototype._splitVertically):
* inspector/front-end/ScriptsPanel.js:
* inspector/front-end/Settings.js:
(WebInspector.Settings):
* inspector/front-end/SettingsScreen.js:
(WebInspector.GenericSettingsTab):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test fast/loader/stateobjects/state-url-sets-links-visited.html is timing out in chromium
https://bugs.webkit.org/show_bug.cgi?id=110566

Unreviewed test expectation update.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test fast/multicol/newmulticol/positioned-split.html is failing on chromium mac 10.8 since it was added
https://bugs.webkit.org/show_bug.cgi?id=110568

Unreviewed test expectation update.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL][EFL] Support for creating surface with alpha disabled.
https://bugs.webkit.org/show_bug.cgi?id=110067

Patch by Kondapally Kalyan <kalyan.kondapally@intel.com> on 2013-02-22
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Covered by compositing/webgl/webgl-no-alpha.html

We currently always create a surface supporting alpha channel.
With this patch we create the surface with alpha only if
required.

* platform/graphics/efl/GraphicsContext3DPrivate.cpp:
(WebCore::GraphicsContext3DPrivate::initialize):
* platform/graphics/efl/GraphicsContext3DPrivate.h:
(GraphicsContext3DPrivate):
* platform/graphics/opengl/GLPlatformSurface.cpp:
(WebCore::GLPlatformSurface::createOffScreenSurface):
(WebCore::GLPlatformSurface::createTransportSurface):
(WebCore::GLPlatformSurface::GLPlatformSurface):
(WebCore::GLPlatformSurface::attributes):
(WebCore):
* platform/graphics/opengl/GLPlatformSurface.h:
* platform/graphics/surfaces/egl/EGLConfigSelector.cpp:
(WebCore):
(WebCore::EGLConfigSelector::EGLConfigSelector):
(WebCore::EGLConfigSelector::pBufferContextConfig):
(WebCore::EGLConfigSelector::surfaceContextConfig):
* platform/graphics/surfaces/egl/EGLConfigSelector.h:
(EGLConfigSelector):
* platform/graphics/surfaces/egl/EGLSurface.cpp:
(WebCore::EGLWindowTransportSurface::EGLWindowTransportSurface):
* platform/graphics/surfaces/egl/EGLSurface.h:
(EGLWindowTransportSurface):
* platform/graphics/surfaces/glx/GLXConfigSelector.h:
(WebCore):
(WebCore::GLXConfigSelector::GLXConfigSelector):
(WebCore::GLXConfigSelector::pixmapContextConfig):
(WebCore::GLXConfigSelector::surfaceContextConfig):
(WebCore::GLXConfigSelector::surfaceClientConfig):
(WebCore::GLXConfigSelector::validateAttributes):
(WebCore::GLXConfigSelector::findMatchingConfig):
(WebCore::GLXConfigSelector::findMatchingConfigWithVisualId):
(GLXConfigSelector):
* platform/graphics/surfaces/glx/GLXContext.cpp:
(WebCore::GLXOffScreenContext::initialize):
* platform/graphics/surfaces/glx/GLXSurface.cpp:
(WebCore::GLXTransportSurface::GLXTransportSurface):
(WebCore::GLXOffScreenSurface::GLXOffScreenSurface):
(WebCore::GLXOffScreenSurface::initialize):
* platform/graphics/surfaces/glx/GLXSurface.h:
(GLXTransportSurface):
(GLXOffScreenSurface):
* platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:
(WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
(WebCore::GraphicsSurfacePrivate::createPixmap):

LayoutTests:

Enabled compositing/webgl/webgl-no-alpha.html for Efl port.

* platform/efl/TestExpectations:
* platform/efl/compositing/webgl/webgl-no-alpha-expected.png: Added.
* platform/efl/compositing/webgl/webgl-no-alpha-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][EFL] Clean up PageViewportControllerClientEfl class
https://bugs.webkit.org/show_bug.cgi?id=110438

Reviewed by Andreas Kling.

Cleaned up PageViewportControllerClientEfl class from unused methods
and class members, eliminated access to WK2 internals from this class.

* UIProcess/efl/PageViewportControllerClientEfl.cpp:
(WebKit::PageViewportControllerClientEfl::didChangeContentsSize):
* UIProcess/efl/PageViewportControllerClientEfl.h:
(WebKit::PageViewportControllerClientEfl::~PageViewportControllerClientEfl):
(PageViewportControllerClientEfl):
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::WebView):
(WebKit::WebView::updateViewportSize):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update FileReaderLoader to allow specifying a range and reading as a blob.
https://bugs.webkit.org/show_bug.cgi?id=110556

This is part of a series of patches to implement Stream support.  See:
https://bugs.webkit.org/show_bug.cgi?id=110194

Patch by Zach Kuznia <zork@chromium.org> on 2013-02-22
Reviewed by Hajime Morrita.

Tests: will be added when js binding is added.

* fileapi/FileReaderLoader.cpp:
* fileapi/FileReaderLoader.h:

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