Maui: Pasteboard support (42317)
<rdar://problem/7660537>
https://bugs.webkit.org/show_bug.cgi?id=42317
        
Reviewed by Darin Adler.

This is the final piece of the pasteboard support for WebKit2.
The menu validation has been hooked up for Mac. The validation is
performed asynchronously and the menu entries updated while the menu
is visible. I've created a generic mechanism to call editing commands
that will make it easy to add new commands we will support in the future.
The commands supported now are copy, cut, paste, pasteAsPlainText, delete
and selectAll.

* Shared/CoreIPCSupport/WebPageProxyMessageKinds.h: Added DidValidateMenuItem.
* UIProcess/API/mac/PageClientImpl.h: Added setEditCommandState.
* UIProcess/API/mac/PageClientImpl.mm: Added setEditCommandState implementation.
(WebKit::PageClientImpl::setEditCommandState): Added.
* UIProcess/API/mac/WKView.mm:
(WebCore::MenuItemInfo::MenuItemInfo):
(-[WKView initWithFrame:pageNamespaceRef:]):
(createSelectorExceptionMap): Added.
(commandNameForSelector): Added.
(-[WKView validateUserInterfaceItem:]): Added implementation.
(-[WKView _setUserInterfaceItemState:enabled:state:]): Added.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::validateMenuItem):
(WebKit::WebPageProxy::executeEditCommand):
(WebKit::WebPageProxy::didReceiveMessage): Now processing also
DidValidateMenuItem.
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::executeEditingCommand): Fixed.
(WebKit::WebPage::isEditingCommandEnabled): Fixed.
(WebKit::WebPage::validateMenuItem): Added.
(WebKit::WebPage::executeEditCommand): Added.
* WebProcess/WebPage/WebPage.h: Removed cut, copy, paste, selectAll.
Added validateMenuItem and executeEditCommand.
* WebProcess/WebPage/WebPage.messages.in: Added new messages.
* UIProcess/API/qt/qwkpage.cpp:
(WebKit::QWKPage::setEditCommandState): Added.
* UIProcess/API/qt/qwkpage_p.h: Added 



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-24  Kwang Yul Seo  <skyul@company100.net>

        Reviewed by Andreas Kling.

        [wx] ChromeClientWx::scaleFactor must return 1.0
        https://bugs.webkit.org/show_bug.cgi?id=46542

        The default value of ChromeClientWx::scaleFactor must be 1.0.
        Otherwise, canvas element won't be painted.

        * WebKitSupport/ChromeClientWx.cpp:
        (WebCore::ChromeClientWx::scaleFactor):

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

* UIProcess/API/qt/qwkpage_p.h:
* UIProcess/win/WebView.cpp:
(WebKit::WebView::setEditCommandState):
* UIProcess/win/WebView.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68320 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-24  Andreas Kling  <andreas.kling@nokia.com>

        Reviewed by Kenneth Rohde Christiansen.

        SVG: Avoid calling pow() in genericParseNumber() unless necessary
        https://bugs.webkit.org/show_bug.cgi?id=46537

        0.4% speedup on <http://themaninblue.com/experiment/AnimationBenchmark/svg/>

        * svg/SVGParserUtilities.cpp:
        (WebCore::genericParseNumber): Only call pow() when we have an exponent.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement WebKit2 callback equivalent to -[WebUIDelegate mouseDidMoveOverElement:modifierFlags:]
<rdar://problem/8359279>
https://bugs.webkit.org/show_bug.cgi?id=46546

Reviewed by Darin Adler.

WebKit2: 

- Adds new WKBundleHitTestResultRef object to represent a content under a cursor.
- Adds new Bundle and UI level mouseDidMoveOverElement UIClient callbacks, with
  pass through userData to communicate context up to the UIProcess

* Shared/APIObject.h:
* Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
* UIProcess/API/C/WKPage.h:
* UIProcess/API/qt/qwkpage.cpp:
(QWKPage::QWKPage):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveMessage):
(WebKit::WebPageProxy::mouseDidMoveOverElement):
* UIProcess/WebPageProxy.h:
* UIProcess/WebUIClient.cpp:
(WebKit::WebUIClient::mouseDidMoveOverElement):
* UIProcess/WebUIClient.h:
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/c/WKBundleBase.h:
* WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp: Added.
(WKBundleHitTestResultGetTypeID):
(WKBundleHitTestResultGetNodeHandle):
(WKBundleHitTestResultGetFrame):
(WKBundleHitTestResultCopyAbsoluteLinkURL):
* WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h: Added.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp: Added.
(WebKit::InjectedBundleHitTestResult::create):
(WebKit::InjectedBundleHitTestResult::nodeHandle):
(WebKit::InjectedBundleHitTestResult::webFrame):
(WebKit::InjectedBundleHitTestResult::absoluteLinkURL):
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.h: Added.
(WebKit::InjectedBundleHitTestResult::coreHitTestResult):
(WebKit::InjectedBundleHitTestResult::InjectedBundleHitTestResult):
(WebKit::InjectedBundleHitTestResult::type):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
(WebKit::InjectedBundlePageUIClient::mouseDidMoveOverElement):
* WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::mouseDidMoveOverElement):
* win/WebKit2.vcproj:

WebKitTools: 

* MiniBrowser/mac/BrowserWindowController.m:
(mouseDidMoveOverElement):
(-[BrowserWindowController awakeFromNib]):
* MiniBrowser/win/BrowserView.cpp:
(mouseDidMoveOverElement):
(BrowserView::create):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
* WebKitTestRunner/TestController.cpp:
(WTR::createOtherPage):
(WTR::TestController::initialize):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-24  Simon Fraser  <simon.fraser@apple.com>

        Reviewed by Sam Weinig.

        Accelerated transitions do not suspend/resume properly.
        https://bugs.webkit.org/show_bug.cgi?id=43792

        (1) Fix regression from r68233, where if an animation affected two
        properties, only one would animate. The testcase tests this.

        (2) Fix a flash at the end of an animation or transition that has been
        paused and resumed. The flash occurred because we used CAAnimation's
        timeOffset when resuming to push the start of the animation into
        the past. However, timeOffset does not play nicely with fill modes,
        causing a single frame of animation with the element in its unanimated state.

        Fixed this by offsetting the beginTime into the past, rather than setting
        timeOffset. Normally we submit animations with beginTime == 0, and rely
        on CA assigning a beginTime when the animation is committed. This beginTime
        is then passed to AnimationController to sync hardware and software animations.
        However, since the code now assigns beginTimes in the past (on resume),
        we now have to denote whether we've done this, and send an appropriate
        timestamp back to AnimationController.

        (3) Finally, the patch removes PropertyAnimationPair and just uses LayerPropertyAnimation
        instead. This is just cleanup.

        Test: animations/opacity-transform-animation.html

        * platform/graphics/mac/GraphicsLayerCA.h: Remove PropertyAnimationPair,
        and change AnimationsMap to store a vector of LayerPropertyAnimation.
        New method, animationDidStart(), is called from the -animationDidStart: callback.

        * platform/graphics/mac/GraphicsLayerCA.mm:
        (-[WebAnimationDelegate animationDidStart:]): Just call m_graphicsLayer->animationDidStart()
        now.
        (WebCore::animationIdentifier): We need to pass in the property, to fix (1)
        (WebCore::GraphicsLayerCA::moveOrCopyAnimationsForProperty): Copy the WebKitAnimationBeginTimeSet
        value, if present.
        (WebCore::GraphicsLayerCA::animationDidStart): Call notifyAnimationStarted() on the client,
        after testing if we set a non-zero beginTime on this particular animation.
        (WebCore::GraphicsLayerCA::updateLayerAnimations): Change to use LayerPropertyAnimation.
        (WebCore::GraphicsLayerCA::setCAAnimationOnLayer): Set value for WebKitAnimationBeginTimeSetKey
        if we have a non-zero timeOffset. Make animationID an NSString, to avoid several conversions.
        (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer):  Make animationID an NSString, to
        avoid several conversions.
        (WebCore::copyAnimationProperties): Copy WebKitAnimationBeginTimeSetKey if present.
        (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): Make animationID an NSString, to avoid
        several conversions.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
One more build fix.

* UIProcess/API/qt/qwkpage.cpp:
(QWKPagePrivate::setEditCommandState):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix release build.

* WebProcess/InjectedBundle/API/c/WKBundlePage.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix accidental increase in the size of InlineBox by using a bit
field to indicate that a bool should only take up 1 bit.

Rubber-stamped by Dan Bernstein.

* rendering/InlineBox.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-24  Mihai Parparita  <mihaip@chromium.org>

        Reviewed by Darin Fisher.

        [Chromium] Unnecessary blob dependency in WebKit.gyp
        https://bugs.webkit.org/show_bug.cgi?id=46488

        r66322 shouldn't have added a blob dependency by hand to targets in
        WebKit.gyp, instead blob should be a dependency of webkit_support.
        http://crrev.com/59406 did that, so we can now remove these deps.

        * WebKit.gyp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-24  Mihai Parparita  <mihaip@chromium.org>

        Unreviewed Chromium test_expectations.txt and drt_expectations.txt update.

        fast/canvas/webgl/null-object-behaviour.html and
        fast/canvas/webgl/uniform-location.html were unskipped with r68187,
        however, they still fail with the DRT (only on the bot, presumably due
        to a Leopard-only issue), just like a lot of other WebGL tests.

        fast/viewport/viewport-128.html is yet another viewport test that only
        the Qt port supports.

        animations/opacity-transform-animation.html hasn't passed since it was
        committed with r68323.

        * platform/chromium/drt_expectations.txt:
        * platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-25  Nicolas Weber  <thakis@chromium.org>

        Reviewed by Adam Barth.

        https://bugs.webkit.org/show_bug.cgi?id=46555
        Fix typo in prepare-ChangeLog's help output.

        * Scripts/prepare-ChangeLog:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-25  Patrick Gansterer  <paroga@webkit.org>

        Unreviewed.

        Fix typo in StringHasher class
        https://bugs.webkit.org/show_bug.cgi?id=45970

        * wtf/StringHashFunctions.h:
        (WTF::StringHasher::createHash):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68330 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-25  Andreas Kling  <andreas.kling@nokia.com>

        Reviewed by Kenneth Rohde Christiansen.

        [Qt] GraphicsContext::setLineDash() should scale dashOffset to penWidth
        https://bugs.webkit.org/show_bug.cgi?id=46548

        Fixes incorrect rendering of <http://www.carto.net/svg/samples/animated_bustrack.shtml>

        This is covered by existing layout tests which need to be rebaselined.

        * platform/graphics/qt/GraphicsContextQt.cpp:
        (WebCore::GraphicsContext::setLineDash):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-25  Andreas Kling  <andreas.kling@nokia.com>

        Unreviewed, Qt rebaseline after r68331 which fixed dash offset rendering.

        * platform/qt/svg/custom/js-repaint-rect-on-path-with-stroke-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68332 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-25  Nicolas Weber  <thakis@chromium.org>

        Reviewed by James Robinson.

        [chromium] Fix clang warning/error.
        https://bugs.webkit.org/show_bug.cgi?id=46552

        * src/WorkerFileSystemCallbacksBridge.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/8478182> Make canHyphenate() return false for unsupported locales

Reviewed by John Sullivan.

No change in functionality, hence no new test.

* platform/text/cf/HyphenationCF.cpp:
(WebCore::::createValueForKey): Return 0 if hyphenation is not available for the locale.
(WebCore::cfLocaleCache): Moved the definition of the cache from lastHyphenLocation() to
this new getter to allow canHyphenate() to share it.
(WebCore::canHyphenate): Now returns true only if hyphenation is available.
(WebCore::lastHyphenLocation): Added an assertion.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/8478160> Null deref in InlineBox::height()
https://bugs.webkit.org/show_bug.cgi?id=45344

Reviewed by John Sullivan.

WebCore: 

Test: fast/css/first-line-parent-style-different.html

* rendering/RenderObject.cpp:
(WebCore::RenderObject::firstLineStyleSlowCase): Set the pseudo style bit on the RenderStyle
which is going to supply the first-line style rather than on this object’s RenderStyle. The
styles may differ.

LayoutTests: 

* fast/css/first-line-parent-style-different-expected.txt: Added.
* fast/css/first-line-parent-style-different.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-25  Mihai Parparita  <mihaip@chromium.org>

        Unreviewed Chromium drt_expectations.txt update.

        Speech input appearance tests have image diffs on Linux too.

        * platform/chromium/drt_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-25  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Tony Chang.

        FormatBlockCommand's modifyRange and doApply should be merged
        https://bugs.webkit.org/show_bug.cgi?id=46504

        Isolated the code in doApply to insert and remove lists for single paragraph into doApplyForSingleParagraph.
        Merged the code in modifyRange into doApply and cleaned up.

        No new tests are added since this is a cleanup.

        * editing/FormatBlockCommand.cpp:
        (WebCore::FormatBlockCommand::doApply): Merged with modifyRange; calls doApplyForSingleParagraph.
        (WebCore::FormatBlockCommand::doApplyForSingleParagraph): Added.
        * editing/FormatBlockCommand.h:


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