[iOS] media preferences not initialized correctly in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=129983

Reviewed by Dan Bernstein.

* Shared/WebPreferencesStore.h: Initialize mediaPlaybackAllowsInline and
mediaPlaybackRequiresUserGesture correctly for iOS.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165345 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderElement::valueForLength() callers misuse bool parameter.
https://bugs.webkit.org/show_bug.cgi?id=129982

Reviewed by Andreas Kling.

Remove bogus RenderView* parameter.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computePercentageLogicalHeight):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintAfterLayoutIfNeeded):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
iOS broken after r165342
https://bugs.webkit.org/show_bug.cgi?id=129987

Reviewed by Simon Fraser.

* NetworkProcess/ios/NetworkProcessIOS.mm:
(WebKit::NetworkProcess::platformLowMemoryHandler): Add missing stub implementation for
platformLowMemoryHandler().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165347 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Don't call scrollOffsetForFixedPosition a second time if we have no header and footer layers
https://bugs.webkit.org/show_bug.cgi?id=129912

Reviewed by Tim Horton.

Avoid extra work if we have no header or footer layers.

* page/scrolling/ios/ScrollingTreeScrollingNodeIOS.mm:
(WebCore::ScrollingTreeScrollingNodeIOS::setScrollLayerPosition):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS WK2] Get position:fixed working slighlty better
https://bugs.webkit.org/show_bug.cgi?id=129988

Source/WebCore:

Reviewed by Dan Bernstein.

On iOS we want to use the viewport-constrained visible rect, not
just the visible rect.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):

Source/WebKit2:

Reviewed by Dan Bernstein.

iOS uses fixed layout, but does not want fixed elements laid
out relative to the frame.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setUseFixedLayout):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165349 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Remove the WebView source-mode WebKit1 test
https://bugs.webkit.org/show_bug.cgi?id=129976

Reviewed by Carlos Garcia Campos.

* TestWebKitAPI/Tests/WebKitGtk/testwebview.c: Remove the source-mode test.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165350 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RunGtkWebKitGObjectDOMBindingsAPIBreakTests should be added to the BuildAndTestFactory not the TestFactory
https://bugs.webkit.org/show_bug.cgi?id=129980

Reviewed by Carlos Garcia Campos.

* BuildSlaveSupport/build.webkit.org-config/master.cfg: Add RunGtkWebKitGObjectDOMBindingsAPIBreakTests to the correct factory.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS Wk2] Can't scroll after going back to page in page cache
https://bugs.webkit.org/show_bug.cgi?id=129989
<rdar://problem/16217588>

Reviewed by Dan Bernstein.

iOS has a special FrameLoader::forceLayoutWithoutRecalculatingStyle()
function that is called instead of FrameView::forceLayout(). This was unimplemented
for the WK2 FrameLoaderClient, so no layout was forced, with the result
that the contentSize was never updated and scrolling was broken.

Fix by renaming the client function to forceLayoutOnRestoreFromPageCache()
and having it return a bool to say whether the default forceLayout()
should be done. WK1 can then continue to have its custom behavior,
and Wk2 will simply do a forceLayout().

Also remove FrameLaoderClient::forceLayout(), which was never called.

Source/WebCore:

* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
* loader/FrameLoaderClient.h:

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::forceLayoutOnRestoreFromPageCache):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
(WebKit::WebFrameLoaderClient::forceLayoutOnRestoreFromPageCache):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip fast/workers/worker-copy-shared-blob-url.html in webkit2

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel rendering: Pass FloatSize boxsize to transform animations to support device pixel sizing.
https://bugs.webkit.org/show_bug.cgi?id=129985

Reviewed by Simon Fraser.

This is in preparation to stop passing integral positioned boxes to transform animations.

No change in behavior.

Source/WebCore:

* WebCore.exp.in:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::addAnimation):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::getTransformFunctionValue):
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
(WebCore::GraphicsLayerCA::setTransformAnimationEndpoints):
(WebCore::GraphicsLayerCA::setTransformAnimationKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::startTransition):

Source/WebKit2:

* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Inline the trivial parts of GC deferral.
<https://webkit.org/b/129984>

Made most of the functions called by the DeferGC RAII object inline
to avoid function call overhead.

Looks like ~1% progression on DYEB.

Reviewed by Geoffrey Garen.

* heap/Heap.cpp:
* heap/Heap.h:
(JSC::Heap::incrementDeferralDepth):
(JSC::Heap::decrementDeferralDepth):
(JSC::Heap::collectIfNecessaryOrDefer):
(JSC::Heap::decrementDeferralDepthAndGCIfNeeded):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Don't perform a round-trip through WebProcess before interpreting key events
https://bugs.webkit.org/show_bug.cgi?id=129812

Reviewed by Darin Adler.

Source/WebCore: 

No significant behavior changes expected, except for Esc key processing, which now
dispatches a keypress before executing its default action.

* platform/KeypressCommand.h: Added.
(WebCore::KeypressCommand::KeypressCommand):
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Moved KeypressCommand from dom/KeyboardEvent.h to its own header, as it needed
in platform/ directory now.

* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
* dom/KeyboardEvent.h:
(WebCore::KeyboardEvent::handledByInputMethod):
(WebCore::KeyboardEvent::keypressCommands):
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::handledByInputMethod):
(WebCore::PlatformKeyboardEvent::commands):
PlatformKeyboardEvent now carries results of interpreting the event by AppKit. This
is logically not much different from carrying charcode, and is similar to what Gtk
does for input methods.
KeyboardEvent already had keypress commands, which were added to it after construction.
It's still possible for WebKit1, while with WebKit2, they are provided at construction
time. The event now also has a boolean for whether IM handled it already.

Source/WebKit/mac: 

* WebCoreSupport/WebEditorClient.mm: (WebEditorClient::handleInputMethodKeydown):
Added a FIXME. WebKit1/mac is the only port that uses this roundabout way to
interpret events, so it would simplify code if we switched it to WebKit2/mac model.

Source/WebKit2: 

* Shared/NativeWebKeyboardEvent.h:
* Shared/WebEvent.h:
(WebKit::WebKeyboardEvent::handledByInputMethod):
(WebKit::WebKeyboardEvent::commands):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
* Shared/WebKeyboardEvent.cpp:
(WebKit::WebKeyboardEvent::WebKeyboardEvent):
(WebKit::WebKeyboardEvent::~WebKeyboardEvent):
(WebKit::WebKeyboardEvent::encode):
(WebKit::WebKeyboardEvent::decode):
* Shared/mac/NativeWebKeyboardEventMac.mm:
(WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
* Shared/mac/WebEventFactory.h:
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebKeyboardEvent):
Keyboard events now carry results of interpretation with them.
Ideally, mouse events should also have a handledByInputMethod member, because IMs
can handle events, but that can wait until we have actual bugs caused by not diabling
default processing for these.

* UIProcess/API/mac/WKView.mm:
(-[WKView becomeFirstResponder]): Updated for new NativeWebKeyboardEvent contructor
signature. We don't interpret the event in this code path.
(-[WKView doCommandBySelector:]): Added logging.
(-[WKView performKeyEquivalent:]): Reimplemented Esc and Cmd+period handling to avoid
infinite loops and re-entrancy. These two work in a unique way in AppKit.
Interpret key event before sending it down to WebProcess.
(-[WKView keyUp:]): Interpret key event before sending it down to WebProcess.
We need to tell IMs about the event, but key binding processing is moot, all commands
are executed on keydown.
(-[WKView keyDown:]): Interpret the event.
(-[WKView flagsChanged:]): Ditto.
(-[WKView _interpretKeyEvent:savingCommandsTo:WebCore::]): Added an assertion in
consumedByIM code path.
(-[WKView _executeSavedCommandBySelector:]): Added logging.

* UIProcess/PageClient.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
* UIProcess/mac/WebPageProxyMac.mm:
Removed interpretQueuedKeyEvent/interpretKeyEvent, WebProcess no longer asks UIProcess to do this.

* WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
(WebKit::WebEditorClient::handleKeyboardEvent):
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
(WebKit::WebEditorClient::handleKeyboardEvent):
(WebKit::WebEditorClient::handleInputMethodKeydown):
WebPage::handleEditingKeyboardEvent is now one function instead of two with a boolean
switch between two behaviors.

* WebProcess/WebPage/WebPage.cpp:(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
Removed m_keyboardEventBeingInterpreted, as we no longer send the event for interpretation.
This means that we sometimes have to pass a null event down to WebCore, but I wasn't
able to find any behavior differences from us doing so.

* WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleEditingKeyboardEvent):
Added a FIXME.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::executeKeypressCommandsInternal): When we don't have an event,
use current frame as a target, just like input method messages do.
(WebKit::WebPage::handleEditingKeyboardEvent): This function no longer saves commands,
it only interprets them.
Added a check for Esc, as we don't want to handle it in keydown event handler.
(WebKit::WebPage::insertText): Pass 0 instead of m_keyboardEventBeingInterpreted.
(WebKit::WebPage::insertDictatedText): Ditto.
(WebKit::WebPage::executeKeypressCommands): Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Short-circuit JSGlobalObjectInspectorController when not inspecting.
<https://webkit.org/b/129995>

Add an early return in reportAPIException() when the console agent
is disabled. This avoids expensive symbolication during exceptions
if there's nobody expecting the fancy backtrace anyway.

~2% progression on DYEB on my MBP.

Reviewed by Geoff Garen.

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::reportAPIException):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL fails the new equals-masquerader strictEqualConstant test
https://bugs.webkit.org/show_bug.cgi?id=129996

Reviewed by Mark Lam.
        
It turns out that the FTL was trying to do the masquerading stuff for ===null. But
that's wrong since none of the other engines do it. The DFG even had an ancient
FIXME about doing it - but that doesn't make sense since the LLInt and baseline JIT
don't do it and JSValue::strictEqual() doesn't do it.
        
Remove the FIXME and remove the extra checks in the FTL.
        
This is a glorious patch: nothing but red and it fixes a test failure.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileStrictEqForConstant):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileCompareStrictEqConstant):



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

* dom/KeyboardEvent.cpp: (WebCore::KeyboardEvent::KeyboardEvent):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: js/dom/create-lots-of-workers.html frequently crashes
(sometimes in js/dom/cross-frame-bad-time.html)
https://bugs.webkit.org/show_bug.cgi?id=129758

* platform/mac/TestExpectations: Skipped the test.



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

* WebProcess/WebPage/ios/WebPageIOS.mm: Include WebCore/KeyboardEvent.h.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GPRInfo::toIndex should return InvalidIndex for non-temp registers on ARM64
https://bugs.webkit.org/show_bug.cgi?id=129998

Reviewed by Geoffrey Garen.
        
Not only is that the established contract, but this is used to signal to
ScratchRegisterAllocator that the register doesn't need locking since it isn't a register
that this allocator would use. In the FTL, we may have an inline cache where LLVM had used
some non-temp register (i.e. a register that JSC itself wouldn't have used). This is totally
fine but previously it would have led to either an assertion failure, or data corruption, in
the ScratchRegisterAllocator.

* jit/GPRInfo.h:
(JSC::GPRInfo::toIndex):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update comment in NetworkResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=129997

Patch by Jeong Yong-uk <yong@company100.com> on 2014-03-09
Reviewed by Andreas Kling.

NetworkResourceLoader::resourceHandleStopped() has been renamed to
NetworkResourceLoader::cleanup() but the comment is not updated.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::start):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@165363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unused dispatchStorageEvent() from StorageAreaSync
https://bugs.webkit.org/show_bug.cgi?id=129999

Reviewed by Andreas Kling.

dispatchStorageEvent() is not used anywhere.

* storage/StorageAreaSync.h: Remove dispatchStorageEvent().


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