[GTK] kill-old-processes should kill dbus-daemon processes
https://bugs.webkit.org/show_bug.cgi?id=127352

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

* BuildSlaveSupport/kill-old-processes:
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Provide a way for JSContext console to log to system console
https://bugs.webkit.org/show_bug.cgi?id=131050

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

Applications often re-expose some log -> NSLog functionality.
We already have the capability ourselves, which includes extra
information such as sourceURL:line:column, all arguments instead
of just one argument, and backtrace information on console.trace.
Therefore it would be convenient if developers could just use
the built-in console.log and get rich output in both the inspector
and the console, without writing their own logger.

The logging will be enabled in debug builds by default, and can be enabled
otherwise by setting a user default before creating the first context.

For example, in the application itself:

    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"JavaScriptCoreOutputConsoleMessagesToSystemConsole"];

Or from outside the application:

    shell> defaults write <app-bundle-identifier> JavaScriptCoreOutputConsoleMessagesToSystemConsole -bool YES

* inspector/JSConsoleClient.h:
* inspector/JSConsoleClient.cpp:
(Inspector::JSConsoleClient::logToSystemConsole):
(Inspector::JSConsoleClient::setLogToSystemConsole):
(Inspector::JSConsoleClient::initializeLogToSystemConsole):
(Inspector::JSConsoleClient::JSConsoleClient):
Global setting for logging to system console. Enabled on
debug builds, and by a user default on supported platforms.

(Inspector::JSConsoleClient::messageWithTypeAndLevel):
Log to system console when the static setting is enabled.

* runtime/ConsoleClient.h:
* runtime/ConsoleClient.cpp:
(JSC::appendURLAndPosition):
(JSC::appendMessagePrefix):
(JSC::ConsoleClient::printConsoleMessage):
(JSC::ConsoleClient::printConsoleMessageWithArguments):
Clean up printing. Build strings and use WTFLogAlways instead of printf
for consistant logging.

* runtime/ConsoleClient.cpp:
(JSC::ConsoleClient::printConsoleMessageWithArguments):
Clean up printing. If there is no source URL, don't print a leading colon.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Blending] Add compositing reason for isolation.
https://bugs.webkit.org/show_bug.cgi?id=131153

Patch by Ion Rosca <rosca@adobe.com> on 2014-04-04
Reviewed by Joseph Pecoraro.

Source/WebCore:

There are 2 reasons involving blend modes for a layer to be composited:
1) the layer has blend mode and has composited descendants: CompositingReasonBlendingWithCompositedDescendants.
2) the layer has to isolate composited blending descendants: CompositingReasonIsolatesCompositedBlendingDescendants

Test: inspector-protocol/layers/layers-blending-compositing-reasons.html

* inspector/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
* inspector/protocol/LayerTree.json:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::reasonsForCompositing):
(WebCore::RenderLayerCompositor::logReasonsForCompositing):
* rendering/RenderLayerCompositor.h: adding CompositingReasonIsolatesCompositedBlendingDescendants.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/LayerTreeSidebarPanel.js:
(WebInspector.LayerTreeSidebarPanel.prototype._populateListOfCompositingReasons):

LayoutTests:

* inspector-protocol/layers/layers-blending-compositing-reasons-expected.txt: Added.
* inspector-protocol/layers/layers-blending-compositing-reasons.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More documentation
https://bugs.webkit.org/show_bug.cgi?id=131238

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKNavigation.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Keep track of filtered active attribute/uniform indices per shader program.
https://bugs.webkit.org/show_bug.cgi?id=131235.

Reviewed by Dean Jackson.

Tests: Covered by existing Khronos Conformance tests. 
Will create a test to use multiple shader programs in a follow-up patch.

* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::cacheActiveAttribLocations): Use getActiveAttribImpl. We do not need to use the filtered list of attributes here.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getUniformLocation): Use filtered list of uniforms for uniform count.
* platform/graphics/GraphicsContext3D.h: Create a map of shader programs to ActiveShaderSymbolCounts.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::attachShader): 
When attaching or detaching a shader the shader program's active symbols list will change. Clear it so that it will be updated later.
(WebCore::GraphicsContext3D::detachShader): Ditto.
(WebCore::GraphicsContext3D::compileShader): No need to clear symbol counts here.
(WebCore::GraphicsContext3D::getActiveAttrib): getActiveAttrib should only be able to query for attributes in the filtered list.
(WebCore::GraphicsContext3D::getActiveUniform): getActiveUniform should only be able to query for uniforms in the filtered list.
(WebCore::GraphicsContext3D::getNonBuiltInActiveSymbolCount): Return the filtered symbol count for a shader program.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Upgrade to SelectorFailsAllSiblings when Child selector is failed.
https://bugs.webkit.org/show_bug.cgi?id=130961

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2014-04-04
Reviewed by Benjamin Poulain.

When Child selector fails, we should resume matching from the closest
Descendant selector.
So upgrading SelectorFailsLocally to SelectorFailsAllSibling at least
to prevent unnecessary direct/indirect adjacent selectors matching.

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Mark a flakey test that is failing intermittenly in pixel tests.

* platform/mac/TestExpectations:
Mark svg/as-image/svg-as-image-canvas.html as flakey.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Improve error checking in WebPageProxy::didReceiveEvent
https://bugs.webkit.org/show_bug.cgi?id=131243
<rdar://problem/16529207>

Reviewed by Anders Carlsson.

* UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didReceiveEvent):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Replay: capture and replay wheel events and scroll commands
https://bugs.webkit.org/show_bug.cgi?id=129402

.:

Reviewed by Timothy Hatcher.

* ManualTests/inspector/replay-wheel-events.html: Added.

Source/WebCore:

Reviewed by Timothy Hatcher and Simon Fraser.

To capture and replay scrolling, the scrolling coordinator will force synchronous
scrolling during capture and replay. If the page is capturing or replaying,
ForceOnMainThread will be added to the coordinator's SynchronousScrollingReasons.

A callback was added to signal that replay session state have changed,
and thus the synchronous scrolling reasons should be recomputed.

Automated replay reftests for scrolling are not included, because they will be
too flaky until more nondeterminism is handled. Specifically, resource loading,
initial focus/active state, and parsing are known blocking issues.

Test: ManualTests/inspector/replay-wheel-events.html

* page/scrolling/ScrollingCoordinator.cpp: Add a new callback for replay state
session changes. Add ForceOnMainThread if the page's active input cursor is
capturing or replaying.

(WebCore::ScrollingCoordinator::synchronousScrollingReasons):
(WebCore::ScrollingCoordinator::replaySessionStateDidChange): Added.
* page/scrolling/ScrollingCoordinator.h:

* platform/PlatformWheelEvent.h:
* platform/ScrollTypes.h: Add explicit enum storage types so these enums can
be forward-declared. This is necessary to generate enum encode/decode implementations.

* replay/ReplayController.cpp:
(WebCore::ReplayController::setForceDeterministicSettings): If async scrolling
support is available, tell the scrolling tree to behave deterministically.

* replay/ReplayInputDispatchMethods.cpp:
(WebCore::HandleWheelEvent::dispatch): Added.
(WebCore::LogicalScrollPage::dispatch): Added.
(WebCore::ScrollPage::dispatch): Added.
* replay/SerializationMethods.cpp: Introduce more specific macros for values
deserialized to arbitraray lvalues, scalars, RefPtr, and unique_ptr. Fix existing
uses of decode macros.

(JSC::EncodingTraits<NondeterministicInputBase>::encodeValue): Fix macro name.
(JSC::EncodingTraits<KeypressCommand>::encodeValue): Fix macro name.
(JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue): Fix macro name.
(JSC::EncodingTraits<PlatformMouseEvent>::encodeValue): Fix macro name.
(JSC::PlatformWheelEventCocoa::PlatformWheelEventCocoa): Added. Encapsulate
and initialize data members specific to PLATFORM(COCOA).

(JSC::EncodingTraits<PlatformWheelEvent>::encodeValue): Added.
(JSC::EncodingTraits<PlatformWheelEvent>::decodeValue): Added.
* replay/SerializationMethods.h:
* replay/UserInputBridge.cpp: Fill in bridge methods to capture inputs.
(WebCore::UserInputBridge::handleWheelEvent):
(WebCore::UserInputBridge::scrollRecursively):
(WebCore::UserInputBridge::logicalScrollRecursively):
* replay/WebInputs.json: Add inputs and new enum types.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac][WK2] Videos do not have access to session cookies
https://bugs.webkit.org/show_bug.cgi?id=129687

Reviewed by Eric Carlson.

Update the CookieStorageShim to track changes in underlying networking stack.

* Shared/mac/CookieStorageShim.mm:
(WebKit::CookieStorageShim::initialize):
(-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] polygon y-value calc() args serialize incorrectly
https://bugs.webkit.org/show_bug.cgi?id=129842

Reviewed by Bem Jones-Bey.

Source/WebCore:

The code hit ASSERT(isCalculation(value)) in CSSParser::createPrimitiveNumbericValue, because
CSSParser::validUnit had been called on both coordinates, which set the value for m_parsedCalculation,
but only one of the coordinates was calculation value. I reordered calling valudUnit and
createPrimitiveNumbericValue to be called in the correct order on the coordinates.

I added the new test case to parsing-test-utils.js.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseBasicShapePolygon):

LayoutTests:

* fast/shapes/parsing/parsing-shape-outside-expected.txt:
* fast/shapes/parsing/parsing-test-utils.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166813 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSGenerateToNativeObject should use fast JSNode/JSElement casts.
<https://webkit.org/b/131245>

Make JSGenerateToNativeObject spit out code using the fast new wrapper
casts for JSNode and JSElement.

This avoids walking the ClassInfo chain in many core functions, e.g:

    - Node.insertBefore()
    - Node.replaceChild()
    - Node.removeChild()
    - Node.appendChild()
    - window.getComputedStyle()

Reviewed by Geoff Garen.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166814 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Include Session ID in WebPageCreationParameters.
https://bugs.webkit.org/show_bug.cgi?id=131239

<rdar://problem/16175483>

Reviewed by Sam Weinig.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Log JS Exceptions to System Console if JavaScriptCoreOutputConsoleMessagesToSystemConsole enabled
https://bugs.webkit.org/show_bug.cgi?id=131241

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

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::reportAPIException):
Log the exception to the system console if system console output is enabled.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: supportsARIAExpanded should always return true for a few roles: combobox, disclosure.
https://bugs.webkit.org/show_bug.cgi?id=129787

Patch by James Craig <jcraig@apple.com> on 2014-04-04
Reviewed by Chris Fleizach.

Source/WebCore:

Test: inspector-protocol/dom/getAccessibilityPropertiesForNode.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAExpanded):

LayoutTests:

* inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt:
* inspector-protocol/dom/getAccessibilityPropertiesForNode.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166817 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Show DataDetector UI on scanned phone numbers.
<rdar://problem/16379588> and https://bugs.webkit.org/show_bug.cgi?id=131247

Reviewed by Tim Horton.

Source/WebCore:

Gather the ranges of the scanned telephone numbers and send them up to WK2:
* editing/Editor.cpp:
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::scanSelectionForTelephoneNumbers):
(WebCore::Editor::scanRangeForTelephoneNumbers):
* editing/Editor.h:

Add client method to receive scanned telephone number ranges:
* page/EditorClient.h:
(WebCore::EditorClient::selectedTelephoneNumberRangesChanged):

Remove unneeded placeholder UI:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDocumentMarkers):
(WebCore::InlineTextBox::computeRectForReplacementMarker): Deleted.
(WebCore::InlineTextBox::paintCompositionUnderline): Deleted.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::expansionBehavior): Deleted.

Source/WebKit2:

Add a new PageOverlay for telephone number UI, handle drawing the UI, and
handle mouse clicks on the button in that UI.

Even though clicks are detected, they aren’t acted upon yet.

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged): Pass ranges to
  the TelephoneNumberController.
* WebProcess/WebCoreSupport/WebEditorClient.h:

This controller handles installing/removing the PageOverlay, drawing the UI elements,
and handling mouse events while any of the UI elements are shown.
There’s also a clumsy attempt to keep platform-specific parts separated out.
* WebProcess/WebPage/TelephoneNumberOverlayController.cpp: Added.
(WebKit::TelephoneNumberOverlayController::TelephoneNumberOverlayController):
(WebKit::TelephoneNumberOverlayController::createOverlayIfNeeded):
(WebKit::TelephoneNumberOverlayController::destroyOverlay):
(WebKit::TelephoneNumberOverlayController::pageOverlayDestroyed):
(WebKit::TelephoneNumberOverlayController::willMoveToWebPage):
(WebKit::TelephoneNumberOverlayController::didMoveToWebPage):
(WebKit::TelephoneNumberOverlayController::rectsForDrawing):
(WebKit::TelephoneNumberOverlayController::selectedTelephoneNumberRangesChanged):

* WebProcess/WebPage/TelephoneNumberOverlayController.h: Added.
(WebKit::TelephoneNumberOverlayController::create):

* WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: Added.
(WebKit::TelephoneNumberOverlayController::drawRect):
(WebKit::TelephoneNumberOverlayController::handleTelephoneClick):
(WebKit::TelephoneNumberOverlayController::mouseEvent):
(WebKit::TelephoneNumberOverlayController::clearMouseDownInformation):
(WebKit::TelephoneNumberOverlayController::clearHighlights):

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::telephoneNumberOverlayController):
* WebProcess/WebPage/WebPage.h:

* WebKit2.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Rollout r166812, breaks 32-bit Mavericks build.

* Shared/mac/CookieStorageShim.mm:
(WebKit::CookieStorageShim::initialize):
(-[WKNSURLSessionLocal _copyCookiesForRequestUsingAllAppropriateStorageSemantics:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WIP for inlining C++.  Added a build target to produce llvm ir.
https://bugs.webkit.org/show_bug.cgi?id=130523

Patch by Matthew Mirman <mmirman@apple.com> on 2014-04-04
Reviewed by Filip Pizlo.

The llvm ir gets placed JavaScriptCoreRuntimeToLLVMir.build with the extension .o

* JavaScriptCore.xcodeproj/project.pbxproj:
* build_index.py: Added.
* Configurations/CompileRuntimeToLLVMir.xcconfig: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. iOS Build fix after r166818.

These member variables / declarations are accessed by iOS
in shared code in TelephoneNumberOverlayControllerMac.

* WebProcess/WebPage/TelephoneNumberOverlayController.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r166820.
https://bugs.webkit.org/show_bug.cgi?id=131256

Broke builds. (Requested by bdash on #webkit).

Reverted changeset:

"WIP for inlining C++.  Added a build target to produce llvm
ir."
https://bugs.webkit.org/show_bug.cgi?id=130523
http://trac.webkit.org/changeset/166820

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