Simplify process suppression state calculation
https://bugs.webkit.org/show_bug.cgi?id=126473

Reviewed by Geoffrey Garen & Sam Weinig.

Don't check the application occlusion state (this is covered by the pages already),
and let the page check visually idle. Remove layers of functions.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didFinishLaunching):
    - Let the network process nap if all processes in its context are napping.*
      (* Except not really. We currently leak a boost onto the process anyway.)
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::didFinishLaunching):
    - Let the plugin process nap if all processes in all contexts are napping.
* UIProcess/WebContext.h:
    - Remove canEnableProcessSuppressionForNetworkProcess & canEnableProcessSuppressionForWebProcess
    - canEnableProcessSuppressionForGlobalChildProcesses -> processSuppressionIsEnabledForAllContexts
    - combine updateProcessSuppressionStateOfChildProcesses & updateProcessSuppressionStateOfGlobalChildProcesses
        -> updateProcessSuppressionState
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isProcessSuppressible):
    - WebProcess is supressible if IsVisuallyIdle.
(WebKit::WebPageProxy::viewStateDidChange):
    - WebProcessProxy should updateProcessSuppressionState when IsVisuallyIdle changes.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::createWebPage):
(WebKit::WebProcessProxy::addExistingWebPage):
(WebKit::WebProcessProxy::pageSuppressibilityChanged):
(WebKit::WebProcessProxy::pagePreferencesChanged):
    - pageIsProcessSuppressible -> isProcessSuppressible
* UIProcess/WebProcessProxy.h:
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::updateProcessSuppressionState):
    - Update supression state of network & plugin processes.
(WebKit::WebContext::processSuppressionIsEnabledForAllContexts):
    - Changed iterator style, made a static member of WebContext.
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::updateProcessSuppressionState):
    - Ask the WebContext to update supression state.
* UIProcess/mac/WindowServerConnection.h:
* UIProcess/mac/WindowServerConnection.mm:
(WebKit::WindowServerConnection::windowServerConnectionStateChanged):
(WebKit::WindowServerConnection::WindowServerConnection):
    - Remove application occlusion state.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix on non-Mac port

* Shared/API/c/WKDeprecatedFunctions.cpp: Add ENABLE(MAC) guard for "WKContextPrivateMac.h".

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161302 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simplify ScrollingStateNode references to various layer types
https://bugs.webkit.org/show_bug.cgi?id=126477

Reviewed by Tim Horton.

ScrollingStateNodes referenced both GraphicsLayer and PlatformLayers, in
confusing ways. In the main thread they have a GraphicsLayer*, but need
to check to see if the underlying PlatformLayer changed. Then, when
cloned to commit to the scrolling thread, they drop the GraphicsLayer
and store a PlatformLayer.

Hide the complexity (and prepare for the future) by adding LayerRepresentation,
which wraps various different flavors of layers, and knows how to check whether
the PlatformLayer underlying a GraphicsLayer changed.

ScrollingStateNode layer setters then just take and compare LayerRepresentations.
Copy constructors convert to a PlatformLayer representation (though not really
in the right place currently), and ScrollingTreeNodes get PlatformLayers.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollingNode):
(WebCore::AsyncScrollingCoordinator::setScrollLayerForNode):
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::syncLayerPositionForViewportRect):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::ScrollingStateNode):
(WebCore::ScrollingStateNode::setLayer):
* page/scrolling/ScrollingStateNode.h:
(WebCore::LayerRepresentation::LayerRepresentation):
(WebCore::LayerRepresentation::operator GraphicsLayer*):
(WebCore::LayerRepresentation::operator PlatformLayer*):
(WebCore::LayerRepresentation::operator GraphicsLayer::PlatformLayerID):
(WebCore::LayerRepresentation::operator ==):
(WebCore::LayerRepresentation::toPlatformLayer):
(WebCore::LayerRepresentation::representsGraphicsLayer):
(WebCore::LayerRepresentation::representsPlatformLayer):
(WebCore::LayerRepresentation::representsPlatformLayerID):
(WebCore::ScrollingStateNode::layer):
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer):
(WebCore::ScrollingStateScrollingNode::setHeaderLayer):
(WebCore::ScrollingStateScrollingNode::setFooterLayer):
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::syncLayerPositionForViewportRect):
* page/scrolling/mac/ScrollingStateNodeMac.mm:
* page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::updateBeforeChildren):
* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::updateBeforeChildren):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[super dealloc] missing in Source/JavaScriptCore/API/tests/testapi.mm, fails to build with -Werror,-Wobjc-missing-super-calls
https://bugs.webkit.org/show_bug.cgi?id=126454

Reviewed by Geoffrey Garen.

* API/tests/testapi.mm:
(-[TextXYZ dealloc]):
add [super dealloc]
(-[EvilAllocationObject dealloc]):
add [super dealloc]


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix CoordinatedGraphics build after r161303. Remove implementations
which are now in the cross-platform file.

* page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
(WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree):
(WebCore::ScrollingCoordinatorCoordinatedGraphics::updateViewportConstrainedNode):
* page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp:
* page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up the means of committing the scrolling state tree
https://bugs.webkit.org/show_bug.cgi?id=126482

Reviewed by Tim Horton.

ScrollingStateNodes would manually call scrollingStateTree().setHasChangedProperties()
after setPropertyChanged() in lots of places, which was repetitive, and
AsyncScrollingCoordinator manually called scheduleTreeStateCommit() in many places.

Clean up both of these with a clearer trigger for state tree commits.
ScrollingStateNodes::setPropertyChanged() calls ScrollingStateTree::setHasChangedProperties(),
which turns around and tells the ScrollingCoordinator that the state tree became dirty.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::AsyncScrollingCoordinator):
(WebCore::AsyncScrollingCoordinator::scrollingStateTreePropertiesChanged):
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::updateScrollingNode):
(WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode):
(WebCore::AsyncScrollingCoordinator::setScrollLayerForNode):
(WebCore::AsyncScrollingCoordinator::setCounterScrollingLayerForNode):
(WebCore::AsyncScrollingCoordinator::setHeaderLayerForNode):
(WebCore::AsyncScrollingCoordinator::setFooterLayerForNode):
(WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionForNode):
(WebCore::AsyncScrollingCoordinator::setWheelEventHandlerCountForNode):
(WebCore::AsyncScrollingCoordinator::setScrollBehaviorForFixedElementsForNode):
(WebCore::AsyncScrollingCoordinator::setScrollbarPaintersFromScrollbarsForNode):
(WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::updateConstraints):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::setPropertyChanged):
(WebCore::ScrollingStateNode::setLayer):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::setViewportRect):
(WebCore::ScrollingStateScrollingNode::setTotalContentsSize):
(WebCore::ScrollingStateScrollingNode::setScrollOrigin):
(WebCore::ScrollingStateScrollingNode::setScrollableAreaParameters):
(WebCore::ScrollingStateScrollingNode::setFrameScaleFactor):
(WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion):
(WebCore::ScrollingStateScrollingNode::setWheelEventHandlerCount):
(WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons):
(WebCore::ScrollingStateScrollingNode::setScrollBehaviorForFixedElements):
(WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition):
(WebCore::ScrollingStateScrollingNode::setHeaderHeight):
(WebCore::ScrollingStateScrollingNode::setFooterHeight):
(WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer):
(WebCore::ScrollingStateScrollingNode::setHeaderLayer):
(WebCore::ScrollingStateScrollingNode::setFooterLayer):
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::updateConstraints):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::create):
(WebCore::ScrollingStateTree::ScrollingStateTree):
(WebCore::ScrollingStateTree::setHasChangedProperties):
(WebCore::ScrollingStateTree::didRemoveNode):
* page/scrolling/ScrollingStateTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
* page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
(WebCore::ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build brake after 161045 on EFL port with WebKit2 and gcc 4.6.3
https://bugs.webkit.org/show_bug.cgi?id=126383

Patch by Piotr Grad <p.grad@samsung.com> on 2014-01-03
Reviewed by Sam Weinig.

Class identifier was missing.

* DatabaseProcess/DatabaseProcess.h:
* NetworkProcess/NetworkProcess.h:
* PluginProcess/PluginProcess.h:
* Shared/mac/CookieStorageShim.h:
* UIProcess/Plugins/PluginProcessManager.h:
* UIProcess/WebPageProxy.cpp:
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebProcess.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Attempt to fix EFL build.

* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::setHasChangedProperties):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Explicitly use the std:: nested name specifier when using std::pair, std::make_pair
https://bugs.webkit.org/show_bug.cgi?id=126439

Reviewed by Andreas Kling.

Source/JavaScriptCore: 

Instead of relying on std::pair and std::make_pair symbols being present in the current scope
through the pair and make_pair symbols, the std:: specifier should be used explicitly.

* bytecode/Opcode.cpp:
(JSC::compareOpcodePairIndices):
(JSC::OpcodeStats::~OpcodeStats):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::makeBinaryNode):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseIfStatement):
* runtime/Structure.cpp:
(JSC::StructureTransitionTable::contains):
(JSC::StructureTransitionTable::get):
(JSC::StructureTransitionTable::add):

Source/WebCore: 

Instead of relying on std::pair and std::make_pair symbols being present in the current scope
through the pair and make_pair symbols, the std:: specifier should be used explicitly.

* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::rowIndexRange):
(WebCore::AccessibilityARIAGridCell::columnIndexRange):
* accessibility/AccessibilityARIAGridCell.h:
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::mathPrescripts):
(WebCore::AccessibilityRenderObject::mathPostscripts):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::cellForColumnAndRow):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::rowIndexRange):
(WebCore::AccessibilityTableCell::columnIndexRange):
* accessibility/AccessibilityTableCell.h:
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableGetColumnAtIndex):
(webkitAccessibleTableGetRowAtIndex):
(webkitAccessibleTableGetColumnExtentAt):
(webkitAccessibleTableGetRowExtentAt):
(webkitAccessibleTableGetColumnHeader):
(webkitAccessibleTableGetRowHeader):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
(-[WebAccessibilityObjectWrapper accessibilityRowRange]):
(-[WebAccessibilityObjectWrapper accessibilityColumnRange]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertMathPairsToNSArray):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* bindings/js/SerializedScriptValue.cpp:
* dom/ContainerNode.cpp:
* dom/StyledElement.cpp:
(WebCore::attributeNameSort):
* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseTimeFragment):
* html/parser/HTMLMetaCharsetParser.h:
* inspector/ContentSearchUtils.cpp:
(WebCore::ContentSearchUtils::getRegularExpressionMatchesByLines):
(WebCore::ContentSearchUtils::searchInTextByLines):
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::diff):
(WebCore::DOMPatchSupport::innerPatchChildren):
* inspector/DOMPatchSupport.h:
* inspector/InspectorAgent.cpp:
(WebCore::InspectorAgent::enable):
(WebCore::InspectorAgent::evaluateForTestInFrontend):
* inspector/InspectorAgent.h:
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::brokenImage):
* loader/cache/CachedImage.h:
* platform/URL.cpp:
(WebCore::findHostnamesInMailToURL):
(WebCore::encodeHostnames):
* platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.h:
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::getCachedFontData):
* platform/graphics/WidthIterator.cpp:
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::adopt):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::parseCacheControlDirectives):
(WebCore::parseCacheHeader):
* platform/text/AtomicStringKeyedMRUCache.h:
* platform/text/LineBreakIteratorPoolICU.h:
* rendering/InlineFlowBox.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageSizeForError):
(WebCore::RenderImage::paintReplaced):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::cachedCollapsedBorder):
* rendering/RenderTableSection.h:
* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::constructFromString):
(WebCore::SVGAnimatedAngleAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
* svg/SVGAnimatedIntegerOptionalInteger.cpp:
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
* svg/SVGAnimatedNumberOptionalNumber.cpp:
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::constructFromString):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::createIntegerOptionalInteger):
(WebCore::SVGAnimatedType::createNumberOptionalNumber):
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::integerOptionalInteger):
(WebCore::SVGAnimatedType::numberOptionalNumber):
* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::constructFromBaseValues):
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues):
* svg/SVGParserUtilities.h:
* svg/animation/SMILTimeContainer.h:

Source/WebKit/mac: 

Instead of relying on std::pair and std::make_pair symbols being present in the current scope
through the pair and make_pair symbols, the std:: specifier should be used explicitly.

* Plugins/Hosted/NetscapePluginInstanceProxy.h:
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject):
(WebKit::NetscapePluginInstanceProxy::LocalObjectMap::retain):
(WebKit::NetscapePluginInstanceProxy::LocalObjectMap::release):
(WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget):

Source/WebKit2: 

Instead of relying on std::pair and std::make_pair symbols being present in the current scope
through the pair and make_pair symbols, the std:: specifier should be used explicitly.

* Shared/mac/ArgumentCodersMac.mm:
(IPC::encode):
* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::show):
(WebKit::WebNotificationManagerProxy::cancel):
(WebKit::WebNotificationManagerProxy::didDestroyNotification):
* UIProcess/Notifications/WebNotificationManagerProxy.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createNewWebProcess):
* UIProcess/WebContext.h:

Source/WTF: 

* wtf/VectorTraits.h: Stop bringing std::pair into the current scope.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] [CMake] Fix the video and audio build
https://bugs.webkit.org/show_bug.cgi?id=126464

Reviewed by Philippe Normand.

.:

* Source/cmake/OptionsGTK.cmake: GStreamer files look for USE(GSTREAMER) and USE(WEBAUDIO_GSTREAMER),
so define those when appropriate. Web audio is one by default in autotools, so turn it on for cmake
as well.

Source/WebCore:

* PlatformGTK.cmake: Complete the audio and video source lists.

Tools:

* GtkLauncher/CMakeLists.txt: Add GStreamer includes and libraries, since GtkLauncher uses it.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] [CMake] Improve the way we locate gobject-introspection
https://bugs.webkit.org/show_bug.cgi?id=126452

Reviewed by Philippe Normand.

.:

* Source/cmake/FindGObjectIntrospection.cmake: Added.
* Source/cmake/OptionsGTK.cmake: Load the new  FindGObjectIntrospection file.

Source/JavaScriptCore:

* PlatformGTK.cmake: Use the new introspection variables.

Source/WebKit:

* PlatformGTK.cmake: Use the new introspection variables.

Source/WebKit2:

* PlatformGTK.cmake: Use the new introspection variables.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move LineBreaker functions to LineBreaker.cpp
https://bugs.webkit.org/show_bug.cgi?id=126491

Reviewed by Simon Fraser.

- Moves LineBreaker::nextLineBreak() and LineBreaker::nextSegmentBreak() to
  LineBreaker.cpp from RenderBlockLineLayout.cpp
- Moves requiresIndent() to LineWidth.h/cpp from RenderBlockLineLayout.cpp
  so it can be shared.
- Adds missing inline specifier to BreakingContext::handleEndOfLine() to avoid
  duplicate symbols.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::updateLogicalInlinePositions):
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
* rendering/line/BreakingContextInlineHeaders.h:
(WebCore::BreakingContext::handleEndOfLine):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::nextLineBreak):
(WebCore::LineBreaker::nextSegmentBreak):
* rendering/line/LineWidth.cpp:
(WebCore::requiresIndent):
* rendering/line/LineWidth.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Prepare the ScrollingTree for remote use
https://bugs.webkit.org/show_bug.cgi?id=126493

Reviewed by Sam Weinig.

When committing the scrolling tree, we clone the ScrollingStateTree
to hand off to another thread, or (in future) to encode to send to the
UI process. During this cloning process, two types of layer transformations
take place: for threaded scrolling, we replace GraphicsLayer with PlatformLayers.
For remote scrolling, we'll replace GraphicsLayers with PlatformLayerIDs.
Allow the ScrollingCoordinator to specify which type of transformation occurs
by giving ScrollingStateTree a LayerRepresentation::Type member,
which is consulted during ScrollingStateNode cloning.

Also only copy layers that have changed to avoid setting dirty bits.

Expose some other stuff on ScrollingStateTree which will be needed for
remote scrolling.

* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::syncLayerPositionForViewportRect):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::ScrollingStateNode):
* page/scrolling/ScrollingStateNode.h:
(WebCore::LayerRepresentation::operator GraphicsLayer::PlatformLayerID):
(WebCore::LayerRepresentation::toRepresentation):
(WebCore::ScrollingStateNode::changedProperties):
(WebCore::ScrollingStateNode::setChangedProperties):
(WebCore::ScrollingStateNode::parentNodeID):
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::syncLayerPositionForViewportRect):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::ScrollingStateTree):
(WebCore::ScrollingStateTree::commit):
(WebCore::ScrollingStateTree::setRemovedNodes):
(WebCore::ScrollingStateTree::stateNodeForID):
* page/scrolling/ScrollingStateTree.h:
(WebCore::ScrollingStateTree::nodeCount):
(WebCore::ScrollingStateTree::nodeMap):
(WebCore::ScrollingStateTree::preferredLayerRepresentation):
(WebCore::ScrollingStateTree::setPreferredLayerRepresentation):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeState):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move a few more functions from RenderBlock to RenderBlockFlow
https://bugs.webkit.org/show_bug.cgi?id=126494

Reviewed by Andreas Kling.

* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::adjustInlineDirectionLineBounds):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::textAlignmentForLine):
(WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
(WebCore::RenderBlockFlow::startAlignedOffsetForLine):
These are only used by RenderBlockFlow, so move them there.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use Compiler macros instead of raw "final" and "override"
https://bugs.webkit.org/show_bug.cgi?id=126490

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2014-01-04
Reviewed by Sam Weinig.

* runtime/JSPromiseReaction.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move process suppression of WebProcess to Page (from UIProcess)
https://bugs.webkit.org/show_bug.cgi?id=126480

Reviewed by Sam Weinig.

Let each page take a UserActivity rather than having to coalesce this state, and take different activity
tokens for normal visibility and suppression disabled, so we can see why the process is not suppressed.

Source/WebCore: 

* WebCore.exp.in:
* page/Page.cpp:
(WebCore::Page::setIsVisuallyIdle):
* page/Page.h:
    - setThrottled -> setIsVisuallyIdle.
* page/PageThrottler.cpp:
(WebCore::PageThrottler::PageThrottler):
    - Initialize m_visuallyNonIdle.
(WebCore::PageThrottler::~PageThrottler):
    - setThrottled -> setIsVisuallyIdle.
(WebCore::PageThrottler::setIsVisuallyIdle):
    - Use m_visuallyNonIdle to disable supression when the page is not visually idle.
* page/PageThrottler.h:
    - setThrottled -> setIsVisuallyIdle, added m_visuallyNonIdle.

Source/WebKit2: 

* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::platformInitialize):
    - Don't start with process supression disabled; this is unnecessary,
      message from the UIProcess should wake.
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::updateProcessSuppressionState):
    - Don't send explicit messages to supress the WebProcess, it handles this for itself.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
    - call setIsVisuallyIdle.
(WebKit::WebPage::setViewState):
    - call setIsVisuallyIdle.
(WebKit::WebPage::updatePreferences):
    - Use m_suppressionDisabled to disable supression if the WebPreference is set.
(WebKit::WebPage::setIsVisuallyIdle):
    - setThrottled -> setIsVisuallyIdle.
* WebProcess/WebPage/WebPage.h:
    - setThrottled -> setIsVisuallyIdle, added m_suppressionDisabled.
* WebProcess/WebProcess.cpp:
* WebProcess/WebProcess.h:
(WebKit::WebProcess::shouldForceScreenFontSubstitution):
    - Removed setProcessSuppressionEnabled - WebPage now detects the supression change.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Weekend URTBF after r161319 to make non Mac builds work again.

* page/PageThrottler.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161320 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the Mac build too.

* page/PageThrottler.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Stop installing WebKit2 C API headers
https://bugs.webkit.org/show_bug.cgi?id=126489

Reviewed by Martin Robinson.

.:

* GNUmakefile.am:

Source/WebKit2:

We are not actually maintaining the API/ABI compatibility of the
WebKit2 C API, it's only used internally by the public GTK+ API
and nobody is using it.

* GNUmakefile.am:
* GNUmakefile.list.am:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use lineageOfType to simplify two rendering helpers.
<https://webkit.org/b/126498>

Reviewed by Antti Koivisto.

* rendering/RenderRuby.cpp:
(WebCore::findRubyRunParent):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::findTreeRootObject):

    Simplify two functions that walk their parent chain to find the
    closest ancestor of a certain type.

* rendering/RenderRubyRun.h:

    Add requisite isRendererOfType<RenderRubyRun>().


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