SVG <use> element inside an svg-as-image fails
https://bugs.webkit.org/show_bug.cgi?id=104007

Reviewed by Eric Seidel.

Upon redraw, SVGImage calls layout on the document it is drawing into
the image if the image, provided it believes the redraw does not need
to be delayed. Unfortunately, when an SVG <use> element is modified
(by animation, say) and regenerates its shadow tree, the destructors
invoke redraw, causing the SVGImage to call layout on something that
is in the process of being deleted. That's bad.

This change causes SVGImage to always delay the redraw. It is the most robust
way to protect against this problem, as there may be any number of
ways to cause this issue (a node being deleted in an svg-as-image
target) and this protects against them all.

The test case crashes in Asan Chromium.

Source/WebCore: 

Test: svg/as-image/animated-use-as-image-crash.html

* svg/graphics/SVGImageCache.cpp:
(WebCore::SVGImageCache::imageContentChanged): Always redraw on the timer.

LayoutTests: 

* platform/chromium-win/svg/custom/use-disappears-after-style-update-expected.png: Changed as a result of this change.
* svg/as-image/animated-use-as-image-crash-expected.txt: Added.
* svg/as-image/animated-use-as-image-crash.html: Added.
* svg/as-image/resources/animated-href-on-use.svg: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136845 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speech Recognition API: Change the error code to a string on SpeechRecognitionError
https://bugs.webkit.org/show_bug.cgi?id=104254

Reviewed by Adam Barth.

Source/WebCore:

SpeechRecognitionError::code (numeric value) has been changed to SpeechRecognitionError::error (string)
in the latest specification.

http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechreco-error

Existing tests modified to cover this patch.

* Modules/speech/SpeechRecognitionError.cpp:
(WebCore::ErrorCodeToString):
(WebCore):
(WebCore::SpeechRecognitionError::create):
(WebCore::SpeechRecognitionError::SpeechRecognitionError):
* Modules/speech/SpeechRecognitionError.h:
(SpeechRecognitionErrorInit):
(WebCore::SpeechRecognitionError::error):
(SpeechRecognitionError):
* Modules/speech/SpeechRecognitionError.idl:

Source/WebKit/chromium:

Minor WebCore type changes.

* src/AssertMatchingEnums.cpp:
* src/SpeechRecognitionClientProxy.cpp:
(WebKit::SpeechRecognitionClientProxy::didReceiveError):

Tools:

Changes the mock error function to take a string instead of an int.

* DumpRenderTree/chromium/DRTTestRunner.cpp:
(DRTTestRunner::setMockSpeechRecognitionError):
* DumpRenderTree/chromium/MockWebSpeechRecognizer.cpp:
(WebTestRunner::ErrorTask::ErrorTask):
(MockWebSpeechRecognizer::setError):
* DumpRenderTree/chromium/MockWebSpeechRecognizer.h:
(MockWebSpeechRecognizer):

LayoutTests:

Adjusting tests.

* fast/events/constructors/speech-recognition-error-constructor-expected.txt:
* fast/events/constructors/speech-recognition-error-constructor.html:
* fast/speech/scripted/speechrecognition-errors-expected.txt:
* fast/speech/scripted/speechrecognition-errors.html:
* fast/speech/scripted/speechrecognitionerror-basics-expected.txt:
* fast/speech/scripted/speechrecognitionerror-basics.html:
* platform/chromium/fast/events/constructors/speech-recognition-error-constructor-expected.txt:


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