[GTK][WK2] Move Vector objects into WebEditorClient::executePendingEditorCommands() invocations
https://bugs.webkit.org/show_bug.cgi?id=131454

Reviewed by Carlos Garcia Campos.

* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::executePendingEditorCommands): Take a const reference of the Vector
object to avoid unnecessary copies. Also deploy two range-based for loops and efficiently move
the Editor::Command objects into the other Vector.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Optimize Canvas fill and drawImage with SourceIn, DestinationIn, SourceOut, and DestinationAtop using transparencyLayer.
https://bugs.webkit.org/show_bug.cgi?id=79659

Patch by Dirk Schulze <krit@webkit.org> on 2014-04-11
Reviewed by Andreas Kling.

Add performance tests for fillRect() and drawImage() on composited contexts.

* Canvas/compositing-drawimage.html: Added.
* Canvas/compositing-fillRect.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Optimize Canvas fill and drawImage with SourceIn, DestinationIn, SourceOut, and DestinationAtop using transparencyLayer.
https://bugs.webkit.org/show_bug.cgi?id=79659

Patch by Dirk Schulze <krit@webkit.org> on 2014-04-11
Reviewed by Andreas Kling.

Add performance tests for real this time.

* Canvas/compositing-drawimage.html: Added.
* Canvas/compositing-fillRect.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Unreviewed GTK gardening.

Update test expectations for flaky tests timing out:
  media/track/track-remove-active-cue-crash.html
  media/media-ended.html
  media/audio-mpeg-supported.html

Patch by Enrique Ocaña González <eocanha@igalia.com> on 2014-04-11

* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebGL: need error checking after texture uploads
https://bugs.webkit.org/show_bug.cgi?id=62902
rdar://problem/9640309

Reviewed by Brent Fulgham.

A followup to Darin's r167109. We need to also check for errors
in the texImage2D case.

This is difficult to reproducibly test because it would require
attempting to exhaust GPU memory.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::compressedTexImage2D): Check for errors by calling
moveErrorsToSyntheticErrorList twice, once before and once after. If an error
occurred, explicitly mark the texture as invalid.
(WebCore::WebGLRenderingContext::texImage2DBase): Ditto.
* html/canvas/WebGLTexture.cpp:
(WebCore::WebGLTexture::markInvalid): If the LevelInfo exists for this
mipmap level, then set the valid flag to false. There is a chance that
a previous call to texImage2D succeeded for this level, but it's probably
better to assume that is now invalid.
* html/canvas/WebGLTexture.h: New markInvalid method.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix LLInt for sh4 architecture (broken since C stack merge).
https://bugs.webkit.org/show_bug.cgi?id=131532

Reviewed by Mark Lam.

This patch fixes build and also implements sh4 parts for initPCRelative and
setEntryAddress macros introduced in http://trac.webkit.org/changeset/167094.

* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* offlineasm/instructions.rb:
* offlineasm/sh4.rb:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
wk2-gtk does not display anything
https://bugs.webkit.org/show_bug.cgi?id=125558

Reviewed by Martin Robinson.

Remove fcntl call to set access mode flags on the duplicated files
descriptor. Those flags are ignored in Linux and make fcntl to
fail in FreeBSD. We should handle the case where the passed
protection is ReadOnly.
Thanks to Raphael Kubo da Costa who proposed the solution.

* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::createHandle):
(WebKit::accessModeFile): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel rendering: WK1: Trail of cruft in redraw during animations.
https://bugs.webkit.org/show_bug.cgi?id=131525

Reviewed by Simon Fraser.

Use enclosing rect instead of snapping to make sure the repaint rect always
covers the dirty area when painting is requested in a non-compositing RenderView.
This only applies to WK1 as WK2 has compositing RenderView and the repainting
is managed by RenderLayerBacking.

This is a temporary solution until after ScrollView/FrameView/RenderView
is transitioned to device pixels. (tracked here: webkit.org/b/131526).

Source/WebCore:

Test: fast/repaint/hidpi-block-width-change-leaves-cruft.html

* rendering/RenderView.cpp:
(WebCore::RenderView::repaintViewRectangle):

LayoutTests:

* fast/repaint/hidpi-block-width-change-leaves-cruft-expected.html: Added.
* fast/repaint/hidpi-block-width-change-leaves-cruft.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Prevent crash when exiting fullscreen mode
https://bugs.webkit.org/show_bug.cgi?id=131528

Reviewed by Jer Noble.

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
Clean up the _scaleAnimation controller, not just the _fadeAnimation controller.
(-[WKFullScreenWindowController close]): If we are doing an immediate
close of the view, we need to stop animations so we avoid any
final timer events from interacting with invalid window handles.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
"playbackTime" parameter is not present in AudioProcessingEvent Interface as per W3C spec
https://bugs.webkit.org/show_bug.cgi?id=105518

Patch by Praveen R Jadhav <praveen.j@samsung.com> on 2014-04-11
Reviewed by Jer Noble.

Source/WebCore:

Attribute "playbackTime" in AudioProcessingEvent implemented to pass playback time of
audiobuffer associated with ScriptProcessorNode of the context.

Reference: https://codereview.chromium.org/210973002

Spec: http://www.w3.org/TR/webaudio/#AudioProcessingEvent

Test: webaudio/audioprocessingevent.html

* Modules/webaudio/AudioProcessingEvent.cpp:
(WebCore::AudioProcessingEvent::create):
(WebCore::AudioProcessingEvent::AudioProcessingEvent):
* Modules/webaudio/AudioProcessingEvent.h:
(WebCore::AudioProcessingEvent::playbackTime):
* Modules/webaudio/AudioProcessingEvent.idl:
* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::fireProcessEvent):

LayoutTests:

Test case added to check AudioProcessingEvent attributes.

* webaudio/audioprocessingevent-expected.txt: Added.
* webaudio/audioprocessingevent.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] inset args and radial args should serialize to the simplest form
https://bugs.webkit.org/show_bug.cgi?id=129825

Reviewed by Dirk Schulze.

Source/WebCore:

Modify inset serialization to omit components where possible. The insets simplify
according to the margin shorthand, while the corner radii simplify according to
the border-radius shorthand.

Modifying existing parsing tests.

* css/CSSBasicShapes.cpp:
(WebCore::buildInsetRadii): Add the necessary radii, omitting components where possible.
(WebCore::buildInsetString): Omit components where possible.

LayoutTests:

Modify tests to use the shortened inset serialization.

* animations/resources/animation-test-helpers.js: Accept shortened inset forms.
* css3/masking/clip-path-animation-expected.txt:
* css3/masking/clip-path-animation.html:
* fast/masking/parsing-clip-path-shape-expected.txt:
* fast/masking/parsing-clip-path-shape.html:
* fast/shapes/parsing/parsing-shape-lengths-expected.txt:
* fast/shapes/parsing/parsing-shape-lengths.html:
* fast/shapes/parsing/parsing-shape-outside-expected.txt:
* fast/shapes/parsing/parsing-test-utils.js:
* fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt:
* fast/shapes/shape-outside-floats/shape-outside-animation.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Remove shared PageScriptDebugServer, create per-Page
https://bugs.webkit.org/show_bug.cgi?id=131523

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-04-11
Reviewed by Timothy Hatcher.

Having a shared PageScriptDebugServer was causing issues when we called
JSC::Debugger::clearBreakpoints() closing one inspector while another
is open for another WebCore::Page in the same process. Having the same
JSC::Debugger underlying multiple InspectorDebuggerAgent instances
means that when clearBreakpoints is called, the real JSC breakpoints
underlying other InspectorDebuggerAgent's get removed. When those
InspectorDebuggerAgents attempt to remove their breakpoints they
encounter unexpected issues.

This entirely rebuilds PageScriptDebugServer to be per-Page instead
of shared across all pages. So take this opportunity to move the
file from WebCore/bindings/js to WebCore/inspector.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/PageScriptDebugServer.h: Removed.
* inspector/InspectorAllInOne.cpp:
Move PageScriptDebugServer.

* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
Set the ScriptDebugServer directly on some other agents that
were previously using the global debug server.

* inspector/InspectorProfilerAgent.h:
(WebCore::InspectorProfilerAgent::scriptDebugServer):
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::InspectorProfilerAgent):
(WebCore::InspectorProfilerAgent::setScriptDebugServer):
(WebCore::InspectorProfilerAgent::start):
(WebCore::InspectorProfilerAgent::willDestroyFrontendAndBackend): Deleted.
* inspector/InspectorTimelineAgent.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::start):
(WebCore::InspectorTimelineAgent::stop):
(WebCore::InspectorTimelineAgent::setPageScriptDebugServer):
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
Refactor these two agents to take in a script debug server.
The server is expected to be set during initialization and
to always be valid (like debug server on RuntimeAgent).

* inspector/PageDebuggerAgent.h:
* inspector/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::PageDebuggerAgent):
(WebCore::PageDebuggerAgent::startListeningScriptDebugServer):
(WebCore::PageDebuggerAgent::stopListeningScriptDebugServer):
(WebCore::PageDebuggerAgent::scriptDebugServer):
Have PageDebuggerAgent hold the PageScriptDebugServer.
Update for the simplified interfaces.

* inspector/PageScriptDebugServer.h: Added.
* inspector/PageScriptDebugServer.cpp: Renamed from Source/WebCore/bindings/js/PageScriptDebugServer.cpp.
(WebCore::PageScriptDebugServer::PageScriptDebugServer):
(WebCore::PageScriptDebugServer::addListener):
(WebCore::PageScriptDebugServer::removeListener):
(WebCore::PageScriptDebugServer::recompileAllJSFunctions):
(WebCore::PageScriptDebugServer::didPause):
(WebCore::PageScriptDebugServer::didContinue):
(WebCore::PageScriptDebugServer::runEventLoopWhilePaused):
(WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal):
(WebCore::PageScriptDebugServer::isContentScript):
(WebCore::PageScriptDebugServer::reportException):
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
Model after JSGlobalObjectScriptDebugServer, the PageScriptDebugServer
holds a reference to a Page.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167133 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid Vector copies in RenderGrid::placeItemsOnGrid()
https://bugs.webkit.org/show_bug.cgi?id=131452

Reviewed by Sergio Villar Senin.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Take in a const reference to the
Vector object. Make the for-loop that iterates through it range-based.
(WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Ditto.
* rendering/RenderGrid.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Heap-use-after-free in WebCore::SpeechSynthesisUtterance::startTime
https://bugs.webkit.org/show_bug.cgi?id=131482

Reviewed by David Kilzer.

Source/WebCore: 

Hold onto the utterance until it has time to fire, in case other references have been removed.

Merged from Blink r171077 by <dmazzoni@chromium.org>

Test: platform/mac/fast/speechsynthesis/speech-synthesis-gc-utterance-crash.html

* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::handleSpeakingCompleted):

LayoutTests: 

* platform/mac/fast/speechsynthesis/speech-synthesis-gc-utterance-crash-expected.txt: Added.
* platform/mac/fast/speechsynthesis/speech-synthesis-gc-utterance-crash.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: WebProcess at com.apple.WebCore: WebCore::AXObjectCache::rootObject + 18
https://bugs.webkit.org/show_bug.cgi?id=131522

Reviewed by Anders Carlsson.

Protect against documents that have had their render tree destroyed, and no longer return a valid cache.

* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add BuiltinLog function to make debugging builtins easier
https://bugs.webkit.org/show_bug.cgi?id=131550

Reviewed by Andreas Kling.

Add a logging function that builtins can use for debugging.

* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::reset):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncBuiltinLog):
* runtime/JSGlobalObjectFunctions.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167137 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pipe initial scale factor to TileController
https://bugs.webkit.org/show_bug.cgi?id=131521

Reviewed by Tim Horton.

Source/WebCore: 

* WebCore.exp.in:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setZoomedOutPageScaleFactor):
* page/Page.h:
(WebCore::Page::zoomedOutPageScaleFactor):
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::zoomedOutPageScaleFactor):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateContentsScale):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::TileController):
(WebCore::TileController::setContentsScale):
(WebCore::TileController::setZoomedOutContentsScale):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::zoomedOutPageScaleFactor):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::zoomedOutPageScaleFactor):
* rendering/RenderLayerCompositor.h:

Source/WebKit2: 

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::viewportConfigurationChanged):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Unreviewed GTK gardening.

Support for audio and video tracks was added on r158436. Stop skipping the following tests:
  media/track/audio-track.html
  media/track/video-track.html

Update bug number for media/track/track*in-band*.html tests

Report and update text expectations for new failing tests:
  media/track/track-remove-track.html
  fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-svg.html
  media/media-event-listeners.html

Update timeout expectation for media/video-controls-captions.html

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-04-11

* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Replay: CodeGeneratorJS should guard includes of replay-related headers
https://bugs.webkit.org/show_bug.cgi?id=131407

Reviewed by Timothy Hatcher.

This patch adds guards to headers that are only required by generated replay code
that is itself guarded. Other ports probably haven't added the headers to their
build files, so we don't want to emit the unused header includes.

This patch also converts generated uses of DEFINE_STATIC_LOCAL to NeverDestroyed<T>.
Finally, a new bindings test was added to document changes to generated replay code.

Test: Source/WebCore/bindings/scripts/test/TestNondeterministic.idl

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateImplementationFunctionCall):

* bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.cpp: Added.
* bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.h: Added.
* bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.symbols: Added.
* bindings/scripts/test/GObject/WebKitDOMTestNondeterministicPrivate.h: Added.
* bindings/scripts/test/JS/JSTestNondeterministic.cpp: Added.
* bindings/scripts/test/JS/JSTestNondeterministic.h: Added.
* bindings/scripts/test/ObjC/DOMTestNondeterministic.h: Added.
* bindings/scripts/test/ObjC/DOMTestNondeterministic.mm: Added.
* bindings/scripts/test/ObjC/DOMTestNondeterministicInternal.h: Added.
* bindings/scripts/test/TestNondeterministic.idl: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Add IconServices to WebProcess sandbox profile
https://bugs.webkit.org/show_bug.cgi?id=131558
<rdar://problem/16552397>

Reviewed by Brady Eidson.

* WebProcess/com.apple.WebProcess.sb.in:



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