WebKit-https.git
6 years agoREGRESSION(r171045) [GTK] Build broken.
jfernandez@igalia.com [Sun, 13 Jul 2014 11:28:58 +0000 (11:28 +0000)]
REGRESSION(r171045) [GTK] Build broken.
https://bugs.webkit.org/show_bug.cgi?id=134867

Unreviewed GTK build fix after r171045.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::willRecordNavigationSnapshot):
* UIProcess/API/gtk/PageClientImpl.h:

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

6 years agoUnreviewed, EFL build fix since r171045.
gyuyoung.kim@samsung.com [Sun, 13 Jul 2014 10:35:36 +0000 (10:35 +0000)]
Unreviewed, EFL build fix since r171045.

* UIProcess/CoordinatedGraphics/WebView.h:

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

6 years agoElements with rendering disabled due to dimensions should not contribute to parent...
commit-queue@webkit.org [Sun, 13 Jul 2014 06:35:21 +0000 (06:35 +0000)]
Elements with rendering disabled due to dimensions should not contribute to parent bounding box
https://bugs.webkit.org/show_bug.cgi?id=134184

Patch by Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> on 2014-07-12
Reviewed by Dirk Schulze.

Source/WebCore:
SVG elements that have rendering disabled should not contribute to any ancestor elements bounding box.
Examples of elements with rendering disabled:
- basic shape with width <= 0 or height <= 0
- path with no path data (d attribute missing or empty)
- polyline or polygon element with no point data (points attribute missing or empty)

To achieve this a method (isRenderingDisabled) was added to RenderSVGShape and it's derived classes.
This is used to determine if an element is included when creating the union of child bounding boxes
in a container element.

Tests: svg/custom/GetBBox-path-nodata.html
       svg/custom/GetBBox-polygon-nodata.html
       svg/custom/GetBBox-polyline-nodata.html
       svg/custom/getBBox-container-hiddenchild.html

* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::isRenderingDisabled):
New method added. Checks bounding box to determine if rendering is disabled.
* rendering/svg/RenderSVGEllipse.h:
* rendering/svg/RenderSVGPath.cpp:
(WebCore::RenderSVGPath::isRenderingDisabled):
New method added. Checks bounding box to determine if rendering is disabled.
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::isRenderingDisabled):
New method added. Checks bounding box to determine if rendering is disabled.
* rendering/svg/RenderSVGRect.h:
* rendering/svg/RenderSVGShape.h:
(WebCore::RenderSVGShape::isRenderingDisabled):
New method added. Always returns false so that derived classes that do not
implement this method retain the existing behaviour.
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
For each element potentially being included in the unioned bounding box of
a container, check isRenderingDisabled and skip that element if true.

* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::isRenderingDisabled):
* rendering/svg/RenderSVGEllipse.h:
* rendering/svg/RenderSVGPath.cpp:
(WebCore::RenderSVGPath::isRenderingDisabled):
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::isRenderingDisabled):
* rendering/svg/RenderSVGRect.h:
* rendering/svg/RenderSVGShape.h:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::computeContainerBoundingBoxes):

LayoutTests:
Test, for each element type, that when rendering is disabled, that element does not contribute
to the bounding box for an ancestor element.

Added test to ensure zero width/height polyline and polygon do contribute to ancestor bounding box.

Updated expected results for 1 existing test (shapes-rect-02-t) as this test included zero
width and zero height rects and these were previously included in the repaint rect.

* platform/mac/svg/W3C-SVG-1.1/shapes-rect-02-t-expected.txt:
* svg/custom/GetBBox-path-nodata-expected.txt: Added.
* svg/custom/GetBBox-path-nodata.html: Added.
* svg/custom/GetBBox-polygon-nodata-expected.txt: Added.
* svg/custom/GetBBox-polygon-nodata.html: Added.
* svg/custom/GetBBox-polyline-nodata-expected.txt: Added.
* svg/custom/GetBBox-polyline-nodata.html: Added.
* svg/custom/getBBox-container-hiddenchild-expected.txt: Added.
* svg/custom/getBBox-container-hiddenchild.html: Added.
* svg/custom/getBBox-perpendicular-polygon-expected.txt: Added.
* svg/custom/getBBox-perpendicular-polygon.svg: Added.
* svg/custom/getBBox-perpendicular-polyline-expected.txt: Added.
* svg/custom/getBBox-perpendicular-polyline.svg: Added.

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

6 years ago[Cocoa] Notify the client when a navigation snapshot is taken
mitz@apple.com [Sun, 13 Jul 2014 05:51:20 +0000 (05:51 +0000)]
[Cocoa] Notify the client when a navigation snapshot is taken
https://bugs.webkit.org/show_bug.cgi?id=134865

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.

* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate): Initialize new flag in
m_navigationDelegateMethods.
(WebKit::NavigationState::willRecordNavigationSnapshot): Added. Calls the new
WKNavigationDelegate method.

* UIProcess/PageClient.h: Declared new client function.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willRecordNavigationSnapshot): Added. Calls the new client function.
* UIProcess/WebPageProxy.h:

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::willRecordNavigationSnapshot): Override that calls
NavigationState::willRecordNavigationSnapshot.

* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.

* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::recordSnapshot): Added a call to
WebPageProxy::willRecordNavigationSnapshot.

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

6 years agoStyle checker complains about namespace indentation when there is no namespace
commit-queue@webkit.org [Sun, 13 Jul 2014 02:37:58 +0000 (02:37 +0000)]
Style checker complains about namespace indentation when there is no namespace
https://bugs.webkit.org/show_bug.cgi?id=105427

Patch by Peter Szanka <h868064@stud.u-szeged.hu> on 2014-07-12
Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_namespace_indentation):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_indentation):

The indentation level depends on the parantheses too, to avoid false warning in case of several statements inside macros.

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

6 years agoRename selectorListContainsUncommonAttributeSelector() to selectorListContainsAttribu...
benjamin@webkit.org [Sun, 13 Jul 2014 02:24:37 +0000 (02:24 +0000)]
Rename selectorListContainsUncommonAttributeSelector() to selectorListContainsAttributeSelector()
https://bugs.webkit.org/show_bug.cgi?id=134862

Reviewed by Sam Weinig.

Unlike containsUncommonAttributeSelector(), selectorListContainsUncommonAttributeSelector() does not
evaluate the attribute for "uncommon" types.

It would be possible to change the function instead to evaluate common attributes based
on the match type and the pseudo class type. Such change would be more risky
and we would get very little benefit from it, I leave that for later if that ever becomes useful.

* css/RuleSet.cpp:
(WebCore::selectorListContainsAttributeSelector):
(WebCore::containsUncommonAttributeSelector):
(WebCore::selectorListContainsUncommonAttributeSelector): Deleted.

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

6 years agoUnreviewed, fix EFL build break since r171034.
gyuyoung.kim@samsung.com [Sun, 13 Jul 2014 01:44:23 +0000 (01:44 +0000)]
Unreviewed, fix EFL build break since r171034.

* UIProcess/CoordinatedGraphics/WebView.h:
* UIProcess/efl/WebContextEfl.cpp:
(WebKit::WebContext::platformMediaCacheDirectory):

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

6 years agoTry to fix 32-bit Mac build.
darin@apple.com [Sun, 13 Jul 2014 01:27:40 +0000 (01:27 +0000)]
Try to fix 32-bit Mac build.

* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::navigationGestureDidBegin): Added WK_API_ENABLED conditional.
(WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
(WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.

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

6 years agoREGRESSION(r171034) [GTK] Build broken.
jfernandez@igalia.com [Sun, 13 Jul 2014 01:09:49 +0000 (01:09 +0000)]
REGRESSION(r171034) [GTK] Build broken.
https://bugs.webkit.org/show_bug.cgi?id=134861

Unreviewed GTK build fix.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::navigationGestureDidBegin):
(WebKit::PageClientImpl::navigationGestureWillEnd):
(WebKit::PageClientImpl::navigationGestureDidEnd):
* UIProcess/API/gtk/PageClientImpl.h:

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

6 years agoRemove excessive nesting from _EnumState.process_clean_line at cpp style checker
commit-queue@webkit.org [Sun, 13 Jul 2014 00:54:13 +0000 (00:54 +0000)]
Remove excessive nesting from _EnumState.process_clean_line at cpp style checker
https://bugs.webkit.org/show_bug.cgi?id=125317

Patch by Daker Fernandes Pinheiro <daker.pinheiro@openbossa.org> on 2014-07-12
Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(_EnumState.process_clean_line):

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

6 years agoStyle Checker should prevent enums in bitfields
brian.holt@samsung.com [Sun, 13 Jul 2014 00:31:14 +0000 (00:31 +0000)]
Style Checker should prevent enums in bitfields
https://bugs.webkit.org/show_bug.cgi?id=57352

Reviewed by Darin Adler.

Added check that enums are not used as types for bitfields
and a unit test.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_language):
(CppChecker):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest):
(CppStyleTest.test_enum_bitfields):
(CppStyleTest.test_plain_integral_bitfields):

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

6 years agoUse braced-init-list to create one-item Vector object in insertPerformanceEntry
commit-queue@webkit.org [Sun, 13 Jul 2014 00:19:41 +0000 (00:19 +0000)]
Use braced-init-list to create one-item Vector object in insertPerformanceEntry
https://bugs.webkit.org/show_bug.cgi?id=133675

Patch by Zan Dobersek <zdobersek@igalia.com> on 2014-07-12
Reviewed by Darin Adler.

* page/PerformanceUserTiming.cpp:
(WebCore::insertPerformanceEntry): Avoid wasting three lines for creating a
Vector object with just one item that in the end gets copied. Use the
braced-init-list syntax instead, leveraging Vector's std::initializer_list
constructor.

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

6 years agoMemory leaks with autoLoadImages off
allan.jensen@digia.com [Sun, 13 Jul 2014 00:10:23 +0000 (00:10 +0000)]
Memory leaks with autoLoadImages off
https://bugs.webkit.org/show_bug.cgi?id=124411

Reviewed by Darin Adler.

Do not emit notifyFinished for images with deferred load,
and allow deferred loads to be cancelled.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::checkNotify):
(WebCore::CachedResource::cancelLoad):

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

6 years agoREGRESSION(r171024) [GTK] Build broken.
jfernandez@igalia.com [Sat, 12 Jul 2014 23:39:47 +0000 (23:39 +0000)]
REGRESSION(r171024) [GTK] Build broken.
https://bugs.webkit.org/show_bug.cgi?id=134859

Unreviewed GTK build fix.

* UIProcess/gtk/WebContextGtk.cpp:
(WebKit::WebContext::platformMediaCacheDirectory):

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

6 years ago<rdar://problem/16020380> [Cocoa] Inform the client when back-forward navigation...
mitz@apple.com [Sat, 12 Jul 2014 23:32:39 +0000 (23:32 +0000)]
<rdar://problem/16020380> [Cocoa] Inform the client when back-forward navigation gestures begin and end
https://bugs.webkit.org/show_bug.cgi?id=134853

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new WKNavigationDelegate
methods.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isShowingNavigationGestureSnapshot]): Added this getter.

* UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property
_isShowingNavigationGestureSnapshot.

* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate): Initialize new flags in
m_navigationDelegateMethods.
(WebKit::NavigationState::navigationGestureDidBegin): Added. Calls the new
WKNavigationDelegate method.
(WebKit::NavigationState::navigationGestureWillEnd): Ditto.
(WebKit::NavigationState::navigationGestureDidEnd): Ditto.

* UIProcess/PageClient.h: Declared new client functions.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Initialize new member variable.
(WebKit::WebPageProxy::navigationGestureDidBegin): Set m_isShowingNavigationGestureSnapshot
and call the new client function.
(WebKit::WebPageProxy::navigationGestureWillEnd): Call the new client function.
(WebKit::WebPageProxy::navigationGestureDidEnd): Ditto.
(WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved): Clear
m_isShowingNavigationGestureSnapshot.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isShowingNavigationGestureSnapshot): Added this getter.

* UIProcess/ios/PageClientImplIOS.h: Declared overrides of new client functions.
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
NavigationState function.
(WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
(WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture): Added calls to
WebPageProxy::navigationGestureDidBegin and WebPageProxy::navigationGestureWillEnd.
(WebKit::ViewGestureController::endSwipeGesture): Added calls to
WebPageProxy::navigationGestureDidEnd.
(WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
WebPageProxy::navigationGestureSnapshotWasRemoved.

* UIProcess/mac/PageClientImpl.h: Declared overrides of new client functions.
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
NavigationState function.
(WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
(WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::beginSwipeGesture): Added call to
WebPageProxy::navigationGestureDidBegin.
(WebKit::ViewGestureController::endSwipeGesture): Added calls to
WebPageProxy::navigationGestureDidEnd.
(WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
WebPageProxy::navigationGestureSnapshotWasRemoved.

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

6 years ago[MSE] http/tests/media/media-source/mediasource-duration.html is failing.
jer.noble@apple.com [Sat, 12 Jul 2014 22:39:43 +0000 (22:39 +0000)]
[MSE] http/tests/media/media-source/mediasource-duration.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=134852

Reviewed by Eric Carlson.

Source/WebCore:
Fixes the following tests:
http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate.html
http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate.html
http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html
http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html
http/tests/media/media-source/mediasource-duration.html
http/tests/media/media-source/mediasource-play.html

The primary change necessary to fix the mediasource-duration.html test was to add support
for delaying the completion of a seek operation until the HTMLMediaElement's readyState
rises to > HAVE_CURRENT_DATA. This is accomplished by modifying MediaSourcePrivate to have
waitForSeekCompleted() and seekCompleted() virtual methods. These are called by MediaSource
when a seek operation results in the current time moving outside the currently buffered time
ranges, and when an append operation results in the readyState changing, respectively.

A number of other drive-by fixes were necessary to get this test fully passing, as noted
below.

Make the MediaSource the primary owner of the media's duration, rather than the MediaSourcePrivate.
Move the MediaSourcePrivateClient pointer to the MediaSourcePrivate from the MediaPlayerPrivate, so
the MediaSource's duration can be retrieved.  While we're at it, do the same thing for buffered.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::MediaSource): Initialize m_duration.
(WebCore::MediaSource::duration): Simple accessor.
(WebCore::MediaSource::setDurationInternal): Bring 'duration change algorithm' up to spec.
(WebCore::MediaSource::setReadyState): Reset m_duration on close.
* Modules/mediasource/MediaSource.h:
* platform/graphics/MediaSourcePrivate.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Do not call setPrivateAndOpen().
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationDouble): Pass through to MediaSourcePrivateAVFObjC.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::buffered): Ditto.
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::create): Call setPrivateAndOpen().
(WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC): Set m_client.
(WebCore::MediaSourcePrivateAVFObjC::duration): Pass through to MediaSourcePrivateClient.
(WebCore::MediaSourcePrivateAVFObjC::buffered): Ditto.
(WebCore::MediaSourcePrivateAVFObjC::durationChanged): Pass through to MediaPlayerPrivateMediaSourceAVFObjC.
(WebCore::MediaSourcePrivateAVFObjC::setDuration): Deleted.
* platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
(WebCore::MediaSourceGStreamer::open): Pass in MediaSourcePrivateClient.
(WebCore::MediaSourceGStreamer::MediaSourceGStreamer): Initialize m_mediaSource.
(WebCore::MediaSourceGStreamer::durationChanged): Retrieve the duration from MediaSourcePrivateClient.
(WebCore::MediaSourceGStreamer::markEndOfStream): Remove unnecssary ASSERT.
(WebCore::MediaSourceGStreamer::unmarkEndOfStream): Ditto.
(WebCore::MediaSourceGStreamer::setDuration): Deleted.
* platform/graphics/gstreamer/MediaSourceGStreamer.h:
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::load): Do not call setPrivateAndOpen().
(WebCore::MockMediaPlayerMediaSource::buffered): Pass through to MockMediaSourcePrivate.
(WebCore::MockMediaPlayerMediaSource::durationDouble): Ditto.
(WebCore::MockMediaPlayerMediaSource::advanceCurrentTime): Ditto.
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::create): Call setPrivateAndOpen().
(WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Set m_client.
(WebCore::MockMediaSourcePrivate::duration): Pass through to MediaSourcePrivateClient.
(WebCore::MockMediaSourcePrivate::buffered): Ditto.
(WebCore::MockMediaSourcePrivate::durationChanged): Pass thorugh to MockMediaPlayerMediaSource.
(WebCore::MockMediaSourcePrivate::setDuration): Deleted.

Route seekToTime through MediaSource, rather than through MediaSourcePrivate, so that
the time can be compared against the buffered ranges, and trigger the delay of the seek
operation if necessary. Add a seekTimer to MediaPlayerPrivateMediaSourceAVFObjC, as this
guarantees the order of asynchronous operations, rather than callOnMainThread, which can
cause async operations to occur out of order.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::seekToTime): Bring up to spec.
(WebCore::MediaSource::completeSeek): Ditto.
(WebCore::MediaSource::monitorSourceBuffers): Call completeSeek() when appropriate.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateSeekToTime): Deleted.
(WebCore::SourceBuffer::seekToTime): Renamed from sourceBufferPrivateSeekToTime().
* platform/graphics/MediaSourcePrivate.h:
* platform/graphics/MediaSourcePrivateClient.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Add seekTimer. Only
    call timeChanged() if no longer seeking, thereby triggering a 'seeked' event.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC): Clear m_seekTimer.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): Use m_seekTimer.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekTimerFired): Call seekInternal.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): Add logging.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted): Added.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted): Added; trigger 'seeked'.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState): No longer attempt to finish seek when
    readyState changes here; this has been moved up to MediaSource.cpp.
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::waitForSeekCompleted): Pass through to MediaPlayerPrivateMediaSourceAVFObjC.
(WebCore::MediaSourcePrivateAVFObjC::seekCompleted): Ditto.
(WebCore::MediaSourcePrivateAVFObjC::seekToTime): Pass through to MediaSourcePrivateClient.
(WebCore::MediaSourcePrivateAVFObjC::fastSeekTimeForMediaTime): Ditto.
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource): Initialize m_seekCompleted.
(WebCore::MockMediaPlayerMediaSource::seeking): Check for an uncompleted seek operation.
(WebCore::MockMediaPlayerMediaSource::seekWithTolerance): Ditto.
(WebCore::MockMediaPlayerMediaSource::waitForSeekCompleted): Added.
(WebCore::MockMediaPlayerMediaSource::seekCompleted): Added; trigger 'seeked'.
* platform/mock/mediasource/MockMediaPlayerMediaSource.h:
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Pass through to MockMediaPlayerMediaSource.
(WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
* platform/mock/mediasource/MockMediaSourcePrivate.h:

Drive-by fixes.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::streamEndedWithError): Re-order the steps in streamEndedWithError()
    to avoid the MediaSource being closed and re-opened by the resulting duration change
    operation.
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::remove): Added logging.
(WebCore::SourceBuffer::removeCodedFrames): Ditto.
(WebCore::SourceBuffer::hasFutureTime): Swap an ASSERT for an early-return; it's possible
    for currentTime() to be outside of a buffered area.
* Modules/mediasource/SourceBuffer.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute): Do not issue an additional 'timeupdate' event
    after finishSeek() issues one of its own.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::globalDataParserQueue): Allow parsing operations to happen concurrently on
    background queues.

LayoutTests:
Eliminate flakiness in the mediasource-duration.html test by not playing
the media while testing seeking and duration.
* http/tests/media/media-source/mediasource-duration.html:

Update testharness.js to the latest W3C version:
* http/tests/w3c/resources/testharness.js:

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

6 years ago[iOS] update control type when playback state changes
eric.carlson@apple.com [Sat, 12 Jul 2014 22:14:44 +0000 (22:14 +0000)]
[iOS] update control type when playback state changes
https://bugs.webkit.org/show_bug.cgi?id=134856

Reviewed by Dean Jackson.

Check to make sure the correct type of media controls are showing when playback state
changes so we don't end up with the wrong type of controls during playback.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.HandledVideoEvents): Drive-by fix, call handlePlay on 'playing' instead
    of 'play' so controls don't hide too early.
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.setPlaying): New, call updateControls to make sure inline
    controls are shown when appropriate.

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

6 years agoFix typo in prior patch
oliver@apple.com [Sat, 12 Jul 2014 21:49:41 +0000 (21:49 +0000)]
Fix typo in prior patch
https://bugs.webkit.org/show_bug.cgi?id=134858

Reviewed by Sam Weinig.

Fix typo

* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformDefaultCookieStorageDirectory):

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

6 years ago[iOS Media] Start playback button should indicate when it can't play
dino@apple.com [Sat, 12 Jul 2014 21:36:42 +0000 (21:36 +0000)]
[iOS Media] Start playback button should indicate when it can't play
https://bugs.webkit.org/show_bug.cgi?id=134851

Post-commit review with Eric Carlson on IRC.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.updateStatusDisplay): Remove the line that sets the
class on the inline play button.

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

6 years ago[iOS Media] Start playback button should indicate when it can't play
dino@apple.com [Sat, 12 Jul 2014 21:17:50 +0000 (21:17 +0000)]
[iOS Media] Start playback button should indicate when it can't play
https://bugs.webkit.org/show_bug.cgi?id=134851

Reviewed by Sam Weinig.

If a video element has errors and cannot play, then the start
playback button should use the "broken" icon.

* Modules/mediacontrols/mediaControlsApple.js: Add a new "failed" class.
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.shouldHaveStartPlaybackButton): We need a playback button
even when there is an error.
(ControllerIOS.prototype.handleWirelessPickerButtonTouchStart): Don't offer Airplay
if we're in an error state.
(ControllerIOS.prototype.updateStatusDisplay): Set the "failed" class on
the playback buttons if we are in an error state.

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

6 years ago[Cocoa] Client is not notified of same-document navigations
mitz@apple.com [Sat, 12 Jul 2014 20:40:17 +0000 (20:40 +0000)]
[Cocoa] Client is not notified of same-document navigations
https://bugs.webkit.org/show_bug.cgi?id=134855

Reviewed by Sam Weinig.

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::didSameDocumentNavigationForFrame): Added navigationID parameter.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient): Ditto.

* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Added new enum and delegate method.

* UIProcess/Cocoa/NavigationState.h: Declare override of
API::LoaderClient::didSameDocumentNavigationForFrame. Added flag in
m_navigationDelegateMethods struct.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate): Initialize new m_navigationDelegateMethods
flag.
(WebKit::toWKSameDocumentNavigationType): Added this helper to convert from internal to API
values.
(WebKit::NavigationState::LoaderClient::didSameDocumentNavigationForFrame): Override to call
the delegate method, if implemented.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Added navigationID parameter,
which is forwarded to the client.
* UIProcess/WebPageProxy.h: Added navigationID parameter.
* UIProcess/WebPageProxy.messages.in: Ditto.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): Send the navigation ID.
(WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): Ditto.
(WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): Ditto.
(WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): Ditto.

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

6 years agoExtend WebContent sandbox to allow some extra access for frameworks
oliver@apple.com [Sat, 12 Jul 2014 18:33:43 +0000 (18:33 +0000)]
Extend WebContent sandbox to allow some extra access for frameworks
https://bugs.webkit.org/show_bug.cgi?id=134844

Reviewed by Sam Weinig.

Open up the webcontent sandbox a bit so that some external frameworks
can work correctly.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createNewWebProcess):
(WebKit::WebContext::mediaCacheDirectory):
* UIProcess/WebContext.h:
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformMediaCacheDirectory):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

6 years agoTemporary work around for <rdar://<rdar://problem/17513375>
oliver@apple.com [Sat, 12 Jul 2014 18:32:13 +0000 (18:32 +0000)]
Temporary work around for <rdar://<rdar://problem/17513375>
https://bugs.webkit.org/show_bug.cgi?id=134848

Reviewed by Sam Weinig.

Temporarily work around <rdar://<rdar://problem/17513375> by
dropping the explicit cookie storage if it points out of the
container.

* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformDefaultCookieStorageDirectory):

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

6 years agoPartition the CSS rules based on the most specific filter of the rightmost fragment
benjamin@webkit.org [Sat, 12 Jul 2014 05:08:33 +0000 (05:08 +0000)]
Partition the CSS rules based on the most specific filter of the rightmost fragment
https://bugs.webkit.org/show_bug.cgi?id=134828

Reviewed by Andreas Kling.

Previously, RuleSet was partitioning each rule based on the rightmost filter.
While fast, this had the side effect of putting many selectors with ID match in the class
bucket (because the selectors are generally written starting with the ID).

This patch replace the code of findBestRuleSetAndAdd() by a simple loop going over all
the simple selectors in the rightmost fragment to find the best bucket.

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::ruleMatches):
* css/RuleSet.cpp:
(WebCore::isSelectorMatchingHTMLBasedOnRuleHash):
I unified ruleData.hasRightmostSelectorMatchingHTMLBasedOnRuleHash() and hasMultipartSelector().

(WebCore::RuleData::RuleData):
(WebCore::rulesCountForName):
(WebCore::RuleSet::addRule):
I removed the recursive part of findBestRuleSetAndAdd() (which was wrong anyway). The function
was useless so I just moved the algorithm to addRule() directly.

We first loop over all the CSSSelectors related by SubSelector, this correspond to the rightmost fragment.
If a filter with high specificity is found, we add the rule immediately and end there.
If a filter that is not very specific is found, we keep a pointer to the selector to use it later.

(WebCore::RuleSet::findBestRuleSetAndAdd): Deleted.
* css/RuleSet.h:
(WebCore::RuleData::hasMultipartSelector): Deleted.

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

6 years ago[WinCairo] Unreviewed build fix after r170937.
achristensen@apple.com [Sat, 12 Jul 2014 03:54:05 +0000 (03:54 +0000)]
[WinCairo] Unreviewed build fix after r170937.

* WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
Update and apply changes applied to WebCoreGenerated.make in r170937.

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

6 years agoWeb Inspector: Crash when using a stale InspectableNode Node
commit-queue@webkit.org [Sat, 12 Jul 2014 01:49:11 +0000 (01:49 +0000)]
Web Inspector: Crash when using a stale InspectableNode Node
https://bugs.webkit.org/show_bug.cgi?id=134849

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-07-11
Reviewed by Timothy Hatcher.

* inspector/PageConsoleAgent.cpp:

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

6 years ago[MSE] Separate MediaSource logging into its own log channel
jer.noble@apple.com [Sat, 12 Jul 2014 00:53:44 +0000 (00:53 +0000)]
[MSE] Separate MediaSource logging into its own log channel
https://bugs.webkit.org/show_bug.cgi?id=134809

Reviewed by Eric Carlson.

Separate out MediaSource logging (which can be quite verbose) into its own log channel,
distinct from the Media log channel. Add some per-sample logging and further sequester that
logging into its own MediaSourceSamples log channel.

Add the MediaSource and MediaSourceSamples channels:
* platform/Logging.h:

Move LOG(Media) -> LOG(MediaSource):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::MediaSource):
(WebCore::MediaSource::~MediaSource):
(WebCore::MediaSource::setReadyState):
(WebCore::MediaSource::addSourceBuffer):
(WebCore::MediaSource::removeSourceBuffer):
(WebCore::MediaSource::isTypeSupported):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateSeekToTime):
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
(WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::monitorBufferingRate):
(WebCore::SourceBuffer::textTrackAddCues):
(WebCore::SourceBuffer::hasFutureTime):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
(WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
(WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::append):
(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):

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

6 years agoPhone numbers that span two lines are not detected.
beidson@apple.com [Fri, 11 Jul 2014 23:54:55 +0000 (23:54 +0000)]
Phone numbers that span two lines are not detected.
<rdar://problem/17601146> and https://bugs.webkit.org/show_bug.cgi?id=134808

Reviewed by Tim Horton.

* editing/Editor.cpp:
(WebCore::Editor::scanSelectionForTelephoneNumbers): After scanning a range from the TextIterator,
    create an "edge range" window around the end of the TextIterator range, and scan it.
    Also make sure to not accumulate duplicate ranges that might have showed up in both the
    TextIterator range and the edge window range.

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

6 years agoImplement textStylingAtPosition in WK2.
enrica@apple.com [Fri, 11 Jul 2014 23:24:24 +0000 (23:24 +0000)]
Implement textStylingAtPosition in WK2.
https://bugs.webkit.org/show_bug.cgi?id=134843
<rdar://problem/17614981>

Source/WebCore:

Reviewed by Benjamin Poulain.

Adding some exports and making styleForSelectionStart public.

* WebCore.exp.in:
* editing/Editor.h:

Source/WebKit2:

Reviewed by Benjamin Poulain.

Adding information about typing attributes to EditorState so
that we can implement textStylingAtPosition.

* Shared/EditorState.cpp:
(WebKit::EditorState::encode):
(WebKit::EditorState::decode):
* Shared/EditorState.h:
(WebKit::EditorState::EditorState):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView textStylingAtPosition:inDirection:]):
(-[WKContentView canPerformAction:withSender:]):
(-[WKContentView toggleBoldface:]):
(-[WKContentView toggleItalics:]):
(-[WKContentView toggleUnderline:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::editorState):

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

6 years agoREGRESSION (r168868): eBay 'see all' links fail due to different JS bindings conversi...
zalan@apple.com [Fri, 11 Jul 2014 22:36:14 +0000 (22:36 +0000)]
REGRESSION (r168868): eBay 'see all' links fail due to different JS bindings conversion behavior.
https://bugs.webkit.org/show_bug.cgi?id=134841
<rdar://problem/17577563>

Reviewed by Simon Fraser.

Revert back to type int for Element.scroll* APIs in order to preserve exception handling
behavior.

Source/WebCore:
Test: cssom/non-subpixel-scroll-top-left-values.html

* dom/Element.cpp:
(WebCore::Element::scrollLeft):
(WebCore::Element::scrollTop):
(WebCore::Element::setScrollLeft):
(WebCore::Element::setScrollTop):
(WebCore::Element::scrollWidth):
(WebCore::Element::scrollHeight):
* dom/Element.h:
* dom/Element.idl:
* html/HTMLBodyElement.cpp:
(WebCore::adjustForZoom):
(WebCore::HTMLBodyElement::scrollLeft):
(WebCore::HTMLBodyElement::setScrollLeft):
(WebCore::HTMLBodyElement::scrollTop):
(WebCore::HTMLBodyElement::setScrollTop):
(WebCore::HTMLBodyElement::scrollHeight):
(WebCore::HTMLBodyElement::scrollWidth):
* html/HTMLBodyElement.h:

LayoutTests:
* cssom/non-subpixel-scroll-top-left-values-expected.txt: Added.
* cssom/non-subpixel-scroll-top-left-values.html: Added.

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

6 years agoWeb Inspector: Debugger Pause button does not work
joepeck@webkit.org [Fri, 11 Jul 2014 21:54:19 +0000 (21:54 +0000)]
Web Inspector: Debugger Pause button does not work
https://bugs.webkit.org/show_bug.cgi?id=134785

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:
* CMakeLists.txt:
* DerivedSources.make:
Minification strips the sourceURL command. Add it back with minification.

Source/WebCore:
* CMakeLists.txt:
* DerivedSources.make:
* inspector/CommandLineAPIModuleSource.js:
Minification strips the sourceURL command. Add it back with minification.

Source/WebInspectorUI:
Previously we were automatically resuming if we had no recognized
call frames in the call stack we get when paused. However, we
were accidentally skipping over anonymous scripts instead of
just Web Inspector originated call frames.

Now that we allow anonymous scripts we can step into anonymous
scripts (e.g. evals, new Function(...)) as expected.

Also, remove the condition of automatically resuming if the
call stack was empty. The UI handles this with "No Call Frames".

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.debuggerDidPause):

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

6 years agoUse the bare minimum tile coverage rect when under memory pressure.
akling@apple.com [Fri, 11 Jul 2014 21:10:46 +0000 (21:10 +0000)]
Use the bare minimum tile coverage rect when under memory pressure.
<https://webkit.org/b/134837>

When the browser is under critical memory pressure, don't generate any
more tiles than are needed to cover the exposed viewport rect.

Reviewed by Pratik Solanki.

* page/FrameView.cpp:
(WebCore::FrameView::computeCoverageRect):

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

6 years agoWeb Inspector: CSS Autocompletion: "background" only has colors, should support others
commit-queue@webkit.org [Fri, 11 Jul 2014 21:04:17 +0000 (21:04 +0000)]
Web Inspector: CSS Autocompletion: "background" only has colors, should support others
https://bugs.webkit.org/show_bug.cgi?id=134839

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-07-11
Reviewed by Timothy Hatcher.

Update and consolidate the background related CSS properties
and include sub-property completions in the shorthand property.

Also take the opportunity to add or update other properties
(-webkit-alt, -webkit-text-decoration-skip, -webkit-aspect-ratio)
and remove unnecessary newlines / commas in the list.

* UserInterface/Models/CSSKeywordCompletions.js:

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

6 years ago[CSS Grid Layout] Implement justify-self css property
jfernandez@igalia.com [Fri, 11 Jul 2014 20:26:00 +0000 (20:26 +0000)]
[CSS Grid Layout] Implement justify-self css property
https://bugs.webkit.org/show_bug.cgi?id=134419

Reviewed by Dean Jackson.

This change adds the justify-self property from CSS 3 Box Alignment
and implements the parsing.

From Blink r164685 by <jchaffraix@chromium.org>

Source/WebCore:
Test: fast/css/parse-justify-self.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::CSSParser::parseValue):
(WebCore::isItemPositionKeyword):
(WebCore::CSSParser::parseJustifySelf):
* css/CSSParser.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator EJustifySelf):
(WebCore::CSSPrimitiveValue::operator EJustifySelfOverflowAlignment):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:

LayoutTests:
* fast/css/parse-justify-self-expected.txt: Added.
* fast/css/parse-justify-self.html: Added.

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

6 years ago[Feature Queries] Feature Query CSS Grammar Productions Should Return a Value
betravis@adobe.com [Fri, 11 Jul 2014 19:00:24 +0000 (19:00 +0000)]
[Feature Queries] Feature Query CSS Grammar Productions Should Return a Value
https://bugs.webkit.org/show_bug.cgi?id=134810

Reviewed by Antti Koivisto.

The parsing return values are used to determine if a feature query is valid. Two
grammar productions have been updated to correctly return a value.

Tests exist for this feature but will not be run until the feature is turned on.
See https://bugs.webkit.org/show_bug.cgi?id=134404.

* css/CSSGrammar.y.in: Adding return values for two valid feature query productions.

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

6 years ago[Win] Enable DFG JIT.
commit-queue@webkit.org [Fri, 11 Jul 2014 18:53:19 +0000 (18:53 +0000)]
[Win] Enable DFG JIT.
https://bugs.webkit.org/show_bug.cgi?id=123615

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-07-11
Reviewed by Mark Lam.

Source/JavaScriptCore:
When the return type of a JIT generated function call is larger than 64-bit (e.g. SlowPathReturnType),
the normal call() implementation cannot be used on 64-bit Windows, because the 64-bit Windows ABI is different in this case.
Also, when generating calls with double arguments, we need to make sure the arguments are put in the correct registers,
since the register allocation differs on 64-bit Windows.

* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::callWithSlowPathReturnType): Added method to handle function calls where the return value type size is larger than 64-bit.
* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState): Move arguments to correct registers when there are floating point arguments.
(JSC::CCallHelpers::setupArgumentsWithExecStateForCallWithSlowPathReturnType): Added method.
* jit/JIT.h:
(JSC::JIT::appendCallWithSlowPathReturnType): Added method.
* jit/JITInlines.h:
(JSC::JIT::appendCallWithExceptionCheckAndSlowPathReturnType): Added method.
(JSC::JIT::callOperation): Call new method.

Source/WTF:
* wtf/Platform.h:

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

6 years agoUse a separate backdrop element to allow cues to have highlight and background color
bfulgham@apple.com [Fri, 11 Jul 2014 17:32:17 +0000 (17:32 +0000)]
Use a separate backdrop element to allow cues to have highlight and background color
https://bugs.webkit.org/show_bug.cgi?id=134821
<rdar://problem/15999721>

Reviewed by Eric Carlson.

Source/WebCore:
Add a new <div> element wrapping the existing cue <span>. This allows
us to have a highlight on the cue (in the <span> background), as well
as an overall background color.

* Modules/mediacontrols/mediaControlsApple.css:
(video::-webkit-media-text-track-display-backdrop): New markup for
the backdrop element of the caption.
* html/track/VTTCue.cpp:
(WebCore::VTTCue::cueBackdropShadowPseudoId): Added to
allow user customization of the cue backdrop.
(WebCore::VTTCue::initialize): Rename the old "m_cueBackgroundBox" to
"m_cueHighlightBox" and add a new "m_cueBackdropBox" member.
(WebCore::VTTCue::updateDisplayTree): Update for m_cueHighlightBox.
(WebCore::VTTCue::getDisplayTree): Make m_cueHighlightBox a child
of the new m_cueBackdropBox element, and add m_cueBackdropBox to
the display tree.
* html/track/VTTCue.h:
(WebCore::VTTCue::element):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
Fix for missing caption style updates. Even if we are already
listening for caption changes, we still want to update the new
instance's style sheet to match.
(WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride):
* rendering/RenderVTTCue.cpp:
(WebCore::RenderVTTCue::initializeLayoutParameters): Take the new
<div> into consideration when looking for the Cue text element.

LayoutTests:
Updated tests for new formatting logic.

* platform/mac/media/track/track-cue-rendering-horizontal-expected.png:
* platform/mac/media/track/track-cue-rendering-horizontal-expected.txt:

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

6 years agoTighten WebContent sandbox
oliver@apple.com [Fri, 11 Jul 2014 17:15:31 +0000 (17:15 +0000)]
Tighten WebContent sandbox
https://bugs.webkit.org/show_bug.cgi?id=134834

Reviewed by Sam Weinig.

Define a much tighter sandbox profile for the WebContent process

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

6 years agoREGRESSION (r170163?): Web content shifts revealing space equivalent to the find...
antti@apple.com [Fri, 11 Jul 2014 16:29:33 +0000 (16:29 +0000)]
REGRESSION (r170163?): Web content shifts revealing space equivalent to the find bar when clicking a link while a phrase is targeted via Cmd+F
https://bugs.webkit.org/show_bug.cgi?id=134833
<rdar://problem/17580021>

Reviewed by Zalan Bujtas.

Some versions of OS X Safari can't handle the new unfreeze timing. Revert back to DidFirstLayout on Mac.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidLayout):

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

6 years agoSubpixel layout: return integral results for offset*, client*, scroll* by default.
zalan@apple.com [Fri, 11 Jul 2014 15:27:42 +0000 (15:27 +0000)]
Subpixel layout: return integral results for offset*, client*, scroll* by default.
https://bugs.webkit.org/show_bug.cgi?id=134651

Reviewed by Simon Fraser.

Revert to returning integral values for Element.offset* client* scroll* by default.
Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).

Since snapped dimension depends on both the original point and the width/height of the box,
we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().

Covered by existing tests

Source/WebCore:

* dom/Element.cpp:
(WebCore::subpixelMetricsEnabled):
(WebCore::convertToNonSubpixelValueIfNeeded):
(WebCore::Element::offsetLeft):
(WebCore::Element::offsetTop):
(WebCore::Element::offsetWidth):
(WebCore::Element::offsetHeight):
(WebCore::Element::clientLeft):
(WebCore::Element::clientTop):
(WebCore::Element::clientWidth):
(WebCore::Element::clientHeight):
* page/Settings.in:

Source/WebKit/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferencesRefPrivate.h:

LayoutTests:

* cssom/subpixel-offsetleft-top-width-height-values-expected.txt:

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

6 years agoSubpixel rendering: icloud.com password arrow has clipped circle at some window sizes.
zalan@apple.com [Fri, 11 Jul 2014 14:19:12 +0000 (14:19 +0000)]
Subpixel rendering: icloud.com password arrow has clipped circle at some window sizes.
https://bugs.webkit.org/show_bug.cgi?id=134824
<rdar://problem/17612729>

Reviewed by Simon Fraser.

Transparent layer clipping needs device pixel offset adjusting.

Source/WebCore:
Test: fast/layers/wrong-clipping-semi-transparent-compositing-layer-on-subpixel-position.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::paintLayer):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintBackgroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragments):
* rendering/RenderLayer.h:

LayoutTests:
* fast/layers/wrong-clipping-semi-transparent-compositing-layer-on-subpixel-position-expected.html: Added.
* fast/layers/wrong-clipping-semi-transparent-compositing-layer-on-subpixel-position.html: Added.

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

6 years agoUnreviewed, rolling out r170995.
commit-queue@webkit.org [Fri, 11 Jul 2014 12:26:08 +0000 (12:26 +0000)]
Unreviewed, rolling out r170995.
https://bugs.webkit.org/show_bug.cgi?id=134831

Causing odd crashes in debug builds (Requested by zdobersek on
#webkit).

Reverted changeset:

"[WTF] Add the move constructor, move assignment operator for
HashTable"
https://bugs.webkit.org/show_bug.cgi?id=130772
http://trac.webkit.org/changeset/170995

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

6 years agoUnreviewed. Remove unused file.
carlosgc@webkit.org [Fri, 11 Jul 2014 12:15:48 +0000 (12:15 +0000)]
Unreviewed. Remove unused file.

* html/shadow/MediaControlsGtk.h: Removed.

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

6 years ago[GTK] Enable VIDEO_TRACK by default
carlosgc@webkit.org [Fri, 11 Jul 2014 12:12:43 +0000 (12:12 +0000)]
[GTK] Enable VIDEO_TRACK by default
https://bugs.webkit.org/show_bug.cgi?id=134801

Reviewed by Philippe Normand.

* Source/cmake/OptionsGTK.cmake:

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

6 years ago[CSS Grid Layout] Update grid-auto-flow to the new syntax
rego@igalia.com [Fri, 11 Jul 2014 10:42:32 +0000 (10:42 +0000)]
[CSS Grid Layout] Update grid-auto-flow to the new syntax
https://bugs.webkit.org/show_bug.cgi?id=134057

Reviewed by Sergio Villar Senin.

Source/WebCore:
In last versions of the spec grid-auto-flow syntax has changed. New
syntax is:
[ row | column ] && dense? | stack && [ row | column ]?

Implemented parsing for new syntax and added/modified test cases in
current layout tests.

For the moment, the implementation keeps working in the same way, but
using "stack" value for grid-auto-flow property instead of "none". This
should be fixed in a follow-up patch once "stack" is properly
implemented.

Also "dense" needs to be reviewed. Right now auto-placement algorithm is
always "dense" and never "sparse".

No new tests, update current tests to add new cases.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue): Adapt to new syntax.
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue): Removed grid-auto-flow as it
is not a keyword anymore.
(WebCore::isKeywordPropertyID): Ditto.
(WebCore::CSSParser::parseValue): Add specific method for parsing
grid-auto-flow.
(WebCore::CSSParser::parseGridShorthand): Adapt parsing for
grid-auto-flow property inside the shorthand.
(WebCore::isValidGridAutoFlowId): Helper method to check if the CSSValue
id is a valid keyword for grid-auto-flow property.
(WebCore::CSSParser::parseGridAutoFlow): Implement new parsing for
grid-auto-flow.
* css/CSSParser.h: Method header for grid-auto-flow parsing.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator GridAutoFlow): Deleted.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted.
* css/CSSValueKeywords.in: Add new keywords required by grid-auto-flow:
"dense" and "stack".
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder): Remove
default handler as grid-auto-flow is not a keyword now.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty): Implement particular handler
for new grid-auto-flow syntax.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::placeItemsOnGrid): Keep old "none" behavior as
"stack" behavior for the moment.
(WebCore::RenderGrid::autoPlacementMajorAxisDirection): Use the new
helper methods in RenderStyle.
(WebCore::RenderGrid::autoPlacementMinorAxisDirection): Ditto.
* rendering/style/GridResolvedPosition.cpp:
(WebCore::GridResolvedPosition::resolveGridPositionsFromStyle): Again
keep old "none" behavior for "stack".
* rendering/style/RenderStyle.h: Add new helper methods to know the
direction and algorithm of grid-auto-flow property.
* rendering/style/RenderStyleConstants.h: Redefine GridAutoFlow enum
using flags for algorithm and direction.
* rendering/style/StyleGridData.h: Change m_gridAutoFlow type to
unsigned.

LayoutTests:
Adapted current tests to the new syntax. Keeping old "none" behavior
using "stack".

Add new use cases to cover the new syntax to grid-auto-flow-get-set.html
and grid-shorthand-get-set.html.

* fast/css-grid-layout/grid-auto-flow-get-set-expected.txt:
* fast/css-grid-layout/grid-auto-flow-get-set.html:
* fast/css-grid-layout/grid-auto-flow-resolution.html:
* fast/css-grid-layout/grid-auto-flow-update-expected.txt:
* fast/css-grid-layout/grid-auto-flow-update.html:
* fast/css-grid-layout/grid-item-named-grid-area-resolution.html:
* fast/css-grid-layout/grid-item-z-index-change-repaint.html:
* fast/css-grid-layout/grid-item-z-index-stacking-context.html:
* fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
* fast/css-grid-layout/grid-shorthand-get-set.html:
* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-dynamic-get-set.html:
* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html:
* fast/css-grid-layout/resources/grid.css:
(.gridAutoFlowStack):
(.gridAutoFlowNone): Deleted.
* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* ietestcenter/css3/grid/grid-column-001.htm:
* ietestcenter/css3/grid/grid-column-002.htm:
* ietestcenter/css3/grid/grid-column-003.htm:
* svg/css/getComputedStyle-basic-expected.txt:

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

6 years ago[WTF] Add the move constructor, move assignment operator for HashTable
zandobersek@gmail.com [Fri, 11 Jul 2014 08:16:36 +0000 (08:16 +0000)]
[WTF] Add the move constructor, move assignment operator for HashTable
https://bugs.webkit.org/show_bug.cgi?id=130772

Reviewed by Darin Adler.

HashTable has both copy constructor and copy assignment operator, meaning that the move constructor
and move assignment operator are implicitly deleted. This patch defines both to avoid unnecessary
copies when moves can be performed.

* wtf/HashTable.h:
(WTF::KeyTraits>::HashTable):

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

6 years agoVersioning.
lforschler@apple.com [Fri, 11 Jul 2014 06:01:26 +0000 (06:01 +0000)]
Versioning.

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

6 years agoWeb Inspector: Debugger Continue button is incorrectly sized
commit-queue@webkit.org [Fri, 11 Jul 2014 05:06:55 +0000 (05:06 +0000)]
Web Inspector: Debugger Continue button is incorrectly sized
https://bugs.webkit.org/show_bug.cgi?id=134786

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-07-10
Reviewed by Timothy Hatcher.

Before this patch everything in the DebuggerDashboardView was flexing.
Normally, if the contents were not too wide, this would just behave
as expected and be centered. If the content was too wide, then each
element would flex uniformly and overlap uniformly. That was not expected.

This patch changes makes everything but the link have a non-flexible
size. If the link (at the end) flexs it will have a nice ellipsis
text truncation, and the rest of the content will be left justified.

This also fixes a few other minor issues seen in the view.

* UserInterface/Views/DebuggerDashboardView.css:
(.dashboard.debugger .navigation-bar):
Reduce the complexity, give the nav bar (the resume button) some simple padding.

(.dashboard.debugger > div):
Make everything non-flex by default.

(.dashboard.debugger > .location):
The location will have an inner element flex, so make it flex.

(.dashboard.debugger > .location > *):
Make everything in .location non-flex by default.

(.dashboard.debugger > .location .go-to-link):
Make the link flex and truncate cleanly.

(.dashboard.debugger > .location .function-name):
Fix vertical alignment when the toolbar has small icons.

* UserInterface/Views/DebuggerDashboardView.js:
(WebInspector.DebuggerDashboardView.prototype._rebuildLocation):
Fix class name spelling.

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

6 years agoUnreviewed EFL build fix after r170970.
jinwoo7.song@samsung.com [Fri, 11 Jul 2014 04:26:31 +0000 (04:26 +0000)]
Unreviewed EFL build fix after r170970.

* UIProcess/efl/WebContextEfl.cpp:
(WebKit::WebContext::platformDefaultOpenGLCacheDirectory):

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

6 years agoREGRESSION(r170970) REGRESSION(r170974): [GTK] Build broken.
commit-queue@webkit.org [Fri, 11 Jul 2014 03:50:15 +0000 (03:50 +0000)]
REGRESSION(r170970) REGRESSION(r170974): [GTK] Build broken.
https://bugs.webkit.org/show_bug.cgi?id=134825

Unreviewed GTK build fix.

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-07-10

* Shared/SessionState.h: Put ifdefs for ViewSnapshot on Mac port.
* Shared/WebBackForwardListItem.h: Idem.
* UIProcess/gtk/WebContextGtk.cpp:
(WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Implement skeleton.

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

6 years ago[iOS][WK2] It should be safe to call WKContentViewInteraction's cleanupInteraction...
benjamin@webkit.org [Fri, 11 Jul 2014 02:29:33 +0000 (02:29 +0000)]
[iOS][WK2] It should be safe to call WKContentViewInteraction's cleanupInteraction multiple times
https://bugs.webkit.org/show_bug.cgi?id=134820

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-07-10
Reviewed by Andreas Kling.

If a view is destroyed just after a crash, "cleanupInteraction" is called twice: once on crash,
once on dealloc.

The code handling _interactionViewsContainerView is using KVO to monitor transform changes. It is not safe
to remove the observer if we are not already observing on that view.

To solve the problem, this patch makes the cleanup actually remove the view so that setup and cleanup
are completely symmetrical. If cleanup is called twice, the second time would not enter the branch because
the view is already nil.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):

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

6 years ago[iOS WK2] Move WKInspectorHighlightView to its own file
simon.fraser@apple.com [Fri, 11 Jul 2014 00:49:02 +0000 (00:49 +0000)]
[iOS WK2] Move WKInspectorHighlightView to its own file
https://bugs.webkit.org/show_bug.cgi?id=134819

Reviewed by Joseph Pecoraro.

WKInspectorHighlightView brought a lot of path/quad-related code into WKContentView.mm,
so move it into its own file.

* UIProcess/WKInspectorHighlightView.h: Added.
* UIProcess/WKInspectorHighlightView.mm: Added.
(-[WKInspectorHighlightView dealloc]):
(-[WKInspectorHighlightView _removeAllLayers]):
(-[WKInspectorHighlightView _createLayers:]):
(findIntersectionOnLineBetweenPoints):
(quadIntersection):
(layerPathWithHole):
(layerPath):
(-[WKInspectorHighlightView _layoutForNodeHighlight:]):
(-[WKInspectorHighlightView _layoutForRectsHighlight:]):
(-[WKInspectorHighlightView update:]):
* UIProcess/ios/WKContentView.mm:
(-[WKInspectorHighlightView initWithFrame:]): Deleted.
(-[WKInspectorHighlightView dealloc]): Deleted.
(-[WKInspectorHighlightView _removeAllLayers]): Deleted.
(-[WKInspectorHighlightView _createLayers:]): Deleted.
(findIntersectionOnLineBetweenPoints): Deleted.
(quadIntersection): Deleted.
(layerPathWithHole): Deleted.
(layerPath): Deleted.
(-[WKInspectorHighlightView _layoutForNodeHighlight:]): Deleted.
(-[WKInspectorHighlightView _layoutForRectsHighlight:]): Deleted.
(-[WKInspectorHighlightView update:]): Deleted.
* WebKit2.xcodeproj/project.pbxproj:

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

6 years ago[iOS] Pasting rich content does not perform a two-step paste
mmaxfield@apple.com [Fri, 11 Jul 2014 00:12:02 +0000 (00:12 +0000)]
[iOS] Pasting rich content does not perform a two-step paste
https://bugs.webkit.org/show_bug.cgi?id=134795

Reviewed by Benjamin Poulain.

Source/WebCore:
UIKit requires writing something (anything!) to a particular pasteboard
during copy in order to flag the content as rich. When a paste occurs,
UIKit will read this flag and perform a two-step paste.

Test: platform/ios-sim/editing/pasteboard/two-step-paste.html

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):

LayoutTests:
Copy and paste some text, and make sure that the two step paste occurred.
The mechanism for detecting this is whether or not styles have changed appropriately.

* platform/ios-sim/editing/pasteboard/two-step-paste-expected.txt: Added.
* platform/ios-sim/editing/pasteboard/two-step-paste.html: Added.

Tools:
Two-step paste requires setting InputViewObeysDOMFocus on the UIWebBrowserView.

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):

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

6 years agoUpdate the ChangeLog per Pratik's review comments
aestes@apple.com [Fri, 11 Jul 2014 00:04:55 +0000 (00:04 +0000)]
Update the ChangeLog per Pratik's review comments

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

6 years ago[iOS] Some QuickLook documents are not displayed as previews
aestes@apple.com [Fri, 11 Jul 2014 00:02:51 +0000 (00:02 +0000)]
[iOS] Some QuickLook documents are not displayed as previews
https://bugs.webkit.org/show_bug.cgi?id=134788

Reviewed by Pratik Solanki.

ResourceRequest::isMainResourceRequest() is not reliable (e.g. ResourceRequests reconstituted from an
NSURLRequest have no way to set this bit properly) and should probably be removed. Instead of using
isMainResourceRequest() to check if a QuickLookHandle should be created when the Network Process is in use,
just check if the current ResourceLoader is the same as the DocumentLoader's ResourceLoader.

No new tests. QuickLook is not testable from WebKit.

* platform/network/ios/QuickLook.mm:
(WebCore::QuickLookHandle::create):

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

6 years agoREGRESSION (r170935): WKWebView is always transparent until the first layer tree...
timothy_horton@apple.com [Thu, 10 Jul 2014 23:46:43 +0000 (23:46 +0000)]
REGRESSION (r170935): WKWebView is always transparent until the first layer tree commit
https://bugs.webkit.org/show_bug.cgi?id=134818
<rdar://problem/17632468>

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKWebView.mm:
(scrollViewBackgroundColor):
r170935 made it so that we would initialize the scroll view background color to an
invalid color until the first layer tree commit. We should go with white instead.

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

6 years agoAdd a mechanism to notify the UIProcess when an editing command is done executing.
enrica@apple.com [Thu, 10 Jul 2014 23:26:19 +0000 (23:26 +0000)]
Add a mechanism to notify the UIProcess when an editing command is done executing.
https://bugs.webkit.org/show_bug.cgi?id=134807

Reviewed by Tim Horton.

Some editing commands have an effect on some parts of the system that
run inside the UIProcess. A good example are the cursor movement commands
that require an update of the autocorrection/autosuggestion machinery.
This patch adds a way to reliably know when the command has been executed
in the WebProcess. A previous attempt at solving this problem was added in
r170858 and was partially reverted in r170948.
The change also removes the selectionWillChange notification added in r170858.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::editorStateChanged):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::selectionWillChange): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView executeEditCommandWithCallback:]):
(-[WKContentView _moveUp:withHistory:]):
(-[WKContentView _moveDown:withHistory:]):
(-[WKContentView _moveLeft:withHistory:]):
(-[WKContentView _moveRight:withHistory:]):
(-[WKContentView _moveToStartOfWord:withHistory:]):
(-[WKContentView _moveToStartOfParagraph:withHistory:]):
(-[WKContentView _moveToStartOfLine:withHistory:]):
(-[WKContentView _moveToStartOfDocument:withHistory:]):
(-[WKContentView _moveToEndOfWord:withHistory:]):
(-[WKContentView _moveToEndOfParagraph:withHistory:]):
(-[WKContentView _moveToEndOfLine:withHistory:]):
(-[WKContentView _moveToEndOfDocument:withHistory:]):
(-[WKContentView _selectionWillChange]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::executeEditCommand):
(WebKit::WebPageProxy::notifySelectionWillChange): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::executeEditCommandWithCallback):

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

6 years ago[Mac] NSWindow warning: adding an unknown subview opening detached Inspector
commit-queue@webkit.org [Thu, 10 Jul 2014 23:20:51 +0000 (23:20 +0000)]
[Mac] NSWindow warning: adding an unknown subview opening detached Inspector
https://bugs.webkit.org/show_bug.cgi?id=134813

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-07-10
Reviewed by Timothy Hatcher.

Source/WebKit/mac:
* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController window]):
Use a selector that will avoid the warning message.

Source/WebKit2:
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::createInspectorWindow):
Use a selector that will avoid the warning message.

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

6 years agoRemove use of container relative restrictions in the network process sandbox
oliver@apple.com [Thu, 10 Jul 2014 23:17:12 +0000 (23:17 +0000)]
Remove use of container relative restrictions in the network process sandbox
https://bugs.webkit.org/show_bug.cgi?id=134816

Reviewed by Anders Carlsson.

As i'm tidying up the various sandboxes and that's meaning we
need to reduce some file restrictions in the network process.

* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

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

6 years ago[iOS WebKit2] Don't uninstall the memory pressure listener after first signal.
akling@apple.com [Thu, 10 Jul 2014 22:26:02 +0000 (22:26 +0000)]
[iOS WebKit2] Don't uninstall the memory pressure listener after first signal.
<https://webkit.org/b/134814>

The call to uninstall() should not be made on iOS since iOS doesn't use the
hold-off mechanism in MemoryPressureHandler.

Reviewed by Benjamin Poulain.

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::respondToMemoryPressure):

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

6 years agoUnreviewed iOS build fix after r170974. Define id if building a non ObjC file.
psolanki@apple.com [Thu, 10 Jul 2014 21:35:52 +0000 (21:35 +0000)]
Unreviewed iOS build fix after r170974. Define id if building a non ObjC file.

* UIProcess/mac/ViewSnapshotStore.h:

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

6 years ago[MSE] Overlapping appended ranges must cause the decoder to flush and re-enqueue.
jer.noble@apple.com [Thu, 10 Jul 2014 21:28:05 +0000 (21:28 +0000)]
[MSE] Overlapping appended ranges must cause the decoder to flush and re-enqueue.
https://bugs.webkit.org/show_bug.cgi?id=134805

Reviewed by Eric Carlson.

When appending a range of media data which overlaps with an existing range, SourceBuffer
must cause the decoder to flush and re-enqueue samples. Those samples removed by appending
the overlapping range may have already been enqueued for display, and unless the decode
queue is flushed, corruption or decode errors may occur as the new samples are enqueued for
display.

Add a boolean flag onto TrackBuffer to indicate whether the decoder needs to be flushed and
re-enqueued the next time an append operation completes. Set this flag whenever samples are
removed due to overlapping or an explicit call to removeCodedFrames(). Move the contents of
sourceBufferPrivateSeekToTime() (which previously did flushing and re-enqueueing) into a new
function, reenqueueMediaForTime(), which can be called from sourceBufferPrivateAppendComplete().

Drive-by fix: findSyncSampleAfterDecodeIterator() would return the passed in iterator if that
sample is a sync-sample. Fix this to correctly return the next sync sample.

Drive-by fix: Use a SampleMap, rather than a DecodeOrderSampleMap, to track erased samples
so that the erasedSamples are correctly accounted for in both presentation and decode orders.

* Modules/mediasource/SampleMap.cpp:
(WebCore::SampleMap::empty): Add convenience method.
(WebCore::DecodeOrderSampleMap::findSyncSampleAfterDecodeIterator): Drive-by fix.
* Modules/mediasource/SampleMap.h:
(WebCore::SampleMap::decodeOrder): Added const accessor.
(WebCore::SampleMap::presentationOrder): Ditto.
(WebCore::SampleMap::addRange): Added.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Add needsReenqueeing flag.
(WebCore::SourceBuffer::sourceBufferPrivateSeekToTime): Move contents into reenqueueMediaForTime().
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): Call reenqueMediaForTime() if necessary.
(WebCore::SourceBuffer::removeCodedFrames): Set needsReenqueing.
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
(WebCore::SourceBuffer::provideMediaData): Drive-by fix.
(WebCore::SourceBuffer::reenqueueMediaForTime): Moved from sourceBufferPrivateSeekToTime().
* Modules/mediasource/SourceBuffer.h:

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

6 years agoASSERT in SharedBuffer::maybeAppendDataArray() on MobileSafari launch
psolanki@apple.com [Thu, 10 Jul 2014 20:48:44 +0000 (20:48 +0000)]
ASSERT in SharedBuffer::maybeAppendDataArray() on MobileSafari launch
https://bugs.webkit.org/show_bug.cgi?id=134812
<rdar://problem/17628434>

Reviewed by Joseph Pecoraro.

Fix bug in my fix in r170930. Initialize the badly named m_shouldUsePurgeableMemory field to
false. This field indicates when it is okay to use purgeable memory and is set to true once
the resource is finished loading. By setting it to true in the constructor we were creating
purgeable memory while the resource was still being loaded and this triggered the assert.

No new tests. Should be covered by existing tests.

* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::SharedBuffer):

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

6 years agoStore ViewSnapshots directly on the WebBackForwardListItem
timothy_horton@apple.com [Thu, 10 Jul 2014 20:33:05 +0000 (20:33 +0000)]
Store ViewSnapshots directly on the WebBackForwardListItem
https://bugs.webkit.org/show_bug.cgi?id=134667
<rdar://problem/17082639>

Reviewed by Dan Bernstein.

Make ViewSnapshot a refcounted class. Store it directly on the back-forward item
instead of in a side map referenced by UUID. Switch to a very simple LRU eviction model for now.
This fixes a ton of snapshot management bugs; for example, we would start throwing out snapshots
in the page that was actively being interacted with *first* when evicting snapshots, instead of
preferring older snapshots. Additionally, we would not throw away snapshots when back forward items
became unreachable.

There is definitely room for improvement of the eviction mechanism, but this is closer to a time-tested implementation.

* Shared/SessionState.h:
Keep a ViewSnapshot instead of a UUID on the BackForwardListItemState.

* Shared/WebBackForwardListItem.h:
Fix some indented namespace contents.

(WebKit::WebBackForwardListItem::snapshot):
(WebKit::WebBackForwardListItem::setSnapshot):
(WebKit::WebBackForwardListItem::setSnapshotUUID): Deleted.
(WebKit::WebBackForwardListItem::snapshotUUID): Deleted.
Switch the snapshot getter/setter to operate on ViewSnapshots instead of UUIDs.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView _takeViewSnapshot]):
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::takeViewSnapshot):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::takeViewSnapshot):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::takeViewSnapshot):
Adopt ViewSnapshot::create, return a PassRefPtr, and class-ify ViewSnapshot.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::shouldUseSnapshotForSize):
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
Grab the ViewSnapshot directly from the WebBackForwardListItem, and adopt the new functions.

* UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
(WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
Rename discardSnapshots to discardSnapshotImages, because we're really only discarding
the images; the render tree size/background color "snapshot" remains and is useful.

* UIProcess/mac/ViewSnapshotStore.h:
(WebKit::ViewSnapshot::setRenderTreeSize):
(WebKit::ViewSnapshot::renderTreeSize):
(WebKit::ViewSnapshot::setBackgroundColor):
(WebKit::ViewSnapshot::backgroundColor):
(WebKit::ViewSnapshot::setDeviceScaleFactor):
(WebKit::ViewSnapshot::deviceScaleFactor):
(WebKit::ViewSnapshot::imageSizeInBytes):
(WebKit::ViewSnapshot::surface):
(WebKit::ViewSnapshot::size):
(WebKit::ViewSnapshot::creationTime):
Make ViewSnapshot a refcounted class.
Add create functions which take an image (or slot ID), and relevant sizes.
It is expected that a ViewSnapshot is created with an image, and it is only possible
to remove that image, never to replace it. A new ViewSnapshot is required in that case.
Add setters for things that ViewSnapshotStore sets on the snapshot after the PageClient
retrieves it from the view. Add getters for things that the ViewGestureControllers need.

Remove removeSnapshotImage, getSnapshot, and the snapshot map.

* UIProcess/mac/ViewSnapshotStore.mm:
(WebKit::ViewSnapshotStore::~ViewSnapshotStore):
(WebKit::ViewSnapshotStore::didAddImageToSnapshot):
(WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
Manage m_snapshotCacheSize and m_snapshotsWithImages via didAddImageToSnapshot and willRemoveImageFromSnapshot.
willRemoveImageFromSnapshot will -always- be called before the ViewSnapshot is destroyed.

(WebKit::ViewSnapshotStore::pruneSnapshots):
Switch to a simple LRU eviction model. As previously mentioned, it's possible to do better, but
this is much less broken than the previous implementation.

(WebKit::ViewSnapshotStore::recordSnapshot):
(WebKit::ViewSnapshotStore::discardSnapshotImages):
(WebKit::ViewSnapshot::create):
(WebKit::ViewSnapshot::ViewSnapshot):
(WebKit::ViewSnapshot::~ViewSnapshot):
(WebKit::ViewSnapshot::hasImage):
(WebKit::ViewSnapshot::clearImage):
(WebKit::ViewSnapshot::asLayerContents):
If a surface is Empty when it comes back from being volatile, throw away the surface
and notify the Store to remove it from m_snapshotCacheSize (via clearImage()).

(WebKit::ViewSnapshotStore::removeSnapshotImage): Deleted.
(WebKit::ViewSnapshotStore::getSnapshot): Deleted.
(WebKit::ViewSnapshotStore::discardSnapshots): Deleted.

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

6 years ago[iOS WebKit2] Some memory pressure relief tweaks.
akling@apple.com [Thu, 10 Jul 2014 20:24:12 +0000 (20:24 +0000)]
[iOS WebKit2] Some memory pressure relief tweaks.
<https://webkit.org/b/134811>

Split memory pressure relief into critical and non-critical sections.
Non-critical relief is for clearing out things that are really not
essential, e.g unused font data, text measurement caches, etc.

On iOS, only flip the "WebKit is under memory pressure" flag when we
are under *critical* memroy pressure, rather than doing it early on
and gimping ourselves because other processes are too big.

Also added logging for when we transition in/out of system pressure.

Reviewed by Geoffrey Garen.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
(WebCore::MemoryPressureHandler::releaseCriticalMemory):
(WebCore::MemoryPressureHandler::releaseMemory):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::loggingEnabled):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::install):

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

6 years agoNeed Setting/WKPreference that allows clients to prevent scrollbars from drawing
bdakin@apple.com [Thu, 10 Jul 2014 20:04:42 +0000 (20:04 +0000)]
Need Setting/WKPreference that allows clients to prevent scrollbars from drawing
on a secondary thread
https://bugs.webkit.org/show_bug.cgi?id=134778
-and corresponding-
<rdar://problem/17595333>

Reviewed by Tim Horton.

Source/WebCore:
This is a requirement for some types of performance tests. The patch adds a new
virtual function to ScrollableArea that forces subclasses to indicate the value of
the Setting. This is required because Scrollbar and ScrollableArea can’t get to
Settings on their own.

* page/FrameView.cpp:
(WebCore::FrameView::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
* page/FrameView.h:
* page/Settings.in:
* platform/ScrollableArea.h:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
* platform/win/PopupMenuWin.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
* rendering/RenderListBox.h:

Source/WebKit2:
This is a requirement for some types of performance tests.

New pref.
* Shared/WebPreferencesDefinitions.h:

PDFPlugin has to implement this new ScrollableArea virtual function to indicate
the Setting’s value.
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):

New pref.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

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

6 years ago[iOS] Frequent assertion failures when swiping back
timothy_horton@apple.com [Thu, 10 Jul 2014 19:31:54 +0000 (19:31 +0000)]
[iOS] Frequent assertion failures when swiping back

Reviewed by Dan Bernstein.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
Don't create an unused VoidCallback. It will assert when destroyed without being called.

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

6 years agoPass sandbox extension for GL cache over to webprocess
oliver@apple.com [Thu, 10 Jul 2014 18:33:39 +0000 (18:33 +0000)]
Pass sandbox extension for GL cache over to webprocess
https://bugs.webkit.org/show_bug.cgi?id=134806

Reviewed by Anders Carlsson.

Add additional WebProcess parameters to pass an extension
that allows access to the opengl cache directory in the
host application's container.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createNewWebProcess):
(WebKit::WebContext::openGLCacheDirectory):
* UIProcess/WebContext.h:
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

6 years agoFix my mis-merged ChangeLog from r170966
beidson@apple.com [Thu, 10 Jul 2014 18:24:23 +0000 (18:24 +0000)]
Fix my mis-merged ChangeLog from r170966

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

6 years agoEnable same features on all Windows ports.
commit-queue@webkit.org [Thu, 10 Jul 2014 17:52:19 +0000 (17:52 +0000)]
Enable same features on all Windows ports.
https://bugs.webkit.org/show_bug.cgi?id=134715

Patch by Alex Christensen <achristensen@webkit.org> on 2014-07-10
Reviewed by Brent Fulgham.

Source/WTF:
* wtf/Platform.h:
Use REQUEST_ANIMATION_FRAME_TIMER on WinCairo.

WebKitLibraries:
* win/tools/vsprops/FeatureDefinesCairo.props:
Made identical to FeatureDefines.props.

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

6 years agoiOS build fix.
mitz@apple.com [Thu, 10 Jul 2014 17:07:41 +0000 (17:07 +0000)]
iOS build fix.

* WebProcess/WebPage/ServicesOverlayController.h:

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

6 years agoPhone number highlights should always be visible if the mouse hovers over.
beidson@apple.com [Thu, 10 Jul 2014 16:19:56 +0000 (16:19 +0000)]
Phone number highlights should always be visible if the mouse hovers over.
<rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784

Reviewed by Tim Horton.

Source/WebCore:
* WebCore.exp.in:

Source/WebKit2:
This is a fairly extensive rewrite of ServicesOverlayController.
It allows one selection highlight for the entire selection, and as many telephone number highlights as there are numbers.
If a telephone number highlight is hovered over, it wins and is painted.
If no telephone number highlight is hovered but the selection highlight is, then it is painted.

The purposes of each method are self evident by their name, and the concepts are mostly the same as they used to be.

The exception is establishHoveredTelephoneHighlight which gets a more detailed explanation below.

* Platform/Logging.h: Add a Services logging channel.

* WebProcess/WebPage/ServicesOverlayController.h:
(WebKit::TelephoneNumberData::TelephoneNumberData):

* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::ServicesOverlayController):
(WebKit::ServicesOverlayController::selectionRectsDidChange):
(WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
(WebKit::ServicesOverlayController::clearHighlightState):
(WebKit::ServicesOverlayController::drawRect):
(WebKit::ServicesOverlayController::drawSelectionHighlight):
(WebKit::ServicesOverlayController::maybeDrawTelephoneNumberHighlight):
(WebKit::ServicesOverlayController::drawHighlight):
(WebKit::ServicesOverlayController::clearSelectionHighlight):
(WebKit::ServicesOverlayController::clearHoveredTelephoneNumberHighlight):
(WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): Starts walking the telephone number ranges and
    creating a highlight for each one that doesn’t already have a highlight. If that highlight is also being hovered by
    the mouse, then it is set as the hovered telephone number highlight and the method stops creating new highlights.
(WebKit::ServicesOverlayController::maybeCreateSelectionHighlight):
(WebKit::ServicesOverlayController::mouseEvent):
(WebKit::ServicesOverlayController::handleClick):
(WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Deleted.
(WebKit::ServicesOverlayController::drawCurrentHighlight): Deleted.

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

6 years ago[GTK][CMake] Add a 'distcheck' target
carlosgc@webkit.org [Thu, 10 Jul 2014 16:13:54 +0000 (16:13 +0000)]
[GTK][CMake] Add a 'distcheck' target
https://bugs.webkit.org/show_bug.cgi?id=130675

.:
Reviewed by Gustavo Noronha Silva.

* Source/PlatformGTK.cmake: Add distcheck target.

Tools:
Patch by Carlos Garcia Campos  <cgarcia@igalia.com> and Martin Robinson <mrobinson@igalia.com> on 2014-07-10
Reviewed by Gustavo Noronha Silva.

Add --check option to make-dist script that builds and installs the tarball.

* gtk/make-dist.py:
(Distcheck.__init__):
(Distcheck.extract_tarball): Extratc the tarball.
(Distcheck.configure): Run cmake.
(Distcheck.configure.create_dir): Helper function to create a directory.
(Distcheck.build): Run make.
(Distcheck.install): Run make install.
(Distcheck.clean): Clean up the extracted tarball.
(Distcheck.check): Run all previous methods in order.
* gtk/manifest.txt: Add missing file.

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

6 years ago[GTK] Use the same default options for production builds that previous stable releases
carlosgc@webkit.org [Thu, 10 Jul 2014 16:11:11 +0000 (16:11 +0000)]
[GTK] Use the same default options for production builds that previous stable releases
https://bugs.webkit.org/show_bug.cgi?id=134589

Reviewed by Martin Robinson.

.:
Change the default value of some features to match our stable releases.
Add FindCairoGL to find cairo-gl libraries and make accelearetd 2D
canvas depend on whether cairo-gl is found.

* Source/cmake/FindCairoGL.cmake: Added.
* Source/cmake/OptionsGTK.cmake:

Tools:
Make sure all features enabled in production builds are also
enabled in developer mode.

* Scripts/webkitperl/FeatureList.pm: Enable ACCELERATED_2D_CANVAS
and CSS_FILTERS for the GTK port.

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

6 years agoAssertions or crashes under _takeViewSnapshot when restoring windows
timothy_horton@apple.com [Thu, 10 Jul 2014 15:39:49 +0000 (15:39 +0000)]
Assertions or crashes under _takeViewSnapshot when restoring windows
https://bugs.webkit.org/show_bug.cgi?id=134792

Reviewed by Simon Fraser.

* UIProcess/API/mac/WKView.mm:
(-[WKView _takeViewSnapshot]):
Taking a window-server snapshot of a non-visible window tends to not succeed.

* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::createFromImage):

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

6 years ago[EFL] Unreviewed EFL gardening.
jinwoo7.song@samsung.com [Thu, 10 Jul 2014 12:23:59 +0000 (12:23 +0000)]
[EFL] Unreviewed EFL gardening.

Rebaseline tests after r170304 and r170619.

* platform/efl/fast/multicol/pagination/RightToLeft-rl-dynamic-expected.png: Added after r170304.
* platform/efl/fast/multicol/pagination/RightToLeft-rl-dynamic-expected.txt: Added after r170304.
* platform/efl/fast/text/indic-expected.png: Added after r170619.
* platform/efl/fast/text/indic-expected.txt: Added after r170619.

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

6 years ago[EFL] Unreviewed EFL gardening.
jinwoo7.song@samsung.com [Thu, 10 Jul 2014 12:14:00 +0000 (12:14 +0000)]
[EFL] Unreviewed EFL gardening.

Rebaseline tests after r170207.

* platform/efl/fast/text/khmer-lao-font-expected.txt: Added.

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

6 years ago[XHR] overrideMimeType() should be able to change encoding in HEADERS RECEIVED state
commit-queue@webkit.org [Thu, 10 Jul 2014 10:09:41 +0000 (10:09 +0000)]
[XHR] overrideMimeType() should be able to change encoding in HEADERS RECEIVED state
https://bugs.webkit.org/show_bug.cgi?id=128968

Patch by Youenn Fablet <youenn.fablet@crf.canon.fr> on 2014-07-10
Reviewed by Alexey Proskuryakov.

Source/WebCore:
Moved response encoding computation from didReceiveResponse to didReceiveData, just before the decoder is instantiated.
This allows overrideMimeType to be changed within readystatechange event callback and have an impact on selected encoding.

Test: http/tests/xmlhttprequest/overridemimetype-headers-received-state-force-shiftjis.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didReceiveResponse): Removed m_responseEncoding computation from response and mimeTypeOverride.
(WebCore::XMLHttpRequest::didReceiveData): Added m_responseEncoding computation from response and mimeTypeOverride.

LayoutTests:
Added test equivalent to http://w3c-test.org/web-platform-tests/master/XMLHttpRequest/overridemimetype-headers-received-state-force-shiftjis.htm
The test sets overrideMimeType when xhr state is changed to HEADERS RECEIVED.

* http/tests/xmlhttprequest/overridemimetype-headers-received-state-force-shiftjis-expected.txt: Added.
* http/tests/xmlhttprequest/overridemimetype-headers-received-state-force-shiftjis.html: Added.
* http/tests/xmlhttprequest/resources/get-content.php: Added.

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

6 years agoBuffer CSS and JS resources in network process before sending over to web process
psolanki@apple.com [Thu, 10 Jul 2014 06:14:35 +0000 (06:14 +0000)]
Buffer CSS and JS resources in network process before sending over to web process
https://bugs.webkit.org/show_bug.cgi?id=134560
<rdar://problem/16737186>

Reviewed by Antti Koivisto.

For CSS and JS resources, ask the network process to buffer the entire resource instead of
sending it to web process in chunks since the web process can't do anything with a partial
css or js file.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
* Shared/Network/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
(WebKit::NetworkResourceLoadParameters::encode):
(WebKit::NetworkResourceLoadParameters::decode):
* Shared/Network/NetworkResourceLoadParameters.h:
* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad):

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

6 years agoFire connected/disconnected events for Gamepads.
beidson@apple.com [Thu, 10 Jul 2014 06:08:58 +0000 (06:08 +0000)]
Fire connected/disconnected events for Gamepads.
https://bugs.webkit.org/show_bug.cgi?id=134386

Reviewed by Dean Jackson.

No new tests (No effect in a currently tested config)

* Modules/gamepad/GamepadManager.cpp:
(WebCore::navigatorGamepadFromDOMWindow): Handling converting a possibly-null Navigator into
    a possibly null NavigatorGamepad.
(WebCore::GamepadManager::platformGamepadConnected): Notify blind Navigator/DOMWindows of all
    previously attached Gamepads, then notify everybody of this new gamepad.
(WebCore::GamepadManager::platformGamepadDisconnected): Handle dispatching the disconnected
    event to all registered DOMWindows.
(WebCore::GamepadManager::platformGamepadInputActivity): Notify blind Navigator/DOMWindows of all
    attached Gamepads.
(WebCore::GamepadManager::makeGamepadVisible): Handles notifying setting up a new gamepads
    with all NavigatorGamepads as well as dispatching the connected even to DOMWindows.
(WebCore::GamepadManager::registerDOMWindow):
(WebCore::GamepadManager::unregisterDOMWindow):
(WebCore::GamepadManager::makeGamepadsVisibileToBlindNavigators): Deleted.
* Modules/gamepad/GamepadManager.h:

* Modules/gamepad/NavigatorGamepad.cpp:
(WebCore::NavigatorGamepad::gamepadAtIndex):
* Modules/gamepad/NavigatorGamepad.h:

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

6 years ago[Win] Unreviewed build fix.
bfulgham@apple.com [Thu, 10 Jul 2014 05:32:40 +0000 (05:32 +0000)]
[Win] Unreviewed build fix.

Build bots don't have a three-part default version string,
breaking pattern matching. Handle this case.

* win/tools/scripts/auto-version.pl:

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

6 years ago[iOS][WK2] Disable text quantization while actively changing the page's scale factor
benjamin@webkit.org [Thu, 10 Jul 2014 05:06:30 +0000 (05:06 +0000)]
[iOS][WK2] Disable text quantization while actively changing the page's scale factor
https://bugs.webkit.org/show_bug.cgi?id=134781

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-07-09
Reviewed by Tim Horton and Myles C. Maxfield.

Source/WebCore:
Query the chrome client to setup quantization on each layers.

* page/ChromeClient.h:
(WebCore::ChromeClient::hasStablePageScaleFactor):
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::drawGlyphs):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setupFontSubpixelQuantization):

Source/WebKit2:
While zooming a page, text quantization causes glyphs to "move" in order to get to the closest
boundary for the current scale factor.

We do not want this to happen while dynamically changing the scale factor because the effect
is visible. To avoid this, we disable text quantization if the page's scale factor changes
in response to a non-stable contentRect update.

* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::hasStablePageScaleFactor):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::hasStablePageScaleFactor):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

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

6 years ago[iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
commit-queue@webkit.org [Thu, 10 Jul 2014 04:38:13 +0000 (04:38 +0000)]
[iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
https://bugs.webkit.org/show_bug.cgi?id=134777

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-07-09
Reviewed by Sam Weinig.

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _showMediaSourceSelectionSheet]):

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

6 years ago[EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already...
commit-queue@webkit.org [Thu, 10 Jul 2014 04:13:37 +0000 (04:13 +0000)]
[EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded.
https://bugs.webkit.org/show_bug.cgi?id=134759

Patch by Shivakumar JM <shiva.jm@samsung.com> on 2014-07-09
Reviewed by Gyuyoung Kim.

Add new API in ewk_download_job.h to get size of the data already downloaded.

* UIProcess/API/efl/ewk_download_job.cpp:
(ewk_download_job_received_data_length_get):
(EwkDownloadJob::receivedData):
* UIProcess/API/efl/ewk_download_job.h:
* UIProcess/API/efl/ewk_download_job_private.h:
* UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
(EWK2DownloadJobTest::on_download_requested):
(EWK2DownloadJobTest::on_download_finished):

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

6 years agoUse 16bits instructions for push/pop on ARMv7 when possible
benjamin@webkit.org [Thu, 10 Jul 2014 04:11:34 +0000 (04:11 +0000)]
Use 16bits instructions for push/pop on ARMv7 when possible
https://bugs.webkit.org/show_bug.cgi?id=134753

Reviewed by Geoffrey Garen.

The patch r170839 mixed the code for push/pop pair and single push/pop.
That part was reverted in r170909.

This patch puts the code back but specialized for single push/pop.

* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::pop):
(JSC::ARMv7Assembler::push):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::pop):
(JSC::MacroAssemblerARMv7::push):

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

6 years ago[Curl] Cache entry invalidated too early.
commit-queue@webkit.org [Thu, 10 Jul 2014 03:11:26 +0000 (03:11 +0000)]
[Curl] Cache entry invalidated too early.
https://bugs.webkit.org/show_bug.cgi?id=134681

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-07-09
Reviewed by Alex Christensen.

When a cache entry has expired, it is invalidated when a request for the corresponding url is started.
This is too early, since the resource is possibly not modified (even though it has expired),
and the server might respond with a 304 (not modified) response.
When we then receive a 304 response, the cache entry is deleted, and we have no cached response/data to provide.
This can be solved by not invalidating the entry when a request for that url is started,
but instead invalidate when a 200 OK response is received (which means the resource has been modified).

* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::isCached): Avoid invalidating cache entry when it has expired, wait until we know the server response.
* platform/network/curl/CurlCacheManager.h: Added const modifier.

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

6 years agoREGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com).
enrica@apple.com [Thu, 10 Jul 2014 02:18:30 +0000 (02:18 +0000)]
REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com).
https://bugs.webkit.org/show_bug.cgi?id=134791
<rdar://problem/17616971>

Reviewed by Benjamin Poulain.

After r170858 we notify the keyboard too often about
the changed selection. This patch removes the notification
until we find a better way to do it that doesn't cause
deadlocks.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _selectionWillChange]):
(-[WKContentView _selectionChanged]):

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

6 years agoRevert r170413 and r170390
mmaxfield@apple.com [Thu, 10 Jul 2014 01:42:43 +0000 (01:42 +0000)]
Revert r170413 and r170390
https://bugs.webkit.org/show_bug.cgi?id=134741

Reviewed by Benjamin Poulain.

These patches caused a variety of failures. I'm going to break them up into
smaller chunks and commit them separately at some point in the future.

Requesting a review from Ben Poulain because there were some conflicts with
r170561 in InlineTextBox.cpp and InlineTextBox.h.

* WebCore.exp.in:
* platform/graphics/Font.cpp:
(WebCore::Font::drawText):
(WebCore::Font::drawEmphasisMarks):
(WebCore::Font::adjustSelectionRectForText):
(WebCore::computeUnderlineType):
* platform/graphics/Font.h:
* platform/graphics/FontFastPath.cpp:
(WebCore::Font::getGlyphsAndAdvancesForSimpleText):
(WebCore::Font::drawSimpleText):
(WebCore::Font::drawEmphasisMarksForSimpleText):
(WebCore::Font::drawGlyphBuffer):
(WebCore::Font::drawEmphasisMarks):
(WebCore::Font::adjustSelectionRectForSimpleText):
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::size):
(WebCore::GlyphBuffer::glyphs):
(WebCore::GlyphBuffer::advances):
(WebCore::GlyphBuffer::fontDataAt):
(WebCore::GlyphBuffer::advanceAt):
(WebCore::GlyphBuffer::offsetAt):
(WebCore::GlyphBuffer::reverse):
(WebCore::GlyphBuffer::offsetInString):
(WebCore::GlyphBuffer::swap):
* platform/graphics/GraphicsContext.cpp:
* platform/graphics/Latin1TextIterator.h:
(WebCore::Latin1TextIterator::Latin1TextIterator):
(WebCore::Latin1TextIterator::currentCharacter):
* platform/graphics/SimpleFontData.h:
* platform/graphics/SurrogatePairAwareTextIterator.cpp:
(WebCore::SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator):
* platform/graphics/SurrogatePairAwareTextIterator.h:
(WebCore::SurrogatePairAwareTextIterator::currentCharacter):
* platform/graphics/TextRun.h:
(WebCore::TextRun::length):
(WebCore::TextRun::charactersLength):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::glyphDataForCharacter):
(WebCore::applyFontTransforms):
(WebCore::WidthIterator::advanceInternal):
(WebCore::WidthIterator::advance):
(WebCore::WidthIterator::advanceOneCharacter):
* platform/graphics/WidthIterator.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::Font::drawGlyphs):
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::Font::drawComplexText):
(WebCore::Font::drawEmphasisMarksForComplexText):
(WebCore::Font::adjustSelectionRectForComplexText):
* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::setNormalizedBuffer):
* platform/graphics/mac/FontComplexTextMac.cpp:
(WebCore::Font::adjustSelectionRectForComplexText):
(WebCore::Font::getGlyphsAndAdvancesForComplexText):
(WebCore::Font::drawComplexText):
(WebCore::Font::drawEmphasisMarksForComplexText):
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::drawGlyphs):
* platform/graphics/win/FontCGWin.cpp:
(WebCore::Font::drawGlyphs):
* platform/graphics/win/FontWin.cpp:
(WebCore::Font::adjustSelectionRectForComplexText):
(WebCore::Font::getGlyphsAndAdvancesForComplexText):
(WebCore::Font::drawComplexText):
(WebCore::Font::drawEmphasisMarksForComplexText):
* platform/graphics/wince/FontWinCE.cpp:
(WebCore::Font::drawGlyphs):
(WebCore::Font::drawComplexText):
(WebCore::Font::drawEmphasisMarksForComplexText):
(WebCore::Font::selectionRectForComplexText):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::isSelected):
(WebCore::InlineTextBox::selectionState):
(WebCore::InlineTextBox::localSelectionRect):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::selectionStartEnd):
(WebCore::InlineTextBox::paintSelection):
(WebCore::InlineTextBox::paintCompositionBackground):
(WebCore::InlineTextBox::paintDocumentMarker):
(WebCore::InlineTextBox::paintTextMatchMarker):
(WebCore::InlineTextBox::computeRectForReplacementMarker):
(WebCore::InlineTextBox::paintCompositionUnderline):
(WebCore::InlineTextBox::positionForOffset):
(WebCore::InlineTextBox::constructTextRun):
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::truncation):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::getStringToRender):
* rendering/RenderCombineText.h:
* rendering/RenderTextLineBoxes.cpp:
(WebCore::ellipsisRectForBox):
* rendering/svg/SVGInlineFlowBox.cpp:
(WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::positionForOffset):
(WebCore::SVGInlineTextBox::localSelectionRect):
(WebCore::SVGInlineTextBox::paintSelectionBackground):
(WebCore::SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates):
(WebCore::SVGInlineTextBox::paintText):
* rendering/svg/SVGInlineTextBox.h:
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::currentCharacterStartsSurrogatePair):
(WebCore::SVGTextMetricsBuilder::advance):
* rendering/svg/SVGTextQuery.cpp:
(WebCore::SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates):
(WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
(WebCore::SVGTextQuery::subStringLengthCallback):
(WebCore::SVGTextQuery::startPositionOfCharacterCallback):
(WebCore::SVGTextQuery::endPositionOfCharacterCallback):
(WebCore::SVGTextQuery::rotationOfCharacterCallback):
(WebCore::SVGTextQuery::extentOfCharacterCallback):
(WebCore::SVGTextQuery::characterNumberAtPositionCallback):
* rendering/svg/SVGTextQuery.h:
* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator):
(WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
* rendering/svg/SVGTextRunRenderingContext.h:
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::applySVGGlyphSelection):
* svg/SVGFontData.h:

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

6 years agoFix flaky loading tests
jpfau@apple.com [Thu, 10 Jul 2014 01:13:45 +0000 (01:13 +0000)]
Fix flaky loading tests
https://bugs.webkit.org/show_bug.cgi?id=133696

Reviewed by Ryosuke Niwa.

Source/WebCore:
In some cases, the Frame may be destroyed while the loader is
initializing. Make sure we don't delete it too early.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):

LayoutTests:
* platform/wk2/TestExpectations: Unskip no-longer failing tests

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

6 years agoSafari showing blank pages
andersca@apple.com [Thu, 10 Jul 2014 01:05:23 +0000 (01:05 +0000)]
Safari showing blank pages
https://bugs.webkit.org/show_bug.cgi?id=134790
<rdar://problem/17617166>

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Make sure to add the content view to the scroll view.

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

6 years agoMake IndirectCompositingReason an enum class
simon.fraser@apple.com [Thu, 10 Jul 2014 01:01:52 +0000 (01:01 +0000)]
Make IndirectCompositingReason an enum class
https://bugs.webkit.org/show_bug.cgi?id=134789

Reviewed by Tim Horton.

Make RenderLayer::IndirectCompositingReason an enum class, and change some code
in RenderLayerCompositor::reasonsForCompositing() to use a switch.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore):
(WebCore::RenderLayerCompositor::reasonsForCompositing):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason):

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

6 years agoClosed web views should never create new web processes
andersca@apple.com [Thu, 10 Jul 2014 00:50:25 +0000 (00:50 +0000)]
Closed web views should never create new web processes
https://bugs.webkit.org/show_bug.cgi?id=134787
<rdar://problem/16892526>

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView loadHTMLString:baseURL:]):
(-[WKWebView reload]):
(-[WKWebView reloadFromOrigin]):
Return nil if the returned navigation ID is 0.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
Assert that the page is not closed.

(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadHTMLString):
(WebKit::WebPageProxy::loadAlternateHTMLString):
(WebKit::WebPageProxy::loadPlainTextString):
(WebKit::WebPageProxy::loadWebArchiveData):
Add early returns if the page is closed.

* UIProcess/WebPageProxy.h:

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

6 years ago[EFL] gardening after r170868
ryuan.choi@samsung.com [Thu, 10 Jul 2014 00:29:10 +0000 (00:29 +0000)]
[EFL] gardening after r170868
https://bugs.webkit.org/show_bug.cgi?id=134717

Unreviewed, EFL gardening.

Four tests have been rebaselined, and disable the gamepad tests

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2014-07-09

* platform/efl/TestExpectations: Disable the gamepad tests
* platform/efl/fast/text/atsui-multiple-renderers-expected.png:
* platform/efl/fast/text/atsui-multiple-renderers-expected.txt:
* platform/efl/fast/text/complex-text-opacity-expected.png:
* platform/efl/fast/text/complex-text-opacity-expected.txt:
* platform/efl/fast/text/midword-break-before-surrogate-pair-expected.png:
* platform/efl/fast/text/midword-break-before-surrogate-pair-expected.txt:
* platform/efl/transforms/2d/hindi-rotated-expected.png:
* platform/efl/transforms/2d/hindi-rotated-expected.txt:

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

6 years ago[MSE] http/tests/media/media-source/mediasource-closed.html is failing.
jer.noble@apple.com [Thu, 10 Jul 2014 00:25:52 +0000 (00:25 +0000)]
[MSE] http/tests/media/media-source/mediasource-closed.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=134775

Reviewed by Eric Carlson.

Update the test to use isNaN rather than Number.isNaN.

* http/tests/media/media-source/mediasource-closed.html:

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

6 years ago[Win] Unreviewed gardening.
bfulgham@apple.com [Thu, 10 Jul 2014 00:24:43 +0000 (00:24 +0000)]
[Win] Unreviewed gardening.

* win/tools/scripts/auto-version.pl: Protect against
malformed paths (trailing backslashes).
* win/tools/scripts/feature-defines.pl: Make sure result
has an EOL character.

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

6 years ago[Win] Unreviewed build fix after r170930.
bfulgham@apple.com [Thu, 10 Jul 2014 00:22:35 +0000 (00:22 +0000)]
[Win] Unreviewed build fix after r170930.

* WTF.vcxproj/copy-files.cmd: Include cf files in
post-build copy operation.

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

6 years agoMake SharedBuffer::append(SharedBuffer*) be smarter about CFData and data arrays
psolanki@apple.com [Thu, 10 Jul 2014 00:18:17 +0000 (00:18 +0000)]
Make SharedBuffer::append(SharedBuffer*) be smarter about CFData and data arrays
https://bugs.webkit.org/show_bug.cgi?id=134731

Reviewed by Antti Koivisto.

If the target SharedBuffer has a CFDataRef or a data array then we can simply retain that
CFDataRef or data array elements in the SharedBuffer being appended to. This avoids
unnecessary copying.

No new tests because no functional changes.

* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::append):
(WebCore::SharedBuffer::maybeAppendPlatformData):
* platform/SharedBuffer.h:
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::maybeAppendPlatformData):
(WebCore::SharedBuffer::maybeAppendDataArray):
* platform/soup/SharedBufferSoup.cpp:
(WebCore::SharedBuffer::maybeAppendPlatformData):

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

6 years ago[Win] Remove uses of 'bash' in build system
bfulgham@apple.com [Wed, 9 Jul 2014 23:48:26 +0000 (23:48 +0000)]
[Win] Remove uses of 'bash' in build system
https://bugs.webkit.org/show_bug.cgi?id=134782
<rdar://problem/17615533>

Reviewed by Dean Jackson.

Remove uses of 'bash' by replacing Windows-specific bash scripts
with Perl equivalents.

Source/JavaScriptCore:
* JavaScriptCore.vcxproj/JavaScriptCoreGenerated.make:
* JavaScriptCore.vcxproj/JavaScriptCoreGenerated.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCoreGenerated.vcxproj.filters:
* JavaScriptCore.vcxproj/JavaScriptCorePreBuild.cmd:
* JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.make:
* JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.vcxproj:
* JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.pl: Copied from Source/JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.sh.
* JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.sh: Removed.
* JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.make:
* JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.vcxproj:
* JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.pl: Copied from Source/JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.sh.
* JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.sh: Removed.
* JavaScriptCore.vcxproj/build-generated-files.pl: Copied from Source/JavaScriptCore/JavaScriptCore.vcxproj/build-generated-files.sh.
* JavaScriptCore.vcxproj/build-generated-files.sh: Removed.
* JavaScriptCore.vcxproj/jsc/jscPreBuild.cmd:
* JavaScriptCore.vcxproj/testRegExp/testRegExpPreBuild.cmd:
* JavaScriptCore.vcxproj/testapi/testapiPreBuild.cmd:

Source/WebCore:
* WebCore.vcxproj/WebCoreGenerated.make:
* WebCore.vcxproj/WebCoreGenerated.vcxproj:
* WebCore.vcxproj/WebCoreGenerated.vcxproj.filters:
* WebCore.vcxproj/WebCorePreBuild.cmd:
* WebCore.vcxproj/build-generated-files.pl: Copied from Source/WebCore/WebCore.vcxproj/build-generated-files.sh.
* WebCore.vcxproj/build-generated-files.sh: Removed.
* WebCore.vcxproj/migrate-scripts.pl: Copied from Source/WebCore/WebCore.vcxproj/migrate-scripts.sh.
* WebCore.vcxproj/migrate-scripts.sh: Removed.

Source/WebInspectorUI:
* WebInspectorUI.vcxproj/WebInspectorUI.make:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:
* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters:
* WebInspectorUI.vcxproj/build-webinspectorui.pl: Copied from Source/WebInspectorUI/WebInspectorUI.vcxproj/build-webinspectorui.sh.
* WebInspectorUI.vcxproj/build-webinspectorui.sh: Removed.

Source/WebKit:
* WebKit.vcxproj/Interfaces/FixMIDLHeaders.pl:
* WebKit.vcxproj/Interfaces/InterfacesPreBuild.cmd:
* WebKit.vcxproj/WebKit/WebKitPreBuild.cmd:
* WebKit.vcxproj/WebKit/WebKitVersion.cmd:
* WebKit.vcxproj/WebKitExportGenerator/WebKitExportGeneratorBuildCmd.cmd:
* WebKit.vcxproj/WebKitExportGenerator/WebKitExportGeneratorPreBuild.cmd:
* WebKit.vcxproj/WebKitGUID/WebKitGUIDPreBuild.cmd:

Source/WTF:
* WTF.vcxproj/WTFGenerated.make:
* WTF.vcxproj/WTFGenerated.vcxproj:
* WTF.vcxproj/WTFGenerated.vcxproj.filters:
* WTF.vcxproj/WTFPreBuild.cmd:
* WTF.vcxproj/build-generated-files.pl: Copied from Source/WTF/WTF.vcxproj/build-generated-files.sh.
* WTF.vcxproj/build-generated-files.sh: Removed.

Tools:
* DumpRenderTree/DumpRenderTree.vcxproj/DumpRenderTree/DumpRenderTreePreBuild.cmd:
* DumpRenderTree/DumpRenderTree.vcxproj/ImageDiff/ImageDiffPreBuild.cmd:
* DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePluginPreBuild.cmd:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIPreBuild.cmd:
* WinLauncher/WinLauncher.vcxproj/WinLauncherLibPreBuild.cmd:
* WinLauncher/WinLauncher.vcxproj/WinLauncherPreBuild.cmd:

WebKitLibraries:
* win/tools/scripts/feature-defines.pl: Copied from WebKitLibraries/win/tools/scripts/feature-defines.sh.
* win/tools/scripts/feature-defines.sh: Removed.

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

6 years agoSupport transparent WKWebViews
andersca@apple.com [Wed, 9 Jul 2014 22:06:29 +0000 (22:06 +0000)]
Support transparent WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=134779
<rdar://problem/17351058>

Reviewed by Tim Horton.

Source/WebCore:
Schedule rebuilding the compositing layers if a FrameView's transparency changes.

* page/FrameView.cpp:
(WebCore::FrameView::setTransparent):

Source/WebKit2:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Call _updateScrollViewBackground instead of setting the background color.

(contentZoomScale):
Use dot notation.

(scrollViewBackgroundColor):
Helper function that returns the scroll view background color.
If the web view isn't opaque, we want the scroll view to be transparent.

(-[WKWebView _updateScrollViewBackground]):
Call scrollViewBackgroundColor.

(-[WKWebView setOpaque:]):
Call WebPageProxy::setDrawsBackground and update the scroll view background.

(-[WKWebView setBackgroundColor:]):
Call setBackgroundColor on the content view.

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

6 years ago[iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook...
aestes@apple.com [Wed, 9 Jul 2014 21:58:13 +0000 (21:58 +0000)]
[iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook preview
https://bugs.webkit.org/show_bug.cgi?id=134780

Reviewed by Tim Horton.

Don't use CFDataCreateWithBytesNoCopy() when we can't guarantee the lifetime of the copied-from DataReference
will match or exceed that of the CFDataRef. Copy the data instead.

* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveData):

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