[Texmap] TextureMapperAnimations does not support keyframe with multiple animations
https://bugs.webkit.org/show_bug.cgi?id=86303

Qt and GTK, in WebKit1, use TextureMapper to store AC animations using
TextureMapperAnimations::add(keyframeName, TextureMapperAnimation). And when a
CSS animation animates several CSS properties, TextureMapperAnimations::add is
called more than once with the same keyframeName value. However, currently,
TextureMapperAnimations can not store more than one animated property in the keyframe
because it is using HashMap<String, TextureMapperAnimation>, and WebKit HashMap
does not support add the same key twice.

Reviewed by Noam Rosenthal.

* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimations::hasActiveAnimationsOfType):
(WebCore::TextureMapperAnimations::hasRunningAnimations):
(WebCore::TextureMapperAnimations::add):
(WebCore):
(WebCore::TextureMapperAnimations::pause):
(WebCore::TextureMapperAnimations::apply):
* platform/graphics/texmap/TextureMapperAnimation.h:
(TextureMapperAnimations): Use HashMap<String, Vector<TextureMapperAnimation> >,
so we can support an keyframe with multiple animations.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Volume slider needs to be displayed below the mute button
https://bugs.webkit.org/show_bug.cgi?id=85990

Patch by Victor Carbune <vcarbune@adobe.com> on 2012-05-13
Reviewed by Dimitri Glazkov.

Source/WebCore:

Added back code for rendering offset, but used only when the volume slider
needs to be displayed below the controls.

Test: media/media-volume-slider-rendered-below.html

* css/mediaControlsChromium.css:
(audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container):
Changed positioning of the slider to absolute, otherwise it is not possible to position it from the layout() method.
* css/mediaControlsQuickTime.css:
Added back the double mute-button and changed the z-index of the original button. When the slider is displayed
the second mute button is actually there.
(audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button):
(audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container):
(audio::-webkit-media-controls-volume-slider-mute-button, video::-webkit-media-controls-volume-slider-mute-button):
Added copy.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::makeTransparent): Disabled the possible of hiding controls. WebVTT rendering
in the place of controls when these are visible is not possible with the current code.
(RenderMediaVolumeSliderContainer):
(WebCore):
(WebCore::RenderMediaVolumeSliderContainer::RenderMediaVolumeSliderContainer):
(WebCore::RenderMediaVolumeSliderContainer::layout):
Checked if the absolute coordinates of the corner of the slider would be rendered outside the page. This part of the
code is faulty if display:none is toggled on the controls.
(WebCore::MediaControlVolumeSliderContainerElement::createRenderer):
* html/shadow/MediaControlElements.h:
(MediaControlVolumeSliderContainerElement):
* html/shadow/MediaControlRootElement.cpp:
(WebCore::MediaControlRootElement::create):

LayoutTests:

Updated tests expectation and marked failing tests accordingly.

* media/media-volume-slider-rendered-below.html: Added.
* media/media-volume-slider-rendered-expected.txt: Added.
* platform/chromium/test_expectations.txt: Updated.
* platform/mac/media/audio-controls-rendering-expected.txt: Updated (z-index change).
* platform/mac/media/controls-after-reload-expected.txt: Same.
* platform/mac/media/controls-strict-expected.txt: Same.
* platform/mac/media/video-controls-rendering-expected.txt: Same.
* platform/mac/media/video-display-toggle-expected.txt: Same.
* platform/mac/media/video-playing-and-pause-expected.txt: Same.
* platform/mac/test_expectations.txt: Updated.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Gardening; skip test added in r116858.

* platform/efl/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Gardening; skip tests after r116900.

The patch only updated the chromium and mac expectations...

* platform/efl/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed, fix test skipped in the previous commit.

* platform/efl/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Dangling node to ID maps vector uses raw pointers, but should use OwnPtr
https://bugs.webkit.org/show_bug.cgi?id=86299

Reviewed by Pavel Feldman.

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::releaseDanglingNodes): Removed now-unneeded call
to deleteAllValues since the clear function now takes care of that.
(WebCore::InspectorDOMAgent::pushNodePathToFrontend): Added code that uses
adoptPtr and release as neeed to deal with a Vector<OwnPtr>.
* inspector/InspectorDOMAgent.h: Changed m_danglingNodeToIdMaps to be
Vector<OwnPtr> instead of a vector of raw pointers.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FractionalLayoutUnit class has unneeded redundant uses of "inline" keyword
https://bugs.webkit.org/show_bug.cgi?id=86301

Reviewed by Andreas Kling.

* platform/FractionalLayoutUnit.h: Removed uses of inline for functions
defined inside a class definition. The C++ language defines that all such
functions are treated as if specified with inline, and explicitly stating
inline in addition does not add anything or change behavior.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderView::selectionBounds and RenderView::setSelection use maps with raw pointers that should be OwnPtr
https://bugs.webkit.org/show_bug.cgi?id=86300

Reviewed by Eric Seidel.

* rendering/RenderView.cpp:
(WebCore::RenderView::selectionBounds): Changed SelectionMap type to use OwnPtr.
Added code to do adoptPtr as needed and removed explicit delete code.
(WebCore::RenderView::setSelection): Changed SelectedBlockMap type to use OwnPtr.
Added code to do adoptPtr as needed and removed explicit delete code.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Image::initPlatformData is always an empty function so we can remove it
https://bugs.webkit.org/show_bug.cgi?id=86297

Reviewed by Dan Bernstein.

* platform/graphics/BitmapImage.h: Removed declaration of initPlatformData.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::BitmapImage): Removed call to initPlatformData.
* platform/graphics/cairo/BitmapImageCairo.cpp:
(WebCore::BitmapImage::BitmapImage): Ditto.
* platform/graphics/cg/ImageCG.cpp:
(WebCore::BitmapImage::BitmapImage): Ditto.
* platform/graphics/chromium/ImageChromiumMac.mm: Removed empty
initPlatformData function.
* platform/graphics/efl/ImageEfl.cpp: Ditto.
* platform/graphics/gtk/ImageGtk.cpp:
* platform/graphics/mac/ImageMac.mm:
* platform/graphics/openvg/ImageOpenVG.cpp:
(WebCore::BitmapImage::BitmapImage): Removed call to initPlatformData.
Removed empty initPlatformData function.
* platform/graphics/qt/ImageQt.cpp:
(WebCore::BitmapImage::BitmapImage): Removed call to initPlatformData.
Removed empty initPlatformData function.
* platform/graphics/skia/ImageSkia.cpp: Removed empty initPlatformData function.
* platform/graphics/win/ImageWin.cpp: Ditto.
* platform/graphics/wx/ImageWx.cpp: Ditto.
(WebCore::BitmapImage::BitmapImage): Removed call to initPlatformData.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use emptyString instead of String("")
https://bugs.webkit.org/show_bug.cgi?id=86305

Reviewed by Darin Adler.

Use emptyString() instead of String("") because it is better style and faster.

No new tests. No change in behavior.

* Modules/webdatabase/AbstractDatabase.cpp:
(WebCore::AbstractDatabase::performOpenAndVerify):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::subprotocol):
(WebCore::ThreadableWebSocketChannelClientWrapper::extensions):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setValueFromRenderer):
* platform/SharedBufferChunkReader.cpp:
(WebCore::SharedBufferChunkReader::nextChunkAsUTF8StringWithLatin1Fallback):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::ResourceHandleManager::setProxyInfo):
* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::initializeLocalizedDateFormatText):
* rendering/RenderQuote.cpp:
(WebCore::RenderQuote::originalText):
* storage/StorageNamespaceImpl.cpp:
(WebCore::StorageNamespaceImpl::localStorageNamespace):
* svg/SVGStringList.cpp:
(WebCore::SVGStringList::reset):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Roll out local changes accidentally landed in r116905.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/ImageCG.cpp:



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

* platform/gtk/test_expectations.txt: Flag failing media test.

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

* platform/gtk/test_expectations.txt: Flag another 2 media failures.

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

* platform/gtk/test_expectations.txt: Mark
media/video-controls-toggling.html as failing and move 2 other
media failures to the correct section.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Heap-use-after-free in WTF::HashMap<int, WTF::RefPtr<WebCore::CalculationValue>, WTF::IntHash<unsigned int>, WTF::HashTrait
https://bugs.webkit.org/show_bug.cgi?id=85195

Source/WebCore:

This bug was caused by Length not understanding that calc expressions shouldn't be
blended - a Length with a calc expression handle was created without incrementing
the ref count of the expression. Length no longer attempts to blend calc expressions,
http://webkit.org/b/86160 has been filed to track expression blending. Fixing this fixed
the crash.

Once this was fixed, the RenderStyle diff checker thought the style was changing,
as Length didn't know how to compare calc expressions, resulting in an infinite
loop of style recalcs. Expressions can now compare themselves.

Reviewed by Darin Adler.

Tests: css3/calc/transition-crash.html
       css3/calc/transition-crash2.html

* platform/CalculationValue.h:
(WebCore::CalcExpressionNode::CalcExpressionNode):
(CalcExpressionNode):
(WebCore::CalcExpressionNode::type):
(CalculationValue):
(WebCore::CalculationValue::operator==):
(WebCore::CalcExpressionNumber::CalcExpressionNumber):
(WebCore::CalcExpressionNumber::operator==):
(CalcExpressionNumber):
(WebCore::CalcExpressionLength::CalcExpressionLength):
(WebCore::CalcExpressionLength::operator==):
(CalcExpressionLength):
(WebCore::CalcExpressionBinaryOperation::CalcExpressionBinaryOperation):
(WebCore::CalcExpressionBinaryOperation::operator==):
(CalcExpressionBinaryOperation):
* platform/Length.cpp:
(WebCore::Length::isCalculatedEqual):
(WebCore):
* platform/Length.h:
(WebCore::Length::operator==):
(Length):
(WebCore::Length::blend):

LayoutTests:

Reviewed by Darin Adler.

* css3/calc/transition-crash-expected.txt: Added.
* css3/calc/transition-crash.html: Added.
* css3/calc/transition-crash2-expected.txt: Added.
* css3/calc/transition-crash2.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Forms] Move ValidityState methods implementation to another place
https://bugs.webkit.org/show_bug.cgi?id=86058

Patch by Yoshifumi Inoue <yosin@chromium.org> on 2012-05-13
Reviewed by Kent Tamura.

This patch changes ValidityState class for limiting scope of
number/range input type related methods for introducing decimal
arithmetic.

Methods related to validation are moved from ValidateState to
input, select and textarea elements with virtual method based
dispatching via FormAssociateElement instead of tag name
dispatching so far for code simplification.

No new tests. This patch doesn't change behavior.

* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::customError): Added. Called from ValidateState. Returns custom error mssage in member variable.
(WebCore::FormAssociatedElement::patternMismatch): Added.  Called from ValidateState. This is default implementation.
(WebCore::FormAssociatedElement::rangeOverflow): Added.  Called from ValidateState. This is default implementation.
(WebCore::FormAssociatedElement::rangeUnderflow): Added.  Called from ValidateState. This is default implementation.
(WebCore::FormAssociatedElement::stepMismatch): Added.  Called from ValidateState. This is default implementation.
(WebCore::FormAssociatedElement::tooLong): Added.  Called from ValidateState. This is default implementation.
(WebCore::FormAssociatedElement::typeMismatch): Added.  Called from ValidateState. This is default implementation.
(WebCore::FormAssociatedElement::valid): Added.  Called from ValidateState. This is default implementation.
(WebCore::FormAssociatedElement::valueMissing): Added.  Called from ValidateState. This is default implementation.
(WebCore::FormAssociatedElement::customValidationMessage): Added.  Called from ValidateState. This is default implementation.
(WebCore::FormAssociatedElement::validationMessage): Added.  Called from ValidateState. This is default implementation.
(WebCore::FormAssociatedElement::setCustomValidity): Added.  set custom error message.
* html/FormAssociatedElement.h:
(FormAssociatedElement): Added new instance value m_customValidationMessage.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::validationMessage): Removed. Note: HTMLInputElement, HTMLSelectElement, and HTMLTextAreaElement implement this method.
(WebCore::HTMLFormControlElement::setCustomValidity): Changed. Calls base class setCustomValidity.
* html/HTMLFormControlElement.h:
(HTMLFormControlElement):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isValidValue): Call m_inputType methods instead of HTMLInputElement's.
(WebCore::HTMLInputElement::tooLong): Call m_inputType methods instead of HTMLInputElement's.
(WebCore):
(WebCore::HTMLInputElement::typeMismatch): Move implementation to InputType.
(WebCore::HTMLInputElement::valueMissing):  Move implementation to InputType.
(WebCore::HTMLInputElement::patternMismatch): Move implementation to InputType.
(WebCore::HTMLInputElement::rangeUnderflow): Move implementation to InputType.
(WebCore::HTMLInputElement::rangeOverflow): Move implementation to InputType.
(WebCore::HTMLInputElement::validationMessage): Move implementation to InputType.
(WebCore::HTMLInputElement::stepMismatch): Move implementation to InputType.
(WebCore::HTMLInputElement::isInRange): Call m_inputType methods instead of HTMLInputElement's.
(WebCore::HTMLInputElement::isOutOfRange): Call m_inputType methods instead of HTMLInputElement's.
* html/HTMLInputElement.h:
(HTMLInputElement): Make tooLong method private.
* html/HTMLObjectElement.h: Add "virtual" and "OVERRIDE".
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::validationMessage): Added. Implementation for HTMLSelectElement.
(WebCore::HTMLSelectElement::valueMissing): Added. Implementation for HTMLSelectElement.
* html/HTMLSelectElement.h:
(HTMLSelectElement):  Added entries for newly added methods.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::validationMessage): Added. Implementation for HTMLTextAreaElement.
(WebCore::HTMLTextAreaElement::valueMissing): Added. Implementation for HTMLTextAreaElement.
(WebCore::HTMLTextAreaElement::tooLong): Added. Implementation for HTMLTextAreaElement.
* html/HTMLTextAreaElement.h:
(HTMLTextAreaElement): Added entries for newly added methods. Change tooLong and valueMissing private.
* html/InputType.cpp:
(WebCore::InputType::stepMismatch): Change method signature.
(WebCore::InputType::alignValueForStep):  Changed for calling InputClass instead of HTMLINputElement.
(WebCore::InputType::stepUpFromRenderer):  Added. Moved from HTMLInputElement.
(WebCore::InputType::validationMessage): Added.  Moved from HTMLInputElement.
* html/InputType.h:
(InputType): Added entries for newly added methods and update methods signature.
* html/ValidityState.cpp: Move actual implementation to FormAssociatedElement and derived classes for localizing implementation change of elements and input types.
(WebCore::ValidityState::validationMessage): Changed to call FormAssociatedElement's method.
(WebCore::ValidityState::valueMissing): Changed to call FormAssociatedElement's method.
(WebCore::ValidityState::typeMismatch): Changed to call FormAssociatedElement's method.
(WebCore::ValidityState::patternMismatch): Changed to call FormAssociatedElement's method.
(WebCore::ValidityState::tooLong): Changed to call FormAssociatedElement's method.
(WebCore::ValidityState::rangeUnderflow): Changed to call FormAssociatedElement's method.
(WebCore::ValidityState::rangeOverflow): Changed to call FormAssociatedElement's method.
(WebCore::ValidityState::stepMismatch): Changed to call FormAssociatedElement's method.
(WebCore::ValidityState::customError): Changed to call FormAssociatedElement's method.
(WebCore::ValidityState::valid):
* html/ValidityState.h:
(ValidityState): Remove custom validation message related things.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
performance tests should be able to measure runs/sec rather than time
https://bugs.webkit.org/show_bug.cgi?id=86021

Reviewed by Ojan Vafai.

PerformanceTests:

Add PerfTestRunner.runPerSecond. It uses _runLoop but replaces _runner by _perSecondRunner
to compute runs/s of runFunction.

When _perSecondRunner is called for the first time, i.e. _completedRuns is 0 (notice this is -1
in regular run/_runner), it slowly increases the number of function calls to runFunction between
time measurements in order to discount the time used by new Date() calls themselves until the
total time spent reaches 100 milliseconds.

By default, runPerSecond runs the test for at least 750 milliseconds in each run, and executes
21 runs, yielding the total run time of roughly 18 seconds. This is significantly faster than
most of existing performance tests. Also see http://ejohn.org/blog/accuracy-of-javascript-time/.

Finally, refactored the existing methods of PerfTestRunner to allow "runs/s" unit and share code.

* Layout/flexbox-column-nowrap.html:
* Layout/flexbox-column-wrap.html:
* Layout/flexbox-row-nowrap.html:
* Layout/flexbox-row-wrap.html:
* resources/runner.js:
(PerfTestRunner.computeStatistics): Takes unit.
(PerfTestRunner.logStatistics): Ditto.
(PerfTestRunner._runLoop):
(PerfTestRunner._runner):
(PerfTestRunner.runPerSecond): Added.
(PerfTestRunner._perSecondRunner): Added. Called by _runLoop.
(PerfTestRunner._perSecondRunnerIterator): Added.

Tools:

Allow " runs/s" or " ms" to appear after numerical values in tests.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest):

LayoutTests:

Add tests for PerfTestRunner.runPerSecond.

* fast/harness/perftests/runs-per-second-iterations-expected.txt: Added.
* fast/harness/perftests/runs-per-second-iterations.html: Added.
* fast/harness/perftests/runs-per-second-log-expected.txt: Added.
* fast/harness/perftests/runs-per-second-log.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Listeners map uses raw pointers, but should use OwnPtr
https://bugs.webkit.org/show_bug.cgi?id=86298

Reviewed by Dan Bernstein.

* bindings/js/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::~PageScriptDebugServer): Removed call
to deleteAllValues since the destructor now takes care of this
(WebCore::PageScriptDebugServer::addListener): Changed idiom of the add
function call here to use adoptPtr.
(WebCore::PageScriptDebugServer::removeListener): Added a now-needed
call to get and removed a now-uneeeded call to delete.
* bindings/js/PageScriptDebugServer.h: Changed the key type of
PageListenersMap to OwnPtr.

* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::~ScriptDebugServer): Removed code to delete
the values in m_pageListenersMap. This map was never used and so I have
removed it.
* bindings/js/ScriptDebugServer.h: Removed the type PageListenersMap
and the unused data member, m_pageListenersMap.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Gtk] Many tests revealed as passing after moving from Skipped to test_expectations.txt
https://bugs.webkit.org/show_bug.cgi?id=85591

Unreviewed, remove test expectations for another test which
consistently passess on all the Gtk builders.

* platform/gtk/test_expectations.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CG] Unneeded CFRetain/Release of CGImageRef in BitmapImage::draw
https://bugs.webkit.org/show_bug.cgi?id=86332

Reviewed by Dan Bernstein.

* platform/graphics/cg/ImageCG.cpp:
(WebCore::BitmapImage::draw): Don't use RetainPtr since the result of
the function is used before anything could call CFRelease on it.


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