[iOS][WK2] Reset the special action-target of WKSyntheticClickTapGestureRecognizer on destruction
https://bugs.webkit.org/show_bug.cgi?id=133165
<rdar://problem/16283914>

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-05-22
Reviewed by Andy Estes.

It is unclear why, but the WKSyntheticClickTapGestureRecognizer sometimes survives its own view
and is reset after WKContentView was destructed.
This patch cleans up the target-action on destruction to avoid accessing a destructed object.

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169240 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Eliminate n/total progress update from run-jsc-stress-tests output to file
https://bugs.webkit.org/show_bug.cgi?id=133191

Reviewed by Geoffrey Garen.

Changed progressMeter setting to be based on stdout being a tty instead of
stdin.  Unified the processing of output from the shell runner to match the
same processing as is used by the makefile runner.  As part of this, the 
shell runner script was simplified.  It now forwards the output of each
test_script just like the Makefile and doesn't provide its own progress.

* Scripts/jsc-stress-test-helpers/shell-runner.sh:
* Scripts/run-jsc-stress-tests:


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

Reviewed by NOBODY.

No new tests.

* platform/graphics/mac/FontMac.mm:
(WebCore::Font::dashesForIntersectionsWithRect): Accidentally said run.length() instead of glyphBuffer.size().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
http/tests/security/xss-DENIED-xsl-document-redirect.xml fails with NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=132523

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2014-05-22
Reviewed by Alexey Proskuryakov.

Source/WebCore:
We should not manufacture a response in the event of an error during a
synchronous XHR. In addition, this test removes two places that are
sensitive to such a manufactured response.

Updates test expectations.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest): Don't inspect a
loader response if there is an error
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Do not
manufacture a response
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Do not
manufacture a response
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::docLoaderFunc): Only use the response's URL if no error
occurred.

LayoutTests:
Two tests have been rebaselined, and re-enable test that now passes. Because of
r23889, synchronous XHRs for file: URLs purposely don't invoke error handlers.

* fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt: Updated
incorrect test description
* fast/xmlhttprequest/resources/xmlhttprequest-nonexistent-file-real.html: Ditto
* platform/mac-wk2/TestExpectations: Re-enable test that now passes.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Can't type in status in facebook.com on iOS Safari because keyboard disappears
https://bugs.webkit.org/show_bug.cgi?id=133196

Reviewed by Geoffrey Garen.

Source/WebCore:
Fixed the bug by rolling out r156252.

When the user taps on the status on facebook.com, the page focuses a textarea,
which is then made momentarily invisible by setting display:none.
The page then removes display:none later and expects the textarea to be still focused.

With r156252, the focus is removed after the page sets display:none and the keyboard disappears.
Since the focus is never reset on the textarea, the user can never type in anything.

The specification may need to change here given that this (rather odd) behavior/expectation exists
on one of the most popular websites on the Web.

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::recalcStyle):
(WebCore::Document::updateLayout):
(WebCore::Document::resetHiddenFocusElementSoon): Deleted.
(WebCore::Document::resetHiddenFocusElementTimer): Deleted.
* dom/Document.h:

LayoutTests:
Removed the test added by r156252.

* fast/dom/HTMLDocument/active-element-gets-unfocusable-expected.txt: Removed.
* fast/dom/HTMLDocument/active-element-gets-unfocusable.html: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Add support for minimal-ui viewports
https://bugs.webkit.org/show_bug.cgi?id=133162

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-05-22
Reviewed by Simon Fraser.


Source/WebCore: 
Add support for minimal-ui directly into the Viewport configuration.

ViewportConfiguration knows about two kinds of layout size in scrollview coordinates:
-normal size
-minimal ui size.

Initially, the page is initialized with resetMinimalUI() and starts with a normal layout.

At any time before the main resource is loaded, the Web page can update its viewport meta tag
to include minimal-ui. The viewport configuration is updated immediately to reflect the minimal-ui
layout size. Any layout after that takes minimal-ui into account.

* WebCore.exp.in:
* css/LengthFunctions.cpp:
(WebCore::minimumValueForLength):
(WebCore::floatValueForLength):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::viewportPercentageValue):
* dom/ViewportArguments.h:
(WebCore::ViewportArguments::operator==):
* page/FrameView.cpp:
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
(WebCore::FrameView::viewportSizeForCSSViewportUnits):
(WebCore::FrameView::setViewportSize): Deleted.
(WebCore::FrameView::viewportSize): Deleted.
* page/FrameView.h:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::setMinimumLayoutSize):
(WebCore::ViewportConfiguration::setMinimumLayoutSizeForMinimalUI):
(WebCore::ViewportConfiguration::activeMinimumLayoutSizeInScrollViewCoordinates):
(WebCore::ViewportConfiguration::resetMinimalUI):
(WebCore::ViewportConfiguration::pageWillRenderFirstFrame):
(WebCore::ViewportConfiguration::initialScale):
(WebCore::ViewportConfiguration::minimumScale):
(WebCore::ViewportConfiguration::updateConfiguration):
(WebCore::ViewportConfiguration::layoutWidth):
(WebCore::ViewportConfiguration::layoutHeight):
(WebCore::ViewportConfiguration::description):
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::minimumLayoutSizeForMinimalUI):
(WebCore::ViewportConfiguration::usesMinimalUI):
* rendering/RenderView.cpp:
(WebCore::RenderView::viewportSizeForCSSViewportUnits):
(WebCore::RenderView::viewportSize): Deleted.
* rendering/RenderView.h:

Source/WebKit2: 
In the WebKit2 layers, we have two parts to minimal-ui.
-In WebPage, we need to get the values from the UIProcess and setup the ViewportConfiguration.
 Another part is freezing the state on page load.
-In the UIProcess, we need to get the right information for layout and styling, and we need to tell
 the UI clients about minimal-ui changes.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setUsesMinimalUI:]):
(-[WKWebView _usesMinimalUI]):
(-[WKWebView _didCommitLayerTree:WebKit::]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _minimumLayoutSizeOverride]):
(-[WKWebView _setMinimumLayoutSizeOverride:]):
(-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]):
(-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
(-[WKWebView _largestUnobscuredSizeOverride]):
(-[WKWebView _setMaximumUnobscuredSizeOverride:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(setViewportConfigurationMinimumLayoutSize): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setUsesMinimalUI):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSizeForMinimalUI):
(WebKit::WebPageProxy::setMaximumUnobscuredSize):
(WebKit::WebPageProxy::setUsesMinimalUI):
(WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::setViewportConfigurationMinimumLayoutSizeForMinimalUI):
(WebKit::WebPage::setMaximumUnobscuredSize):
(WebKit::WebPage::willFlushLayers):
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::viewportConfigurationChanged):
(WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
(WebKit::WebPage::setMinimumLayoutSizeForMinimalUI): Deleted.
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add Yusuke Suzuki to the list of contributors

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-05-22

* Scripts/webkitpy/common/config/contributors.json:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169246 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add Yusuke Suzuki to the list of contributors (for real)

Wrong section...

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-05-22

* Scripts/webkitpy/common/config/contributors.json:


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