[Win][WebGL] WebGL rendering is slow.
https://bugs.webkit.org/show_bug.cgi?id=120841

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-09-06
Reviewed by Brent Fulgham.

Rendering WebGL content is slow on Windows, because lots of debug information is written to debug.txt.

* ANGLE.vcxproj/ANGLERelease.props: Disable logging in release builds.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][BlackBerry] Text track localized string functions are named wrong
https://bugs.webkit.org/show_bug.cgi?id=120788

Patch by Brendan Long <b.long@cablelabs.com> on 2013-09-06
Reviewed by Philippe Normand.

This renames textTrackOffText() to textTrackOffMenuItemText(), and
adds textTrackAutomaticMenuItemText(), to make them match the
definitions in LocalizedStrings.h.

* platform/blackberry/LocalizedStringsBlackBerry.cpp:
* platform/qt/LocalizedStringsQt.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: aria-relevant does not expose AXARIARelevant
https://bugs.webkit.org/show_bug.cgi?id=120373

Reviewed by Darin Adler.

Source/WebCore:

When global ARIA attributes are present on an Element we need to ignore
a presentational role, if set on that Element.

Test: accessibility/global-aria-attributes-invalidate-presentational.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAriaRoleAttribute):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAAttributes):

LayoutTests:

* accessibility/global-aria-attributes-invalidate-presentational-expected.txt: Added.
* accessibility/global-aria-attributes-invalidate-presentational.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] AccessibilityUIElement::addNotificationListener() crashes on debug build
https://bugs.webkit.org/show_bug.cgi?id=120416

Patch by Denis Nomiyama <d.nomiyama@samsung.com> on 2013-09-06
Reviewed by Mario Sanchez Prada.

Tools:

Fixed crashes when running debug DRT. Simplified loops at AccessibilityCallbackAtk.cpp where the HashMap
iterator was removed inside a loop. Fixed AccessibilityUIElement::addNotificationListener() where
m_notificationHandler expected RefPtr.

The global notification handler was stored in the HashMap with key 0. And this caused an assertion when
HashMap::add() or find() are called. To fix it, moved the global handler to a separated pointer.

* DumpRenderTree/atk/AccessibilityCallbacks.h: Removed the global notification key.
* DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp:
(axObjectEventListener): Simplified the code by using HashMap::find() and a separate pointer for the
global notification handler.
(addAccessibilityNotificationHandler): Simplified the code by using HashMap::find() and a separate pointer
for the global notification handler.
(removeAccessibilityNotificationHandler): Added the removal for the global notification handler.
* DumpRenderTree/atk/AccessibilityNotificationHandlerAtk.h:
(AccessibilityNotificationHandler::create): Added static function to create
AccessibilityNotificationHandler.
* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(AccessibilityUIElement::addNotificationListener): Assigned m_notificationHandler with
AccessibilityNotificationHandler::create().

LayoutTests:

Fixed crashes when running debug DRT on tests that require an a11y notification handler.

* platform/gtk/TestExpectations: Unskipped some a11y tests that were crashing before this fix.
Updated the expectation of accessibility/notification-listeners.html to expect failure on Debug build
since it is not crashing anymore. This other issue is tracked in a separate bug (bug 120669).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] GlibUtilities: getCurrentExecutablePath() does not compile on GNU/Hurd
https://bugs.webkit.org/show_bug.cgi?id=120793

Reviewed by Gustavo Noronha Silva.

Original patch by Svante Signell <svante.signell@telia.com>.

PATH_MAX is not defined in GNU/Hurd, this patch adds a dummy
implementation to make it compile.

* wtf/gobject/GlibUtilities.cpp:
(getCurrentExecutablePath):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FrameLoader::subresourceLoader() should return a reference.
<https://webkit.org/b/120830>

Reviewed by Anders Carlsson.

There is always a SubresourceLoader, so this method could never return null.
Also made m_subresourceLoader an OwnPtr to reduce header dependencies.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix fastMalloc/delete mismatches in CSS parser
https://bugs.webkit.org/show_bug.cgi?id=120864

Reviewed by Andreas Kling.

Stop putting fastMalloced memory inside an OwnPtr.

* css/CSSParserValues.cpp:
(WebCore::CSSParserSelector::CSSParserSelector):
(WebCore::CSSParserSelector::adoptSelectorVector):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Lots of pixel tests are failing on first run, so tests cannot finish
        https://bugs.webkit.org/show_bug.cgi?id=120755

        Reviewed by Ryosuke Niwa.

        For whatever reason, many reftests are color profile sensitive, and we only set
        color profile to a known one for pixel tests, not for reftests.

        Pixel testing mode is also enabled  when retrying tests, so these failures used to
        be essentially hidden - the tests were "flaky", but that was not reported loudly enough.
        But now, so many tests fail that it makes run-webkit-tests stop early, and never retry.

        This probably shouldn't happen, as reftests should not be color profile sensitive.
        The fix is a stopgap measure to unblock EWS until a better fix can be investigated.

        * Scripts/webkitpy/layout_tests/controllers/manager.py:
        (Manager._set_up_run): Roll out <http://trac.webkit.org/changeset/115601>.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Desktop proxy settings are ignored inside the internal jhbuild
https://bugs.webkit.org/show_bug.cgi?id=120833

Patch by Mario Sanchez Prada <mario.prada@samsung.com> on 2013-09-06
Reviewed by Gustavo Noronha Silva.

Add dconf as an optional module for the internal jhbuild, along
with vala 0.17 as a dependency, and make sure we do not explicitly
set always the 'memory' backend, so we can have an easy way to
allow apps access desktop settings from the jhbuild. This is
useful for example to be able to run apps such as MiniBrowser
inside the jhbuild (by means of run-launcher, for instance) while
working behind a proxy, since those network settings have to be
read from the system global configuration in org.gnome.system.proxy.

* gtk/jhbuild-optional.modules: Added dconf 0.14 and vala 0.17.
* gtk/jhbuildrc: Do not explicitly choose the GSettings memory
backend here, since that will make more difficult to use the dconf
backend from inside the jhbuild if we need to do it so.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stop using fastNew/fastDelete in WebCore
https://bugs.webkit.org/show_bug.cgi?id=120867

Reviewed by Geoffrey Garen.

Using fastNew/fastDelete can be dangerous, especially when put into a smart pointer
such as OwnPtr which uses regular delete. Because of this I'd like to remove fastNew/fastDelete.
Turns out it's only used in a couple of places in WebCore, so just use new/delete here instead.

* platform/audio/FFTFrame.h:
* platform/audio/gstreamer/FFTFrameGStreamer.cpp:
(WebCore::FFTFrame::FFTFrame):
(WebCore::FFTFrame::~FFTFrame):
(WebCore::FFTFrame::doFFT):
(WebCore::FFTFrame::doInverseFFT):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(webkitVideoSinkDispose):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MediaStream API] Allow empty MediaStreams
https://bugs.webkit.org/show_bug.cgi?id=120815

Reviewed by Jer Noble.

The spec is a bit unclear ecactly what should happen with newly created MediaStreams
that doesn't have any tracks. The current implementation is too strict and the spec
is being worked upon to be clearer. In the meantime this patch doesn't set eneded to
true in the constructor.

Source/WebCore:

No new tests, existing test updated.

(WebCore::MediaStreamRegistry::lookupMediaStreamDescriptor):
* platform/mediastream/MediaStreamDescriptor.h:
(WebCore::MediaStreamDescriptor::MediaStreamDescriptor):

LayoutTests:

* fast/mediastream/MediaStreamConstructor-expected.txt:
* fast/mediastream/MediaStreamConstructor.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce a way to run benchmarks and JSRegress as stress tests with different jsc command-line options
https://bugs.webkit.org/show_bug.cgi?id=120808

Source/JavaScriptCore: 

Reviewed by Mark Hahnenberg and rubber stamped by Geoffrey Garen.
        
Allow --useExperimentalFTL=true even if FTL isn't built since this simplifies
testing.

* dfg/DFGTierUpCheckInjectionPhase.cpp:
(JSC::DFG::TierUpCheckInjectionPhase::run):

Tools: 

Reviewed by Mark Hahnenberg and rubber stamped by Geoffrey Garen.
        
Add a script for running stress tests.  A stress test is a .js file that is run
through different configurations of JSC.  It can control which configurations it
runs by using "//@ <ruby code>" to guide the script.
        
This script is now run as part of run-javascriptcore-tests, on Mac only.

* Scripts/run-javascriptcore-tests:
* Scripts/run-jsc-stress-tests: Added.

LayoutTests: 

Reviewed by Mark Hahnenberg and rubber stamped by Geoffrey Garen.
        
Make it so that long-running tests aren't run as part of the stress test (they
will still run as part of benchmarks and LayoutTests) or run them with fewer
configurations.

* fast/js/regress/script-tests/ArrayBuffer-DataView-alloc-large-long-lived.js:
* fast/js/regress/script-tests/ArrayBuffer-DataView-alloc-long-lived.js:
* fast/js/regress/script-tests/ArrayBuffer-Int32Array-byteOffset.js:
* fast/js/regress/script-tests/ArrayBuffer-Int8Array-alloc-huge-long-lived.js:
* fast/js/regress/script-tests/ArrayBuffer-Int8Array-alloc-large-long-lived-fragmented.js:
* fast/js/regress/script-tests/ArrayBuffer-Int8Array-alloc-large-long-lived.js:
* fast/js/regress/script-tests/ArrayBuffer-Int8Array-alloc-long-lived-buffer.js:
* fast/js/regress/script-tests/ArrayBuffer-Int8Array-alloc-long-lived.js:
* fast/js/regress/script-tests/ArrayBuffer-Int8Array-alloc.js:
* fast/js/regress/script-tests/DataView-custom-properties.js:
* fast/js/regress/script-tests/Float32Array-to-Float64Array-set.js:
* fast/js/regress/script-tests/Float64Array-alloc-long-lived.js:
* fast/js/regress/script-tests/Float64Array-to-Int16Array-set.js:
* fast/js/regress/script-tests/HashMap-put-get-iterate-keys.js:
* fast/js/regress/script-tests/HashMap-put-get-iterate.js:
* fast/js/regress/script-tests/HashMap-string-put-get-iterate.js:
* fast/js/regress/script-tests/Int16Array-alloc-long-lived.js:
* fast/js/regress/script-tests/Int16Array-to-Int32Array-set.js:
* fast/js/regress/script-tests/Int32Array-alloc-huge-long-lived.js:
* fast/js/regress/script-tests/Int32Array-alloc-huge.js:
* fast/js/regress/script-tests/Int32Array-alloc-large-long-lived.js:
* fast/js/regress/script-tests/Int32Array-alloc-large.js:
* fast/js/regress/script-tests/Int32Array-alloc-long-lived.js:
* fast/js/regress/script-tests/Int32Array-alloc.js:
* fast/js/regress/script-tests/Int8Array-alloc-long-lived.js:
* fast/js/regress/script-tests/array-nonarray-polymorhpic-access.js:
* fast/js/regress/script-tests/basic-set.js:
* fast/js/regress/script-tests/emscripten-memops.js:
* fast/js/regress/script-tests/inline-arguments-local-escape.js:
* fast/js/regress/script-tests/method-on-number.js:
* fast/js/regress/script-tests/nested-function-parsing-random.js:
* fast/js/regress/script-tests/nested-function-parsing.js:
* fast/js/regress/script-tests/new-array-buffer-push.js:
* fast/js/regress/script-tests/new-array-push.js:
* fast/js/regress/script-tests/poly-stricteq.js:
* fast/js/regress/script-tests/splice-to-remove.js:
* fast/js/regress/script-tests/string-equality.js:
* fast/js/regress/script-tests/string-repeat-arith.js:
* fast/js/regress/script-tests/string-sub.js:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(149636, merged in 153145): ToThis conversion doesn't work in the DFG
https://bugs.webkit.org/show_bug.cgi?id=120781

Reviewed by Mark Hahnenberg.
        
Roll this back in with a build fix.
        
- Use some method table hacks to detect if the CheckStructure optimization is
  valid for to_this.
        
- Introduce a FinalObjectUse and use it for ToThis->Identity conversion.
        
This looks like it might be perf-neutral on the major benchmarks, but it
introduces some horrible performance cliffs. For example if you add methods to
the Array prototype, you'll get horrible performance cliffs. As in virtual calls
to C++ every time you call a JS function even if it's inlined.
LongSpider/3d-cube appears to hit this.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGRepatch.cpp:
(JSC::DFG::emitPutTransitionStub):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::SafeToExecuteEdge::operator()):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::speculateFinalObject):
(JSC::DFG::SpeculativeJIT::speculate):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGUseKind.cpp:
(WTF::printInternal):
* dfg/DFGUseKind.h:
(JSC::DFG::typeFilterFor):
(JSC::DFG::isCell):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/js/dfg-* tests should wait for the concurrent JIT
https://bugs.webkit.org/show_bug.cgi?id=120723

Rubber stamped by Oliver Hunt.
        
Convert more tests.

* fast/js/dfg-check-structure-elimination-for-non-cell-expected.txt:
* fast/js/dfg-check-two-structures-expected.txt:
* fast/js/dfg-compare-final-object-to-final-object-or-other-expected.txt:
* fast/js/dfg-compare-final-object-to-final-object-or-other-when-both-proven-final-object-expected.txt:
* fast/js/dfg-compare-final-object-to-final-object-or-other-when-proven-final-object-expected.txt:
* fast/js/dfg-constant-fold-first-local-read-after-block-merge-expected.txt:
* fast/js/dfg-constant-fold-logical-not-branch-expected.txt:
* fast/js/dfg-constant-fold-misprediction-expected.txt:
* fast/js/dfg-constant-fold-uncaptured-variable-that-is-later-captured-expected.txt:
* fast/js/dfg-convert-this-dom-window-expected.txt:
* fast/js/dfg-convert-this-object-then-exit-on-other-expected.txt:
* fast/js/dfg-convert-this-other-then-exit-on-object-expected.txt:
* fast/js/dfg-convert-this-polymorphic-object-then-exit-on-other-expected.txt:
* fast/js/dfg-convert-this-polymorphic-object-then-exit-on-string-expected.txt:
* fast/js/dfg-create-inlined-arguments-in-closure-inline-expected.txt:
* fast/js/dfg-cross-global-object-inline-new-array-literal-expected.txt:
* fast/js/dfg-cross-global-object-inline-new-array-literal-with-variables-expected.txt:
* fast/js/jsc-test-list:
* fast/js/script-tests/dfg-check-structure-elimination-for-non-cell.js:
* fast/js/script-tests/dfg-check-two-structures.js:
* fast/js/script-tests/dfg-compare-final-object-to-final-object-or-other-when-both-proven-final-object.js:
* fast/js/script-tests/dfg-compare-final-object-to-final-object-or-other-when-proven-final-object.js:
* fast/js/script-tests/dfg-compare-final-object-to-final-object-or-other.js:
* fast/js/script-tests/dfg-constant-fold-first-local-read-after-block-merge.js:
* fast/js/script-tests/dfg-constant-fold-logical-not-branch.js:
* fast/js/script-tests/dfg-constant-fold-misprediction.js:
* fast/js/script-tests/dfg-constant-fold-uncaptured-variable-that-is-later-captured.js:
* fast/js/script-tests/dfg-convert-this-dom-window.js:
* fast/js/script-tests/dfg-convert-this-object-then-exit-on-other.js:
* fast/js/script-tests/dfg-convert-this-other-then-exit-on-object.js:
* fast/js/script-tests/dfg-convert-this-polymorphic-object-then-exit-on-other.js:
* fast/js/script-tests/dfg-convert-this-polymorphic-object-then-exit-on-string.js:
* fast/js/script-tests/dfg-create-inlined-arguments-in-closure-inline.js:
* fast/js/script-tests/dfg-cross-global-object-inline-new-array-literal-with-variables.js:
(done):
(doit):
* fast/js/script-tests/dfg-cross-global-object-inline-new-array-literal.js:
(done):
(doit):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-06  Mike West  <mkwst@chromium.org>

        Revalidation header blacklisting should be case-insensitive.
        https://bugs.webkit.org/show_bug.cgi?id=120832

        Reviewed by Alexey Proskuryakov.

        Headers like 'content-type' should be ignored for 304 responses,
        even if they are delivered as 'Content-Type', or 'CoNtEnT-TyPe', etc.

        I broke this behavior in http://trac.webkit.org/changeset/142068
        ("Entity-header extension headers honored on 304 responses"). Pages like
        https://learndev.unm.edu/ currently break on reload, as they incorrectly
        send 'Content-Type: text/plain' for 304 responses for resources like
        CSS and JavaScript. The browser should drop these headers, but because
        we're comparing in a case-sensitive fashion, we don't.

        https://code.google.com/p/chromium/issues/detail?id=246875 documents the
        Blink-side fix; this patch is a port of that patch.

        Test: http/tests/cache/content-type-ignored-during-revalidation.html

        * loader/cache/CachedResource.cpp:
        (WebCore::shouldUpdateHeaderAfterRevalidation):
        Compare the provided AtomicString 'header' to the revalidation
        blacklists in a case-insensitive fashion.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix run-jsc-stress-tests to use Pathname instead of File.realpath.
        
Also make it uses system() instead of popen(); that means that test output
will go to the console. This reduces error detection flakiness. It's fine
because stress tests don't print() unless they really have to.

Rubber stamped by Mark Hahnenberg.

* Scripts/run-jsc-stress-tests:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Actually increment $numFailures

Reviewed by Mark Hahnenberg.

* Scripts/run-jsc-stress-tests:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Calling window.close() should indicate failure with warning message
https://bugs.webkit.org/show_bug.cgi?id=120156

Reviewed by Darin Adler.

Closing of window is allowed for the tests for the automation.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::close):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Revalidation header blacklisting should be case-insensitive.
        https://bugs.webkit.org/show_bug.cgi?id=120832

        Reviewed by Alexey Proskuryakov.

        Adds a new test to verify that a CSS file served initially as type
        'text/css' maintains that type even if a revalidation response sends
        'text/plain' along with a 304 response.

        * http/tests/cache/content-type-ignored-during-revalidation-expected.txt: Added.
        * http/tests/cache/content-type-ignored-during-revalidation.html: Added.
        * http/tests/cache/resources/stylesheet304-bad-content-type.php: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Concurrent FTL causes !hasOptimizedReplacement() asserts in cti_optimize
https://bugs.webkit.org/show_bug.cgi?id=120890

Reviewed by Mark Hahnenberg.
        
Don't install an FTL code block if the DFG code block has already been jettisoned.

* dfg/DFGToFTLDeferredCompilationCallback.cpp:
(JSC::DFG::ToFTLDeferredCompilationCallback::compilationDidComplete):



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