[CSS Grid Layout] Make sure grid element's shrink-to-fit behavior is correct
https://bugs.webkit.org/show_bug.cgi?id=103473

Patch by Javier Fernandez <jfernandez@igalia.com> on 2014-04-03
Reviewed by Sergio Villar Senin.

Added a new Layout Test to verify the shrink-to-fit behavior works as expected
for out-of-flow positioned grid elements.

* fast/css-grid-layout/grid-element-shrink-to-fit-expected.html: Added.
* fast/css-grid-layout/grid-element-shrink-to-fit.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Replacing zoom functionality of MiniBrowser from scale_set to page_zoom_set.
https://bugs.webkit.org/show_bug.cgi?id=130391

Patch by Andrzej Badowski <a.badowski@samsung.com> on 2014-04-03
Reviewed by Gyuyoung Kim.

Source/WebKit2:

Change the implementation of the zoom functionality from ewk_view_scale_set
to ewk_view_page_zoom_set. Adding to the API functions: ewk_view_page_zoom_set and
ewk_view_page_zoom_get to call appropriate WK functions.

* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_page_zoom_set):
(ewk_view_page_zoom_get):
* UIProcess/API/efl/ewk_view.h:
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):

Tools:

Change the implementation of the zoom functionality from ewk_view_scale_set
to ewk_view_page_zoom_set.

* MiniBrowser/efl/main.c:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] add missing QuickTime plug-in replacement API
https://bugs.webkit.org/show_bug.cgi?id=131042

Reviewed by Dean Jackson.

Rename QuickTimePluginReplacement.cpp to QuickTimePluginReplacement.mm to make it possible
to use the ObjC JSC API.
* Modules/plugins/QuickTimePluginReplacement.cpp:
* Modules/plugins/QuickTimePluginReplacement.h:
(WebCore::QuickTimePluginReplacement::parentElement):
* Modules/plugins/QuickTimePluginReplacement.idl:

* Modules/plugins/QuickTimePluginReplacement.js:
(Replacement.prototype.timedMetadataUpdates): Implement.
(Replacement.prototype.accessLog): Ditto.
(Replacement.prototype.errorLog): Ditto.

Use the JSC ObjC API to create a JavaScript object from an array of AVMetadataItems. The
JSC ObjC API supports basic NSTypes, but an AVMetadataItem can also contain NSData which 
the existing plug-in returns as base-64 encoded data, so create wrappers for NSDictionary
and NSArray.
* Modules/plugins/QuickTimePluginReplacement.mm: Copied from Source/WebCore/Modules/plugins/QuickTimePluginReplacement.cpp.
(WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected): Disambiguate with "JSC::"
(WebCore::QuickTimePluginReplacement::installReplacement): Ditto.
(WebCore::jsValueWithDataInContext): Create JSValue* from NSData.
(WebCore::jsValueWithArrayInContext): Create JSValue* from NSArray.
(WebCore::jsValueWithDictionaryInContext): Create JSValue* from NSDictionary.
(WebCore::jsValueWithValueInContext): Create JSValue* from basic NSTypes plus AVMetadataItem
    and NSData.
(WebCore::jsValueWithAVMetadataItemInContext): Create JSValue* from AVMetadataItem.
(WebCore::JSQuickTimePluginReplacement::timedMetaData): Script interface.
(WebCore::JSQuickTimePluginReplacement::accessLog): Ditto.
(WebCore::JSQuickTimePluginReplacement::errorLog): Ditto.

* WebCore.xcodeproj/project.pbxproj: QuickTimePluginReplacement.cpp -> QuickTimePluginReplacement.mm.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::timedMetadata): iOS only accessor.
(WebCore::MediaPlayer::accessLog): Ditto.
(WebCore::MediaPlayer::errorLog): Ditto.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::timedMetadata):
(WebCore::MediaPlayerPrivateAVFoundationObjC::accessLog):
(WebCore::MediaPlayerPrivateAVFoundationObjC::errorLog):
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
(WebCore::itemKVOProperties):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename UIClient.{h, mm} to UIDelegate.{h, mm}.

Rubber-stamped by Dan Bernstein.

* UIProcess/API/Cocoa/WKWebView.mm:
* UIProcess/Cocoa/UIDelegate.h: Renamed from Source/WebKit2/UIProcess/Cocoa/UIClient.h.
* UIProcess/Cocoa/UIDelegate.mm: Renamed from Source/WebKit2/UIProcess/Cocoa/UIClient.mm.
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EME] Crash when passing a NULL initData to MediaKeys.createSession()
https://bugs.webkit.org/show_bug.cgi?id=131156

Reviewed by Eric Carlson.

Update the checks at the start of createSession() to match the current spec, notably
bailing early if the initData parameter is NULL or empty.

* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::createSession):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Leaving a streaming movie by going "Back" keeps playing the audio
https://bugs.webkit.org/show_bug.cgi?id=131149

Reviewed by Eric Carlson.

When stopping a HTMLMediaElement, call userCancelledLoad() (which clears the
MediaPlayer) only after calling setPausedInternal() (which pauses the MediaPlayer).
Previously, and in the reverse order, the MediaPlayer would never get a chance to pause
before being cleared. There is an underlying error with the QTKit media engine which
is causing it to continue playing even after its last reference is released, but this
does fix the symptom of playback continuing even after stopping.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::stop):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166722 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKitPerfMonitor: Tooltips cannot be pinned after using browser's back button
https://bugs.webkit.org/show_bug.cgi?id=131155

Reviewed by Andreas Kling.

The bug was caused by Chart.attach binding event listeners on plot container on each call.
This resulted in the click event handler toggling the visiblity of the tooltip twice upon
click when attach() has been called even number of times, keeping the tooltip invisible.

Fixed the bug by extracting the code to bind event listeners outside of Chart.attach as
a separate function, bindPlotEventHandlers, and calling it exactly once when Chart.attach
is called for the first time.

* public/index.html:
(Chart.attach):
(Chart..bindPlotEventHandlers):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKitPerfMonitor: There should be a way to add all metrics of a suite without also adding subtests
https://bugs.webkit.org/show_bug.cgi?id=131157

Reviewed by Andreas Kling.

Split "all metrics" into all metrics of a test suite and all subtests of the suite.
This allows, for example, adding all metrics such as Arithmetic and Geometric for
a given test suite without also adding its subtests.

* public/index.html:
(init.showCharts):
(init):


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

* UIProcess/ios/WKActionSheetAssistant.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] CRASH with calc() value args in inset round
https://bugs.webkit.org/show_bug.cgi?id=129816

Reviewed by Andreas Kling.

Source/WebCore:

The code to parse the inset rounded corners was adding the parser
value arguments to a temporary CSSParserValueList. Unfortunately,
CSSParserValueList expects to own the values it contains, and it frees
the values it contains when the list is destroyed. This was a problem
because the values are owned by the CSSParserValueList passed in to
parseInsetRoundedCorners, and thus the calc's argument list would get
double freed, resulting in a crash. This patch fixes this by using a
Vector to hold the pointers instead.

Test: fast/shapes/shape-outside-floats/shape-outside-inset-round-calc-crash.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseInsetRoundedCorners):

LayoutTests:

Simple test to make sure that using calc in the round argument of an
inset doesn't cause a crash.

* fast/shapes/shape-outside-floats/shape-outside-inset-round-calc-crash-expected.txt: Added.
* fast/shapes/shape-outside-floats/shape-outside-inset-round-calc-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebInspector] inspector/dom/highlight-shape-outside-margin.html is failing
https://bugs.webkit.org/show_bug.cgi?id=131126

Reviewed by Timothy Hatcher.

I updated the test, so it works with the new testing framework. I included the shape path results in the test,
so we won't run into rounding problems, and we don't have that big test set, which would require an expected
result generation. We can add it later, if we extend the test set. The logic is similar to the non margin test case.

* TestExpectations:
* inspector/dom/highlight-shape-outside-margin-expected.txt:
* inspector/dom/highlight-shape-outside-margin.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Fix !ENABLE(BLOB) build
https://bugs.webkit.org/show_bug.cgi?id=131164

Patch by Martin Hodovan <mhodovan@inf.u-szeged.hu> on 2014-04-03
Reviewed by Alexey Proskuryakov.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make actionsForElement a proper API::UIClient member function
https://bugs.webkit.org/show_bug.cgi?id=131171

Reviewed by Sam Weinig.

* UIProcess/API/APIUIClient.h:
(API::UIClient::actionsForElement):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIClient::actionsForElement):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showImageSheet]):
(-[WKActionSheetAssistant showLinkSheet]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Document WKNavigationAction and WKNavigationResponse
https://bugs.webkit.org/show_bug.cgi?id=131138

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKFrameInfo.h:
* UIProcess/API/Cocoa/WKNavigationAction.h:
* UIProcess/API/Cocoa/WKNavigationResponse.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix bit rot in ARMv7 JIT probe mechanism.
<https://webkit.org/b/131167>

Reviewed by Geoffrey Garen.

1. The macro assembler does not support pushing the SP register.  Worked
   around this by pushing the LR register as a placeholder, and then
   writing the original SP value to that slot.
2. The CPUState field in the ProbeContext needs to be aligned on a 4
   byte boundary, not an 8 byte boundary.

* assembler/MacroAssemblerARMv7.cpp:
(JSC::MacroAssemblerARMv7::probe):
* jit/JITStubsARMv7.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WKWebView should always have a UIDelegate, even when closed
https://bugs.webkit.org/show_bug.cgi?id=131174
<rdar://problem/16389248>

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView UIDelegate]):
(-[WKWebView setUIDelegate:]):
* UIProcess/Cocoa/UIDelegate.h:
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIDelegate):
(WebKit::UIDelegate::~UIDelegate):
(WebKit::UIDelegate::createUIClient):
(WebKit::UIDelegate::delegate):
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::UIClient):
(WebKit::UIDelegate::UIClient::~UIClient):
(WebKit::UIDelegate::UIClient::createNewPage):
(WebKit::UIDelegate::UIClient::runJavaScriptAlert):
(WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
(WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
(WebKit::UIDelegate::UIClient::actionsForElement):
(WebKit::UIClient::UIClient): Deleted.
(WebKit::UIClient::~UIClient): Deleted.
(WebKit::UIClient::delegate): Deleted.
(WebKit::UIClient::setDelegate): Deleted.
(WebKit::UIClient::createNewPage): Deleted.
(WebKit::UIClient::runJavaScriptAlert): Deleted.
(WebKit::UIClient::runJavaScriptConfirm): Deleted.
(WebKit::UIClient::runJavaScriptPrompt): Deleted.
(WebKit::UIClient::actionsForElement): Deleted.
* UIProcess/ios/WKActionSheetAssistant.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (Async text input): Controls become unresponsive to mouse events
https://bugs.webkit.org/show_bug.cgi?id=131176
<rdar://problem/16507932>

Reviewed by Tim Horton.

* UIProcess/API/mac/WKView.mm: (NATIVE_MOUSE_EVENT_HANDLER):
Don't confuse event handling machinery by sending events to WebProcess twice.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Continuations casting issue.
https://bugs.webkit.org/show_bug.cgi?id=130057
<rdar://problem/16283406>

Reviewed by Simon Fraser.

Source/WebCore: 

The code to update relative positioned anonymous block continuations should not
have assumed that all siblings were RenderBlocks. Make the code smarter and
make it bail when it hits something that isn't part of the block continuation
chain.

Added fast/block/continuation-crash.html

* rendering/RenderInline.cpp:
(WebCore::updateStyleOfAnonymousBlockContinuations):

LayoutTests: 

* fast/block/continuation-crash-expected.txt: Added.
* fast/block/continuation-crash.html: Added.



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