Flush throttling with remote layers
https://bugs.webkit.org/show_bug.cgi?id=134398

Reviewed by Darin Adler.


Source/WebCore: 
With remote layer trees the flush scheduling lives in the WebKit2 layer. The throttling code
needs to live there as well.
        
Add the required callbacks and disable the existing throttling code in RenderLayerCompositor
when remote layers are in use. Later we can get rid of the RenderLayerCompositor throttling code.

* WebCore.xcodeproj/project.pbxproj:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadProgressingStatusChanged):
* page/ChromeClient.h:
(WebCore::ChromeClient::adjustLayerFlushThrottling):
* page/FrameView.cpp:
(WebCore::FrameView::disableLayerFlushThrottlingTemporarilyForInteraction):
(WebCore::FrameView::loadProgressingStatusChanged):
        
    Factor the progress status change activities to a function.

(WebCore::FrameView::updateLayerFlushThrottling):
(WebCore::FrameView::setExposedRect):
        
    Move the call to adjustTiledBackingCoverage from WebKit to here.

(WebCore::FrameView::updateLayerFlushThrottlingInAllFrames): Deleted.
* page/FrameView.h:
* page/LayerFlushThrottleState.h: Added.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):

Source/WebKit2: 
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::adjustLayerFlushThrottling):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::adjustLayerFlushThrottling):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):

    Delay layer flushes during page loading.
    If use interacts with the page the next flush in unthrottled even if loading is in progress.

(WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
        
    Compute the new delay. The first visual flush uses a shorter delay.
    Flush immediately when we are no longer throttling.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170557 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ScrollView::rootViewToTotalContents() needs to take topContentInset into account
https://bugs.webkit.org/show_bug.cgi?id=134415
-and corresponding-
<rdar://problem/17473633>

Reviewed by Simon Fraser.

This affects hit testing in headers aka PageBanners.

The root view will be anchored above the start of the total contents if there is a 
topContentInset, so the inset value should be subtracted to get into the right 
coordinate space here.
* platform/ScrollView.cpp:
(WebCore::ScrollView::rootViewToTotalContents):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove extra operations from 64-bit or on armv7.
https://bugs.webkit.org/show_bug.cgi?id=134408

Patch by Alex Christensen <achristensen@webkit.org> on 2014-06-27
Reviewed by Geoffrey Garen.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::addFlagsToElementStyleFromContext):
Only do or operations if it would change values.
Often we're only setting one flag, so half the operations are not necessary.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Lazily link frameworks in WebVideoFullscreenInterfaceAVKit.
https://bugs.webkit.org/show_bug.cgi?id=134407

Patch by Jeremy Jones <jeremyj@apple.com> on 2014-06-27
Reviewed by Eric Carlson.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerController init]):
Load AVPlayerController on use.
(WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
Remove loading on construction.
(WebVideoFullscreenInterfaceAVKit::setCurrentTime): Load AVValueTiming on use.
(WebVideoFullscreenInterfaceAVKit::setupFullscreen): Load several classes on use.
(WebVideoFullscreenInterfaceAVKit::exitFullscreen): Load UIColor on use.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove BufferForAppendingHyphen
https://bugs.webkit.org/show_bug.cgi?id=134376

Reviewed by Darin Adler.

It is legacy, from a time when that code was using a Vector.

The problem is that StringBuilder's memory was also implicitly used to keep
the string alive for the lifespan of the TextRun. That seems quite dangerous
as changes in StringBuilder could have changed that.

To fix the lifetime issue, my first idea was to make it explicit by passing
a String reference to hold the memory alive, and a boolean to say if the text
need an hyphen. The problem with that is this code is very hot and I made things
worse.

The solution with this patch is to just pass a pointer to a String to do both
the buffer reference, and the decision to add the hyphen. Having a single
argument with 2 meanings is not pretty but that's not worse than the old buffer.

* editing/TextIterator.cpp:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintSelection):
(WebCore::InlineTextBox::constructTextRun):
(WebCore::adjustCharactersAndLengthForHyphen): Deleted.
* rendering/InlineTextBox.h:
(WebCore::BufferForAppendingHyphen::BufferForAppendingHyphen): Deleted.
* rendering/RenderText.cpp:


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