Move snapRubberBand to ScrollElasticityController
https://bugs.webkit.org/show_bug.cgi?id=76200

Reviewed by Andreas Kling.

* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::smoothScrollWithEvent):
(WebCore::ScrollAnimatorMac::endScrollGesture):
* platform/mac/ScrollElasticityController.h:
* platform/mac/ScrollElasticityController.mm:
(systemUptime):
(WebCore::ScrollElasticityController::snapRubberBand):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104846 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add allowsHorizontalStretching and allowsVerticalStretching to ScrollElasticityControllerClient
https://bugs.webkit.org/show_bug.cgi?id=76202

Reviewed by Andreas Kling.

* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::allowsVerticalStretching):
(WebCore::ScrollAnimatorMac::allowsHorizontalStretching):
(WebCore::ScrollAnimatorMac::smoothScrollWithEvent):
* platform/mac/ScrollElasticityController.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Re-enable Skia feColorMatrix filter implementation.
https://bugs.webkit.org/show_bug.cgi?id=76186

Source/WebCore:

This code was landed in http://trac.webkit.org/changeset/104566 and
partially reverted in http://trac.webkit.org/changeset/104632 due
to problems with the Windows Shared builder.  Those problems have
been fixed in r3006, since rolled into Chrome.

Reviewed by Kenneth Russell.

Covered by SVG feColorMatrix tests.

* WebCore.gypi:
* platform/graphics/filters/FEColorMatrix.h:

LayoutTests:

Remove suppressions for tests which now pass.

Reviewed by Kenneth Russell.

* platform/chromium/test_expectations.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104848 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make all calls to pinnedInDirection go through the ScrollElasticityController
https://bugs.webkit.org/show_bug.cgi?id=76204

Reviewed by Andreas Kling.

* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::smoothScrollWithEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] [WebKit2] WebKitURIRequest and WebKitURIResponse should wrap the corresponding WebCore classes
https://bugs.webkit.org/show_bug.cgi?id=74478

Reviewed by Gustavo Noronha Silva.

Have WebKitURIRequest wrap a ResourceRquesst and WebKitURIResponse wrap a ResourceResponse.
They are the WebCore types they are meant to represent and we will need to expose more
information from them in the future to make them useful. Later we can have ResourceResponse
generate a SoupMessage lazily if necessary.

* GNUmakefile.am:
* UIProcess/API/gtk/WebKitURIRequest.cpp:
(webkit_uri_request_class_init): Remove the set property vmethod.
(webkit_uri_request_new): The URI property is no longer settable.
(webkitURIRequestCreateForResourceRequest): Added this private constructor.
(webkit_uri_request_get_uri): Now we just get the URI directly from the ResourceRequest.
* UIProcess/API/gtk/WebKitURIResponse.cpp:
(webkit_uri_response_class_init): Remove the set property vmethod.
(webkit_uri_response_get_uri): Get the URI directly from the ResourceReponse.
(webkit_uri_response_get_status_code): Get the status code directly from the ResourceResponse.
(webkit_uri_response_get_content_length): Get the content length directly from the ResourceResponse.
(webkitURIResponseCreateForResourceResponse): Added this private constructor.
* UIProcess/API/gtk/WebKitURIResponsePrivate.h: Removed unnecessary methods.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104850 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Borders and box masks behave incorrectly with overlapping offsets
https://bugs.webkit.org/show_bug.cgi?id=76137

Source/WebCore:

Reviewed by Dave Hyatt.

When border-image-slice sizes add up to more than the height or width
of the border-image, the middle sections should not be rendered, per spec.

Test: fast/borders/border-image-slice-constrained.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintNinePieceImage):

LayoutTests:

Reviewed by Dave Hyatt.

Testcase with border-image slices adding up to more than the height/width
of the border image.

Fixed cross-fade-webkit-mask-box-image.html to use slices that are half
of the image width.

* animations/cross-fade-webkit-mask-box-image.html:
* fast/borders/border-image-slice-constrained.html: Added.
* platform/mac/animations/cross-fade-webkit-mask-box-image-expected.png:
* platform/mac/fast/borders/border-image-slice-constrained-expected.png: Added.
* platform/mac/fast/borders/border-image-slice-constrained-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move wheel event handling to ScrollElasticityController::handleWheelEvent
https://bugs.webkit.org/show_bug.cgi?id=76205

Reviewed by Andreas Kling.

Move the code in ScrollAnimatorMac::smoothScrollWithEvent to ScrollElasticityController::handleWheelEvent and
change ScrollAnimatorMac::handleWheelEvent to just call ScrollElasticityController::handleWheelEvent.
This means that we'll not set m_haveScrolledSincePageLoad = true anymore (we used to set it in ScrollAnimatorMac::smoothScrollWithEvent),
but we already set it to true in ScrollAnimatorMac::handleWheelEvent so it already had no effect.

* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::handleWheelEvent):
* platform/mac/ScrollElasticityController.h:
* platform/mac/ScrollElasticityController.mm:
(WebCore::elasticDeltaForReboundDelta):
(WebCore::scrollWheelMultiplier):
(WebCore::ScrollElasticityController::handleWheelEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make ScrollElasticityController members private
https://bugs.webkit.org/show_bug.cgi?id=76208

Reviewed by Andreas Kling.

* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::endScrollGesture):
Call ScrollElasticityController::endScrollGesture.

* platform/mac/ScrollElasticityController.h:
Make members private.

* platform/mac/ScrollElasticityController.mm:
(WebCore::ScrollElasticityController::endScrollGesture):
Call snapRubberBand.

(WebCore::ScrollElasticityController::snapRubberBandTimerFired):
Call stopSnapRubberbandTimer.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104855 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Need a script to run tests in PerformanceTests
https://bugs.webkit.org/show_bug.cgi?id=76132

Reviewed by Adam Barth.

Add run-perf-tests to run performance tests using parser/resources/runner.js.
Unfortunately, there isn't an easy way of telling which test uses which format
so hard-code directory that uses Chromium perf-bot style (only inspector perf. tests for now).

All test outputs are re-formatted to match Chromium perf-bot style.

* Scripts/run-inspector-perf-tests.py:
* Scripts/run-perf-tests: Added.
* Scripts/webkitpy/performance_tests/perftestsrunner.py:
(PerfTestsRunner):
(PerfTestsRunner.__init__):
(PerfTestsRunner._collect_tests):
(PerfTestsRunner.run):
(PerfTestsRunner._print_status):
(PerfTestsRunner._run_tests_set):
(PerfTestsRunner._process_chromium_style_test_result):
(PerfTestsRunner._should_ignore_line_in_parser_test_result):
(PerfTestsRunner._process_parser_test_result):
(PerfTestsRunner._run_single_test):
* Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py:
(MainTest.TestDriver.run_test):
(create_runner):
(run_test):
(test_run_test_set):
(test_run_test_set_for_parser_tests):
(test_collect_tests):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebAudio: Use Logging instead of printf.
https://bugs.webkit.org/show_bug.cgi?id=74322

Reviewed by Darin Adler.

No new tests; no net change in functionality.

Add a new WebCoreLogLevel for WebAudio, and use this new log level instead of
printf statements in webaudio classes.

* platform/Logging.cpp:
(WebCore::getChannelFromName):
* platform/Logging.h:
* platform/mac/LoggingMac.mm:
(WebCore::InitializeLoggingChannelsIfNecessary):
* platform/audio/FFTFrame.cpp:
(WebCore::FFTFrame::print):
* webaudio/DefaultAudioDestinationNode.cpp:
(WebCore::DefaultAudioDestinationNode::initialize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104857 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebAudio: AudioBus::loadPlatformResource should mmap file on Mac port.
https://bugs.webkit.org/show_bug.cgi?id=74326

Reviewed by Darin Adler.

No new tests; no net change in functionality.

Use NSDataReadingMappedIfSafe when reading platform audio file data.

* platform/audio/mac/AudioBusMac.mm:
(WebCore::AudioBus::loadPlatformResource):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebAudio: Enable USE_CONCATENATED_IMPULSE_RESPONSES on Mac port.
https://bugs.webkit.org/show_bug.cgi?id=74328

Reviewed by Eric Carlson.

No new tests; no net change in functionality.

* WebCore.xcodeproj/project.pbxproj: Added SincResampler class, Composite.wav to the project.
    Removed IRC_*.wav resources from the project.
* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::createBySampleRateConverting): Uncommented this function
* platform/audio/AudioBus.h:
* platform/audio/HRTFElevation.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104859 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=76209
Support expanded scrollbars
-and corresponding-
<rdar://problem/10527734>

Reviewed by Sam Weinig.

All this really requires is leaving the proper amount of space for the 
expanded width.
* platform/mac/NSScrollerImpDetails.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::supportsExpandedScrollbars):
(WebCore::ScrollbarThemeMac::scrollbarThickness):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104860 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[skia] Track a simple opaque area when painting via PlatformContextSkia and save in LayerTextureUpdater
https://bugs.webkit.org/show_bug.cgi?id=74352

Patch by Dana Jansens <danakj@chromium.org> on 2012-01-12
Reviewed by Stephen White.

Source/WebCore:

New unit tests in PlatformContextSkiaTest.cpp

* WebCore.gypi:
* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::clearRect):
(WebCore::GraphicsContext::drawConvexPolygon):
(WebCore::GraphicsContext::drawEllipse):
(WebCore::drawOuterPath):
(WebCore::drawInnerPath):
(WebCore::GraphicsContext::drawFocusRing):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawLineForTextChecking):
(WebCore::GraphicsContext::drawLineForText):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::fillRoundedRect):
(WebCore::GraphicsContext::strokeArc):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::strokeRect):
* platform/graphics/skia/ImageSkia.cpp:
(WebCore::paintSkBitmap):
* platform/graphics/skia/OpaqueRegionSkia.cpp: Added.
(WebCore::OpaqueRegionSkia::OpaqueRegionSkia):
(WebCore::OpaqueRegionSkia::~OpaqueRegionSkia):
(WebCore::OpaqueRegionSkia::asRect):
(WebCore::xfermodeIsOpaque):
(WebCore::xfermodePreservesOpaque):
(WebCore::paintIsOpaque):
(WebCore::OpaqueRegionSkia::didDrawRect):
(WebCore::OpaqueRegionSkia::didDrawPath):
(WebCore::OpaqueRegionSkia::didDrawPoints):
(WebCore::OpaqueRegionSkia::didDrawBounded):
(WebCore::OpaqueRegionSkia::didDraw):
(WebCore::OpaqueRegionSkia::didDrawUnbounded):
(WebCore::OpaqueRegionSkia::markRectAsOpaque):
(WebCore::OpaqueRegionSkia::markRectAsNonOpaque):
* platform/graphics/skia/OpaqueRegionSkia.h: Added.
* platform/graphics/skia/PlatformContextSkia.cpp:
(WebCore::PlatformContextSkia::PlatformContextSkia):
(WebCore::PlatformContextSkia::clippedToImage):
(WebCore::PlatformContextSkia::drawRect):
(WebCore::PlatformContextSkia::paintSkPaint):
(WebCore::PlatformContextSkia::didDrawRect):
(WebCore::PlatformContextSkia::didDrawPath):
(WebCore::PlatformContextSkia::didDrawPoints):
(WebCore::PlatformContextSkia::didDrawBounded):
* platform/graphics/skia/PlatformContextSkia.h:
(WebCore::PlatformContextSkia::setTrackOpaqueRegion):
(WebCore::PlatformContextSkia::opaqueRegion):

Source/WebKit/chromium:

* WebKit.gypi:
* tests/PlatformContextSkiaTest.cpp: Added.
(WebCore::TEST):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r104858.

NSDataReadingMappedIfSafe is not defined on <= 10.6.  Use NSDataReadingMapped on that platform instead.

* platform/audio/mac/AudioBusMac.mm:
(WebCore::AudioBus::loadPlatformResource):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Setting value on a select element to a non existing option value should clear selection
https://bugs.webkit.org/show_bug.cgi?id=67233
<rdar://problem/10057159>

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/forms/select/setting-to-invalid-value.html

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setValue): Clear the selection in the cases where we cannot
find an option with the specified value. The spec states to clear the selectedness of all
options first. To avoid calling setSelectedIndex() multiple times, we clear the selected
option(s) only when don't find the appropriate option.

Also, correct the sentence style of a comment.

LayoutTests:

New tests check to see that setting the value of a select element clears the
selection, even if the value is invalid, null, or undefined.

* fast/forms/select/setting-to-invalid-value-expected.txt: Added.
* fast/forms/select/setting-to-invalid-value.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Throw exception if IDBCursor.continue() called with key equal to current
https://bugs.webkit.org/show_bug.cgi?id=76100

Source/WebCore:

The fix for https://bugs.webkit.org/show_bug.cgi?id=74213 missed the "or equal" clause
in the spec.

Patch by Joshua Bell <jsbell@chromium.org> on 2012-01-12
Reviewed by Tony Chang.

Test: storage/indexeddb/cursor-continue.html

* storage/IDBCursorBackendImpl.cpp:
(WebCore::IDBCursorBackendImpl::continueFunction):

LayoutTests:

The previously existing clauses that iterated a cursor over non-unique values
by specifing a key now fail per spec, so they are changed to simply call continue().

Patch by Joshua Bell <jsbell@chromium.org> on 2012-01-12
Reviewed by Tony Chang.

* storage/indexeddb/cursor-continue-expected.txt:
* storage/indexeddb/cursor-continue.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
NodeIterator loses track of the reference node when the reference node is removed from the document (IETC ni_removeReferenceNode)
https://bugs.webkit.org/show_bug.cgi?id=76146

Reviewed by Eric Seidel.

Source/WebCore:

In the case where we're removing the reference node we can end up with
the wrong reference node.  This patch makes sure we traverse outside of
the removed node's subtree.

This bug was caught by the following IE Test Center test:

http://samples.msdn.microsoft.com/ietestcenter/domtraversal/showdomtraversaltest.htm?ni_removeReferenceNode

Our new behavior also match Firefox.

I experimented a bit with adding ASSERT_NOT_REACHED to various branches
in NodeIterator::updateForNodeRemoval, and it seems our test coverage
for this function is relatively poor.  In the future, we should
consider adding more tests for this complicated function.

Test: fast/dom/node-iterator-reference-node-removed.html

* dom/NodeIterator.cpp:
(WebCore::NodeIterator::updateForNodeRemoval):

LayoutTests:

Test based on http://samples.msdn.microsoft.com/ietestcenter/domtraversal/showdomtraversaltest.htm?ni_removeReferenceNode

* fast/dom/node-iterator-reference-node-removed-expected.txt: Added.
* fast/dom/node-iterator-reference-node-removed.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104866 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Fix DC leak in WebScreenInfoFactory.
https://bugs.webkit.org/show_bug.cgi?id=76203

Reviewed by Dmitry Titov.

Source/JavaScriptCore:

* JavaScriptCore.gyp/JavaScriptCore.gyp: Added OwnGetDCWin.h
* JavaScriptCore.gypi: Added OwnGetDCWin.h
* JavaScriptCore/wtf/win/OwnGetDCWin.h: Made an owner class for GetDC which needs ReleaseDC as opposed to DeleteDC.

Source/WebKit/chromium:

* src/win/WebScreenInfoFactory.cpp:
(WebKit::WebScreenInfoFactory::screenInfo): Use OwnGetDC to ensure its release.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=76141
defineSetter/defineGetter may fail to update Accessor attribute

Reviewed by Oliver Hunt.

* runtime/JSObject.cpp:
(JSC::JSObject::defineGetter):
(JSC::JSObject::initializeGetterSetterProperty):
(JSC::JSObject::defineSetter):
* runtime/Structure.cpp:
(JSC::Structure::attributeChangeTransition):
* runtime/Structure.h:



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