NodesFromRect and area-based hit-testing can not handle CSS transforms.
https://bugs.webkit.org/show_bug.cgi?id=85792

Reviewed by Eric Seidel.

Source/WebCore:

To support the combination of CSS transforms and rect based hit testing,
we need to test against the transformed rect, instead of the original rect.

This patch makes HitTestPoint store the exact transformed FloatPoint and
FloatQuad, and modifies the intersection methods so that they will use a
new FloatQuad based intersection when transforms requires it.

Tests: fast/dom/nodesFromRect/nodesFromRect-rotate.html
       fast/dom/nodesFromRect/nodesFromRect-scale.html

* platform/graphics/FloatQuad.cpp:
(WebCore::determinant):
(WebCore::rightMostCornerToVector):
(WebCore::FloatQuad::intersectsRect):
(WebCore::FloatQuad::isCounterclockwise):
* platform/graphics/FloatQuad.h:
(FloatQuad):
* rendering/HitTestResult.cpp:
(WebCore::HitTestPoint::HitTestPoint):
(WebCore::HitTestPoint::operator=):
(WebCore::HitTestPoint::move):
(WebCore::HitTestPoint::intersectsRect):
(WebCore::HitTestPoint::intersects):
* rendering/HitTestResult.h:
(HitTestPoint):
(WebCore::HitTestPoint::isRectilinear):
(WebCore::HitTestPoint::transformedPoint):
(WebCore::HitTestPoint::transformedRect):
* rendering/HitTestingTransformState.cpp:
(WebCore::HitTestingTransformState::flattenWithTransform):
(WebCore::HitTestingTransformState::mappedArea):
(WebCore::HitTestingTransformState::boundsOfMappedArea):
* rendering/HitTestingTransformState.h:
(WebCore::HitTestingTransformState::create):
(WebCore::HitTestingTransformState::HitTestingTransformState):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::hitTestRegion):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTest):
(WebCore::RenderLayer::createLocalTransformState):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::hitTestChildLayerColumns):
* rendering/RenderLayer.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::nodeAtFloatPoint):

LayoutTests:

Adds nodesFromRect tests that tests the API under the CSS transforms
scale and rotate.

* fast/dom/nodesFromRect/nodesFromRect-rotate-expected.txt: Added.
* fast/dom/nodesFromRect/nodesFromRect-rotate.html: Added.
* fast/dom/nodesFromRect/nodesFromRect-scale-expected.txt: Added.
* fast/dom/nodesFromRect/nodesFromRect-scale.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add *explicit* keyword to constructors in WebCore/platform
https://bugs.webkit.org/show_bug.cgi?id=92238

Reviewed by Kentaro Hara.

As a step to let *explicit* keyword add to constructors which have a parameter,
*explicit* keyword is added to Source/WebCore/platform in order to avoid implicit
type conversion.

Some files in platform directory can't use explicit keyword because of build breaks.

No new tests. Covered by existing tests.

* platform/AutodrainedPool.h:
(AutodrainedPool):
* platform/ContentType.h:
(ContentType):
* platform/ContextMenu.h:
(ContextMenu):
* platform/ContextMenuItem.h:
(ContextMenuItem):
* platform/Cursor.h:
(WebCore::SharedCursor::SharedCursor):
(Cursor):
* platform/KURL.h:
(WebCore::KURL::KURL):
(KURL):
* platform/KURLGooglePrivate.h:
(KURLGooglePrivate):
* platform/PODRedBlackTree.h:
(WebCore::PODRedBlackTree::PODRedBlackTree):
* platform/Pasteboard.h:
(Pasteboard):
* platform/PlatformEvent.h:
(WebCore::PlatformEvent::PlatformEvent):
* platform/PlatformKeyboardEvent.h:
(PlatformKeyboardEvent):
* platform/PlatformMouseEvent.h:
(PlatformMouseEvent):
* platform/PlatformPasteboard.h:
(PlatformPasteboard):
* platform/PlatformTouchEvent.h:
(PlatformTouchEvent):
* platform/PlatformWheelEvent.h:
(PlatformWheelEvent):
* platform/RunLoop.h:
(TimerBase):
* platform/ScrollAnimator.h:
(ScrollAnimator):
* platform/ScrollAnimatorNone.h:
(ScrollAnimatorNone):
* platform/SharedBuffer.h:
(SharedBuffer):
* platform/WheelFlingPlatformGestureCurve.h:
(WheelFlingPlatformGestureCurve):
* platform/Widget.h:
(Widget):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
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
[Qt] css2.1/t* tests needs rebaseline after new testfonts
https://bugs.webkit.org/show_bug.cgi?id=91999

Unreviewed.

* platform/qt-5.0-wk1/Skipped:
* platform/qt-5.0-wk2/Skipped:
* platform/qt-5.0/Skipped:
* platform/qt-5.0/css2.1/t0805-c5519-brdr-r-01-e-expected.png: Removed.
* platform/qt-5.0/css2.1/t0805-c5519-brdr-r-01-e-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c414-flt-02-c-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c414-flt-03-c-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c414-flt-04-c-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c414-flt-fit-01-d-g-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c5525-fltblck-00-d-ag-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c5525-fltblck-01-d-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c5525-fltcont-00-d-g-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c5525-flthw-00-c-g-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c5525-fltwidth-02-c-g-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c5525-fltwidth-03-c-g-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c5525-fltwrap-00-b-expected.txt: Removed.
* platform/qt-5.0/css2.1/t0905-c5526-flthw-00-c-g-expected.txt: Removed.
* platform/qt-5.0/css2.1/t090501-c414-flt-01-b-expected.txt: Removed.
* platform/qt-5.0/css2.1/t090501-c414-flt-03-b-g-expected.txt: Removed.
* platform/qt-5.0/css2.1/t090501-c414-flt-ln-01-d-g-expected.txt: Removed.
* platform/qt-5.0/css2.1/t090501-c5525-flt-l-00-b-g-expected.txt: Removed.
* platform/qt-5.0/css2.1/t090501-c5525-flt-r-00-b-g-expected.txt: Removed.
* platform/qt/css2.1/t010403-shand-border-00-c-expected.png:
* platform/qt/css2.1/t010403-shand-border-00-c-expected.txt:
* platform/qt/css2.1/t010403-shand-font-00-b-expected.png:
* platform/qt/css2.1/t010403-shand-font-00-b-expected.txt:
* platform/qt/css2.1/t010403-shand-font-01-b-expected.png:
* platform/qt/css2.1/t010403-shand-font-01-b-expected.txt:
* platform/qt/css2.1/t010403-shand-font-02-b-expected.png:
* platform/qt/css2.1/t010403-shand-font-02-b-expected.txt:
* platform/qt/css2.1/t010403-shand-font-03-b-expected.png:
* platform/qt/css2.1/t010403-shand-font-03-b-expected.txt:
* platform/qt/css2.1/t050201-c12-grouping-00-b-expected.png:
* platform/qt/css2.1/t050201-c12-grouping-00-b-expected.txt:
* platform/qt/css2.1/t0505-c16-descendant-00-e-expected.png:
* platform/qt/css2.1/t0505-c16-descendant-00-e-expected.txt:
* platform/qt/css2.1/t0505-c16-descendant-01-e-expected.png:
* platform/qt/css2.1/t0505-c16-descendant-01-e-expected.txt:
* platform/qt/css2.1/t0505-c16-descendant-02-e-expected.png:
* platform/qt/css2.1/t0505-c16-descendant-02-e-expected.txt:
* platform/qt/css2.1/t050803-c14-classes-00-e-expected.png:
* platform/qt/css2.1/t050803-c14-classes-00-e-expected.txt:
* platform/qt/css2.1/t0509-c15-ids-00-a-expected.png:
* platform/qt/css2.1/t0509-c15-ids-00-a-expected.txt:
* platform/qt/css2.1/t0509-c15-ids-01-e-expected.png:
* platform/qt/css2.1/t0509-c15-ids-01-e-expected.txt:
* platform/qt/css2.1/t0509-id-sel-syntax-01-f-expected.png:
* platform/qt/css2.1/t0509-id-sel-syntax-01-f-expected.txt:
* platform/qt/css2.1/t0509-id-sel-syntax-02-b-expected.png:
* platform/qt/css2.1/t0509-id-sel-syntax-02-b-expected.txt:
* platform/qt/css2.1/t0510-c25-pseudo-elmnt-00-c-expected.png:
* platform/qt/css2.1/t0510-c25-pseudo-elmnt-00-c-expected.txt:
* platform/qt/css2.1/t0511-c21-pseud-anch-00-e-i-expected.png:
* platform/qt/css2.1/t0511-c21-pseud-anch-00-e-i-expected.txt:
* platform/qt/css2.1/t0511-c21-pseud-link-00-e-expected.png:
* platform/qt/css2.1/t0511-c21-pseud-link-00-e-expected.txt:
* platform/qt/css2.1/t0511-c21-pseud-link-01-e-expected.png:
* platform/qt/css2.1/t0511-c21-pseud-link-01-e-expected.txt:
* platform/qt/css2.1/t0511-c21-pseud-link-02-e-expected.png:
* platform/qt/css2.1/t0511-c21-pseud-link-02-e-expected.txt:
* platform/qt/css2.1/t0511-c21-pseud-link-03-e-expected.png:
* platform/qt/css2.1/t0511-c21-pseud-link-03-e-expected.txt:
* platform/qt/css2.1/t051103-c21-activ-ln-00-e-i-expected.png:
* platform/qt/css2.1/t051103-c21-activ-ln-00-e-i-expected.txt:
* platform/qt/css2.1/t051103-c21-focus-ln-00-e-i-expected.png:
* platform/qt/css2.1/t051103-c21-focus-ln-00-e-i-expected.txt:
* platform/qt/css2.1/t051103-c21-hover-ln-00-e-i-expected.png:
* platform/qt/css2.1/t051103-c21-hover-ln-00-e-i-expected.txt:
* platform/qt/css2.1/t051103-dom-hover-01-c-io-expected.png:
* platform/qt/css2.1/t051103-dom-hover-01-c-io-expected.txt:
* platform/qt/css2.1/t051103-dom-hover-02-c-io-expected.png:
* platform/qt/css2.1/t051103-dom-hover-02-c-io-expected.txt:
* platform/qt/css2.1/t051202-c24-first-lttr-00-b-expected.png:
* platform/qt/css2.1/t051202-c24-first-lttr-00-b-expected.txt:
* platform/qt/css2.1/t051202-c26-psudo-nest-00-c-expected.png:
* platform/qt/css2.1/t051202-c26-psudo-nest-00-c-expected.txt:
* platform/qt/css2.1/t0602-c13-inh-underlin-00-e-expected.png:
* platform/qt/css2.1/t0602-c13-inh-underlin-00-e-expected.txt:
* platform/qt/css2.1/t0602-c13-inheritance-00-e-expected.png:
* platform/qt/css2.1/t0602-c13-inheritance-00-e-expected.txt:
* platform/qt/css2.1/t0602-inherit-bdr-pad-b-00-expected.png:
* platform/qt/css2.1/t0602-inherit-bdr-pad-b-00-expected.txt:
* platform/qt/css2.1/t0603-c11-import-00-b-expected.png:
* platform/qt/css2.1/t0603-c11-import-00-b-expected.txt:
* platform/qt/css2.1/t060401-c32-cascading-00-b-expected.png:
* platform/qt/css2.1/t060401-c32-cascading-00-b-expected.txt:
* platform/qt/css2.1/t060402-c31-important-00-b-expected.png:
* platform/qt/css2.1/t060402-c31-important-00-b-expected.txt:
* platform/qt/css2.1/t060403-c21-pseu-cls-00-e-i-expected.png:
* platform/qt/css2.1/t060403-c21-pseu-cls-00-e-i-expected.txt:
* platform/qt/css2.1/t060403-c21-pseu-id-00-e-i-expected.png:
* platform/qt/css2.1/t060403-c21-pseu-id-00-e-i-expected.txt:
* platform/qt/css2.1/t09-c5526c-display-00-e-expected.png:
* platform/qt/css2.1/t09-c5526c-display-00-e-expected.txt:
* platform/qt/css2.1/t090402-c42-ibx-pad-00-d-ag-expected.png:
* platform/qt/css2.1/t090402-c42-ibx-pad-00-d-ag-expected.txt:
* platform/qt/css2.1/t0905-c414-flt-00-d-expected.png:
* platform/qt/css2.1/t0905-c414-flt-00-d-expected.txt:
* platform/qt/css2.1/t0905-c414-flt-01-d-g-expected.png:
* platform/qt/css2.1/t0905-c414-flt-01-d-g-expected.txt:
* platform/qt/css2.1/t0905-c414-flt-02-c-expected.png:
* platform/qt/css2.1/t0905-c414-flt-02-c-expected.txt:
* platform/qt/css2.1/t0905-c414-flt-03-c-expected.png:
* platform/qt/css2.1/t0905-c414-flt-03-c-expected.txt:
* platform/qt/css2.1/t0905-c414-flt-04-c-expected.png:
* platform/qt/css2.1/t0905-c414-flt-04-c-expected.txt:
* platform/qt/css2.1/t0905-c414-flt-fit-00-d-expected.png:
* platform/qt/css2.1/t0905-c414-flt-fit-00-d-expected.txt:
* platform/qt/css2.1/t0905-c414-flt-fit-01-d-g-expected.png:
* platform/qt/css2.1/t0905-c414-flt-fit-01-d-g-expected.txt:
* platform/qt/css2.1/t0905-c414-flt-wrap-00-e-expected.png:
* platform/qt/css2.1/t0905-c414-flt-wrap-00-e-expected.txt:
* platform/qt/css2.1/t0905-c414-flt-wrap-01-d-g-expected.png:
* platform/qt/css2.1/t0905-c414-flt-wrap-01-d-g-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltblck-00-d-ag-expected.png:
* platform/qt/css2.1/t0905-c5525-fltblck-00-d-ag-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltblck-01-d-expected.png:
* platform/qt/css2.1/t0905-c5525-fltblck-01-d-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltclr-00-c-ag-expected.png:
* platform/qt/css2.1/t0905-c5525-fltclr-00-c-ag-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltcont-00-d-g-expected.png:
* platform/qt/css2.1/t0905-c5525-fltcont-00-d-g-expected.txt:
* platform/qt/css2.1/t0905-c5525-flthw-00-c-g-expected.png:
* platform/qt/css2.1/t0905-c5525-flthw-00-c-g-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltinln-00-c-ag-expected.png:
* platform/qt/css2.1/t0905-c5525-fltinln-00-c-ag-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltmrgn-00-c-ag-expected.png:
* platform/qt/css2.1/t0905-c5525-fltmrgn-00-c-ag-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltmult-00-d-g-expected.png:
* platform/qt/css2.1/t0905-c5525-fltmult-00-d-g-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png:
* platform/qt/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltwidth-01-c-g-expected.png:
* platform/qt/css2.1/t0905-c5525-fltwidth-01-c-g-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltwidth-02-c-g-expected.png:
* platform/qt/css2.1/t0905-c5525-fltwidth-02-c-g-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltwidth-03-c-g-expected.png:
* platform/qt/css2.1/t0905-c5525-fltwidth-03-c-g-expected.txt:
* platform/qt/css2.1/t0905-c5525-fltwrap-00-b-expected.png:
* platform/qt/css2.1/t0905-c5525-fltwrap-00-b-expected.txt:
* platform/qt/css2.1/t0905-c5526-fltclr-00-c-ag-expected.png:
* platform/qt/css2.1/t0905-c5526-fltclr-00-c-ag-expected.txt:
* platform/qt/css2.1/t0905-c5526-flthw-00-c-g-expected.png:
* platform/qt/css2.1/t0905-c5526-flthw-00-c-g-expected.txt:
* platform/qt/css2.1/t090501-c414-flt-00-d-expected.png:
* platform/qt/css2.1/t090501-c414-flt-00-d-expected.txt:
* platform/qt/css2.1/t090501-c414-flt-01-b-expected.png:
* platform/qt/css2.1/t090501-c414-flt-01-b-expected.txt:
* platform/qt/css2.1/t090501-c414-flt-02-d-g-expected.png:
* platform/qt/css2.1/t090501-c414-flt-02-d-g-expected.txt:
* platform/qt/css2.1/t090501-c414-flt-03-b-g-expected.png:
* platform/qt/css2.1/t090501-c414-flt-03-b-g-expected.txt:
* platform/qt/css2.1/t090501-c414-flt-ln-00-d-expected.png:
* platform/qt/css2.1/t090501-c414-flt-ln-00-d-expected.txt:
* platform/qt/css2.1/t090501-c414-flt-ln-01-d-g-expected.png:
* platform/qt/css2.1/t090501-c414-flt-ln-01-d-g-expected.txt:
* platform/qt/css2.1/t090501-c414-flt-ln-02-d-expected.png:
* platform/qt/css2.1/t090501-c414-flt-ln-02-d-expected.txt:
* platform/qt/css2.1/t090501-c414-flt-ln-03-d-expected.png:
* platform/qt/css2.1/t090501-c414-flt-ln-03-d-expected.txt:
* platform/qt/css2.1/t090501-c5525-flt-l-00-b-g-expected.png:
* platform/qt/css2.1/t090501-c5525-flt-l-00-b-g-expected.txt:
* platform/qt/css2.1/t090501-c5525-flt-r-00-b-g-expected.png:
* platform/qt/css2.1/t090501-c5525-flt-r-00-b-g-expected.txt:
* platform/qt/css2.1/t1503-c522-font-family-00-b-expected.png:
* platform/qt/css2.1/t1503-c522-font-family-00-b-expected.txt:
* platform/qt/css2.1/t1508-c527-font-03-b-expected.png:
* platform/qt/css2.1/t1508-c527-font-03-b-expected.txt:
* platform/qt/css2.1/t1508-c527-font-06-b-expected.png:
* platform/qt/css2.1/t1508-c527-font-06-b-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speech JavaScript API: extract function from SpeechRecognitionResult::emma()
https://bugs.webkit.org/show_bug.cgi?id=92232

Reviewed by Adam Barth.

Extract code for creating emma-qualified names to a helper function.

Just a refactoring; covered by the existing test.

* Modules/speech/SpeechRecognitionResult.cpp:
(WebCore::emmaQualifiedName):
(WebCore):
(WebCore::SpeechRecognitionResult::emma):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Build fix for clang builds after r123628
https://bugs.webkit.org/show_bug.cgi?id=92266

Reviewed by Adrienne Walker.

An un-used variable was causing build failures for clang builds
after the refactoring in r123628.  It is correct to simply remove
this value.

* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateDrawTransformsInternal):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Geolocation override
https://bugs.webkit.org/show_bug.cgi?id=89365

Reviewed by Pavel Feldman.

Source/WebCore:

Re-added the m_page member variable for GeolocationController since
it's now being used by InspectorInstrumentaiton.

Added a way to override the GeolocationPosition and GeolocationError
using Web Inspector. Curretnly only PositionError can be set.

This will be hidden behind the experiments flag for now.

Tests: inspector/geolocation-error.html
       inspector/geolocation-success.html
       inspector/geolocation-watchPosition.html

* English.lproj/localizedStrings.js:
* Modules/geolocation/GeolocationController.cpp:
(WebCore::GeolocationController::GeolocationController):
(WebCore::GeolocationController::positionChanged):
* Modules/geolocation/GeolocationController.h:
(GeolocationController):
* inspector/Inspector.json:
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::overrideGeolocationPositionImpl):
* inspector/InspectorInstrumentation.h:
(WebCore):
(InspectorInstrumentation):
(WebCore::InspectorInstrumentation::overrideGeolocationPosition):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::InspectorPageAgent):
(WebCore::InspectorPageAgent::setGeolocationOverride):
(WebCore):
(WebCore::InspectorPageAgent::clearGeolocationOverride):
(WebCore::InspectorPageAgent::canOverrideGeolocation):
(WebCore::InspectorPageAgent::overrideGeolocationPosition):
* inspector/InspectorPageAgent.h:
* inspector/front-end/Settings.js:
* inspector/front-end/SettingsScreen.js:
(WebInspector.UserAgentSettingsTab):
(WebInspector.UserAgentSettingsTab.prototype._createDeviceMetricsElement):
(WebInspector.UserAgentSettingsTab.prototype._onGeolocationOverrideCheckboxClicked):
(WebInspector.UserAgentSettingsTab.prototype._applyGeolocationUserInput):
(WebInspector.UserAgentSettingsTab.prototype._setGeolocationPosition.set if):
(WebInspector.UserAgentSettingsTab.prototype._setGeolocationPosition):
(WebInspector.UserAgentSettingsTab.prototype._createGeolocationOverrideElement.createInput):
(WebInspector.UserAgentSettingsTab.prototype._createGeolocationOverrideElement):
* inspector/front-end/UserAgentSupport.js:
(WebInspector.UserAgentSupport.GeolocationPosition):
(WebInspector.UserAgentSupport.GeolocationPosition.prototype.toSetting):
(WebInspector.UserAgentSupport.GeolocationPosition.parseSetting):
(WebInspector.UserAgentSupport.GeolocationPosition.parseUserInput):
(WebInspector.UserAgentSupport.GeolocationPosition.clearGeolocationOverride):
* inspector/front-end/inspector.js:
(WebInspector.doLoadedDone):

LayoutTests:

Added new tests.

* inspector/geolocation-error-expected.txt: Added.
* inspector/geolocation-error.html: Added.
* inspector/geolocation-success-expected.txt: Added.
* inspector/geolocation-success.html: Added.
* inspector/geolocation-watchPosition-expected.txt: Added.
* inspector/geolocation-watchPosition.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123634 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r123560.
http://trac.webkit.org/changeset/123560
https://bugs.webkit.org/show_bug.cgi?id=90321

Breaks chromium valgrind tests.

Source/WebCore:

* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::append):
* html/parser/HTMLEntityParser.cpp:
(WebCore::HTMLEntityParser::consumeNamedEntity):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::stripLeadingAndTrailingHTMLSpaces):
* html/parser/HTMLSourceTracker.cpp:
(WebCore::HTMLSourceTracker::sourceForToken):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script):
* platform/text/SegmentedString.cpp:
(WebCore::SegmentedString::SegmentedString):
(WebCore::SegmentedString::operator=):
(WebCore::SegmentedString::clear):
(WebCore::SegmentedString::append):
(WebCore::SegmentedString::prepend):
(WebCore::SegmentedString::advanceSubstring):
(WebCore::SegmentedString::advance):
(WebCore::SegmentedString::advanceSlowCase):
(WebCore::SegmentedString::advanceAndUpdateLineNumberSlowCase):
* platform/text/SegmentedString.h:
(WebCore::SegmentedSubstring::SegmentedSubstring):
(WebCore::SegmentedSubstring::clear):
(WebCore::SegmentedSubstring::appendTo):
(SegmentedSubstring):
(WebCore::SegmentedString::SegmentedString):
(WebCore::SegmentedString::push):
(WebCore::SegmentedString::isEmpty):
(WebCore::SegmentedString::lookAhead):
(WebCore::SegmentedString::lookAheadIgnoringCase):
(WebCore::SegmentedString::advance):
(WebCore::SegmentedString::advanceAndASSERT):
(WebCore::SegmentedString::advanceAndASSERTIgnoringCase):
(WebCore::SegmentedString::advancePastNewlineAndUpdateLineNumber):
(SegmentedString):
(WebCore::SegmentedString::advancePastNonNewline):
(WebCore::SegmentedString::advanceAndUpdateLineNumber):
(WebCore::SegmentedString::operator*):
(WebCore::SegmentedString::operator->):
(WebCore::SegmentedString::current):
(WebCore::SegmentedString::equalsLiterally):
(WebCore::SegmentedString::equalsIgnoringCase):
(WebCore::SegmentedString::lookAheadInline):
(WebCore::SegmentedString::lookAheadSlowCase):
* xml/parser/CharacterReferenceParserInlineMethods.h:
(WebCore::consumeCharacterReference):
* xml/parser/MarkupTokenizerBase.h:
(WebCore::MarkupTokenizerBase::InputStreamPreprocessor::nextInputCharacter):
(WebCore::MarkupTokenizerBase::InputStreamPreprocessor::peek):
(WebCore::MarkupTokenizerBase::InputStreamPreprocessor::advance):

Source/WTF:

* wtf/text/WTFString.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123635 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make ElementAttributeData a variable-sized object to reduce memory use.
<http://webkit.org/b/88240>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Take advantage of the fact that we know at ElementAttributeData construction time how many attributes
it needs to accomodate and allocate exactly as much space as needed instead of using a Vector.
For elements that never have their attribute list mutated (the vast majority), this saves a lot of
memory and removes the indirection to Vector<Attribute>'s heap-allocated storage.

Introduced a mutability flag to ElementAttributeData and sprinkled assertions all over to make sure
that nothing tries to mutate an element with a raw attribute array.

When an Element's attribute(s) are mutated, we reconstruct the ElementAttributeData, this time using
a Vector as backing instead. This is triggered when calling Element::mutableAttributeData().

This reduces memory consumption by 3.2MB when viewing the full HTML5 spec at <http://whatwg.org/c/>.
That is a ~35% reduction in DOM attribute memory use.

Furthermore, that page ends up promoting 27% of the elements to mutable attribute storage due to dynamic
adding of "class" attributes. For more static pages, savings are even greater.

Also did away with ElementAttributeData::removeAttribute(name) and do separate index lookup where
needed. Not a big deal but avoids double lookup of attributes when removing them.

* dom/Element.cpp:
(WebCore::Element::detachAttribute):
(WebCore::Element::removeAttribute):
(WebCore::Element::attributes):
(WebCore::Element::setAttributeInternal):
(WebCore::Element::parserSetAttributes):
(WebCore::Element::hasEquivalentAttributes):
(WebCore::Element::setAttributeNode):
(WebCore::Element::removeAttributeNode):
(WebCore::Element::getAttributeNode):
(WebCore::Element::getAttributeNodeNS):
(WebCore::Element::hasAttribute):
(WebCore::Element::hasAttributeNS):
(WebCore::Element::cloneAttributesFromElement):

    Sprinkle const on ElementAttributeData* pointers.
    Switch to using mutableAttributeData() in code paths that modify attributes.

(WebCore::Element::normalizeAttributes):

    Cleaner iteration over attributes, I removed ElementAttributeData::attributeVector() since that
    was just incurring a bunch of extra Vector copying. Since ElementAttributeData already exposes
    length() and attributeItem(index), use those to iterate directly over the attributes.

(WebCore::Element::createMutableAttributeData):

    Added, converts existing ElementAttributeData to a mutable object. Otherwise creates a new
    ElementAttributeData (mutable and empty.)

* dom/Element.h:
(WebCore::Element::attributeData):
(WebCore::Element::updatedAttributeData):
(WebCore::Element::ensureAttributeData):
(WebCore::Element::ensureUpdatedAttributeData):

    Made all of these return "const ElementAttributeData*" to ensure at compile-time that nothing
    attempts to modify an ElementAttributeData that may be immutable.

    ensureUpdatedAttributeData() is still const, despite possibly calling mutableAttributeData().
    The goal of having methods be const is to prevent conversion from one ElementAttributeData
    object to another, so that pointers remain intact and no unnecessary work gets done.

(WebCore::Element::mutableAttributeData):

    Added, returns a guaranteed mutable ElementAttributeData* pointer.

* dom/ElementAttributeData.cpp:
(WebCore::ElementAttributeData::createImmutable):

    Creates a new ElementAttributeData tailored to fit the provided Vector<Attribute>.

(WebCore::ElementAttributeData::ElementAttributeData):

    Moved constructors out-of-line, getting too complex for header files.

    ElementAttributeData(const Vector<Attribute>&) creates an immutable ElementAttributeData
    containing the provided attributes in an array tacked onto the end of the object.

(WebCore::ElementAttributeData::~ElementAttributeData):

    Free the attribute vector if mutable.
    For immutable objects, manually invoke destructor on each Attribute object,
    since these won't be destroyed automatically by ~ElementAttributeData.

(WebCore::ElementAttributeData::attrIfExists):

(WebCore::ElementAttributeData::ensureAttr):
(WebCore::ElementAttributeData::setAttr):
(WebCore::ElementAttributeData::removeAttr):

    Make these const, as they should always have been- they don't affect the ElementAttributeData,
    only the global DOM Attr <-> ElementAttributeData mappings.

(WebCore::ElementAttributeData::ensureInlineStyle):
(WebCore::ElementAttributeData::ensureMutableInlineStyle):

    Sprinkle ASSERT(isMutable()). This doesn't mean that all Elements with inline styles automatically
    have mutable attribute data. There's still inlineStyle() for that, which may return null.
    These are only for use where you need a valid StylePropertySet*, even if there is no inline style
    attribute, e.g in editing code that wants to add style.

(WebCore::ElementAttributeData::updateInlineStyleAvoidingMutation):
(WebCore::ElementAttributeData::destroyInlineStyle):

    Make these const. While destroyInlineStyle() doesn't sound very const-y, immutable objects that
    contain a style attribute will have a valid inlineStyle() with that style data. This is just
    an interface for ~StyledElement to destroy the style object.
    It'd be nice to do that in ~ElementAttributeData(), but we need a StyledElement* pointer to
    clean up properly and we don't store one in this class.

(WebCore::ElementAttributeData::addAttribute):
(WebCore::ElementAttributeData::removeAttribute):
(WebCore::ElementAttributeData::clearAttributes):
(WebCore::ElementAttributeData::replaceAttribute):

    Sprinkle ASSERT(isMutable()).
    Always go straight for m_mutableAttributeVector since we know that's the storage being used.

(WebCore::ElementAttributeData::isEquivalent):
(WebCore::ElementAttributeData::detachAttrObjectsFromElement):
(WebCore::ElementAttributeData::getAttributeItemIndexSlowCase):
(WebCore::ElementAttributeData::removeAttribute):
(WebCore::ElementAttributeData::getAttributeItem):
(WebCore::ElementAttributeData::getAttributeItemIndex):

    Use length() and attributeItem(index) to iterate over the attributes.

(WebCore::ElementAttributeData::cloneDataFrom):

    Sprinkle ASSERT(isMutable()). Added a FIXME that cloning elements could create immutable
    attribute data. I'm not sure this optimization is worthwhile, as cloning elements is already
    a semi-rare occurrence.

    Updated code to handle both immutable and mutable source objects. This could

(WebCore::ElementAttributeData::getAttributeNode):

    Const correctness.

* dom/ElementAttributeData.h:
(ElementAttributeData):

    Turn attribute storage into what's effectively union { OwnPtr<Vector<Attribute>>; Attribute[]; }
    The new m_isMutable bit determines which union member should be used for access.

(WebCore::ElementAttributeData::create):
(WebCore::ElementAttributeData::createImmutable):

    Added createImmutable(const Vector<Attribute>&) as a complement to create().

(WebCore::ElementAttributeData::setClass):
(WebCore::ElementAttributeData::setIdForStyleResolution):
(WebCore::ElementAttributeData::inlineStyle):
(WebCore::ElementAttributeData::setAttributeStyle):

    Make these const, and their data member counterparts 'mutable'.
    An immutable ElementAttributeData object still has m_classNames, m_idForStyleResolution,
    m_inlineStyleDecl and m_attributeStyle.

(WebCore::ElementAttributeData::reportMemoryUsage):

    Updated for isMutable().

(WebCore::ElementAttributeData::makeMutable):

    Returns a mutable clone of itself.

(WebCore::ElementAttributeData::isEmpty):
(WebCore::ElementAttributeData::length):
(WebCore::ElementAttributeData::attributeItem):

    Check isMutable() to know how to access attribute storage.

* dom/StyledElement.cpp:
(WebCore::StyledElement::style):
(WebCore::StyledElement::setInlineStyleProperty):

    Simplify by using StyledElement::ensureInlineStyle().

(WebCore::StyledElement::classAttributeChanged):

    Use mutableAttributeData() if the attribute is being removed completely.
    In other cases, tiptoe around without causing the attribute data to go mutable.

(WebCore::StyledElement::removeInlineStyleProperty):

    Use mutableAttributeData() if/when actually removing something.

(WebCore::StyledElement::addSubresourceAttributeURLs):

    Const correctness.

* dom/StyledElement.h:
(WebCore::StyledElement::ensureInlineStyle):

    This now implies conversion to mutable attribute data. Used by codepaths that add/remove
    properties, so conversion is inevitable.

* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
(WebCore::HTMLConstructionSite::createHTMLElementFromSavedElement):
* svg/properties/SVGAnimatedPropertyMacros.h:
(WebCore::SVGSynchronizableAnimatedProperty::synchronize):

    Use mutableAttributeData() as appropriate.

* xml/parser/XMLDocumentParserQt.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser):

    Const correctness.

LayoutTests:

Extended this test to cover the case where setAttributeNode() returns a lazily serialized value.

* fast/dom/attr-style-too-lazy-expected.txt:
* fast/dom/attr-style-too-lazy.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=89114
REGRESSION (r112919): Setting scrollTop after setting display from none to block 
fails
-and corresponding-
<rdar://problem/11656050>

Reviewed by Simon Fraser.

Source/WebCore: 

ScrollAnimatorMac::immediateScrollTo() and ScrollAnimatorMac::immediateScrollBy() 
both have an optimization in place so that they do not call 
notifyPositionChanged() if the new scroll offset matches the ScrollAnimator's 
cached m_currentPosX and m_currentPosY. So revision 112919 caused troubled with 
this optimization because it allowed RenderLayers to restore a scrollOffset from 
the Element if there is one cached there. This caused the RenderLayer to have a 
scrollOffset that is improperly out-of-synch with the ScrollAnimator's 
currentPosition (which will just be 0,0 since it is being re-created like the 
RenderLayer). This fix makes sure they are in synch by calling 
setCurrentPosition() on the ScrollAnimator when the cached position is non-zero.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):

LayoutTests: 

* fast/overflow/setting-scrollTop-after-hide-show-expected.txt: Added.
* fast/overflow/setting-scrollTop-after-hide-show.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web inspector auto-completes "optimizequality" but then complains
https://bugs.webkit.org/show_bug.cgi?id=92262

Reviewed by Timothy Hatcher.

Fixed optimizeSpeed, optimizeLegibility, geometricPrecision.

* inspector/front-end/CSSKeywordCompletions.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123638 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r123624.

* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::clearGeolocationOverride):
Changed ASSERT_UNUSED() to UNUSED_PARAM().


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