[iOS] a Paused media session is not active
https://bugs.webkit.org/show_bug.cgi?id=135108

Reviewed by Darin Adler.

Activating the shared AudioSession will pause audio playing in another application,
so only report a Playing media sessions as active.

* platform/audio/MediaSessionManager.cpp:
* platform/audio/MediaSessionManager.h:
(WebCore::MediaSessionManager::activeAudioSessionRequired): Renamed from hasActive to make
clear what it does. Only return true for a session that is Playing.

* platform/audio/mac/MediaSessionManagerMac.cpp:
(MediaSessionManager::updateSessionState): hasActive renamed to activeAudioSessionRequired.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL gardening

Remove passing tests from TestExpectations file.

* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed hidpi test gardening.

Use Ahem font to ensure font size predictability.

* fast/inline/hidpi-selection-gap-and-inline-selection-have-gap-rtl-expected.html:
* fast/inline/hidpi-selection-gap-and-inline-selection-have-gap-rtl.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r150169): http/tests/cache/willsendrequest-returns-null-for-memory-cache-load.html fails
https://bugs.webkit.org/show_bug.cgi?id=116259

Updating expectations to acknowledge that the test is flaky on WK1 too (it depends
on preceding tests).

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171302 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DatabaseProcess doesn't relaunch after crashing.
<rdar://problem/17717343> and https://bugs.webkit.org/show_bug.cgi?id=135117

Reviewed by Alexey Proskuryakov.

* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::didClose): Tell the WebContext.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::databaseProcessCrashed): Notify supplements, then clear the DatabaseProcessProxy pointer.
* UIProcess/WebContext.h:

* UIProcess/WebContextSupplement.h:
(WebKit::WebContextSupplement::processDidClose): Added. No users right now, but the patch in bug 135035 will need this.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed hidpi test gardening.

* fast/inline/hidpi-selection-gap-on-subpixel-position-expected.html:
* fast/inline/hidpi-selection-gap-on-subpixel-position.html: Speculative fix.
* fast/inline/hidpi-selection-gap-overlaps-inline-selection-expected.html:
* fast/inline/hidpi-selection-gap-overlaps-inline-selection.html: Use Ahem.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171304 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Correct auto-version.pl script for two-digit version numbers
https://bugs.webkit.org/show_bug.cgi?id=135119
<rdar://problem/17743959>

Reviewed by David Kilzer.

The $MAJOR_VERSION must be the first digit of $BUILD_MAJOR_VERSION,
and $MINOR_VERSION must be the remaining digits.

Also correct regexp (line 90) that was allowing version numbers
larger than three digits to be processed.

* win/tools/scripts/auto-version.pl: Correct regular expression.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WK1] Single touch div scrolling doesn't work in framesets (breaks Word previews)
https://bugs.webkit.org/show_bug.cgi?id=135103
<rdar://problem/11830219>

Reviewed by Darin Adler.

After r166117 all layer flushing starts on the root frame; we no longer flush layers
for each frame during painting. However, flushing GraphicsLayers can set some state
on a subframe RenderLayerCompositor that is now never processed, which breaks scroll
layer registration.

Fix by doing a walk of the Frame tree, and calling didFlushLayers() on subframe RenderLayerCompositors
before calling didFlushLayers() on self.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::didFlushLayers):
(WebCore::RenderLayerCompositor::notifySubframesAfterLayerFlush):
(WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers): Drive-by nullptr.
* rendering/RenderLayerCompositor.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171306 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add helper functions to dump the scrolling state tree from the debugger
https://bugs.webkit.org/show_bug.cgi?id=135101

Reviewed by Darin Adler.

Add debug-only showScrollingStateTree() functions that take a ScrollingStateTree* and ScrollingStateNode*
for use while debugging.

* page/scrolling/ScrollingStateTree.cpp:
(showScrollingStateTree):
* page/scrolling/ScrollingStateTree.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Put position:fixed elements into layers when a WK1 view is layer-backed
https://bugs.webkit.org/show_bug.cgi?id=135075

Reviewed by Darin Adler.


Source/WebCore: 
This patch adds a new ChromeClient function called 
requiresAcceleratedCompositingForViewportConstrainedPosition(). Since a view can 
go in and out of layer backing, we need a ChromeClient method that can be 
dynamically re-evaluated rather than using the existing settings for enabling 
accelerated fixed and fixed that creates a stacking context.

Ensure that fixed elements create a stacking context when 
requiresAcceleratedCompositingForViewportConstrainedPosition is true.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):

New ChromeClient function.
* page/ChromeClient.h:

Source/WebKit/mac: 
Returns true when the WebHTMLView has a layer.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::requiresAcceleratedCompositingForViewportConstrainedPosition):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed hidpi test gardening.

Use Ahem font to ensure font size predictability.

* fast/forms/hidpi-fieldset-on-subpixel-position-when-legend-is-present-expected.html:
* fast/forms/hidpi-fieldset-on-subpixel-position-when-legend-is-present.html:

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

* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::requiresAcceleratedCompositingForViewportConstrainedPosition):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Case sensitive file system build fix.

* page/scrolling/ScrollingStateTree.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Back/Forward arrows (modern) are too large.
https://bugs.webkit.org/show_bug.cgi?id=135073

Reviewed by Joseph Pecoraro.

Changes to adjust new forward and back arrow sizes to be more consistent with the
universal design language. Moved WebInspector.Platform definition to its own file.
Refactored handling of image versions inside ImageUtilities.js.

* UserInterface/Base/ImageUtilities.js:
(.restoreImage):
(.generateImage):
(generateColoredImagesForCSS):
Make the default image versioning smarter.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
(WebInspector.contentLoaded.WebInspector.Platform.version.toString): Deleted.
(WebInspector.contentLoaded.WebInspector.Platform.toString): Deleted.
* UserInterface/Base/Platform.js: Added.
Move platform information definition into Platform.js.

* UserInterface/Main.html: Include Platform.js.

* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser):
* UserInterface/Views/FindBanner.css:
(.find-banner > button > .glyph):
(body.mac-platform.legacy .find-banner > button > .glyph):
(.find-banner > button.segmented.left > .glyph):
(body.mac-platform.legacy .find-banner > button.segmented.left > .glyph):
(.find-banner > button.segmented.right > .glyph):
(body.mac-platform.legacy .find-banner > button.segmented.right > .glyph):
(.find-banner > button.segmented):
(body.mac-platform.legacy .find-banner > button.segmented):
* UserInterface/Views/FindBanner.js:
(WebInspector.FindBanner.prototype._generateButtonsGlyphsIfNeeded):
Size of forward and back arrows adjusted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
fast/canvas/canvas-putImageData-zero-alpha.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=131787

* platform/mac/TestExpectations: Mark it as such.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171313 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Handle QuickLook ResourceLoaders in the web process
https://bugs.webkit.org/show_bug.cgi?id=135113

Reviewed by David Kilzer.

Source/WebCore:
No new tests. QuickLook is not testable from WebKit.

* WebCore.exp.in:
* loader/ResourceLoadScheduler.cpp:
(WebCore::ResourceLoadScheduler::maybeLoadQuickLookResource): Start loading the ResourceLoader if it is for a QuickLook resource.
* loader/ResourceLoadScheduler.h:

Source/WebKit2:
The QuickLook framework registers a NSURLProtocol to handle loading subresources of the HTML documents it
generates. In order for these loads to succeed, we need to start them in the same process in which QuickLook
generated the main resource.

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow MiniBrowser WK1 to do element fullscreen
https://bugs.webkit.org/show_bug.cgi?id=135125

Reviewed by Simon Fraser.

Allow WK1 windows to go fullscreen using the DOM API.

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController awakeFromNib]): Enable the preference for
fullscreen.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] YouTube video decode error when variant-switching
https://bugs.webkit.org/show_bug.cgi?id=135128

Reviewed by Brent Fulgham.

Source/WebCore:
Test: media/media-source/media-source-overlapping-decodetime.html

When variant-switching, the situation can arise where an existing sample with a presentation
timestamp of N and a decode timestamp of M, and a new sample with a presentation timestamp > N
and the same decode timestamp of M, will keep the new sample from being added to the SampleMap.
This can result in a decode error when samples depending on that new, missing sample are enqueued.

The MSE spec is silent on the issue of overlapping decode timestamps. However, it guarantees that
presentation timestamps are non-overlapping. So instead of using just the decode timestamp as a key
for storing the samples in decode order, use both the decode timestamp and the presentation timestamp.
That ensures that samples with different presentation times but equal decode times are both inserted
into the decode queue, and in the correct order.

* Modules/mediasource/SampleMap.cpp:
(WebCore::SampleIsRandomAccess::operator()): Update the parameter type to match the new KeyType.
(WebCore::SampleMap::addSample): Pass both decodeTime and presentationTime as the key to decodeOrder.
(WebCore::SampleMap::removeSample): Ditto.
(WebCore::DecodeOrderSampleMap::findSampleWithDecodeKey): Renamed from findSampleWithDecodeTime.
(WebCore::DecodeOrderSampleMap::reverseFindSampleWithDecodeKey): renamed from reverseFindSampleWithDecodeTime.
(WebCore::DecodeOrderSampleMap::findSyncSamplePriorToPresentationTime): Use renamed version of above.
(WebCore::DecodeOrderSampleMap::findSyncSampleAfterPresentationTime): Ditto.
(WebCore::DecodeOrderSampleMap::findDependentSamples): Ditto.
(WebCore::DecodeOrderSampleMap::findSampleWithDecodeTime): Deleted.
(WebCore::DecodeOrderSampleMap::reverseFindSampleWithDecodeTime): Deleted.
* Modules/mediasource/SampleMap.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::removeCodedFrames): Ditto.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
(WebCore::SourceBuffer::reenqueueMediaForTime): Ditto.

LayoutTests:
* media/media-source/media-source-overlapping-decodetime-expected.txt: Added.
* media/media-source/media-source-overlapping-decodetime.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171316 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Random crashes on the Web Thread due to Timers firing on the wrong thread in the UI process
https://bugs.webkit.org/show_bug.cgi?id=135132
<rdar://problem/17719832>

Reviewed by Simon Fraser.

* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::ProcessThrottler):
(WebKit::ProcessThrottler::suspendTimerFired):
* UIProcess/ProcessThrottler.h:
* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
We can't use WebCore timers in the UI process because of coexistence concerns
(they fire on the Web Thread if there is one!), so use RunLoop::Timer instead.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: fast/layers/no-clipping-overflow-hidden-added-after-transform.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=135133

* platform/mac/TestExpectations: Marked it as such.



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