[Cocoa] Add a _certificateChain property to WKWebProcessPlugInFrame
https://bugs.webkit.org/show_bug.cgi?id=131370

Reviewed by Anders Carlsson.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
(-[WKWebProcessPlugInFrame _certificateChain]): Added this getter, which uses the new
WebFrame::certificateInfo.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFramePrivate.h:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::certificateInfo): Added this getter.
* WebProcess/WebPage/WebFrame.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Add a way to tell whether a WKWebProcessPlugInNodeHandle is a text-type HTML input element
https://bugs.webkit.org/show_bug.cgi?id=131374

Reviewed by Anders Carlsson.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle isTextField]): Added this getter. Calls
InjectedBundleNodeHandle::isTextField.
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::isTextField): Added. Uses
WebCore::HTMLInputElement::isText, which is consistent with what
WebChromeClient::focusedElementChanged uses to decide whether to call didFocusTextField.
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow elements to register for changes in page scale
https://bugs.webkit.org/show_bug.cgi?id=131319

Reviewed by Eric Carlson.

Some parts of WebCore need to react to changes in the page
scale factor, such as resizing when the user zooms. A followup
patch will enable this for media controls - this simply lays
the groundwork.

At the moment we only allow HTMLMediaElements to register, but if
necessary this could be expanded in the future.

* dom/Document.cpp: New methods to keep a list of HTMLMediaElements that
are interested in updates.
(WebCore::Document::registerForPageScaleFactorChangedCallbacks):
(WebCore::Document::unregisterForPageScaleFactorChangedCallbacks):
(WebCore::Document::pageScaleFactorChanged):
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::registerWithDocument): Add ourselves to the
the document's pageScale callback.
(WebCore::HTMLMediaElement::unregisterWithDocument): Remove ourselves from the
the document's pageScale callback.
(WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Add/remove ourselves to/from
the callback if necessary.
(WebCore::HTMLMediaElement::pageScaleFactorChanged): The callback function. Empty for now.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::mediaControlsDependOnPageScaleFactor): Accessor.
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor): Tell all documents that the user has zoomed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[New Multicolumn] Child top margin sometimes ignored for column balancing
https://bugs.webkit.org/show_bug.cgi?id=122754

Patch by Morten Stenshorne <mstensho@opera.com> on 2014-04-08
Reviewed by David Hyatt.

Source/WebCore:

We need to set zero page logical height in LayoutState when column
height is unknown (when the columns haven't yet been
balanced). There's code that assumes that non-zero page height means
that page height is known. Lying about this makes the pagination code
believe that every top margin is adjacent to a column break, which
makes it eat and ignore all top margins.

This should be cleaned up, but it's easier to wait until the old
multicol code has been removed.

Tests: fast/multicol/break-in-scrollable.html
       fast/multicol/newmulticol/leading-and-trailing-margin.html
       fast/multicol/newmulticol/leading-margin.html

* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
* rendering/RenderFlowThread.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::isPageLogicalHeightKnown):
* rendering/RenderMultiColumnFlowThread.h:

LayoutTests:

* fast/multicol/break-in-scrollable-expected.html: Added.
* fast/multicol/break-in-scrollable.html: Added.
* fast/multicol/newmulticol/leading-and-trailing-margin-expected.html: Added.
* fast/multicol/newmulticol/leading-and-trailing-margin.html: Added.
* fast/multicol/newmulticol/leading-margin-expected.html: Added.
* fast/multicol/newmulticol/leading-margin.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][iOS] Consecutive videos in full screen display only black
https://bugs.webkit.org/show_bug.cgi?id=131316

Reviewed by Eric Carlson.

Update the MediaPlayer's full screen attributes whenever the underlying engine changes,
not just when the engine is initially created. Also, clear the videoLayer out of the
fullscreen layer when destroying the videoLayer.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166939 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac][WK2] Videos do not have access to session cookies
https://bugs.webkit.org/show_bug.cgi?id=129687

Reviewed by Eric Carlson.

Update the CookieStorageShim to track changes in underlying networking stack.

* Shared/mac/CookieStorageShim.mm:
(WebKit::CookieStorageShim::initialize):
(-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166940 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit2 View Gestures (Swipe): Swipe-start hysteresis
https://bugs.webkit.org/show_bug.cgi?id=127393
<rdar://problem/15876822>

Reviewed by Anders Carlsson.

We shouldn't start a swipe immediately upon very small scrolls in the correct direction,
because we don't want to get the user trapped in a swipe when they want to scroll.

We'll accumulate the scroll deltas and wait until the user has scrolled at least 15px horizontally.
In addition, we'll drop the swipe completely if any event has a vertical delta equal to half (or more)
of the horizontal delta.

* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::ViewGestureController):
(WebKit::ViewGestureController::deltaIsSufficientToBeginSwipe):
(WebKit::ViewGestureController::handleScrollWheelEvent):
(WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up old protocol JSON files to better match the latest
https://bugs.webkit.org/show_bug.cgi?id=131308

Reviewed by Joseph Pecoraro.

* Versions/Inspector-iOS-6.0.json:
* Versions/Inspector-iOS-7.0.json:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166942 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactor to make JSMainThreadExecState's constructor and destructor private.
<https://webkit.org/b/131372>

Reviewed by Mark Hahnenberg.

This is in preparation for subsequent patches to ensure that we don't
exit the VM with an exception still pending.

No new tests required.  This is only a refactor of existing behavior.

* bindings/js/JSDOMGlobalObjectTask.cpp:
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::runTask):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-04-08  Geoffrey Garen  <ggaren@apple.com>

        Removed an unused file.

        Unreviewed.

        * bmalloc/AsyncTask.cpp: Removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Repatch should support setters and plant calls to them directly
https://bugs.webkit.org/show_bug.cgi?id=130750

Source/JavaScriptCore: 

Reviewed by Geoffrey Garen.
        
All of the infrastructure was in place so this just enables setter optimization.
        
This is a 12x speed-up on setter microbenchmarks. This is a 1% speed-up on Octane.

* bytecode/PolymorphicPutByIdList.cpp:
(JSC::PutByIdAccess::visitWeak):
* bytecode/PolymorphicPutByIdList.h:
(JSC::PutByIdAccess::setter):
(JSC::PutByIdAccess::customSetter): Deleted.
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeForStubInfo):
* jit/Repatch.cpp:
(JSC::toString):
(JSC::kindFor):
(JSC::customFor):
(JSC::generateByIdStub):
(JSC::tryCachePutByID):
(JSC::tryBuildPutByIdList):
* runtime/JSObject.cpp:
(JSC::JSObject::put):
* runtime/Lookup.h:
(JSC::putEntry):
* runtime/PutPropertySlot.h:
(JSC::PutPropertySlot::setCacheableSetter):
(JSC::PutPropertySlot::isCacheableSetter):
(JSC::PutPropertySlot::isCacheableCustom):
(JSC::PutPropertySlot::setCacheableCustomProperty): Deleted.
(JSC::PutPropertySlot::isCacheableCustomProperty): Deleted.
* tests/stress/setter.js: Added.
(foo):

LayoutTests: 

Reviewed by Geoffrey Garen.

* js/regress/script-tests/setter.js: Added.
* js/regress/setter-expected.txt: Added.
* js/regress/setter.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FlagsChanged events are not delivered to input methods when using async text input
https://bugs.webkit.org/show_bug.cgi?id=131383

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm: (-[WKView _interpretKeyEvent:completionHandler:]):
The early return is no longer needed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166946 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build bmalloc on iOS too
https://bugs.webkit.org/show_bug.cgi?id=131381

Reviewed by Andreas Kling.

.: 

* Source/Makefile: Build it.

Tools: 

* Scripts/build-webkit:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166947 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fail silently if the LLVM dylib isn't found
https://bugs.webkit.org/show_bug.cgi?id=131385

Reviewed by Mark Hahnenberg.

* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* llvm/InitializeLLVM.cpp:
(JSC::initializeLLVM):
* llvm/InitializeLLVM.h:
* llvm/InitializeLLVMPOSIX.cpp:
(JSC::initializeLLVMPOSIX):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Unreviewed GTK gardening.

Update text expectations for failing tests:
  accessibility/children-changed-sends-notification.html
  accessibility/notification-listeners.html
  fast/repaint/blend-mode-isolate-stacking-context.html
  fast/repaint/hidpi-absolute-positioned-element-wrong-cliprect-after-move.html

Rebaseline fast/multicol/client-rects-expected.txt after r165991

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

* platform/gtk/TestExpectations:
* platform/gtk/fast/multicol/client-rects-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Added bmalloc to the WebKit workspace.
https://bugs.webkit.org/show_bug.cgi?id=131362

Reviewed by Geoff Garen.

* WebKit.xcworkspace/contents.xcworkspacedata:
* WebKit.xcworkspace/xcshareddata/xcschemes/All Source (target WebProcess).xcscheme:
* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166950 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed iOS build fix. Pass 0 instead of nil to setRate: when pausing.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166951 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix a goofy assertion to fix debug.

* bytecode/PolymorphicPutByIdList.h:
(JSC::PutByIdAccess::isSetter):
(JSC::PutByIdAccess::oldStructure):
(JSC::PutByIdAccess::chain):
(JSC::PutByIdAccess::stubRoutine):
(JSC::PutByIdAccess::customSetter):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166952 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Always do a full GC when simulating memory pressure.
<https://webkit.org/b/129790>

To get more consistent accounting on automated memory testers,
add a synchronous GC as part of the simulated memory pressure event.

Reviewed by Geoffrey Garen.

* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::install):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
XPC services launched by Safari have wrong DYLD_FRAMEWORK_PATH set when launched via run-safari / debug-safari
<https://webkit.org/b/131388> / <rdar://problem/16291687>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitdirs.pm:
(runMacWebKitApp): Set __XPC_DYLD_FRAMEWORK_PATH to the absolute path to the built products directory.
(execMacWebKitAppForDebugging): Ditto.

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