Remove some dead code from FTLJITFinalizer
https://bugs.webkit.org/show_bug.cgi?id=134874

Reviewed by Geoffrey Garen.

Not sure what that code was for...but it does not do anything :)

* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::finalizeFunction):
The pointer of the label is computed but never used.

* ftl/FTLJITFinalizer.h:
* ftl/FTLLink.cpp:
(JSC::FTL::link):
The label is never set to anything.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Fix withinEpsilon()
https://bugs.webkit.org/show_bug.cgi?id=134798

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-07-14
Reviewed by Darin Adler.

Move the function back to WKWebView, it is no longer needed in WKContentView.

Use the real types as input to properly verify that the two inputs are within
a small value of the 32bit floating point.

The epsilon we use is always on 32 bits float because we want to avoid doing work for changes
that would not make any difference on float.

The source of those small changes comes from the fact UIProcess does a lot of processing
on CGFloat, which are double on 64bits architecture, while the WebProcess use 32bits floating point
for scale. When we are getting updates from the WebProcess, we should ignore any small differences
caused by the computations done with less precision.

* UIProcess/API/Cocoa/WKWebView.mm:
(withinEpsilon):
* UIProcess/ios/WKContentViewInteraction.h:
(withinEpsilon): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171078 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] On rotation, RemoteLayerTreeDrawingArea renders one extra frame at the wrong orientation
https://bugs.webkit.org/show_bug.cgi?id=134875

Reviewed by Tim Horton.

On animated resize, the size of the DrawingAreaProxy was changed before the layout parameters were
changed. This in turn caused the WebProcess's DrawingArea to flush the layer tree while still
at the wrong orientation.

This patch fixes the issue by making a special case for animated resize:
-While starting animated resize, _frameOrBoundsChanged can be called several times in response to
 the API's client changing the WKWebView. In that case, we do not update the drawing area.
-After the "updateBlock" is executed and the size have been changed, the dynamic viewport update
 is computed, the dynamicViewportSizeUpdate is sent to the WebProcess, followed by the message
 DrawingArea::updateGeometry(). Since both messages are asynchronous, they are received in that
 order, and the updateGeometry() is always done after the viewport configuration has been updated.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView setMinimumSize:]): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Some videos play as inline audio-only content
https://bugs.webkit.org/show_bug.cgi?id=134898.
<rdar://problem/17629379>

Reviewed by Eric Carlson.

Add a new 'presentationType' accessor that indicates if the media
element is playing in 'audio' mode. This can happen if a video
element plays an HLS stream that starts off in audio-only mode.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::presentationType): Added.
* html/HTMLMediaElement.h:
* platform/audio/MediaSession.cpp:
(WebCore::MediaSession::presentationType): Added.
* platform/audio/MediaSession.h:
* platform/audio/MediaSessionManager.cpp: 
(WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
Use the presentationType, rather than the mediaType to control
inline playback behavior.
* platform/audio/ios/AudioDestinationIOS.h:
(WebCore::AudioDestinationMac::presentationType): Add presentationType.
* platform/audio/mac/AudioDestinationMac.h:
(WebCore::AudioDestinationMac::presentationType): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Support sparse in auto-placement algorithm
https://bugs.webkit.org/show_bug.cgi?id=134544

Reviewed by Sergio Villar Senin.

Source/WebCore:
This patch implements sparse mode for auto-placement algorithm, which is
the default mode in the new grid-auto-flow syntax. It keeps track of the
auto-placement cursor in
RenderGrid::placeAutoMajorAxisItemsOnGrid() and updates it accordingly
when auto-positioned items are placed.
If we're in dense mode it resets the cursor after each item (which keeps
the old behavior that was using dense mode by default).

GridIterator has been adapted to look for empty areas from a given
position in both directions.

Test: fast/css-grid-layout/grid-auto-flow-sparse.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::GridIterator::GridIterator): Modify constructor to
add an optional argument for the varying index. This allows to look for
empty areas in both axis.
(WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Defined the
auto-placement cursor and rested after each item if we're in dense mode.
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid): Use auto-placement
cursor to look for empty areas from the last auto-positioned item
placed.
* rendering/RenderGrid.h: Modify placeAutoMajorAxisItemOnGrid() header
to receive the auto-placement cursor.

LayoutTests:
Test cases have been adapted accordingly, adding new cases to cover both
sparse and dense options.

* fast/css-grid-layout/grid-auto-flow-resolution-expected.txt:
* fast/css-grid-layout/grid-auto-flow-resolution.html:
* fast/css-grid-layout/grid-auto-flow-sparse-expected.txt: Added.
* fast/css-grid-layout/grid-auto-flow-sparse.html: Added.
* fast/css-grid-layout/grid-container-change-named-grid-lines-recompute-child.html:
* fast/css-grid-layout/grid-item-auto-placement-automatic-span-expected.txt:
* fast/css-grid-layout/grid-item-auto-placement-automatic-span.html:
* fast/css-grid-layout/grid-item-auto-placement-definite-span-expected.txt:
* fast/css-grid-layout/grid-item-auto-placement-definite-span.html:
* fast/css-grid-layout/grid-item-removal-auto-placement-update.html:
* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html:
* fast/css-grid-layout/resources/grid.css:
(.autoRowAutoColumnSpanning2):
(.autoRowSpanning2AutoColumn):
(.autoRowSpanning2AutoColumnSpanning3):
(.autoRowSpanning3AutoColumnSpanning2):
(.gridAutoFlowColumnDense):
(.gridAutoFlowRowDense):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the !ENABLE(FILTERS) && !ENABLE(CSS_FILTERS) build after r167497
https://bugs.webkit.org/show_bug.cgi?id=134679

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-07-14
Reviewed by Darin Adler.

* html/ImageData.cpp:
* platform/graphics/cairo/ImageBufferCairo.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[UNIX] Log error description when failing to create shared memory file.
https://bugs.webkit.org/show_bug.cgi?id=134892

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-07-14
Reviewed by Darin Adler.

* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::create): Print the string describing the error number (errno).

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

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
* UIProcess/API/ios/WKViewIOS.mm:
(-[WKView _frameOrBoundsChanged]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERT(isMainThread()) under OneShotDisplayLinkHandler
https://bugs.webkit.org/show_bug.cgi?id=134900

Reviewed by Simon Fraser.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(-[OneShotDisplayLinkHandler displayLinkFired:]):
isMainThread means the Web thread sometimes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
check-webkit-style should apply C++ rules to Objective-C++ files
https://bugs.webkit.org/show_bug.cgi?id=134884

Reviewed by Joseph Pecoraro.

Fixes an issue where check-webkit-style doesn't apply applicable C++ rules to
Objective-C++ files.

Currently check-webkit-style doesn't apply the following rules to Objective-C++
files: build/using_std, runtime/max_min_macros, runtime/wtf_move, readability/null.
Instead, we should teach check-webkit-style to apply these rules because, as
its name implies, an Objective-C++ file may contain C++ code.

* Scripts/webkitpy/style/checkers/cpp.py:
(_FileState.__init__): Add instance variable _is_objective_cpp to track whether a file has
extension mm (i.e. an Objective-C++ file).
(_FileState.is_objective_c_or_objective_cpp): Added; returns true if the file
has extension m or mm or if the file has extension h and contains Objective-C directives.
(check_for_null): No change in behavior; don't apply rule to Objective-C++ file.
(check_identifier_name_in_declaration): Substitute _FileState.is_objective_c_or_objective_cpp() for
_FileState.is_c_or_objective_c()
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_null_false_zero): Added test case for Objective-C++ file.
(WebKitStyleTest.test_max_macro): Add test case for Objective-C and Objective-C++ file.
(WebKitStyleTest.test_min_macro): Ditto.
(WebKitStyleTest.test_wtf_move): Add test case for Objective-C++ file.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebVideoFullscreenInterfaceAVKit should only call the UI from main thread.
https://bugs.webkit.org/show_bug.cgi?id=134890

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

dispatch_async to the main thread before setting properties that would affect the UI.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): wrap in call to dispatch_async
(WebVideoFullscreenInterfaceAVKit::setDuration): ditto
(WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto
(WebVideoFullscreenInterfaceAVKit::setRate): ditto
(WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto
(WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto
(WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto
(WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto
(WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto

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