[iOS WK2] Turn off position:fixed behavior when the keyboard is up
https://bugs.webkit.org/show_bug.cgi?id=132537

Reviewed by Benjamin Poulain.

Source/WebCore:

Export RenderObject::localToContainerPoint().

* WebCore.exp.in:

Source/WebKit2:

Make interaction with form elements inside position:fixed less terrible by re-laying out
fixed elements relative to the document while we have an assisted node. This ensures
that all parts of a position:fixed are accessible (e.g. inputs on the right side
of a fixed-width top bar).

* Shared/AssistedNodeInformation.cpp: Add a flag for being inside postion:fixed,
and encode/decode it.
(WebKit::AssistedNodeInformation::encode):
(WebKit::AssistedNodeInformation::decode):
* Shared/AssistedNodeInformation.h:
(WebKit::AssistedNodeInformation::AssistedNodeInformation):
* UIProcess/PageClient.h: Add isAssistingNode().
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::isAssistingNode):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect): If we have an assisted
node, just use the document rect as the custom fixed position rect.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation): Get the selection rect first,
since we have to fix it up for position:fixed. If the element is inside fixed
position in the main frame, re-set the fixed position rect to the document rect
(which forces a layout), re-fetch elementRect, then set it back. This ensures
that the UI process gets an elementRect which it can zoom to correctly.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171320 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WK1 should always setAcceleratedCompositingForFixedPositionEnabled(true) on 
Yosemite
https://bugs.webkit.org/show_bug.cgi?id=135135

Reviewed by Darin Adler.


Source/WebCore: 
This patch gets rid of the ChromeClient function that was introduced with 
http://trac.webkit.org/changeset/171308 We’ll just enable the Setting instead.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::fixedPositionCreatesStackingContext): Deleted.
* page/ChromeClient.h:
(WebCore::ChromeClient::requiresAcceleratedCompositingForViewportConstrainedPosition): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):

Source/WebKit/mac: 
Get rid of the ChromeClient function, and enable the Setting instead.
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::requiresAcceleratedCompositingForViewportConstrainedPosition): Deleted.
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Correct sandbox profiles to fix some excess privileges
https://bugs.webkit.org/show_bug.cgi?id=135134
<rdar://problem/17741886>
<rdar://problem/17739080>

Reviewed by Alexey Proskuryakov.

This cleans up our sandbox profiles to fix a few issues - the profiles
no longer allow us to issue file extension we have the ability to consume,
and tightens some of the other file access rules.

This means we have to addd some rules to allow us to access things
that we previously had access to due to lax file system restrictions.

Some of the features were fixable simply by using entitlements on the
process rather than custom rules.

* Configurations/WebContent-iOS.entitlements:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171322 268f45cc-cd09-0410-ab3c-d52691b4dbfc
new Int32Array(new ArrayBuffer(100), 1, 1) shouldn't throw an error that says "RangeError: Byte offset and length out of range of buffer"
https://bugs.webkit.org/show_bug.cgi?id=125391

Patch by Diego Pino Garcia <dpino@igalia.com> on 2014-07-21
Reviewed by Darin Adler.

Source/JavaScriptCore:
Create own method for verifying byte offset alignment.

* runtime/ArrayBufferView.h:
(JSC::ArrayBufferView::verifyByteOffsetAlignment):
(JSC::ArrayBufferView::verifySubRangeLength):
(JSC::ArrayBufferView::verifySubRange): Deleted.
* runtime/GenericTypedArrayViewInlines.h:
(JSC::GenericTypedArrayView<Adaptor>::create):
* runtime/JSDataView.cpp:
(JSC::JSDataView::create):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::create):

LayoutTests:
* fast/canvas/webgl/data-view-crash-expected.txt:
* fast/canvas/webgl/data-view-test-expected.txt:
* fast/canvas/webgl/data-view-test.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171323 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r171319.

* Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl: This test should
only execute on Windows. It will fail on other platforms, so give it a way to
successfully exit.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171324 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Follow-up for r171324.

* Scripts/webkitperl/auto-version_unittest/autoVersionTests.pl: Cygwin
perl reports itself as 'cygwin'; native Windows Perl reports as
'MSWin32'. We need to handle both cases.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove global cookie workaround from sandbox profiles
https://bugs.webkit.org/show_bug.cgi?id=135138
<rdar://17513375>

Reviewed by Alexey Proskuryakov.

Remove the workaround needed for global cookie access, and silencing
of the associated sandbox violation.

* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::platformDefaultCookieStorageDirectory):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactor ArrayPrototype to use getLength() and putLength() utility functions.
https://bugs.webkit.org/show_bug.cgi?id=135139.

Reviewed by Oliver Hunt.

- Specialize putProperty() to putLength() because it is only used for setting
  the length property.
- Added a getLength() utility function to get the value of the length property.
- Use these getLength() and putLength() functions instead of the existing code
  to get and put the length property.  Less code to read, easier to understand.

* runtime/ArrayPrototype.cpp:
(JSC::getLength):
(JSC::putLength):
(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncToLocaleString):
(JSC::arrayProtoFuncJoin):
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSort):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncReduce):
(JSC::arrayProtoFuncReduceRight):
(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):
(JSC::putProperty): Deleted.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@171328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r170361): In landscape with UI hidden, fixed position elements at top of screen are too low
https://bugs.webkit.org/show_bug.cgi?id=135141
<rdar://problem/17627525>

Reviewed by Benjamin Poulain.

We can't use the WKWebView's UIScrollView contentInsets to determine the unobscured rect
in MobileSafari, because contentInsets can't be changed dynamically while scrolling.
To get around this, MobileSafari sets obscured insets instead (but also sets a fixed
contentInset).

So if the client calls _setObscuredInsets:, always use _obscuredInsets to compute the
content insets.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _computedContentInset]):
(-[WKWebView _setObscuredInsets:]):

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