[EFL] Refactor ewk_view_context_paint code.
https://bugs.webkit.org/show_bug.cgi?id=85588

Patch by Tomasz Morawski <t.morawski@samsung.com> on 2012-06-04
Reviewed by Hajime Morita.

Source/WebKit:

Added new ewk_paint_context.cpp file to source list.

* PlatformEfl.cmake:

Source/WebKit/efl:

The main purpose of this change is reduce size of ewk_view.h/cpp files and make use of ewk_view_context_paint
object by ewk_view_single and ewk_view_tiled instead of direct operations on cairo.
The code is more objective and looks very simple now.
Remove ewk_view_context_paint code from ewk_view h/cpp file and move it to separate new ewk_context_paint file.
The ewk_view_context_paint has been renamed to ewk_context_paint and it is not binded to view on creation time.

* ewk/ewk_paint_context.cpp: Added.
Functions renamed and moved from ewk_view to ewk_paint_context file.
(ewk_paint_context_new):
(ewk_paint_context_from_image_new): New function.
(ewk_paint_context_from_image_data_new): New function.
(ewk_paint_context_free):
(ewk_paint_context_save):
(ewk_paint_context_restore):
(ewk_paint_context_clip):
(ewk_paint_context_scale):
(ewk_paint_context_translate):
(ewk_paint_context_paint): Added FrameView parameter.
(ewk_paint_context_paint_contents): Added FrameView parameter.
* ewk/ewk_paint_context_private.h: Added.
(_Ewk_Paint_Context):
* ewk/ewk_private.h: Functions ewk_view_paint and ewk_view_paint_contents moved from ewk_view.h.
* ewk/ewk_tiled_backing_store.h: Removed unused include.
* ewk/ewk_view.cpp: Moved all function releated to paint context object to new ewk_paint_context file.
(_Ewk_View_Private_Data):
(ewk_view_paint): Changed function according change in ewk_paint_context_paint function.
(ewk_view_paint_contents): Changed function according change in ewk_paint_context_paint_contents function.
* ewk/ewk_view.h: Removed all paint context functions and ewk_view_paint, ewk_view_paint_contents function from
public API.
* ewk/ewk_view_single.cpp:
(_ewk_view_single_smart_repaints_process):
Refactor of _ewk_view_single_smart_repaints_process function.
Removed goto statements.
Removed variables declaration from function beginning.
* ewk/ewk_view_tiled.cpp:
(_ewk_view_tiled_render_cb): Make use of ewk_paint_context object instead of direction operation on cairo.
Looks simpler and more objective.

Tools:

* DumpRenderTree/efl/CMakeLists.txt: Added include directory.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use SelectorQuery in Element::webkitMatchesSelector()
https://bugs.webkit.org/show_bug.cgi?id=88209

Reviewed by Antti Koivisto.

By using SelectorQuery in Element::webkitMatchesSelector(),
we can not only simplify the code but also improve the performance
thanks to the cache mechanism of SelectorQuery which was implemented
in bug 87942.

Tests: fast/dom/SelectorAPI/*. No change in test results.

* dom/Element.cpp:
(WebCore::Element::webkitMatchesSelector):
* dom/SelectorQuery.cpp:
(WebCore::SelectorQuery::matches):
(WebCore):
* dom/SelectorQuery.h:
(SelectorQuery):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Remove geoclue dependency from WebKit API Layer
https://bugs.webkit.org/show_bug.cgi?id=87801

Reviewed by Martin Robinson.

Make GeolocationClient for WebKitGTK+ use the new Geoclue-based
geolocation provider available in WebCore.

* WebCoreSupport/GeolocationClientGtk.cpp:
(WebKit):
(WebKit::GeolocationClient::GeolocationClient):
(WebKit::GeolocationClient::startUpdating):
(WebKit::GeolocationClient::stopUpdating):
(WebKit::GeolocationClient::setEnableHighAccuracy):
(WebKit::GeolocationClient::notifyPositionChanged):
(WebKit::GeolocationClient::notifyErrorOccurred):
* WebCoreSupport/GeolocationClientGtk.h:
(GeolocationClient):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Reset "WebKitTabToLinksPreferenceKey" in DumpRenderTreeChrome::resetDefaultsToConsistentValues
https://bugs.webkit.org/show_bug.cgi?id=87668

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-06-04
Reviewed by Ryosuke Niwa.

Tools:

Layout test controller "WebKitTabToLinksPreferenceKey" setting should be reset to false
otherwise LayoutTests/fast/html/tab-order.html is failing as it has a link inside the test description which might
be included in focus chain (if "WebKitTabToLinksPreferenceKey" setting is set to true).

* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):

LayoutTests:

* platform/efl/Skipped: Unskipped fast/html/tab-order.html.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119377 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in WebCore::RenderView::getRetainedWidgets
https://bugs.webkit.org/show_bug.cgi?id=88217

Reviewed by Kenneth Rohde Christiansen.
        
There is no known repro, the crash has been seen on the field. It is likely that it happens with frame
flattening enabled only.

Null check root renderer in performPostLayoutTasks. The root can legitimely be null for several reasons and
is mostly null checked everywhere else.

* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r117929) [Forms] input type=number thinks 0 is not a number
https://bugs.webkit.org/show_bug.cgi?id=88208

Reviewed by Kent Tamura.

Source/WebCore:

This patch fixes invalid handling of return value of parseToDoubleForNumberType
in NumberInputType::isAcceptableValue to use isfinite() function for checking
whether specified string is valid number or not. Before r117929, return value
of parseToDoubleForNumberType was bool, but after r117929, it is double.

Test: fast/forms/number/input-number-from-renderer.html

* html/NumberInputType.cpp:
(WebCore::NumberInputType::isAcceptableValue): Use isfinite()

LayoutTests:

This patch introduced function checkIt() for code sharing and added
more test cases to input-number-commit-valid-only.htm

* fast/forms/number/input-number-commit-valid-only-expected.txt: Changed for additional tests.
* fast/forms/number/input-number-commit-valid-only.html: Changed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adding explicit console error for duplicated CSP directives.
https://bugs.webkit.org/show_bug.cgi?id=88193

Source/WebCore:

This patch adds an explicit error message for duplicated CSP
directives instead of reusing the "unrecognized directive" error.

Patch by Mike West <mkwst@chromium.org> on 2012-06-04
Reviewed by Adam Barth.

Test: http/tests/security/contentSecurityPolicy/duplicate-directive.html

* page/ContentSecurityPolicy.cpp:
(CSPDirectiveList):
(WebCore::CSPDirectiveList::logDuplicateDirective):
(WebCore):
(WebCore::CSPDirectiveList::parseReportURI):
(WebCore::CSPDirectiveList::setCSPDirective):
(WebCore::CSPDirectiveList::applySandboxPolicy):
(WebCore::CSPDirectiveList::addDirective):

LayoutTests:

Patch by Mike West <mkwst@chromium.org> on 2012-06-04
Reviewed by Adam Barth.

* http/tests/security/contentSecurityPolicy/duplicate-directive-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/duplicate-directive.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Don't use WebKit HAVE() macro in public Qt headers

Reviewed by Kenneth Rohde Christiansen.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Update NEWS and configure.ac for 1.9.3 release

.:

* configure.ac: Bump version number.

Source/WebKit/gtk:

* NEWS: Added release notes for 1.9.3.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Qt DRT / WTR should be able to load external resources
https://bugs.webkit.org/show_bug.cgi?id=87326

Reviewed by Ryosuke Niwa.

Allow external resources to be loaded when the main frame's URL is also an external resource.
This change is analogous to r118231 for Mac port and to r119153 Chromium port.

* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::blockRequest):
(WebCore):
(WebCore::isLocalhost):
(WebCore::hostIsUsedBySomeTestsToGenerateError):
(WebCore::FrameLoaderClientQt::dispatchWillSendRequest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] Refactor the tap gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=88096

Reviewed by Simon Hausmann.

Refactor the tap gesture recognizer so that its internal state machine is
self contained and independent of input event types.
Also change the internal API for tap highlighting to make the code easier
to understand on the caller side.

This patch makes the tap gesture recognizer more robust, consistent with
other gesture recognizers and fixes some issues related to highlighting
and link activation with respect to native touch events.

* UIProcess/qt/QtTapGestureRecognizer.cpp:
(WebKit::QtTapGestureRecognizer::QtTapGestureRecognizer):
(WebKit::QtTapGestureRecognizer::withinDistance):
(WebKit::QtTapGestureRecognizer::update):
(WebKit::QtTapGestureRecognizer::finish):
(WebKit::QtTapGestureRecognizer::cancel):
(WebKit::QtTapGestureRecognizer::highlightTimeout):
(WebKit::QtTapGestureRecognizer::singleTapTimeout):
(WebKit::QtTapGestureRecognizer::tapAndHoldTimeout):
(WebKit::QtTapGestureRecognizer::reset):
* UIProcess/qt/QtTapGestureRecognizer.h:
(QtTapGestureRecognizer):
* UIProcess/qt/QtWebPageEventHandler.cpp:
(WebKit::QtWebPageEventHandler::QtWebPageEventHandler):
(WebKit::QtWebPageEventHandler::activateTapHighlight):
(WebKit::QtWebPageEventHandler::deactivateTapHighlight):
(WebKit):
(WebKit::QtWebPageEventHandler::handleSingleTapEvent):
(WebKit::QtWebPageEventHandler::handleDoubleTapEvent):
(WebKit::QtWebPageEventHandler::doneWithTouchEvent):
* UIProcess/qt/QtWebPageEventHandler.h:
(QtWebPageEventHandler):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: add unknown size to the memory pie-chart legend
https://bugs.webkit.org/show_bug.cgi?id=88081

Patch by Yury Semikhatsky <yurys@chromium.org> on 2012-06-04
Reviewed by Pavel Feldman.

Added "Unknown" part size to the memory pie-chart legend.

* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.NativeMemoryProfileType.prototype.buttonClicked.didReceiveMemorySnapshot):
(WebInspector.NativeMemoryProfileType.prototype.buttonClicked):
(WebInspector.MemoryBlockViewProperties._initialize):
(WebInspector.NativeMemoryPieChart.prototype._paint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r119384.
http://trac.webkit.org/changeset/119384
https://bugs.webkit.org/show_bug.cgi?id=88227

Need to update some tests, I'll roll in later. (Requested by
Zoltan on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-06-04

* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::dispatchWillSendRequest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Disable heap profiler test on mac platform.

* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: speed up _calculateRetainedSizes function
https://bugs.webkit.org/show_bug.cgi?id=87863

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

PerformanceTests:

* inspector/heap-snapshot-advanced.html: Added.
* inspector/heap-snapshot-performance-test.js: Copied from PerformanceTests/inspector/heap-snapshot.html.
(test.performanceTest.step0):
(test.performanceTest.step1):
(test.performanceTest.step2):
(test.performanceTest.cleanup):
(test.performanceTest.done):
(test.performanceTest):
(test):
* inspector/heap-snapshot.html:

Source/WebCore:

* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshot.prototype._calculateRetainedSizes):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Tap-to-zoom overshoot animation.
https://bugs.webkit.org/show_bug.cgi?id=87108

Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-06-04
Reviewed by Tor Arne Vestbø.

Reverts the change in animation, so the default is more "neutral".
This should be made configurable later.

* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::QtViewportInteractionEngine::animatePageItemRectVisible):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix assert in non-scaling strokes in patterns
https://bugs.webkit.org/show_bug.cgi?id=88198

Source/WebCore:

When calculating the CTM for a rect or path in a pattern we need to use
an SVGPatternElement's local transform. Pattern did not expose the transform
because it does not extend from from SVGStyledLocatable or SVGStyledTransformable.
This patch exposes the pattern's transform in localCoordinateSpaceTransform.

SVGGradientElement does not need this special handling because the children
of a gradient element are restricted to not include shape and structural elements
that would need to calculate a CTM.

Before this patch the added test would assert.
This patch is a prerequisite to a major refactoring of RenderSVGShape &
friends, and the test will be unskipped in a followup patch.

Reviewed by Dirk Schulze.

Tests: svg/stroke/non-scaling-stroke-pattern-expected.svg
       svg/stroke/non-scaling-stroke-pattern.svg

* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::localCoordinateSpaceTransform):
(WebCore):
* svg/SVGPatternElement.h:
(SVGPatternElement):
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::localCoordinateSpaceTransform):

LayoutTests:

Reviewed by Dirk Schulze.

* platform/chromium/TestExpectations:
* platform/mac/TestExpectations:
* svg/stroke/non-scaling-stroke-pattern-expected.svg: Added.
* svg/stroke/non-scaling-stroke-pattern.svg: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cairo] Implementation of GraphicsContext does not save/restore ImageInterpolation correctly
https://bugs.webkit.org/show_bug.cgi?id=87985

Patch by Dominik Röttsches <dominik.rottsches@intel.com> on 2012-06-04
Reviewed by Gustavo Noronha Silva.

Source/WebCore:

Moving image interpolation quality setting into state so that it's saved and restored.

Covered by existing test fast/canvas/canvas-imageSmoothingEnabled.html which is now passing.

* platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
(GraphicsContextPlatformPrivate): Removing stale member that was never used.
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::State::State):
(PlatformContextCairo::State):
(WebCore::PlatformContextCairo::PlatformContextCairo):
(WebCore::PlatformContextCairo::drawSurfaceToContext):
(WebCore::PlatformContextCairo::setImageInterpolationQuality):
(WebCore):
(WebCore::PlatformContextCairo::imageInterpolationQuality):
* platform/graphics/cairo/PlatformContextCairo.h:
(PlatformContextCairo): Moving implementations for image interpolation quality setter into implementation file.

LayoutTests:

Unskipping fast/canvas/canvas-imageSmoothingEnabled.html now that it passes.

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Canvas 2D - Source rectangles that overlap the source image boundary, not supported by drawImage
https://bugs.webkit.org/show_bug.cgi?id=66574

Patch by Justin Novosad <junov@chromium.org> on 2012-06-04
Reviewed by Stephen White.

Source/WebCore:

Test: fast/canvas/drawImage-clipped-source.html

When the source rectangle argument to drawImage is not entirely
contatained by the domain of the source image, the source rectangle
is clipped, and the destination rectangle is clipped proportionately
Old behavior was to silently fail, which did not comply with the spec.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::normalizeAndClipRects):
(WebCore):
(WebCore::CanvasRenderingContext2D::drawImage):

LayoutTests:

Adding a new layout test that verifies that the source and destination
rectangle arguments to drawImage are properly clipped when the source
rectangle is not entirely contained whithin the domian of the source
image. Tests image to canvas draws and canvas to canvas draws.

* fast/canvas/drawImage-clipped-source-expected.txt: Added.
* fast/canvas/drawImage-clipped-source.html: Added.
* fast/canvas/drawImage-clipped-source.js: Added.
(patternTest.this.testPixel):
(patternTest.this.testRedSquare):
(patternTest.this.testAggregatePattern):
(patternTest):
(drawTestPattern):
(executeTest):

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