[CSSRegions] Make RenderNamedFlowFragment::computeStyleInRegion const
https://bugs.webkit.org/show_bug.cgi?id=137604

Reviewed by Andrei Bucur.

The method computeStyleInRegion should be const as it does not modify
the state of the RenderNamedFlowFragment instance. Make pointers to
the region used for styling const along the way. No new tests as no
change in functionality.

* css/ElementRuleCollector.h:
(WebCore::ElementRuleCollector::ElementRuleCollector):
(WebCore::ElementRuleCollector::setRegionForStyling):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::initForStyleResolve):
(WebCore::StyleResolver::styleForElement):
* css/StyleResolver.h:
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::computeStyleInRegion):
* rendering/RenderNamedFlowFragment.h:


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

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174649 268f45cc-cd09-0410-ab3c-d52691b4dbfc
iOS DRT snapshots are limited to the page visible area
https://bugs.webkit.org/show_bug.cgi?id=137650

Reviewed by Daniel Bates.
Source/WebCore:

LegacyTileCache drawing was limited to the window's visible area, found by
crawling up the layer hierarchy to the root layer. This caused test snapshots to
be missing non-composited content outside the iPhone visible area, which hinders
testing.

Fix by adding a test-only mode where the window visible area is the entire window.

* platform/ios/wak/WAKWindow.h:
* platform/ios/wak/WAKWindow.mm:
(-[WAKWindow setEntireWindowVisibleForTesting:]):
(-[WAKWindow _visibleRectRespectingMasksToBounds:]):

Tools:

LegacyTileCache drawing was limited to the window's visible area, found by
crawling up the layer hierarchy to the root layer. This caused test snapshots to
be missing non-composited content outside the iPhone visible area, which hinders
testing.

Fix by adding a test-only mode where the window visible area is the entire window.

* DumpRenderTree/ios/PixelDumpSupportIOS.mm:
(dumpWebViewAsPixelsAndCompareWithExpected): Drive-by RetainPtr fix.
* DumpRenderTree/mac/DumpRenderTreeWindow.mm:
(-[DumpRenderTreeWindow initWithLayer:]): Call setEntireWindowVisibleForTesting:YES
for the DRT window.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Stop listening for wireless playback target availability when the default controls are hidden.
https://bugs.webkit.org/show_bug.cgi?id=137633

Reviewed by Dean Jackson.

In order to minimize the excess bandwidth and power consumption required for actively listening
for wireless playback target availablity, unregister for those notifications while the controls
are hidden due to playback, or when the element's document is hidden.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.createBase): Register for document visiblity change notfications.
(ControllerIOS.prototype.setControlsType): Call updateShouldListenForPlaybackTargetAvailabilityEvent()
    instead of setShouldListenForPlaybackTargetAvailabilityEvent()
(ControllerIOS.prototype.hideControls): Ditto.
(ControllerIOS.prototype.showControls): Ditto.
(ControllerIOS.prototype.updateStatusDisplay): Ditto.
(ControllerIOS.prototype.handleVisibilityChange): Ditto.
(ControllerIOS.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent): Added. Only listen
    for target availability when the video has no errors, is not in the initial "big play button"
    controls state, and when the controls are not hidden.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Explicitly set the discoveryMode to "disabled"
    rather than waiting for the autoreleasepool to destroy our routing controller.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174651 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaPlayer::characteristicChanged() is not called when new tracks are found in SourceBufferPrivateAVFObjC
https://bugs.webkit.org/show_bug.cgi?id=137533

Reviewed by Darin Adler.

Source/WebCore:

When a new AVAsset is returned out of the AVStreamDataParser, notify the HTMLMediaElement that
characteristics of the player may have changed.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::characteristicsChanged):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/WKPageIsPlayingAudio.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/file-with-mse.html: Added.
* TestWebKitAPI/Tests/WebKit2/test-mse.mp4: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use is<>() / downcast<>() for Table render objects
https://bugs.webkit.org/show_bug.cgi?id=137641

Reviewed by Mihnea Ovidenie.

Use is<>() / downcast<>() for table-related render objects and clean
up the surrounding code.

No new tests, no behavior change.

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::tableElement):
(WebCore::AccessibilityTable::isDataTable):
(WebCore::AccessibilityTable::isTableExposableThroughAccessibility):
(WebCore::AccessibilityTable::addChildren):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::parentTable):
(WebCore::AccessibilityTableCell::rowIndexRange):
(WebCore::AccessibilityTableCell::columnIndexRange):
(WebCore::AccessibilityTableCell::titleUIElement):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::headerObject):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::removeNode):
* editing/TextIterator.cpp:
(WebCore::shouldEmitTabBeforeNode):
(WebCore::shouldEmitNewlinesBeforeAndAfterNode):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::parseAttribute):
(WebCore::HTMLTableCellElement::cellAbove):
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::parseAttribute):
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::parseAttribute):
* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
(WebCore::shouldScaleColumns):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::layoutOverflowRectForPropagation):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::addChild):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild):
(WebCore::RenderTable::layout):
(WebCore::RenderTable::firstColumn):
(WebCore::RenderTable::recalcSections):
(WebCore::RenderTable::sectionAbove):
(WebCore::RenderTable::sectionBelow):
(WebCore::RenderTable::bottomSection):
* rendering/RenderTable.h:
* rendering/RenderTableCaption.cpp:
(WebCore::RenderTableCaption::table):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::nextCell):
(WebCore::RenderTableCell::previousCell):
(WebCore::RenderTableRow::firstCell):
(WebCore::RenderTableRow::lastCell):
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::table):
(WebCore::RenderTableCol::enclosingColumnGroup):
(WebCore::RenderTableCol::nextColumn):
* rendering/RenderTableCol.h:
Make updateFromElement() public to allow the callers to use tighter
typing and devitualize the call as the class is final.

* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild):
* rendering/RenderTableRow.h:
(WebCore::RenderTableSection::firstRow):
(WebCore::RenderTableSection::lastRow):
(WebCore::RenderTableRow::nextRow):
(WebCore::RenderTableRow::previousRow):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::paintCell):
* rendering/RenderTableSection.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::writeTextRun):
(WebCore::writeSimpleLine):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use is<>() / downcast<>() for Filter / FilterOperation subclasses
https://bugs.webkit.org/show_bug.cgi?id=137644

Reviewed by Darin Adler.

Use is<>() / downcast<>() for Filter / FilterOperation subclasses.

Source/WebCore:

No new tests, no behavior change.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForFilter):
* platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
(PlatformCAFilters::filterValueForOperation):
(PlatformCAFilters::colorMatrixValueForFilter):
* platform/graphics/filters/Filter.h:
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::DefaultFilterOperation::operator==):
(WebCore::ReferenceFilterOperation::operator==):
(WebCore::BasicColorMatrixFilterOperation::blend):
(WebCore::BasicColorMatrixFilterOperation::operator==):
(WebCore::BasicComponentTransferFilterOperation::blend):
(WebCore::BasicComponentTransferFilterOperation::operator==):
(WebCore::BlurFilterOperation::operator==):
(WebCore::BlurFilterOperation::blend):
(WebCore::DropShadowFilterOperation::operator==):
(WebCore::DropShadowFilterOperation::blend):
* platform/graphics/filters/FilterOperation.h:
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::outsets):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::build):
* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
* rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
(WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
* svg/graphics/filters/SVGFilter.h:
(isType):

Source/WebKit2:

* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(IPC::ArgumentCoder<WebCore::FilterOperations>::encode):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<FilterOperation>::encode):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTextStream::operator<<):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add more detailed wait time information to EWS metrics
https://bugs.webkit.org/show_bug.cgi?id=137649

Reviewed by Daniel Bates.

Added average and worst time (we used to only have median), and also a percentage
of patches that took a non-trivial time to start. Non-trivial is defined as 3 minutes.

There is always some wait due to the polling nature of the queues, which is well understood
and doesn't need to be measured. What needs to be measured is whether there is enough
bot machines to process patches as soon as they are submitted.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js:
(Analyzer.prototype._analyzeBubblePerformance):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsBubbleView.js:
(MetricsBubbleView.prototype._update):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[XvfbDriver] Regular expression used to match running X servers fails on Fedora 21.
https://bugs.webkit.org/show_bug.cgi?id=137659

Reviewed by Martin Robinson.

* Scripts/webkitpy/port/xvfbdriver.py:
(XvfbDriver._next_free_display): Update the regular expression to also match Xorg.bin


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174656 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use is<>() / downcast<>() for PlatformCALayer subclasses
https://bugs.webkit.org/show_bug.cgi?id=137661

Reviewed by Simon Fraser.

Source/WebCore:

Use is<>() / downcast<>() for PlatformCALayer subclasses and clean up
the surrounding code.

No new tests, no behavior change.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
(WebCore::GraphicsLayerCA::updateContentsRects):
(WebCore::GraphicsLayerCA::updateReplicatedLayers):
(WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
(WebCore::GraphicsLayerCA::fetchCloneLayers): Deleted.
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileCoverageMap.cpp:
(WebCore::TileCoverageMap::TileCoverageMap):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::ensureTilesForRect):
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::clone):
(PlatformCALayerMac::appendSublayer):
(PlatformCALayerMac::insertSublayer):
(PlatformCALayerMac::replaceSublayer):
(PlatformCALayerMac::adoptSublayers):
(PlatformCALayerMac::copyFiltersFrom):
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::setRootChildLayer):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::clone):
(PlatformCALayerWin::rootLayer):
(PlatformCALayerWin::appendSublayer):
(PlatformCALayerWin::insertSublayer):
(PlatformCALayerWin::replaceSublayer):
(PlatformCALayerWin::adoptSublayers):
(PlatformCALayerWin::copyFiltersFrom):
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::insertSublayer):
* platform/graphics/ca/win/PlatformCALayerWinInternal.h:

Source/WebKit/win:

Use is<>() / downcast<>() for PlatformCALayer subclasses and clean up
the surrounding code.

* FullscreenVideoController.cpp:
(FullscreenVideoController::enterFullscreen):

Source/WebKit2:

Use is<>() / downcast<>() for PlatformCALayer subclasses and clean up
the surrounding code.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::~PlatformCALayerRemote):
(WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
(WebKit::PlatformCALayerRemote::setSublayers):
(WebKit::PlatformCALayerRemote::appendSublayer):
(WebKit::PlatformCALayerRemote::insertSublayer):
(WebKit::PlatformCALayerRemote::replaceSublayer):
(WebKit::PlatformCALayerRemote::adoptSublayers):
(WebKit::PlatformCALayerRemote::setMask):
(WebKit::PlatformCALayerRemote::copyFiltersFrom):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::buildTransaction):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Drop unnecessary overlapMap null checks in computeCompositingRequirements()
https://bugs.webkit.org/show_bug.cgi?id=137668

Reviewed by Andreas Kling.

Drop unnecessary overlapMap null checks in computeCompositingRequirements().
The function is never called with a null overlapMap so we can make the
argument a reference and drop all the null checks.

No new tests, no behavior change.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
* rendering/RenderLayerCompositor.h:


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

* public/include/manifest.php:
(ManifestGenerator::generate): Assign an empty array to $repositories_with_commit when there are no commits.
* tests/admin-regenerate-manifest.js: Fixed the test case.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add StringCapture helper for thread-safe lambda capture
https://bugs.webkit.org/show_bug.cgi?id=137664

Reviewed by Anders Carlsson.

There is currently no clean way to capture a String in a thread-safe manner. This will now work:

StringCapture stringCapture(string);
auto lambdaThatRunsInAnotherThread = [stringCapture] { String string = stringCapture.string(); ... }

This type won't be necessary with C++14 initialized lambda capture: [string = string.isolatedCopy()].

* wtf/text/WTFString.h:
(WTF::StringCapture::StringCapture): Create isolated copy in copy-constructor.
(WTF::StringCapture::string):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use modern loops in RenderLayerCompositor
https://bugs.webkit.org/show_bug.cgi?id=137670

Reviewed by Simon Fraser.

Use modern range for-loops in RenderLayerCompositor.

No new tests, no behavior change.

* rendering/RenderLayerCompositor.cpp:
(WebCore::OverlapMapContainer::overlapsLayers):
(WebCore::RenderLayerCompositor::OverlapMap::RectList::intersects):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree):
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
(WebCore::RenderLayerCompositor::recursiveRepaintLayer):
(WebCore::resetTrackedRepaintRectsRecursive):
(WebCore::RenderLayerCompositor::layerHas3DContent):
(WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
(WebCore::RenderLayerCompositor::registerAllScrollingLayers):
(WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Improve the test image diffs page
https://bugs.webkit.org/show_bug.cgi?id=137674

Reviewed by Alexey Proskuryakov.

Tools:

Don't treat the input file as a format string, otherwise we have to escape special
characters. Just do a couple of replaces.

* Scripts/webkitpy/layout_tests/controllers/test_result_writer.py:
(TestResultWriter.write_image_diff_files):

LayoutTests:

New version of the image diff page that has the diff images in-place, and allows
for control of the image toggling.

* fast/harness/image-diff-template-expected.txt:
* fast/harness/image-diff-template.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS JIT: Implement :visited pseudo class
https://bugs.webkit.org/show_bug.cgi?id=135293

Reviewed by Benjamin Poulain.

Source/WebCore:

This patch implements CSS JIT for :visited. And it makes :not(:link) JIT-ed.
Following the design discussed at the other bug[1], implemented :visited JIT
without tracking VisitedMatchEnabled state.

In this patch, we change the semantics of :visited / :link
inside functional pseudo classes for further CSS Selector Level 4 extensions.

Edge cases are tested by the existing tests.
:not(:link)
    fast/history/link-inside-not.html
:not(:visited)
    fast/history/visited-inside-not.html
:-webkit-any(:link)
    fast/history/link-inside-any.html
:-webkit-any(:visited)
    fast/history/visited-inside-any.html

[1]: https://bugs.webkit.org/show_bug.cgi?id=135639

Test: fast/history/link-inside-not-inside-any.html
    To cover the :-webkit-any(:not(:link)), added new tests.

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
(WebCore::SelectorCompiler::constructFragments):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateRightmostTreeWalker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementLinkMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstLink):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateStoreLastVisitedElement):

LayoutTests:

To cover the :-webkit-any(:not(:link)), added new tests.

* TestExpectations:
* fast/history/link-inside-not-expected.txt:
* fast/history/link-inside-not-inside-any-expected.txt: Added.
* fast/history/link-inside-not-inside-any.html: Added.
* fast/history/link-inside-not.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Implement a page load profiling tool
https://bugs.webkit.org/show_bug.cgi?id=137673

Reviewed by Dean Jackson.

Source/WebKit/win:

Add a new predicate (isMainFrame) to the IWebFrame interface so
that we can make decisions about a frames position in the page
load hierarchy in client programs.

* Interfaces/IWebFrame.idl: Added new isMainFrame
predicate to interface definition.
* WebFrame.cpp:
(WebFrame::isMainFrame): Added.
* WebFrame.h:

Tools:

Add a tool to capture and summarize page load statistics.

* WinLauncher/Common.cpp:
(parseCommandLine): Move from WinMain.cpp so that it can
be shared with internal tools.
* WinLauncher/PageLoadTestClient.cpp: Added.
(PageLoadTestClient::PageLoadTestClient):
(PageLoadTestClient::pageLoadStartedAtTime):
(PageLoadTestClient::didStartProvisionalLoad):
(PageLoadTestClient::didCommitLoad):
(PageLoadTestClient::didFirstLayoutForMainFrame):
(PageLoadTestClient::didHandleOnLoadEvents):
(PageLoadTestClient::didFinishLoad):
(PageLoadTestClient::didFailLoad):
(PageLoadTestClient::didInitiateResourceLoad):
(PageLoadTestClient::didEndResourceLoad):
(PageLoadTestClient::pageLoadEndedAtTime):
(PageLoadTestClient::endPageLoad):
(PageLoadTestClient::clearPageLoadState):
(PageLoadTestClient::shouldConsiderPageLoadEnded):
(PageLoadTestClient::maybeEndPageLoadSoon):
(PageLoadTestClient::setPageURL):
(PageLoadTestClient::dumpRunStatistics):
* WinLauncher/PrintWebUIDelegate.cpp:
(PrintWebUIDelegate::createWebViewWithRequest): Handle
nullptr URL properly.
* WinLauncher/ResourceLoadDelegate.cpp: Added.
(ResourceLoadDelegate::QueryInterface):
(ResourceLoadDelegate::AddRef):
(ResourceLoadDelegate::Release):
(ResourceLoadDelegate::identifierForInitialRequest):
(ResourceLoadDelegate::willSendRequest):
(ResourceLoadDelegate::didReceiveAuthenticationChallenge):
(ResourceLoadDelegate::didCancelAuthenticationChallenge):
(ResourceLoadDelegate::didReceiveResponse):
(ResourceLoadDelegate::didReceiveContentLength):
(ResourceLoadDelegate::didFinishLoadingFromDataSource):
(ResourceLoadDelegate::didFailLoadingWithError):
(ResourceLoadDelegate::plugInFailedWithError):
* WinLauncher/ResourceLoadDelegate.h: Added.
(ResourceLoadDelegate::ResourceLoadDelegate):
* WinLauncher/WinLauncher.cpp:
(WinLauncher::WinLauncher): Accept argument to indicate we want to capture
page loading statistics.
(WinLauncher::setFrameLoadDelegatePrivate): Get rid of stub implementation
and set private load delegate state.
(WinLauncher::setResourceLoadDelegate): Replace stub with a full implementation
that sets the view's resource load delegate.
(WinLauncher::loadURL): If no URL is passed, load the test document.
* WinLauncher/WinLauncher.h:
(WinLauncher::pageLoadTestClient):
* WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj: Updated for new source files.
* WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj.filters: Ditto.
* WinLauncher/WinLauncherWebHost.cpp:
(WinLauncherWebHost::updateAddressBar): Hook into page load statistics routine.
(WinLauncherWebHost::loadURL): Moved 'SendMessage' call to its own method so that
it could be used from other source files.
(WinLauncherWebHost::didFinishLoadForFrame): Added overload to capture statistics.
(WinLauncherWebHost::didStartProvisionalLoadForFrame): Ditto.
(WinLauncherWebHost::didFailLoadWithError): Ditto.
(WinLauncherWebHost::didHandleOnloadEventsForFrame): Ditto.
(WinLauncherWebHost::didFirstLayoutInFrame): Ditto.
(WinLauncherWebHost::didFinishDocumentLoadForFrame): Ditto.
(WinLauncherWebHost::didFirstVisuallyNonEmptyLayoutInFrame): Ditto.
(WinLauncherWebHost::didStartProvisionalLoadForFrame): Deleted.
* WinLauncher/WinLauncherWebHost.h:
* WinLauncher/WinMain.cpp:
(wWinMain): Create and use new delegates for gathering page load data.
* WinLauncher/stdafx.h: Need to add <wtf/Platform> include for various macros used in build.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Return value of createImageSourceOptions() is leaked in ImageSourceCG
https://bugs.webkit.org/show_bug.cgi?id=137677

Reviewed by Simon Fraser.

The return value of createImageSourceOptions() was leaked in
ImageSourceCG.cpp. It was returning a CFDictionaryRef created using
CFDictionaryCreate(). Therefore, the return value should have been
released but wasn't.

This patch makes createImageSourceOptions() return a
RetainPtr<CFDictionaryRef> to make sure the CFDictionaryRef properly
gets released after use.

No new tests, no behavior change.

* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::createImageSourceOptions):
(WebCore::imageSourceOptions):
(WebCore::ImageSource::isSizeAvailable):
(WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
(WebCore::ImageSource::frameSizeAtIndex):
(WebCore::ImageSource::orientationAtIndex):
(WebCore::ImageSource::getHotSpot):
(WebCore::ImageSource::repetitionCount):
(WebCore::ImageSource::createFrameAtIndex):
(WebCore::ImageSource::frameDurationAtIndex):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Refactor AirPlay monitoring code
https://bugs.webkit.org/show_bug.cgi?id=137645
<rdar://problem/18444817>

Reviewed by Jer Noble.

Refactor AirPlay route change monitoring code:
+ Have MediaSessionManager register/unregister for route changes depending on the state of
    all sessions so it does the right thing when there is more than one media element.
+ Make HTMLMediaElement unregister with MediaSession as soon as the media player is cleared
    because there can be no wireless playback without a player.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::~HTMLMediaElement): Call mediaSession->setHasPlaybackTargetAvailabilityListeners
    when there are target availability changed listeners.
(WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
(WebCore::HTMLMediaElement::wirelessRoutesAvailableDidChange): New, media session client method.
* html/HTMLMediaElement.h:

* html/HTMLMediaSession.cpp:
(WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_hasPlaybackTargetAvailabilityListeners.
(WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Remember whether or not
    the client has a target availability listener and tell the media session manager to reconfigure
    itself instead of telling it to start or stop listening for route changes so it does the
    right thing when there is more than one media element.
* html/HTMLMediaSession.h:
(WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring): Return true when the client
    has a target availability listener, false otherwise.

* platform/audio/MediaSession.cpp:
(WebCore::MediaSession::wirelessRoutesAvailableDidChange): Inform the client that routes have changed.
* platform/audio/MediaSession.h:
(WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
(WebCore::MediaSessionClient::wirelessRoutesAvailableDidChange):

* platform/audio/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Implement it.
* platform/audio/MediaSessionManager.h:
(WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
(WebCore::MediaSessionManager::hasWirelessTargetsAvailable):
(WebCore::MediaSessionManager::sessions):
(WebCore::MediaSessionManager::startMonitoringAirPlayRoutes): Deleted.
(WebCore::MediaSessionManager::stopMonitoringAirPlayRoutes): Deleted.

* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring): Start or stop monitoring
    for route changes depending on client state.
(WebCore::MediaSessionManageriOS::startMonitoringAirPlayRoutes): Deleted.
(WebCore::MediaSessionManageriOS::stopMonitoringAirPlayRoutes): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaPlayer::characteristicChanged() is not called when new tracks are found in SourceBufferPrivateAVFObjC
https://bugs.webkit.org/show_bug.cgi?id=137533

Reviewed by Andy Estes.

Follow up patch; bail out of the test early (without failing) if the platform does not support MSE.

* TestWebKitAPI/Tests/WebKit2/WKPageIsPlayingAudio.cpp:
(TestWebKitAPI::isMSEEnabledCallback):
(TestWebKitAPI::TEST):


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