PNGImageDecoder: Handle interlace buffer allocation failure
https://bugs.webkit.org/show_bug.cgi?id=85276

Reviewed by Eric Seidel.

No new tests. Not something we can easily test (malloc failure).

* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::rowAvailable): Check interlace buffer allocations
and bail via longjmp on failure. Note PNG_INTERLACE_ADAM7 is the only libpng
supported interlace type so test for it explicitly.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Calendar Picker: Close the picker by ESC key
https://bugs.webkit.org/show_bug.cgi?id=85337

Reviewed by Kentaro Hara.

No new tests. Calendar picker is not testable in DRT yet.

* Resources/calendarPicker.js:
(handleGlobalKey): Close the popup by ESC key.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
datalist: Form control in a <datalist> should be barred from constraint validation
https://bugs.webkit.org/show_bug.cgi?id=84359

Reviewed by Kent Tamura.

Source/WebCore:

Tests: fast/forms/datalist/datalist-child-validation.html
       fast/forms/form-control-element-crash.html

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::HTMLFormControlElement):
(WebCore::HTMLFormControlElement::updateAncestors): Updates the ancestor information.
(WebCore::HTMLFormControlElement::insertedInto): Invalidate the ancestor information and call setNeedsWillValidateCheck because willValidate might have changed.
(WebCore::HTMLFormControlElement::removedFrom): Ditto.
(WebCore::HTMLFormControlElement::disabled):
(WebCore::HTMLFormControlElement::recalcWillValidate): Returns false if element has a datalist ancestor.
(WebCore::HTMLFormControlElement::willValidate): Check if ancestor information is valid too.
(WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
* html/HTMLFormControlElement.h:
(HTMLFormControlElement):

LayoutTests:

* fast/forms/datalist/datalist-child-validation-expected.txt: Added.
* fast/forms/datalist/datalist-child-validation.html: Added. Tests that willValidate changes from false to true when we move the element out of the datalist.
* fast/forms/form-control-element-crash-expected.txt: Added.
* fast/forms/form-control-element-crash.html: Added. Tests for the crash reported in Bug 85149.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modify RealtimeAnalyserNode pull mechanism
https://bugs.webkit.org/show_bug.cgi?id=77515

Patch by Raymond Liu <raymond.liu@intel.com> on 2012-05-01
Reviewed by Chris Rogers.

Source/WebCore:

Test: webaudio/automatic-pull-node.html

* GNUmakefile.list.am:
* Modules/webaudio/AudioBasicInspectorNode.cpp: Added.
(WebCore):
(WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
(WebCore::AudioBasicInspectorNode::pullInputs):
(WebCore::AudioBasicInspectorNode::connect):
(WebCore::AudioBasicInspectorNode::disconnect):
(WebCore::AudioBasicInspectorNode::checkNumberOfChannelsForInput):
(WebCore::AudioBasicInspectorNode::updatePullStatus):
* Modules/webaudio/AudioBasicInspectorNode.h: Added.
(WebCore):
(AudioBasicInspectorNode):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::AudioContext):
(WebCore::AudioContext::~AudioContext):
(WebCore::AudioContext::handlePreRenderTasks):
(WebCore::AudioContext::handlePostRenderTasks):
(WebCore::AudioContext::markForDeletion):
(WebCore):
(WebCore::AudioContext::addAutomaticPullNode):
(WebCore::AudioContext::removeAutomaticPullNode):
(WebCore::AudioContext::updateAutomaticPullNodes):
(WebCore::AudioContext::processAutomaticPullNodes):
* Modules/webaudio/AudioContext.h:
(AudioContext):
* Modules/webaudio/AudioDestinationNode.cpp:
(WebCore::AudioDestinationNode::provideInput):
* Modules/webaudio/AudioNode.h:
(AudioNode):
* Modules/webaudio/AudioNodeOutput.h:
(WebCore::AudioNodeOutput::isConnected):
(AudioNodeOutput):
* Modules/webaudio/RealtimeAnalyserNode.cpp:
(WebCore::RealtimeAnalyserNode::RealtimeAnalyserNode):
* Modules/webaudio/RealtimeAnalyserNode.h:
(RealtimeAnalyserNode):
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* webaudio/automatic-pull-node-expected.txt: Added.
* webaudio/automatic-pull-node.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: enable ctrl-arrow move by word visually in non-Windows platforms.
https://bugs.webkit.org/show_bug.cgi?id=85017

Reviewed by Ryosuke Niwa.

Enable ctrl-arrow moves caret by word in visual order in non-Windows platforms that use ICU word
break iterator (it is not enabled for WinCE and Qt where ICU is not used). For those platforms, ctrl-arrow
moves caret to word break position before spaces. For example, given a logical text "abc def hij", the word
break positions using ctrl-left-arrow from rightmost position are "|abc |def |hij".
The word break positions using ctrl-right-arrow from leftmost position are "abc| def| hij|".

Test: editing/selection/move-by-word-visually-mac.html

* editing/EditingBehavior.h:
(EditingBehavior):
(WebCore::EditingBehavior::shouldEatSpaceToNextWord): To control different word break positions
(regards to space) for different platforms.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::modifyMovingRight): Enable visual word movement for all platforms that use ICU.
(WebCore::FrameSelection::modifyMovingLeft):
* editing/visible_units.cpp:
(WebCore::visualWordPosition): Determine the right word break position (regards to space) based on EditingBehavior.
(WebCore::leftWordPosition):
(WebCore::rightWordPosition):
* editing/visible_units.h:

LayoutTests: enable ctrl-arrow move by word visually in other platforms (besides Windows)
https://bugs.webkit.org/show_bug.cgi?id=85017

Reviewed by Ryosuke Niwa.

Since DOMSelection.modify('move', 'left'/'right', 'word') moves caret by word in visual order (instead of
logical order) now, there are several changes to the test file:
1. file name renamed from move-left-right-by-word-mac.html to move-by-word-visually-mac.html.
2. test expectations change from moving caret by word in logical order to moving caret by word in visual order.
3. since test expectations are inside test file itself, test file itself changes accordingly.

* editing/selection/move-by-word-visually-mac-expected.txt: Copied from LayoutTests/editing/selection/move-left-right-by-word-mac-expected.txt.
* editing/selection/move-by-word-visually-mac.html: Copied from LayoutTests/editing/selection/move-left-right-by-word-mac.html.
* editing/selection/move-left-right-by-word-mac-expected.txt: Removed.
* editing/selection/move-left-right-by-word-mac.html: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
webkitpy: Remove unused platform imports.
https://bugs.webkit.org/show_bug.cgi?id=85341

Reviewed by Eric Seidel.

Remove a few uses of `import platform' which were either rendered
unneeded after r105931 or were never needed at all.

* Scripts/webkitpy/common/system/executive.py:
* Scripts/webkitpy/tool/bot/flakytestreporter.py:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-05-01  Xiaomei Ji  <xji@chromium.org>

        Skip editing/selection/move-by-word-visually-mac.html (introduced in r115788) in qt and wk2.

        * platform/qt/Skipped:
        * platform/wk2/Skipped:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fullscreen pop-up logic restored to using processingUserGesture.
https://bugs.webkit.org/show_bug.cgi?id=85105

WebKit was recently updated to the new Fullscreen API:
http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html#api
http://trac.webkit.org/changeset/111028

This change reverts back to using processingUserGesture() instead
of DOMWindow::allowPopUp(). This fixes incorrect behavior in
at least the Chromium port and is consistent with the cited
definition of "allowed to show a pop-up":
  An algorithm is allowed to show a pop-up if, in the task in which the algorithm is running, either:
  - an activation behavior is currently being processed whose click event was trusted, or
  - the event listener for a trusted click event is being handled.

Reviewed by Dimitri Glazkov.

No new tests.

* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unnecessary <form> tags created inside of an <iframe> with designMode on
https://bugs.webkit.org/show_bug.cgi?id=13126

Reviewed by Eric Seidel.

Add a regression test since this bug doesn't reproduce anymore but it's still good to test it.

* editing/inserting/insert-paragraph-inside-form-expected.txt: Added.
* editing/inserting/insert-paragraph-inside-form.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Move date-input-visible-strings-expected.txt to the correct place.

* platform/chromium-linux/fast/forms/date/date-input-visible-strings-expected.txt: Renamed from LayoutTests/platform/chromium-linux-x86/fast/forms/date/date-input-visible-strings-expected.txt.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add <iframe seamless> navigation code (and pass all the navigation tests)
https://bugs.webkit.org/show_bug.cgi?id=85340

Reviewed by Adam Barth.

Source/WebCore:

This code was primarily written by Adam Barth and then submitted to my
GitHub branch via a pull request:
https://github.com/eseidel/webkit/compare/master...seamless
https://github.com/eseidel/webkit/pull/2
https://github.com/eseidel/webkit/pull/3

I rewrote parts of it to use Docment::shouldDisplaySeamlesslyWithParent.

Other parts of the original change have already been committed to WebKit by Adam
as part of prep-work for making the loader seamless-ready.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::findFrameForNavigation):

LayoutTests:

Update results now that we pass all the navigation tests.

* fast/frames/seamless/seamless-form-get-expected.txt:
* fast/frames/seamless/seamless-form-get-named-expected.txt:
* fast/frames/seamless/seamless-form-post-expected.txt:
* fast/frames/seamless/seamless-form-post-named-expected.txt:
* fast/frames/seamless/seamless-hyperlink-expected.txt:
* fast/frames/seamless/seamless-hyperlink-named-expected.txt:
* fast/frames/seamless/seamless-window-location-expected.txt:
* fast/frames/seamless/seamless-window-location-href-expected.txt:
* fast/frames/seamless/seamless-window-location-sandbox-expected.txt:
* fast/frames/seamless/seamless-window-open-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Add an Isolate parameter to setJSWrapperForXXX()
https://bugs.webkit.org/show_bug.cgi?id=85329

Reviewed by Adam Barth.

The objective is to pass Isolate around in V8 bindings.
This patch adds an Isolate parameter to setJSWrapperForXXX()
and passes Isolate to setJSWrapperForXXX() in CodeGeneratorV8.pm.
I'll pass Isolate to setJSWrapperForXXX() in custom bindings
in a follow-up patch.

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorV8.pm: Modified as described above.
(GenerateConstructorCallback):
(GenerateEventConstructorCallback):
(GenerateNamedConstructorCallback):
(GenerateToV8Converters):
* bindings/v8/V8DOMWrapper.cpp:
(WebCore::V8DOMWrapper::setJSWrapperForDOMNode):
(WebCore::V8DOMWrapper::setJSWrapperForActiveDOMNode):
* bindings/v8/V8DOMWrapper.h:
(V8DOMWrapper):
(WebCore::V8DOMWrapper::setJSWrapperForDOMObject):
(WebCore::V8DOMWrapper::setJSWrapperForActiveDOMObject):

* bindings/scripts/test/V8/V8Float64Array.cpp: Updated run-bindings-tests results.
(WebCore::V8Float64Array::wrapSlow):
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
(WebCore::V8TestActiveDOMObject::wrapSlow):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
(WebCore::V8TestCustomNamedGetter::wrapSlow):
* bindings/scripts/test/V8/V8TestEventConstructor.cpp:
(WebCore::V8TestEventConstructor::constructorCallback):
(WebCore::V8TestEventConstructor::wrapSlow):
* bindings/scripts/test/V8/V8TestEventTarget.cpp:
(WebCore::V8TestEventTarget::wrapSlow):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore::V8TestInterface::constructorCallback):
(WebCore::V8TestInterface::wrapSlow):
* bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
(WebCore::V8TestMediaQueryListListener::wrapSlow):
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
(WebCore::V8TestNamedConstructorConstructorCallback):
(WebCore::V8TestNamedConstructor::wrapSlow):
* bindings/scripts/test/V8/V8TestNode.cpp:
(WebCore::V8TestNode::constructorCallback):
(WebCore::V8TestNode::wrapSlow):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::V8TestObj::constructorCallback):
(WebCore::V8TestObj::wrapSlow):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
(WebCore::V8TestSerializedScriptValueInterface::constructorCallback):
(WebCore::V8TestSerializedScriptValueInterface::wrapSlow):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up media canPlayType() tests and add a test for WebM.
https://bugs.webkit.org/show_bug.cgi?id=85116

Reviewed by Eric Carlson.

* media/media-can-play-flac-audio-expected.txt:
* media/media-can-play-flac-audio.html:
* media/media-can-play-mpeg-audio-expected.txt:
* media/media-can-play-mpeg-audio.html:
* media/media-can-play-mpeg4-video.html:
* media/media-can-play-octet-stream-expected.txt:
* media/media-can-play-octet-stream.html:
* media/media-can-play-ogg-expected.txt:
* media/media-can-play-ogg.html:
* media/media-can-play-type-expected.txt: Renamed from LayoutTests/media/video-can-play-type-expected.txt.
* media/media-can-play-type.html: Added.
* media/media-can-play-wav-audio-expected.txt:
* media/media-can-play-wav-audio.html:
* media/media-can-play-webm-expected.txt: Added.
* media/media-can-play-webm.html: Added.
* media/video-can-play-type.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Adjust baseline location for media/media-can-play-type-webm.html.

* platform/chromium/media/media-can-play-webm-expected.txt: Renamed from LayoutTests/media/media-can-play-webm-expected.txt.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Implement the Web Audio API feature.
https://bugs.webkit.org/show_bug.cgi?id=78688

Patch by Dongwoo Im <dw.im@samsung.com> on 2012-05-02
Reviewed by Philippe Normand.

Implement the Web Audio API feature on the EFL port.
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html

.:

* Source/cmake/FindGStreamer-Audio.cmake: Added. Find the pkgconfig of the GStreamer-audio.
* Source/cmake/FindGStreamer-FFT.cmake: Added. Find the pkgconfig of the GStreamer-fft.
* Source/cmake/OptionsEfl.cmake: Add the ENABLE_WEB_AUDIO option.
* Source/cmakeconfig.h.cmake: Add the ENABLE_WEB_AUDIO option.

Source/WebCore:

* CMakeLists.txt: Add the list of the files which are needed for the Web Audio APi.
* PlatformEfl.cmake: Add the list of the files which are needed for the Web Audio APi.
* UseJSC.cmake: Add the list of the files which are needed for the Web Audio APi.
* platform/audio/HRTFElevation.cpp: Enable the USE_CONCATENATED_IMPULSE_RESPONSES macro.
(WebCore):
* platform/audio/efl/AudioBusEfl.cpp: Added.
(WebCore):
(WebCore::AudioBus::loadPlatformResource): Create the absolute path of the audio resource.

Source/WebKit/efl:

* ewk/ewk_view.cpp: Add the setter/getter of the webaudio feature.
(_Ewk_View_Private_Data):
(_ewk_view_priv_new):
(ewk_view_setting_web_audio_get): Enable/disable the Web Audio API feature.
(ewk_view_setting_web_audio_set): Query if the Web Audio API feature is enabled.
* ewk/ewk_view.h: Add the prototypes.

LayoutTests:

* platform/efl/Skipped: Change the comment of webaudio.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] QQuickWebView does not allow for input from virtual keyboard
https://bugs.webkit.org/show_bug.cgi?id=85350

Reviewed by Kenneth Christiansen.

It is necessary to set the ItemAcceptsInputMethod flag on the QQuickWebView if we have editable
content, in order for the input method to recognize that we can handle input method events.

Analyzed by Michael Brüning.

* UIProcess/API/qt/qquickwebview.cpp: Add simple hook for executing JS as private C++ API.
(JSCallbackClosure):
(javaScriptCallback):
(QQuickWebView::runJavaScriptInMainFrame):
* UIProcess/API/qt/qquickwebview_p.h:
* UIProcess/API/qt/tests/html/inputmethod.html: Added.
* UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
(tst_QQuickWebView):
(tst_QQuickWebView::runJavaScript): Simple helper for running JS.
(tst_QQuickWebView::inputMethod): Added simple test for ItemAcceptsInputMethod toggling.
* UIProcess/qt/QtWebPageEventHandler.cpp:
(WebKit::QtWebPageEventHandler::updateTextInputState): Set ItemAcceptsInputMethod as soon as we
have editable content.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt]r57240 broke Qt build (gcc bug)
https://bugs.webkit.org/show_bug.cgi?id=37253

Patch by Adenilson Cavalcanti <cavalcantii@gmail.com> on 2012-05-02
Reviewed by Noam Rosenthal.

Removing workaround macro since current gcc/Qt doesn't require it to compile.

* wtf/PassRefPtr.h:
(WTF):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed test rebaseline after r115749.

* platform/chromium-mac-leopard/media/audio-controls-rendering-expected.png:
* platform/chromium-mac-leopard/media/audio-repaint-expected.png:
* platform/chromium-mac-leopard/media/controls-after-reload-expected.png:
* platform/chromium-mac/media/audio-controls-rendering-expected.png:
* platform/chromium-mac/media/audio-repaint-expected.png:
* platform/chromium-mac/media/controls-after-reload-expected.png:
* platform/chromium-mac/media/controls-layout-direction-expected.png:
* platform/chromium-mac/media/media-controls-clone-expected.png:
* platform/chromium-win/media/audio-controls-rendering-expected.png:
* platform/chromium-win/media/audio-repaint-expected.png:
* platform/chromium-win/media/controls-after-reload-expected.png:
* platform/chromium-win/media/controls-layout-direction-expected.png:
* platform/chromium-win/media/media-controls-clone-expected.png:
* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: Web Inspector doesn't show cookies anymore
https://bugs.webkit.org/show_bug.cgi?id=85349

Pass root node instead of DataGrid object to the "populateNode" method.
Added compiler annotations so that closure compiler catches such errors.

Reviewed by Pavel Feldman.

* inspector/front-end/CookiesTable.js:
(WebInspector.CookiesTable.prototype._rebuildTable):
* inspector/front-end/NetworkRequest.js:
(WebInspector.NetworkRequest.prototype.addFrameError):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115804 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StyleSheetInternal::parseUserStyleSheet() should be called parseAuthorStyleSheet().

Rubber-stamped by Nikolas Zimmermann.

* css/CSSImportRule.cpp:
(WebCore::StyleRuleImport::setCSSStyleSheet):
* css/CSSStyleSheet.cpp:
(WebCore::StyleSheetInternal::parseAuthorStyleSheet):
* css/CSSStyleSheet.h:
(StyleSheetInternal):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setCSSStyleSheet):



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