[iOS] Upstream WebCore/dom changes
https://bugs.webkit.org/show_bug.cgi?id=125646

Reviewed by David Kilzer.

* WebCore.exp.in: Added symbol __ZN7WebCore8Settings17setLayoutIntervalEi and removed symbol
__ZN7WebCore24cLayoutScheduleThresholdE.
* dom/ActiveDOMObject.h: Add suspension reason DocumentWillBePaused.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument): Opt-out of ENABLE(VIDEO) logic when
building for iOS.
* dom/DeviceMotionClient.h: Made class non-copyable.
(WebCore::DeviceMotionClient::DeviceMotionClient): Added;
* dom/DeviceMotionController.cpp: Added FIXME comment to reconcile iOS and OpenSource differences.
(WebCore::DeviceMotionController::suspendUpdates): Added; guarded by PLATFORM(IOS).
(WebCore::DeviceMotionController::resumeUpdates): Added; guarded by PLATFORM(IOS).
* dom/DeviceMotionController.h: Added FIXME comment to reconcile iOS and OpenSource differences.
* dom/DeviceOrientationClient.h: Made class non-copyable.
(WebCore::DeviceOrientationClient::DeviceOrientationClient): Added.
* dom/DeviceOrientationController.cpp: Added FIXME comment to reconcile iOS and OpenSource differences.
(WebCore::DeviceOrientationController::DeviceOrientationController):
(WebCore::DeviceOrientationController::suspendUpdates): Added; guarded by PLATFORM(IOS).
(WebCore::DeviceOrientationController::resumeUpdates): Added; guarded by PLATFORM(IOS).
* dom/DeviceOrientationController.h: Added FIXME comment to reconcile iOS and OpenSource differences.
* dom/DeviceOrientationData.cpp:
(WebCore::DeviceOrientationData::create): Added; iOS-specific. Added FIXME comment.
(WebCore::DeviceOrientationData::DeviceOrientationData): Added iOS-specific code.
(WebCore::DeviceOrientationData::compassHeading): Added; guarded by PLATFORM(IOS).
(WebCore::DeviceOrientationData::compassAccuracy): Added; guarded by PLATFORM(IOS).
(WebCore::DeviceOrientationData::canProvideCompassHeading): Added; guarded by PLATFORM(IOS).
(WebCore::DeviceOrientationData::canProvideCompassAccuracy): Added; guarded by PLATFORM(IOS).
* dom/DeviceOrientationData.h:
* dom/DeviceOrientationEvent.idl: Added iOS-specific code.
* dom/Document.cpp: Moved constant cLayoutScheduleThreshold to Settings.cpp and renamed it
layoutScheduleThreshold towards allowing a port to configure the layout interval.
(WebCore::Document::Document): Added optional argument isSynthesized, defaults false.
(WebCore::Document::~Document): Added iOS-specific code to destroy the device motion
and device orientation controllers.
(WebCore::Document::didBecomeCurrentDocumentInFrame): Added iOS-specific code with FIXME comment.
(WebCore::Document::prepareForDestruction): Added iOS-specific touch event code.
(WebCore::Document::removeAllEventListeners): Ditto.
(WebCore::Document::platformSuspendOrStopActiveDOMObjects): Added; compiles to an empty function on
non-iOS port.
(WebCore::Document::suspendActiveDOMObjects): Modified to call platformSuspendOrStopActiveDOMObjects().
(WebCore::Document::resumeActiveDOMObjects): Ditto.
(WebCore::Document::stopActiveDOMObjects): Added.
(WebCore::Document::implicitClose): Modified to query Settings::layoutInterval().
(WebCore::Document::minimumLayoutDelay): Ditto.
(WebCore::Document::processViewport): Added iOS-specific code.
(WebCore::Document::updateViewportArguments): Ditto.
(WebCore::setParserFeature): Added; guarded by PLATFORM(IOS).
(WebCore::Document::processFormatDetection): Added; guarded by PLATFORM(IOS).
(WebCore::Document::processWebAppOrientations): Added; guarded by PLATFORM(IOS).
(WebCore::Document::isTelephoneNumberParsingEnabled): Added; guarded by PLATFORM(IOS).
(WebCore::Document::setIsTelephoneNumberParsingAllowed): Added; guarded by PLATFORM(IOS).
(WebCore::Document::isTelephoneNumberParsingAllowed): Added; guarded by PLATFORM(IOS).
(WebCore::Document::initSecurityContext): Added iOS-specific code.
(WebCore::Document::suspendScheduledTasks): Added; guarded by PLATFORM(IOS).
(WebCore::Document::deviceMotionController): Added; iOS-specific.
(WebCore::Document::deviceOrientationController): Added; iOS-specific.
(WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale): Added iOS-specific code.
(WebCore::Document::adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale): Added iOS-specific code.
* dom/Document.h: Register gesture events gesture{change, end, start}; guarded by ENABLE(IOS_GESTURE_EVENTS).
(WebCore::Document::isSynthesized): Added.
(WebCore::Document::platformSuspendOrStopActiveDOMObjects): Added.
* dom/Document.idl:
* dom/DocumentMarker.h: Added iOS-specific changes. We should look to reconcile the differences between
iOS and OpenSource. See <rdar://problem/11306422>.
(WebCore::DocumentMarker::AllMarkers::AllMarkers):
(WebCore::DocumentMarker::DocumentMarker): Added; iOS-specific.
(WebCore::DocumentMarker::alternatives): Added; iOS-specific.
(WebCore::DocumentMarker::setAlternative): Added; iOS-specific.
(WebCore::DocumentMarker::metadata): Added; iOS-specific.
(WebCore::DocumentMarker::setMetadata): Added; iOS-specific.
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addMarker):
(WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker):
(WebCore::DocumentMarkerController::addDictationResultMarker):
(WebCore::DocumentMarkerController::shiftMarkers):
* dom/DocumentMarkerController.h:
* dom/Element.cpp:
(WebCore::Element::focus): Add iOS-specific workaround for <rdar://problem/6699741>.
* dom/Element.h: Register gesture events gesture{change, end, start}; guarded by ENABLE(IOS_GESTURE_EVENTS).
* dom/EventContext.cpp: Opt-out of ENABLE(TOUCH_EVENTS)-guarded code when building the iOS port.
* dom/EventContext.h: Ditto.
* dom/EventDispatcher.cpp:
(WebCore::EventRelatedNodeResolver::EventRelatedNodeResolver): Ditto.
(WebCore::EventDispatcher::dispatchEvent): Ditto.
(WebCore::EventPath::EventPath): Ditto.
* dom/EventNames.h: Added events webkit{currentplaybacktargetiswirelesschanged, playbacktargetavailabilitychanged}
and gesture{change, end, start}.
* dom/EventNames.in: Added event names GestureEvent and WebKitPlaybackTargetAvailabilityEvent conditioned on
the macro defines ENABLE_IOS_GESTURE_EVENTS and ENABLE_IOS_AIRPLAY.
* dom/MouseRelatedEvent.cpp:
(WebCore::contentsScrollOffset): Added iOS-specific code.
(WebCore::MouseRelatedEvent::MouseRelatedEvent): Ditto.
* dom/Node.cpp:
(WebCore::Node::willBeDeletedFrom): Ditto.
(WebCore::Node::isDescendantOf): Fixed style issue in function prototype; moved '*' to the left side.
(WebCore::Node::isDescendantOrShadowDescendantOf): Added.
(WebCore::tryAddEventListener): Added iOS-specific code; also added FIXME comment.
(WebCore::tryRemoveEventListener): Ditto.
(WebCore::Node::dispatchEvent): Opt-out of ENABLE(TOUCH_EVENTS)-guarded code when building the iOS port.
(WebCore::Node::defaultEventHandler): Added iOS-specific code.
(WebCore::Node::willRespondToMouseMoveEvents): Added iOS-specific code; also added FIXME comment.
(WebCore::Node::willRespondToMouseClickEvents): Added iOS-specific code; also added FIXME comment.
(WebCore::Node::willRespondToMouseWheelEvents): Added.
* dom/Node.h:
* dom/Position.h:
(WebCore::operator<): Added.
(WebCore::operator>): Added.
(WebCore::operator>=): Added.
(WebCore::operator<=): Added.
* dom/Range.cpp:
(WebCore::Range::create): Added iOS-specific code; also added FIXME comment.
(WebCore::intervalsSufficientlyOverlap): Added; guarded by PLATFORM(IOS).
(WebCore::printRects): Added; guarded by PLATFORM(IOS).
(WebCore::adjustLineHeightOfSelectionRects): Added; guarded by PLATFORM(IOS).
(WebCore::coalesceSelectionRects): Added; guarded by PLATFORM(IOS).
(WebCore::Range::collectSelectionRects): Added; guarded by PLATFORM(IOS).
* dom/Range.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects): Added iOS-specific code.
(WebCore::ScriptExecutionContext::dispatchErrorEvent): Ditto.
* dom/TreeScope.cpp:
(WebCore::nodeFromPoint): Ditto.
* dom/ViewportArguments.cpp:
(WebCore::computeViewportAttributes): Ditto.
(WebCore::setViewportFeature): Added iOS-specific code.
(WebCore::finalizeViewportArguments): Added; iOS-specific.
* dom/ViewportArguments.h:
* dom/make_names.pl: Added support to find the path to gcc with respect to the environment
variable SDKROOT.
* html/HTMLMediaElement.cpp:
(HTMLMediaElement::suspend):
* page/Settings.cpp:
(WebCore::Settings::Settings): Initialize setting m_layoutInterval to layoutScheduleThreshold.
(WebCore::Settings::setLayoutInterval): Added.
* page/Settings.h:
(WebCore::Settings::layoutInterval): Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add some missing functions to MacroAssembler
https://bugs.webkit.org/show_bug.cgi?id=125809

Reviewed by Oliver Hunt.

* assembler/AbstractMacroAssembler.h:
* assembler/AssemblerBuffer.h:
* assembler/LinkBuffer.cpp:
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::storePtr):
(JSC::MacroAssembler::andPtr):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::and64):
(JSC::MacroAssemblerARM64::branchTest8):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::branchTest8):
* assembler/X86Assembler.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][iOS] WKView sends unscaled scroll position to WKContentView
https://bugs.webkit.org/show_bug.cgi?id=125819

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-12-16
Reviewed by Anders Carlsson.

WKView was sending untransformed scroll coordinates to WKContentView. The scroll position
seen by WebKit was wrong when the content is scaled.

* UIProcess/API/ios/WKView.mm:
(-[WKView _didScroll]):
(-[WKView scrollViewDidEndDragging:willDecelerate:]):
(-[WKView scrollViewDidEndDecelerating:]):
(-[WKView scrollViewDidScrollToTop:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Use JSC::SourceID and JSC::BreakpointID instead of WebCore dups
https://bugs.webkit.org/show_bug.cgi?id=125818

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-12-16
Reviewed by Mark Lam.

Remove the WebCore typedefs of JSC types. Prefer JSC namespace
prefixed types throughout WebCore's Inspector code.

* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/BreakpointID.h: Removed.
* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::setBreakpoint):
(WebCore::ScriptDebugServer::removeBreakpoint):
(WebCore::ScriptDebugServer::dispatchDidParseSource):
* bindings/js/ScriptDebugServer.h:
* bindings/js/SourceID.h: Removed.
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
(WebCore::parseLocation):
(WebCore::InspectorDebuggerAgent::setBreakpoint):
(WebCore::InspectorDebuggerAgent::continueToLocation):
(WebCore::InspectorDebuggerAgent::resolveBreakpoint):
(WebCore::InspectorDebuggerAgent::searchInContent):
(WebCore::InspectorDebuggerAgent::getScriptSource):
(WebCore::InspectorDebuggerAgent::didParseSource):
(WebCore::InspectorDebuggerAgent::didPause):
(WebCore::InspectorDebuggerAgent::clear):
* inspector/InspectorDebuggerAgent.h:
* inspector/ScriptDebugListener.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix some whitespace issues in inspector code
https://bugs.webkit.org/show_bug.cgi?id=125814

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-12-16
Reviewed by Darin Adler.

Source/JavaScriptCore:

* inspector/protocol/Debugger.json:
* inspector/protocol/Runtime.json:
* inspector/scripts/CodeGeneratorInspector.py:
(Generator.process_command):

Source/WebCore:

* inspector/protocol/DOM.json:
* inspector/protocol/DOMStorage.json:
* inspector/protocol/Timeline.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fix GTK+ build after r160653.

Renamed WebData to API::Data

* GNUmakefile.list.am: Added APIData.cpp and APIData.h
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestReadCallback):
* UIProcess/API/gtk/WebKitWebResource.cpp:
* UIProcess/API/gtk/WebKitWebView.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit2 View Gestures: Pinching beyond the extremes doesn't animate back to the min/max
https://bugs.webkit.org/show_bug.cgi?id=125750

Reviewed by Simon Fraser.

When you let go of a pinch where you exceeded the maximum or minimum scale,
the view should animate back to the limit instead of snapping back.

* UIProcess/mac/ViewGestureController.cpp:
(WebKit::ViewGestureController::endMagnificationGesture):
Unscrolling the scaled origin here is wrong; we should send the same
value for 'origin' for commitTransientZoom that we do for adjustTransientZoom.
The drawing area can deal with transforming that however it needs to call scalePage().

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::beginTransientZoom):
Drive-by use WebPage::mainFrameView().

(WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
Update the shadow layer's bounds, position, and shadow path while zooming,
instead of hiding it.

(WebKit::transientZoomSnapAnimationForKeyPath):
Create a CABasicAnimation that stays applied to its target when it finishes,
lasts for a quarter second, and uses the ease-in-ease-out timing function.

(WebKit::constrainZoomOriginForFrameView):
When we land a transient zoom, there may be overhang areas (linen, in the case of Mac)
visible. During the commit animation, we should move the RenderView layer appropriately
so that the page covers the entire view and there are no overhang areas visible.
Adapt some code from ScrollableArea to constrain the zoom origin to do so.

(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
Animate the RenderView layer's transform, and the shadow layer's bounds, position, and path.
When they complete, apply the zoom via scalePage() and flush the layer tree (otherwise there
can be a flash between removing the animations and the next flush with the new scale).

(WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
Move the code to land the transient zoom (via scalePage) and to put the shadow back
in the state WebCore left it out into its own function, so it can be called both from the
animation completion callback and from the short-circuit in the case where we don't need to animate.

* WebCore.exp.in:
Export a few things so WebKit2 can use them.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit2 View Gestures: Pinching beyond the extremes doesn't animate back to the min/max
https://bugs.webkit.org/show_bug.cgi?id=125750

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
Remove some accidentally included commented out code.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove EnumClass.h from WTF
https://bugs.webkit.org/show_bug.cgi?id=125820

Reviewed by Darin Adler.

Source/WebCore:

Replace uses of ENUM_CLASS with real enum class declarations.

* Modules/webdatabase/DatabaseBasicTypes.h:
* Modules/webdatabase/DatabaseError.h:
* Modules/webdatabase/SQLTransactionState.h:
* bindings/js/JSSubtleCryptoCustom.cpp:
* bindings/js/SerializedScriptValue.cpp:
* crypto/CryptoAlgorithmIdentifier.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/CryptoKey.h:
* crypto/CryptoKeyData.h:
* crypto/CryptoKeyType.h:
* crypto/keys/CryptoKeyDataRSAComponents.h:
* inspector/InspectorTimelineAgent.h:

Source/WTF:

All compilers we build on now support real strongly typed enums, so we can remove the ENUM_CLASS version.

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/CheckedArithmetic.h:
* wtf/EnumClass.h: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid indirect function calls for custom getters
https://bugs.webkit.org/show_bug.cgi?id=125821

Reviewed by Mark Hahnenberg.

Rather than invoking a helper function to perform an indirect call
through a function pointer, just have the JIT call the function directly.

Unfortunately this only works in JSVALUE64 at the moment as there
is not an obvious way to pass two EncodedJSValues uniformly over
the various effected JITs.

* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArguments):
* jit/Repatch.cpp:
(JSC::generateProtoChainAccessStub):
(JSC::tryBuildGetByIDList):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add my Samsung email address.

Unreviewed.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Revert a mysterious and inexplicable part of http://trac.webkit.org/changeset/160685

* platform/KeyedCoding.h:
(WebCore::KeyedEncoder::encodeEnum):
(WebCore::KeyedEncoder::encodeObject):
(WebCore::KeyedEncoder::encodeConditionalObject):
(WebCore::KeyedEncoder::encodeObjects):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Unreviewed build fix for 64-bit.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
Corrected 64-bit linker symbols.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Remove unused contentAnchor SPI from WKView
https://bugs.webkit.org/show_bug.cgi?id=125826

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView setFrameSize:]):
(-[WKView _setDrawingAreaSize:]):
(-[WKView _setAcceleratedCompositingModeRootLayer:]):
(-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):


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