Add SPI for allowing HTTPS certificates
https://bugs.webkit.org/show_bug.cgi?id=129002

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKProcessClass.mm:
(-[WKProcessClass _setAllowsSpecificHTTPSCertificate:forHost:]):
* UIProcess/API/Cocoa/WKProcessClassInternal.h:
* UIProcess/API/Cocoa/WKProcessClassPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassInternal.h.
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL unwind parsing should handle ARM64
https://bugs.webkit.org/show_bug.cgi?id=128984

Reviewed by Oliver Hunt.
        
This makes unwind parsing handle ARM64 and it makes all clients of unwind info capable of
dealing with that architecture.
        
The big difference is that ARM64 has callee-save double registers. This is conceptually easy
to handle, but out code for dealing with callee-saves spoke of "GPRReg". We've been in this
situation before: code that needs to deal with either a GPRReg or a FPRReg. In the past we'd
hacked around the problem, but this time I decided to do a full frontal assault. This patch
adds a Reg class, which is a box for either GPRReg or FPRReg along with tools for iterating
over all possible registers. Then, I threaded this through SaveRestore, RegisterSet,
RegisterAtOffset, and UnwindInfo. With the help of Reg, it was easy to refactor the code to
handle FPRs in addition to GPRs.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* ftl/FTLRegisterAtOffset.cpp:
(JSC::FTL::RegisterAtOffset::dump):
* ftl/FTLRegisterAtOffset.h:
(JSC::FTL::RegisterAtOffset::RegisterAtOffset):
(JSC::FTL::RegisterAtOffset::operator!):
(JSC::FTL::RegisterAtOffset::reg):
(JSC::FTL::RegisterAtOffset::operator==):
(JSC::FTL::RegisterAtOffset::operator<):
(JSC::FTL::RegisterAtOffset::getReg):
* ftl/FTLSaveRestore.cpp:
(JSC::FTL::offsetOfReg):
* ftl/FTLSaveRestore.h:
* ftl/FTLUnwindInfo.cpp:
(JSC::FTL::UnwindInfo::parse):
(JSC::FTL::UnwindInfo::find):
(JSC::FTL::UnwindInfo::indexOf):
* ftl/FTLUnwindInfo.h:
* jit/Reg.cpp: Added.
(JSC::Reg::dump):
* jit/Reg.h: Added.
(JSC::Reg::Reg):
(JSC::Reg::fromIndex):
(JSC::Reg::first):
(JSC::Reg::last):
(JSC::Reg::next):
(JSC::Reg::index):
(JSC::Reg::isSet):
(JSC::Reg::operator!):
(JSC::Reg::isGPR):
(JSC::Reg::isFPR):
(JSC::Reg::gpr):
(JSC::Reg::fpr):
(JSC::Reg::operator==):
(JSC::Reg::operator!=):
(JSC::Reg::operator<):
(JSC::Reg::operator>):
(JSC::Reg::operator<=):
(JSC::Reg::operator>=):
(JSC::Reg::hash):
(JSC::Reg::invalid):
* jit/RegisterSet.h:
(JSC::RegisterSet::set):
(JSC::RegisterSet::clear):
(JSC::RegisterSet::get):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add -[WKWebView reload]
https://bugs.webkit.org/show_bug.cgi?id=129005

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView reload]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make reload SPI for now
https://bugs.webkit.org/show_bug.cgi?id=129007

Reviewed by Simon Fraser.

* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _reload]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TextFieldInputType::handleBeforeTextInsertedEvent shouldn't use plainText
https://bugs.webkit.org/show_bug.cgi?id=128953

Reviewed by Alexey Proskuryakov.

Don't use FrameSelection's toNormalizedRange and plainText. Instead, use the cached selection start and selection
end to extract the selected text. The caches are updated inside FrameSelection::setSelection whenever selection
is inside a text form control via HTMLTextFormControlElement::selectionChanged.

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add more new SPI methods
https://bugs.webkit.org/show_bug.cgi?id=129009

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _certificateChain]):
(-[WKWebView _committedURL]):
(-[WKWebView _applicationNameForUserAgent]):
(-[WKWebView _setApplicationNameForUserAgent:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164330 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Commit the code change supposed to happen in r164320.

* editing/Editor.cpp:
(WebCore::Editor::setIgnoreCompositionSelectionChange):
(WebCore::Editor::respondToChangedSelection):
* editing/Editor.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: AX: more properties: exists, required, and invalid (exists was previously combined with ignored)
https://bugs.webkit.org/show_bug.cgi?id=128504

Patch by James Craig <jcraig@apple.com> on 2014-02-18
Reviewed by Timothy Hatcher.

Source/WebCore:

Additions to the accessibility node inspector: exists, required, invalid.

Test: inspector-protocol/dom/getAccessibilityPropertiesForNode.html

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* inspector/protocol/DOM.json:

Source/WebInspectorUI:

Additions to the accessibility node inspector: exists, required, invalid.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/DOMNode.js:
* UserInterface/DOMNodeDetailsSidebarPanel.js:

LayoutTests:

New files test the inspector protocol for DOM.getAccessibilityPropertiesForNode

* inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt: Added.
* inspector-protocol/dom/getAccessibilityPropertiesForNode.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164332 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should build on ARM64
https://bugs.webkit.org/show_bug.cgi?id=129010

Reviewed by Sam Weinig.
        
* disassembler/X86Disassembler.cpp: Just because we have the LLVM disassembler doesn't mean we're on X86.
* ftl/FTLLocation.cpp: DWARF parsing for ARM64 is super easy.
(JSC::FTL::Location::isGPR):
(JSC::FTL::Location::gpr):
(JSC::FTL::Location::isFPR):
(JSC::FTL::Location::fpr):
(JSC::FTL::Location::restoreInto): This function wasn't even X86-specific to begin with so move it out of the #if stuff.
* ftl/FTLUnwindInfo.cpp: They're called q not d.
(JSC::FTL::UnwindInfo::parse):
* jit/GPRInfo.h:
(JSC::GPRInfo::toArgumentRegister): Add this method; we alraedy had it on X86.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add more SPI methods to WKWebView
https://bugs.webkit.org/show_bug.cgi?id=129011

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _webProcessIdentifier]):
(-[WKWebView _sessionState]):
(releaseNSData):
(-[WKWebView _restoreFromSessionState:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add SPI for enabling/disabling private browsing
https://bugs.webkit.org/show_bug.cgi?id=129012

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _privateBrowsingEnabled]):
(-[WKWebView _setPrivateBrowsingEnabled:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164335 268f45cc-cd09-0410-ab3c-d52691b4dbfc
border-box clip-paths jump around when outline changes
https://bugs.webkit.org/show_bug.cgi?id=128929

Source/WebCore:

Reviewed by Dirk Schulze.

computeReferenceBox() for clip paths was using "rootRelativeBounds"
to position the border-box. This bounds is an enclosing bounds for
the layer and its descendants, including outlines and absolute descendants,
so it is not the correct box to use to offset the border-box.

The caller has offsetFromRoot(), which is the correct thing to use,
so use it.

Test: css3/masking/clip-path-root-relative-bounds.html

* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
(WebCore::RenderLayer::setupClipPath):

LayoutTests:

Reviewed by Dirk Schulze.

Test comparing a border-box clip path with and without an outline.

* css3/masking/clip-path-root-relative-bounds-expected.html: Added.
* css3/masking/clip-path-root-relative-bounds.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a way to efficiently thumbnail WKViews
https://bugs.webkit.org/show_bug.cgi?id=128831
<rdar://problem/15669655>

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKThumbnailView.h: Added.
* UIProcess/API/Cocoa/WKThumbnailView.mm: Added.
(-[WKThumbnailView initWithFrame:fromWKView:]):
(-[WKThumbnailView _viewWasUnparented]):
(-[WKThumbnailView _viewWasParented]):
(-[WKThumbnailView viewDidMoveToWindow]):
(-[WKThumbnailView setScale:]):
(-[WKThumbnailView setThumbnailLayer:]):
(-[WKThumbnailView thumbnailLayer]):
* UIProcess/API/Cocoa/WKThumbnailViewInternal.h: Added.
Add WKThumbnailView.
Clients of this private API will call initWithFrame:fromWKView:,
giving the WKView they wish to borrow contents from.
They can also call setScale: to set the scale that will be used to render
the content in an implementation-defined set of cases (currently, we will
use the low resolution scale for WKViews which were not parented when the
WKThumbnailView was created; parented WKViews will use the existing scale).

* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::isViewWindowActive):
(WebKit::PageClientImpl::isViewVisible):
(WebKit::PageClientImpl::isViewVisibleOrOccluded):
(WebKit::PageClientImpl::isViewInWindow):
(WebKit::PageClientImpl::viewLayerHostingMode):
If the WKView has an actively-parented WKThumbnailView attached to it,
we should determine view visibility/etc. using that view instead of the WKView.

* UIProcess/API/mac/WKView.mm:
(-[WKView dealloc]):
WKThumbnailView holds on to the WKView, and clears WKView's backpointer
when it leaves the window, so we should never see WKView get deallocated
with a live thumbnail view.

(-[WKView scrollWheel:]):
(-[WKView mouseMoved:]):
(-[WKView mouseDown:]):
(-[WKView mouseUp:]):
(-[WKView mouseDragged:]):
Don't handle events while thumbnailed.

(-[WKView _setAcceleratedCompositingModeRootLayer:]):
Forward root layer changes to the installed thumbnail view.

(-[WKView _acceleratedCompositingModeRootLayer]):
_acceleratedCompositingModeRootLayer should return the same layer
that was set via _setAcceleratedCompositingModeRootLayer:, not its parent.

(-[WKView _setThumbnailView:]):
(-[WKView _thumbnailView]):
Install/uninstall a WKThumbnailView. Hand it our root layer if installing,
or recover it from the departing thumbnail view if uninstalling.

* UIProcess/API/mac/WKViewInternal.h:
Add in a missing RetainPtr.h include that I missed earlier and causes trouble.
Add WKView _thumbnailView and _setThumbnailView:.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setThumbnailScale):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::mayStartMediaWhenInWindow):

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::handleSwipeGesture):
Swipe was accidentally depending on a mistake in WKView's
_acceleratedCompositingModeRootLayer where it was returning the wrong layer.
The actual root layer doesn't have a size, so we should use the drawing
area's size instead.

* WebKit2.xcodeproj/project.pbxproj:
Add some new files.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
If we reset the page scale because a load was committed, we should
reset the stored thumbnail-scale-less page scale so that we don't restore
the wrong scale when leaving thumbnailing.

(WebKit::WebPage::WebPage):
(WebKit::WebPage::setThumbnailScale):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Apply the thumbnail scale to the page. If we're currently not in
thumbnail scaling mode, save the current page scale and scroll position
so we can restore them once we leave thumbnail mode again.
Transform the DrawingArea so that the page appears at the same
position and size, but scaled.

* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::setTransform):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::setTransform):
Add a DrawingArea method to apply an arbitrary transform to the drawing area.

(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
(WebKit::TiledCoreAnimationDrawingArea::setPageOverlayNeedsDisplay):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::suspendPainting):
(WebKit::TiledCoreAnimationDrawingArea::resumePainting):
(WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
(WebKit::TiledCoreAnimationDrawingArea::updateLayerHostingContext):
(WebKit::TiledCoreAnimationDrawingArea::createPageOverlayLayer):
(WebKit::TiledCoreAnimationDrawingArea::didCommitChangesForLayer):
(WebKit::TiledCoreAnimationDrawingArea::updateDebugInfoLayer):
(WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
Remove the word "compositing" in a bunch of places where it isn't needed.
Rename m_rootLayer to m_hostingLayer, and repurpose m_rootLayer to store
the root compositing layer actually passed in via setRootCompositingLayer.
Rename m_pendingRootCompositingLayer to m_pendingRootLayer.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32-bit build fix after r164337

* UIProcess/API/Cocoa/WKThumbnailView.mm:
Address a review comment. We'll get this for free.

* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::activeView):
Build fix.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164338 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Windows test gardening.

* platform/win/TestExpectations: Re-enable the many tests that actually pass on Windows. Mark tests
using current syntax so we can see when tests start passing. Identify a few flaky tests.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164339 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove UIWKRemoteView
https://bugs.webkit.org/show_bug.cgi?id=129015

Source/WebCore:

Reviewed by Dan Bernstein.

The project referenced a maketokenizer script that disappeared
long ago.

* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

Reviewed by Dan Bernstein.

Remove UIWKRemoteView which is unused.

* Configurations/WebKit2.xcconfig:
* UIProcess/API/ios/UIWKRemoteView.h: Removed.
* UIProcess/API/ios/UIWKRemoteView.mm: Removed.
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More WK_API_ENABLED after r164337.

* UIProcess/API/mac/WKView.mm:
(-[WKView dealloc]):
(-[WKView scrollWheel:]):
(-[WKView mouseMoved:]):
(-[WKView mouseDown:]):
(-[WKView mouseUp:]):
(-[WKView mouseDragged:]):
(-[WKView _setAcceleratedCompositingModeRootLayer:]):
* UIProcess/API/mac/WKViewInternal.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't build WKThumbnailView on iOS; it won't build.

* Configurations/WebKit2.xcconfig:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Can't use #if inside a macro, so we'll duplicate the macro for now.

Build fix for all of Mac.

* UIProcess/API/mac/WKView.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164343 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More more WK_API_ENABLED after r164337.

* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::activeView):


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