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
[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 plenty of sputnik tests that
were specific for debug builds. These tests are now consistently
passing on all the builders but that was only noticed when migration to
using test_expectations.txt was complete, meaning their test expectations
were out of date and moreover erroneous.

* platform/gtk/test_expectations.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Several dom tests are failing after r116828
https://bugs.webkit.org/show_bug.cgi?id=86334

Unreviewed EFL gardening.

Move fast/dom/CSSStyleDeclaration/empty-string-property.html and
fast/dom/collection-null-like-arguments.html to test_expectations.txt.
Those tests are failing due to a regression introduced in r116828.

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-05-13

* platform/efl/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed test fix: these calc() tests are dumpAsText().

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, skip new asserting and failing test to paint the bots green.

* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Remove platform/image-decoders/xbm from WebCore.gyp
https://bugs.webkit.org/show_bug.cgi?id=86333

Reviewed by Adam Barth.

No new tests. No change in behavior.

* WebCore.gyp/WebCore.gyp: Remove reference to platform/image-decoders/xbm
since that directory was removed from the repository long ago.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG performs incorrect constant folding on double-to-uint32 conversion in
Uint32Array PutByVal
https://bugs.webkit.org/show_bug.cgi?id=86330

Source/JavaScriptCore: 

Reviewed by Darin Adler.
        
static_cast<int>(d) is wrong, since JS semantics require us to use toInt32(d).
In particular, C++ casts on typical hardware (like x86 and similar) will
return 0x80000000 for double values that are out of range of the int32 domain
(i.e. less than -2^31 or greater than or equal to 2^31). But JS semantics call
for wrap-around; for example the double value 4294967297 ought to become the
int32 value 1, not 0x80000000.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):

LayoutTests: 

Rubber stamped by Darin Adler.

* fast/js/dfg-uint32array-overflow-constant-expected.txt: Added.
* fast/js/dfg-uint32array-overflow-constant.html: Added.
* fast/js/script-tests/dfg-uint32array-overflow-constant.js: Added.
(foo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce PropertyName class
https://bugs.webkit.org/show_bug.cgi?id=86241

Reviewed by Darin Adler.

This patch introduced a couple of small bugs.

* runtime/PropertyName.h:
(JSC::toUInt32FromCharacters):
    - Returning wrong value for "" - should not convert to 0.
(JSC::PropertyName::PropertyName):
    - Remove the ASSERT, it was a little too aspirational.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Should have Node::inDetach() for assertion purposes.
https://bugs.webkit.org/show_bug.cgi?id=86157

Reviewed by Darin Adler.

Implemented Node::inDetach() and added an assertio in Document::setFocusedNode().
This is a follow up of r116644 which removes inDetach() checking.

No new tests. Just adding an asssertion.

* dom/Document.cpp:
(WebCore::Document::setFocusedNode):
* dom/Node.cpp:
(WebCore):
(WebCore::Node::inDetach):
(WebCore::Node::detach):
* dom/Node.h:
(Node):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, removing test expectations for two tests that were
fixed in r116926.

* platform/gtk/test_expectations.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, unskip now passing tests after r116926.

* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: implement tabs reordering via drag'n'drop.
https://bugs.webkit.org/show_bug.cgi?id=86294

Reviewed by Yury Semikhatsky.

* inspector/front-end/TabbedPane.js:
(WebInspector.TabbedPaneTab.prototype._createTabElement):
(WebInspector.TabbedPaneTab.prototype._tabClicked):
(WebInspector.TabbedPaneTab.prototype._tabMouseDown):
(WebInspector.TabbedPaneTab.prototype._tabContextMenu):
(WebInspector.TabbedPaneTab.prototype._tabMouseMove):
(WebInspector.TabbedPaneTab.prototype._tabDragging):
(WebInspector.TabbedPaneTab.prototype._endTabDragging):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] TextureMapperGL::drawTexture marked OVERRIDE but does not override any member function.
https://bugs.webkit.org/show_bug.cgi?id=86347

This bug was introduced by r116834.
TextureMapperGL implements two drawTexture functions.
The first one takes a BitmapTexture as an argument and does override TextureMapper::drawTexture().
The second one takes a texture id as an argument and does not override any member function.

* platform/graphics/texmap/TextureMapperGL.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116931 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, unskip a now passing test.

* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Esc should revert the colorpicker-modifed color to the original
https://bugs.webkit.org/show_bug.cgi?id=86349

Reviewed by Vsevolod Vlasov.

A boolean parameter has been added to the Spectrum's hide() method to denote the picker cancellation,
which gets passed into the "Hidden" event listeners. StylesSidebarPane is made to remember the original property value
when the picker is opened, and restore it if the color picker is cancelled.

* inspector/front-end/Spectrum.js:
(WebInspector.Spectrum):
(WebInspector.Spectrum.prototype.toggle):
(WebInspector.Spectrum.prototype.show):
(WebInspector.Spectrum.prototype.hide):
(WebInspector.Spectrum.prototype._onKeyDown):
* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylesSidebarPane.prototype.update):
(WebInspector.StylesSidebarPane.prototype.willHide):
(WebInspector.StylePropertyTreeElement.prototype.updateTitle.):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
webkit-patch apply-attachment is very slow for big patches
https://bugs.webkit.org/show_bug.cgi?id=74929

Add "excludefield=attachmentdata" to the URL everywhere
"ctype=xml" is used to exclude this field from the XML.

Reviewed by Adam Barth.

* Scripts/prepare-ChangeLog:
(fetchBugDescriptionFromURL):
* Scripts/webkitpy/common/config/urls.py:
* Scripts/webkitpy/common/config/urls_unittest.py:
(URLsTest.test_parse_bug_id):
* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla.bug_url_for_bug_id):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
webkit-patch land should automatically add svn:mime-type for .png files
https://bugs.webkit.org/show_bug.cgi?id=75825
I refactored the png.py to avoid code duplication.

Patch by Balazs Ankes <bank@inf.u-szeged.hu> on 2012-05-14
Reviewed by Dirk Pranke.

* Scripts/webkitpy/common/checksvnconfigfile.py: Added.
(check):
(_config_file_path):
(errorstr_autoprop):
(errorstr_png):
* Scripts/webkitpy/style/checkers/png.py:
(PNGChecker.check):
* Scripts/webkitpy/tool/commands/download.py:
(Land):
* Scripts/webkitpy/tool/steps/__init__.py:
* Scripts/webkitpy/tool/steps/addsvnmimetypeforpng.py: Added.
(AddSvnMimetypeForPng):
(AddSvnMimetypeForPng.__init__):
(AddSvnMimetypeForPng.run):
(AddSvnMimetypeForPng._check_pngs):
* Scripts/webkitpy/tool/steps/addsvnmimetypeforpng_unittest.py: Added.
(MockSCMDetector):
(MockSCMDetector.__init__):
(MockSCMDetector.display_name):
(AddSvnMimetypeForPngTest):
(AddSvnMimetypeForPngTest.test_run):

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