Incorrect rounding in ceiledLayoutUnit and roundedLayoutUnit.
https://bugs.webkit.org/show_bug.cgi?id=91061

Reviewed by Adam Barth.

The two functions are currently both returning the flooredLayoutUnit when subpixel
layout is enabled. This patch changes them to return the correct fractional rounded
value.

* platform/FractionalLayoutUnit.h:
(WebCore::FractionalLayoutUnit::fromFloatCeil):
(FractionalLayoutUnit):
(WebCore::FractionalLayoutUnit::fromFloatRound):
* rendering/LayoutTypes.h:
(WebCore::roundedLayoutUnit):
(WebCore::ceiledLayoutUnit):
* rendering/RenderBlock.cpp:
(WebCore::updatePreferredWidth):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaStream API: Update MediaStreamTrack to match the specification
https://bugs.webkit.org/show_bug.cgi?id=90180

Reviewed by Adam Barth.

Source/Platform:

* chromium/public/WebMediaStreamDescriptor.h:
(WebMediaStreamDescriptor):
* chromium/public/WebMediaStreamSource.h:
(WebMediaStreamSource):

Source/WebCore:

MediaStreamTracks are now required to show the status of the underlying source,
and trigger events when that status changes.

Test: fast/mediastream/MediaStreamTrack.html

* GNUmakefile.list.am:
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::addTrack):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::create):
(WebCore::MediaStreamTrack::MediaStreamTrack):
(WebCore::MediaStreamTrack::~MediaStreamTrack):
(WebCore::MediaStreamTrack::setEnabled):
(WebCore::MediaStreamTrack::readyState):
(WebCore):
(WebCore::MediaStreamTrack::sourceChangedState):
(WebCore::MediaStreamTrack::stop):
(WebCore::MediaStreamTrack::interfaceName):
(WebCore::MediaStreamTrack::scriptExecutionContext):
(WebCore::MediaStreamTrack::eventTargetData):
(WebCore::MediaStreamTrack::ensureEventTargetData):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* WebCore.gypi:
* dom/EventNames.h:
(WebCore):
* dom/EventTargetFactory.in:
* platform/chromium/support/WebMediaStreamDescriptor.cpp:
* platform/chromium/support/WebMediaStreamSource.cpp:
(WebKit::WebMediaStreamSource::setReadyState):
(WebKit):
(WebKit::WebMediaStreamSource::readyState):
* platform/mediastream/MediaStreamSource.cpp: Copied from Source/WebCore/platform/mediastream/MediaStreamSource.h.
(WebCore):
(WebCore::MediaStreamSource::create):
(WebCore::MediaStreamSource::MediaStreamSource):
(WebCore::MediaStreamSource::setReadyState):
(WebCore::MediaStreamSource::addObserver):
(WebCore::MediaStreamSource::removeObserver):
* platform/mediastream/MediaStreamSource.h:
(Observer):
(WebCore::MediaStreamSource::Observer::~Observer):
(MediaStreamSource):
(WebCore::MediaStreamSource::readyState):
* platform/mediastream/chromium/MediaStreamCenterChromium.cpp:
(WebCore::MediaStreamCenterChromium::queryMediaStreamSources):
(WebCore::MediaStreamCenterChromium::didCreateMediaStream):

Tools:

Adding a Mock WebMediaStreamCenter to enable better LayoutTests.

* DumpRenderTree/DumpRenderTree.gypi:
* DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp:
(MockWebKitPlatformSupport::createMediaStreamCenter):
* DumpRenderTree/chromium/MockWebMediaStreamCenter.cpp: Added.
(WebKit):
(WebKit::MockWebMediaStreamCenter::MockWebMediaStreamCenter):
(WebKit::MockWebMediaStreamCenter::queryMediaStreamSources):
(WebKit::MockWebMediaStreamCenter::didEnableMediaStreamTrack):
(WebKit::MockWebMediaStreamCenter::didDisableMediaStreamTrack):
(WebKit::MockWebMediaStreamCenter::didStopLocalMediaStream):
(WebKit::MockWebMediaStreamCenter::didCreateMediaStream):
(WebKit::MockWebMediaStreamCenter::constructSDP):
* DumpRenderTree/chromium/MockWebMediaStreamCenter.h: Copied from Tools/DumpRenderTree/chromium/MockWebKitPlatformSupport.cpp.
(WebKit):
(MockWebMediaStreamCenter):
(WebKit::MockWebMediaStreamCenter::MockWebMediaStreamCenter):

LayoutTests:

* fast/mediastream/MediaStreamTrack-expected.txt: Added.
* fast/mediastream/MediaStreamTrack.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unify compositor quadTransform/drawTransform/originTransform
https://bugs.webkit.org/show_bug.cgi?id=91417

Reviewed by Kenneth Russell.

Source/WebCore:

drawTransform used to operate on centered layer rects. To unify quad
transforms, draw transforms, and origin transforms, make draw
transforms operate on content rects with the origin in the top left.

This essentially eliminates the need for surface origin transforms,
which will be eliminated in a future patch.

Also, remove the unused CCLayerImpl::getDrawRect function.

No-op refactoring. Tested by existing tests.

* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::drawRenderPassQuad):
* platform/graphics/chromium/RenderSurfaceChromium.cpp:
(WebCore::RenderSurfaceChromium::drawableContentRect):
* platform/graphics/chromium/cc/CCDamageTracker.cpp:
(WebCore::CCDamageTracker::extendDamageForLayer):
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::createSharedQuadState):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(CCLayerImpl):
* platform/graphics/chromium/cc/CCLayerSorter.cpp:
(WebCore::CCLayerSorter::LayerShape::LayerShape):
(WebCore::CCLayerSorter::createGraphNodes):
* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateVisibleContentRect):
(WebCore::calculateDrawTransformsInternal):
* platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
(WebCore::::markOccludedBehindLayer):
(WebCore::::occluded):
(WebCore::::unoccludedContentRect):
* platform/graphics/chromium/cc/CCRenderPass.cpp:
(WebCore::CCRenderPass::appendQuadsToFillScreen):
* platform/graphics/chromium/cc/CCRenderSurface.cpp:
(WebCore::CCRenderSurface::drawableContentRect):

Source/WebKit/chromium:

Clean up tests to refer to the new draw transform semantics.

* tests/CCDamageTrackerTest.cpp:
(WebKitTests::createTestTreeWithOneSurface):
(WebKitTests::createTestTreeWithTwoSurfaces):
(WebKitTests::TEST_F):
* tests/CCLayerSorterTest.cpp:
* tests/CCLayerTreeHostCommonTest.cpp:
* tests/CCLayerTreeHostImplTest.cpp:
* tests/CCLayerTreeHostTest.cpp:
(WTF::CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers::commitCompleteOnCCThread):
* tests/CCQuadCullerTest.cpp:
* tests/TiledLayerChromiumTest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123628 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] clock_gettime() in BackingStore.cpp should use CLOCK_MONOTONIC
https://bugs.webkit.org/show_bug.cgi?id=91898

Reviewed by Yong Li.
Patch by Jacky Jiang  <zhajiang@rim.com>

Let pthread condition variable in BackingStore.cpp use monotonic clock
to fix a regression caused by r123266.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Chinese IM receives incorrect/duplicated key events in text fields in webpages in Safari.
        https://bugs.webkit.org/show_bug.cgi?id=89048
        <rdar://problem/11786384>

        Reviewed by Andreas Kling.

        Cannot test text input from UI process side.

        Stop relying on IPC to handle key events in order. There are too many complications
        where out of order delivery is performed. Instead, queue the events at UI process
        side.

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



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