<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[161638] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/161638">161638</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2014-01-10 09:06:52 -0800 (Fri, 10 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] Upstream WebCore and Tools miscellaneous changes
https://bugs.webkit.org/show_bug.cgi?id=126698

Reviewed by David Kilzer.

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
* Configurations/iOS.xcconfig: Added.
* DerivedSources.make:
* English.lproj/Localizable.strings:
* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp: Copied from Source/WebCore/editing/TextAffinity.h.
(WebCore::stringForPlaybackTargetAvailability):
(WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h: Added.
(WebCore::WebKitPlaybackTargetAvailabilityEventInit::WebKitPlaybackTargetAvailabilityEventInit):
(WebCore::WebKitPlaybackTargetAvailabilityEvent::~WebKitPlaybackTargetAvailabilityEvent):
(WebCore::WebKitPlaybackTargetAvailabilityEvent::create):
(WebCore::WebKitPlaybackTargetAvailabilityEvent::availability):
* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl: Copied from Source/WebCore/editing/DeleteButton.h.
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::Geolocation):
(WebCore::Geolocation::canSuspend):
(WebCore::Geolocation::suspend):
(WebCore::Geolocation::resume):
(WebCore::Geolocation::resumeTimerFired):
(WebCore::Geolocation::resetAllGeolocationPermission):
(WebCore::Geolocation::stop):
(WebCore::Geolocation::setIsAllowed):
(WebCore::Geolocation::positionChanged):
(WebCore::Geolocation::setError):
* Modules/geolocation/Geolocation.h:
* Modules/geolocation/NavigatorGeolocation.cpp:
(WebCore::NavigatorGeolocation::resetAllGeolocationPermission):
* Modules/geolocation/NavigatorGeolocation.h:
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::SpeechSynthesis):
(WebCore::SpeechSynthesis::speak):
* Modules/speech/SpeechSynthesis.h:
(WebCore::SpeechSynthesis::userGestureRequiredForSpeechStart):
(WebCore::SpeechSynthesis::removeBehaviorRestriction):
* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/AudioScheduledSourceNode.cpp:
* Modules/webdatabase/Database.cpp:
* Modules/webdatabase/DatabaseBackendBase.cpp:
(WebCore::DatabaseBackendBase::performOpenAndVerify):
(WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::DatabaseContext):
(WebCore::DatabaseContext::databaseThread):
(WebCore::DatabaseContext::setPaused):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManagerClient.h:
* Modules/webdatabase/DatabaseTask.cpp:
(WebCore::DatabaseTask::performTask):
(WebCore::Database::DatabaseTransactionTask::shouldPerformWhilePaused):
* Modules/webdatabase/DatabaseTask.h:
* Modules/webdatabase/DatabaseThread.cpp:
(WebCore::DatabaseThread::DatabaseThread):
(WebCore::DatabaseThread::requestTermination):
(WebCore::DatabaseUnpauseTask::create):
(WebCore::DatabaseUnpauseTask::shouldPerformWhilePaused):
(WebCore::DatabaseUnpauseTask::DatabaseUnpauseTask):
(WebCore::DatabaseUnpauseTask::doPerformTask):
(WebCore::DatabaseUnpauseTask::debugTaskName):
(WebCore::DatabaseThread::setPaused):
(WebCore::DatabaseThread::handlePausedQueue):
(WebCore::DatabaseThread::databaseThread):
* Modules/webdatabase/DatabaseThread.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::setQuota):
(WebCore::DatabaseTracker::deleteOrigin):
(WebCore::DatabaseTracker::deleteDatabase):
(WebCore::DatabaseTracker::deleteDatabaseFile):
(WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
(WebCore::isZeroByteFile):
(WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
(WebCore::DatabaseTracker::openDatabaseMutex):
(WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled):
(WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish):
(WebCore::DatabaseTracker::setDatabasesPaused):
* Modules/webdatabase/DatabaseTracker.h:
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::shouldPerformWhilePaused):
* Modules/webdatabase/SQLTransactionBackend.h:
* Resources/DictationPhraseWithAlternativesDot.png: Added.
* Resources/DictationPhraseWithAlternativesDot@2x.png: Added.
* Resources/SpellingDot.png: Added.
* Resources/SpellingDot@2x.png: Added.
* Resources/decrementArrow.tiff: Added.
* Resources/hScrollControl_left.png: Added.
* Resources/hScrollControl_middle.png: Added.
* Resources/hScrollControl_right.png: Added.
* Resources/incrementArrow.tiff: Added.
* Resources/markedLeft.png: Added.
* Resources/markedMiddle.png: Added.
* Resources/markedRight.png: Added.
* Resources/vScrollControl_bottom.png: Added.
* Resources/vScrollControl_middle.png: Added.
* Resources/vScrollControl_top.png: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/GCController.cpp:
(WebCore::GCController::garbageCollectNow):
(WebCore::GCController::releaseExecutableMemory):
* bindings/js/GCController.h:
* bindings/js/JSCallbackData.h:
(WebCore::JSCallbackData::~JSCallbackData):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::supportsProfiling):
(WebCore::JSDOMWindowBase::shouldInterruptScriptBeforeTimeout):
(WebCore::JSDOMWindowBase::commonVM):
(WebCore::JSDOMWindowBase::commonVMExists):
(WebCore::JSDOMWindowBase::commonVMInternal):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::touch):
(WebCore::JSDOMWindow::touchList):
* bindings/js/JSDeviceOrientationEventCustom.cpp:
(WebCore::JSDeviceOrientationEvent::webkitCompassHeading):
(WebCore::JSDeviceOrientationEvent::webkitCompassAccuracy):
(WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
* bindings/js/JSMainThreadExecState.h:
* bindings/js/JSTouchCustom.cpp:
* bindings/js/JSTouchListCustom.cpp:
* bindings/js/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::didContinue):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initializeThreading):
* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::handlePause):
* bindings/js/ios/TouchConstructors.cpp: Added.
* bindings/objc/DOM.mm:
(WebCore::wkQuadFromFloatQuad):
(WebCore::kit):
(WebCore::min4):
(WebCore::max4):
(WebCore::emptyQuad):
(-[WKQuadObject initWithQuad:]):
(-[WKQuadObject quad]):
(-[WKQuadObject boundingBox]):
(-[DOMNode boundingBox]):
(-[DOMNode absoluteQuad]):
(-[DOMNode absoluteQuadAndInsideFixedPosition:]):
(-[DOMNode boundingBoxUsingTransforms]):
(-[DOMNode lineBoxQuads]):
(-[DOMNode _linkElement]):
(-[DOMNode hrefURL]):
(-[DOMNode hrefTarget]):
(-[DOMNode hrefFrame]):
(-[DOMNode hrefLabel]):
(-[DOMNode hrefTitle]):
(-[DOMNode boundingFrame]):
(-[DOMNode innerFrameQuad]):
(-[DOMNode computedFontSize]):
(-[DOMNode nextFocusNode]):
(-[DOMNode previousFocusNode]):
(-[DOMRange boundingBox]):
(-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]):
(-[DOMElement _font]):
(-[DOMHTMLLinkElement _mediaQueryMatchesForOrientation:]):
(-[DOMHTMLLinkElement _mediaQueryMatches]):
* bindings/objc/DOMEvents.h:
* bindings/objc/DOMEvents.mm:
(kitClass):
* bindings/objc/DOMExtensions.h:
* bindings/objc/DOMHTML.mm:
(-[DOMHTMLElement scrollYOffset]):
(-[DOMHTMLElement setScrollXOffset:scrollYOffset:]):
(-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):
(-[DOMHTMLElement absolutePosition::::]):
(-[DOMHTMLInputElement _autocapitalizeType]):
(-[DOMHTMLTextAreaElement _autocapitalizeType]):
(-[DOMHTMLInputElement setValueWithChangeEvent:]):
(-[DOMHTMLInputElement setValueAsNumberWithChangeEvent:]):
* bindings/objc/DOMInternal.h:
* bindings/objc/DOMInternal.mm:
(wrapperCacheLock):
(getDOMWrapper):
(addDOMWrapper):
(removeDOMWrapper):
* bindings/objc/DOMPrivate.h:
* bindings/objc/DOMUIKitExtensions.h: Added.
* bindings/objc/DOMUIKitExtensions.mm: Added.
* bindings/objc/PublicDOMInterfaces.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeaderContentHeader):
(GenerateImplementationContentHeader):
(GenerateHeader):
(GenerateImplementation):
(GenerateCallbackImplementation):
* bindings/scripts/CodeGeneratorObjC.pm:
(ReadPublicInterfaces):
(GetClassName):
(IsCoreFoundationType):
(GetObjCType):
(AddIncludesForType):
(GenerateHeader):
(GenerateImplementation):
(WriteData):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/preprocessor.pm:
(applyPreprocessor):
* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::fieldNamed):
* bridge/objc/objc_instance.mm:
* config.h:
* dom/Document.cpp:
(WebCore::Document::addAutoSizingNode):
* dom/Document.h:
* dom/Document.idl:
* dom/ios/TouchEvents.cpp: Added.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyBlockStyle):
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply):
(WebCore::CompositeEditCommand::apply):
(WebCore::CompositeEditCommand::inputText):
(WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* editing/DeleteButton.h:
* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::enable):
(WebCore::DeleteButtonController::disable):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::doApply):
* editing/DeleteSelectionCommand.h:
* editing/EditAction.h:
* editing/EditCommand.h:
(WebCore::EditCommand::isInsertTextCommand):
* editing/EditingStyle.cpp:
* editing/Editor.cpp:
(WebCore::ClearTextCommand::ClearTextCommand):
(WebCore::ClearTextCommand::editingAction):
(WebCore::ClearTextCommand::CreateAndApply):
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::clearText):
(WebCore::Editor::insertDictationPhrases):
(WebCore::Editor::setDictationPhrasesAsChildOfElement):
(WebCore::Editor::confirmMarkedText):
(WebCore::Editor::setTextAsChildOfElement):
(WebCore::Editor::notifyComponentsOnChangedSelection):
(WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping):
(WebCore::Editor::copy):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::setComposition):
(WebCore::Editor::showSpellingGuessPanel):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::markMisspellingsOrBadGrammar):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::updateMarkersForWordsAffectedByEditing):
(WebCore::Editor::setIgnoreCompositionSelectionChange):
(WebCore::Editor::changeSelectionAfterCommand):
(WebCore::Editor::shouldChangeSelection):
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::resolveTextCheckingTypeMask):
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::executeClearText):
(WebCore::enabledCopy):
(WebCore::enabledCut):
(WebCore::enabledClearText):
(WebCore::createCommandMap):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::setSelection):
(WebCore::FrameSelection::modifyExtendingRight):
(WebCore::FrameSelection::modifyExtendingForward):
(WebCore::FrameSelection::modifyMovingRight):
(WebCore::FrameSelection::modifyMovingForward):
(WebCore::FrameSelection::modifyExtendingLeft):
(WebCore::FrameSelection::modifyExtendingBackward):
(WebCore::FrameSelection::modifyMovingLeft):
(WebCore::FrameSelection::modifyMovingBackward):
(WebCore::FrameSelection::setSelectedRange):
(WebCore::FrameSelection::focusedOrActiveStateChanged):
(WebCore::FrameSelection::updateAppearance):
(WebCore::FrameSelection::shouldDeleteSelection):
(WebCore::FrameSelection::revealSelection):
(WebCore::FrameSelection::setSelectionFromNone):
(WebCore::FrameSelection::shouldChangeSelection):
(WebCore::FrameSelection::expandSelectionToElementContainingCaretSelection):
(WebCore::FrameSelection::elementRangeContainingCaretSelection):
(WebCore::FrameSelection::expandSelectionToWordContainingCaretSelection):
(WebCore::FrameSelection::wordRangeContainingCaretSelection):
(WebCore::FrameSelection::expandSelectionToStartOfWordContainingCaretSelection):
(WebCore::FrameSelection::characterInRelationToCaretSelection):
(WebCore::FrameSelection::characterBeforeCaretSelection):
(WebCore::FrameSelection::characterAfterCaretSelection):
(WebCore::FrameSelection::wordOffsetInRange):
(WebCore::FrameSelection::spaceFollowsWordInRange):
(WebCore::FrameSelection::selectionAtDocumentStart):
(WebCore::FrameSelection::selectionAtSentenceStart):
(WebCore::FrameSelection::selectionAtWordStart):
(WebCore::FrameSelection::rangeByMovingCurrentSelection):
(WebCore::FrameSelection::rangeByExtendingCurrentSelection):
(WebCore::FrameSelection::selectRangeOnElement):
(WebCore::FrameSelection::wordSelectionContainingCaretSelection):
(WebCore::FrameSelection::actualSelectionAtSentenceStart):
(WebCore::FrameSelection::rangeByAlteringCurrentSelection):
(WebCore::FrameSelection::clearCurrentSelection):
(WebCore::FrameSelection::setCaretBlinks):
(WebCore::FrameSelection::setCaretColor):
* editing/FrameSelection.h:
(WebCore::FrameSelection::suppressCloseTyping):
(WebCore::FrameSelection::restoreCloseTyping):
(WebCore::FrameSelection::setUpdateAppearanceEnabled):
(WebCore::FrameSelection::suppressScrolling):
(WebCore::FrameSelection::restoreScrolling):
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doReapply):
* editing/InsertIntoTextNodeCommand.h:
* editing/InsertTextCommand.h:
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
* editing/TextAffinity.h:
* editing/TextCheckingHelper.cpp:
* editing/TextGranularity.h:
* editing/TextIterator.cpp:
(WebCore::isRendererReplacedElement):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping):
(WebCore::TypingCommand::markMisspellingsAfterTyping):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::FriendlyEditCommand::setEndingSelection):
(WebCore::TypingCommand::setEndingSelectionOnLastInsertCommand):
* editing/TypingCommand.h:
* editing/VisiblePosition.h:
(WebCore::operator&lt;):
(WebCore::operator&gt;):
(WebCore::operator&lt;=):
(WebCore::operator&gt;=):
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
(WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
* editing/VisibleUnits.cpp:
(WebCore::previousBoundary):
(WebCore::nextBoundary):
(WebCore::startOfDocument):
(WebCore::endOfDocument):
(WebCore::directionIsDownstream):
(WebCore::atBoundaryOfGranularity):
(WebCore::withinTextUnitOfGranularity):
(WebCore::nextCharacterBoundaryInDirection):
(WebCore::nextWordBoundaryInDirection):
(WebCore::nextSentenceBoundaryInDirection):
(WebCore::nextLineBoundaryInDirection):
(WebCore::nextParagraphBoundaryInDirection):
(WebCore::nextDocumentBoundaryInDirection):
(WebCore::positionOfNextBoundaryOfGranularity):
(WebCore::enclosingTextUnitOfGranularity):
(WebCore::distanceBetweenPositions):
(WebCore::wordRangeFromPosition):
(WebCore::closestWordBoundaryForPosition):
* editing/VisibleUnits.h:
* editing/ios/DictationCommandIOS.cpp: Added.
* editing/ios/DictationCommandIOS.h: Added.
(WebCore::DictationCommandIOS::create):
(WebCore::DictationCommandIOS::editingAction):
* editing/mac/FrameSelectionMac.mm:
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
* fileapi/AsyncFileStream.cpp:
* generate-export-file: Added.
* inspector/InspectorCounters.h:
* inspector/InspectorFrontendHost.h:
* make-export-file-generator:
* plugins/PluginPackage.h:
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::willProvidePluginLayer):
(WebCore::PluginViewBase::attachPluginLayer):
(WebCore::PluginViewBase::detachPluginLayer):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
* style/StyleResolveTree.cpp:
(WebCore::Style::elementImplicitVisibility):
* testing/Internals.cpp:
(WebCore::Internals::getCurrentCursorInfo):
(WebCore::Internals::isSelectPopupVisible):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

* MigrateHeaders.make:

Tools:

* Scripts/check-for-inappropriate-objc-class-names:
* Scripts/check-for-webkit-framework-include-consistency:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreConfigurationsBasexcconfig">trunk/Source/WebCore/Configurations/Base.xcconfig</a></li>
<li><a href="#trunkSourceWebCoreConfigurationsWebCorexcconfig">trunk/Source/WebCore/Configurations/WebCore.xcconfig</a></li>
<li><a href="#trunkSourceWebCoreConfigurationsWebCoreTestSupportxcconfig">trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreEnglishlprojLocalizablestrings">trunk/Source/WebCore/English.lproj/Localizable.strings</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationGeolocationcpp">trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationGeolocationh">trunk/Source/WebCore/Modules/geolocation/Geolocation.h</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationNavigatorGeolocationcpp">trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationNavigatorGeolocationh">trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h</a></li>
<li><a href="#trunkSourceWebCoreModulesspeechSpeechSynthesiscpp">trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesspeechSpeechSynthesish">trunk/Source/WebCore/Modules/speech/SpeechSynthesis.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioContextcpp">trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioContexth">trunk/Source/WebCore/Modules/webaudio/AudioContext.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebaudioAudioScheduledSourceNodecpp">trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabasecpp">trunk/Source/WebCore/Modules/webdatabase/Database.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseBackendBasecpp">trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseContextcpp">trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseContexth">trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseManagerClienth">trunk/Source/WebCore/Modules/webdatabase/DatabaseManagerClient.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseTaskcpp">trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseTaskh">trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseThreadcpp">trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseThreadh">trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseTrackercpp">trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseDatabaseTrackerh">trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendcpp">trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendh">trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsGCControllercpp">trunk/Source/WebCore/bindings/js/GCController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsGCControllerh">trunk/Source/WebCore/bindings/js/GCController.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCallbackDatah">trunk/Source/WebCore/bindings/js/JSCallbackData.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowBasecpp">trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDeviceOrientationEventCustomcpp">trunk/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMainThreadExecStateh">trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSTouchCustomcpp">trunk/Source/WebCore/bindings/js/JSTouchCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSTouchListCustomcpp">trunk/Source/WebCore/bindings/js/JSTouchListCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsPageScriptDebugServercpp">trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptControllercpp">trunk/Source/WebCore/bindings/js/ScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptDebugServercpp">trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMmm">trunk/Source/WebCore/bindings/objc/DOM.mm</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMEventsh">trunk/Source/WebCore/bindings/objc/DOMEvents.h</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMEventsmm">trunk/Source/WebCore/bindings/objc/DOMEvents.mm</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMExtensionsh">trunk/Source/WebCore/bindings/objc/DOMExtensions.h</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMHTMLmm">trunk/Source/WebCore/bindings/objc/DOMHTML.mm</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMInternalh">trunk/Source/WebCore/bindings/objc/DOMInternal.h</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMInternalmm">trunk/Source/WebCore/bindings/objc/DOMInternal.mm</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMPrivateh">trunk/Source/WebCore/bindings/objc/DOMPrivate.h</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcPublicDOMInterfacesh">trunk/Source/WebCore/bindings/objc/PublicDOMInterfaces.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorObjCpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptspreprocessorpm">trunk/Source/WebCore/bindings/scripts/preprocessor.pm</a></li>
<li><a href="#trunkSourceWebCorebridgeobjcobjc_classmm">trunk/Source/WebCore/bridge/objc/objc_class.mm</a></li>
<li><a href="#trunkSourceWebCorebridgeobjcobjc_instancemm">trunk/Source/WebCore/bridge/objc/objc_instance.mm</a></li>
<li><a href="#trunkSourceWebCoreconfigh">trunk/Source/WebCore/config.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentidl">trunk/Source/WebCore/dom/Document.idl</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyStyleCommandcpp">trunk/Source/WebCore/editing/ApplyStyleCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandcpp">trunk/Source/WebCore/editing/CompositeEditCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingCompositeEditCommandh">trunk/Source/WebCore/editing/CompositeEditCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteButtonh">trunk/Source/WebCore/editing/DeleteButton.h</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteButtonControllercpp">trunk/Source/WebCore/editing/DeleteButtonController.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteSelectionCommandcpp">trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingDeleteSelectionCommandh">trunk/Source/WebCore/editing/DeleteSelectionCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingEditActionh">trunk/Source/WebCore/editing/EditAction.h</a></li>
<li><a href="#trunkSourceWebCoreeditingEditCommandh">trunk/Source/WebCore/editing/EditCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingEditingStylecpp">trunk/Source/WebCore/editing/EditingStyle.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorh">trunk/Source/WebCore/editing/Editor.h</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorCommandcpp">trunk/Source/WebCore/editing/EditorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectioncpp">trunk/Source/WebCore/editing/FrameSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectionh">trunk/Source/WebCore/editing/FrameSelection.h</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertIntoTextNodeCommandcpp">trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertIntoTextNodeCommandh">trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertTextCommandh">trunk/Source/WebCore/editing/InsertTextCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandcpp">trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextAffinityh">trunk/Source/WebCore/editing/TextAffinity.h</a></li>
<li><a href="#trunkSourceWebCoreeditingTextCheckingHelpercpp">trunk/Source/WebCore/editing/TextCheckingHelper.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextGranularityh">trunk/Source/WebCore/editing/TextGranularity.h</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTypingCommandcpp">trunk/Source/WebCore/editing/TypingCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTypingCommandh">trunk/Source/WebCore/editing/TypingCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingVisiblePositionh">trunk/Source/WebCore/editing/VisiblePosition.h</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleSelectioncpp">trunk/Source/WebCore/editing/VisibleSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleUnitscpp">trunk/Source/WebCore/editing/VisibleUnits.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleUnitsh">trunk/Source/WebCore/editing/VisibleUnits.h</a></li>
<li><a href="#trunkSourceWebCoreeditingmacFrameSelectionMacmm">trunk/Source/WebCore/editing/mac/FrameSelectionMac.mm</a></li>
<li><a href="#trunkSourceWebCorefileapiAsyncFileStreamcpp">trunk/Source/WebCore/fileapi/AsyncFileStream.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCountersh">trunk/Source/WebCore/inspector/InspectorCounters.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorFrontendHosth">trunk/Source/WebCore/inspector/InspectorFrontendHost.h</a></li>
<li><a href="#trunkSourceWebCoremakeexportfilegenerator">trunk/Source/WebCore/make-export-file-generator</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginPackageh">trunk/Source/WebCore/plugins/PluginPackage.h</a></li>
<li><a href="#trunkSourceWebCorepluginsPluginViewBaseh">trunk/Source/WebCore/plugins/PluginViewBase.h</a></li>
<li><a href="#trunkSourceWebCorestyleStyleResolveForDocumentcpp">trunk/Source/WebCore/style/StyleResolveForDocument.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleResolveTreecpp">trunk/Source/WebCore/style/StyleResolveTree.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerThreadcpp">trunk/Source/WebCore/workers/WorkerThread.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacMigrateHeadersmake">trunk/Source/WebKit/mac/MigrateHeaders.make</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptscheckforinappropriateobjcclassnames">trunk/Tools/Scripts/check-for-inappropriate-objc-class-names</a></li>
<li><a href="#trunkToolsScriptscheckforwebkitframeworkincludeconsistency">trunk/Tools/Scripts/check-for-webkit-framework-include-consistency</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreConfigurationsiOSxcconfig">trunk/Source/WebCore/Configurations/iOS.xcconfig</a></li>
<li>trunk/Source/WebCore/Modules/airplay/</li>
<li><a href="#trunkSourceWebCoreModulesairplayWebKitPlaybackTargetAvailabilityEventcpp">trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesairplayWebKitPlaybackTargetAvailabilityEventh">trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h</a></li>
<li><a href="#trunkSourceWebCoreModulesairplayWebKitPlaybackTargetAvailabilityEventidl">trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl</a></li>
<li><a href="#trunkSourceWebCoreResourcesDictationPhraseWithAlternativesDotpng">trunk/Source/WebCore/Resources/DictationPhraseWithAlternativesDot.png</a></li>
<li><a href="#trunkSourceWebCoreResourcesDictationPhraseWithAlternativesDot2xpng">trunk/Source/WebCore/Resources/DictationPhraseWithAlternativesDot@2x.png</a></li>
<li><a href="#trunkSourceWebCoreResourcesSpellingDotpng">trunk/Source/WebCore/Resources/SpellingDot.png</a></li>
<li><a href="#trunkSourceWebCoreResourcesSpellingDot2xpng">trunk/Source/WebCore/Resources/SpellingDot@2x.png</a></li>
<li><a href="#trunkSourceWebCoreResourcesdecrementArrowtiff">trunk/Source/WebCore/Resources/decrementArrow.tiff</a></li>
<li><a href="#trunkSourceWebCoreResourceshScrollControl_leftpng">trunk/Source/WebCore/Resources/hScrollControl_left.png</a></li>
<li><a href="#trunkSourceWebCoreResourceshScrollControl_middlepng">trunk/Source/WebCore/Resources/hScrollControl_middle.png</a></li>
<li><a href="#trunkSourceWebCoreResourceshScrollControl_rightpng">trunk/Source/WebCore/Resources/hScrollControl_right.png</a></li>
<li><a href="#trunkSourceWebCoreResourcesincrementArrowtiff">trunk/Source/WebCore/Resources/incrementArrow.tiff</a></li>
<li><a href="#trunkSourceWebCoreResourcesmarkedLeftpng">trunk/Source/WebCore/Resources/markedLeft.png</a></li>
<li><a href="#trunkSourceWebCoreResourcesmarkedMiddlepng">trunk/Source/WebCore/Resources/markedMiddle.png</a></li>
<li><a href="#trunkSourceWebCoreResourcesmarkedRightpng">trunk/Source/WebCore/Resources/markedRight.png</a></li>
<li><a href="#trunkSourceWebCoreResourcesvScrollControl_bottompng">trunk/Source/WebCore/Resources/vScrollControl_bottom.png</a></li>
<li><a href="#trunkSourceWebCoreResourcesvScrollControl_middlepng">trunk/Source/WebCore/Resources/vScrollControl_middle.png</a></li>
<li><a href="#trunkSourceWebCoreResourcesvScrollControl_toppng">trunk/Source/WebCore/Resources/vScrollControl_top.png</a></li>
<li>trunk/Source/WebCore/bindings/js/ios/</li>
<li><a href="#trunkSourceWebCorebindingsjsiosTouchConstructorscpp">trunk/Source/WebCore/bindings/js/ios/TouchConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMUIKitExtensionsh">trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.h</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMUIKitExtensionsmm">trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm</a></li>
<li>trunk/Source/WebCore/dom/ios/</li>
<li><a href="#trunkSourceWebCoredomiosTouchEventscpp">trunk/Source/WebCore/dom/ios/TouchEvents.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingiosDictationCommandIOScpp">trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingiosDictationCommandIOSh">trunk/Source/WebCore/editing/ios/DictationCommandIOS.h</a></li>
<li><a href="#trunkSourceWebCoregenerateexportfile">trunk/Source/WebCore/generate-export-file</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/ChangeLog        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -1,5 +1,389 @@
</span><span class="cx"> 2014-01-10  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [iOS] Upstream WebCore and Tools miscellaneous changes
+        https://bugs.webkit.org/show_bug.cgi?id=126698
+
+        Reviewed by David Kilzer.
+
+        * Configurations/Base.xcconfig:
+        * Configurations/WebCore.xcconfig:
+        * Configurations/WebCoreTestSupport.xcconfig:
+        * Configurations/iOS.xcconfig: Added.
+        * DerivedSources.make:
+        * English.lproj/Localizable.strings:
+        * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp: Copied from Source/WebCore/editing/TextAffinity.h.
+        (WebCore::stringForPlaybackTargetAvailability):
+        (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
+        * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h: Added.
+        (WebCore::WebKitPlaybackTargetAvailabilityEventInit::WebKitPlaybackTargetAvailabilityEventInit):
+        (WebCore::WebKitPlaybackTargetAvailabilityEvent::~WebKitPlaybackTargetAvailabilityEvent):
+        (WebCore::WebKitPlaybackTargetAvailabilityEvent::create):
+        (WebCore::WebKitPlaybackTargetAvailabilityEvent::availability):
+        * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl: Copied from Source/WebCore/editing/DeleteButton.h.
+        * Modules/geolocation/Geolocation.cpp:
+        (WebCore::Geolocation::Geolocation):
+        (WebCore::Geolocation::canSuspend):
+        (WebCore::Geolocation::suspend):
+        (WebCore::Geolocation::resume):
+        (WebCore::Geolocation::resumeTimerFired):
+        (WebCore::Geolocation::resetAllGeolocationPermission):
+        (WebCore::Geolocation::stop):
+        (WebCore::Geolocation::setIsAllowed):
+        (WebCore::Geolocation::positionChanged):
+        (WebCore::Geolocation::setError):
+        * Modules/geolocation/Geolocation.h:
+        * Modules/geolocation/NavigatorGeolocation.cpp:
+        (WebCore::NavigatorGeolocation::resetAllGeolocationPermission):
+        * Modules/geolocation/NavigatorGeolocation.h:
+        * Modules/speech/SpeechSynthesis.cpp:
+        (WebCore::SpeechSynthesis::SpeechSynthesis):
+        (WebCore::SpeechSynthesis::speak):
+        * Modules/speech/SpeechSynthesis.h:
+        (WebCore::SpeechSynthesis::userGestureRequiredForSpeechStart):
+        (WebCore::SpeechSynthesis::removeBehaviorRestriction):
+        * Modules/webaudio/AudioContext.cpp:
+        * Modules/webaudio/AudioContext.h:
+        * Modules/webaudio/AudioScheduledSourceNode.cpp:
+        * Modules/webdatabase/Database.cpp:
+        * Modules/webdatabase/DatabaseBackendBase.cpp:
+        (WebCore::DatabaseBackendBase::performOpenAndVerify):
+        (WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded):
+        * Modules/webdatabase/DatabaseContext.cpp:
+        (WebCore::DatabaseContext::DatabaseContext):
+        (WebCore::DatabaseContext::databaseThread):
+        (WebCore::DatabaseContext::setPaused):
+        * Modules/webdatabase/DatabaseContext.h:
+        * Modules/webdatabase/DatabaseManagerClient.h:
+        * Modules/webdatabase/DatabaseTask.cpp:
+        (WebCore::DatabaseTask::performTask):
+        (WebCore::Database::DatabaseTransactionTask::shouldPerformWhilePaused):
+        * Modules/webdatabase/DatabaseTask.h:
+        * Modules/webdatabase/DatabaseThread.cpp:
+        (WebCore::DatabaseThread::DatabaseThread):
+        (WebCore::DatabaseThread::requestTermination):
+        (WebCore::DatabaseUnpauseTask::create):
+        (WebCore::DatabaseUnpauseTask::shouldPerformWhilePaused):
+        (WebCore::DatabaseUnpauseTask::DatabaseUnpauseTask):
+        (WebCore::DatabaseUnpauseTask::doPerformTask):
+        (WebCore::DatabaseUnpauseTask::debugTaskName):
+        (WebCore::DatabaseThread::setPaused):
+        (WebCore::DatabaseThread::handlePausedQueue):
+        (WebCore::DatabaseThread::databaseThread):
+        * Modules/webdatabase/DatabaseThread.h:
+        * Modules/webdatabase/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::setQuota):
+        (WebCore::DatabaseTracker::deleteOrigin):
+        (WebCore::DatabaseTracker::deleteDatabase):
+        (WebCore::DatabaseTracker::deleteDatabaseFile):
+        (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
+        (WebCore::isZeroByteFile):
+        (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
+        (WebCore::DatabaseTracker::openDatabaseMutex):
+        (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled):
+        (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish):
+        (WebCore::DatabaseTracker::setDatabasesPaused):
+        * Modules/webdatabase/DatabaseTracker.h:
+        * Modules/webdatabase/SQLTransactionBackend.cpp:
+        (WebCore::SQLTransactionBackend::shouldPerformWhilePaused):
+        * Modules/webdatabase/SQLTransactionBackend.h:
+        * Resources/DictationPhraseWithAlternativesDot.png: Added.
+        * Resources/DictationPhraseWithAlternativesDot@2x.png: Added.
+        * Resources/SpellingDot.png: Added.
+        * Resources/SpellingDot@2x.png: Added.
+        * Resources/decrementArrow.tiff: Added.
+        * Resources/hScrollControl_left.png: Added.
+        * Resources/hScrollControl_middle.png: Added.
+        * Resources/hScrollControl_right.png: Added.
+        * Resources/incrementArrow.tiff: Added.
+        * Resources/markedLeft.png: Added.
+        * Resources/markedMiddle.png: Added.
+        * Resources/markedRight.png: Added.
+        * Resources/vScrollControl_bottom.png: Added.
+        * Resources/vScrollControl_middle.png: Added.
+        * Resources/vScrollControl_top.png: Added.
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/GCController.cpp:
+        (WebCore::GCController::garbageCollectNow):
+        (WebCore::GCController::releaseExecutableMemory):
+        * bindings/js/GCController.h:
+        * bindings/js/JSCallbackData.h:
+        (WebCore::JSCallbackData::~JSCallbackData):
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::supportsProfiling):
+        (WebCore::JSDOMWindowBase::shouldInterruptScriptBeforeTimeout):
+        (WebCore::JSDOMWindowBase::commonVM):
+        (WebCore::JSDOMWindowBase::commonVMExists):
+        (WebCore::JSDOMWindowBase::commonVMInternal):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::touch):
+        (WebCore::JSDOMWindow::touchList):
+        * bindings/js/JSDeviceOrientationEventCustom.cpp:
+        (WebCore::JSDeviceOrientationEvent::webkitCompassHeading):
+        (WebCore::JSDeviceOrientationEvent::webkitCompassAccuracy):
+        (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
+        * bindings/js/JSMainThreadExecState.h:
+        * bindings/js/JSTouchCustom.cpp:
+        * bindings/js/JSTouchListCustom.cpp:
+        * bindings/js/PageScriptDebugServer.cpp:
+        (WebCore::PageScriptDebugServer::didContinue):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::initializeThreading):
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::handlePause):
+        * bindings/js/ios/TouchConstructors.cpp: Added.
+        * bindings/objc/DOM.mm:
+        (WebCore::wkQuadFromFloatQuad):
+        (WebCore::kit):
+        (WebCore::min4):
+        (WebCore::max4):
+        (WebCore::emptyQuad):
+        (-[WKQuadObject initWithQuad:]):
+        (-[WKQuadObject quad]):
+        (-[WKQuadObject boundingBox]):
+        (-[DOMNode boundingBox]):
+        (-[DOMNode absoluteQuad]):
+        (-[DOMNode absoluteQuadAndInsideFixedPosition:]):
+        (-[DOMNode boundingBoxUsingTransforms]):
+        (-[DOMNode lineBoxQuads]):
+        (-[DOMNode _linkElement]):
+        (-[DOMNode hrefURL]):
+        (-[DOMNode hrefTarget]):
+        (-[DOMNode hrefFrame]):
+        (-[DOMNode hrefLabel]):
+        (-[DOMNode hrefTitle]):
+        (-[DOMNode boundingFrame]):
+        (-[DOMNode innerFrameQuad]):
+        (-[DOMNode computedFontSize]):
+        (-[DOMNode nextFocusNode]):
+        (-[DOMNode previousFocusNode]):
+        (-[DOMRange boundingBox]):
+        (-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]):
+        (-[DOMElement _font]):
+        (-[DOMHTMLLinkElement _mediaQueryMatchesForOrientation:]):
+        (-[DOMHTMLLinkElement _mediaQueryMatches]):
+        * bindings/objc/DOMEvents.h:
+        * bindings/objc/DOMEvents.mm:
+        (kitClass):
+        * bindings/objc/DOMExtensions.h:
+        * bindings/objc/DOMHTML.mm:
+        (-[DOMHTMLElement scrollYOffset]):
+        (-[DOMHTMLElement setScrollXOffset:scrollYOffset:]):
+        (-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):
+        (-[DOMHTMLElement absolutePosition::::]):
+        (-[DOMHTMLInputElement _autocapitalizeType]):
+        (-[DOMHTMLTextAreaElement _autocapitalizeType]):
+        (-[DOMHTMLInputElement setValueWithChangeEvent:]):
+        (-[DOMHTMLInputElement setValueAsNumberWithChangeEvent:]):
+        * bindings/objc/DOMInternal.h:
+        * bindings/objc/DOMInternal.mm:
+        (wrapperCacheLock):
+        (getDOMWrapper):
+        (addDOMWrapper):
+        (removeDOMWrapper):
+        * bindings/objc/DOMPrivate.h:
+        * bindings/objc/DOMUIKitExtensions.h: Added.
+        * bindings/objc/DOMUIKitExtensions.mm: Added.
+        * bindings/objc/PublicDOMInterfaces.h:
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeaderContentHeader):
+        (GenerateImplementationContentHeader):
+        (GenerateHeader):
+        (GenerateImplementation):
+        (GenerateCallbackImplementation):
+        * bindings/scripts/CodeGeneratorObjC.pm:
+        (ReadPublicInterfaces):
+        (GetClassName):
+        (IsCoreFoundationType):
+        (GetObjCType):
+        (AddIncludesForType):
+        (GenerateHeader):
+        (GenerateImplementation):
+        (WriteData):
+        * bindings/scripts/IDLAttributes.txt:
+        * bindings/scripts/preprocessor.pm:
+        (applyPreprocessor):
+        * bridge/objc/objc_class.mm:
+        (JSC::Bindings::ObjcClass::fieldNamed):
+        * bridge/objc/objc_instance.mm:
+        * config.h:
+        * dom/Document.cpp:
+        (WebCore::Document::addAutoSizingNode):
+        * dom/Document.h:
+        * dom/Document.idl:
+        * dom/ios/TouchEvents.cpp: Added.
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::ApplyStyleCommand::applyBlockStyle):
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::EditCommandComposition::unapply):
+        (WebCore::CompositeEditCommand::apply):
+        (WebCore::CompositeEditCommand::inputText):
+        (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
+        (WebCore::CompositeEditCommand::moveParagraphs):
+        * editing/CompositeEditCommand.h:
+        * editing/DeleteButton.h:
+        * editing/DeleteButtonController.cpp:
+        (WebCore::DeleteButtonController::enable):
+        (WebCore::DeleteButtonController::disable):
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::doApply):
+        * editing/DeleteSelectionCommand.h:
+        * editing/EditAction.h:
+        * editing/EditCommand.h:
+        (WebCore::EditCommand::isInsertTextCommand):
+        * editing/EditingStyle.cpp:
+        * editing/Editor.cpp:
+        (WebCore::ClearTextCommand::ClearTextCommand):
+        (WebCore::ClearTextCommand::editingAction):
+        (WebCore::ClearTextCommand::CreateAndApply):
+        (WebCore::Editor::handleTextEvent):
+        (WebCore::Editor::clearText):
+        (WebCore::Editor::insertDictationPhrases):
+        (WebCore::Editor::setDictationPhrasesAsChildOfElement):
+        (WebCore::Editor::confirmMarkedText):
+        (WebCore::Editor::setTextAsChildOfElement):
+        (WebCore::Editor::notifyComponentsOnChangedSelection):
+        (WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping):
+        (WebCore::Editor::copy):
+        (WebCore::Editor::setBaseWritingDirection):
+        (WebCore::Editor::setComposition):
+        (WebCore::Editor::showSpellingGuessPanel):
+        (WebCore::Editor::markMisspellingsAfterTypingToWord):
+        (WebCore::Editor::markMisspellingsOrBadGrammar):
+        (WebCore::Editor::changeBackToReplacedString):
+        (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
+        (WebCore::Editor::setIgnoreCompositionSelectionChange):
+        (WebCore::Editor::changeSelectionAfterCommand):
+        (WebCore::Editor::shouldChangeSelection):
+        (WebCore::Editor::respondToChangedSelection):
+        (WebCore::Editor::resolveTextCheckingTypeMask):
+        * editing/Editor.h:
+        * editing/EditorCommand.cpp:
+        (WebCore::executeClearText):
+        (WebCore::enabledCopy):
+        (WebCore::enabledCut):
+        (WebCore::enabledClearText):
+        (WebCore::createCommandMap):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::FrameSelection):
+        (WebCore::FrameSelection::setSelection):
+        (WebCore::FrameSelection::modifyExtendingRight):
+        (WebCore::FrameSelection::modifyExtendingForward):
+        (WebCore::FrameSelection::modifyMovingRight):
+        (WebCore::FrameSelection::modifyMovingForward):
+        (WebCore::FrameSelection::modifyExtendingLeft):
+        (WebCore::FrameSelection::modifyExtendingBackward):
+        (WebCore::FrameSelection::modifyMovingLeft):
+        (WebCore::FrameSelection::modifyMovingBackward):
+        (WebCore::FrameSelection::setSelectedRange):
+        (WebCore::FrameSelection::focusedOrActiveStateChanged):
+        (WebCore::FrameSelection::updateAppearance):
+        (WebCore::FrameSelection::shouldDeleteSelection):
+        (WebCore::FrameSelection::revealSelection):
+        (WebCore::FrameSelection::setSelectionFromNone):
+        (WebCore::FrameSelection::shouldChangeSelection):
+        (WebCore::FrameSelection::expandSelectionToElementContainingCaretSelection):
+        (WebCore::FrameSelection::elementRangeContainingCaretSelection):
+        (WebCore::FrameSelection::expandSelectionToWordContainingCaretSelection):
+        (WebCore::FrameSelection::wordRangeContainingCaretSelection):
+        (WebCore::FrameSelection::expandSelectionToStartOfWordContainingCaretSelection):
+        (WebCore::FrameSelection::characterInRelationToCaretSelection):
+        (WebCore::FrameSelection::characterBeforeCaretSelection):
+        (WebCore::FrameSelection::characterAfterCaretSelection):
+        (WebCore::FrameSelection::wordOffsetInRange):
+        (WebCore::FrameSelection::spaceFollowsWordInRange):
+        (WebCore::FrameSelection::selectionAtDocumentStart):
+        (WebCore::FrameSelection::selectionAtSentenceStart):
+        (WebCore::FrameSelection::selectionAtWordStart):
+        (WebCore::FrameSelection::rangeByMovingCurrentSelection):
+        (WebCore::FrameSelection::rangeByExtendingCurrentSelection):
+        (WebCore::FrameSelection::selectRangeOnElement):
+        (WebCore::FrameSelection::wordSelectionContainingCaretSelection):
+        (WebCore::FrameSelection::actualSelectionAtSentenceStart):
+        (WebCore::FrameSelection::rangeByAlteringCurrentSelection):
+        (WebCore::FrameSelection::clearCurrentSelection):
+        (WebCore::FrameSelection::setCaretBlinks):
+        (WebCore::FrameSelection::setCaretColor):
+        * editing/FrameSelection.h:
+        (WebCore::FrameSelection::suppressCloseTyping):
+        (WebCore::FrameSelection::restoreCloseTyping):
+        (WebCore::FrameSelection::setUpdateAppearanceEnabled):
+        (WebCore::FrameSelection::suppressScrolling):
+        (WebCore::FrameSelection::restoreScrolling):
+        * editing/InsertIntoTextNodeCommand.cpp:
+        (WebCore::InsertIntoTextNodeCommand::doReapply):
+        * editing/InsertIntoTextNodeCommand.h:
+        * editing/InsertTextCommand.h:
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::doApply):
+        * editing/TextAffinity.h:
+        * editing/TextCheckingHelper.cpp:
+        * editing/TextGranularity.h:
+        * editing/TextIterator.cpp:
+        (WebCore::isRendererReplacedElement):
+        * editing/TypingCommand.cpp:
+        (WebCore::TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping):
+        (WebCore::TypingCommand::markMisspellingsAfterTyping):
+        (WebCore::TypingCommand::deleteKeyPressed):
+        (WebCore::TypingCommand::forwardDeleteKeyPressed):
+        (WebCore::FriendlyEditCommand::setEndingSelection):
+        (WebCore::TypingCommand::setEndingSelectionOnLastInsertCommand):
+        * editing/TypingCommand.h:
+        * editing/VisiblePosition.h:
+        (WebCore::operator&lt;):
+        (WebCore::operator&gt;):
+        (WebCore::operator&lt;=):
+        (WebCore::operator&gt;=):
+        * editing/VisibleSelection.cpp:
+        (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
+        (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
+        * editing/VisibleUnits.cpp:
+        (WebCore::previousBoundary):
+        (WebCore::nextBoundary):
+        (WebCore::startOfDocument):
+        (WebCore::endOfDocument):
+        (WebCore::directionIsDownstream):
+        (WebCore::atBoundaryOfGranularity):
+        (WebCore::withinTextUnitOfGranularity):
+        (WebCore::nextCharacterBoundaryInDirection):
+        (WebCore::nextWordBoundaryInDirection):
+        (WebCore::nextSentenceBoundaryInDirection):
+        (WebCore::nextLineBoundaryInDirection):
+        (WebCore::nextParagraphBoundaryInDirection):
+        (WebCore::nextDocumentBoundaryInDirection):
+        (WebCore::positionOfNextBoundaryOfGranularity):
+        (WebCore::enclosingTextUnitOfGranularity):
+        (WebCore::distanceBetweenPositions):
+        (WebCore::wordRangeFromPosition):
+        (WebCore::closestWordBoundaryForPosition):
+        * editing/VisibleUnits.h:
+        * editing/ios/DictationCommandIOS.cpp: Added.
+        * editing/ios/DictationCommandIOS.h: Added.
+        (WebCore::DictationCommandIOS::create):
+        (WebCore::DictationCommandIOS::editingAction):
+        * editing/mac/FrameSelectionMac.mm:
+        (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
+        * fileapi/AsyncFileStream.cpp:
+        * generate-export-file: Added.
+        * inspector/InspectorCounters.h:
+        * inspector/InspectorFrontendHost.h:
+        * make-export-file-generator:
+        * plugins/PluginPackage.h:
+        * plugins/PluginViewBase.h:
+        (WebCore::PluginViewBase::willProvidePluginLayer):
+        (WebCore::PluginViewBase::attachPluginLayer):
+        (WebCore::PluginViewBase::detachPluginLayer):
+        * style/StyleResolveForDocument.cpp:
+        (WebCore::Style::resolveForDocument):
+        * style/StyleResolveTree.cpp:
+        (WebCore::Style::elementImplicitVisibility):
+        * testing/Internals.cpp:
+        (WebCore::Internals::getCurrentCursorInfo):
+        (WebCore::Internals::isSelectPopupVisible):
+        * workers/WorkerThread.cpp:
+        (WebCore::WorkerThread::workerThread):
+
+2014-01-10  Daniel Bates  &lt;dabates@apple.com&gt;
+
</ins><span class="cx">         Fix the iOS build after &lt;http://trac.webkit.org/changeset/161589&gt;
</span><span class="cx">         (https://bugs.webkit.org/show_bug.cgi?id=126654)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreConfigurationsBasexcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Configurations/Base.xcconfig (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Configurations/Base.xcconfig        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Configurations/Base.xcconfig        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -21,6 +21,8 @@
</span><span class="cx"> // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
</span><span class="cx"> // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx"> 
</span><ins>+#include &quot;iOS.xcconfig&quot;
+
</ins><span class="cx"> CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
</span><span class="cx"> CLANG_CXX_LIBRARY = libc++;
</span><span class="cx"> CLANG_WARN_BOOL_CONVERSION = YES;
</span><span class="lines">@@ -56,6 +58,7 @@
</span><span class="cx"> GCC_WARN_64_TO_32_BIT_CONVERSION_ = YES;
</span><span class="cx"> GCC_WARN_64_TO_32_BIT_CONVERSION_armv7 = YES;
</span><span class="cx"> GCC_WARN_64_TO_32_BIT_CONVERSION_armv7s = YES;
</span><ins>+GCC_WARN_64_TO_32_BIT_CONVERSION_arm64 = NO;
</ins><span class="cx"> GCC_WARN_64_TO_32_BIT_CONVERSION_i386 = YES;
</span><span class="cx"> GCC_WARN_64_TO_32_BIT_CONVERSION_x86_64 = NO;
</span><span class="cx"> GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO;
</span><span class="lines">@@ -82,7 +85,10 @@
</span><span class="cx"> DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT));
</span><span class="cx"> 
</span><span class="cx"> GCC_OPTIMIZATION_LEVEL = $(GCC_OPTIMIZATION_LEVEL_$(CURRENT_VARIANT));
</span><del>-GCC_OPTIMIZATION_LEVEL_normal = 2;
</del><ins>+GCC_OPTIMIZATION_LEVEL_normal = $(GCC_OPTIMIZATION_LEVEL_normal_$(PLATFORM_NAME));
+GCC_OPTIMIZATION_LEVEL_normal_iphoneos = 3;
+GCC_OPTIMIZATION_LEVEL_normal_iphonesimulator = 3;
+GCC_OPTIMIZATION_LEVEL_normal_macosx = 2;
</ins><span class="cx"> GCC_OPTIMIZATION_LEVEL_debug = 0;
</span><span class="cx"> 
</span><span class="cx"> STRIP_INSTALLED_PRODUCT = $(STRIP_INSTALLED_PRODUCT_$(CURRENT_VARIANT));
</span><span class="lines">@@ -93,7 +99,9 @@
</span><span class="cx"> DEAD_CODE_STRIPPING_normal = YES;
</span><span class="cx"> DEAD_CODE_STRIPPING = $(DEAD_CODE_STRIPPING_$(CURRENT_VARIANT));
</span><span class="cx"> 
</span><del>-SECTORDER_FLAGS = -Wl,-order_file,WebCore.order;
</del><ins>+SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(PLATFORM_NAME));
+SECTORDER_FLAGS_iphoneos = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/WebCore.order;
+SECTORDER_FLAGS_macosx = -Wl,-order_file,WebCore.order;
</ins><span class="cx"> 
</span><span class="cx"> WEBCORE_SQLITE3_HEADER_SEARCH_PATHS = $(NEXT_ROOT)/usr/local/include/WebCoreSQLite3;
</span><span class="cx"> SQLITE3_HEADER_SEARCH_PATHS = $(SQLITE3_HEADER_SEARCH_PATHS_$(PLATFORM_NAME));
</span></span></pre></div>
<a id="trunkSourceWebCoreConfigurationsWebCorexcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Configurations/WebCore.xcconfig        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -33,8 +33,9 @@
</span><span class="cx"> EXPORTED_SYMBOLS_FILE_i386 = $(EXPORTED_SYMBOLS_FILE_i386_$(PLATFORM_NAME));
</span><span class="cx"> EXPORTED_SYMBOLS_FILE_i386_iphonesimulator = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.LP64.i386.exp;
</span><span class="cx"> EXPORTED_SYMBOLS_FILE_i386_macosx = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.exp;
</span><del>-EXPORTED_SYMBOLS_FILE_ppc = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.exp;
-EXPORTED_SYMBOLS_FILE_x86_64 = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.LP64.exp;
</del><ins>+EXPORTED_SYMBOLS_FILE_x86_64 = $(EXPORTED_SYMBOLS_FILE_x86_64_$(PLATFORM_NAME));
+EXPORTED_SYMBOLS_FILE_x86_64_iphonesimulator = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.LP64.x86_64.exp;
+EXPORTED_SYMBOLS_FILE_x86_64_macosx = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.LP64.exp;
</ins><span class="cx"> GCC_PREFIX_HEADER = WebCorePrefix.h;
</span><span class="cx"> GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST $(GCC_PREPROCESSOR_DEFINITIONS);
</span><span class="cx"> FRAMEWORK_SEARCH_PATHS = $(FRAMEWORK_SEARCH_PATHS_$(PLATFORM_NAME));
</span><span class="lines">@@ -51,7 +52,9 @@
</span><span class="cx"> STAGED_FRAMEWORKS_SEARCH_PATH = $(STAGED_FRAMEWORKS_SEARCH_PATH_$(USE_STAGING_INSTALL_PATH));
</span><span class="cx"> STAGED_FRAMEWORKS_SEARCH_PATH_YES = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari;
</span><span class="cx"> 
</span><del>-HEADER_SEARCH_PATHS = ForwardingHeaders icu /usr/include/libxslt /usr/include/libxml2 &quot;${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore&quot; &quot;${BUILT_PRODUCTS_DIR}/usr/local/include&quot; $(HEADER_SEARCH_PATHS);
</del><ins>+WEBKITADDITIONS_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include/WebKitAdditions $(SDKROOT)/usr/local/include/WebKitAdditions;
+
+HEADER_SEARCH_PATHS = ForwardingHeaders icu /usr/include/libxslt /usr/include/libxml2 $(SQLITE3_HEADER_SEARCH_PATHS) &quot;${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore&quot; &quot;$(BUILT_PRODUCTS_DIR)/usr/local/include&quot; $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) $(HEADER_SEARCH_PATHS);
</ins><span class="cx"> INFOPLIST_FILE = Info.plist;
</span><span class="cx"> INSTALL_PATH = $(INSTALL_PATH_$(PLATFORM_NAME));
</span><span class="cx"> INSTALL_PATH_iphoneos = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
</span><span class="lines">@@ -68,8 +71,8 @@
</span><span class="cx"> PRODUCT_NAME = WebCore;
</span><span class="cx"> OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport;
</span><span class="cx"> OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_$(PLATFORM_NAME));
</span><del>-OTHER_LDFLAGS_iphoneos = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework QuartzCore;
-OTHER_LDFLAGS_iphonesimulator = $(OTHER_LDFLAGS_iphoneos);
</del><ins>+OTHER_LDFLAGS_iphoneos = $(OTHER_LDFLAGS_iphonesimulator) -framework IOSurface;
+OTHER_LDFLAGS_iphonesimulator = $(OTHER_LDFLAGS_BASE) -framework Accelerate -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework OpenGLES -framework QuartzCore -lMobileGestalt;
</ins><span class="cx"> OTHER_LDFLAGS_macosx = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -umbrella WebKit -allowable_client WebKit2 -framework IOSurface;
</span><span class="cx"> 
</span><span class="cx"> NORMAL_WEBCORE_FRAMEWORKS_DIR = $(NORMAL_WEBCORE_FRAMEWORKS_DIR_$(PLATFORM_NAME));
</span><span class="lines">@@ -102,10 +105,13 @@
</span><span class="cx"> JAVASCRIPTCORE_PRIVATE_HEADERS_DIR = $(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_$(CONFIGURATION));
</span><span class="cx"> JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Release = $(JAVASCRIPTCORE_PRIVATE_HEADERS_engineering);
</span><span class="cx"> JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Debug = $(JAVASCRIPTCORE_PRIVATE_HEADERS_engineering);
</span><del>-JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production = $(SDKROOT)$(PRODUCTION_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders;
</del><ins>+JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production = $(JAVASCRIPTCORE_PRIVATE_HEADERS_Production_$(PLATFORM_NAME));
+JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production_iphoneos = $(SDKROOT)/$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaScriptCore.framework/Headers;
+JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production_iphonesimulator = $(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production_iphoneos);
+JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production_macosx = $(SDKROOT)$(PRODUCTION_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders;
</ins><span class="cx"> JAVASCRIPTCORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/JavaScriptCore.framework/PrivateHeaders;
</span><span class="cx"> 
</span><span class="cx"> EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME));
</span><del>-EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png Cursor.cpp CursorMac.mm EventHandlerMac.mm HTMLConverter.mm KillRingMac.mm PlatformEventFactoryMac.mm SSLKeyGeneratorMac.cpp SearchPopupMenuMac.mm ScrollingCoordinatorMac.mm ScrollingStateScrollingNodeMac.mm ScrollingTreeScrollingNodeMac.mm SharedTimerMac.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm;
</del><ins>+EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.tiff *Cursor.png AccessibilityObjectMac.mm AXObjectCacheMac.mm ClipboardMac.mm ColorMac.mm Cursor.cpp CursorMac.mm EditorMac.mm EventHandlerMac.mm EventLoopMac.mm GeolocationServiceMac.mm GraphicsContext3DOpenGLES.cpp IconDatabase.cpp IconMac.mm KeyEventMac.mm KillRingMac.mm LocalCurrentGraphicsContext.mm MIMETypeRegistryMac.mm MediaPlayerPrivateQTKit.mm NSScrollerImpDetails.mm NetworkStateNotifierMac.cpp PasteboardMac.mm PlatformEventFactoryMac.mm PlatformMouseEventMac.mm PlatformPasteboardMac.mm PlatformScreenMac.mm PlatformSpeechSynthesizerMac.mm PluginMainThreadScheduler.cpp RunLoopMac.mm SSLKeyGeneratorMac.cpp ScrollingCoordinatorMac.mm ScrollingStateScrollingNodeMac.mm ScrollingTreeScrollingNodeMac.mm ScrollViewMac.mm ScrollbarThemeMac.mm SharedTimerMac.mm SoundMac.mm SystemTimeMac.cpp ThemeMac.mm ThreadCheck.mm WebAccessibilityObjectWrapperMac.mm WebCoreSystemInterface.mm WebCoreURLResponse.mm WebCoreView.m WebFontCache.mm WebVideoFullscreenController.mm WebVideoFullscreenHUDWindowController.mm WebWindowAnimation.mm WheelEventMac.mm WidgetMac.mm mac/LayerPool.mm DisplayRefreshMonitorMac.mm;
</ins><span class="cx"> EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos);
</span><span class="cx"> EXCLUDED_SOURCE_FILE_NAMES_macosx = *IOS.h *IOS.cpp *IOS.mm KillRingNone.cpp WAKAppKitStubs.h WAKClipView.h WAKResponder.h WAKScrollView.h WAKView.h WAKViewPrivate.h WAKWindow.h WKContentObservation.h WKGraphics.h WKTypes.h WKUtilities.h WKView.h WKViewPrivate.h WebCoreThread.h WebCoreThreadMessage.h WebCoreThreadRun.h WebCoreThreadSystemInterface.h;
</span></span></pre></div>
<a id="trunkSourceWebCoreConfigurationsWebCoreTestSupportxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -26,10 +26,15 @@
</span><span class="cx"> PRIVATE_HEADERS_FOLDER_PATH = $(PRIVATE_HEADERS_FOLDER_PATH_$(CONFIGURATION));
</span><span class="cx"> PRIVATE_HEADERS_FOLDER_PATH_Debug = WebCoreTestSupport;
</span><span class="cx"> PRIVATE_HEADERS_FOLDER_PATH_Release = $(PRIVATE_HEADERS_FOLDER_PATH_Debug);
</span><del>-PRIVATE_HEADERS_FOLDER_PATH_Production = /usr/local/include/WebCoreTestSupport;
</del><ins>+PRIVATE_HEADERS_FOLDER_PATH_Production = $(PRIVATE_HEADERS_FOLDER_PATH_Production_$(PLATFORM_NAME));
+PRIVATE_HEADERS_FOLDER_PATH_Production_iphoneos = /usr/local/include/WebCoreTestSupport;
+PRIVATE_HEADERS_FOLDER_PATH_Production_iphonesimulator = $(INDIGO_INSTALL_PATH_PREFIX)$(PRIVATE_HEADERS_FOLDER_PATH_Production_iphoneos);
+PRIVATE_HEADERS_FOLDER_PATH_Production_macosx = /usr/local/include/WebCoreTestSupport;
</ins><span class="cx"> 
</span><del>-INSTALL_PATH = $(INSTALL_PATH_$(CONFIGURATION));
-INSTALL_PATH_Production = /usr/local/lib;
</del><ins>+INSTALL_PATH = $(INSTALL_PATH_$(CONFIGURATION)_$(PLATFORM_NAME));
+INSTALL_PATH_Production_iphoneos = /usr/local/lib;
+INSTALL_PATH_Production_iphonesimulator = $(INDIGO_INSTALL_PATH_PREFIX)$(INSTALL_PATH_Production_iphoneos);
+INSTALL_PATH_Production_macosx = /usr/local/lib;
</ins><span class="cx"> 
</span><span class="cx"> SKIP_INSTALL = $(SKIP_INSTALL_$(FORCE_TOOL_INSTALL));
</span><span class="cx"> SKIP_INSTALL_ = YES;
</span></span></pre></div>
<a id="trunkSourceWebCoreConfigurationsiOSxcconfig"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Configurations/iOS.xcconfig (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Configurations/iOS.xcconfig                                (rev 0)
+++ trunk/Source/WebCore/Configurations/iOS.xcconfig        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+#include &quot;&lt;DEVELOPER_DIR&gt;/AppleInternal/XcodeConfig/AspenFamily.xcconfig&quot;
</ins></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/DerivedSources.make        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> VPATH = \
</span><span class="cx">     $(WebCore) \
</span><ins>+    $(WebCore)/Modules/airplay \
</ins><span class="cx">     $(WebCore)/Modules/encryptedmedia \
</span><span class="cx">     $(WebCore)/Modules/geolocation \
</span><span class="cx">     $(WebCore)/Modules/indexeddb \
</span><span class="lines">@@ -67,6 +68,7 @@
</span><span class="cx"> #
</span><span class="cx"> 
</span><span class="cx"> BINDING_IDLS = \
</span><ins>+    $(WebCore)/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl \
</ins><span class="cx">     $(WebCore)/Modules/encryptedmedia/MediaKeyMessageEvent.idl \
</span><span class="cx">     $(WebCore)/Modules/encryptedmedia/MediaKeyNeededEvent.idl \
</span><span class="cx">     $(WebCore)/Modules/encryptedmedia/MediaKeySession.idl \
</span><span class="lines">@@ -304,9 +306,6 @@
</span><span class="cx">     $(WebCore)/dom/StringCallback.idl \
</span><span class="cx">     $(WebCore)/dom/Text.idl \
</span><span class="cx">     $(WebCore)/dom/TextEvent.idl \
</span><del>-    $(WebCore)/dom/Touch.idl \
-    $(WebCore)/dom/TouchEvent.idl \
-    $(WebCore)/dom/TouchList.idl \
</del><span class="cx">     $(WebCore)/dom/TransitionEvent.idl \
</span><span class="cx">     $(WebCore)/dom/TreeWalker.idl \
</span><span class="cx">     $(WebCore)/dom/UIEvent.idl \
</span><span class="lines">@@ -719,6 +718,12 @@
</span><span class="cx">         SDK_FLAGS=-isysroot $(SDKROOT)
</span><span class="cx"> endif
</span><span class="cx"> 
</span><ins>+ifeq ($(shell $(CC) -isysroot $(SDKROOT) -std=gnu++11 -x c++ -E -P -dM -F $(BUILT_PRODUCTS_DIR) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include &quot;wtf/Platform.h&quot; /dev/null | grep ' WTF_PLATFORM_IOS ' | cut -d' ' -f3), 1)
+    WTF_PLATFORM_IOS = 1
+else
+    WTF_PLATFORM_IOS = 0
+endif
+
</ins><span class="cx"> ifeq ($(shell $(CC) -std=gnu++11 -x c++ -E -P -dM $(SDK_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include &quot;wtf/Platform.h&quot; /dev/null | grep ENABLE_ORIENTATION_EVENTS | cut -d' ' -f3), 1)
</span><span class="cx">     ENABLE_ORIENTATION_EVENTS = 1
</span><span class="cx"> endif
</span><span class="lines">@@ -727,6 +732,32 @@
</span><span class="cx"> PLATFORM_FEATURE_DEFINES = Configurations/FeatureDefines.xcconfig
</span><span class="cx"> endif
</span><span class="cx"> 
</span><ins>+ifeq ($(WTF_PLATFORM_IOS), 1)
+
+ADDITIONAL_BINDING_IDLS = \
+    GestureEvent.idl \
+    Touch.idl \
+    TouchEvent.idl \
+    TouchList.idl
+
+BINDING_IDLS += $(ADDITIONAL_BINDING_IDLS)
+
+all : $(ADDITIONAL_BINDING_IDLS:%.idl=JS%.h)
+
+vpath %.idl $(BUILT_PRODUCTS_DIR)/usr/local/include $(SDKROOT)/usr/local/include
+
+$(ADDITIONAL_BINDING_IDLS) : % : WebKitAdditions/%
+    cp $&lt; .
+
+else
+
+BINDING_IDLS += \
+    $(WebCore)/dom/Touch.idl \
+    $(WebCore)/dom/TouchEvent.idl \
+    $(WebCore)/dom/TouchList.idl
+
+endif
+
</ins><span class="cx"> endif # MACOS
</span><span class="cx"> 
</span><span class="cx"> ifndef ENABLE_ORIENTATION_EVENTS
</span><span class="lines">@@ -1156,15 +1187,52 @@
</span><span class="cx"> 
</span><span class="cx"> ifneq ($(ACTION),installhdrs)
</span><span class="cx"> 
</span><ins>+ifeq ($(WTF_PLATFORM_IOS),1)
+
+ifeq ($(findstring armv6,$(ARCHS)), armv6)
+    WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.armv6.exp
+endif
+ifeq ($(findstring armv7f,$(ARCHS)), armv7f)
+    WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.armv7f.exp
+endif
+ifeq ($(findstring armv7s,$(ARCHS)), armv7s)
+    WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.armv7s.exp
+endif
+ifeq ($(findstring armv7,$(ARCHS)), armv7)
+    WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.armv7.exp
+endif
+ifeq ($(findstring arm64,$(ARCHS)), arm64)
+    WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.arm64.exp
+endif
+ifeq ($(findstring i386,$(ARCHS)), i386)
+    WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.i386.exp
+endif
+ifeq ($(findstring x86_64,$(ARCHS)), x86_64)
+    WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.x86_64.exp
+endif
+
+all : $(WEBCORE_EXPORT_FILES)
+
+WebCore.%.exp : generate-export-file WebCore.exp.in
+    $^ $@
+
+# Switch NSRect, NSSize and NSPoint with their CG counterparts for the 64-bit exports file.
+WebCore.LP64.%.exp : WebCore.%.exp
+    cat $^ | sed -e s/7_NSRect/6CGRect/ -e s/7_NSSize/6CGSize/ -e s/8_NSPoint/7CGPoint/ &gt; $@
+
+else
+
</ins><span class="cx"> all : WebCore.exp WebCore.LP64.exp
</span><span class="cx"> 
</span><span class="cx"> WebCore.exp : $(BUILT_PRODUCTS_DIR)/WebCoreExportFileGenerator
</span><del>-        $^ &gt; $@
</del><ins>+    $^ | grep -v '^# ' | sed -e 's/^#//' &gt; $@
</ins><span class="cx"> 
</span><span class="cx"> # Switch NSRect, NSSize and NSPoint with their CG counterparts for the 64-bit exports file.
</span><span class="cx"> WebCore.LP64.exp : WebCore.exp
</span><span class="cx">         cat $^ | sed -e s/7_NSRect/6CGRect/ -e s/7_NSSize/6CGSize/ -e s/8_NSPoint/7CGPoint/ &gt; $@
</span><span class="cx"> 
</span><ins>+endif # WTF_PLATFORM_IOS
+
</ins><span class="cx"> endif # installhdrs
</span><span class="cx"> 
</span><span class="cx"> # --------
</span></span></pre></div>
<a id="trunkSourceWebCoreEnglishlprojLocalizablestrings"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/English.lproj/Localizable.strings        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -112,6 +112,12 @@
</span><span class="cx"> /* title for a multiple file chooser button used in HTML forms. This title should be as short as possible. */
</span><span class="cx"> &quot;Choose Files&quot; = &quot;Choose Files&quot;;
</span><span class="cx"> 
</span><ins>+/* PLATFORM(IOS) title for file button used in HTML forms for media files */
+&quot;Choose Media (Single)&quot; = &quot;Choose Photo&quot;;
+
+/* PLATFORM(IOS) title for file button used in HTML5 forms for multiple media files */
+&quot;Choose Media (Multiple)&quot; = &quot;Choose Photos&quot;;
+
</ins><span class="cx"> /* menu item in Recent Searches menu that empties menu's contents */
</span><span class="cx"> &quot;Clear Recent Searches&quot; = &quot;Clear Recent Searches&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -157,6 +163,12 @@
</span><span class="cx"> /* Default writing direction context menu item */
</span><span class="cx"> &quot;Default&quot; = &quot;Default&quot;;
</span><span class="cx"> 
</span><ins>+/* PLATFORM(IOS) Undo action name */
+&quot;Delete (Undo action name)&quot; = &quot;Delete&quot;;
+
+/* PLATFORM(IOS) Undo action name */
+&quot;Dictation (Undo action name)&quot; = &quot;Dictation&quot;;
+
</ins><span class="cx"> /* text to display in &lt;details&gt; tag when it has no &lt;summary&gt; child */
</span><span class="cx"> &quot;Details&quot; = &quot;Details&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -781,6 +793,12 @@
</span><span class="cx"> /* text to display in file button used in HTML forms when no files are selected and the button allows multiple files to be selected */
</span><span class="cx"> &quot;no files selected&quot; = &quot;no files selected&quot;;
</span><span class="cx"> 
</span><ins>+/* PLATFORM(IOS) text to display in file button used in HTML forms for media files when no media file is selected */
+&quot;no media selected (single)&quot; = &quot;no photo selected&quot;;
+
+/* PLATFORM(IOS) text to display in file button used in HTML forms for media files when no media files are selected and the button allows multiple files to be selected */
+&quot;no media selected (multiple)&quot; = &quot;no photos selected&quot;;
+
</ins><span class="cx"> /* HTTP result code string */
</span><span class="cx"> &quot;no longer exists&quot; = &quot;no longer exists&quot;;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesairplayWebKitPlaybackTargetAvailabilityEventcppfromrev161637trunkSourceWebCoreeditingTextAffinityh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp (from rev 161637, trunk/Source/WebCore/editing/TextAffinity.h) (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebKitPlaybackTargetAvailabilityEvent.h&quot;
+
+#if ENABLE(IOS_AIRPLAY)
+
+namespace WebCore {
+
+static const AtomicString&amp; stringForPlaybackTargetAvailability(bool available)
+{
+    DEFINE_STATIC_LOCAL(AtomicString, availableString, (&quot;available&quot;, AtomicString::ConstructFromLiteral));
+    DEFINE_STATIC_LOCAL(AtomicString, notAvailableString, (&quot;not-available&quot;, AtomicString::ConstructFromLiteral));
+
+    return available ? availableString : notAvailableString;
+}
+
+WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent()
+{
+}
+
+WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent(const AtomicString&amp; eventType, bool available)
+    : Event(eventType, false, false)
+    , m_availability(stringForPlaybackTargetAvailability(available))
+{
+}
+
+WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent(const AtomicString&amp; eventType, const WebKitPlaybackTargetAvailabilityEventInit&amp; initializer)
+    : Event(eventType, initializer)
+    , m_availability(initializer.availability)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(IOS_AIRPLAY)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesairplayWebKitPlaybackTargetAvailabilityEventh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebKitPlaybackTargetAvailabilityEvent_h
+#define WebKitPlaybackTargetAvailabilityEvent_h
+
+#if ENABLE(IOS_AIRPLAY)
+
+#include &quot;Event.h&quot;
+#include &quot;EventNames.h&quot;
+
+namespace WebCore {
+
+struct WebKitPlaybackTargetAvailabilityEventInit : public EventInit {
+    WebKitPlaybackTargetAvailabilityEventInit()
+    {
+    };
+
+    String availability;
+};
+
+class WebKitPlaybackTargetAvailabilityEvent : public Event {
+public:
+    ~WebKitPlaybackTargetAvailabilityEvent() { }
+
+    static PassRefPtr&lt;WebKitPlaybackTargetAvailabilityEvent&gt; create()
+    {
+        return adoptRef(new WebKitPlaybackTargetAvailabilityEvent);
+    }
+
+    static PassRefPtr&lt;WebKitPlaybackTargetAvailabilityEvent&gt; create(const AtomicString&amp; eventType, bool available)
+    {
+        return adoptRef(new WebKitPlaybackTargetAvailabilityEvent(eventType, available));
+    }
+
+    static PassRefPtr&lt;WebKitPlaybackTargetAvailabilityEvent&gt; create(const AtomicString&amp; eventType, const WebKitPlaybackTargetAvailabilityEventInit&amp; initializer)
+    {
+        return adoptRef(new WebKitPlaybackTargetAvailabilityEvent(eventType, initializer));
+    }
+
+    String availability() const { return m_availability; }
+
+    virtual EventInterface eventInterface() const OVERRIDE { return WebKitPlaybackTargetAvailabilityEventInterfaceType; }
+
+private:
+    WebKitPlaybackTargetAvailabilityEvent();
+    explicit WebKitPlaybackTargetAvailabilityEvent(const AtomicString&amp; eventType, bool available);
+    WebKitPlaybackTargetAvailabilityEvent(const AtomicString&amp; eventType, const WebKitPlaybackTargetAvailabilityEventInit&amp;);
+
+    String m_availability;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(IOS_AIRPLAY)
+
+#endif // WebKitPlaybackTargetAvailabilityEvent_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesairplayWebKitPlaybackTargetAvailabilityEventidlfromrev161637trunkSourceWebCoreeditingDeleteButtonh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl (from rev 161637, trunk/Source/WebCore/editing/DeleteButton.h) (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ *
+ */
+
+[
+    Conditional=IOS_AIRPLAY,
+    ConstructorTemplate=Event
+] interface WebKitPlaybackTargetAvailabilityEvent : Event {
+    [InitializedByEventConstructor] readonly attribute DOMString availability;
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationGeolocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -235,6 +235,11 @@
</span><span class="cx"> Geolocation::Geolocation(ScriptExecutionContext* context)
</span><span class="cx">     : ActiveDOMObject(context)
</span><span class="cx">     , m_allowGeolocation(Unknown)
</span><ins>+#if PLATFORM(IOS)
+    , m_isSuspended(false)
+    , m_hasChangedPosition(false)
+    , m_resumeTimer(this, &amp;Geolocation::resumeTimerFired)
+#endif
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -258,6 +263,123 @@
</span><span class="cx">     return document() ? document()-&gt;page() : 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool Geolocation::canSuspend() const
+{
+    return !hasListeners();
+}
+
+void Geolocation::suspend(ReasonForSuspension reason)
+{
+    // Allow pages that no longer have listeners to enter the page cache.
+    // Have them stop updating and reset geolocation permissions when the page is resumed.
+    if (reason == ActiveDOMObject::DocumentWillBecomeInactive) {
+        ASSERT(!hasListeners());
+        stop();
+        m_resetOnResume = true;
+    }
+
+    // Suspend GeoNotifier timeout timers.
+    if (hasListeners())
+        stopTimers();
+
+    m_isSuspended = true;
+    m_resumeTimer.stop();
+    ActiveDOMObject::suspend(reason);
+}
+
+void Geolocation::resume()
+{
+    ASSERT(WebThreadIsLockedOrDisabled());
+    ActiveDOMObject::resume();
+
+    if (!m_resumeTimer.isActive())
+        m_resumeTimer.startOneShot(0);
+}
+
+void Geolocation::resumeTimerFired(Timer&lt;Geolocation&gt;*)
+{
+    m_isSuspended = false;
+
+    if (m_resetOnResume) {
+        resetAllGeolocationPermission();
+        m_resetOnResume = false;
+    }
+
+    // Resume GeoNotifier timeout timers.
+    if (hasListeners()) {
+        GeoNotifierSet::const_iterator end = m_oneShots.end();
+        for (GeoNotifierSet::const_iterator it = m_oneShots.begin(); it != end; ++it)
+            (*it)-&gt;startTimerIfNeeded();
+        GeoNotifierVector watcherCopy;
+        m_watchers.getNotifiersVector(watcherCopy);
+        for (size_t i = 0; i &lt; watcherCopy.size(); ++i)
+            watcherCopy[i]-&gt;startTimerIfNeeded();
+    }
+
+    if ((isAllowed() || isDenied()) &amp;&amp; !m_pendingForPermissionNotifiers.isEmpty()) {
+        // The pending permission was granted while the object was suspended.
+        setIsAllowed(isAllowed());
+        ASSERT(!m_hasChangedPosition);
+        ASSERT(!m_errorWaitingForResume);
+        return;
+    }
+
+    if (isDenied() &amp;&amp; hasListeners()) {
+        // The permission was revoked while the object was suspended.
+        setIsAllowed(false);
+        return;
+    }
+
+    if (m_hasChangedPosition) {
+        positionChanged();
+        m_hasChangedPosition = false;
+    }
+
+    if (m_errorWaitingForResume) {
+        handleError(m_errorWaitingForResume.get());
+        m_errorWaitingForResume = nullptr;
+    }
+}
+
+void Geolocation::resetAllGeolocationPermission()
+{
+    if (m_isSuspended) {
+        m_resetOnResume = true;
+        return;
+    }
+
+    if (m_allowGeolocation == InProgress) {
+        Page* page = this-&gt;page();
+        if (page)
+            GeolocationController::from(page)-&gt;cancelPermissionRequest(this);
+
+        // This return is not technically correct as GeolocationController::cancelPermissionRequest() should have cleared the active request.
+        // Neither iOS nor OS X supports cancelPermissionRequest() (https://bugs.webkit.org/show_bug.cgi?id=89524), so we workaround that and let ongoing requests complete. :(
+        return;
+    }
+
+    // 1) Reset our own state.
+    stopUpdating();
+    m_allowGeolocation = Unknown;
+    m_hasChangedPosition = false;
+    m_errorWaitingForResume = nullptr;
+
+    // 2) Request new permission for the active notifiers.
+    stopTimers();
+
+    // Go over the one shot and re-request permission.
+    GeoNotifierSet::iterator end = m_oneShots.end();
+    for (GeoNotifierSet::iterator it = m_oneShots.begin(); it != end; ++it)
+        startRequest((*it).get());
+    // Go over the watchers and re-request permission.
+    GeoNotifierVector watcherCopy;
+    m_watchers.getNotifiersVector(watcherCopy);
+    for (size_t i = 0; i &lt; watcherCopy.size(); ++i)
+        startRequest(watcherCopy[i].get());
+}
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> void Geolocation::stop()
</span><span class="cx"> {
</span><span class="cx">     Page* page = this-&gt;page();
</span><span class="lines">@@ -267,6 +389,10 @@
</span><span class="cx">     m_allowGeolocation = Unknown;
</span><span class="cx">     cancelAllRequests();
</span><span class="cx">     stopUpdating();
</span><ins>+#if PLATFORM(IOS)
+    m_hasChangedPosition = false;
+    m_errorWaitingForResume = nullptr;
+#endif // PLATFORM(IOS)
</ins><span class="cx">     m_pendingForPermissionNotifiers.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -429,6 +555,11 @@
</span><span class="cx">     // position.
</span><span class="cx">     m_allowGeolocation = allowed ? Yes : No;
</span><span class="cx">     
</span><ins>+#if PLATFORM(IOS)
+    if (m_isSuspended)
+        return;
+#endif
+
</ins><span class="cx">     // Permission request was made during the startRequest process
</span><span class="cx">     if (!m_pendingForPermissionNotifiers.isEmpty()) {
</span><span class="cx">         handlePendingPermissionNotifiers();
</span><span class="lines">@@ -441,6 +572,11 @@
</span><span class="cx">         error-&gt;setIsFatal(true);
</span><span class="cx">         handleError(error.get());
</span><span class="cx">         m_requestsAwaitingCachedPosition.clear();
</span><ins>+#if PLATFORM(IOS)
+        m_hasChangedPosition = false;
+        m_errorWaitingForResume = nullptr;
+#endif
+
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -620,11 +756,24 @@
</span><span class="cx">     // Stop all currently running timers.
</span><span class="cx">     stopTimers();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if (m_isSuspended) {
+        m_hasChangedPosition = true;
+        return;
+    }
+#endif
+
</ins><span class="cx">     makeSuccessCallbacks();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Geolocation::setError(GeolocationError* error)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (m_isSuspended) {
+        m_errorWaitingForResume = createPositionError(error);
+        return;
+    }
+#endif
</ins><span class="cx">     RefPtr&lt;PositionError&gt; positionError = createPositionError(error);
</span><span class="cx">     handleError(positionError.get());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationGeolocationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/Geolocation.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/geolocation/Geolocation.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -54,6 +54,12 @@
</span><span class="cx">     static PassRefPtr&lt;Geolocation&gt; create(ScriptExecutionContext*);
</span><span class="cx">     ~Geolocation();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    virtual bool canSuspend() const OVERRIDE;
+    virtual void suspend(ReasonForSuspension) OVERRIDE;
+    virtual void resume() OVERRIDE;
+    void resetAllGeolocationPermission();
+#endif // PLATFORM(IOS)
</ins><span class="cx">     Document* document() const;
</span><span class="cx">     Frame* frame() const;
</span><span class="cx"> 
</span><span class="lines">@@ -174,7 +180,16 @@
</span><span class="cx">         Yes,
</span><span class="cx">         No
</span><span class="cx">     } m_allowGeolocation;
</span><ins>+#if PLATFORM(IOS)
+    bool m_isSuspended;
+    bool m_resetOnResume;
+    bool m_hasChangedPosition;
+    RefPtr&lt;PositionError&gt; m_errorWaitingForResume;
</ins><span class="cx"> 
</span><ins>+    void resumeTimerFired(Timer&lt;Geolocation&gt;*);
+    Timer&lt;Geolocation&gt; m_resumeTimer;
+#endif // PLATFORM(IOS)
+
</ins><span class="cx">     GeoNotifierSet m_requestsAwaitingCachedPosition;
</span><span class="cx"> };
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationNavigatorGeolocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -57,6 +57,14 @@
</span><span class="cx">     return supplement;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void NavigatorGeolocation::resetAllGeolocationPermission()
+{
+    if (m_geolocation)
+        m_geolocation-&gt;resetAllGeolocationPermission();
+}
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> Geolocation* NavigatorGeolocation::geolocation(Navigator* navigator)
</span><span class="cx"> {
</span><span class="cx">     return NavigatorGeolocation::from(navigator)-&gt;geolocation();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationNavigatorGeolocationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -39,6 +39,10 @@
</span><span class="cx">     static Geolocation* geolocation(Navigator*);
</span><span class="cx">     Geolocation* geolocation() const;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    void resetAllGeolocationPermission();
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> private:
</span><span class="cx">     NavigatorGeolocation(Frame*);
</span><span class="cx">     static const char* supplementName();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesspeechSpeechSynthesiscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;PlatformSpeechSynthesisVoice.h&quot;
</span><span class="cx"> #include &quot;PlatformSpeechSynthesizer.h&quot;
</span><ins>+#include &quot;ScriptController.h&quot;
</ins><span class="cx"> #include &quot;SpeechSynthesisEvent.h&quot;
</span><span class="cx"> #include &quot;SpeechSynthesisUtterance.h&quot;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="lines">@@ -44,6 +45,9 @@
</span><span class="cx"> SpeechSynthesis::SpeechSynthesis()
</span><span class="cx">     : m_currentSpeechUtterance(0)
</span><span class="cx">     , m_isPaused(false)
</span><ins>+#if PLATFORM(IOS)
+    , m_restrictions(RequireUserGestureForSpeechStartRestriction)
+#endif
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="lines">@@ -112,6 +116,14 @@
</span><span class="cx"> {
</span><span class="cx">     if (!utterance)
</span><span class="cx">         return;
</span><ins>+ 
+    // Like Audio, we should require that the user interact to start a speech synthesis session.
+#if PLATFORM(IOS)
+    if (ScriptController::processingUserGesture())
+        removeBehaviorRestriction(RequireUserGestureForSpeechStartRestriction);
+    else if (userGestureRequiredForSpeechStart())
+        return;
+#endif
</ins><span class="cx">     
</span><span class="cx">     m_utteranceQueue.append(utterance);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesspeechSpeechSynthesish"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/speech/SpeechSynthesis.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/speech/SpeechSynthesis.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/speech/SpeechSynthesis.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -76,11 +76,26 @@
</span><span class="cx">     void handleSpeakingCompleted(SpeechSynthesisUtterance*, bool errorOccurred);
</span><span class="cx">     void fireEvent(const AtomicString&amp; type, SpeechSynthesisUtterance*, unsigned long charIndex, const String&amp; name);
</span><span class="cx">     
</span><ins>+#if PLATFORM(IOS)
+    // Restrictions to change default behaviors.
+    enum BehaviorRestrictionFlags {
+        NoRestrictions = 0,
+        RequireUserGestureForSpeechStartRestriction = 1 &lt;&lt; 0,
+    };
+    typedef unsigned BehaviorRestrictions;
+    
+    bool userGestureRequiredForSpeechStart() const { return m_restrictions &amp; RequireUserGestureForSpeechStartRestriction; }
+    void removeBehaviorRestriction(BehaviorRestrictions restriction) { m_restrictions &amp;= ~restriction; }
+#endif
+    
</ins><span class="cx">     OwnPtr&lt;PlatformSpeechSynthesizer&gt; m_platformSpeechSynthesizer;
</span><span class="cx">     Vector&lt;RefPtr&lt;SpeechSynthesisVoice&gt;&gt; m_voiceList;
</span><span class="cx">     SpeechSynthesisUtterance* m_currentSpeechUtterance;
</span><span class="cx">     Deque&lt;RefPtr&lt;SpeechSynthesisUtterance&gt;&gt; m_utteranceQueue;
</span><span class="cx">     bool m_isPaused;
</span><ins>+#if PLATFORM(IOS)
+    BehaviorRestrictions m_restrictions;
+#endif
</ins><span class="cx"> };
</span><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -80,6 +80,11 @@
</span><span class="cx"> #include &quot;GStreamerUtilities.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;ScriptController.h&quot;
+#include &quot;Settings.h&quot;
+#endif
+
</ins><span class="cx"> #include &lt;runtime/ArrayBuffer.h&gt;
</span><span class="cx"> #include &lt;wtf/Atomics.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioContext.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioContext.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webaudio/AudioContext.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -96,7 +96,6 @@
</span><span class="cx">     virtual void stop() OVERRIDE;
</span><span class="cx"> 
</span><span class="cx">     Document* document() const; // ASSERTs if document no longer exists.
</span><del>-    bool hasDocument();
</del><span class="cx"> 
</span><span class="cx">     AudioDestinationNode* destination() { return m_destinationNode.get(); }
</span><span class="cx">     size_t currentSampleFrame() const { return m_destinationNode-&gt;currentSampleFrame(); }
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebaudioAudioScheduledSourceNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -35,6 +35,10 @@
</span><span class="cx"> #include &lt;algorithm&gt;
</span><span class="cx"> #include &lt;wtf/MathExtras.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;ScriptController.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> const double AudioScheduledSourceNode::UnknownTime = -1;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/Database.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/Database.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -60,6 +60,10 @@
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;SQLiteDatabaseTracker.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Database&gt; Database::create(ScriptExecutionContext*, PassRefPtr&lt;DatabaseBackendBase&gt; backend)
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseBackendBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -52,6 +52,10 @@
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;SQLiteDatabaseTracker.h&quot;
+#endif
+
</ins><span class="cx"> // Registering &quot;opened&quot; databases with the DatabaseTracker
</span><span class="cx"> // =======================================================
</span><span class="cx"> // The DatabaseTracker maintains a list of databases that have been
</span><span class="lines">@@ -314,6 +318,14 @@
</span><span class="cx"> 
</span><span class="cx">     const int maxSqliteBusyWaitTime = 30000;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    {
+        // Make sure we wait till the background removal of the empty database files finished before trying to open any database.
+        MutexLocker locker(DatabaseTracker::openDatabaseMutex());
+    }
+    SQLiteTransactionInProgressAutoCounter transactionCounter;
+#endif
+
</ins><span class="cx">     if (!m_sqliteDatabase.open(m_filename, true)) {
</span><span class="cx">         errorMessage = formatErrorMessage(&quot;unable to open database&quot;, m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
</span><span class="cx">         return false;
</span><span class="lines">@@ -564,6 +576,9 @@
</span><span class="cx"> 
</span><span class="cx"> void DatabaseBackendBase::incrementalVacuumIfNeeded()
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    SQLiteTransactionInProgressAutoCounter transactionCounter;
+#endif
</ins><span class="cx">     int64_t freeSpaceSize = m_sqliteDatabase.freeSpaceSize();
</span><span class="cx">     int64_t totalSize = m_sqliteDatabase.totalSize();
</span><span class="cx">     if (totalSize &lt;= 10 * freeSpaceSize) {
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -102,6 +102,9 @@
</span><span class="cx">     , m_hasOpenDatabases(false)
</span><span class="cx">     , m_isRegistered(true) // will register on construction below.
</span><span class="cx">     , m_hasRequestedTermination(false)
</span><ins>+#if PLATFORM(IOS)
+    , m_paused(false)
+#endif //PLATFORM(IOS)
</ins><span class="cx"> {
</span><span class="cx">     // ActiveDOMObject expects this to be called to set internal flags.
</span><span class="cx">     suspendIfNeeded();
</span><span class="lines">@@ -161,6 +164,9 @@
</span><span class="cx"> DatabaseThread* DatabaseContext::databaseThread()
</span><span class="cx"> {
</span><span class="cx">     if (!m_databaseThread &amp;&amp; !m_hasOpenDatabases) {
</span><ins>+#if PLATFORM(IOS)
+        MutexLocker lock(m_databaseThreadMutex);
+#endif //PLATFORM(IOS)
</ins><span class="cx">         // It's OK to ask for the m_databaseThread after we've requested
</span><span class="cx">         // termination because we're still using it to execute the closing
</span><span class="cx">         // of the database. However, it is NOT OK to create a new thread
</span><span class="lines">@@ -172,11 +178,26 @@
</span><span class="cx">         m_databaseThread = DatabaseThread::create();
</span><span class="cx">         if (!m_databaseThread-&gt;start())
</span><span class="cx">             m_databaseThread = 0;
</span><ins>+#if PLATFORM(IOS)
+        if (m_databaseThread)
+            m_databaseThread-&gt;setPaused(m_paused);
+#endif //PLATFORM(IOS)
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return m_databaseThread.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void DatabaseContext::setPaused(bool paused)
+{
+    MutexLocker lock(m_databaseThreadMutex);
+
+    m_paused = paused;
+    if (m_databaseThread)
+        m_databaseThread-&gt;setPaused(m_paused);
+}
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> bool DatabaseContext::stopDatabases(DatabaseTaskSynchronizer* cleanupSync)
</span><span class="cx"> {
</span><span class="cx">     if (m_isRegistered) {
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -35,6 +35,10 @@
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;wtf/Threading.h&gt;
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Database;
</span><span class="lines">@@ -53,6 +57,9 @@
</span><span class="cx"> 
</span><span class="cx">     PassRefPtr&lt;DatabaseBackendContext&gt; backend();
</span><span class="cx">     DatabaseThread* databaseThread();
</span><ins>+#if PLATFORM(IOS)
+    void setPaused(bool);
+#endif // PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx">     void setHasOpenDatabases() { m_hasOpenDatabases = true; }
</span><span class="cx">     bool hasOpenDatabases() { return m_hasOpenDatabases; }
</span><span class="lines">@@ -75,6 +82,11 @@
</span><span class="cx"> 
</span><span class="cx">     friend class DatabaseBackendContext;
</span><span class="cx">     friend class DatabaseManager;
</span><ins>+
+#if PLATFORM(IOS)
+    Mutex m_databaseThreadMutex;
+    bool m_paused;
+#endif // PLATFORM(IOS)
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseManagerClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseManagerClient.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseManagerClient.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseManagerClient.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -38,6 +38,12 @@
</span><span class="cx">     virtual ~DatabaseManagerClient() { }
</span><span class="cx">     virtual void dispatchDidModifyOrigin(SecurityOrigin*) = 0;
</span><span class="cx">     virtual void dispatchDidModifyDatabase(SecurityOrigin*, const String&amp; databaseName) = 0;
</span><ins>+
+#if PLATFORM(IOS)
+    virtual void dispatchDidAddNewOrigin(SecurityOrigin*) = 0;
+    virtual void dispatchDidDeleteDatabase() = 0;
+    virtual void dispatchDidDeleteDatabaseOrigin() = 0;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseTaskcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -85,7 +85,13 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(StorageAPI, &quot;Performing %s %p\n&quot;, debugTaskName(), this);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     m_database-&gt;resetAuthorizer();
</span><ins>+#else
+    if (m_database)
+        m_database-&gt;resetAuthorizer();
+#endif
+
</ins><span class="cx">     doPerformTask();
</span><span class="cx"> 
</span><span class="cx">     if (m_synchronizer)
</span><span class="lines">@@ -168,6 +174,13 @@
</span><span class="cx">         m_transaction-&gt;notifyDatabaseThreadIsShuttingDown();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool Database::DatabaseTransactionTask::shouldPerformWhilePaused() const
+{
+    return m_transaction-&gt;shouldPerformWhilePaused();
+}
+#endif
+
</ins><span class="cx"> void DatabaseBackend::DatabaseTransactionTask::doPerformTask()
</span><span class="cx"> {
</span><span class="cx">     m_transaction-&gt;performNextStep();
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseTaskh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -75,6 +75,10 @@
</span><span class="cx"> public:
</span><span class="cx">     virtual ~DatabaseTask();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    virtual bool shouldPerformWhilePaused() const = 0;
+#endif
+
</ins><span class="cx">     void performTask();
</span><span class="cx"> 
</span><span class="cx">     DatabaseBackend* database() const { return m_database; }
</span><span class="lines">@@ -104,6 +108,10 @@
</span><span class="cx">     {
</span><span class="cx">         return std::unique_ptr&lt;DatabaseOpenTask&gt;(new DatabaseOpenTask(db, setVersionInNewDatabase, synchronizer, error, errorMessage, success));
</span><span class="cx">     }
</span><ins>+    
+#if PLATFORM(IOS)
+    virtual bool shouldPerformWhilePaused() const OVERRIDE { return true; }
+#endif
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     DatabaseOpenTask(DatabaseBackend*, bool setVersionInNewDatabase, DatabaseTaskSynchronizer*, DatabaseError&amp;, String&amp; errorMessage, bool&amp; success);
</span><span class="lines">@@ -126,6 +134,10 @@
</span><span class="cx">         return std::unique_ptr&lt;DatabaseCloseTask&gt;(new DatabaseCloseTask(db, synchronizer));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    virtual bool shouldPerformWhilePaused() const OVERRIDE { return true; }
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     DatabaseCloseTask(DatabaseBackend*, DatabaseTaskSynchronizer*);
</span><span class="cx"> 
</span><span class="lines">@@ -145,6 +157,10 @@
</span><span class="cx">         return std::unique_ptr&lt;DatabaseTransactionTask&gt;(new DatabaseTransactionTask(transaction));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    virtual bool shouldPerformWhilePaused() const OVERRIDE;
+#endif
+
</ins><span class="cx">     SQLTransactionBackend* transaction() const { return m_transaction.get(); }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -166,6 +182,10 @@
</span><span class="cx">         return std::unique_ptr&lt;DatabaseTableNamesTask&gt;(new DatabaseTableNamesTask(db, synchronizer, names));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    virtual bool shouldPerformWhilePaused() const OVERRIDE { return true; }
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     DatabaseTableNamesTask(DatabaseBackend*, DatabaseTaskSynchronizer*, Vector&lt;String&gt;&amp; names);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -42,6 +42,9 @@
</span><span class="cx"> 
</span><span class="cx"> DatabaseThread::DatabaseThread()
</span><span class="cx">     : m_threadID(0)
</span><ins>+#if PLATFORM(IOS)
+    , m_paused(false)
+#endif
</ins><span class="cx">     , m_transactionClient(adoptPtr(new SQLTransactionClient()))
</span><span class="cx">     , m_transactionCoordinator(adoptPtr(new SQLTransactionCoordinator()))
</span><span class="cx">     , m_cleanupSync(0)
</span><span class="lines">@@ -77,6 +80,9 @@
</span><span class="cx"> {
</span><span class="cx">     m_cleanupSync = cleanupSync;
</span><span class="cx">     LOG(StorageAPI, &quot;DatabaseThread %p was asked to terminate\n&quot;, this);
</span><ins>+#if PLATFORM(IOS)
+    m_pausedQueue.kill();
+#endif
</ins><span class="cx">     m_queue.kill();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -98,6 +104,80 @@
</span><span class="cx">     dbThread-&gt;databaseThread();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+class DatabaseUnpauseTask : public DatabaseTask {
+public:
+    static std::unique_ptr&lt;DatabaseUnpauseTask&gt; create(DatabaseThread* thread)
+    {
+        return std::unique_ptr&lt;DatabaseUnpauseTask&gt;(new DatabaseUnpauseTask(thread));
+    }
+    
+    virtual bool shouldPerformWhilePaused() const 
+    {
+        // Since we're not locking the DatabaseThread::m_paused in the main database thread loop, it's possible that
+        // a DatabaseUnpauseTask might be added to the m_pausedQueue and performed from within ::handlePausedQueue.
+        // To protect against this, we allow it to be performed even if the database is paused.
+        // If the thread is paused when it is being performed, the tasks from the paused queue will simply be
+        // requeued instead of performed.
+        return true;
+    }
+
+private:
+    DatabaseUnpauseTask(DatabaseThread* thread)
+        : DatabaseTask(0, 0)
+        , m_thread(thread)
+    {}
+
+    virtual void doPerformTask()
+    {
+        m_thread-&gt;handlePausedQueue();
+    }
+#if !LOG_DISABLED
+    virtual const char* debugTaskName() const { return &quot;DatabaseUnpauseTask&quot;; }
+#endif
+
+    DatabaseThread* m_thread;
+};
+
+
+void DatabaseThread::setPaused(bool paused)
+{
+    if (m_paused == paused)
+        return;
+
+    MutexLocker pausedLocker(m_pausedMutex);
+    m_paused = paused;
+    if (!m_paused)
+        scheduleTask(DatabaseUnpauseTask::create(this));
+}
+
+void DatabaseThread::handlePausedQueue()
+{
+    Vector&lt;std::unique_ptr&lt;DatabaseTask&gt; &gt; pausedTasks;
+    while (auto task = m_pausedQueue.tryGetMessage())
+        pausedTasks.append(std::move(task));
+
+    for (unsigned i = 0; i &lt; pausedTasks.size(); ++i) {
+        AutodrainedPool pool;
+
+        std::unique_ptr&lt;DatabaseTask&gt; task(pausedTasks[i].release());
+        {
+            MutexLocker pausedLocker(m_pausedMutex);
+            if (m_paused) {
+                m_pausedQueue.append(std::move(task));
+                continue;
+            }
+        }
+            
+        if (terminationRequested())
+            break;
+    
+        task-&gt;performTask();
+    }
+}
+#endif //PLATFORM(IOS)
+
+
</ins><span class="cx"> void DatabaseThread::databaseThread()
</span><span class="cx"> {
</span><span class="cx">     {
</span><span class="lines">@@ -109,7 +189,14 @@
</span><span class="cx">     while (auto task = m_queue.waitForMessage()) {
</span><span class="cx">         AutodrainedPool pool;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        if (!m_paused || task-&gt;shouldPerformWhilePaused())
+            task-&gt;performTask();
+        else
+            m_pausedQueue.append(std::move(task));
+#else
</ins><span class="cx">         task-&gt;performTask();
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Clean up the list of all pending transactions on this database thread
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseThreadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -69,6 +69,11 @@
</span><span class="cx">     SQLTransactionClient* transactionClient() { return m_transactionClient.get(); }
</span><span class="cx">     SQLTransactionCoordinator* transactionCoordinator() { return m_transactionCoordinator.get(); }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    void setPaused(bool);
+    void handlePausedQueue();
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     DatabaseThread();
</span><span class="cx"> 
</span><span class="lines">@@ -80,6 +85,11 @@
</span><span class="cx">     RefPtr&lt;DatabaseThread&gt; m_selfRef;
</span><span class="cx"> 
</span><span class="cx">     MessageQueue&lt;DatabaseTask&gt; m_queue;
</span><ins>+#if PLATFORM(IOS)
+    MessageQueue&lt;DatabaseTask&gt; m_pausedQueue;
+    Mutex m_pausedMutex;
+    volatile bool m_paused;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     // This set keeps track of the open databases that have been used on this thread.
</span><span class="cx">     typedef HashSet&lt;RefPtr&lt;DatabaseBackend&gt;&gt; DatabaseSet;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseTrackercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><span class="cx"> #include &quot;ChromeClient.h&quot;
</span><ins>+#include &quot;Database.h&quot;
</ins><span class="cx"> #include &quot;DatabaseBackendBase.h&quot;
</span><span class="cx"> #include &quot;DatabaseBackendContext.h&quot;
</span><span class="cx"> #include &quot;DatabaseManager.h&quot;
</span><span class="lines">@@ -50,6 +51,10 @@
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static DatabaseTracker* staticTracker = 0;
</span><span class="lines">@@ -741,6 +746,10 @@
</span><span class="cx">     openTrackerDatabase(CreateIfDoesNotExist);
</span><span class="cx">     if (!m_database.isOpen())
</span><span class="cx">         return;
</span><ins>+    
+#if PLATFORM(IOS)
+    bool insertedNewOrigin = false;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     bool originEntryExists = hasEntryForOriginNoLock(origin);
</span><span class="cx">     if (!originEntryExists) {
</span><span class="lines">@@ -753,6 +762,10 @@
</span><span class="cx"> 
</span><span class="cx">             if (statement.step() != SQLResultDone)
</span><span class="cx">                 LOG_ERROR(&quot;Unable to establish origin %s in the tracker&quot;, origin-&gt;databaseIdentifier().ascii().data());
</span><ins>+#if PLATFORM(IOS)
+            else
+                insertedNewOrigin = true;
+#endif
</ins><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         SQLiteStatement statement(m_database, &quot;UPDATE Origins SET quota=? WHERE origin=?&quot;);
</span><span class="lines">@@ -769,7 +782,15 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_client)
</span><ins>+#if PLATFORM(IOS)
+    {
+        if (insertedNewOrigin)
+            m_client-&gt;dispatchDidAddNewOrigin(origin);
+#endif
</ins><span class="cx">         m_client-&gt;dispatchDidModifyOrigin(origin);
</span><ins>+#if PLATFORM(IOS)
+    }
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool DatabaseTracker::addDatabase(SecurityOrigin* origin, const String&amp; name, const String&amp; path)
</span><span class="lines">@@ -897,6 +918,9 @@
</span><span class="cx"> 
</span><span class="cx">         if (m_client) {
</span><span class="cx">             m_client-&gt;dispatchDidModifyOrigin(origin);
</span><ins>+#if PLATFORM(IOS)
+            m_client-&gt;dispatchDidDeleteDatabaseOrigin();
+#endif
</ins><span class="cx">             for (unsigned i = 0; i &lt; databaseNames.size(); ++i)
</span><span class="cx">                 m_client-&gt;dispatchDidModifyDatabase(origin, databaseNames[i]);
</span><span class="cx">         }
</span><span class="lines">@@ -1062,6 +1086,9 @@
</span><span class="cx">     if (m_client) {
</span><span class="cx">         m_client-&gt;dispatchDidModifyOrigin(origin);
</span><span class="cx">         m_client-&gt;dispatchDidModifyDatabase(origin, name);
</span><ins>+#if PLATFORM(IOS)
+        m_client-&gt;dispatchDidDeleteDatabase();
+#endif
</ins><span class="cx">     }
</span><span class="cx">     doneDeletingDatabase(origin, name);
</span><span class="cx">     
</span><span class="lines">@@ -1110,9 +1137,203 @@
</span><span class="cx">     for (unsigned i = 0; i &lt; deletedDatabases.size(); ++i)
</span><span class="cx">         deletedDatabases[i]-&gt;markAsDeletedAndClose();
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     return SQLiteFileSystem::deleteDatabaseFile(fullPath);
</span><ins>+#else
+    // On the phone, other background processes may still be accessing this database.  Deleting the database directly
+    // would nuke the POSIX file locks, potentially causing Safari/WebApp to corrupt the new db if it's running in the background.
+    // We'll instead truncate the database file to 0 bytes.  If another process is operating on this same database file after
+    // the truncation, it should get an error since the database file is no longer valid.  When Safari is launched
+    // next time, it'll go through the database files and clean up any zero-bytes ones.
+    SQLiteDatabase database;
+    if (database.open(fullPath))
+        return SQLiteFileSystem::truncateDatabaseFile(database.sqlite3Handle());
+    return false;
+#endif
</ins><span class="cx"> }
</span><ins>+    
+#if PLATFORM(IOS)
+void DatabaseTracker::removeDeletedOpenedDatabases()
+{
+    // This is called when another app has deleted a database.  Go through all opened databases in this
+    // tracker and close any that's no longer being tracked in the database.
+    
+    {
+        // Acquire the lock before calling openTrackerDatabase.
+        MutexLocker lockDatabase(m_databaseGuard);
+        openTrackerDatabase(DontCreateIfDoesNotExist);
+    }
</ins><span class="cx"> 
</span><ins>+    if (!m_database.isOpen())
+        return;
+    
+    // Keep track of which opened databases have been deleted.
+    Vector&lt;RefPtr&lt;Database&gt; &gt; deletedDatabases;
+    typedef HashMap&lt;RefPtr&lt;SecurityOrigin&gt;, Vector&lt;String&gt; &gt; DeletedDatabaseMap;
+    DeletedDatabaseMap deletedDatabaseMap;
+    
+    // Make sure not to hold the m_openDatabaseMapGuard mutex when calling
+    // Database::markAsDeletedAndClose(), since that can cause a deadlock
+    // during the synchronous DatabaseThread call it triggers.
+    {
+        MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+        if (m_openDatabaseMap) {
+            DatabaseOriginMap::const_iterator originMapEnd = m_openDatabaseMap-&gt;end();
+            for (DatabaseOriginMap::const_iterator originMapIt = m_openDatabaseMap-&gt;begin(); originMapIt != originMapEnd; ++originMapIt) {
+                RefPtr&lt;SecurityOrigin&gt; origin = originMapIt-&gt;key;
+                DatabaseNameMap* databaseNameMap = originMapIt-&gt;value;
+                Vector&lt;String&gt; deletedDatabaseNamesForThisOrigin;
+
+                // Loop through all opened databases in this origin.  Get the current database file path of each database and see if
+                // it still matches the path stored in the opened database object.
+                DatabaseNameMap::const_iterator dbNameMapEnd = databaseNameMap-&gt;end();
+                for (DatabaseNameMap::const_iterator dbNameMapIt = databaseNameMap-&gt;begin(); dbNameMapIt != dbNameMapEnd; ++dbNameMapIt) {
+                    String databaseName = dbNameMapIt-&gt;key;
+                    String databaseFileName;
+                    SQLiteStatement statement(m_database, &quot;SELECT path FROM Databases WHERE origin=? AND name=?;&quot;);
+                    if (statement.prepare() == SQLResultOk) {
+                        statement.bindText(1, origin-&gt;databaseIdentifier());
+                        statement.bindText(2, databaseName);
+                        if (statement.step() == SQLResultRow)
+                            databaseFileName = statement.getColumnText(0);
+                        statement.finalize();
+                    }
+                    
+                    bool foundDeletedDatabase = false;
+                    DatabaseSet* databaseSet = dbNameMapIt-&gt;value;
+                    DatabaseSet::const_iterator dbEnd = databaseSet-&gt;end();
+                    for (DatabaseSet::const_iterator dbIt = databaseSet-&gt;begin(); dbIt != dbEnd; ++dbIt) {
+                        Database* db = static_cast&lt;Database*&gt;(*dbIt);
+                        
+                        // We are done if this database has already been marked as deleted.
+                        if (db-&gt;deleted())
+                            continue;
+                        
+                        // If this database has been deleted or if its database file no longer matches the current version, this database is no longer valid and it should be marked as deleted.
+                        if (databaseFileName.isNull() || databaseFileName != pathGetFileName(db-&gt;fileName())) {
+                            deletedDatabases.append(db);
+                            foundDeletedDatabase = true;
+                        }
+                    }
+                    
+                    // If the database no longer exists, we should remember to remove it from the OriginQuotaManager later.
+                    if (foundDeletedDatabase &amp;&amp; databaseFileName.isNull())
+                        deletedDatabaseNamesForThisOrigin.append(databaseName);
+                }
+                
+                if (!deletedDatabaseNamesForThisOrigin.isEmpty())
+                    deletedDatabaseMap.set(origin, deletedDatabaseNamesForThisOrigin);
+            }
+        }
+    }
+    
+    for (unsigned i = 0; i &lt; deletedDatabases.size(); ++i)
+        deletedDatabases[i]-&gt;markAsDeletedAndClose();
+    
+    DeletedDatabaseMap::const_iterator end = deletedDatabaseMap.end();
+    for (DeletedDatabaseMap::const_iterator it = deletedDatabaseMap.begin(); it != end; ++it) {
+        SecurityOrigin* origin = it-&gt;key.get();
+        if (m_client)
+            m_client-&gt;dispatchDidModifyOrigin(origin);
+        
+        const Vector&lt;String&gt;&amp; databaseNames = it-&gt;value;
+        for (unsigned i = 0; i &lt; databaseNames.size(); ++i) {
+            if (m_client)
+                m_client-&gt;dispatchDidModifyDatabase(origin, databaseNames[i]);
+        }        
+    }
+}
+    
+static bool isZeroByteFile(const String&amp; path)
+{
+    long long size = 0;
+    return getFileSize(path, size) &amp;&amp; !size;
+}
+    
+bool DatabaseTracker::deleteDatabaseFileIfEmpty(const String&amp; path)
+{
+    if (!isZeroByteFile(path))
+        return false;
+    
+    SQLiteDatabase database;
+    if (!database.open(path))
+        return false;
+    
+    // Specify that we want the exclusive locking mode, so after the next read,
+    // we'll be holding the lock to this database file.
+    SQLiteStatement lockStatement(database, &quot;PRAGMA locking_mode=EXCLUSIVE;&quot;);
+    if (lockStatement.prepare() != SQLResultOk)
+        return false;
+    int result = lockStatement.step();
+    if (result != SQLResultRow &amp;&amp; result != SQLResultDone)
+        return false;
+    lockStatement.finalize();
+
+    // Every sqlite database has a sqlite_master table that contains the schema for the database.
+    // http://www.sqlite.org/faq.html#q7
+    SQLiteStatement readStatement(database, &quot;SELECT * FROM sqlite_master LIMIT 1;&quot;);    
+    if (readStatement.prepare() != SQLResultOk)
+        return false;
+    // We shouldn't expect any result.
+    if (readStatement.step() != SQLResultDone)
+        return false;
+    readStatement.finalize();
+    
+    // At this point, we hold the exclusive lock to this file.  Double-check again to make sure
+    // it's still zero bytes.
+    if (!isZeroByteFile(path))
+        return false;
+    
+    return SQLiteFileSystem::deleteDatabaseFile(path);
+}
+
+Mutex&amp; DatabaseTracker::openDatabaseMutex()
+{
+    DEFINE_STATIC_LOCAL(Mutex, mutex, ());
+    return mutex;
+}
+
+void DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled()
+{
+    // Lock the database from opening any database until we are done with scanning the file system for
+    // zero byte database files to remove.
+    openDatabaseMutex().lock();
+}
+
+void DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish()
+{
+    openDatabaseMutex().unlock();
+}
+
+void DatabaseTracker::setDatabasesPaused(bool paused)
+{
+    MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
+    if (!m_openDatabaseMap)
+        return;
+
+    // This walking is - sadly - the only reliable way to get at each open database thread.
+    // This will be cleaner once &lt;rdar://problem/5680441&gt; or some other DB thread consolidation takes place.
+    DatabaseOriginMap::iterator i = m_openDatabaseMap.get()-&gt;begin();
+    DatabaseOriginMap::iterator end = m_openDatabaseMap.get()-&gt;end();
+    
+    for (; i != end; ++i) {
+        DatabaseNameMap* databaseNameMap = i-&gt;value;
+        DatabaseNameMap::iterator j = databaseNameMap-&gt;begin();
+        DatabaseNameMap::iterator dbNameMapEnd = databaseNameMap-&gt;end();
+        for (; j != dbNameMapEnd; ++j) {
+            DatabaseSet* databaseSet = j-&gt;value;
+            DatabaseSet::iterator k = databaseSet-&gt;begin();
+            DatabaseSet::iterator dbSetEnd = databaseSet-&gt;end();
+            for (; k != dbSetEnd; ++k) {
+                DatabaseContext* context = (*k)-&gt;databaseContext();
+                context-&gt;setPaused(paused);
+            }
+        }
+    }
+}
+
+#endif
+
</ins><span class="cx"> void DatabaseTracker::setClient(DatabaseManagerClient* client)
</span><span class="cx"> {
</span><span class="cx">     m_client = client;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseDatabaseTrackerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -100,6 +100,21 @@
</span><span class="cx">     bool deleteOrigin(SecurityOrigin*);
</span><span class="cx">     bool deleteDatabase(SecurityOrigin*, const String&amp; name);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    void removeDeletedOpenedDatabases();
+    static bool deleteDatabaseFileIfEmpty(const String&amp;);
+
+    // MobileSafari will grab this mutex on the main thread before dispatching the task to 
+    // clean up zero byte database files.  Any operations to open new database will have to
+    // wait for that task to finish by waiting on this mutex.
+    static Mutex&amp; openDatabaseMutex();
+    
+    static void emptyDatabaseFilesRemovalTaskWillBeScheduled();
+    static void emptyDatabaseFilesRemovalTaskDidFinish();
+    
+    void setDatabasesPaused(bool);
+#endif
+    
</ins><span class="cx">     void setClient(DatabaseManagerClient*);
</span><span class="cx"> 
</span><span class="cx">     // From a secondary thread, must be thread safe with its data
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -518,6 +518,14 @@
</span><span class="cx">     runStateMachine();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool SQLTransactionBackend::shouldPerformWhilePaused() const
+{
+    // SQLTransactions should only run-while-paused if they have progressed passed the first transaction step.
+    return m_nextState != SQLTransactionState::AcquireLock;
+}
+#endif
+
</ins><span class="cx"> void SQLTransactionBackend::executeSQL(PassOwnPtr&lt;AbstractSQLStatement&gt; statement,
</span><span class="cx">     const String&amp; sqlStatement, const Vector&lt;SQLValue&gt;&amp; arguments, int permissions)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebdatabaseSQLTransactionBackendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -68,6 +68,10 @@
</span><span class="cx">     void lockAcquired();
</span><span class="cx">     void performNextStep();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    bool shouldPerformWhilePaused() const;
+#endif
+
</ins><span class="cx">     DatabaseBackend* database() { return m_database.get(); }
</span><span class="cx">     bool isReadOnly() { return m_readOnly; }
</span><span class="cx">     void notifyDatabaseThreadIsShuttingDown();
</span></span></pre></div>
<a id="trunkSourceWebCoreResourcesDictationPhraseWithAlternativesDotpng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/DictationPhraseWithAlternativesDot.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/DictationPhraseWithAlternativesDot.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourcesDictationPhraseWithAlternativesDot2xpng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/DictationPhraseWithAlternativesDot@2x.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/DictationPhraseWithAlternativesDot@2x.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourcesSpellingDotpng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/SpellingDot.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/SpellingDot.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourcesSpellingDot2xpng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/SpellingDot@2x.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/SpellingDot@2x.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourcesdecrementArrowtiff"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Resources/decrementArrow.tiff (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Resources/decrementArrow.tiff                                (rev 0)
+++ trunk/Source/WebCore/Resources/decrementArrow.tiff        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+MM*L;x;x\xB3\xB3;w\xB3\xB3\xB3\xB3&lt;x\xB3\xB3\xB3\xB3\xB3\xB3:\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2:w\xB2\xB3\xB2\xB2\xB2\xB2:v\xB2\xB3\xB3\xB3:v\xB1\xB2:v                D(RSHH
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreResourceshScrollControl_leftpng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/hScrollControl_left.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/hScrollControl_left.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourceshScrollControl_middlepng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/hScrollControl_middle.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/hScrollControl_middle.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourceshScrollControl_rightpng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/hScrollControl_right.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/hScrollControl_right.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourcesincrementArrowtiff"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Resources/incrementArrow.tiff (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Resources/incrementArrow.tiff                                (rev 0)
+++ trunk/Source/WebCore/Resources/incrementArrow.tiff        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+MM*Lx;\xB3\xB3x;\xB3\xB3\xB3\xB3w;\xB3\xB3\xB3\xB3\xB3\xB3x&lt;\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2:\xB2\xB2\xB2\xB2\xB3\xB2w:\xB3\xB3\xB3\xB2v:\xB2\xB1v:v:                D(RSHH
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreResourcesmarkedLeftpng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/markedLeft.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/markedLeft.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourcesmarkedMiddlepng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/markedMiddle.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/markedMiddle.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourcesmarkedRightpng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/markedRight.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/markedRight.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourcesvScrollControl_bottompng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/vScrollControl_bottom.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/vScrollControl_bottom.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourcesvScrollControl_middlepng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/vScrollControl_middle.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/vScrollControl_middle.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreResourcesvScrollControl_toppng"></a>
<div class="binary"><h4>Added: trunk/Source/WebCore/Resources/vScrollControl_top.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/Source/WebCore/Resources/vScrollControl_top.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx">                 01D3CF8514BD0A3000FE9970 /* WebGLContextObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 01D3CF7F14BD0A3000FE9970 /* WebGLContextObject.h */; };
</span><span class="cx">                 01D3CF8614BD0A3000FE9970 /* WebGLSharedObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 01D3CF8014BD0A3000FE9970 /* WebGLSharedObject.cpp */; };
</span><span class="cx">                 01D3CF8714BD0A3000FE9970 /* WebGLSharedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 01D3CF8114BD0A3000FE9970 /* WebGLSharedObject.h */; };
</span><ins>+                01E6C2E41194B2820050821C /* SpellingDot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 01E6C2E31194B2820050821C /* SpellingDot@2x.png */; };
</ins><span class="cx">                 0562F9461573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0562F9441573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp */; };
</span><span class="cx">                 0562F9471573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0562F9451573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h */; };
</span><span class="cx">                 0562F9611573F88F0031CA16 /* PlatformLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0562F9601573F88F0031CA16 /* PlatformLayer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3567,6 +3568,8 @@
</span><span class="cx">                 A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */; };
</span><span class="cx">                 A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */; };
</span><span class="cx">                 A1C7FAA2133A5D3500D6732D /* JSXPathResultCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1C7FAA1133A5D3500D6732D /* JSXPathResultCustom.cpp */; };
</span><ins>+                A1DE712D18612AC100734192 /* TouchEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1DE712B18612AC100734192 /* TouchEvents.cpp */; };
+                A1DE71321861322200734192 /* TouchConstructors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1DE71301861322200734192 /* TouchConstructors.cpp */; };
</ins><span class="cx">                 A1E1154413015C3D0054AC8C /* DistantLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */; };
</span><span class="cx">                 A1E1154613015C4E0054AC8C /* PointLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154513015C4E0054AC8C /* PointLightSource.cpp */; };
</span><span class="cx">                 A1E1154813015C5D0054AC8C /* SpotLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154713015C5D0054AC8C /* SpotLightSource.cpp */; };
</span><span class="lines">@@ -3639,6 +3642,8 @@
</span><span class="cx">                 A5AFB34F115151A700B045CB /* StepRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5AFB34D115151A700B045CB /* StepRange.cpp */; };
</span><span class="cx">                 A5AFB350115151A700B045CB /* StepRange.h in Headers */ = {isa = PBXBuildFile; fileRef = A5AFB34E115151A700B045CB /* StepRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A5C566AB127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C566AA127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */; };
+                A5DEBDA416FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */; };
</ins><span class="cx">                 A5F6E16B132ED46E008EDAE3 /* Autocapitalize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */; };
</span><span class="cx">                 A5F9EF701266750D00FCCF52 /* DiskImageCacheIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5F9EF6E1266750D00FCCF52 /* DiskImageCacheIOS.mm */; };
</span><span class="cx">                 A5F9EF711266750D00FCCF52 /* DiskImageCacheIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A5F9EF6F1266750D00FCCF52 /* DiskImageCacheIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5328,6 +5333,7 @@
</span><span class="cx">                 BE88E0DF1715D2A200658D98 /* VideoTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = BE88E0D31715D2A200658D98 /* VideoTrack.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BE88E0E11715D2A200658D98 /* VideoTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE88E0D51715D2A200658D98 /* VideoTrackList.cpp */; };
</span><span class="cx">                 BE88E0E21715D2A200658D98 /* VideoTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = BE88E0D61715D2A200658D98 /* VideoTrackList.h */; };
</span><ins>+                BE8C753110681324001E93F5 /* SpellingDot.png in Resources */ = {isa = PBXBuildFile; fileRef = BE8C753010681324001E93F5 /* SpellingDot.png */; };
</ins><span class="cx">                 BE8EF042171C8FF9009B48C3 /* JSAudioTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE8EF03E171C8FF9009B48C3 /* JSAudioTrack.cpp */; };
</span><span class="cx">                 BE8EF043171C8FF9009B48C3 /* JSAudioTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = BE8EF03F171C8FF9009B48C3 /* JSAudioTrack.h */; };
</span><span class="cx">                 BE8EF044171C8FF9009B48C3 /* JSAudioTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE8EF040171C8FF9009B48C3 /* JSAudioTrackList.cpp */; };
</span><span class="lines">@@ -5580,6 +5586,8 @@
</span><span class="cx">                 D000ED2811C1B9CD00C47726 /* SubframeLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = D000ED2611C1B9CD00C47726 /* SubframeLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 D01A27AD10C9BFD800026A42 /* SpaceSplitString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */; };
</span><span class="cx">                 D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */ = {isa = PBXBuildFile; fileRef = D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                D02B64B214089E56006EFA21 /* DictationPhraseWithAlternativesDot.png in Resources */ = {isa = PBXBuildFile; fileRef = D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */; };
+                D02B64B314089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */; };
</ins><span class="cx">                 D05CED290A40BB2C00C5AF38 /* FormatBlockCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */; };
</span><span class="cx">                 D05CED2A0A40BB2C00C5AF38 /* FormatBlockCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */; };
</span><span class="cx">                 D06C0D8F0CFD11460065F43F /* RemoveFormatCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D06C0D8D0CFD11460065F43F /* RemoveFormatCommand.h */; };
</span><span class="lines">@@ -5592,6 +5600,8 @@
</span><span class="cx">                 D0B0556809C6700100307E43 /* CreateLinkCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D0B0556609C6700100307E43 /* CreateLinkCommand.h */; };
</span><span class="cx">                 D0B0556909C6700100307E43 /* CreateLinkCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0B0556709C6700100307E43 /* CreateLinkCommand.cpp */; };
</span><span class="cx">                 D0BC54491443AC4A00E105DA /* CachedStyleSheetClient.h in Headers */ = {isa = PBXBuildFile; fileRef = D0BC54481443AC4A00E105DA /* CachedStyleSheetClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                D0BD4F5C1408850F006839B6 /* DictationCommandIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0BD4F5A1408850F006839B6 /* DictationCommandIOS.cpp */; };
+                D0BD4F5D1408850F006839B6 /* DictationCommandIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = D0BD4F5B1408850F006839B6 /* DictationCommandIOS.h */; };
</ins><span class="cx">                 D0CE58F8125E4CC200F3F199 /* ResourceLoadScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0CE58F6125E4CC200F3F199 /* ResourceLoadScheduler.cpp */; };
</span><span class="cx">                 D0CE58F9125E4CC200F3F199 /* ResourceLoadScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CE58F7125E4CC200F3F199 /* ResourceLoadScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 D0EDA774143E303C0028E383 /* CachedRawResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0EDA772143E303C0028E383 /* CachedRawResource.cpp */; };
</span><span class="lines">@@ -6456,6 +6466,8 @@
</span><span class="cx">                 FEB26D28167A8F2A00FDD26B /* DatabaseServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEB26D27167A8F2A00FDD26B /* DatabaseServer.cpp */; };
</span><span class="cx">                 FEBC5F3116BD0CC300659BD3 /* DatabaseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEBC5F2F16BD0CC300659BD3 /* DatabaseBase.cpp */; };
</span><span class="cx">                 FEBC5F3216BD0CC300659BD3 /* DatabaseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                FED13D2A0CEA91DF00D89466 /* DOMUIKitExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = FED13D260CEA91DF00D89466 /* DOMUIKitExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                FED13D2B0CEA91DF00D89466 /* DOMUIKitExtensions.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D270CEA91DF00D89466 /* DOMUIKitExtensions.mm */; };
</ins><span class="cx">                 FED13D3A0CEA934600D89466 /* EditorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D390CEA934600D89466 /* EditorIOS.mm */; };
</span><span class="cx">                 FED13D3D0CEA936A00D89466 /* FrameIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D3B0CEA936A00D89466 /* FrameIOS.mm */; };
</span><span class="cx">                 FED13D400CEA939400D89466 /* IconIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D3F0CEA939400D89466 /* IconIOS.mm */; };
</span><span class="lines">@@ -6738,6 +6750,7 @@
</span><span class="cx">                 01D3CF7F14BD0A3000FE9970 /* WebGLContextObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLContextObject.h; path = canvas/WebGLContextObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 01D3CF8014BD0A3000FE9970 /* WebGLSharedObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLSharedObject.cpp; path = canvas/WebGLSharedObject.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 01D3CF8114BD0A3000FE9970 /* WebGLSharedObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLSharedObject.h; path = canvas/WebGLSharedObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                01E6C2E31194B2820050821C /* SpellingDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = &quot;SpellingDot@2x.png&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0562F9441573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSSVGDocumentValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0562F9451573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSSVGDocumentValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0562F9601573F88F0031CA16 /* PlatformLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformLayer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -10520,6 +10533,8 @@
</span><span class="cx">                 A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElementFactory.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElementFactory.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1C7FAA1133A5D3500D6732D /* JSXPathResultCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXPathResultCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A1DE712B18612AC100734192 /* TouchEvents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TouchEvents.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A1DE71301861322200734192 /* TouchConstructors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TouchConstructors.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DistantLightSource.cpp; path = filters/DistantLightSource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1E1154513015C4E0054AC8C /* PointLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PointLightSource.cpp; path = filters/PointLightSource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A1E1154713015C5D0054AC8C /* SpotLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SpotLightSource.cpp; path = filters/SpotLightSource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -10601,6 +10616,9 @@
</span><span class="cx">                 A5C566AA127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskImageCacheClientIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyEventCocoa.h; path = cocoa/KeyEventCocoa.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = KeyEventCocoa.mm; path = cocoa/KeyEventCocoa.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitPlaybackTargetAvailabilityEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitPlaybackTargetAvailabilityEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A5DEBDA116FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitPlaybackTargetAvailabilityEvent.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Autocapitalize.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5F9EF6E1266750D00FCCF52 /* DiskImageCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiskImageCacheIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5F9EF6F1266750D00FCCF52 /* DiskImageCacheIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskImageCacheIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12534,6 +12552,7 @@
</span><span class="cx">                 BE88E0D51715D2A200658D98 /* VideoTrackList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoTrackList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BE88E0D61715D2A200658D98 /* VideoTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BE88E0D71715D2A200658D98 /* VideoTrackList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VideoTrackList.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                BE8C753010681324001E93F5 /* SpellingDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = SpellingDot.png; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 BE8EF03E171C8FF9009B48C3 /* JSAudioTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioTrack.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BE8EF03F171C8FF9009B48C3 /* JSAudioTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAudioTrack.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BE8EF040171C8FF9009B48C3 /* JSAudioTrackList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioTrackList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12846,6 +12865,8 @@
</span><span class="cx">                 D000ED2611C1B9CD00C47726 /* SubframeLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubframeLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceSplitString.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DictationPhraseWithAlternativesDot.png; sourceTree = &quot;&lt;group&gt;&quot;; };
+                D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = &quot;DictationPhraseWithAlternativesDot@2x.png&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormatBlockCommand.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FormatBlockCommand.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 D06C0D8D0CFD11460065F43F /* RemoveFormatCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoveFormatCommand.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12858,6 +12879,8 @@
</span><span class="cx">                 D0B0556609C6700100307E43 /* CreateLinkCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CreateLinkCommand.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 D0B0556709C6700100307E43 /* CreateLinkCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CreateLinkCommand.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 D0BC54481443AC4A00E105DA /* CachedStyleSheetClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedStyleSheetClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                D0BD4F5A1408850F006839B6 /* DictationCommandIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationCommandIOS.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                D0BD4F5B1408850F006839B6 /* DictationCommandIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictationCommandIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 D0CE58F6125E4CC200F3F199 /* ResourceLoadScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadScheduler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 D0CE58F7125E4CC200F3F199 /* ResourceLoadScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadScheduler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 D0EDA772143E303C0028E383 /* CachedRawResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedRawResource.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13817,6 +13840,8 @@
</span><span class="cx">                 FEB26D27167A8F2A00FDD26B /* DatabaseServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseServer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEBC5F2F16BD0CC300659BD3 /* DatabaseBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseBase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FED13D260CEA91DF00D89466 /* DOMUIKitExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMUIKitExtensions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FED13D270CEA91DF00D89466 /* DOMUIKitExtensions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMUIKitExtensions.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FED13D390CEA934600D89466 /* EditorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FED13D3B0CEA936A00D89466 /* FrameIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FED13D3F0CEA939400D89466 /* IconIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IconIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13825,6 +13850,7 @@
</span><span class="cx">                 FEDEF84016797108000E444A /* DatabaseStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseStrategy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEE1811116C319E800084849 /* SQLTransactionBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLTransactionBackend.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEE1811216C319E800084849 /* SQLTransactionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLTransactionBackend.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FEE7D6610D99AD16005351F6 /* iOS.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = iOS.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FF945EC9161F7F3600971BC8 /* PseudoElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PseudoElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FF945ECA161F7F3600971BC8 /* PseudoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FFAC30FC184FB145008C4F1E /* TrailingObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrailingObjects.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14412,6 +14438,7 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 CD0DBB3E142274E600280263 /* audio */,
</span><ins>+                                65998A650E5F5FD3004E097A /* images */,
</ins><span class="cx">                                 46F9D5DA0B0D60170028EE36 /* aliasCursor.png */,
</span><span class="cx">                                 46D4F2460AF97E810035385A /* cellCursor.png */,
</span><span class="cx">                                 93153BDD141959F400FCF5BE /* deleteButton.png */,
</span><span class="lines">@@ -14918,6 +14945,7 @@
</span><span class="cx">                                 1CDD45E60BA9C84600F90147 /* Base.xcconfig */,
</span><span class="cx">                                 1CDD45E40BA9C84600F90147 /* DebugRelease.xcconfig */,
</span><span class="cx">                                 449098B10F8F82520076A327 /* FeatureDefines.xcconfig */,
</span><ins>+                                FEE7D6610D99AD16005351F6 /* iOS.xcconfig */,
</ins><span class="cx">                                 1C904DF90BA9D2C80081E9D0 /* Version.xcconfig */,
</span><span class="cx">                                 1CDD45E50BA9C84600F90147 /* WebCore.xcconfig */,
</span><span class="cx">                                 E1BA66F21742BDCC00C20251 /* WebCoreTestShim.xcconfig */,
</span><span class="lines">@@ -15279,6 +15307,8 @@
</span><span class="cx">                 443292C10EBA6D7300E62016 /* ios */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                D0BD4F5A1408850F006839B6 /* DictationCommandIOS.cpp */,
+                                D0BD4F5B1408850F006839B6 /* DictationCommandIOS.h */,
</ins><span class="cx">                                 FED13D390CEA934600D89466 /* EditorIOS.mm */,
</span><span class="cx">                         );
</span><span class="cx">                         path = ios;
</span><span class="lines">@@ -16000,6 +16030,17 @@
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                65998A650E5F5FD3004E097A /* images */ = {
+                        isa = PBXGroup;
+                        children = (
+                                D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */,
+                                D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */,
+                                BE8C753010681324001E93F5 /* SpellingDot.png */,
+                                01E6C2E31194B2820050821C /* SpellingDot@2x.png */,
+                        );
+                        name = images;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 65BF02180974806300C43196 /* page */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -17423,6 +17464,7 @@
</span><span class="cx">                 971145FE14EF006E00674FD9 /* Modules */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                CE26169D187E6554007955F3 /* airplay */,
</ins><span class="cx">                                 072AE1DE183C0513000A5988 /* plugins */,
</span><span class="cx">                                 CDA98DBD16014E0800FEA3B1 /* encryptedmedia */,
</span><span class="cx">                                 971145FF14EF007900674FD9 /* geolocation */,
</span><span class="lines">@@ -20198,6 +20240,8 @@
</span><span class="cx">                                 8538F0840AD72CB6006A81D1 /* DOMRanges.h */,
</span><span class="cx">                                 BC1A37A7097C715F0019F3D8 /* DOMStylesheets.h */,
</span><span class="cx">                                 BC1A37A8097C715F0019F3D8 /* DOMTraversal.h */,
</span><ins>+                                FED13D260CEA91DF00D89466 /* DOMUIKitExtensions.h */,
+                                FED13D270CEA91DF00D89466 /* DOMUIKitExtensions.mm */,
</ins><span class="cx">                                 BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */,
</span><span class="cx">                                 BC1A37AA097C715F0019F3D8 /* DOMViews.h */,
</span><span class="cx">                                 1A1D137E0A5325520064BF5F /* DOMXPath.h */,
</span><span class="lines">@@ -20612,6 +20656,7 @@
</span><span class="cx">                 BCCE58B41061E925008FB35A /* Constructors */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                CE261694187E6469007955F3 /* ios */,
</ins><span class="cx">                                 BC6C49F10D7DBA0500FFA558 /* JSImageConstructor.cpp */,
</span><span class="cx">                                 BC6C49F20D7DBA0500FFA558 /* JSImageConstructor.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -20922,6 +20967,32 @@
</span><span class="cx">                         path = mediasource;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                CE261694187E6469007955F3 /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                A1DE71301861322200734192 /* TouchConstructors.cpp */,
+                        );
+                        path = ios;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
+                CE26169D187E6554007955F3 /* airplay */ = {
+                        isa = PBXGroup;
+                        children = (
+                                A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */,
+                                A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */,
+                                A5DEBDA116FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.idl */,
+                        );
+                        path = airplay;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
+                CE2616A4187E65C1007955F3 /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                A1DE712B18612AC100734192 /* TouchEvents.cpp */,
+                        );
+                        path = ios;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 CE79D68617F220ED00815C00 /* ios */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -21791,6 +21862,7 @@
</span><span class="cx">                 F523D32402DE4478018635CA /* dom */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                CE2616A4187E65C1007955F3 /* ios */,
</ins><span class="cx">                                 E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */,
</span><span class="cx">                                 E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */,
</span><span class="cx">                                 A8C4A7FC09D563270003AC8D /* Attr.cpp */,
</span><span class="lines">@@ -23355,6 +23427,7 @@
</span><span class="cx">                                 856C8AE40A912649005C687B /* DOMObject.h in Headers */,
</span><span class="cx">                                 0705851317FA7107005F2BCB /* JSMediaStreamCapabilities.h in Headers */,
</span><span class="cx">                                 BC53DA601143141A000D817E /* DOMObjectHashTableMap.h in Headers */,
</span><ins>+                                FED13D2A0CEA91DF00D89466 /* DOMUIKitExtensions.h in Headers */,
</ins><span class="cx">                                 85C7F5D00AAFB8D9004014DD /* DOMOverflowEvent.h in Headers */,
</span><span class="cx">                                 85989DCF0ACC8BBD00A0BC51 /* DOMOverflowEventInternal.h in Headers */,
</span><span class="cx">                                 E1284BD61044A01E00EAEB52 /* DOMPageTransitionEvent.h in Headers */,
</span><span class="lines">@@ -25028,6 +25101,7 @@
</span><span class="cx">                                 F55B3DD01251F12D003EF269 /* ResetInputType.h in Headers */,
</span><span class="cx">                                 514BC843161CF05C004D52F4 /* ResourceBuffer.h in Headers */,
</span><span class="cx">                                 7EE6846A12D26E3800E79415 /* ResourceError.h in Headers */,
</span><ins>+                                D0BD4F5D1408850F006839B6 /* DictationCommandIOS.h in Headers */,
</ins><span class="cx">                                 934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
</span><span class="cx">                                 514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
</span><span class="cx">                                 26FAE4CD1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h in Headers */,
</span><span class="lines">@@ -25695,6 +25769,7 @@
</span><span class="cx">                                 F5A154281279534D00D0B0C0 /* ValidationMessage.h in Headers */,
</span><span class="cx">                                 F513A3EA15FF4841001526DB /* ValidationMessageClient.h in Headers */,
</span><span class="cx">                                 15C7708D100D3C6B005BA267 /* ValidityState.h in Headers */,
</span><ins>+                                A5DEBDA416FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h in Headers */,
</ins><span class="cx">                                 FD3160AF12B026F700C1A359 /* VectorMath.h in Headers */,
</span><span class="cx">                                 BCA257151293C010007A263D /* VerticalPositionCache.h in Headers */,
</span><span class="cx">                                 BE88E0DF1715D2A200658D98 /* VideoTrack.h in Headers */,
</span><span class="lines">@@ -26059,15 +26134,19 @@
</span><span class="cx">                         isa = PBXResourcesBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><ins>+                                D02B64B214089E56006EFA21 /* DictationPhraseWithAlternativesDot.png in Resources */,
</ins><span class="cx">                                 46F9D5DD0B0D60170028EE36 /* aliasCursor.png in Resources */,
</span><ins>+                                D02B64B314089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png in Resources */,
</ins><span class="cx">                                 46D4F2490AF97E810035385A /* cellCursor.png in Resources */,
</span><span class="cx">                                 93153BDE141959F400FCF5BE /* deleteButton.png in Resources */,
</span><ins>+                                BE8C753110681324001E93F5 /* SpellingDot.png in Resources */,
</ins><span class="cx">                                 93153BCD1417FBBF00FCF5BE /* deleteButton@2x.png in Resources */,
</span><span class="cx">                                 93153BE014195A2800FCF5BE /* deleteButtonPressed.png in Resources */,
</span><span class="cx">                                 93153BCF1417FBDB00FCF5BE /* deleteButtonPressed@2x.png in Resources */,
</span><span class="cx">                                 85136C990AED665900F90A3D /* eastResizeCursor.png in Resources */,
</span><span class="cx">                                 85136C9A0AED665900F90A3D /* eastWestResizeCursor.png in Resources */,
</span><span class="cx">                                 85136C9B0AED665900F90A3D /* helpCursor.png in Resources */,
</span><ins>+                                01E6C2E41194B2820050821C /* SpellingDot@2x.png in Resources */,
</ins><span class="cx">                                 7CC7E3D717208C0F003C5277 /* IDNScriptWhiteList.txt in Resources */,
</span><span class="cx">                                 93153BE414195B2A00FCF5BE /* inputSpeech.png in Resources */,
</span><span class="cx">                                 2D9F0E1314FF1CBF00BA0FF7 /* linearSRGB.icc in Resources */,
</span><span class="lines">@@ -26492,6 +26571,7 @@
</span><span class="cx">                                 BC64B4D70CB4298A005F2B62 /* CSSFontFaceSource.cpp in Sources */,
</span><span class="cx">                                 BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */,
</span><span class="cx">                                 4A6E9FC313C17D1D0046A7F8 /* CSSFontFeatureValue.cpp in Sources */,
</span><ins>+                                A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */,
</ins><span class="cx">                                 BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */,
</span><span class="cx">                                 A80E6CF10A1989CA007FB8C5 /* CSSFontValue.cpp in Sources */,
</span><span class="cx">                                 BC02A6460E09AAE9004B6D2B /* CSSFunctionValue.cpp in Sources */,
</span><span class="lines">@@ -27193,6 +27273,7 @@
</span><span class="cx">                                 97205AB51239291000B17380 /* ImageDocument.cpp in Sources */,
</span><span class="cx">                                 F55B3DC11251F12D003EF269 /* ImageInputType.cpp in Sources */,
</span><span class="cx">                                 51D719E6181106E00016DC51 /* IDBOpenDBRequest.cpp in Sources */,
</span><ins>+                                FED13D2B0CEA91DF00D89466 /* DOMUIKitExtensions.mm in Sources */,
</ins><span class="cx">                                 089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */,
</span><span class="cx">                                 B275357B0B053814002CE64F /* ImageMac.mm in Sources */,
</span><span class="cx">                                 2D5A592F152525230036EE51 /* ImageOrientation.cpp in Sources */,
</span><span class="lines">@@ -27374,6 +27455,7 @@
</span><span class="cx">                                 1A494EDE0A123F4C00FDAFC1 /* JSDocumentFragment.cpp in Sources */,
</span><span class="cx">                                 65DF31F509D1CC60000BE325 /* JSDocumentType.cpp in Sources */,
</span><span class="cx">                                 1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */,
</span><ins>+                                A1DE712D18612AC100734192 /* TouchEvents.cpp in Sources */,
</ins><span class="cx">                                 93B70D6309EB0C7C009D8468 /* JSDOMBinding.cpp in Sources */,
</span><span class="cx">                                 BC60D7C00D29A46300B9918F /* JSDOMCoreException.cpp in Sources */,
</span><span class="cx">                                 40ECAE8116B8B68A00C36103 /* JSDOMError.cpp in Sources */,
</span><span class="lines">@@ -27537,6 +27619,7 @@
</span><span class="cx">                                 BC06ED060BFD5BAE00856E9D /* JSHTMLTableSectionElement.cpp in Sources */,
</span><span class="cx">                                 D6489D25166FFCF1007C031B /* JSHTMLTemplateElement.cpp in Sources */,
</span><span class="cx">                                 D6F7960D166FFECE0076DD18 /* JSHTMLTemplateElementCustom.cpp in Sources */,
</span><ins>+                                A1DE71321861322200734192 /* TouchConstructors.cpp in Sources */,
</ins><span class="cx">                                 A80E7E9E0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.cpp in Sources */,
</span><span class="cx">                                 A80E7B130A19D606007FB8C5 /* JSHTMLTitleElement.cpp in Sources */,
</span><span class="cx">                                 070756D314239A4E00414161 /* JSHTMLTrackElement.cpp in Sources */,
</span><span class="lines">@@ -29060,6 +29143,7 @@
</span><span class="cx">                                 1AB7FC780A8B92EC00D9D37B /* XPathParser.cpp in Sources */,
</span><span class="cx">                                 4476531B133170990006B789 /* SSLKeyGeneratorIOS.cpp in Sources */,
</span><span class="cx">                                 1AB7FC7A0A8B92EC00D9D37B /* XPathPath.cpp in Sources */,
</span><ins>+                                D0BD4F5C1408850F006839B6 /* DictationCommandIOS.cpp in Sources */,
</ins><span class="cx">                                 1AB7FC7C0A8B92EC00D9D37B /* XPathPredicate.cpp in Sources */,
</span><span class="cx">                                 1AB7FC7E0A8B92EC00D9D37B /* XPathResult.cpp in Sources */,
</span><span class="cx">                                 1AB7FC810A8B92EC00D9D37B /* XPathStep.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsGCControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/GCController.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/GCController.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/GCController.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -81,6 +81,12 @@
</span><span class="cx"> void GCController::garbageCollectNow()
</span><span class="cx"> {
</span><span class="cx">     JSLockHolder lock(JSDOMWindow::commonVM());
</span><ins>+#if PLATFORM(IOS)
+    // If JavaScript was never run in this process, there's no need to call GC which will
+    // end up creating a VM unnecessarily.
+    if (!JSDOMWindow::commonVMExists())
+        return;
+#endif
</ins><span class="cx">     if (!JSDOMWindow::commonVM()-&gt;heap.isBusy())
</span><span class="cx">         JSDOMWindow::commonVM()-&gt;heap.collectAllGarbage();
</span><span class="cx"> }
</span><span class="lines">@@ -97,6 +103,26 @@
</span><span class="cx">     detachThread(threadID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void GCController::releaseExecutableMemory()
+{
+    JSLockHolder lock(JSDOMWindow::commonVM());
+
+    if (!JSDOMWindow::commonVMExists())
+        return;
+
+    // We shouldn't have any javascript running on our stack when this function is called. The
+    // following line asserts that.
+    ASSERT(!JSDOMWindow::commonVM()-&gt;dynamicGlobalObject);
+
+    // But be safe in release builds just in case...
+    if (JSDOMWindow::commonVM()-&gt;dynamicGlobalObject)
+        return;
+
+    JSDOMWindow::commonVM()-&gt;releaseExecutableMemory();
+}
+#endif
+
</ins><span class="cx"> void GCController::setJavaScriptGarbageCollectorTimerEnabled(bool enable)
</span><span class="cx"> {
</span><span class="cx">     JSDOMWindow::commonVM()-&gt;heap.setGarbageCollectionTimerEnabled(enable);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsGCControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/GCController.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/GCController.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/GCController.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -44,6 +44,9 @@
</span><span class="cx">         void garbageCollectNow(); // It's better to call garbageCollectSoon, unless you have a specific reason not to.
</span><span class="cx"> 
</span><span class="cx">         void garbageCollectOnAlternateThreadForDebugging(bool waitUntilDone); // Used for stress testing.
</span><ins>+#if PLATFORM(IOS)
+        void releaseExecutableMemory();
+#endif
</ins><span class="cx">         void setJavaScriptGarbageCollectorTimerEnabled(bool);
</span><span class="cx">         void discardAllCompiledCode();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCallbackDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCallbackData.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCallbackData.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/JSCallbackData.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -58,7 +58,9 @@
</span><span class="cx">     
</span><span class="cx">     ~JSCallbackData()
</span><span class="cx">     {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         ASSERT(m_thread == currentThread());
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     JSC::JSObject* callback() { return m_callback.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -40,6 +40,12 @@
</span><span class="cx"> #include &lt;runtime/Microtask.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;ChromeClient.h&quot;
+#include &quot;WebSafeGCActivityCallbackIOS.h&quot;
+#include &quot;WebSafeIncrementalSweeperIOS.h&quot;
+#endif
+
</ins><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -110,7 +116,11 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+#if ENABLE(INSPECTOR)
</ins><span class="cx">     return page-&gt;inspectorController()-&gt;profilerEnabled();
</span><ins>+#else
+    return false;
+#endif // ENABLE(INSPECTOR)
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -166,7 +176,7 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    if (page-&gt;chrome().client()-&gt;isStopping())
</del><ins>+    if (page-&gt;chrome().client().isStopping())
</ins><span class="cx">         return true;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -202,17 +212,44 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     static VM* vm = 0;
</span><ins>+#else
+    VM*&amp; vm = commonVMInternal();
+#endif
</ins><span class="cx">     if (!vm) {
</span><span class="cx">         ScriptController::initializeThreading();
</span><span class="cx">         vm = VM::createLeaked(LargeHeap).leakRef();
</span><ins>+#if PLATFORM(IOS)
+        PassOwnPtr&lt;WebSafeGCActivityCallback&gt; activityCallback = WebSafeGCActivityCallback::create(&amp;vm-&gt;heap);
+        vm-&gt;heap.setActivityCallback(activityCallback);
+        PassOwnPtr&lt;WebSafeIncrementalSweeper&gt; incrementalSweeper = WebSafeIncrementalSweeper::create(&amp;vm-&gt;heap);
+        vm-&gt;heap.setIncrementalSweeper(incrementalSweeper);
+        vm-&gt;makeUsableFromMultipleThreads();
+        vm-&gt;heap.machineThreads().addCurrentThread();
+#else
</ins><span class="cx">         vm-&gt;exclusiveThread = currentThread();
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx">         initNormalWorldClientData(vm);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return vm;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool JSDOMWindowBase::commonVMExists()
+{
+    return commonVMInternal();
+}
+
+VM*&amp; JSDOMWindowBase::commonVMInternal()
+{
+    ASSERT(isMainThread());
+    static VM* commonVM;
+    return commonVM;
+}
+#endif
+
</ins><span class="cx"> // JSDOMGlobalObject* is ignored, accessing a window in any context will
</span><span class="cx"> // use that DOMWindow's prototype chain.
</span><span class="cx"> JSValue toJS(ExecState* exec, JSDOMGlobalObject*, DOMWindow* domWindow)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -41,6 +41,11 @@
</span><span class="cx"> #include &quot;JSSharedWorker.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+#include &quot;JSTouchConstructor.h&quot;
+#include &quot;JSTouchListConstructor.h&quot;
+#endif
+
</ins><span class="cx"> #if ENABLE(WEB_AUDIO)
</span><span class="cx"> #include &quot;JSAudioContext.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -452,6 +457,18 @@
</span><span class="cx">     return getDOMConstructor&lt;JSImageConstructor&gt;(exec-&gt;vm(), this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_TOUCH_EVENTS)
+JSValue JSDOMWindow::touch(ExecState* exec) const
+{
+    return getDOMConstructor&lt;JSTouchConstructor&gt;(exec-&gt;vm(), this);
+}
+
+JSValue JSDOMWindow::touchList(ExecState* exec) const
+{
+    return getDOMConstructor&lt;JSTouchListConstructor&gt;(exec-&gt;vm(), this);
+}
+#endif
+
</ins><span class="cx"> // Custom functions
</span><span class="cx"> 
</span><span class="cx"> JSValue JSDOMWindow::open(ExecState* exec)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDeviceOrientationEventCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -60,6 +60,25 @@
</span><span class="cx">     return jsNumber(imp.orientation()-&gt;gamma());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+JSValue JSDeviceOrientationEvent::webkitCompassHeading(ExecState*) const
+{
+    DeviceOrientationEvent&amp; imp = impl();
+    if (!imp.orientation()-&gt;canProvideCompassHeading())
+        return jsNull();
+    return jsNumber(imp.orientation()-&gt;compassHeading());
+}
+
+JSValue JSDeviceOrientationEvent::webkitCompassAccuracy(ExecState*) const
+{
+    DeviceOrientationEvent&amp; imp = impl();
+    if (!imp.orientation()-&gt;canProvideCompassAccuracy())
+        return jsNull();
+    return jsNumber(imp.orientation()-&gt;compassAccuracy());
+}
+#endif
+
+#if !PLATFORM(IOS)
</ins><span class="cx"> JSValue JSDeviceOrientationEvent::absolute(ExecState*) const
</span><span class="cx"> {
</span><span class="cx">     DeviceOrientationEvent&amp; imp = impl();
</span><span class="lines">@@ -67,6 +86,7 @@
</span><span class="cx">         return jsNull();
</span><span class="cx">     return jsBoolean(imp.orientation()-&gt;absolute());
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> JSValue JSDeviceOrientationEvent::initDeviceOrientationEvent(ExecState* exec)
</span><span class="cx"> {
</span><span class="lines">@@ -81,9 +101,17 @@
</span><span class="cx">     double beta = exec-&gt;argument(4).toNumber(exec);
</span><span class="cx">     bool gammaProvided = !exec-&gt;argument(5).isUndefinedOrNull();
</span><span class="cx">     double gamma = exec-&gt;argument(5).toNumber(exec);
</span><ins>+#if PLATFORM(IOS)
+    bool compassHeadingProvided = !exec-&gt;argument(6).isUndefinedOrNull();
+    double compassHeading = exec-&gt;argument(6).toNumber(exec);
+    bool compassAccuracyProvided = !exec-&gt;argument(7).isUndefinedOrNull();
+    double compassAccuracy = exec-&gt;argument(7).toNumber(exec);
+    RefPtr&lt;DeviceOrientationData&gt; orientation = DeviceOrientationData::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma, compassHeadingProvided, compassHeading, compassAccuracyProvided, compassAccuracy);
+#else
</ins><span class="cx">     bool absoluteProvided = !exec-&gt;argument(6).isUndefinedOrNull();
</span><span class="cx">     bool absolute = exec-&gt;argument(6).toBoolean(exec);
</span><span class="cx">     RefPtr&lt;DeviceOrientationData&gt; orientation = DeviceOrientationData::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvided, absolute);
</span><ins>+#endif
</ins><span class="cx">     impl().initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
</span><span class="cx">     return jsUndefined();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMainThreadExecStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -30,6 +30,10 @@
</span><span class="cx"> #include &lt;runtime/Completion.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class InspectorInstrumentationCookie;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSTouchCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSTouchCustom.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSTouchCustom.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/JSTouchCustom.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSTouch.h&quot;
</span><span class="lines">@@ -46,3 +47,4 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(TOUCH_EVENTS)
</span><ins>+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSTouchListCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSTouchListCustom.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSTouchListCustom.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/JSTouchListCustom.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSTouchList.h&quot;
</span><span class="lines">@@ -46,3 +47,4 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(TOUCH_EVENTS)
</span><ins>+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsPageScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -148,6 +148,11 @@
</span><span class="cx"> {
</span><span class="cx">     // Page can be null if we are continuing because the Page closed.
</span><span class="cx">     Page* page = toPage(globalObject);
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: Can this happen in open source too, or is this iOS (multi-threaded) only?
+    if (!page)
+        return;
+#endif
</ins><span class="cx">     ASSERT(!page || page == m_pausedPage);
</span><span class="cx"> 
</span><span class="cx">     m_pausedPage = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptController.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -61,8 +61,10 @@
</span><span class="cx"> 
</span><span class="cx"> void ScriptController::initializeThreading()
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     JSC::initializeThreading();
</span><span class="cx">     WTF::initializeMainThread();
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScriptController::ScriptController(Frame&amp; frame)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;ScriptDebugServer.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ContentSearchUtils.h&quot;
</span><ins>+#include &quot;EventLoop.h&quot;
</ins><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;JSDOMWindowCustom.h&quot;
</span><span class="cx"> #include &quot;JSJavaScriptCallFrame.h&quot;
</span><span class="lines">@@ -49,6 +50,11 @@
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;JSDOMWindowBase.h&quot;
+#include &quot;WebCoreThreadInternal.h&quot;
+#endif
+
</ins><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -295,11 +301,27 @@
</span><span class="cx"> 
</span><span class="cx">     TimerBase::fireTimersInNestedEventLoop();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // On iOS, running an EventLoop causes us to run a nested WebRunLoop.
+    // Since the WebThread is autoreleased at the end of run loop iterations
+    // we need to gracefully handle releasing and reacquiring the lock.
+    ASSERT(WebThreadIsLockedOrDisabled());
+    {
+        if (WebThreadIsEnabled())
+            JSC::JSLock::DropAllLocks dropAllLocks(WebCore::JSDOMWindowBase::commonVM(), JSC::JSLock::DropAllLocks::AlwaysDropLocks);
+        WebRunLoopEnableNested();
+#endif
+
</ins><span class="cx">     m_runningNestedMessageLoop = true;
</span><span class="cx">     m_doneProcessingDebuggerEvents = false;
</span><span class="cx">     runEventLoopWhilePaused();
</span><span class="cx">     m_runningNestedMessageLoop = false;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        WebRunLoopDisableNested();
+    }
+    ASSERT(WebThreadIsLockedOrDisabled());
+#endif
</ins><span class="cx">     didContinue(vmEntryGlobalObject);
</span><span class="cx">     dispatchFunctionToListeners(&amp;ScriptDebugServer::dispatchDidContinue, vmEntryGlobalObject);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsiosTouchConstructorscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/js/ios/TouchConstructors.cpp (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ios/TouchConstructors.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/ios/TouchConstructors.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#if PLATFORM(IOS) &amp;&amp; ENABLE(TOUCH_EVENTS)
+
+#include &lt;WebKitAdditions/JSTouchConstructor.cpp&gt;
+#include &lt;WebKitAdditions/JSTouchListConstructor.cpp&gt;
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOM.mm (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOM.mm        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/objc/DOM.mm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -53,6 +53,22 @@
</span><span class="cx"> #import &lt;JavaScriptCore/APICast.h&gt;
</span><span class="cx"> #import &lt;wtf/HashMap.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &quot;FocusController.h&quot;
+#import &quot;HTMLLinkElement.h&quot;
+#import &quot;KeyboardEvent.h&quot;
+#import &quot;URL.h&quot;
+#import &quot;MediaList.h&quot;
+#import &quot;MediaQueryEvaluator.h&quot;
+#import &quot;NodeRenderStyle.h&quot;
+#import &quot;Page.h&quot;
+#import &quot;RenderView.h&quot;
+#import &quot;Touch.h&quot;
+#import &quot;WAKAppKitStubs.h&quot;
+#import &quot;WAKWindow.h&quot;
+#import &quot;WebCoreThreadMessage.h&quot;
+#endif
+
</ins><span class="cx"> using namespace JSC;
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -176,8 +192,80 @@
</span><span class="cx">     return array;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+static WKQuad wkQuadFromFloatQuad(const FloatQuad&amp; inQuad)
+{
+    WKQuad  theQuad;
+    theQuad.p1 = inQuad.p1();
+    theQuad.p2 = inQuad.p2();
+    theQuad.p3 = inQuad.p3();
+    theQuad.p4 = inQuad.p4();
+    
+    return theQuad;
+}
+
+static NSArray *kit(const Vector&lt;FloatQuad&gt;&amp; quads)
+{
+    size_t size = quads.size();
+    NSMutableArray *array = [NSMutableArray arrayWithCapacity:size];
+    for (size_t i = 0; i &lt; size; ++i) {
+        WKQuadObject* quadObject = [[WKQuadObject alloc] initWithQuad:wkQuadFromFloatQuad(quads[i])];
+        [array addObject:quadObject];
+        [quadObject release];
+    }
+    return array;
+}
+
+static inline float min4(float a, float b, float c, float d)
+{
+    return std::min(std::min(a, b), std::min(c, d));
+}
+
+static inline float max4(float a, float b, float c, float d)
+{
+    return std::max(std::max(a, b), std::max(c, d));
+}
+
+static inline WKQuad emptyQuad()
+{
+    WKQuad zeroQuad = { CGPointZero, CGPointZero, CGPointZero, CGPointZero };
+    return zeroQuad;
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+@implementation WKQuadObject
+
+- (id)initWithQuad:(WKQuad)quad
+{
+    if ((self = [super init]))
+    {
+        _quad = quad;
+    }
+    return self;
+}
+
+- (WKQuad)quad
+{
+    return _quad;
+}
+
+- (CGRect)boundingBox
+{
+    float left      = WebCore::min4(_quad.p1.x, _quad.p2.x, _quad.p3.x, _quad.p4.x);
+    float top       = WebCore::min4(_quad.p1.y, _quad.p2.y, _quad.p3.y, _quad.p4.y);
+    
+    float right     = WebCore::max4(_quad.p1.x, _quad.p2.x, _quad.p3.x, _quad.p4.x);
+    float bottom    = WebCore::max4(_quad.p1.y, _quad.p2.y, _quad.p3.y, _quad.p4.y);
+    
+    return CGRectMake(left, top, right - left, bottom - top);
+}
+
+@end
+#endif
+
</ins><span class="cx"> @implementation DOMNode (WebCoreInternal)
</span><span class="cx"> 
</span><span class="cx"> #pragma clang diagnostic push
</span><span class="lines">@@ -263,13 +351,21 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation DOMNode (DOMNodeExtensions)
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+- (CGRect)boundingBox
+#else
</ins><span class="cx"> - (NSRect)boundingBox
</span><ins>+#endif
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Could we move this function to WebCore::Node and autogenerate?
</span><span class="cx">     core(self)-&gt;document().updateLayoutIgnorePendingStylesheets();
</span><span class="cx">     WebCore::RenderObject* renderer = core(self)-&gt;renderer();
</span><span class="cx">     if (!renderer)
</span><ins>+#if PLATFORM(IOS)
+        return CGRectZero;
+#else
</ins><span class="cx">         return NSZeroRect;
</span><ins>+#endif
</ins><span class="cx">     return renderer-&gt;absoluteBoundingBoxRect();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -278,10 +374,180 @@
</span><span class="cx">     return [self textRects];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+// quad in page coordinates, taking transforms into account. c.f. - (NSRect)boundingBox;
+- (WKQuad)absoluteQuad
+{
+    return [self absoluteQuadAndInsideFixedPosition:0];
+}
+
+- (WKQuad)absoluteQuadAndInsideFixedPosition:(BOOL *)insideFixed
+{
+    core(self)-&gt;document().updateLayoutIgnorePendingStylesheets();
+    WebCore::RenderObject *renderer = core(self)-&gt;renderer();
+    if (renderer) {
+        Vector&lt;FloatQuad&gt; quads;
+        bool wasFixed = false;
+        renderer-&gt;absoluteQuads(quads, &amp;wasFixed);
+        if (insideFixed)
+            *insideFixed = wasFixed;
+
+        if (quads.size() == 0)
+            return WebCore::emptyQuad();
+        
+        if (quads.size() == 1)
+            return wkQuadFromFloatQuad(quads[0]);
+
+        FloatRect boundingRect = quads[0].boundingBox();
+        for (size_t i = 1; i &lt; quads.size(); ++i)
+            boundingRect.unite(quads[i].boundingBox());
+
+        return wkQuadFromFloatQuad(boundingRect);
+    }
+
+    return WebCore::emptyQuad();
+}
+
+// this method is like - (CGRect)boundingBox, but it accounts for for transforms
+- (CGRect)boundingBoxUsingTransforms
+{
+    core(self)-&gt;document().updateLayoutIgnorePendingStylesheets();
+    WebCore::RenderObject* renderer = core(self)-&gt;renderer();
+    if (!renderer)
+        return CGRectZero;
+    return renderer-&gt;absoluteBoundingBoxRect(true);
+}
+
+// returns array of WKQuadObject
+- (NSArray *)lineBoxQuads
+{
+    core(self)-&gt;document().updateLayoutIgnorePendingStylesheets();
+    WebCore::RenderObject *renderer = core(self)-&gt;renderer();
+    if (renderer) {
+        Vector&lt;WebCore::FloatQuad&gt; quads;
+        renderer-&gt;absoluteQuads(quads);
+        return kit(quads);
+    }
+    return nil;
+}
+
+- (Element *)_linkElement
+{
+    WebCore::Node* node = core(self);
+    
+    while (node) {
+        if (node-&gt;isLink())
+            return static_cast&lt;WebCore::Element*&gt;(node);
+        node = node-&gt;parentNode();
+    }
+    
+    return 0;
+}
+
+- (NSURL *)hrefURL
+{
+    Element *link= [self _linkElement];
+    if (link)
+        return link-&gt;document().completeURL(stripLeadingAndTrailingHTMLSpaces(link-&gt;getAttribute(HTMLNames::hrefAttr)));
+    
+    return nil;
+}
+
+- (NSString *)hrefTarget
+{
+    Element *target = [self _linkElement];
+    
+    if(target) return target-&gt;getAttribute(HTMLNames::targetAttr);
+    
+    return nil;
+}
+
+- (CGRect)hrefFrame
+{
+    RenderObject *renderer = [self _linkElement]-&gt;renderer();
+    
+    if(renderer) return renderer-&gt;absoluteBoundingBoxRect();
+    
+    return NSZeroRect;
+}
+
+- (NSString *)hrefLabel
+{
+    Element *link= [self _linkElement];
+    
+    if (!link) return nil;
+    
+    return link-&gt;textContent();
+}
+
+- (NSString *)hrefTitle
+{
+    Element *link= [self _linkElement];
+    
+    if (!link) return nil;
+    
+    return link-&gt;document().displayStringModifiedByEncoding(static_cast&lt;HTMLElement *&gt;(link)-&gt;title());
+}
+
+- (CGRect)boundingFrame
+{
+    return [self boundingBox];
+}
+
+- (WKQuad)innerFrameQuad       // takes transforms into account
+{
+    core(self)-&gt;document().updateLayoutIgnorePendingStylesheets();
+    RenderObject* renderer = core(self)-&gt;renderer();
+    if (!renderer)
+        return emptyQuad();
+
+    RenderStyle&amp; style = renderer-&gt;style();
+    IntRect boundingBox = renderer-&gt;absoluteBoundingBoxRect(true /* use transforms*/);
+
+    boundingBox.move(style.borderLeftWidth(), style.borderTopWidth());
+    boundingBox.setWidth(boundingBox.width() - style.borderLeftWidth() - style.borderRightWidth());
+    boundingBox.setHeight(boundingBox.height() - style.borderBottomWidth() - style.borderTopWidth());
+
+    // FIXME: This function advertises returning a quad, but it actually returns a bounding box (so there is no rotation, for instance).
+    return wkQuadFromFloatQuad(FloatQuad(boundingBox));
+}
+
+- (float)computedFontSize
+{
+    WebCore::Node *node = core(self);
+    RenderStyle *style = node-&gt;renderStyle();
+    if (!style)
+        return 0.0f;
+    return style-&gt;fontDescription().computedSize();
+}
+
+- (DOMNode *)nextFocusNode
+{
+    Page *page = core(self)-&gt;document().page();
+    if (!page)
+        return nil;
+
+    RefPtr&lt;KeyboardEvent&gt; key = KeyboardEvent::create();
+    return kit(page-&gt;focusController().nextFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&amp;core(self)-&gt;document()), core(self), key.get()));
+}
+
+- (DOMNode *)previousFocusNode
+{
+    Page *page = core(self)-&gt;document().page();
+    if (!page)
+        return nil;
+
+    RefPtr&lt;KeyboardEvent&gt; key = KeyboardEvent::create();
+    return kit(page-&gt;focusController().previousFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&amp;core(self)-&gt;document()), core(self), key.get()));
+}
+
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation DOMNode (DOMNodeExtensionsPendingPublic)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> - (NSImage *)renderedImage
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Could we move this function to WebCore::Node and autogenerate?
</span><span class="lines">@@ -291,6 +557,7 @@
</span><span class="cx">         return nil;
</span><span class="cx">     return [createDragImageForNode(*frame, *node).leakRef() autorelease];
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> - (NSArray *)textRects
</span><span class="cx"> {
</span><span class="lines">@@ -321,14 +588,22 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation DOMRange (DOMRangeExtensions)
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+- (CGRect)boundingBox
+#else
</ins><span class="cx"> - (NSRect)boundingBox
</span><ins>+#endif
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: The call to updateLayoutIgnorePendingStylesheets should be moved into WebCore::Range.
</span><span class="cx">     core(self)-&gt;ownerDocument().updateLayoutIgnorePendingStylesheets();
</span><span class="cx">     return core(self)-&gt;boundingBox();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> - (NSImage *)renderedImageForcingBlackText:(BOOL)forceBlackText
</span><ins>+#else
+- (CGImageRef)renderedImageForcingBlackText:(BOOL)forceBlackText
+#endif
</ins><span class="cx"> {
</span><span class="cx">     WebCore::Range* range = core(self);
</span><span class="cx">     WebCore::Frame* frame = range-&gt;ownerDocument().frame();
</span><span class="lines">@@ -360,6 +635,7 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation DOMElement (DOMElementAppKitExtensions)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> - (NSImage*)image
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Could we move this function to WebCore::Node and autogenerate?
</span><span class="lines">@@ -371,11 +647,13 @@
</span><span class="cx">         return nil;
</span><span class="cx">     return cachedImage-&gt;imageForRenderer(toRenderImage(renderer))-&gt;getNSImage();
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation DOMElement (WebPrivate)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> - (NSFont *)_font
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Could we move this function to WebCore::Element and autogenerate?
</span><span class="lines">@@ -384,7 +662,17 @@
</span><span class="cx">         return nil;
</span><span class="cx">     return renderer-&gt;style().font().primaryFont()-&gt;getNSFont();
</span><span class="cx"> }
</span><ins>+#else
+- (CTFontRef)_font
+{
+    RenderObject* renderer = core(self)-&gt;renderer();
+    if (!renderer)
+        return nil;
+    return renderer-&gt;style().font().primaryFont()-&gt;getCTFont();
+}
+#endif
</ins><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> - (NSData *)_imageTIFFRepresentation
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Could we move this function to WebCore::Element and autogenerate?
</span><span class="lines">@@ -396,6 +684,7 @@
</span><span class="cx">         return nil;
</span><span class="cx">     return (NSData *)cachedImage-&gt;imageForRenderer(renderer)-&gt;getTIFFRepresentation();
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> - (NSURL *)_getURLAttribute:(NSString *)name
</span><span class="cx"> {
</span><span class="lines">@@ -415,6 +704,49 @@
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+@implementation DOMHTMLLinkElement (WebPrivate)
+- (BOOL)_mediaQueryMatchesForOrientation:(int)orientation
+{
+    Document&amp; document = static_cast&lt;HTMLLinkElement*&gt;(core(self))-&gt;document();
+    FrameView* frameView = document.frame() ? document.frame()-&gt;view() : 0;
+    if (!frameView)
+        return false;
+    int layoutWidth = frameView-&gt;layoutWidth();
+    int layoutHeight = frameView-&gt;layoutHeight();
+    IntSize savedFixedLayoutSize = frameView-&gt;fixedLayoutSize();
+    bool savedUseFixedLayout = frameView-&gt;useFixedLayout();
+    if ((orientation == WebMediaQueryOrientationPortrait &amp;&amp; layoutWidth &gt; layoutHeight) ||
+        (orientation == WebMediaQueryOrientationLandscape &amp;&amp; layoutWidth &lt; layoutHeight)) {
+        // temporarily swap the orientation for the evaluation
+        frameView-&gt;setFixedLayoutSize(IntSize(layoutHeight, layoutWidth));
+        frameView-&gt;setUseFixedLayout(true);
+    }
+        
+    bool result = [self _mediaQueryMatches];
+
+    frameView-&gt;setFixedLayoutSize(savedFixedLayoutSize);
+    frameView-&gt;setUseFixedLayout(savedUseFixedLayout);
+
+    return result;
+}
+
+- (BOOL)_mediaQueryMatches
+{
+    HTMLLinkElement* link = static_cast&lt;HTMLLinkElement*&gt;(core(self));
+    String media = link-&gt;getAttribute(HTMLNames::mediaAttr);
+    if (media.isEmpty())
+        return true;
+    Document&amp; document = link-&gt;document();
+
+    RefPtr&lt;MediaQuerySet&gt; mediaQuerySet = MediaQuerySet::createAllowingDescriptionSyntax(media);
+    MediaQueryEvaluator screenEval(&quot;screen&quot;, document.frame(), document.renderView() ? &amp;document.renderView()-&gt;style() : 0);
+
+    return screenEval.eval(mediaQuerySet.get());
+}
+@end
+#endif
+
</ins><span class="cx"> //------------------------------------------------------------------------------------------
</span><span class="cx"> // DOMRange
</span><span class="cx"> 
</span><span class="lines">@@ -442,12 +774,14 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation DOMRGBColor (WebPrivate)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> // FIXME: This should be removed as soon as all internal Apple uses of it have been replaced with
</span><span class="cx"> // calls to the public method - (NSColor *)color.
</span><span class="cx"> - (NSColor *)_color
</span><span class="cx"> {
</span><span class="cx">     return [self color];
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMEventsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMEvents.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMEvents.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/objc/DOMEvents.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -40,3 +40,11 @@
</span><span class="cx"> #import &lt;WebCore/DOMProgressEvent.h&gt;
</span><span class="cx"> #import &lt;WebCore/DOMUIEvent.h&gt;
</span><span class="cx"> #import &lt;WebCore/DOMWheelEvent.h&gt;
</span><ins>+
+#if defined(ENABLE_IOS_TOUCH_EVENTS) &amp;&amp; ENABLE_IOS_TOUCH_EVENTS
+#import &lt;WebCore/DOMTouchEvent.h&gt;
+#endif
+
+#if defined(ENABLE_IOS_GESTURE_EVENTS) &amp;&amp; ENABLE_IOS_GESTURE_EVENTS
+#import &lt;WebCore/DOMGestureEvent.h&gt;
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMEventsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMEvents.mm (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMEvents.mm        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/objc/DOMEvents.mm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -40,6 +40,14 @@
</span><span class="cx"> #import &quot;Event.h&quot;
</span><span class="cx"> #import &quot;EventNames.h&quot;
</span><span class="cx"> 
</span><ins>+#if ENABLE(TOUCH_EVENTS)
+#import &quot;DOMTouchEvent.h&quot;
+#endif
+
+#if ENABLE(IOS_GESTURE_EVENTS)
+#import &quot;DOMGestureEvent.h&quot;
+#endif
+
</ins><span class="cx"> using WebCore::eventNames;
</span><span class="cx"> 
</span><span class="cx"> Class kitClass(WebCore::Event* impl)
</span><span class="lines">@@ -54,7 +62,15 @@
</span><span class="cx">         if (desiredInterface == WebCore::TextEventInterfaceType)
</span><span class="cx">             return [DOMTextEvent class];
</span><span class="cx">         if (desiredInterface == WebCore::WheelEventInterfaceType)
</span><del>-            return [DOMWheelEvent class];
</del><ins>+            return [DOMWheelEvent class];        
+#if PLATFORM(IOS) &amp;&amp; ENABLE(TOUCH_EVENTS)
+        if (desiredInterface == WebCore::TouchEventInterfaceType) 
+            return [DOMTouchEvent class];
+#endif
+#if ENABLE(IOS_GESTURE_EVENTS)
+        if (desiredInterface == WebCore::GestureEventInterfaceType)
+            return [DOMGestureEvent class];
+#endif
</ins><span class="cx">         return [DOMUIEvent class];
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMExtensionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMExtensions.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMExtensions.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/objc/DOMExtensions.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -43,20 +43,89 @@
</span><span class="cx"> #import &lt;WebCore/DOMRGBColor.h&gt;
</span><span class="cx"> #import &lt;WebCore/DOMRange.h&gt;
</span><span class="cx"> 
</span><ins>+#if defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
+#import &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
+
</ins><span class="cx"> @class NSArray;
</span><span class="cx"> @class NSImage;
</span><span class="cx"> @class NSURL;
</span><span class="cx"> 
</span><ins>+
+#if defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
+@interface DOMHTMLElement (DOMHTMLElementExtensions)
+- (int)scrollXOffset;
+- (int)scrollYOffset;
+- (void)setScrollXOffset:(int)x scrollYOffset:(int)y;
+- (void)setScrollXOffset:(int)x scrollYOffset:(int)y adjustForIOSCaret:(BOOL)adjustForIOSCaret;
+- (void)absolutePosition:(int *)x :(int *)y :(int *)w :(int *)h;
+@end
+#endif
+
+#if defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
+typedef struct _WKQuad {
+    CGPoint p1;
+    CGPoint p2;
+    CGPoint p3;
+    CGPoint p4;
+} WKQuad;
+
+@interface WKQuadObject : NSObject
+{
+    WKQuad  _quad;
+}
+
+- (id)initWithQuad:(WKQuad)quad;
+- (WKQuad)quad;
+- (CGRect)boundingBox;
+@end
+#endif
+
</ins><span class="cx"> @interface DOMNode (DOMNodeExtensions)
</span><ins>+#if defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
+- (CGRect)boundingBox;
+#else
</ins><span class="cx"> - (NSRect)boundingBox WEBKIT_AVAILABLE_MAC(10_5);
</span><ins>+#endif
</ins><span class="cx"> - (NSArray *)lineBoxRects WEBKIT_AVAILABLE_MAC(10_5);
</span><ins>+
+#if defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
+- (CGRect)boundingBoxUsingTransforms; // takes transforms into account
+
+- (WKQuad)absoluteQuad;
+- (WKQuad)absoluteQuadAndInsideFixedPosition:(BOOL *)insideFixed;
+- (NSArray *)lineBoxQuads;      // returns array of WKQuadObject
+
+- (NSURL *)hrefURL;
+- (CGRect)hrefFrame;
+- (NSString *)hrefTarget;
+- (NSString *)hrefLabel;
+- (NSString *)hrefTitle;
+- (CGRect)boundingFrame;
+- (WKQuad)innerFrameQuad;       // takes transforms into account
+- (float)computedFontSize;
+- (DOMNode *)nextFocusNode;
+- (DOMNode *)previousFocusNode;
+#endif
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface DOMElement (DOMElementAppKitExtensions)
</span><ins>+#if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED
</ins><span class="cx"> - (NSImage *)image WEBKIT_AVAILABLE_MAC(10_5);
</span><ins>+#endif
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface DOMHTMLDocument (DOMHTMLDocumentExtensions)
</span><span class="cx"> - (DOMDocumentFragment *)createDocumentFragmentWithMarkupString:(NSString *)markupString baseURL:(NSURL *)baseURL WEBKIT_AVAILABLE_MAC(10_5);
</span><span class="cx"> - (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text WEBKIT_AVAILABLE_MAC(10_5);
</span><span class="cx"> @end
</span><ins>+
+#if defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
+@interface DOMHTMLAreaElement (DOMHTMLAreaElementExtensions)
+- (CGRect)boundingFrameForOwner:(DOMNode *)anOwner;
+@end
+
+@interface DOMHTMLSelectElement (DOMHTMLSelectElementExtensions)
+- (DOMNode *)listItemAtIndex:(int)anIndex;
+@end
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMHTMLmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMHTML.mm (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMHTML.mm        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/objc/DOMHTML.mm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -49,6 +49,99 @@
</span><span class="cx"> #import &quot;Settings.h&quot;
</span><span class="cx"> #import &quot;markup.h&quot;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &quot;Autocapitalize.h&quot;
+#import &quot;DOMHTMLElementInternal.h&quot;
+#import &quot;HTMLTextFormControlElement.h&quot;
+#import &quot;JSMainThreadExecState.h&quot;
+#import &quot;RenderLayer.h&quot;
+#import &quot;WAKWindow.h&quot;
+#import &quot;WebCoreThreadMessage.h&quot;
+#endif
+
+#if PLATFORM(IOS)
+
+using namespace WebCore;
+
+@implementation DOMHTMLElement (DOMHTMLElementExtensions)
+
+- (int)scrollXOffset
+{
+    RenderObject *renderer = core(self)-&gt;renderer();
+    if (!renderer)
+        return 0;
+
+    if (!renderer-&gt;isRenderBlockFlow())
+        renderer = renderer-&gt;containingBlock();
+
+    if (!renderer-&gt;isBox() || !renderer-&gt;hasOverflowClip())
+        return 0;
+
+    RenderBox *renderBox = toRenderBox(renderer);
+    return renderBox-&gt;layer()-&gt;scrollXOffset();
+}
+
+- (int)scrollYOffset
+{
+    RenderObject *renderer = core(self)-&gt;renderer();
+    if (!renderer)
+        return 0;
+
+    if (!renderer-&gt;isRenderBlockFlow())
+        renderer = renderer-&gt;containingBlock();
+    if (!renderer-&gt;isBox() || !renderer-&gt;hasOverflowClip())
+        return 0;
+
+    RenderBox *renderBox = toRenderBox(renderer);
+    return renderBox-&gt;layer()-&gt;scrollYOffset();
+}
+
+- (void)setScrollXOffset:(int)x scrollYOffset:(int)y
+{
+    [self setScrollXOffset:x scrollYOffset:y adjustForIOSCaret:NO];
+}
+
+- (void)setScrollXOffset:(int)x scrollYOffset:(int)y adjustForIOSCaret:(BOOL)adjustForIOSCaret
+{
+    RenderObject *renderer = core(self)-&gt;renderer();
+    if (!renderer)
+        return;
+
+    if (!renderer-&gt;isRenderBlockFlow())
+        renderer = renderer-&gt;containingBlock();
+    if (!renderer-&gt;hasOverflowClip() || !renderer-&gt;isBox())
+        return;
+
+    RenderBox *renderBox = toRenderBox(renderer);
+    RenderLayer *layer = renderBox-&gt;layer();
+    if (adjustForIOSCaret)
+        layer-&gt;setAdjustForIOSCaretWhenScrolling(true);
+    layer-&gt;scrollToOffset(IntSize(x, y));
+    if (adjustForIOSCaret)
+        layer-&gt;setAdjustForIOSCaretWhenScrolling(false);
+}
+
+- (void)absolutePosition:(int *)x :(int *)y :(int *)w :(int *)h {
+    RenderBox *renderer = core(self)-&gt;renderBox();
+    if (renderer) {
+        if (w)
+            *w = renderer-&gt;width();
+        if (h)
+            *h = renderer-&gt;width();
+        if (x &amp;&amp; y) {
+            FloatPoint floatPoint(*x, *y);
+            renderer-&gt;localToAbsolute(floatPoint);
+            IntPoint point = roundedIntPoint(floatPoint);
+            *x = point.x();
+            *y = point.y();
+        }
+    }
+}
+
+@end
+
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> //------------------------------------------------------------------------------------------
</span><span class="cx"> // DOMHTMLDocument
</span><span class="cx"> 
</span><span class="lines">@@ -90,6 +183,7 @@
</span><span class="cx">     return core(self)-&gt;isTextField();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> - (NSRect)_rectOnScreen
</span><span class="cx"> {
</span><span class="cx">     // Returns bounding rect of text field, in screen coordinates.
</span><span class="lines">@@ -105,6 +199,7 @@
</span><span class="cx"> #pragma clang diagnostic pop
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> - (void)_replaceCharactersInRange:(NSRange)targetRange withString:(NSString *)replacementString selectingFromIndex:(int)index
</span><span class="cx"> {
</span><span class="lines">@@ -181,6 +276,45 @@
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+@implementation DOMHTMLInputElement (AutocapitalizeAdditions)
+
+- (WebAutocapitalizeType)_autocapitalizeType
+{
+    WebCore::HTMLInputElement* inputElement = core(self);
+    return static_cast&lt;WebAutocapitalizeType&gt;(inputElement-&gt;autocapitalizeType());
+}
+
+@end
+
+@implementation DOMHTMLTextAreaElement (AutocapitalizeAdditions)
+
+- (WebAutocapitalizeType)_autocapitalizeType
+{
+    WebCore::HTMLTextAreaElement* textareaElement = core(self);
+    return static_cast&lt;WebAutocapitalizeType&gt;(textareaElement-&gt;autocapitalizeType());
+}
+
+@end
+
+@implementation DOMHTMLInputElement (WebInputChangeEventAdditions)
+
+- (void)setValueWithChangeEvent:(NSString *)newValue
+{
+    WebCore::JSMainThreadNullState state;
+    core(self)-&gt;setValue(newValue, DispatchInputAndChangeEvent);
+}
+
+- (void)setValueAsNumberWithChangeEvent:(double)newValueAsNumber
+{
+    WebCore::JSMainThreadNullState state;
+    WebCore::ExceptionCode ec = 0;
+    core(self)-&gt;setValueAsNumber(newValueAsNumber, ec, DispatchInputAndChangeEvent);
+}
+
+@end
+#endif
+
</ins><span class="cx"> Class kitClass(WebCore::HTMLCollection* collection)
</span><span class="cx"> {
</span><span class="cx">     if (collection-&gt;type() == WebCore::SelectOptions)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMInternal.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMInternal.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/objc/DOMInternal.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -45,6 +45,9 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     class NodeFilter;
</span><span class="cx">     class XPathNSResolver;
</span><ins>+#if ENABLE(TOUCH_EVENTS)
+    class Touch;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @interface DOMNodeFilter : DOMObject &lt;DOMNodeFilter&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMInternalmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMInternal.mm (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMInternal.mm        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/objc/DOMInternal.mm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -33,10 +33,22 @@
</span><span class="cx"> #import &quot;WebScriptObjectPrivate.h&quot;
</span><span class="cx"> #import &quot;runtime_root.h&quot;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#define NEEDS_WRAPPER_CACHE_LOCK 1
+#endif
+
</ins><span class="cx"> //------------------------------------------------------------------------------------------
</span><span class="cx"> // Wrapping WebCore implementation objects
</span><span class="cx"> 
</span><span class="cx"> static NSMapTable* DOMWrapperCache;
</span><ins>+    
+#ifdef NEEDS_WRAPPER_CACHE_LOCK
+static Mutex&amp; wrapperCacheLock()
+{
+    DEFINE_STATIC_LOCAL(Mutex, wrapperCacheMutex, ());
+    return wrapperCacheMutex;
+}
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if COMPILER(CLANG)
</span><span class="cx"> #pragma clang diagnostic push
</span><span class="lines">@@ -57,6 +69,9 @@
</span><span class="cx"> 
</span><span class="cx"> NSObject* getDOMWrapper(DOMObjectInternal* impl)
</span><span class="cx"> {
</span><ins>+#ifdef NEEDS_WRAPPER_CACHE_LOCK
+    MutexLocker locker(wrapperCacheLock());
+#endif
</ins><span class="cx">     if (!DOMWrapperCache)
</span><span class="cx">         return nil;
</span><span class="cx">     return static_cast&lt;NSObject*&gt;(NSMapGet(DOMWrapperCache, impl));
</span><span class="lines">@@ -64,6 +79,9 @@
</span><span class="cx"> 
</span><span class="cx"> void addDOMWrapper(NSObject* wrapper, DOMObjectInternal* impl)
</span><span class="cx"> {
</span><ins>+#ifdef NEEDS_WRAPPER_CACHE_LOCK
+    MutexLocker locker(wrapperCacheLock());
+#endif
</ins><span class="cx">     if (!DOMWrapperCache)
</span><span class="cx">         DOMWrapperCache = createWrapperCache();
</span><span class="cx">     NSMapInsert(DOMWrapperCache, impl, wrapper);
</span><span class="lines">@@ -71,6 +89,9 @@
</span><span class="cx"> 
</span><span class="cx"> void removeDOMWrapper(DOMObjectInternal* impl)
</span><span class="cx"> {
</span><ins>+#ifdef NEEDS_WRAPPER_CACHE_LOCK
+    MutexLocker locker(wrapperCacheLock());
+#endif
</ins><span class="cx">     if (!DOMWrapperCache)
</span><span class="cx">         return;
</span><span class="cx">     NSMapRemove(DOMWrapperCache, impl);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMPrivate.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMPrivate.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/objc/DOMPrivate.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -26,8 +26,15 @@
</span><span class="cx"> 
</span><span class="cx"> #import &lt;WebCore/DOM.h&gt;
</span><span class="cx"> 
</span><ins>+#if defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
+#import &lt;WebCore/WebAutocapitalize.h&gt;
+#import &lt;CoreText/CoreText.h&gt;
+#endif
+
</ins><span class="cx"> @interface DOMNode (DOMNodeExtensionsPendingPublic)
</span><ins>+#if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED
</ins><span class="cx"> - (NSImage *)renderedImage;
</span><ins>+#endif
</ins><span class="cx"> - (NSArray *)textRects;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="lines">@@ -38,7 +45,9 @@
</span><span class="cx"> // FIXME: this should be removed as soon as all internal Apple uses of it have been replaced with
</span><span class="cx"> // calls to the public method - (NSColor *)color.
</span><span class="cx"> @interface DOMRGBColor (WebPrivate)
</span><ins>+#if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED
</ins><span class="cx"> - (NSColor *)_color;
</span><ins>+#endif
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> // FIXME: this should be removed as soon as all internal Apple uses of it have been replaced with
</span><span class="lines">@@ -48,15 +57,27 @@
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface DOMRange (DOMRangeExtensions)
</span><ins>+#if defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
+- (CGRect)boundingBox;
+#else
</ins><span class="cx"> - (NSRect)boundingBox;
</span><ins>+#endif
+#if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED
</ins><span class="cx"> - (NSImage *)renderedImageForcingBlackText:(BOOL)forceBlackText;
</span><ins>+#else
+- (CGImageRef)renderedImageForcingBlackText:(BOOL)forceBlackText;
+#endif
</ins><span class="cx"> - (NSArray *)lineBoxRects; // Deprecated. Use textRects instead.
</span><span class="cx"> - (NSArray *)textRects;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface DOMElement (WebPrivate)
</span><ins>+#if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED
</ins><span class="cx"> - (NSFont *)_font;
</span><span class="cx"> - (NSData *)_imageTIFFRepresentation;
</span><ins>+#else
+- (CTFontRef)_font;
+#endif
</ins><span class="cx"> - (NSURL *)_getURLAttribute:(NSString *)name;
</span><span class="cx"> - (BOOL)isFocused;
</span><span class="cx"> @end
</span><span class="lines">@@ -81,7 +102,9 @@
</span><span class="cx"> @interface DOMHTMLInputElement (FormAutoFillTransition)
</span><span class="cx"> - (BOOL)_isAutofilled;
</span><span class="cx"> - (BOOL)_isTextField;
</span><ins>+#if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED
</ins><span class="cx"> - (NSRect)_rectOnScreen; // bounding box of the text field, in screen coordinates
</span><ins>+#endif
</ins><span class="cx"> - (void)_replaceCharactersInRange:(NSRange)targetRange withString:(NSString *)replacementString selectingFromIndex:(int)index;
</span><span class="cx"> - (NSRange)_selectedRange;
</span><span class="cx"> - (void)_setAutofilled:(BOOL)filled;
</span><span class="lines">@@ -105,3 +128,26 @@
</span><span class="cx"> - (void)_activateItemAtIndex:(int)index;
</span><span class="cx"> - (void)_activateItemAtIndex:(int)index allowMultipleSelection:(BOOL)allowMultipleSelection;
</span><span class="cx"> @end
</span><ins>+
+#if defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
+enum { WebMediaQueryOrientationCurrent, WebMediaQueryOrientationPortrait, WebMediaQueryOrientationLandscape };
+@interface DOMHTMLLinkElement (WebPrivate)
+- (BOOL)_mediaQueryMatchesForOrientation:(int)orientation;
+- (BOOL)_mediaQueryMatches;
+@end
+
+// These changes are useful to get the AutocapitalizeType on particular form controls.
+@interface DOMHTMLInputElement (AutocapitalizeAdditions)
+- (WebAutocapitalizeType)_autocapitalizeType;
+@end
+
+@interface DOMHTMLTextAreaElement (AutocapitalizeAdditions)
+- (WebAutocapitalizeType)_autocapitalizeType;
+@end
+
+// These are used by Date and Time input types because the generated ObjC methods default to not dispatching events.
+@interface DOMHTMLInputElement (WebInputChangeEventAdditions)
+- (void)setValueWithChangeEvent:(NSString *)newValue;
+- (void)setValueAsNumberWithChangeEvent:(double)newValueAsNumber;
+@end
+#endif // defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMUIKitExtensionsh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.h (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1,89 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ *
+ */
+
+#if defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
+
+#import &lt;WebCore/DOMElement.h&gt;
+#import &lt;WebCore/DOMExtensions.h&gt;
+#import &lt;WebCore/DOMHTMLAreaElement.h&gt;
+#import &lt;WebCore/DOMHTMLImageElement.h&gt;
+#import &lt;WebCore/DOMHTMLSelectElement.h&gt;
+#import &lt;WebCore/DOMNode.h&gt;
+#import &lt;WebCore/DOMRange.h&gt;
+
+typedef enum { 
+    // The first four match SelectionDirection.  The last two don't have WebKit counterparts because
+    // they aren't necessary until there is support vertical layout.
+    WebTextAdjustmentForward,
+    WebTextAdjustmentBackward,
+    WebTextAdjustmentRight,
+    WebTextAdjustmentLeft,
+    WebTextAdjustmentUp,
+    WebTextAdjustmentDown
+} WebTextAdjustmentDirection; 
+
+@interface DOMRange (UIKitExtensions)
+
+- (void)move:(UInt32)amount inDirection:(WebTextAdjustmentDirection)direction;
+- (void)extend:(UInt32)amount inDirection:(WebTextAdjustmentDirection)direction;
+- (DOMNode *)firstNode;
+
+@end
+
+@interface DOMNode (UIKitExtensions)
+- (NSArray *)borderRadii;
+- (NSArray *)boundingBoxes;
+- (NSArray *)absoluteQuads;     // return array of WKQuadObjects. takes transforms into account
+
+- (BOOL)containsOnlyInlineObjects;
+- (BOOL)isSelectableBlock;
+- (DOMRange *)rangeOfContainingParagraph;
+- (CGFloat)textHeight;
+- (DOMNode *)findExplodedTextNodeAtPoint:(CGPoint)point;  // A second-chance pass to look for text nodes missed by the hit test.
+@end
+
+@interface DOMHTMLAreaElement (UIKitExtensions)
+- (CGRect)boundingBoxWithOwner:(DOMNode *)anOwner;
+- (WKQuad)absoluteQuadWithOwner:(DOMNode *)anOwner;     // takes transforms into account
+- (NSArray *)boundingBoxesWithOwner:(DOMNode *)anOwner;
+- (NSArray *)absoluteQuadsWithOwner:(DOMNode *)anOwner; // return array of WKQuadObjects. takes transforms into account
+@end
+
+@interface DOMHTMLSelectElement (UIKitExtensions)
+- (unsigned)completeLength;
+- (DOMNode *)listItemAtIndex:(int)anIndex;
+@end
+
+@interface DOMHTMLImageElement (WebDOMHTMLImageElementOperationsPrivate)
+- (NSData *)dataRepresentation:(BOOL)rawImageData;
+- (NSString *)mimeType;
+@end
+
+@interface DOMElement (DOMUIKitComplexityExtensions) 
+- (int)structuralComplexityContribution; // Does not include children.
+@end
+
+#endif // defined(TARGET_OS_EMBEDDED) &amp;&amp; TARGET_OS_EMBEDDED
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMUIKitExtensionsmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm                                (rev 0)
+++ trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1,507 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008, 2009, 2013 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ *
+ */
+
+#if PLATFORM(IOS)
+
+#import &quot;config.h&quot;
+#import &quot;htmlediting.h&quot;
+
+#import &quot;CachedImage.h&quot;
+#import &quot;DOM.h&quot;
+#import &quot;DOMCore.h&quot;
+#import &quot;DOMExtensions.h&quot;
+#import &quot;DOMHTML.h&quot;
+#import &quot;DOMHTMLAreaElementInternal.h&quot;
+#import &quot;DOMHTMLElementInternal.h&quot;
+#import &quot;DOMHTMLImageElementInternal.h&quot;
+#import &quot;DOMHTMLSelectElementInternal.h&quot;
+#import &quot;DOMInternal.h&quot;
+#import &quot;DOMNodeInternal.h&quot;
+#import &quot;DOMRangeInternal.h&quot;
+#import &quot;DOMUIKitExtensions.h&quot;
+#import &quot;FloatPoint.h&quot;
+#import &quot;Font.h&quot;
+#import &quot;FrameSelection.h&quot;
+#import &quot;HTMLAreaElement.h&quot;
+#import &quot;HTMLImageElement.h&quot;
+#import &quot;HTMLInputElement.h&quot;
+#import &quot;HTMLSelectElement.h&quot;
+#import &quot;HTMLTextAreaElement.h&quot;
+#import &quot;Image.h&quot;
+#import &quot;InlineBox.h&quot;
+#import &quot;Node.h&quot;
+#import &quot;Range.h&quot;
+#import &quot;RenderBlock.h&quot;
+#import &quot;RenderBlockFlow.h&quot;
+#import &quot;RenderBox.h&quot;
+#import &quot;RoundedRect.h&quot;
+#import &quot;RenderObject.h&quot;
+#import &quot;RenderStyleConstants.h&quot;
+#import &quot;RenderText.h&quot;
+#import &quot;ResourceBuffer.h&quot;
+#import &quot;SharedBuffer.h&quot;
+#import &quot;TextIterator.h&quot;
+#import &quot;VisiblePosition.h&quot;
+#import &quot;VisibleUnits.h&quot;
+
+#import &quot;WAKAppKitStubs.h&quot;
+
+using namespace WebCore;
+
+using WebCore::FloatPoint;
+using WebCore::Font;
+using WebCore::HTMLAreaElement;
+using WebCore::HTMLImageElement;
+using WebCore::HTMLSelectElement;
+using WebCore::InlineBox;
+using WebCore::IntRect;
+using WebCore::Node;
+using WebCore::Position;
+using WebCore::Range;
+using WebCore::RenderBlock;
+using WebCore::RenderBox;
+using WebCore::RenderObject;
+using WebCore::RenderStyle;
+using WebCore::RenderText;
+using WebCore::RootInlineBox;
+using WebCore::TextIterator;
+using WebCore::VisiblePosition;
+
+@implementation DOMRange (UIKitExtensions)
+
+- (void)move:(UInt32)amount inDirection:(WebTextAdjustmentDirection)direction
+{
+    Range *range = core(self);
+    FrameSelection frameSelection;
+    frameSelection.moveTo(range, DOWNSTREAM);
+    
+    TextGranularity granularity = CharacterGranularity;
+    // Until WebKit supports vertical layout, &quot;down&quot; is equivalent to &quot;forward by a line&quot; and
+    // &quot;up&quot; is equivalent to &quot;backward by a line&quot;.
+    if (direction == WebTextAdjustmentDown) {
+        direction = WebTextAdjustmentForward;
+        granularity = LineGranularity;
+    } else if (direction == WebTextAdjustmentUp) {
+        direction = WebTextAdjustmentBackward;
+        granularity = LineGranularity;
+    }
+    
+    for (UInt32 i = 0; i &lt; amount; i++)
+        frameSelection.modify(FrameSelection::AlterationMove, (SelectionDirection)direction, granularity);
+    
+    ExceptionCode ignored;
+    range-&gt;setStart(frameSelection.start().anchorNode(), frameSelection.start().deprecatedEditingOffset(), ignored);
+    range-&gt;setEnd(frameSelection.end().anchorNode(), frameSelection.end().deprecatedEditingOffset(), ignored);
+}
+
+- (void)extend:(UInt32)amount inDirection:(WebTextAdjustmentDirection)direction
+{
+    Range *range = core(self);
+    FrameSelection frameSelection;
+    frameSelection.moveTo(range, DOWNSTREAM);
+    
+    for (UInt32 i = 0; i &lt; amount; i++)
+        frameSelection.modify(FrameSelection::AlterationExtend, (SelectionDirection)direction, CharacterGranularity);    
+    
+    ExceptionCode ignored;
+    range-&gt;setStart(frameSelection.start().anchorNode(), frameSelection.start().deprecatedEditingOffset(), ignored);
+    range-&gt;setEnd(frameSelection.end().anchorNode(), frameSelection.end().deprecatedEditingOffset(), ignored);    
+}
+
+- (DOMNode *)firstNode
+{
+    return kit(core(self)-&gt;firstNode());
+}
+
+@end
+
+//-------------------
+
+@implementation DOMNode (UIKitExtensions)
+
+// NOTE: Code blatantly copied from [WebInspector _hightNode:] in WebKit/WebInspector/WebInspector.m@19861
+- (NSArray *)boundingBoxes
+{
+    NSArray *rects = nil;
+    NSRect bounds = [self boundingBox];
+    if (!NSIsEmptyRect(bounds)) {
+        if ([self isKindOfClass:[DOMElement class]]) {
+            DOMDocument *document = [self ownerDocument];
+            DOMCSSStyleDeclaration *style = [document getComputedStyle:(DOMElement *)self pseudoElement:@&quot;&quot;];
+            if ([[style getPropertyValue:@&quot;display&quot;] isEqualToString:@&quot;inline&quot;])
+                rects = [self lineBoxRects];
+        } else if ([self isKindOfClass:[DOMText class]]
+#if ENABLE(SVG_DOM_OBJC_BINDINGS)
+                   &amp;&amp; ![[self parentNode] isKindOfClass:NSClassFromString(@&quot;DOMSVGElement&quot;)]
+#endif
+                  )
+            rects = [self lineBoxRects];
+    }
+
+    if (![rects count])
+        rects = [NSArray arrayWithObject:[NSValue valueWithRect:bounds]];
+
+    return rects;
+}
+
+- (NSArray *)absoluteQuads
+{
+    NSArray *quads = nil;
+    NSRect bounds = [self boundingBox];
+    if (!NSIsEmptyRect(bounds)) {
+        if ([self isKindOfClass:[DOMElement class]]) {
+            DOMDocument *document = [self ownerDocument];
+            DOMCSSStyleDeclaration *style = [document getComputedStyle:(DOMElement *)self pseudoElement:@&quot;&quot;];
+            if ([[style getPropertyValue:@&quot;display&quot;] isEqualToString:@&quot;inline&quot;])
+                quads = [self lineBoxQuads];
+        } else if ([self isKindOfClass:[DOMText class]]
+#if ENABLE(SVG_DOM_OBJC_BINDINGS)
+                   &amp;&amp; ![[self parentNode] isKindOfClass:NSClassFromString(@&quot;DOMSVGElement&quot;)]
+#endif
+                   )
+            quads = [self lineBoxQuads];
+    }
+
+    if (![quads count]) {
+        WKQuadObject* quadObject = [[WKQuadObject alloc] initWithQuad:[self absoluteQuad]];
+        quads = [NSArray arrayWithObject:quadObject];
+        [quadObject release];
+    }
+
+    return quads;
+}
+
+- (NSArray *)borderRadii
+{
+    RenderObject* renderer = core(self)-&gt;renderer();
+    
+
+    if (renderer &amp;&amp; renderer-&gt;isBox()) {
+        RoundedRect::Radii radii = toRenderBox(renderer)-&gt;borderRadii();
+        return @[[NSValue valueWithSize:(CGSize)radii.topLeft()],
+                 [NSValue valueWithSize:(CGSize)radii.topRight()],
+                 [NSValue valueWithSize:(CGSize)radii.bottomLeft()],
+                 [NSValue valueWithSize:(CGSize)radii.bottomRight()]];
+    }
+    NSValue *emptyValue = [NSValue valueWithSize:CGSizeZero];
+    return @[emptyValue, emptyValue, emptyValue, emptyValue];
+}
+
+- (BOOL)containsOnlyInlineObjects
+{
+    RenderObject * renderer = core(self)-&gt;renderer();
+    return  (renderer &amp;&amp;
+             renderer-&gt;childrenInline() &amp;&amp;
+             (renderer-&gt;isRenderBlock() &amp;&amp; toRenderBlock(renderer)-&gt;inlineElementContinuation() == nil) &amp;&amp;
+             !renderer-&gt;isTable());
+}
+
+- (BOOL)isSelectableBlock
+{
+    RenderObject * renderer = core(self)-&gt;renderer();
+    return (renderer &amp;&amp; (renderer-&gt;isRenderBlockFlow() || (renderer-&gt;isRenderBlock() &amp;&amp; toRenderBlock(renderer)-&gt;inlineElementContinuation() != nil)));
+}
+
+- (DOMRange *)rangeOfContainingParagraph
+{
+    DOMRange *result = nil;
+    
+    Node *node = core(self);    
+    VisiblePosition visiblePosition(createLegacyEditingPosition(node, 0), WebCore::DOWNSTREAM);
+    VisiblePosition visibleParagraphStart = startOfParagraph(visiblePosition);
+    VisiblePosition visibleParagraphEnd = endOfParagraph(visiblePosition);
+    
+    Position paragraphStart = visibleParagraphStart.deepEquivalent().parentAnchoredEquivalent();
+    Position paragraphEnd = visibleParagraphEnd.deepEquivalent().parentAnchoredEquivalent();    
+    
+    if (paragraphStart.isNotNull() &amp;&amp; paragraphEnd.isNotNull()) {
+        PassRefPtr&lt;Range&gt; range = Range::create(*node-&gt;ownerDocument(), paragraphStart, paragraphEnd);
+        result = kit(range.get());
+    }
+    
+    return result;
+}
+
+- (CGFloat)textHeight
+{  
+    RenderObject *o = core(self)-&gt;renderer();
+    if (o &amp;&amp; o-&gt;isText()) {
+        RenderText *t = toRenderText(o);
+        return t-&gt;style().computedLineHeight();;
+    }
+    
+    return CGFLOAT_MAX;
+}
+
+- (DOMNode *)findExplodedTextNodeAtPoint:(CGPoint)point
+{
+    // A light, non-recursive version of RenderBlock::positionForCoordinates that looks at
+    // whether a point lies within the gaps between its root line boxes, to be called against
+    // a node returned from elementAtPoint.  We make the assumption that either the node or one
+    // of its immediate children contains the root line boxes in question.
+    // See &lt;rdar://problem/6824650&gt; for context.
+    RenderObject *renderer = core(self)-&gt;renderer();
+    if (!renderer || !renderer-&gt;isRenderBlockFlow())
+        return nil;
+
+    RenderBlock *block = static_cast&lt;RenderBlock *&gt;(renderer);
+    
+    FloatPoint absPoint(point);
+    FloatPoint localPoint = block-&gt;absoluteToLocal(absPoint);
+
+    if (!block-&gt;childrenInline()) {
+        // Look among our immediate children for an alternate box that contains the point.
+        for (RenderBox* child = block-&gt;firstChildBox(); child; child = child-&gt;nextSiblingBox()) {
+            if (child-&gt;height() == 0 || child-&gt;style().visibility() != WebCore::VISIBLE || child-&gt;isFloatingOrOutOfFlowPositioned())
+                continue;
+            float top = child-&gt;y();
+            
+            RenderBox* nextChild = child-&gt;nextSiblingBox();
+            while (nextChild &amp;&amp; nextChild-&gt;isFloatingOrOutOfFlowPositioned())
+                nextChild = nextChild-&gt;nextSiblingBox();
+            if (!nextChild) {
+                if (localPoint.y() &gt;= top) {
+                    block = static_cast&lt;RenderBlock *&gt;(child);
+                    break;
+                }
+                continue;
+            }
+            
+            float bottom = nextChild-&gt;y();
+            
+            if (localPoint.y() &gt;= top &amp;&amp; localPoint.y() &lt; bottom &amp;&amp; child-&gt;isRenderBlock()) {
+                block = static_cast&lt;RenderBlock *&gt;(child);
+                break;
+            }                
+        }
+        
+        if (!block-&gt;childrenInline())
+            return nil;
+        
+        localPoint = block-&gt;absoluteToLocal(absPoint);
+    }
+
+    RenderBlockFlow *blockFlow = toRenderBlockFlow(block);
+    
+    // Only check the gaps between the root line boxes.  We deliberately ignore overflow because
+    // experience has shown that hit tests on an exploded text node can fail when within the
+    // overflow region.
+    for (RootInlineBox *cur = blockFlow-&gt;firstRootBox(); cur &amp;&amp; cur != blockFlow-&gt;lastRootBox(); cur = cur-&gt;nextRootBox()) {
+        float currentBottom = cur-&gt;y() + cur-&gt;logicalHeight();        
+        if (localPoint.y() &lt; currentBottom)
+            return nil;
+
+        RootInlineBox *next = cur-&gt;nextRootBox();
+        float nextTop = next-&gt;y();
+        if (localPoint.y() &lt; nextTop) {
+            InlineBox *inlineBox = cur-&gt;closestLeafChildForLogicalLeftPosition(localPoint.x());
+            if (inlineBox &amp;&amp; inlineBox-&gt;behavesLikeText() &amp;&amp; inlineBox-&gt;renderer().isText()) {
+                RenderText *t = toRenderText(&amp;inlineBox-&gt;renderer());
+                if (t-&gt;textNode()) {
+                    return kit(t-&gt;textNode());
+                }
+            }
+        }
+
+    }
+    return nil;    
+}
+
+@end
+
+//-----------------
+
+@implementation DOMElement (DOMUIKitComplexityExtensions) 
+
+- (int)structuralComplexityContribution { return 0; }
+
+@end
+
+@implementation DOMHTMLElement (DOMUIKitComplexityExtensions) 
+
+- (int)structuralComplexityContribution
+{
+    int result = 0;
+    RenderObject * renderer = core(self)-&gt;renderer();
+    if (renderer) {
+        if (renderer-&gt;isFloatingOrOutOfFlowPositioned() ||
+            renderer-&gt;isWidget()) {
+            result = INT_MAX;
+        } else if (renderer-&gt;isEmpty()) {
+            result = 0;
+        } else if (renderer-&gt;isRenderBlockFlow() || (renderer-&gt;isRenderBlock() &amp;&amp; toRenderBlock(renderer)-&gt;inlineElementContinuation() != 0)) {
+            BOOL noCost = NO;
+            if (renderer-&gt;isBox()) {
+                RenderBox *asBox = renderer-&gt;enclosingBox();
+                RenderObject *parent = asBox-&gt;parent();
+                RenderBox *parentRenderBox = (parent &amp;&amp; parent-&gt;isBox()) ? toRenderBox(parent) : 0;
+                if (parentRenderBox &amp;&amp; asBox &amp;&amp; asBox-&gt;width() == parentRenderBox-&gt;width()) {
+                    noCost = YES;
+                }
+            }
+            result = (noCost ? 0 : 1);
+        } else if (renderer-&gt;hasTransform()) {
+            result = INT_MAX;
+        }
+    }
+    return result;
+}
+
+@end
+
+@implementation DOMHTMLBodyElement (DOMUIKitComplexityExtensions)
+- (int)structuralComplexityContribution { return 0; }
+@end
+
+
+// Maximally complex elements
+
+@implementation DOMHTMLFormElement (DOMUIKitComplexityExtensions)
+- (int)structuralComplexityContribution { return INT_MAX; }
+@end
+
+@implementation DOMHTMLTableElement (DOMUIKitComplexityExtensions)
+- (int)structuralComplexityContribution { return INT_MAX; }
+@end
+
+@implementation DOMHTMLFrameElement (DOMUIKitComplexityExtensions)
+- (int)structuralComplexityContribution { return INT_MAX; }
+@end
+
+@implementation DOMHTMLIFrameElement (DOMUIKitComplexityExtensions)
+- (int)structuralComplexityContribution { return INT_MAX; }
+@end
+
+@implementation DOMHTMLButtonElement (DOMUIKitComplexityExtensions)
+- (int)structuralComplexityContribution { return INT_MAX; }
+@end
+
+@implementation DOMHTMLTextAreaElement (DOMUIKitComplexityExtensions)
+- (int)structuralComplexityContribution { return INT_MAX; }
+@end
+
+@implementation DOMHTMLInputElement (DOMUIKitComplexityExtensions)
+- (int)structuralComplexityContribution { return INT_MAX; }
+@end
+
+@implementation DOMHTMLSelectElement (DOMUIKitComplexityExtensions)
+- (int)structuralComplexityContribution { return INT_MAX; }
+@end
+
+
+//-----------------
+        
+@implementation DOMHTMLAreaElement (DOMUIKitExtensions)
+
+- (CGRect)boundingBoxWithOwner:(DOMNode *)anOwner
+{
+    // ignores transforms
+    return anOwner ? pixelSnappedIntRect(core(self)-&gt;computeRect(core(anOwner)-&gt;renderer())) : CGRectZero;
+}
+
+- (WKQuad)absoluteQuadWithOwner:(DOMNode *)anOwner
+{
+    if (anOwner) {
+        // FIXME: ECLAIR
+        //WebCore::FloatQuad theQuad = core(self)-&gt;getAbsoluteQuad(core(anOwner)-&gt;renderer());
+        WebCore::IntRect rect = pixelSnappedIntRect(core(self)-&gt;computeRect(core(anOwner)-&gt;renderer()));
+        WKQuad quad;
+        quad.p1 = CGPointMake(rect.x(), rect.y());
+        quad.p2 = CGPointMake(rect.maxX(), rect.y());
+        quad.p3 = CGPointMake(rect.maxX(), rect.maxY());
+        quad.p4 = CGPointMake(rect.x(), rect.maxY());
+        return quad;
+    }
+
+    WKQuad zeroQuad = { CGPointZero, CGPointZero, CGPointZero, CGPointZero };
+    return zeroQuad;
+}
+
+- (NSArray *)boundingBoxesWithOwner:(DOMNode *)anOwner
+{
+    return [NSArray arrayWithObject:[NSValue valueWithRect:[self boundingBoxWithOwner:anOwner]]];
+}
+
+- (NSArray *)absoluteQuadsWithOwner:(DOMNode *)anOwner
+{
+    WKQuadObject* quadObject = [[WKQuadObject alloc] initWithQuad:[self absoluteQuadWithOwner:anOwner]];
+    NSArray*    quadArray = [NSArray arrayWithObject:quadObject];
+    [quadObject release];
+    return quadArray;
+}
+
+@end
+
+@implementation DOMHTMLSelectElement (DOMUIKitExtensions)
+
+- (unsigned)completeLength
+{
+    return core(self)-&gt;listItems().size();
+}
+
+- (DOMNode *)listItemAtIndex:(int)anIndex
+{
+    return kit(core(self)-&gt;listItems()[anIndex]);
+}
+
+@end
+
+@implementation DOMHTMLImageElement (WebDOMHTMLImageElementOperationsPrivate)
+
+- (NSData *)dataRepresentation:(BOOL)rawImageData
+{
+    WebCore::CachedImage *cachedImage = core(self)-&gt;cachedImage();
+    if (!cachedImage)
+        return nil;
+    WebCore::Image *image = cachedImage-&gt;image();
+    if (!image)
+        return nil;
+    WebCore::SharedBuffer *data = nil;
+    if (rawImageData) {
+        ResourceBuffer *resourceBuffer = cachedImage-&gt;resourceBuffer();
+        if (resourceBuffer)
+            data = resourceBuffer-&gt;sharedBuffer();
+    } else {
+        data = image-&gt;data();
+    }
+    if (!data)
+        return nil;
+    
+    return [data-&gt;createNSData().leakRef() autorelease];
+}
+
+- (NSString *)mimeType
+{
+    WebCore::CachedImage *cachedImage = core(self)-&gt;cachedImage();
+    if (!cachedImage || !cachedImage-&gt;image())
+        return nil;
+    
+    return cachedImage-&gt;response().mimeType();
+}
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcPublicDOMInterfacesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/PublicDOMInterfaces.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/PublicDOMInterfaces.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/objc/PublicDOMInterfaces.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> // All public DOM class interfaces, properties and methods need to be in this file.
</span><span class="cx"> // Anything not in the file will be generated into the appropriate private header file.
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/Platform.h&gt;
+
</ins><span class="cx"> #ifndef OBJC_CODE_GENERATION
</span><span class="cx"> #error Do not include this header, instead include the appropriate DOM header.
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -49,6 +49,40 @@
</span><span class="cx"> my $numCachedAttributes = 0;
</span><span class="cx"> my $currentCachedAttribute = 0;
</span><span class="cx"> 
</span><ins>+my $beginAppleCopyrightForHeaderFiles = &lt;&lt;END;
+// ------- Begin Apple Copyright -------
+/*
+ * Copyright (C) 2008, Apple Inc. All rights reserved.
+ *
+ * Permission is granted by Apple to use this file to the extent
+ * necessary to relink with LGPL WebKit files.
+ *
+ * No license or rights are granted by Apple expressly or by
+ * implication, estoppel, or otherwise, to Apple patents and
+ * trademarks. For the sake of clarity, no license or rights are
+ * granted by Apple expressly or by implication, estoppel, or otherwise,
+ * under any Apple patents, copyrights and trademarks to underlying
+ * implementations of any application programming interfaces (APIs)
+ * or to any functionality that is invoked by calling any API.
+ */
+
+END
+my $beginAppleCopyrightForSourceFiles = &lt;&lt;END;
+// ------- Begin Apple Copyright -------
+/*
+ * Copyright (C) 2008, Apple Inc. All rights reserved.
+ *
+ * No license or rights are granted by Apple expressly or by implication,
+ * estoppel, or otherwise, to Apple copyrights, patents, trademarks, trade
+ * secrets or other rights.
+ */
+
+END
+my $endAppleCopyright   = &lt;&lt;END;
+// ------- End Apple Copyright   -------
+
+END
+
</ins><span class="cx"> # Default .h template
</span><span class="cx"> my $headerTemplate = &lt;&lt; &quot;EOF&quot;;
</span><span class="cx"> /*
</span><span class="lines">@@ -448,7 +482,12 @@
</span><span class="cx">     my $interface = shift;
</span><span class="cx">     my $className = &quot;JS&quot; . $interface-&gt;name;
</span><span class="cx"> 
</span><del>-    my @headerContentHeader = split(&quot;\r&quot;, $headerTemplate);
</del><ins>+    my @headerContentHeader;
+    if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+        @headerContentHeader = split(&quot;\r&quot;, $beginAppleCopyrightForHeaderFiles);
+    } else {
+        @headerContentHeader = split(&quot;\r&quot;, $headerTemplate);
+    }
</ins><span class="cx"> 
</span><span class="cx">     # - Add header protection
</span><span class="cx">     push(@headerContentHeader, &quot;\n#ifndef $className&quot; . &quot;_h&quot;);
</span><span class="lines">@@ -464,7 +503,12 @@
</span><span class="cx">     my $interface = shift;
</span><span class="cx">     my $className = &quot;JS&quot; . $interface-&gt;name;
</span><span class="cx"> 
</span><del>-    my @implContentHeader = split(&quot;\r&quot;, $headerTemplate);
</del><ins>+    my @implContentHeader;
+    if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+        @implContentHeader = split(&quot;\r&quot;, $beginAppleCopyrightForSourceFiles);
+    } else {
+        @implContentHeader = split(&quot;\r&quot;, $headerTemplate);
+    }
</ins><span class="cx"> 
</span><span class="cx">     push(@implContentHeader, &quot;\n#include \&quot;config.h\&quot;\n&quot;);
</span><span class="cx">     my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($interface);
</span><span class="lines">@@ -867,8 +911,21 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($numCustomFunctions &gt; 0) {
</span><ins>+        my $inAppleCopyright = 0;
</ins><span class="cx">         push(@headerContent, &quot;\n    // Custom functions\n&quot;);
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><ins>+            # PLATFORM_IOS
+            my $needsAppleCopyright = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;};
+            if ($needsAppleCopyright) {
+                if (!$inAppleCopyright) {
+                    push(@headerContent, $beginAppleCopyrightForHeaderFiles);
+                    $inAppleCopyright = 1;
+                }
+            } elsif ($inAppleCopyright) {
+                push(@headerContent, $endAppleCopyright);
+                $inAppleCopyright = 0;
+            }
+            # end PLATFORM_IOS
</ins><span class="cx">             next unless HasCustomMethod($function-&gt;signature-&gt;extendedAttributes);
</span><span class="cx">             next if $function-&gt;{overloads} &amp;&amp; $function-&gt;{overloadIndex} != 1;
</span><span class="cx">             my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($function-&gt;signature);
</span><span class="lines">@@ -877,6 +934,7 @@
</span><span class="cx">             push(@headerContent, &quot;    &quot; . ($function-&gt;isStatic ? &quot;static &quot; : &quot;&quot;) . &quot;JSC::JSValue &quot; . $functionImplementationName . &quot;(JSC::ExecState*);\n&quot;);
</span><span class="cx">             push(@headerContent, &quot;#endif\n&quot;) if $conditionalString;
</span><span class="cx">         }
</span><ins>+        push(@headerContent, $endAppleCopyright) if $inAppleCopyright;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!$hasParent) {
</span><span class="lines">@@ -1043,15 +1101,29 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($numFunctions &gt; 0) {
</span><ins>+        my $inAppleCopyright = 0;
</ins><span class="cx">         push(@headerContent,&quot;// Functions\n\n&quot;);
</span><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
</span><ins>+            my $needsAppleCopyright = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;};
+            if ($needsAppleCopyright) {
+                if (!$inAppleCopyright) {
+                    push(@headerContent, $beginAppleCopyrightForHeaderFiles);
+                    $inAppleCopyright = 1;
+                }
+            } elsif ($inAppleCopyright) {
+                push(@headerContent, $endAppleCopyright);
+                $inAppleCopyright = 0;
+            }
+
</ins><span class="cx">             my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($function-&gt;signature);
</span><span class="cx">             push(@headerContent, &quot;#if ${conditionalString}\n&quot;) if $conditionalString;
</span><span class="cx">             my $functionName = GetFunctionName($className, $function);
</span><span class="cx">             push(@headerContent, &quot;JSC::EncodedJSValue JSC_HOST_CALL ${functionName}(JSC::ExecState*);\n&quot;);
</span><span class="cx">             push(@headerContent, &quot;#endif\n&quot;) if $conditionalString;
</span><span class="cx">         }
</span><ins>+
+        push(@headerContent, $endAppleCopyright) if $inAppleCopyright;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($numAttributes &gt; 0 || !$interface-&gt;extendedAttributes-&gt;{&quot;NoInterfaceObject&quot;}) {
</span><span class="lines">@@ -1094,6 +1166,10 @@
</span><span class="cx">     push(@headerContent, &quot;\n} // namespace WebCore\n\n&quot;);
</span><span class="cx">     push(@headerContent, &quot;#endif // ${conditionalString}\n\n&quot;) if $conditionalString;
</span><span class="cx">     push(@headerContent, &quot;#endif\n&quot;);
</span><ins>+
+    if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+        push(@headerContent, split(&quot;\r&quot;, $endAppleCopyright));
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GenerateAttributesHashTable($$)
</span><span class="lines">@@ -2382,7 +2458,19 @@
</span><span class="cx"> 
</span><span class="cx">     # Functions
</span><span class="cx">     if ($numFunctions &gt; 0) {
</span><ins>+        my $inAppleCopyright = 0;
</ins><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><ins>+            my $needsAppleCopyright = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;};
+            if ($needsAppleCopyright) {
+                if (!$inAppleCopyright) {
+                    push(@implContent, $beginAppleCopyrightForSourceFiles);
+                    $inAppleCopyright = 1;
+                }
+            } elsif ($inAppleCopyright) {
+                push(@implContent, $endAppleCopyright);
+                $inAppleCopyright = 0;
+            }
+
</ins><span class="cx">             my $isCustom = HasCustomMethod($function-&gt;signature-&gt;extendedAttributes);
</span><span class="cx">             my $isOverloaded = $function-&gt;{overloads} &amp;&amp; @{$function-&gt;{overloads}} &gt; 1;
</span><span class="cx">             my $raisesException = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;RaisesException&quot;};
</span><span class="lines">@@ -2497,6 +2585,9 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">         }
</span><ins>+
+        push(@implContent, $endAppleCopyright) if $inAppleCopyright;
+
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if ($needsMarkChildren &amp;&amp; !$interface-&gt;extendedAttributes-&gt;{&quot;JSCustomMarkFunction&quot;}) {
</span><span class="lines">@@ -3229,6 +3320,10 @@
</span><span class="cx">     push(@implContent, &quot;\n}\n&quot;);
</span><span class="cx">     my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($interface);
</span><span class="cx">     push(@implContent, &quot;\n#endif // ${conditionalString}\n&quot;) if $conditionalString;
</span><ins>+
+    if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+        push(@implContent, split(&quot;\r&quot;, $endAppleCopyright));
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GenerateImplementationFunctionCall()
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorObjCpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -48,11 +48,46 @@
</span><span class="cx"> 
</span><span class="cx"> my @internalHeaderContent = ();
</span><span class="cx"> 
</span><ins>+my @implConditionalIncludes = ();
</ins><span class="cx"> my @implContentHeader = ();
</span><span class="cx"> my @implContent = ();
</span><span class="cx"> my %implIncludes = ();
</span><span class="cx"> my @depsContent = ();
</span><span class="cx"> 
</span><ins>+my $beginAppleCopyrightForHeaderFiles = &lt;&lt;END;
+// ------- Begin Apple Copyright -------
+/*
+ * Copyright (C) 2008, Apple Inc. All rights reserved.
+ *
+ * Permission is granted by Apple to use this file to the extent
+ * necessary to relink with LGPL WebKit files.
+ *
+ * No license or rights are granted by Apple expressly or by
+ * implication, estoppel, or otherwise, to Apple patents and
+ * trademarks. For the sake of clarity, no license or rights are
+ * granted by Apple expressly or by implication, estoppel, or otherwise,
+ * under any Apple patents, copyrights and trademarks to underlying
+ * implementations of any application programming interfaces (APIs)
+ * or to any functionality that is invoked by calling any API.
+ */
+
+END
+my $beginAppleCopyrightForSourceFiles = &lt;&lt;END;
+// ------- Begin Apple Copyright -------
+/*
+ * Copyright (C) 2008, Apple Inc. All rights reserved.
+ *
+ * No license or rights are granted by Apple expressly or by implication,
+ * estoppel, or otherwise, to Apple copyrights, patents, trademarks, trade
+ * secrets or other rights.
+ */
+
+END
+my $endAppleCopyright   = &lt;&lt;END;
+// ------- End Apple Copyright   -------
+
+END
+
</ins><span class="cx"> # Hashes
</span><span class="cx"> my %protocolTypeHash = (&quot;XPathNSResolver&quot; =&gt; 1, &quot;EventListener&quot; =&gt; 1, &quot;EventTarget&quot; =&gt; 1, &quot;NodeFilter&quot; =&gt; 1,
</span><span class="cx">                         &quot;SVGFilterPrimitiveStandardAttributes&quot; =&gt; 1, 
</span><span class="lines">@@ -76,6 +111,7 @@
</span><span class="cx">                     &quot;SVGStringList&quot; =&gt; 1, &quot;SVGTransform&quot; =&gt; 1, &quot;SVGTransformList&quot; =&gt; 1, &quot;SVGUnitTypes&quot; =&gt; 1);
</span><span class="cx"> 
</span><span class="cx"> # Constants
</span><ins>+my $buildingForIPhone = ($ENV{PLATFORM_NAME} eq &quot;iphoneos&quot; or $ENV{PLATFORM_NAME} eq &quot;iphonesimulator&quot;);
</ins><span class="cx"> my $nullableInit = &quot;bool isNull = false;&quot;;
</span><span class="cx"> my $exceptionInit = &quot;WebCore::ExceptionCode ec = 0;&quot;;
</span><span class="cx"> my $jsContextSetter = &quot;WebCore::JSMainThreadNullState state;&quot;;
</span><span class="lines">@@ -214,6 +250,18 @@
</span><span class="cx">     my $actualSuperClass;
</span><span class="cx">     %publicInterfaces = ();
</span><span class="cx"> 
</span><ins>+    my @args = qw(-E -P -x objective-c);
+    # Set include path to find &lt;wtf/Platform.h&gt;.  We search BUILT_PRODUCTS_DIR
+    # first for local developer builds, then the installation path for B&amp;I
+    # builds.
+    push(@args, &quot;-I&quot; . $ENV{BUILT_PRODUCTS_DIR} . &quot;/usr/local/include&quot;) if $ENV{BUILT_PRODUCTS_DIR};
+    push(@args, &quot;-I&quot; . $ENV{BUILT_PRODUCTS_DIR} . $ENV{SDKROOT} . &quot;/usr/local/include&quot;) if $ENV{BUILT_PRODUCTS_DIR};
+
+    # Xcode 3.1 is required for SDKROOT to be set.
+    if ($ENV{SDKROOT} &amp;&amp; $ENV{SYSTEM_LIBRARY_DIR}) {
+        push(@args, &quot;-I&quot; . $ENV{BUILT_PRODUCTS_DIR} . $ENV{SDKROOT} . &quot;/usr/local/include&quot;) if $ENV{BUILT_PRODUCTS_DIR};
+        push(@args, &quot;-I&quot; . $ENV{SDKROOT} . &quot;/usr/local/include&quot;);
+    }
</ins><span class="cx">     my $fileName = &quot;WebCore/bindings/objc/PublicDOMInterfaces.h&quot;;
</span><span class="cx">     my $gccLocation = &quot;&quot;;
</span><span class="cx">     if ($ENV{CC}) {
</span><span class="lines">@@ -225,7 +273,13 @@
</span><span class="cx">     } else {
</span><span class="cx">         $gccLocation = &quot;/usr/bin/gcc&quot;;
</span><span class="cx">     }
</span><del>-    open FILE, &quot;-|&quot;, $gccLocation, &quot;-E&quot;, &quot;-P&quot;, &quot;-x&quot;, &quot;objective-c&quot;,
</del><ins>+
+    if ($ENV{SDKROOT}) {
+        # PLATFORM(IOS)
+        push(@args, &quot;-isysroot&quot;, $ENV{SDKROOT});
+    }
+
+    open FILE, &quot;-|&quot;, $gccLocation, @args,
</ins><span class="cx">         (map { &quot;-D$_&quot; } split(/ +/, $defines)), &quot;-DOBJC_CODE_GENERATION&quot;, $fileName or die &quot;Could not open $fileName&quot;;
</span><span class="cx">     my @documentContent = &lt;FILE&gt;;
</span><span class="cx">     close FILE;
</span><span class="lines">@@ -353,6 +407,7 @@
</span><span class="cx"> 
</span><span class="cx">     # special cases
</span><span class="cx">     return &quot;NSString&quot; if $codeGenerator-&gt;IsStringType($name) or $name eq &quot;SerializedScriptValue&quot;;
</span><ins>+    return &quot;CGColorRef&quot; if $name eq &quot;Color&quot; and $buildingForIPhone;
</ins><span class="cx">     return &quot;NS$name&quot; if IsNativeObjCType($name);
</span><span class="cx">     return &quot;BOOL&quot; if $name eq &quot;boolean&quot;;
</span><span class="cx">     return &quot;unsigned char&quot; if $name eq &quot;octet&quot;;
</span><span class="lines">@@ -483,6 +538,14 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+sub IsCoreFoundationType
+{
+    my $type = shift;
+
+    return 1 if $type =~ /^(CF|CG)[A-Za-z]+Ref$/;
+    return 0;
+}
+
</ins><span class="cx"> sub SkipFunction
</span><span class="cx"> {
</span><span class="cx">     my $function = shift;
</span><span class="lines">@@ -518,7 +581,6 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> sub GetObjCType
</span><span class="cx"> {
</span><span class="cx">     my $type = shift;
</span><span class="lines">@@ -527,6 +589,7 @@
</span><span class="cx">     return &quot;id &lt;$name&gt;&quot; if IsProtocolType($type);
</span><span class="cx">     return $name if $codeGenerator-&gt;IsPrimitiveType($type) or $type eq &quot;DOMTimeStamp&quot;;
</span><span class="cx">     return &quot;unsigned short&quot; if $type eq &quot;CompareHow&quot;;
</span><ins>+    return $name if IsCoreFoundationType($name);
</ins><span class="cx">     return &quot;$name *&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -612,7 +675,11 @@
</span><span class="cx"> 
</span><span class="cx">     if (IsNativeObjCType($type)) {
</span><span class="cx">         if ($type eq &quot;Color&quot;) {
</span><del>-            $implIncludes{&quot;ColorMac.h&quot;} = 1;
</del><ins>+            if ($buildingForIPhone) {
+                $implIncludes{&quot;ColorSpace.h&quot;} = 1;
+            } else {
+                $implIncludes{&quot;ColorMac.h&quot;} = 1;
+            }
</ins><span class="cx">         }
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -752,7 +819,11 @@
</span><span class="cx">     my $numFunctions = @{$interface-&gt;functions};
</span><span class="cx"> 
</span><span class="cx">     # - Add default header template
</span><del>-    @headerContentHeader = split(&quot;\r&quot;, $headerLicenseTemplate);
</del><ins>+    if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+        @headerContentHeader = split(&quot;\r&quot;, $beginAppleCopyrightForHeaderFiles);
+    } else {
+        @headerContentHeader = split(&quot;\r&quot;, $headerLicenseTemplate);
+    }
</ins><span class="cx">     push(@headerContentHeader, &quot;\n&quot;);
</span><span class="cx"> 
</span><span class="cx">     # - INCLUDES -
</span><span class="lines">@@ -848,6 +919,11 @@
</span><span class="cx"> 
</span><span class="cx">             my $publicInterfaceKey = $property . &quot;;&quot;;
</span><span class="cx"> 
</span><ins>+            # FIXME: This only works for the getter, but not the setter.  Need to refactor this code.
+            if ($buildingForTigerOrEarlier &amp;&amp; !$buildingForIPhone || IsCoreFoundationType($attributeType)) {
+                $publicInterfaceKey = &quot;- (&quot; . $attributeType . &quot;)&quot; . $attributeName . &quot;;&quot;;
+            }
+
</ins><span class="cx">             my $availabilityMacro = &quot;&quot;;
</span><span class="cx">             if (defined $publicInterfaces{$publicInterfaceKey} and length $publicInterfaces{$publicInterfaceKey}) {
</span><span class="cx">                 $availabilityMacro = $publicInterfaces{$publicInterfaceKey};
</span><span class="lines">@@ -875,9 +951,34 @@
</span><span class="cx">                 $fatalError = 1;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            $property .= $declarationSuffix;
-            push(@headerAttributes, $property) if $public;
-            push(@privateHeaderAttributes, $property) unless $public;
</del><ins>+            if (!IsCoreFoundationType($attributeType)) {
+                $property .= $declarationSuffix;
+                push(@headerAttributes, $property) if $public;
+                push(@privateHeaderAttributes, $property) unless $public;
+            } else {
+                my $attributeConditionalString = $codeGenerator-&gt;GenerateConditionalString($attribute-&gt;signature);
+                if ($attributeConditionalString) {
+                    push(@headerAttributes, &quot;#if ${attributeConditionalString}\n&quot;) if $public;
+                    push(@privateHeaderAttributes, &quot;#if ${attributeConditionalString}\n&quot;) unless $public;
+                }

+                # - GETTER
+                my $getter = &quot;- (&quot; . $attributeType . &quot;)&quot; . $attributeName . $declarationSuffix;
+                push(@headerAttributes, $getter) if $public;
+                push(@privateHeaderAttributes, $getter) unless $public;

+                # - SETTER
+                if (!$attribute-&gt;isReadOnly) {
+                    my $setter = &quot;- (void)$setterName(&quot; . $attributeType . &quot;)new&quot; . ucfirst($attributeName) . $declarationSuffix;
+                    push(@headerAttributes, $setter) if $public;
+                    push(@privateHeaderAttributes, $setter) unless $public;
+                }

+                if ($attributeConditionalString) {
+                    push(@headerAttributes, &quot;#endif\n&quot;) if $public;
+                    push(@privateHeaderAttributes, &quot;#endif\n&quot;) unless $public;
+                }
+            }
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         push(@headerContent, @headerAttributes) if @headerAttributes &gt; 0;
</span><span class="lines">@@ -889,6 +990,7 @@
</span><span class="cx"> 
</span><span class="cx">     # - Add functions.
</span><span class="cx">     if ($numFunctions &gt; 0) {
</span><ins>+        my %inAppleCopyright = (public =&gt; 0, private =&gt; 0);
</ins><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             next if SkipFunction($function);
</span><span class="cx">             next if ($function-&gt;signature-&gt;name eq &quot;set&quot; and $interface-&gt;extendedAttributes-&gt;{&quot;TypedArray&quot;});
</span><span class="lines">@@ -896,6 +998,7 @@
</span><span class="cx"> 
</span><span class="cx">             my $returnType = GetObjCType($function-&gt;signature-&gt;type);
</span><span class="cx">             my $needsDeprecatedVersion = (@{$function-&gt;parameters} &gt; 1 and $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;ObjCLegacyUnnamedParameters&quot;});
</span><ins>+            my $needsAppleCopyright = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;};
</ins><span class="cx">             my $numberOfParameters = @{$function-&gt;parameters};
</span><span class="cx">             my %typesToForwardDeclare = ($function-&gt;signature-&gt;type =&gt; 1);
</span><span class="cx"> 
</span><span class="lines">@@ -950,6 +1053,18 @@
</span><span class="cx">                 AddForwardDeclarationsForType($type, $public) unless $public and $needsDeprecatedVersion;
</span><span class="cx">             }
</span><span class="cx"> 
</span><ins>+            if ($needsAppleCopyright) {
+                if (!$inAppleCopyright{$public ? &quot;public&quot; : &quot;private&quot;}) {
+                    push(@headerFunctions, $beginAppleCopyrightForHeaderFiles) if $public;
+                    push(@privateHeaderFunctions, $beginAppleCopyrightForHeaderFiles) unless $public;
+                    $inAppleCopyright{$public ? &quot;public&quot; : &quot;private&quot;} = 1;
+                }
+            } elsif ($inAppleCopyright{$public ? &quot;public&quot; : &quot;private&quot;}) {
+                push(@headerFunctions, $endAppleCopyright) if $public;
+                push(@privateHeaderFunctions, $endAppleCopyright) unless $public;
+                $inAppleCopyright{$public ? &quot;public&quot; : &quot;private&quot;} = 0;
+            }
+
</ins><span class="cx">             my $functionConditionalString = $codeGenerator-&gt;GenerateConditionalString($function-&gt;signature);
</span><span class="cx">             if ($functionConditionalString) {
</span><span class="cx">                 push(@headerFunctions, &quot;#if ${functionConditionalString}\n&quot;) if $public;
</span><span class="lines">@@ -991,6 +1106,9 @@
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        push(@headerFunctions, $endAppleCopyright) if $inAppleCopyright{&quot;public&quot;};
+        push(@privateHeaderFunctions, $endAppleCopyright) if $inAppleCopyright{&quot;private&quot;};
+
</ins><span class="cx">         if (@headerFunctions &gt; 0) {
</span><span class="cx">             push(@headerContent, &quot;\n&quot;) if @headerAttributes &gt; 0;
</span><span class="cx">             push(@headerContent, @headerFunctions);
</span><span class="lines">@@ -1011,11 +1129,19 @@
</span><span class="cx">         push(@headerContent, &quot;\@end\n&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+        push(@headerContent, split(&quot;\r&quot;, $endAppleCopyright));
+    }
+
</ins><span class="cx">     my %alwaysGenerateForNoSVGBuild = map { $_ =&gt; 1 } qw(DOMHTMLEmbedElement DOMHTMLObjectElement);
</span><span class="cx"> 
</span><span class="cx">     if (@privateHeaderAttributes &gt; 0 or @privateHeaderFunctions &gt; 0 or exists $alwaysGenerateForNoSVGBuild{$className}) {
</span><span class="cx">         # - Private category @interface
</span><del>-        @privateHeaderContentHeader = split(&quot;\r&quot;, $headerLicenseTemplate);
</del><ins>+        if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+            @privateHeaderContentHeader = split(&quot;\r&quot;, $beginAppleCopyrightForHeaderFiles);
+        } else {
+            @privateHeaderContentHeader = split(&quot;\r&quot;, $headerLicenseTemplate);
+        }
</ins><span class="cx">         push(@privateHeaderContentHeader, &quot;\n&quot;);
</span><span class="cx"> 
</span><span class="cx">         my $classHeaderName = GetClassHeaderName($className);
</span><span class="lines">@@ -1027,6 +1153,10 @@
</span><span class="cx">         push(@privateHeaderContent, &quot;\n&quot;) if @privateHeaderAttributes &gt; 0 and @privateHeaderFunctions &gt; 0;
</span><span class="cx">         push(@privateHeaderContent, @privateHeaderFunctions) if @privateHeaderFunctions &gt; 0;
</span><span class="cx">         push(@privateHeaderContent, &quot;\@end\n&quot;);
</span><ins>+
+        if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+            push(@privateHeaderContent, split(&quot;\r&quot;, $endAppleCopyright));
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unless ($isProtocol) {
</span><span class="lines">@@ -1039,7 +1169,11 @@
</span><span class="cx">         $implType = $svgNativeType if $svgNativeType;
</span><span class="cx"> 
</span><span class="cx">         # Generate interface definitions. 
</span><del>-        @internalHeaderContent = split(&quot;\r&quot;, $implementationLicenseTemplate);
</del><ins>+        if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+            @internalHeaderContent = split(&quot;\r&quot;, $beginAppleCopyrightForHeaderFiles);
+        } else {
+            @internalHeaderContent = split(&quot;\r&quot;, $implementationLicenseTemplate);
+        }
</ins><span class="cx"> 
</span><span class="cx">         push(@internalHeaderContent, &quot;\n#import &lt;WebCore/$className.h&gt;\n\n&quot;);
</span><span class="cx">         push(@internalHeaderContent, &quot;#import &lt;WebCore/SVGAnimatedPropertyTearOff.h&gt;\n\n&quot;) if $svgPropertyType;
</span><span class="lines">@@ -1108,7 +1242,11 @@
</span><span class="cx">     $implType = $svgNativeType if $svgNativeType;
</span><span class="cx"> 
</span><span class="cx">     # - Add default header template.
</span><del>-    @implContentHeader = split(&quot;\r&quot;, $implementationLicenseTemplate);
</del><ins>+    if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+        @implContentHeader = split(&quot;\r&quot;, $beginAppleCopyrightForSourceFiles);
+    } else {
+        @implContentHeader = split(&quot;\r&quot;, $implementationLicenseTemplate);
+    }
</ins><span class="cx"> 
</span><span class="cx">     # - INCLUDES -
</span><span class="cx">     push(@implContentHeader, &quot;\n#import \&quot;config.h\&quot;\n&quot;);
</span><span class="lines">@@ -1335,8 +1473,13 @@
</span><span class="cx">                 $getterContentHead = &quot;kit($getterContentHead&quot;;
</span><span class="cx">                 $getterContentTail .= &quot;)&quot;;
</span><span class="cx">             } elsif ($idlType eq &quot;Color&quot;) {
</span><del>-                $getterContentHead = &quot;WebCore::nsColor($getterContentHead&quot;;
-                $getterContentTail .= &quot;)&quot;;
</del><ins>+                if ($buildingForIPhone) {
+                    $getterContentHead = &quot;WebCore::cachedCGColor($getterContentHead&quot;;
+                    $getterContentTail .= &quot;, WebCore::ColorSpaceDeviceRGB)&quot;;
+                } else {
+                    $getterContentHead = &quot;WebCore::nsColor($getterContentHead&quot;;
+                    $getterContentTail .= &quot;)&quot;;
+                }
</ins><span class="cx">             } elsif ($attribute-&gt;signature-&gt;type eq &quot;SerializedScriptValue&quot;) {
</span><span class="cx">                 $getterContentHead = &quot;$getterContentHead&quot;;
</span><span class="cx">                 $getterContentTail .= &quot;-&gt;toString()&quot;;                
</span><span class="lines">@@ -1507,6 +1650,7 @@
</span><span class="cx"> 
</span><span class="cx">     # - Functions
</span><span class="cx">     if ($numFunctions &gt; 0) {
</span><ins>+        my $inAppleCopyright = 0;
</ins><span class="cx">         foreach my $function (@{$interface-&gt;functions}) {
</span><span class="cx">             next if SkipFunction($function);
</span><span class="cx">             next if ($function-&gt;signature-&gt;name eq &quot;set&quot; and $interface-&gt;extendedAttributes-&gt;{&quot;TypedArray&quot;});
</span><span class="lines">@@ -1514,6 +1658,7 @@
</span><span class="cx"> 
</span><span class="cx">             my $functionName = $function-&gt;signature-&gt;name;
</span><span class="cx">             my $returnType = GetObjCType($function-&gt;signature-&gt;type);
</span><ins>+            my $needsAppleCopyright = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;};
</ins><span class="cx">             my $hasParameters = @{$function-&gt;parameters};
</span><span class="cx">             my $raisesExceptions = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;RaisesException&quot;};
</span><span class="cx"> 
</span><span class="lines">@@ -1724,6 +1869,16 @@
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx"> 
</span><ins>+            if ($needsAppleCopyright) {
+                if (!$inAppleCopyright) {
+                    push(@implContent, $beginAppleCopyrightForSourceFiles);
+                    $inAppleCopyright = 1;
+                }
+            } elsif ($inAppleCopyright) {
+                push(@implContent, $endAppleCopyright);
+                $inAppleCopyright = 0;
+            }
+
</ins><span class="cx">             my $conditionalString = $codeGenerator-&gt;GenerateConditionalString($function-&gt;signature);
</span><span class="cx">             push(@implContent, &quot;\n#if ${conditionalString}\n&quot;) if $conditionalString;
</span><span class="cx"> 
</span><span class="lines">@@ -1750,11 +1905,16 @@
</span><span class="cx">             # Clear the hash
</span><span class="cx">             %needsCustom = ();
</span><span class="cx">         }
</span><ins>+        push(@implContent, $endAppleCopyright) if $inAppleCopyright;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     # END implementation
</span><span class="cx">     push(@implContent, &quot;\@end\n&quot;);
</span><span class="cx"> 
</span><ins>+    if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+        push(@implContent, split(&quot;\r&quot;, $endAppleCopyright));
+    }
+
</ins><span class="cx">     # Generate internal interfaces
</span><span class="cx">     push(@implContent, &quot;\n$implType* core($className *wrapper)\n&quot;);
</span><span class="cx">     push(@implContent, &quot;{\n&quot;);
</span><span class="lines">@@ -1792,6 +1952,10 @@
</span><span class="cx">     # - End the ifdef conditional if necessary
</span><span class="cx">     push(@implContent, &quot;\n#endif // ${conditionalString}\n&quot;) if $conditionalString;
</span><span class="cx"> 
</span><ins>+    if ($interface-&gt;extendedAttributes-&gt;{&quot;AppleCopyright&quot;}) {
+        push(@implContent, split(&quot;\r&quot;, $endAppleCopyright));
+    }
+
</ins><span class="cx">     # - Generate dependencies.
</span><span class="cx">     if ($writeDependencies &amp;&amp; @ancestorInterfaceNames) {
</span><span class="cx">         push(@depsContent, &quot;$className.h : &quot;, join(&quot; &quot;, map { &quot;$_.idl&quot; } @ancestorInterfaceNames), &quot;\n&quot;);
</span><span class="lines">@@ -1803,11 +1967,11 @@
</span><span class="cx"> sub WriteData
</span><span class="cx"> {
</span><span class="cx">     my $object = shift;
</span><del>-    my $dataNode = shift;
</del><ins>+    my $interface = shift;
</ins><span class="cx">     my $outputDir = shift;
</span><span class="cx"> 
</span><span class="cx">     # Open files for writing...
</span><del>-    my $name = $dataNode-&gt;name;
</del><ins>+    my $name = $interface-&gt;name;
</ins><span class="cx">     my $prefix = FileNamePrefix;
</span><span class="cx">     my $headerFileName = &quot;$outputDir/$prefix$name.h&quot;;
</span><span class="cx">     my $privateHeaderFileName = &quot;$outputDir/$prefix${name}Private.h&quot;;
</span><span class="lines">@@ -1817,7 +1981,7 @@
</span><span class="cx"> 
</span><span class="cx">     # Write public header.
</span><span class="cx">     my $contents = join &quot;&quot;, @headerContentHeader;
</span><del>-    map { $contents .= &quot;\@class $_;\n&quot; } sort keys(%headerForwardDeclarations);
</del><ins>+    map { $contents .= (IsCoreFoundationType($_) ? &quot;typedef struct &quot; . substr($_, 0, -3) . &quot;* $_;\n&quot; : &quot;\@class $_;\n&quot;) } sort keys(%headerForwardDeclarations);
</ins><span class="cx">     map { $contents .= &quot;\@protocol $_;\n&quot; } sort keys(%headerForwardDeclarationsForProtocols);
</span><span class="cx"> 
</span><span class="cx">     my $hasForwardDeclarations = keys(%headerForwardDeclarations) + keys(%headerForwardDeclarationsForProtocols);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -107,3 +107,6 @@
</span><span class="cx"> TreatUndefinedAs=NullString
</span><span class="cx"> TypedArray=*
</span><span class="cx"> URL
</span><ins>+
+# PLATFORM(IOS)
+AppleCopyright
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptspreprocessorpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/preprocessor.pm (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/preprocessor.pm        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bindings/scripts/preprocessor.pm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -57,6 +57,9 @@
</span><span class="cx">         push(@args, qw(-E -P -x c++));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    push(@args, &quot;-I&quot; . $ENV{BUILT_PRODUCTS_DIR} . &quot;/usr/local/include&quot;) if $ENV{BUILT_PRODUCTS_DIR};
+    push(@args, &quot;-isysroot&quot;, $ENV{SDKROOT}) if $ENV{SDKROOT};
+
</ins><span class="cx">     # Remove double quotations from $defines and extract macros.
</span><span class="cx">     # For example, if $defines is ' &quot;A=1&quot; &quot;B=1&quot; C=1 &quot;&quot;    D  ',
</span><span class="cx">     # then it is converted into four macros -DA=1, -DB=1, -DC=1 and -DD.
</span></span></pre></div>
<a id="trunkSourceWebCorebridgeobjcobjc_classmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/objc/objc_class.mm (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/objc/objc_class.mm        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bridge/objc/objc_class.mm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -161,7 +161,11 @@
</span><span class="cx">     CString jsName = name.ascii();
</span><span class="cx">     RetainPtr&lt;CFStringRef&gt; fieldName = adoptCF(CFStringCreateWithCString(NULL, jsName.data(), kCFStringEncodingASCII));
</span><span class="cx">     id targetObject = (static_cast&lt;ObjcInstance*&gt;(instance))-&gt;getObject();
</span><ins>+#if PLATFORM(IOS)
+    id attributes = [targetObject respondsToSelector:@selector(attributeKeys)] ? [targetObject performSelector:@selector(attributeKeys)] : nil;
+#else
</ins><span class="cx">     id attributes = [targetObject attributeKeys];
</span><ins>+#endif
</ins><span class="cx">     if (attributes) {
</span><span class="cx">         // Class overrides attributeKeys, use that array of key names.
</span><span class="cx">         unsigned count = [attributes count];
</span></span></pre></div>
<a id="trunkSourceWebCorebridgeobjcobjc_instancemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bridge/objc/objc_instance.mm (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bridge/objc/objc_instance.mm        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/bridge/objc/objc_instance.mm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -37,6 +37,10 @@
</span><span class="cx"> #import &quot;runtime/FunctionPrototype.h&quot;
</span><span class="cx"> #import &lt;wtf/Assertions.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &lt;Foundation/NSMapTable.h&gt;
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> #ifdef NDEBUG
</span><span class="cx"> #define OBJC_LOG(formatAndArgs...) ((void)0)
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebCoreconfigh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/config.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/config.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/config.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> // New theme
</span><span class="cx"> #define WTF_USE_NEW_THEME 1
</span><span class="cx"> #endif // PLATFORM(MAC)
</span><span class="lines">@@ -125,6 +125,11 @@
</span><span class="cx"> #define WTF_USE_CA 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#define WEBCORE_NAVIGATOR_PLATFORM wkGetPlatformNameForNavigator();
+#define WEBCORE_NAVIGATOR_VENDOR wkGetVendorNameForNavigator();
+#endif
+
</ins><span class="cx"> // FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define WTF_USE_AVFOUNDATION on the Mac.
</span><span class="cx"> // https://bugs.webkit.org/show_bug.cgi?id=67334
</span><span class="cx"> #if PLATFORM(WIN) &amp;&amp; USE(CG) &amp;&amp; HAVE(AVCF)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/dom/Document.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -4789,7 +4789,7 @@
</span><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx"> void Document::addAutoSizingNode(Node* node, float candidateSize)
</span><span class="cx"> {
</span><del>-    TextAutoSizingKey key(node-&gt;renderer()-&gt;style(), &amp;document());
</del><ins>+    TextAutoSizingKey key(&amp;node-&gt;renderer()-&gt;style(), &amp;document());
</ins><span class="cx">     TextAutoSizingMap::AddResult result = m_textAutoSizedNodes.add(key, nullptr);
</span><span class="cx">     if (result.isNewEntry)
</span><span class="cx">         result.iterator-&gt;value = TextAutoSizingValue::create();
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/dom/Document.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -165,8 +165,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-#include &quot;DocumentIOSForward.h&quot;
-#endif
</del><ins>+#include &lt;WebKitAdditions/DocumentIOSForward.h&gt;
+#endif // PLATFORM(IOS)
</ins><span class="cx"> class Touch;
</span><span class="cx"> class TouchList;
</span><span class="cx"> #endif
</span><span class="lines">@@ -1114,7 +1114,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-#include &quot;DocumentIOS.h&quot;
</del><ins>+#include &lt;WebKitAdditions/DocumentIOS.h&gt;
</ins><span class="cx"> #else
</span><span class="cx">     PassRefPtr&lt;Touch&gt; createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force, ExceptionCode&amp;) const;
</span><span class="cx"> #endif // PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.idl (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.idl        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/dom/Document.idl        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx">     // FIXME: Consider defining an ENABLE macro for iOS touch event code, say IOS_TOUCH_EVENTS,
</span><span class="cx">     // and/or modifying the bindings scripts to support generating more complicated conditional code.
</span><span class="cx"> #if defined(WTF_PLATFORM_IOS) &amp;&amp; WTF_PLATFORM_IOS
</span><del>-#include &quot;DocumentIOS.idl&quot;
</del><ins>+#include &lt;WebKitAdditions/DocumentIOS.idl&gt;
</ins><span class="cx"> #else
</span><span class="cx">     [ReturnNewObject, RaisesException] Touch createTouch([Default=Undefined] optional DOMWindow window,
</span><span class="cx">                                                      [Default=Undefined] optional EventTarget target,
</span></span></pre></div>
<a id="trunkSourceWebCoredomiosTouchEventscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/dom/ios/TouchEvents.cpp (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ios/TouchEvents.cpp                                (rev 0)
+++ trunk/Source/WebCore/dom/ios/TouchEvents.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#if PLATFORM(IOS) &amp;&amp; ENABLE(TOUCH_EVENTS)
+
+#include &lt;WebKitAdditions/DocumentIOS.cpp&gt;
+#include &lt;WebKitAdditions/GestureEventIOS.cpp&gt;
+#include &lt;WebKitAdditions/Touch.cpp&gt;
+#include &lt;WebKitAdditions/TouchEvent.cpp&gt;
+#include &lt;WebKitAdditions/TouchList.cpp&gt;
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -255,10 +255,18 @@
</span><span class="cx">     if (visibleStart.isNull() || visibleStart.isOrphan() || visibleEnd.isNull() || visibleEnd.isOrphan())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     // Save and restore the selection endpoints using their indices in the document, since
</span><ins>+#else
+    // Save and restore the selection endpoints using their indices in the editable root, since
+#endif
</ins><span class="cx">     // addBlockStyleIfNeeded may moveParagraphs, which can remove these endpoints.
</span><span class="cx">     // Calculate start and end indices from the start of the tree that they're in.
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     Node* scope = highestAncestor(visibleStart.deepEquivalent().deprecatedNode());
</span><ins>+#else
+    Node* scope = highestEditableRoot(visibleStart.deepEquivalent());
+#endif
</ins><span class="cx">     RefPtr&lt;Range&gt; startRange = Range::create(document(), firstPositionInNode(scope), visibleStart.deepEquivalent().parentAnchoredEquivalent());
</span><span class="cx">     RefPtr&lt;Range&gt; endRange = Range::create(document(), firstPositionInNode(scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent());
</span><span class="cx">     int startIndex = TextIterator::rangeLength(startRange.get(), true);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -72,6 +72,10 @@
</span><span class="cx"> #include &quot;DeleteButtonController.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;BreakBlockquoteCommand.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="lines">@@ -102,6 +106,14 @@
</span><span class="cx">     // Low level operations, like RemoveNodeCommand, don't require a layout because the high level operations that use them perform one
</span><span class="cx">     // if one is necessary (like for the creation of VisiblePositions).
</span><span class="cx">     m_document-&gt;updateLayoutIgnorePendingStylesheets();
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: Where should iPhone code deal with the composition?
+    // Since editing commands don't save/restore the composition, undoing without fixing
+    // up the composition will leave a stale, invalid composition, as in &lt;rdar://problem/6831637&gt;.
+    // Desktop handles this in -[WebHTMLView _updateSelectionForInputManager], but the phone
+    // goes another route.
+    frame-&gt;editor().cancelComposition();
+#endif
</ins><span class="cx"> 
</span><span class="cx">     {
</span><span class="cx"> #if ENABLE(DELETION_UI)
</span><span class="lines">@@ -190,6 +202,10 @@
</span><span class="cx">         case EditActionSetWritingDirection:
</span><span class="cx">         case EditActionCut:
</span><span class="cx">         case EditActionUnspecified:
</span><ins>+#if PLATFORM(IOS)
+        case EditActionDelete:
+        case EditActionDictation:
+#endif
</ins><span class="cx">             break;
</span><span class="cx">         default:
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="lines">@@ -486,6 +502,49 @@
</span><span class="cx">     applyCommandToComposite(SplitTextNodeContainingElementCommand::create(text, offset));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void CompositeEditCommand::inputText(const String&amp; text, bool selectInsertedText)
+{
+    unsigned offset = 0;
+    unsigned length = text.length();
+    
+    RefPtr&lt;ContainerNode&gt; scope;
+    unsigned startIndex = indexForVisiblePosition(endingSelection().visibleStart(), scope);
+    
+    size_t newline;
+    do {
+        newline = text.find('\n', offset);
+        if (newline != offset) {
+            int substringLength = newline == notFound ? length - offset : newline - offset;
+            RefPtr&lt;InsertTextCommand&gt; command = InsertTextCommand::create(document(), text.substring(offset, substringLength), false);
+            applyCommandToComposite(command);
+        }
+        if (newline != notFound) {
+            VisiblePosition caret(endingSelection().visibleStart());
+            if (enclosingNodeOfType(caret.deepEquivalent(), &amp;isMailBlockquote)) {
+                // FIXME: Breaking a blockquote when the caret is just after a space will collapse the 
+                // space. Modify startIndex or length to compensate for this so that the ending selection 
+                // will be positioned correctly.
+                // &lt;rdar://problem/9914462&gt; breaking a Mail blockquote just after a space collapses the space
+                if (caret.previous().characterAfter() == ' ') {
+                    if (!offset &amp;&amp; !startIndex)
+                        startIndex--;
+                    else if (!length)
+                        length--;
+                }
+                applyCommandToComposite(BreakBlockquoteCommand::create(document()));
+            } else
+                insertLineBreak();
+        }
+            
+        offset = newline + 1;
+    } while (newline != notFound &amp;&amp; offset != length);
+    
+    if (selectInsertedText)
+        setEndingSelection(VisibleSelection(visiblePositionForIndex(startIndex, scope.get()), visiblePositionForIndex(startIndex + length, scope.get())));
+}
+#endif
+
</ins><span class="cx"> void CompositeEditCommand::insertTextIntoNode(PassRefPtr&lt;Text&gt; node, unsigned offset, const String&amp; text)
</span><span class="cx"> {
</span><span class="cx">     if (!text.isEmpty())
</span><span class="lines">@@ -535,7 +594,11 @@
</span><span class="cx">     replaceTextInNode(node, offset, count, replacementText);
</span><span class="cx">     RefPtr&lt;Range&gt; newRange = Range::create(document(), node, offset, node, offset + replacementText.length());
</span><span class="cx">     for (size_t i = 0; i &lt; markers.size(); ++i)
</span><ins>+#if PLATFORM(IOS)
+        markerController.addMarker(newRange.get(), markers[i].type(), markers[i].description(), markers[i].alternatives(), markers[i].metadata());
+#else
</ins><span class="cx">         markerController.addMarker(newRange.get(), markers[i].type(), markers[i].description());
</span><ins>+#endif // PLATFORM(IOS)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Position CompositeEditCommand::positionOutsideTabSpan(const Position&amp; pos)
</span><span class="lines">@@ -1201,7 +1264,11 @@
</span><span class="cx">     // anything if we're given an empty paragraph, but an empty paragraph can have style
</span><span class="cx">     // too, &lt;div&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/div&gt; for example.  Save it so that we can preserve it later.
</span><span class="cx">     RefPtr&lt;EditingStyle&gt; styleInEmptyParagraph;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (startOfParagraphToMove == endOfParagraphToMove &amp;&amp; preserveStyle) {
</span><ins>+#else
+    if (startOfParagraphToMove == endOfParagraphToMove &amp;&amp; preserveStyle &amp;&amp; isRichlyEditablePosition(destination.deepEquivalent())) {
+#endif
</ins><span class="cx">         styleInEmptyParagraph = EditingStyle::create(startOfParagraphToMove.deepEquivalent());
</span><span class="cx">         styleInEmptyParagraph-&gt;mergeTypingStyle(document());
</span><span class="cx">         // The moved paragraph should assume the block style of the destination.
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingCompositeEditCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/CompositeEditCommand.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/CompositeEditCommand.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/CompositeEditCommand.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -104,6 +104,9 @@
</span><span class="cx">     void deleteSelection(bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true, bool sanitizeMarkup = true);
</span><span class="cx">     void deleteSelection(const VisibleSelection&amp;, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true, bool sanitizeMarkup = true);
</span><span class="cx">     virtual void deleteTextFromNode(PassRefPtr&lt;Text&gt;, unsigned offset, unsigned count);
</span><ins>+#if PLATFORM(IOS)
+    void inputText(const String&amp;, bool selectInsertedText = false);
+#endif
</ins><span class="cx">     bool isRemovableBlock(const Node*);
</span><span class="cx">     void insertNodeAfter(PassRefPtr&lt;Node&gt;, PassRefPtr&lt;Node&gt; refChild);
</span><span class="cx">     void insertNodeAt(PassRefPtr&lt;Node&gt;, const Position&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteButtonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteButton.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteButton.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/DeleteButton.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -34,7 +34,9 @@
</span><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;DeleteButton&gt; create(Document&amp;);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit DeleteButton(Document&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteButtonControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteButtonController.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteButtonController.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/DeleteButtonController.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -331,6 +331,7 @@
</span><span class="cx"> 
</span><span class="cx"> void DeleteButtonController::enable()
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     ASSERT(m_disableStack &gt; 0);
</span><span class="cx">     if (m_disableStack &gt; 0)
</span><span class="cx">         m_disableStack--;
</span><span class="lines">@@ -341,13 +342,16 @@
</span><span class="cx">         m_frame.document()-&gt;updateStyleIfNeeded();
</span><span class="cx">         show(enclosingDeletableElement(m_frame.selection().selection()));
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DeleteButtonController::disable()
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (enabled())
</span><span class="cx">         hide();
</span><span class="cx">     m_disableStack++;
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class RemoveTargetCommand : public CompositeEditCommand {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -861,7 +861,24 @@
</span><span class="cx">         insertNodeAt(placeholder.get(), m_endingPosition);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // This checking is due to iphone shows the last entered character momentarily, removing and adding back the 
+    // space when deleting password cause space been showed insecurely.
+    bool isSecure = NO;
+    Node* node = m_endingPosition.deprecatedNode();
+    if (node &amp;&amp; node-&gt;isTextNode()) {
+        Text* textNode = static_cast&lt;Text*&gt;(node);    
+        if (textNode-&gt;length() &gt; 0) {
+            RenderObject* renderer = textNode-&gt;renderer();
+            isSecure = renderer-&gt;style().textSecurity() != TSNONE;
+        }
+    }
+        
+    if (!isSecure)
+        rebalanceWhitespaceAt(m_endingPosition);
+#else
</ins><span class="cx">     rebalanceWhitespaceAt(m_endingPosition);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     calculateTypingStyleAfterDelete();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDeleteSelectionCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/DeleteSelectionCommand.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DeleteSelectionCommand.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/DeleteSelectionCommand.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -43,8 +43,10 @@
</span><span class="cx">         return adoptRef(new DeleteSelectionCommand(selection, smartDelete, mergeBlocksAfterDelete, replace, expandForSpecialElements, sanitizeMarkup));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+protected:
+    DeleteSelectionCommand(Document&amp;, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool santizeMarkup);
+
</ins><span class="cx"> private:
</span><del>-    DeleteSelectionCommand(Document&amp;, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool santizeMarkup);
</del><span class="cx">     DeleteSelectionCommand(const VisibleSelection&amp;, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup);
</span><span class="cx"> 
</span><span class="cx">     virtual void doApply();
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditActionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditAction.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditAction.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/EditAction.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -57,6 +57,10 @@
</span><span class="cx">         EditActionCut,
</span><span class="cx">         EditActionBold,
</span><span class="cx">         EditActionItalics,
</span><ins>+#if PLATFORM(IOS)
+        EditActionDelete,
+        EditActionDictation,
+#endif
</ins><span class="cx">         EditActionPaste,
</span><span class="cx">         EditActionPasteFont,
</span><span class="cx">         EditActionPasteRuler,
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditCommand.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditCommand.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/EditCommand.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -51,6 +51,10 @@
</span><span class="cx">     const VisibleSelection&amp; startingSelection() const { return m_startingSelection; }
</span><span class="cx">     const VisibleSelection&amp; endingSelection() const { return m_endingSelection; }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    virtual bool isInsertTextCommand() const { return false; }
+#endif
+    
</ins><span class="cx">     virtual bool isSimpleEditCommand() const { return false; }
</span><span class="cx">     virtual bool isCompositeEditCommand() const { return false; }
</span><span class="cx">     virtual bool isEditCommandComposition() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditingStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditingStyle.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -71,6 +71,10 @@
</span><span class="cx">     CSSPropertyWhiteSpace,
</span><span class="cx">     CSSPropertyWidows,
</span><span class="cx">     CSSPropertyWordSpacing,
</span><ins>+#if PLATFORM(IOS)
+    CSSPropertyWebkitTapHighlightColor,
+    CSSPropertyWebkitCompositionFillColor,
+#endif
</ins><span class="cx">     CSSPropertyWebkitTextDecorationsInEffect,
</span><span class="cx">     CSSPropertyWebkitTextFillColor,
</span><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/Editor.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -95,8 +95,50 @@
</span><span class="cx"> #include &quot;DeleteButtonController.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;DictationCommandIOS.h&quot;
+#include &lt;wtf/text/StringBuilder.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+class ClearTextCommand : public DeleteSelectionCommand {
+public:
+    ClearTextCommand(Document&amp; document);
+    static void CreateAndApply(const RefPtr&lt;Frame&gt; frame);
+    
+private:
+    virtual EditAction editingAction() const;
+};
+
+ClearTextCommand::ClearTextCommand(Document&amp; document)
+    : DeleteSelectionCommand(document, false, true, false, false, true)
+{
+}
+
+EditAction ClearTextCommand::editingAction() const
+{
+    return EditActionDelete;
+}
+
+void ClearTextCommand::CreateAndApply(const RefPtr&lt;Frame&gt; frame)
+{
+    if (frame-&gt;selection().isNone())
+        return;
+
+    // Don't leave around stale composition state.
+    frame-&gt;editor().clear();
+    
+    const VisibleSelection oldSelection = frame-&gt;selection().selection();
+    frame-&gt;selection().selectAll();
+    RefPtr&lt;ClearTextCommand&gt; clearCommand = adoptRef(new ClearTextCommand(*frame-&gt;document()));
+    clearCommand-&gt;setStartingSelection(oldSelection);
+    applyCommand(clearCommand.release());
+}
+#endif
+
</ins><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> using namespace WTF;
</span><span class="cx"> using namespace Unicode;
</span><span class="lines">@@ -218,7 +260,15 @@
</span><span class="cx"> 
</span><span class="cx">     if (event-&gt;isPaste()) {
</span><span class="cx">         if (event-&gt;pastingFragment())
</span><ins>+#if PLATFORM(IOS)
+        {
+            if (client()-&gt;performsTwoStepPaste(event-&gt;pastingFragment()))
+                return true;
+#endif
</ins><span class="cx">             replaceSelectionWithFragment(event-&gt;pastingFragment(), false, event-&gt;shouldSmartReplace(), event-&gt;shouldMatchStyle());
</span><ins>+#if PLATFORM(IOS)
+        }
+#endif
</ins><span class="cx">         else 
</span><span class="cx">             replaceSelectionWithText(event-&gt;data(), false, event-&gt;shouldSmartReplace());
</span><span class="cx">         return true;
</span><span class="lines">@@ -391,6 +441,84 @@
</span><span class="cx">     applyCommand(DeleteSelectionCommand::create(document(), smartDelete));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void Editor::clearText()
+{
+    ClearTextCommand::CreateAndApply(&amp;m_frame);
+}
+
+void Editor::insertDictationPhrases(PassOwnPtr&lt;Vector&lt;Vector&lt;String&gt; &gt; &gt; dictationPhrases, RetainPtr&lt;id&gt; metadata)
+{
+    if (m_frame.selection().isNone())
+        return;
+        
+    if (dictationPhrases-&gt;isEmpty())
+        return;
+        
+    applyCommand(DictationCommandIOS::create(document(), dictationPhrases, metadata));
+}
+
+void Editor::setDictationPhrasesAsChildOfElement(PassOwnPtr&lt;Vector&lt;Vector&lt;String&gt; &gt; &gt; dictationPhrases, RetainPtr&lt;id&gt; metadata, Element* element)
+{
+    // Clear the composition.
+    clear();
+    
+    // Clear the Undo stack, since the operations that follow are not Undoable, and will corrupt the stack.  Some day
+    // we could make them Undoable, and let callers clear the Undo stack explicitly if they wish.
+    clearUndoRedoOperations();
+    
+    m_frame.selection().clear();
+    
+    element-&gt;removeChildren();
+    
+    if (dictationPhrases-&gt;isEmpty()) {
+        client()-&gt;respondToChangedContents();
+        return;
+    }
+    
+    ExceptionCode ec;    
+    RefPtr&lt;Range&gt; context = document().createRange();
+    context-&gt;selectNodeContents(element, ec);
+    
+    StringBuilder dictationPhrasesBuilder;
+    size_t dictationPhraseCount = dictationPhrases-&gt;size();
+    for (size_t i = 0; i &lt; dictationPhraseCount; i++) {
+        const String&amp; firstInterpretation = dictationPhrases-&gt;at(i)[0];
+        dictationPhrasesBuilder.append(firstInterpretation);
+    }
+    String serializedDictationPhrases = dictationPhrasesBuilder.toString();
+    
+    element-&gt;appendChild(createFragmentFromText(*context.get(), serializedDictationPhrases), ec);
+    
+    // We need a layout in order to add markers below.
+    document().updateLayout();
+    
+    if (!element-&gt;firstChild()-&gt;isTextNode()) {
+        // Shouldn't happen.
+        ASSERT(element-&gt;firstChild()-&gt;isTextNode());
+        return;
+    }
+        
+    Text* textNode = static_cast&lt;Text*&gt;(element-&gt;firstChild());
+    int previousDictationPhraseStart = 0;
+    for (size_t i = 0; i &lt; dictationPhraseCount; i++) {
+        const Vector&lt;String&gt;&amp; interpretations = dictationPhrases-&gt;at(i);
+        int dictationPhraseLength = interpretations[0].length();
+        int dictationPhraseEnd = previousDictationPhraseStart + dictationPhraseLength;
+        if (interpretations.size() &gt; 1) {
+            RefPtr&lt;Range&gt; dictationPhraseRange = Range::create(document(), textNode, previousDictationPhraseStart, textNode, dictationPhraseEnd);
+            document().markers().addDictationPhraseWithAlternativesMarker(dictationPhraseRange.get(), interpretations);
+        }
+        previousDictationPhraseStart = dictationPhraseEnd;
+    }
+    
+    RefPtr&lt;Range&gt; resultRange = Range::create(document(), textNode, 0, textNode, textNode-&gt;length());
+    document().markers().addDictationResultMarker(resultRange.get(), metadata);
+    
+    client()-&gt;respondToChangedContents();
+}
+#endif
+
</ins><span class="cx"> void Editor::pasteAsPlainText(const String&amp; pastingText, bool smartReplace)
</span><span class="cx"> {
</span><span class="cx">     Node* target = findEventTargetFromSelection();
</span><span class="lines">@@ -507,6 +635,86 @@
</span><span class="cx">     return m_frame.selection().toNormalizedRange();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void Editor::confirmMarkedText()
+{
+    // FIXME: This is a hacky workaround for the keyboard calling this method too late -
+    // after the selection and focus have already changed.  See &lt;rdar://problem/5975559&gt;
+    Element* focused = document().focusedElement();
+    Node* composition = compositionNode();
+    
+    if (composition &amp;&amp; focused &amp;&amp; focused != composition &amp;&amp; !composition-&gt;isDescendantOrShadowDescendantOf(focused)) {
+        cancelComposition();
+        document().setFocusedElement(focused);
+    } else
+        confirmComposition();
+}
+
+void Editor::setTextAsChildOfElement(const String&amp; text, Element* elem)
+{
+    // Clear the composition
+    clear();
+    
+    // Clear the Undo stack, since the operations that follow are not Undoable, and will corrupt the stack.  Some day
+    // we could make them Undoable, and let callers clear the Undo stack explicitly if they wish.
+    clearUndoRedoOperations();
+    
+    // If the element is empty already and we're not adding text, we can early return and avoid clearing/setting
+    // a selection at [0, 0] and the expense involved in creation VisiblePositions.
+    if (!elem-&gt;firstChild() &amp;&amp; text.isEmpty())
+        return;
+    
+    // As a side effect this function sets a caret selection after the inserted content.  Much of what 
+    // follows is more expensive if there is a selection, so clear it since it's going to change anyway.
+    m_frame.selection().clear();
+    
+    // clear out all current children of element
+    elem-&gt;removeChildren();
+
+    if (text.length()) {
+        // insert new text
+        // remove element from tree while doing it
+        // FIXME: The element we're inserting into is often the body element.  It seems strange to be removing it
+        // (even if it is only temporary).  ReplaceSelectionCommand doesn't bother doing this when it inserts
+        // content, why should we here?
+        ExceptionCode ec;
+        RefPtr&lt;Node&gt; parent = elem-&gt;parentNode();
+        RefPtr&lt;Node&gt; siblingAfter = elem-&gt;nextSibling();
+        if (parent)
+            elem-&gt;remove(ec);    
+            
+        RefPtr&lt;Range&gt; context = document().createRange();
+        context-&gt;selectNodeContents(elem, ec);
+        RefPtr&lt;DocumentFragment&gt; fragment = createFragmentFromText(*context.get(), text);
+        elem-&gt;appendChild(fragment, ec);
+    
+        // restore element to document
+        if (parent) {
+            if (siblingAfter)
+                parent-&gt;insertBefore(elem, siblingAfter.get(), ec);
+            else
+                parent-&gt;appendChild(elem, ec);
+        }
+    }
+
+    // set the selection to the end
+    VisibleSelection selection;
+
+    Position pos = createLegacyEditingPosition(elem, elem-&gt;childNodeCount());
+
+    VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY);
+    if (visiblePos.isNull())
+        return;
+
+    selection.setBase(visiblePos);
+    selection.setExtent(visiblePos);
+     
+    m_frame.selection().setSelection(selection);
+    
+    client()-&gt;respondToChangedContents();
+}
+#endif
+
</ins><span class="cx"> bool Editor::shouldDeleteRange(Range* range) const
</span><span class="cx"> {
</span><span class="cx">     if (!range || range-&gt;collapsed(IGNORE_EXCEPTION))
</span><span class="lines">@@ -546,6 +754,12 @@
</span><span class="cx"> 
</span><span class="cx"> void Editor::notifyComponentsOnChangedSelection(const VisibleSelection&amp; oldSelection, FrameSelection::SetSelectionOptions options)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: Merge this to open source https://bugs.webkit.org/show_bug.cgi?id=38830
+    if (m_ignoreCompositionSelectionChange)
+        return;
+#endif
+
</ins><span class="cx">     if (client())
</span><span class="cx">         client()-&gt;respondToChangedSelection(&amp;m_frame);
</span><span class="cx">     setStartNewKillRingSequence(true);
</span><span class="lines">@@ -704,6 +918,14 @@
</span><span class="cx"> {
</span><span class="cx">     m_lastEditCommand.clear();
</span><span class="cx"> }
</span><ins>+#if PLATFORM(IOS)
+// If the selection is adjusted from UIKit without closing the typing, the typing command may
+// have a stale selection.
+void Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping()
+{
+    TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping(&amp;m_frame, m_frame.selection().selection());
+}
+#endif
</ins><span class="cx"> 
</span><span class="cx"> // Returns whether caller should continue with &quot;the default processing&quot;, which is the same as 
</span><span class="cx"> // the event handler NOT setting the return value to false
</span><span class="lines">@@ -1088,13 +1310,13 @@
</span><span class="cx">             canSmartCopyOrDelete() ? Pasteboard::CanSmartReplace : Pasteboard::CannotSmartReplace);
</span><span class="cx">     } else {
</span><span class="cx">         if (HTMLImageElement* imageElement = imageElementFromImageDocument(document())) {
</span><del>-#if (PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)) || PLATFORM(EFL) || PLATFORM(NIX)
</del><ins>+#if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX)
</ins><span class="cx">             writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), *imageElement, document().url(), document().title());
</span><span class="cx"> #else
</span><span class="cx">             Pasteboard::createForCopyAndPaste()-&gt;writeImage(*imageElement, document().url(), document().title());
</span><span class="cx"> #endif
</span><span class="cx">         } else {
</span><del>-#if (PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)) || PLATFORM(EFL) || PLATFORM(NIX)
</del><ins>+#if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX)
</ins><span class="cx">             writeSelectionToPasteboard(*Pasteboard::createForCopyAndPaste());
</span><span class="cx"> #else
</span><span class="cx">             // FIXME: Convert all other platforms to match Mac and delete this.
</span><span class="lines">@@ -1169,6 +1391,7 @@
</span><span class="cx">     applyCommand(SimplifyMarkupCommand::create(document(), startNode, (endNode) ? NodeTraversal::next(endNode) : 0));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> void Editor::copyURL(const URL&amp; url, const String&amp; title)
</span><span class="cx"> {
</span><span class="cx">     copyURL(url, title, *Pasteboard::createForCopyAndPaste());
</span><span class="lines">@@ -1203,6 +1426,7 @@
</span><span class="cx">     Pasteboard::createForCopyAndPaste()-&gt;writeImage(*element, url, result.altDisplayString());
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> bool Editor::isContinuousSpellCheckingEnabled() const
</span><span class="cx"> {
</span><span class="lines">@@ -1413,6 +1637,12 @@
</span><span class="cx"> 
</span><span class="cx"> void Editor::setBaseWritingDirection(WritingDirection direction)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (inSameParagraph(m_frame.selection().selection().visibleStart(), m_frame.selection().selection().visibleEnd()) &amp;&amp; 
+        baseWritingDirectionForSelectionStart() == direction)
+        return;
+#endif
+        
</ins><span class="cx">     Element* focusedElement = document().focusedElement();
</span><span class="cx">     if (focusedElement &amp;&amp; isHTMLTextFormControlElement(*focusedElement)) {
</span><span class="cx">         if (direction == NaturalWritingDirection)
</span><span class="lines">@@ -1561,6 +1791,10 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    client()-&gt;startDelayingAndCoalescingContentChangeNotifications();
+#endif
+
</ins><span class="cx">     Element* target = document().focusedElement();
</span><span class="cx">     if (target) {
</span><span class="cx">         // Dispatch an appropriate composition event to the focused node.
</span><span class="lines">@@ -1636,6 +1870,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     setIgnoreCompositionSelectionChange(false);
</span><ins>+
+#if PLATFORM(IOS)        
+    client()-&gt;stopDelayingAndCoalescingContentChangeNotifications();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Editor::ignoreSpelling()
</span><span class="lines">@@ -1668,6 +1906,7 @@
</span><span class="cx">     textChecker()-&gt;learnWord(text);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> void Editor::advanceToNextMisspelling(bool startBeforeSelection)
</span><span class="cx"> {
</span><span class="cx">     // The basic approach is to search in two phases - from the selection end to the end of the doc, and
</span><span class="lines">@@ -1840,6 +2079,7 @@
</span><span class="cx">         document().markers().addMarker(misspellingRange.get(), DocumentMarker::Spelling);
</span><span class="cx">     }
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> String Editor::misspelledWordAtCaretOrRange(Node* clickedNode) const
</span><span class="cx"> {
</span><span class="lines">@@ -1954,8 +2194,10 @@
</span><span class="cx">         client()-&gt;showSpellingUI(false);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+#if !PLATFORM(IOS)
</ins><span class="cx">     advanceToNextMisspelling(true);
</span><ins>+#endif
</ins><span class="cx">     client()-&gt;showSpellingUI(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1982,6 +2224,18 @@
</span><span class="cx"> 
</span><span class="cx"> void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &amp;wordStart, const VisibleSelection&amp; selectionAfterTyping, bool doReplacement)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    UNUSED_PARAM(selectionAfterTyping);
+    UNUSED_PARAM(doReplacement);
+    TextCheckingTypeMask textCheckingOptions = 0;
+    if (isContinuousSpellCheckingEnabled())
+        textCheckingOptions |= TextCheckingTypeSpelling;
+    if (!(textCheckingOptions &amp; TextCheckingTypeSpelling))
+        return;
+
+    VisibleSelection adjacentWords = VisibleSelection(startOfWord(wordStart, LeftWordIfOnBoundary), endOfWord(wordStart, RightWordIfOnBoundary));
+    markAllMisspellingsAndBadGrammarInRanges(textCheckingOptions, adjacentWords.toNormalizedRange().get(), adjacentWords.toNormalizedRange().get());
+#else
</ins><span class="cx"> #if !USE(AUTOMATIC_TEXT_REPLACEMENT)
</span><span class="cx">     UNUSED_PARAM(doReplacement);
</span><span class="cx"> #endif
</span><span class="lines">@@ -2056,10 +2310,12 @@
</span><span class="cx">     
</span><span class="cx">     // Check grammar of entire sentence
</span><span class="cx">     markBadGrammar(VisibleSelection(startOfSentence(wordStart), endOfSentence(wordStart)));
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void Editor::markMisspellingsOrBadGrammar(const VisibleSelection&amp; selection, bool checkSpelling, RefPtr&lt;Range&gt;&amp; firstMisspellingRange)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     // This function is called with a selection already expanded to word boundaries.
</span><span class="cx">     // Might be nice to assert that here.
</span><span class="cx">     
</span><span class="lines">@@ -2095,6 +2351,11 @@
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx"> #endif
</span><span class="cx">     }    
</span><ins>+#else
+        UNUSED_PARAM(selection);
+        UNUSED_PARAM(checkSpelling);
+        UNUSED_PARAM(firstMisspellingRange);
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Editor::isSpellCheckingEnabledFor(Node* node) const
</span><span class="lines">@@ -2372,6 +2633,7 @@
</span><span class="cx"> 
</span><span class="cx"> void Editor::changeBackToReplacedString(const String&amp; replacedString)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     ASSERT(unifiedTextCheckerEnabled());
</span><span class="cx"> 
</span><span class="cx">     if (replacedString.isEmpty())
</span><span class="lines">@@ -2387,6 +2649,10 @@
</span><span class="cx">     RefPtr&lt;Range&gt; changedRange = paragraph.subrange(paragraph.checkingStart(), replacedString.length());
</span><span class="cx">     changedRange-&gt;startContainer()-&gt;document().markers().addMarker(changedRange.get(), DocumentMarker::Replacement, String());
</span><span class="cx">     m_alternativeTextController-&gt;markReversed(changedRange.get());
</span><ins>+#else
+    ASSERT_NOT_REACHED();
+    UNUSED_PARAM(replacedString);
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -2487,7 +2753,11 @@
</span><span class="cx">     for (size_t i = 0; i &lt; markers.size(); ++i)
</span><span class="cx">         m_alternativeTextController-&gt;removeDictationAlternativesForMarker(markers[i]);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    document().markers().removeMarkers(wordRange.get(), DocumentMarker::Spelling | DocumentMarker::CorrectionIndicator | DocumentMarker::SpellCheckingExemption | DocumentMarker::DictationAlternatives | DocumentMarker::DictationPhraseWithAlternatives, DocumentMarkerController::RemovePartiallyOverlappingMarker);
+#else
</ins><span class="cx">     document().markers().removeMarkers(wordRange.get(), DocumentMarker::Spelling | DocumentMarker::Grammar | DocumentMarker::CorrectionIndicator | DocumentMarker::SpellCheckingExemption | DocumentMarker::DictationAlternatives, DocumentMarkerController::RemovePartiallyOverlappingMarker);
</span><ins>+#endif
</ins><span class="cx">     document().markers().clearDescriptionOnMarkersIntersectingRange(wordRange.get(), DocumentMarker::Replacement);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2527,7 +2797,12 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_ignoreCompositionSelectionChange = ignore;
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: Merge this to open source https://bugs.webkit.org/show_bug.cgi?id=38830
</ins><span class="cx">     if (!ignore)
</span><ins>+        notifyComponentsOnChangedSelection(m_frame.selection().selection(), 0);
+#endif
+    if (!ignore)
</ins><span class="cx">         revealSelectionAfterEditingOperation(ScrollAlignment::alignToEdgeIfNeeded, RevealExtent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2656,6 +2931,11 @@
</span><span class="cx">     // change the caret's DOM position ([&quot;hello&quot;, 0]). In these situations the above FrameSelection::setSelection call
</span><span class="cx">     // does not call EditorClient::respondToChangedSelection(), which, on the Mac, sends selection change notifications and
</span><span class="cx">     // starts a new kill ring sequence, but we want to do these things (matches AppKit).
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: Merge this to open source https://bugs.webkit.org/show_bug.cgi?id=38830
+    if (m_ignoreCompositionSelectionChange)
+        return;
+#endif
</ins><span class="cx">     if (selectionDidNotChangeDOMPosition &amp;&amp; client())
</span><span class="cx">         client()-&gt;respondToChangedSelection(&amp;m_frame);
</span><span class="cx"> }
</span><span class="lines">@@ -2727,6 +3007,10 @@
</span><span class="cx"> 
</span><span class="cx"> bool Editor::shouldChangeSelection(const VisibleSelection&amp; oldSelection, const VisibleSelection&amp; newSelection, EAffinity affinity, bool stillSelecting) const
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (m_frame.selectionChangeCallbacksDisabled())
+        return true;
+#endif
</ins><span class="cx">     return client() &amp;&amp; client()-&gt;shouldChangeSelectedRange(oldSelection.toNormalizedRange().get(), newSelection.toNormalizedRange().get(), affinity, stillSelecting);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3021,7 +3305,20 @@
</span><span class="cx">         bool caretBrowsing = m_frame.settings().caretBrowsingEnabled();
</span><span class="cx">         if (m_frame.selection().selection().isContentEditable() || caretBrowsing) {
</span><span class="cx">             VisiblePosition newStart(m_frame.selection().selection().visibleStart());
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">             newAdjacentWords = VisibleSelection(startOfWord(newStart, LeftWordIfOnBoundary), endOfWord(newStart, RightWordIfOnBoundary));
</span><ins>+#else
+            // If this bug gets fixed, this PLATFORM(IOS) code could be removed:
+            // &lt;rdar://problem/7259611&gt; Word boundary code on iPhone gives different results than desktop
+            EWordSide startWordSide = LeftWordIfOnBoundary;
+            UChar32 c = newStart.characterBefore();
+            // FIXME: VisiblePosition::characterAfter() and characterBefore() do not emit newlines the same
+            // way as TextIterator, so we do an isStartOfParagraph check here.
+            if (isSpaceOrNewline(c) || c == 0xA0 || isStartOfParagraph(newStart)) {
+                startWordSide = RightWordIfOnBoundary;
+            }
+            newAdjacentWords = VisibleSelection(startOfWord(newStart, startWordSide), endOfWord(newStart, RightWordIfOnBoundary));
+#endif // !PLATFORM(IOS)
</ins><span class="cx">             if (isContinuousGrammarCheckingEnabled)
</span><span class="cx">                 newSelectedSentence = VisibleSelection(startOfSentence(newStart), endOfSentence(newStart));
</span><span class="cx">         }
</span><span class="lines">@@ -3103,14 +3400,17 @@
</span><span class="cx"> {
</span><span class="cx">     bool shouldMarkSpelling = textCheckingOptions &amp; TextCheckingTypeSpelling;
</span><span class="cx">     bool shouldMarkGrammar = textCheckingOptions &amp; TextCheckingTypeGrammar;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     bool shouldShowCorrectionPanel = textCheckingOptions &amp; TextCheckingTypeShowCorrectionPanel;
</span><span class="cx">     bool shouldCheckForCorrection = shouldShowCorrectionPanel || (textCheckingOptions &amp; TextCheckingTypeCorrection);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     TextCheckingTypeMask checkingTypes = 0;
</span><span class="cx">     if (shouldMarkSpelling)
</span><span class="cx">         checkingTypes |= TextCheckingTypeSpelling;
</span><span class="cx">     if (shouldMarkGrammar)
</span><span class="cx">         checkingTypes |= TextCheckingTypeGrammar;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (shouldCheckForCorrection)
</span><span class="cx">         checkingTypes |= TextCheckingTypeCorrection;
</span><span class="cx">     if (shouldShowCorrectionPanel)
</span><span class="lines">@@ -3131,6 +3431,7 @@
</span><span class="cx">             checkingTypes |= TextCheckingTypeCorrection;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx">     return checkingTypes;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/Editor.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -126,9 +126,11 @@
</span><span class="cx">     void pasteAsPlainText();
</span><span class="cx">     void performDelete();
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     void copyURL(const URL&amp;, const String&amp; title);
</span><span class="cx">     void copyURL(const URL&amp;, const String&amp; title, Pasteboard&amp;);
</span><span class="cx">     void copyImage(const HitTestResult&amp;);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     String readPlainTextFromPasteboard(Pasteboard&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -161,9 +163,17 @@
</span><span class="cx">     void removeFormattingAndStyle();
</span><span class="cx"> 
</span><span class="cx">     void clearLastEditCommand();
</span><ins>+#if PLATFORM(IOS)
+    void ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping();
+#endif
</ins><span class="cx"> 
</span><span class="cx">     bool deleteWithDirection(SelectionDirection, TextGranularity, bool killRing, bool isTypingAction);
</span><span class="cx">     void deleteSelectionWithSmartDelete(bool smartDelete);
</span><ins>+#if PLATFORM(IOS)
+    void clearText();
+    void removeUnchangeableStyles();
+#endif
+    
</ins><span class="cx">     bool dispatchCPPEvent(const AtomicString&amp;, ClipboardAccessPolicy);
</span><span class="cx">     
</span><span class="cx">     void applyStyle(StyleProperties*, EditAction = EditActionUnspecified);
</span><span class="lines">@@ -235,9 +245,14 @@
</span><span class="cx">     void toggleOverwriteModeEnabled();
</span><span class="cx"> 
</span><span class="cx">     void markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeMask, Range* spellingRange, Range* grammarRange);
</span><ins>+#if PLATFORM(IOS)
+    NO_RETURN_DUE_TO_ASSERT
+#endif
</ins><span class="cx">     void changeBackToReplacedString(const String&amp; replacedString);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     void advanceToNextMisspelling(bool startBeforeSelection = false);
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx">     void showSpellingGuessPanel();
</span><span class="cx">     bool spellingPanelIsShowing();
</span><span class="cx"> 
</span><span class="lines">@@ -303,6 +318,14 @@
</span><span class="cx">     EditingBehavior behavior() const;
</span><span class="cx"> 
</span><span class="cx">     PassRefPtr&lt;Range&gt; selectedRange();
</span><ins>+
+#if PLATFORM(IOS)
+    void confirmMarkedText();
+    void setTextAsChildOfElement(const String&amp;, Element*);
+    void setTextAlignmentForChangedBaseWritingDirection(WritingDirection);
+    void insertDictationPhrases(PassOwnPtr&lt;Vector&lt;Vector&lt;String&gt; &gt; &gt; dictationPhrases, RetainPtr&lt;id&gt; metadata);
+    void setDictationPhrasesAsChildOfElement(PassOwnPtr&lt;Vector&lt;Vector&lt;String&gt; &gt; &gt; dictationPhrases, RetainPtr&lt;id&gt; metadata, Element* element);
+#endif
</ins><span class="cx">     
</span><span class="cx">     void addToKillRing(Range*, bool prepend);
</span><span class="cx"> 
</span><span class="lines">@@ -400,13 +423,15 @@
</span><span class="cx">     bool insertParagraphSeparatorInQuotedContent();
</span><span class="cx">     const SimpleFontData* fontForSelection(bool&amp;) const;
</span><span class="cx">     NSDictionary* fontAttributesForSelectionStart() const;
</span><ins>+    String stringSelectionForPasteboard();
+    String stringSelectionForPasteboardWithImageAltText();
+    PassRefPtr&lt;DocumentFragment&gt; webContentFromPasteboard(Pasteboard&amp;, Range&amp; context, bool allowPlainText, bool&amp; chosePlainText);
+#if !PLATFORM(IOS)
</ins><span class="cx">     bool canCopyExcludingStandaloneImages();
</span><span class="cx">     void takeFindStringFromSelection();
</span><span class="cx">     void readSelectionFromPasteboard(const String&amp; pasteboardName);
</span><del>-    String stringSelectionForPasteboard();
-    String stringSelectionForPasteboardWithImageAltText();
</del><span class="cx">     PassRefPtr&lt;SharedBuffer&gt; dataSelectionForPasteboard(const String&amp; pasteboardName);
</span><del>-    PassRefPtr&lt;DocumentFragment&gt; webContentFromPasteboard(Pasteboard&amp;, Range&amp; context, bool allowPlainText, bool&amp; chosePlainText);
</del><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditorCommand.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -302,6 +302,14 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+static bool executeClearText(Frame&amp; frame, Event*, EditorCommandSource, const String&amp;)
+{
+    frame.editor().clearText();
+    return true;
+}
+#endif
+
</ins><span class="cx"> static bool executeDefaultParagraphSeparator(Frame&amp; frame, Event*, EditorCommandSource, const String&amp; value)
</span><span class="cx"> {
</span><span class="cx">     if (equalIgnoringCase(value, &quot;div&quot;))
</span><span class="lines">@@ -1093,7 +1101,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> static bool executeTakeFindStringFromSelection(Frame&amp; frame, Event*, EditorCommandSource, const String&amp;)
</span><span class="cx"> {
</span><span class="cx">     frame.editor().takeFindStringFromSelection();
</span><span class="lines">@@ -1237,14 +1245,30 @@
</span><span class="cx"> 
</span><span class="cx"> static bool enabledCopy(Frame&amp; frame, Event*, EditorCommandSource)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     return frame.editor().canDHTMLCopy() || frame.editor().canCopy();
</span><ins>+#else
+    return frame.editor().canCopy();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool enabledCut(Frame&amp; frame, Event*, EditorCommandSource)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     return frame.editor().canDHTMLCut() || frame.editor().canCut();
</span><ins>+#else
+    return frame.editor().canCut();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+static bool enabledClearText(Frame&amp; frame, Event*, EditorCommandSource)
+{
+    UNUSED_PARAM(frame);
+    return false;
+}
+#endif
+
</ins><span class="cx"> static bool enabledInEditableText(Frame&amp; frame, Event* event, EditorCommandSource)
</span><span class="cx"> {
</span><span class="cx">     return frame.editor().selectionForCommand(event).rootEditableElement();
</span><span class="lines">@@ -1296,7 +1320,7 @@
</span><span class="cx">     return frame.editor().canRedo();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> static bool enabledTakeFindStringFromSelection(Frame&amp; frame, Event*, EditorCommandSource)
</span><span class="cx"> {
</span><span class="cx">     return frame.editor().canCopyExcludingStandaloneImages();
</span><span class="lines">@@ -1603,9 +1627,16 @@
</span><span class="cx">         { &quot;PasteGlobalSelection&quot;, { executePasteGlobalSelection, supportedFromMenuOrKeyBinding, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">         { &quot;TakeFindStringFromSelection&quot;, { executeTakeFindStringFromSelection, supportedFromMenuOrKeyBinding, enabledTakeFindStringFromSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
</span><span class="cx"> #endif
</span><ins>+#if PLATFORM(IOS)
+        { &quot;ClearText&quot;, { executeClearText, supported, enabledClearText, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
+#endif
+
+#if PLATFORM(GTK) || PLATFORM(QT)
+        { &quot;PasteGlobalSelection&quot;, { executePasteGlobalSelection, supportedFromMenuOrKeyBinding, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
+#endif
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     // These unsupported commands are listed here since they appear in the Microsoft
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -65,6 +65,15 @@
</span><span class="cx"> #include &lt;stdio.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;Chrome.h&quot;
+#include &quot;ChromeClient.h&quot;
+#include &quot;Color.h&quot;
+#include &quot;RenderLayer.h&quot;
+#include &quot;RenderObject.h&quot;
+#include &quot;RenderStyle.h&quot;
+#endif
+
</ins><span class="cx"> #define EDIT_DEBUG 0
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -107,6 +116,12 @@
</span><span class="cx">     , m_isCaretBlinkingSuspended(false)
</span><span class="cx">     , m_focused(frame &amp;&amp; frame-&gt;page() &amp;&amp; frame-&gt;page()-&gt;focusController().focusedFrame() == frame)
</span><span class="cx">     , m_shouldShowBlockCursor(false)
</span><ins>+#if PLATFORM(IOS)
+    , m_updateAppearanceEnabled(false)
+    , m_caretBlinks(true)
+    , m_closeTypingSuppressions(0)
+    , m_scrollingSuppressCount(0)
+#endif
</ins><span class="cx"> {
</span><span class="cx">     if (shouldAlwaysUseDirectionalSelection(m_frame))
</span><span class="cx">         m_selection.setIsDirectional(true);
</span><span class="lines">@@ -268,7 +283,11 @@
</span><span class="cx"> 
</span><span class="cx">     m_granularity = granularity;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if (closeTyping &amp;&amp; m_closeTypingSuppressions == 0)
+#else
</ins><span class="cx">     if (closeTyping)
</span><ins>+#endif
</ins><span class="cx">         TypingCommand::closeTyping(m_frame);
</span><span class="cx"> 
</span><span class="cx">     if (shouldClearTypingStyle)
</span><span class="lines">@@ -620,6 +639,11 @@
</span><span class="cx">         // FIXME: implement all of the above?
</span><span class="cx">         pos = modifyExtendingForward(granularity);
</span><span class="cx">         break;
</span><ins>+#if PLATFORM(IOS)
+    case DocumentGranularity:
+        ASSERT_NOT_REACHED();
+        break;
+#endif
</ins><span class="cx">     }
</span><span class="cx"> #if ENABLE(USERSELECT_ALL)
</span><span class="cx">     adjustPositionForUserSelectAll(pos, directionOfEnclosingBlock() == LTR);
</span><span class="lines">@@ -646,6 +670,11 @@
</span><span class="cx">     case ParagraphGranularity:
</span><span class="cx">         pos = nextParagraphPosition(pos, lineDirectionPointForBlockDirectionNavigation(EXTENT));
</span><span class="cx">         break;
</span><ins>+#if PLATFORM(IOS)
+    case DocumentGranularity:
+        ASSERT_NOT_REACHED();
+        break;
+#endif
</ins><span class="cx">     case SentenceBoundary:
</span><span class="cx">         pos = endOfSentence(endForPlatform());
</span><span class="cx">         break;
</span><span class="lines">@@ -703,6 +732,11 @@
</span><span class="cx">     case LineBoundary:
</span><span class="cx">         pos = rightBoundaryOfLine(startForPlatform(), directionOfEnclosingBlock());
</span><span class="cx">         break;
</span><ins>+#if PLATFORM(IOS)
+    case DocumentGranularity:
+        ASSERT_NOT_REACHED();
+        break;
+#endif
</ins><span class="cx">     }
</span><span class="cx">     return pos;
</span><span class="cx"> }
</span><span class="lines">@@ -735,6 +769,11 @@
</span><span class="cx">     case ParagraphGranularity:
</span><span class="cx">         pos = nextParagraphPosition(endForPlatform(), lineDirectionPointForBlockDirectionNavigation(START));
</span><span class="cx">         break;
</span><ins>+#if PLATFORM(IOS)
+    case DocumentGranularity:
+        ASSERT_NOT_REACHED();
+        break;
+#endif
</ins><span class="cx">     case SentenceBoundary:
</span><span class="cx">         pos = endOfSentence(endForPlatform());
</span><span class="cx">         break;
</span><span class="lines">@@ -791,6 +830,11 @@
</span><span class="cx">     case DocumentBoundary:
</span><span class="cx">         pos = modifyExtendingBackward(granularity);
</span><span class="cx">         break;
</span><ins>+#if PLATFORM(IOS)
+    case DocumentGranularity:
+        ASSERT_NOT_REACHED();
+        break;
+#endif
</ins><span class="cx">     }
</span><span class="cx"> #if ENABLE(USERSELECT_ALL)
</span><span class="cx">     adjustPositionForUserSelectAll(pos, !(directionOfEnclosingBlock() == LTR));
</span><span class="lines">@@ -838,6 +882,11 @@
</span><span class="cx">         else
</span><span class="cx">             pos = startOfDocument(pos);
</span><span class="cx">         break;
</span><ins>+#if PLATFORM(IOS)
+    case DocumentGranularity:
+        ASSERT_NOT_REACHED();
+        break;
+#endif
</ins><span class="cx">     }
</span><span class="cx"> #if ENABLE(USERSELECT_ALL)
</span><span class="cx">     adjustPositionForUserSelectAll(pos, !(directionOfEnclosingBlock() == LTR));
</span><span class="lines">@@ -877,6 +926,11 @@
</span><span class="cx">     case LineBoundary:
</span><span class="cx">         pos = leftBoundaryOfLine(startForPlatform(), directionOfEnclosingBlock());
</span><span class="cx">         break;
</span><ins>+#if PLATFORM(IOS)
+    case DocumentGranularity:
+        ASSERT_NOT_REACHED();
+        break;
+#endif
</ins><span class="cx">     }
</span><span class="cx">     return pos;
</span><span class="cx"> }
</span><span class="lines">@@ -919,6 +973,11 @@
</span><span class="cx">         else
</span><span class="cx">             pos = startOfDocument(pos);
</span><span class="cx">         break;
</span><ins>+#if PLATFORM(IOS)
+    case DocumentGranularity:
+        ASSERT_NOT_REACHED();
+        break;
+#endif
</ins><span class="cx">     }
</span><span class="cx">     return pos;
</span><span class="cx"> }
</span><span class="lines">@@ -1668,6 +1727,12 @@
</span><span class="cx">     // FIXME: Can we provide extentAffinity?
</span><span class="cx">     VisiblePosition visibleStart(range-&gt;startPosition(), collapsed ? affinity : DOWNSTREAM);
</span><span class="cx">     VisiblePosition visibleEnd(range-&gt;endPosition(), SEL_DEFAULT_AFFINITY);
</span><ins>+#if PLATFORM(IOS)
+    if (range-&gt;startContainer() &amp;&amp; visibleStart.isNull())
+        return false;
+    if (range-&gt;endContainer() &amp;&amp; visibleEnd.isNull())
+        return false;
+#endif
</ins><span class="cx">     setSelection(VisibleSelection(visibleStart, visibleEnd), ClearTypingStyle | (closeTyping ? CloseTyping : 0));
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -1685,6 +1750,12 @@
</span><span class="cx"> 
</span><span class="cx">     document-&gt;updateStyleIfNeeded();
</span><span class="cx"> 
</span><ins>+#if USE(UIKIT_EDITING)
+    // Caret blinking (blinks | does not blink)
+    if (activeAndFocused)
+        setSelectionFromNone();
+    setCaretVisible(activeAndFocused);
+#else
</ins><span class="cx">     // Because RenderObject::selectionBackgroundColor() and
</span><span class="cx">     // RenderObject::selectionForegroundColor() check if the frame is active,
</span><span class="cx">     // we have to update places those colors were painted.
</span><span class="lines">@@ -1708,6 +1779,7 @@
</span><span class="cx">             if (renderer &amp;&amp; renderer-&gt;style().hasAppearance())
</span><span class="cx">                 renderer-&gt;theme().stateChanged(renderer, FocusState);
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FrameSelection::pageActivationChanged()
</span><span class="lines">@@ -1738,6 +1810,11 @@
</span><span class="cx"> 
</span><span class="cx"> void FrameSelection::updateAppearance()
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (!m_updateAppearanceEnabled)
+        return;
+#endif
+
</ins><span class="cx">     // Paint a block cursor instead of a caret in overtype mode unless the caret is at the end of a line (in this case
</span><span class="cx">     // the FrameSelection will paint a blinking caret as usual).
</span><span class="cx">     VisiblePosition forwardPosition;
</span><span class="lines">@@ -1912,6 +1989,10 @@
</span><span class="cx"> 
</span><span class="cx"> bool FrameSelection::shouldDeleteSelection(const VisibleSelection&amp; selection) const
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (m_frame-&gt;selectionChangeCallbacksDisabled())
+        return true;
+#endif
</ins><span class="cx">     return m_frame-&gt;editor().client()-&gt;shouldDeleteRange(selection.toNormalizedRange().get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2010,11 +2091,24 @@
</span><span class="cx">     Position start = this-&gt;start();
</span><span class="cx">     ASSERT(start.deprecatedNode());
</span><span class="cx">     if (start.deprecatedNode() &amp;&amp; start.deprecatedNode()-&gt;renderer()) {
</span><ins>+#if PLATFORM(IOS)
+        if (RenderLayer* layer = start.deprecatedNode()-&gt;renderer()-&gt;enclosingLayer()) {
+            if (!m_scrollingSuppressCount) {
+                layer-&gt;setAdjustForIOSCaretWhenScrolling(true);
+                layer-&gt;scrollRectToVisible(rect, alignment, alignment);
+                layer-&gt;setAdjustForIOSCaretWhenScrolling(false);
+                updateAppearance();
+                if (m_frame-&gt;page())
+                    m_frame-&gt;page()-&gt;chrome().client().notifyRevealedSelectionByScrollingFrame(m_frame);
+            }
+        }
+#else
</ins><span class="cx">         // FIXME: This code only handles scrolling the startContainer's layer, but
</span><span class="cx">         // the selection rect could intersect more than just that.
</span><span class="cx">         // See &lt;rdar://problem/4799899&gt;.
</span><span class="cx">         if (start.deprecatedNode()-&gt;renderer()-&gt;scrollRectToVisible(rect, alignment, alignment))
</span><span class="cx">             updateAppearance();
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2024,9 +2118,14 @@
</span><span class="cx">     // entire WebView is editable or designMode is on for this document).
</span><span class="cx"> 
</span><span class="cx">     Document* document = m_frame-&gt;document();
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     bool caretBrowsing = m_frame-&gt;settings().caretBrowsingEnabled();
</span><span class="cx">     if (!isNone() || !(document-&gt;hasEditableStyle() || caretBrowsing))
</span><span class="cx">         return;
</span><ins>+#else
+    if (!document || !(isNone() || isStartOfDocument(VisiblePosition(selection().start(), selection().affinity()))) || !document-&gt;rendererIsEditable())
+        return;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     Node* node = document-&gt;documentElement();
</span><span class="cx">     while (node &amp;&amp; !node-&gt;hasTagName(bodyTag))
</span><span class="lines">@@ -2037,6 +2136,10 @@
</span><span class="cx"> 
</span><span class="cx"> bool FrameSelection::shouldChangeSelection(const VisibleSelection&amp; newSelection) const
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (m_frame-&gt;selectionChangeCallbacksDisabled())
+        return true;
+#endif
</ins><span class="cx">     return m_frame-&gt;editor().shouldChangeSelection(selection(), newSelection, newSelection.affinity(), false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -2072,8 +2175,431 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void FrameSelection::expandSelectionToElementContainingCaretSelection()
+{
+    RefPtr&lt;Range&gt; range = elementRangeContainingCaretSelection();
+    if (!range)
+        return;
+    VisibleSelection selection(range.get(), DOWNSTREAM);
+    setSelection(selection);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassRefPtr&lt;Range&gt; FrameSelection::elementRangeContainingCaretSelection() const
+{
+    if (m_selection.isNone())
+        return nullptr;
+
+    VisibleSelection selection = m_selection;
+    if (selection.isNone())
+        return nullptr;
+
+    VisiblePosition visiblePos(selection.start(), VP_DEFAULT_AFFINITY);
+    if (visiblePos.isNull())
+        return nullptr;
+
+    Node* node = visiblePos.deepEquivalent().deprecatedNode();
+    Element* element = deprecatedEnclosingBlockFlowElement(node);
+    if (!element)
+        return nullptr;
+
+    Position startPos = createLegacyEditingPosition(element, 0);
+    Position endPos = createLegacyEditingPosition(element, element-&gt;childNodeCount());
+    
+    VisiblePosition startVisiblePos(startPos, VP_DEFAULT_AFFINITY);
+    VisiblePosition endVisiblePos(endPos, VP_DEFAULT_AFFINITY);
+    if (startVisiblePos.isNull() || endVisiblePos.isNull())
+        return nullptr;
+
+    selection.setBase(startVisiblePos);
+    selection.setExtent(endVisiblePos);
+
+    return selection.toNormalizedRange();
+}
+
+void FrameSelection::expandSelectionToWordContainingCaretSelection()
+{
+    VisibleSelection selection(wordSelectionContainingCaretSelection(m_selection));        
+    if (selection.isCaretOrRange())
+        setSelection(selection);
+}
+
+PassRefPtr&lt;Range&gt; FrameSelection::wordRangeContainingCaretSelection()
+{
+    return wordSelectionContainingCaretSelection(m_selection).toNormalizedRange();
+}
+
+void FrameSelection::expandSelectionToStartOfWordContainingCaretSelection()
+{
+    if (m_selection.isNone() || isStartOfDocument(m_selection.start()))
+        return;
+
+    VisiblePosition s1(m_selection.start());
+    VisiblePosition e1(m_selection.end());
+
+    VisibleSelection expanded(wordSelectionContainingCaretSelection(m_selection));
+    VisiblePosition s2(expanded.start());
+
+    // Don't allow the start to become greater after the expansion.
+    if (s2.isNull() || s2 &gt; s1)
+        s2 = s1;
+
+    moveTo(s2, e1);
+}
+
+UChar FrameSelection::characterInRelationToCaretSelection(int amount) const
+{
+    if (m_selection.isNone())
+        return 0;
+
+    VisibleSelection selection = m_selection;
+    ASSERT(selection.isCaretOrRange());
+
+    VisiblePosition visiblePosition(selection.start(), VP_DEFAULT_AFFINITY);
+
+    if (amount &lt; 0) {
+        int count = abs(amount);
+        for (int i = 0; i &lt; count; i++)
+            visiblePosition = visiblePosition.previous();    
+        return visiblePosition.characterBefore();
+    }
+    for (int i = 0; i &lt; amount; i++)
+        visiblePosition = visiblePosition.next();    
+    return visiblePosition.characterAfter();
+}
+
+UChar FrameSelection::characterBeforeCaretSelection() const
+{
+    if (m_selection.isNone())
+        return 0;
+
+    VisibleSelection selection = m_selection;
+    ASSERT(selection.isCaretOrRange());
+
+    VisiblePosition visiblePosition(selection.start(), VP_DEFAULT_AFFINITY);
+    return visiblePosition.characterBefore();
+}
+
+UChar FrameSelection::characterAfterCaretSelection() const
+{
+    if (m_selection.isNone())
+        return 0;
+
+    VisibleSelection selection = m_selection;
+    ASSERT(selection.isCaretOrRange());
+
+    VisiblePosition visiblePosition(selection.end(), VP_DEFAULT_AFFINITY);
+    return visiblePosition.characterAfter();
+}
+
+int FrameSelection::wordOffsetInRange(const Range *range) const
+{
+    if (!range)
+        return -1;
+
+    VisibleSelection selection = m_selection;
+    if (!selection.isCaret())
+        return -1;
+
+    // FIXME: This will only work in cases where the selection remains in
+    // the same node after it is expanded. Improve to handle more complicated
+    // cases.
+    ExceptionCode ec = 0;
+    int result = selection.start().deprecatedEditingOffset() - range-&gt;startOffset(ec);
+    ASSERT(!ec);
+    if (result &lt; 0)
+        result = 0;
+    return result;
+}
+
+bool FrameSelection::spaceFollowsWordInRange(const Range *range) const
+{
+    if (!range)
+        return false;
+    ExceptionCode ec = 0;
+    Node* node = range-&gt;endContainer(ec);
+    ASSERT(!ec);
+    int endOffset = range-&gt;endOffset(ec);
+    ASSERT(!ec);
+    VisiblePosition pos(createLegacyEditingPosition(node, endOffset), VP_DEFAULT_AFFINITY);
+    return isSpaceOrNewline(pos.characterAfter());
+}
+
+bool FrameSelection::selectionAtDocumentStart() const
+{
+    VisibleSelection selection = m_selection;
+    if (selection.isNone())
+        return false;
+
+    Position startPos(selection.start());
+    VisiblePosition pos(createLegacyEditingPosition(startPos.deprecatedNode(), startPos.deprecatedEditingOffset()), VP_DEFAULT_AFFINITY);
+    if (pos.isNull())
+        return false;
+
+    return isStartOfDocument(pos);
+}
+
+bool FrameSelection::selectionAtSentenceStart() const
+{
+    VisibleSelection selection = m_selection;
+    if (selection.isNone())
+        return false;
+
+    return actualSelectionAtSentenceStart(selection);
+}
+
+bool FrameSelection::selectionAtWordStart() const
+{
+    VisibleSelection selection = m_selection;
+    if (selection.isNone())
+        return false;
+
+    Position startPos(selection.start());
+    VisiblePosition pos(createLegacyEditingPosition(startPos.deprecatedNode(), startPos.deprecatedEditingOffset()), VP_DEFAULT_AFFINITY);
+    if (pos.isNull())
+        return false;
+
+    if (isStartOfParagraph(pos))
+        return true;
+        
+    bool result = true;
+    unsigned previousCount = 0;
+    for (pos = pos.previous(); !pos.isNull(); pos = pos.previous()) {
+        previousCount++;
+        if (isStartOfParagraph(pos)) {
+            if (previousCount == 1)
+                result = false;
+            break;
+        }
+        UChar c(pos.characterAfter());
+        if (c) {
+            result = isSpaceOrNewline(c) || c == 0xA0 || (u_ispunct(c) &amp;&amp; c != ',' &amp;&amp; c != '-' &amp;&amp; c != '\'');
+            break;
+        }
+    }
+
+    return result;
+}
+
+PassRefPtr&lt;Range&gt; FrameSelection::rangeByMovingCurrentSelection(int amount) const
+{
+    return rangeByAlteringCurrentSelection(AlterationMove, amount);
+}
+
+PassRefPtr&lt;Range&gt; FrameSelection::rangeByExtendingCurrentSelection(int amount) const
+{
+    return rangeByAlteringCurrentSelection(AlterationExtend, amount);
+}
+
+void FrameSelection::selectRangeOnElement(unsigned location, unsigned length, Node* node)
+{
+    RefPtr&lt;Range&gt; resultRange = m_frame-&gt;document()-&gt;createRange();
+    ExceptionCode ec = 0;
+    resultRange-&gt;setStart(node, location, ec);
+    ASSERT(!ec);
+    resultRange-&gt;setEnd(node, location + length, ec);
+    ASSERT(!ec);
+    VisibleSelection selection = VisibleSelection(resultRange.get(), SEL_DEFAULT_AFFINITY);
+    setSelection(selection, true);
+}
+
+VisibleSelection FrameSelection::wordSelectionContainingCaretSelection(const VisibleSelection&amp; selection)
+{
+    if (selection.isNone())
+        return VisibleSelection();
+
+    ASSERT(selection.isCaretOrRange());
+    FrameSelection frameSelection;
+    frameSelection.setSelection(selection);
+
+    Position startPosBeforeExpansion(selection.start());
+    Position endPosBeforeExpansion(selection.end());
+    VisiblePosition startVisiblePosBeforeExpansion(startPosBeforeExpansion, VP_DEFAULT_AFFINITY);
+    VisiblePosition endVisiblePosBeforeExpansion(endPosBeforeExpansion, VP_DEFAULT_AFFINITY);
+    if (endVisiblePosBeforeExpansion.isNull())
+        return VisibleSelection();
+
+    if (isEndOfParagraph(endVisiblePosBeforeExpansion)) {
+        UChar c(endVisiblePosBeforeExpansion.characterBefore());
+        if (isSpaceOrNewline(c) || c == 0xA0) {
+            // End of paragraph with space.
+            return VisibleSelection();
+        }
+    }
+
+    // If at end of paragraph, move backwards one character.
+    // This has the effect of selecting the word on the line (which is
+    // what we want, rather than selecting past the end of the line).
+    if (isEndOfParagraph(endVisiblePosBeforeExpansion) &amp;&amp; !isStartOfParagraph(endVisiblePosBeforeExpansion))
+        frameSelection.modify(FrameSelection::AlterationMove, DirectionBackward, CharacterGranularity);
+
+    VisibleSelection newSelection = frameSelection.selection();
+    newSelection.expandUsingGranularity(WordGranularity);
+    frameSelection.setSelection(newSelection, frameSelection.granularity());
+
+    Position startPos(frameSelection.selection().start());
+    Position endPos(frameSelection.selection().end());
+
+    // Expansion cannot be allowed to change selection so that it is no longer
+    // touches (or contains) the original, unexpanded selection.
+    // Enforce this on the way into these additional calculations to give them
+    // the best chance to yield a suitable answer.
+    if (startPos &gt; startPosBeforeExpansion)
+        startPos = startPosBeforeExpansion;
+    if (endPos &lt; endPosBeforeExpansion)
+        endPos = endPosBeforeExpansion;
+
+    VisiblePosition startVisiblePos(startPos, VP_DEFAULT_AFFINITY);
+    VisiblePosition endVisiblePos(endPos, VP_DEFAULT_AFFINITY);
+
+    if (startVisiblePos.isNull() || endVisiblePos.isNull()) {
+        // Start or end is nil
+        return VisibleSelection();
+    }
+
+    if (isEndOfLine(endVisiblePosBeforeExpansion)) {
+        VisiblePosition previous(endVisiblePos.previous());
+        if (previous == endVisiblePos) {
+            // Empty document
+            return VisibleSelection();
+        }
+        UChar c(previous.characterAfter());
+        if (isSpaceOrNewline(c) || c == 0xA0) {
+            // Space at end of line
+            return VisibleSelection();
+        }
+    }
+
+    // Expansion has selected past end of line.
+    // Try repositioning backwards.
+    if (isEndOfLine(startVisiblePos) &amp;&amp; isStartOfLine(endVisiblePos)) {
+        VisiblePosition previous(startVisiblePos.previous());
+        if (isEndOfLine(previous)) {
+            // On empty line
+            return VisibleSelection();
+        }
+        UChar c(previous.characterAfter());
+        if (isSpaceOrNewline(c) || c == 0xA0) {
+            // Space at end of line
+            return VisibleSelection();
+        }
+        frameSelection.moveTo(startVisiblePos);
+        frameSelection.modify(FrameSelection::AlterationExtend, DirectionBackward, WordGranularity);
+        startPos = frameSelection.selection().start();
+        endPos = frameSelection.selection().end();
+        startVisiblePos = VisiblePosition(startPos, VP_DEFAULT_AFFINITY);
+        endVisiblePos = VisiblePosition(endPos, VP_DEFAULT_AFFINITY);
+        if (startVisiblePos.isNull() || endVisiblePos.isNull()) {
+            // Start or end is nil
+            return VisibleSelection();
+        }
+    }
+
+    // Now loop backwards until we find a non-space.
+    while (endVisiblePos != startVisiblePos) {
+        VisiblePosition previous(endVisiblePos.previous());
+        UChar c(previous.characterAfter());
+        if (!isSpaceOrNewline(c) &amp;&amp; c != 0xA0)
+            break;
+        endVisiblePos = previous;
+    }
+
+    // Expansion cannot be allowed to change selection so that it is no longer
+    // touches (or contains) the original, unexpanded selection.
+    // Enforce this on the way out of the function to preserve the invariant.
+    if (startVisiblePos &gt; startVisiblePosBeforeExpansion)
+        startVisiblePos = startVisiblePosBeforeExpansion;
+    if (endVisiblePos &lt; endVisiblePosBeforeExpansion)
+        endVisiblePos = endVisiblePosBeforeExpansion;
+
+    return VisibleSelection(startVisiblePos, endVisiblePos);    
+}
+
+bool FrameSelection::actualSelectionAtSentenceStart(const VisibleSelection&amp; sel) const
+{
+    Position startPos(sel.start());
+    VisiblePosition pos(createLegacyEditingPosition(startPos.deprecatedNode(), startPos.deprecatedEditingOffset()), VP_DEFAULT_AFFINITY);
+    if (pos.isNull())
+        return false;
+
+    if (isStartOfParagraph(pos))
+        return true;

+    bool result = true;
+    bool sawSpace = false;
+    unsigned previousCount = 0;
+    for (pos = pos.previous(); !pos.isNull(); pos = pos.previous()) {
+        previousCount++;
+        if (isStartOfParagraph(pos)) {
+            if (previousCount == 1 || (previousCount == 2 &amp;&amp; sawSpace))
+                result = false;
+            break;
+        }
+        UChar c(pos.characterAfter());
+        if (c) {
+            if (isSpaceOrNewline(c) || c == 0xA0) {
+                sawSpace = true;
+            }
+            else {
+                result = (c == '.' || c == '!' || c == '?');
+                break;
+            }
+        }
+    }
+    
+    return result;
+}
+
+PassRefPtr&lt;Range&gt; FrameSelection::rangeByAlteringCurrentSelection(EAlteration alteration, int amount) const
+{
+    if (m_selection.isNone())
+        return nullptr;
+
+    if (!amount)
+        return toNormalizedRange();
+
+    FrameSelection frameSelection;
+    frameSelection.setSelection(m_selection);
+    SelectionDirection direction = amount &gt; 0 ? DirectionForward : DirectionBackward;
+    for (int i = 0; i &lt; abs(amount); i++)
+        frameSelection.modify(alteration, direction, CharacterGranularity);
+    return frameSelection.toNormalizedRange();
+}
+
+void FrameSelection::clearCurrentSelection()
+{
+    setSelection(VisibleSelection());
+}
+
+void FrameSelection::setCaretBlinks(bool caretBlinks)
+{
+    if (m_caretBlinks == caretBlinks)
+        return;
+#if ENABLE(TEXT_CARET)
+    m_frame-&gt;document()-&gt;updateLayoutIgnorePendingStylesheets(); 
+    if (m_caretPaint) {
+        m_caretPaint = false; 
+        invalidateCaretRect(); 
+    }
+#endif
+    if (caretBlinks)
+        setFocusedElementIfNeeded();
+    m_caretBlinks = caretBlinks;
+    updateAppearance();
+}
+
+void FrameSelection::setCaretColor(const Color&amp; caretColor)
+{
+    if (m_caretColor != caretColor) {
+        m_caretColor = caretColor;
+        if (caretIsVisible() &amp;&amp; m_caretBlinks &amp;&amp; isCaret())
+            invalidateCaretRect();
+    }
+}
+#endif // PLATFORM(IOS)
+
+}
+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> 
</span><span class="cx"> void showTree(const WebCore::FrameSelection&amp; sel)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/FrameSelection.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -35,6 +35,10 @@
</span><span class="cx"> #include &quot;VisibleSelection.h&quot;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;Color.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CharacterData;
</span><span class="lines">@@ -228,6 +232,43 @@
</span><span class="cx">     void showTreeForThis() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+public:
+    void expandSelectionToElementContainingCaretSelection();
+    PassRefPtr&lt;Range&gt; elementRangeContainingCaretSelection() const;
+    void expandSelectionToWordContainingCaretSelection();
+    PassRefPtr&lt;Range&gt; wordRangeContainingCaretSelection();
+    void expandSelectionToStartOfWordContainingCaretSelection();
+    UChar characterInRelationToCaretSelection(int amount) const;
+    UChar characterBeforeCaretSelection() const;
+    UChar characterAfterCaretSelection() const;
+    int wordOffsetInRange(const Range*) const;
+    bool spaceFollowsWordInRange(const Range*) const;
+    bool selectionAtDocumentStart() const;
+    bool selectionAtSentenceStart() const;
+    bool selectionAtWordStart() const;
+    PassRefPtr&lt;Range&gt; rangeByMovingCurrentSelection(int amount) const;
+    PassRefPtr&lt;Range&gt; rangeByExtendingCurrentSelection(int amount) const;
+    void selectRangeOnElement(unsigned location, unsigned length, Node*);
+    void suppressCloseTyping() { ++m_closeTypingSuppressions; }
+    void restoreCloseTyping() { --m_closeTypingSuppressions; }
+    void clearCurrentSelection();
+    void setCaretBlinks(bool caretBlinks = true);
+    void setCaretColor(const Color&amp;);
+    static VisibleSelection wordSelectionContainingCaretSelection(const VisibleSelection&amp;);
+    void setUpdateAppearanceEnabled(bool enabled) { m_updateAppearanceEnabled = enabled; }
+    void suppressScrolling() { ++m_scrollingSuppressCount; }
+    void restoreScrolling()
+    {
+        ASSERT(m_scrollingSuppressCount);
+        --m_scrollingSuppressCount;
+    }
+private:
+    bool actualSelectionAtSentenceStart(const VisibleSelection&amp;) const;
+    PassRefPtr&lt;Range&gt; rangeByAlteringCurrentSelection(EAlteration, int amount) const;
+public:
+#endif
+
</ins><span class="cx">     bool shouldChangeSelection(const VisibleSelection&amp;) const;
</span><span class="cx">     bool shouldDeleteSelection(const VisibleSelection&amp;) const;
</span><span class="cx">     enum EndPointsAdjustmentMode { AdjustEndpointsAtBidiBoundary, DoNotAdjsutEndpoints };
</span><span class="lines">@@ -309,6 +350,14 @@
</span><span class="cx">     bool m_isCaretBlinkingSuspended : 1;
</span><span class="cx">     bool m_focused : 1;
</span><span class="cx">     bool m_shouldShowBlockCursor : 1;
</span><ins>+
+#if PLATFORM(IOS)
+    bool m_updateAppearanceEnabled : 1;
+    bool m_caretBlinks : 1;
+    Color m_caretColor;
+    int m_closeTypingSuppressions;
+    int m_scrollingSuppressCount;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline EditingStyle* FrameSelection::typingStyle() const
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertIntoTextNodeCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -32,6 +32,9 @@
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;Text.h&quot;
</span><ins>+#if PLATFORM(IOS)
+#include &quot;RenderText.h&quot;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -68,6 +71,14 @@
</span><span class="cx">         cache-&gt;nodeTextChangeNotification(m_node.get(), AXObjectCache::AXTextInserted, m_offset, m_text);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void InsertIntoTextNodeCommand::doReapply()
+{
+    ExceptionCode ec;
+    m_node-&gt;insertData(m_offset, m_text, ec);
+}
+#endif
+    
</ins><span class="cx"> void InsertIntoTextNodeCommand::doUnapply()
</span><span class="cx"> {
</span><span class="cx">     if (!m_node-&gt;hasEditableStyle())
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertIntoTextNodeCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -44,6 +44,9 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void doApply() OVERRIDE;
</span><span class="cx">     virtual void doUnapply() OVERRIDE;
</span><ins>+#if PLATFORM(IOS)
+    virtual void doReapply() OVERRIDE;
+#endif
</ins><span class="cx">     
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     virtual void getNodesInCommand(HashSet&lt;Node*&gt;&amp;) OVERRIDE;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertTextCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertTextCommand.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertTextCommand.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/InsertTextCommand.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -68,6 +68,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void doApply();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    virtual bool isInsertTextCommand() const OVERRIDE { return true; }
+#endif
+
</ins><span class="cx">     Position positionInsideTextNode(const Position&amp;);
</span><span class="cx">     Position insertTab(const Position&amp;);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -899,6 +899,13 @@
</span><span class="cx">     if (!selection.rootEditableElement())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // In plain text only regions, we create style-less fragments, so the inserted content will automatically
+    // match the style of the surrounding area and so we can avoid unnecessary work below for m_matchStyle.
+    if (!selection.isContentRichlyEditable())
+        m_matchStyle = false;
+#endif
+
</ins><span class="cx">     ReplacementFragment fragment(document(), m_documentFragment.get(), selection);
</span><span class="cx">     if (performTrivialReplace(fragment))
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextAffinityh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextAffinity.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextAffinity.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/TextAffinity.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -27,7 +27,11 @@
</span><span class="cx"> #define TextAffinity_h
</span><span class="cx"> 
</span><span class="cx"> #ifdef __OBJC__
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;AppKit/NSTextView.h&gt;
</span><ins>+#else
+#include &quot;WAKAppKitStubs.h&quot;
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextCheckingHelpercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextCheckingHelper.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextCheckingHelper.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/TextCheckingHelper.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -233,6 +233,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> String TextCheckingHelper::findFirstMisspelling(int&amp; firstMisspellingOffset, bool markAll, RefPtr&lt;Range&gt;&amp; firstMisspellingRange)
</span><span class="cx"> {
</span><span class="cx">     WordAwareIterator it(m_range.get());
</span><span class="lines">@@ -413,6 +414,7 @@
</span><span class="cx">     }
</span><span class="cx">     return firstFoundItem;
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #if USE(GRAMMAR_CHECKING)
</span><span class="cx"> int TextCheckingHelper::findFirstGrammarDetail(const Vector&lt;GrammarDetail&gt;&amp; grammarDetails, int badGrammarPhraseLocation, int startOffset, int endOffset, bool markAll) const
</span><span class="lines">@@ -612,6 +614,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> void TextCheckingHelper::markAllMisspellings(RefPtr&lt;Range&gt;&amp; firstMisspellingRange)
</span><span class="cx"> {
</span><span class="cx">     // Use the &quot;markAll&quot; feature of findFirstMisspelling. Ignore the return value and the &quot;out parameter&quot;;
</span><span class="lines">@@ -630,6 +633,7 @@
</span><span class="cx">     findFirstBadGrammar(ignoredGrammarDetail, ignoredOffset, true);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> bool TextCheckingHelper::unifiedTextCheckerEnabled() const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextGranularityh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextGranularity.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextGranularity.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/TextGranularity.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -36,6 +36,9 @@
</span><span class="cx">     SentenceGranularity,
</span><span class="cx">     LineGranularity,
</span><span class="cx">     ParagraphGranularity,
</span><ins>+#if PLATFORM(IOS)
+    DocumentGranularity,
+#endif
</ins><span class="cx">     SentenceBoundary,
</span><span class="cx">     LineBoundary,
</span><span class="cx">     ParagraphBoundary,
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -250,8 +250,21 @@
</span><span class="cx">     if (!renderer)
</span><span class="cx">         return false;
</span><span class="cx">     
</span><ins>+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    if (renderer-&gt;isImage() || renderer-&gt;isMedia())
+        return true;
+    if (renderer-&gt;isWidget()) {
+        if (renderer-&gt;node() &amp;&amp; renderer-&gt;node()-&gt;isElementNode()) {
+            Element* element = toElement(renderer-&gt;node());
+            if (element-&gt;hasTagName(videoTag) || !element-&gt;hasTagName(audioTag))
+                return false; // See &lt;rdar://problem/6893793&gt;.
+        }
+        return true;
+    }
+#else
</ins><span class="cx">     if (renderer-&gt;isImage() || renderer-&gt;isWidget() || renderer-&gt;isMedia())
</span><span class="cx">         return true;
</span><ins>+#endif
</ins><span class="cx">     
</span><span class="cx">     if (renderer-&gt;node() &amp;&amp; renderer-&gt;node()-&gt;isElementNode()) {
</span><span class="cx">         Element* element = toElement(renderer-&gt;node());
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTypingCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TypingCommand.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TypingCommand.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/TypingCommand.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -236,6 +236,16 @@
</span><span class="cx">         lastTypingCommand-&gt;closeTyping();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping(Frame* frame, const VisibleSelection&amp; newSelection)
+{
+    if (RefPtr&lt;TypingCommand&gt; lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) {
+        lastTypingCommand-&gt;setEndingSelection(newSelection);
+        lastTypingCommand-&gt;setEndingSelectionOnLastInsertCommand(newSelection);
+    }
+}
+#endif
+
</ins><span class="cx"> void TypingCommand::doApply()
</span><span class="cx"> {
</span><span class="cx">     if (!endingSelection().isNonOrphanedCaretOrRange())
</span><span class="lines">@@ -281,7 +291,7 @@
</span><span class="cx"> {
</span><span class="cx">     Frame&amp; frame = this-&gt;frame();
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     if (!frame.editor().isContinuousSpellCheckingEnabled()
</span><span class="cx">         &amp;&amp; !frame.editor().isAutomaticQuoteSubstitutionEnabled()
</span><span class="cx">         &amp;&amp; !frame.editor().isAutomaticLinkDetectionEnabled()
</span><span class="lines">@@ -299,6 +309,7 @@
</span><span class="cx">     VisiblePosition start(endingSelection().start(), endingSelection().affinity());
</span><span class="cx">     VisiblePosition previous = start.previous();
</span><span class="cx">     if (previous.isNotNull()) {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         VisiblePosition p1 = startOfWord(previous, LeftWordIfOnBoundary);
</span><span class="cx">         VisiblePosition p2 = startOfWord(start, LeftWordIfOnBoundary);
</span><span class="cx">         if (p1 != p2) {
</span><span class="lines">@@ -309,6 +320,22 @@
</span><span class="cx">             frame.editor().markMisspellingsAfterTypingToWord(p1, endingSelection(), !strippedPreviousWord.isEmpty());
</span><span class="cx">         } else if (commandType == TypingCommand::InsertText)
</span><span class="cx">             frame.editor().startAlternativeTextUITimer();
</span><ins>+#else
+        UNUSED_PARAM(commandType);
+        // If this bug gets fixed, this PLATFORM(IOS) code could be removed:
+        // &lt;rdar://problem/7259611&gt; Word boundary code on iPhone gives different results than desktop
+        EWordSide startWordSide = LeftWordIfOnBoundary;
+        UChar32 c = previous.characterAfter();
+        // FIXME: VisiblePosition::characterAfter() and characterBefore() do not emit newlines the same
+        // way as TextIterator, so we do an isEndOfParagraph check here.
+        if (isSpaceOrNewline(c) || c == 0xA0 || isEndOfParagraph(previous)) {
+            startWordSide = RightWordIfOnBoundary;
+        }
+        VisiblePosition p1 = startOfWord(previous, startWordSide);
+        VisiblePosition p2 = startOfWord(start, startWordSide);
+        if (p1 != p2)
+            frame.editor().markMisspellingsAfterTypingToWord(p1, endingSelection(), false);
+#endif // !PLATFORM(IOS)
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -487,8 +514,15 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     ASSERT(!selectionToDelete.isNone());
</span><del>-    if (selectionToDelete.isNone())
</del><ins>+    if (selectionToDelete.isNone()) {
+#if PLATFORM(IOS)
+        // Workaround for this bug:
+        // &lt;rdar://problem/4653755&gt; UIKit text widgets should use WebKit editing API to manipulate text
+        setEndingSelection(frame.selection().selection());
+        closeTyping(&amp;frame);
+#endif
</ins><span class="cx">         return;
</span><ins>+    }
</ins><span class="cx">     
</span><span class="cx">     if (selectionToDelete.isCaret() || !frame.selection().shouldDeleteSelection(selectionToDelete))
</span><span class="cx">         return;
</span><span class="lines">@@ -578,8 +612,15 @@
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     ASSERT(!selectionToDelete.isNone());
</span><del>-    if (selectionToDelete.isNone())
</del><ins>+    if (selectionToDelete.isNone()) {
+#if PLATFORM(IOS)
+        // Workaround for this bug:
+        // &lt;rdar://problem/4653755&gt; UIKit text widgets should use WebKit editing API to manipulate text
+        setEndingSelection(frame.selection().selection());
+        closeTyping(&amp;frame);
+#endif
</ins><span class="cx">         return;
</span><ins>+    }
</ins><span class="cx">     
</span><span class="cx">     if (selectionToDelete.isCaret() || !frame.selection().shouldDeleteSelection(selectionToDelete))
</span><span class="cx">         return;
</span><span class="lines">@@ -599,6 +640,25 @@
</span><span class="cx">     typingAddedToOpenCommand(DeleteSelection);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+class FriendlyEditCommand : public EditCommand {
+public:
+    void setEndingSelection(const VisibleSelection&amp; selection)
+    {
+        EditCommand::setEndingSelection(selection);
+    }
+};
+
+void TypingCommand::setEndingSelectionOnLastInsertCommand(const VisibleSelection&amp; selection)
+{
+    if (!m_commands.isEmpty()) {
+        EditCommand* lastCommand = m_commands.last().get();
+        if (lastCommand-&gt;isInsertTextCommand())
+            static_cast&lt;FriendlyEditCommand*&gt;(lastCommand)-&gt;setEndingSelection(selection);
+    }
+}
+#endif
+
</ins><span class="cx"> void TypingCommand::updatePreservesTypingStyle(ETypingCommand commandType)
</span><span class="cx"> {
</span><span class="cx">     switch (commandType) {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTypingCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TypingCommand.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TypingCommand.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/TypingCommand.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -66,6 +66,9 @@
</span><span class="cx">     static void insertParagraphSeparator(Document&amp;, Options);
</span><span class="cx">     static void insertParagraphSeparatorInQuotedContent(Document&amp;);
</span><span class="cx">     static void closeTyping(Frame*);
</span><ins>+#if PLATFORM(IOS)
+    static void ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping(Frame*, const VisibleSelection&amp;);
+#endif
</ins><span class="cx"> 
</span><span class="cx">     void insertText(const String &amp;text, bool selectInsertedText);
</span><span class="cx">     void insertTextRunWithoutNewlines(const String &amp;text, bool selectInsertedText);
</span><span class="lines">@@ -77,6 +80,10 @@
</span><span class="cx">     void deleteSelection(bool smartDelete);
</span><span class="cx">     void setCompositionType(TextCompositionType type) { m_compositionType = type; }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    void setEndingSelectionOnLastInsertCommand(const VisibleSelection&amp; selection);
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     static PassRefPtr&lt;TypingCommand&gt; create(Document&amp; document, ETypingCommand command, const String&amp; text = &quot;&quot;, Options options = 0, TextGranularity granularity = CharacterGranularity)
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisiblePositionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisiblePosition.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisiblePosition.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/VisiblePosition.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -127,7 +127,29 @@
</span><span class="cx"> {
</span><span class="cx">     return !(a == b);
</span><span class="cx"> }
</span><ins>+    
+#if PLATFORM(IOS)
+inline bool operator&lt;(const VisiblePosition&amp; a, const VisiblePosition&amp; b)
+{
+    return a.deepEquivalent() &lt; b.deepEquivalent();
+}
</ins><span class="cx"> 
</span><ins>+inline bool operator&gt;(const VisiblePosition&amp; a, const VisiblePosition&amp; b) 
+{
+    return a.deepEquivalent() &gt; b.deepEquivalent();
+}
+
+inline bool operator&lt;=(const VisiblePosition&amp; a, const VisiblePosition&amp; b)
+{
+    return a.deepEquivalent() &lt;= b.deepEquivalent();
+}
+
+inline bool operator&gt;=(const VisiblePosition&amp; a, const VisiblePosition&amp; b) 
+{
+    return a.deepEquivalent() &gt;= b.deepEquivalent();
+}    
+#endif
+
</ins><span class="cx"> PassRefPtr&lt;Range&gt; makeRange(const VisiblePosition&amp;, const VisiblePosition&amp;);
</span><span class="cx"> bool setStart(Range*, const VisiblePosition&amp;);
</span><span class="cx"> bool setEnd(Range*, const VisiblePosition&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleSelection.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleSelection.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/VisibleSelection.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -321,6 +321,14 @@
</span><span class="cx">             }
</span><span class="cx">                 
</span><span class="cx">             m_end = end.deepEquivalent();
</span><ins>+#if PLATFORM(IOS)
+            // End must not be before start.
+            if (m_start.deprecatedNode() == m_end.deprecatedNode() &amp;&amp; m_start.deprecatedEditingOffset() &gt; m_end.deprecatedEditingOffset()) {
+                Position swap(m_start);
+                m_start = m_end;    
+                m_end = swap;    
+            }
+#endif
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case SentenceGranularity: {
</span><span class="lines">@@ -384,6 +392,11 @@
</span><span class="cx">             m_start = startOfSentence(VisiblePosition(m_start, m_affinity)).deepEquivalent();
</span><span class="cx">             m_end = endOfSentence(VisiblePosition(m_end, m_affinity)).deepEquivalent();
</span><span class="cx">             break;
</span><ins>+#if PLATFORM(IOS)
+        case DocumentGranularity:
+            ASSERT_NOT_REACHED();
+            break;
+#endif
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // Make sure we do not have a dangling start or end.
</span><span class="lines">@@ -519,6 +532,13 @@
</span><span class="cx">     if (m_base.isNull() || m_start.isNull() || m_end.isNull())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // Early return in the caret case (the state hasn't actually been set yet, so we can't use isCaret()) to avoid the 
+    // expense of computing highestEditableRoot.
+    if (m_base == m_start &amp;&amp; m_base == m_end)
+        return;
+#endif
+
</ins><span class="cx">     Node* baseRoot = highestEditableRoot(m_base);
</span><span class="cx">     Node* startRoot = highestEditableRoot(m_start);
</span><span class="cx">     Node* endRoot = highestEditableRoot(m_end);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleUnitscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleUnits.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleUnits.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/VisibleUnits.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -497,7 +497,11 @@
</span><span class="cx">         else {
</span><span class="cx">             // Treat bullets used in the text security mode as regular characters when looking for boundaries
</span><span class="cx">             String iteratorString(it.characters(), it.length());
</span><ins>+#if PLATFORM(IOS)
+            iteratorString = iteratorString.impl()-&gt;fill('x');
+#else
</ins><span class="cx">             iteratorString.fill('x');
</span><ins>+#endif
</ins><span class="cx">             string.insert(0, iteratorString.characters(), iteratorString.length());
</span><span class="cx">         }
</span><span class="cx">         next = searchFunction(string.data(), string.size(), string.size() - suffixLength, MayHaveMoreContext, needMoreContext);
</span><span class="lines">@@ -571,7 +575,11 @@
</span><span class="cx">         else {
</span><span class="cx">             // Treat bullets used in the text security mode as regular characters when looking for boundaries
</span><span class="cx">             String iteratorString(it.characters(), it.length());
</span><ins>+#if PLATFORM(IOS)
+            iteratorString = iteratorString.impl()-&gt;fill('x');
+#else
</ins><span class="cx">             iteratorString.fill('x');
</span><ins>+#endif
</ins><span class="cx">             string.append(iteratorString.characters(), iteratorString.length());
</span><span class="cx">         }
</span><span class="cx">         next = searchFunction(string.data(), string.size(), prefixLength, MayHaveMoreContext, needMoreContext);
</span><span class="lines">@@ -1332,7 +1340,18 @@
</span><span class="cx">     if (!node || !node-&gt;document().documentElement())
</span><span class="cx">         return VisiblePosition();
</span><span class="cx">     
</span><ins>+#if PLATFORM(IOS)
+    // The canonicalization of the position at (documentElement, 0) can turn the visible
+    // position to null, even when there's a valid candidate to be had, because the root HTML element
+    // is not content editable.  So we construct directly from the valid candidate.
+    // FIXME: Merge this to Open Source. https://bugs.webkit.org/show_bug.cgi?id=56437
+    Position firstCandidate = nextCandidate(createLegacyEditingPosition(node-&gt;document().documentElement(), 0));
+    if (firstCandidate.isNull())
+        return VisiblePosition();
+    return VisiblePosition(firstCandidate);
+#else
</ins><span class="cx">     return VisiblePosition(firstPositionInNode(node-&gt;document().documentElement()), DOWNSTREAM);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> VisiblePosition startOfDocument(const VisiblePosition &amp;c)
</span><span class="lines">@@ -1345,7 +1364,20 @@
</span><span class="cx">     if (!node || !node-&gt;document().documentElement())
</span><span class="cx">         return VisiblePosition();
</span><span class="cx">     
</span><ins>+#if PLATFORM(IOS)
+    // (As above, in startOfDocument.)  The canonicalization can reject valid visible positions
+    // when descending from the root element, so we construct the visible position directly from a
+    // valid candidate.
+    // FIXME: Merge this to Open Source. https://bugs.webkit.org/show_bug.cgi?id=56437
+#endif
</ins><span class="cx">     Element* doc = node-&gt;document().documentElement();
</span><ins>+#if PLATFORM(IOS)
+    Position lastPosition = createLegacyEditingPosition(node-&gt;document().documentElement(), doc-&gt;childNodeCount());
+    Position lastCandidate = previousCandidate(lastPosition);
+    if (lastCandidate.isNull())
+        return VisiblePosition();
+    return VisiblePosition(lastCandidate);
+#endif
</ins><span class="cx">     return VisiblePosition(lastPositionInNode(doc), DOWNSTREAM);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1413,4 +1445,443 @@
</span><span class="cx">     return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+static bool directionIsDownstream(SelectionDirection direction)
+{
+    if (direction == DirectionBackward)
+        return false;
+    else if (direction == DirectionForward)
+        return true;
+
+    // FIXME: this code doesn't take into account the original direction of the element.
+    // I'm not fixing this now because I'm afraid there is some code in UIKit relying on
+    // this wrong behavior.
+    return direction == DirectionRight;
</ins><span class="cx"> }
</span><ins>+
+bool atBoundaryOfGranularity(const VisiblePosition&amp; vp, TextGranularity granularity, SelectionDirection direction)
+{
+    if (granularity == CharacterGranularity)
+        return true;
+
+    VisiblePosition boundary;
+
+    bool useDownstream = directionIsDownstream(direction);
+
+    switch (granularity) {
+    case WordGranularity:
+        // visible_units claims erroneously that the start and the end
+        // of a paragraph are the end and start of a word, respectively.
+        if ((useDownstream &amp;&amp; isStartOfParagraph(vp)) || (!useDownstream &amp;&amp; isEndOfParagraph(vp)))
+            return false;
+
+        // Note that &quot;Left&quot; and &quot;Right&quot; in this context apparently mean &quot;upstream/previous&quot; and &quot;downstream/next&quot;.
+        boundary = useDownstream ? endOfWord(vp, LeftWordIfOnBoundary) : startOfWord(vp, RightWordIfOnBoundary);
+        break;
+
+    case SentenceGranularity:
+        boundary = useDownstream ? endOfSentence(vp) : startOfSentence(vp);
+        break;
+
+    case LineGranularity:
+        // Affinity has to be set to get right boundary of the line.
+        boundary = vp;
+        boundary.setAffinity(useDownstream ? VP_UPSTREAM_IF_POSSIBLE : DOWNSTREAM);
+        boundary = useDownstream ? endOfLine(boundary) : startOfLine(boundary);
+        break;
+
+    case ParagraphGranularity:
+        boundary = useDownstream ? endOfParagraph(vp) : startOfParagraph(vp);
+        break;
+
+    case DocumentGranularity:
+        boundary = useDownstream ? endOfDocument(vp) : startOfDocument(vp);
+        break;
+
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+
+    return vp == boundary;
+}
+
+bool withinTextUnitOfGranularity(const VisiblePosition&amp; vp, TextGranularity granularity, SelectionDirection direction)
+{
+    if (granularity == CharacterGranularity || granularity == DocumentGranularity)
+        return true;
+
+    bool useDownstream = directionIsDownstream(direction);
+
+    VisiblePosition prevBoundary;
+    VisiblePosition nextBoundary;
+    
+    switch (granularity) {
+    case WordGranularity:
+        // Note that &quot;Left&quot; and &quot;Right&quot; in this context apparently mean &quot;upstream/previous&quot; and &quot;downstream/next&quot;.
+        prevBoundary = startOfWord(vp, (useDownstream ? RightWordIfOnBoundary : LeftWordIfOnBoundary));
+        nextBoundary = endOfWord(vp, (useDownstream ? RightWordIfOnBoundary : LeftWordIfOnBoundary));
+    
+        // Workaround for &lt;rdar://problem/7259611&gt; Word boundary code on iPhone gives different results than desktop
+        if (endOfWord(prevBoundary, RightWordIfOnBoundary) != nextBoundary)
+            return false;
+
+        break;
+
+    case SentenceGranularity:
+        prevBoundary = startOfSentence(vp);
+        nextBoundary = endOfSentence(vp);
+        break;
+
+    case LineGranularity:
+        prevBoundary = startOfLine(vp);
+        nextBoundary = endOfLine(vp);
+
+        if (prevBoundary == nextBoundary) {
+            nextBoundary = nextLinePosition(nextBoundary, 0);
+            nextBoundary.setAffinity(UPSTREAM);
+            if (!inSameLine(prevBoundary, nextBoundary))
+                nextBoundary = vp.next();
+        }
+        break;
+
+    case ParagraphGranularity:
+        prevBoundary = startOfParagraph(vp);
+        nextBoundary = endOfParagraph(vp);
+        break;
+
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+
+    if (prevBoundary == nextBoundary)
+        return false;
+
+    if (vp == prevBoundary)
+        return useDownstream;
+
+    if (vp == nextBoundary)
+        return !useDownstream;
+
+    return (prevBoundary &lt; vp &amp;&amp; vp &lt; nextBoundary);
+}
+
+static VisiblePosition nextCharacterBoundaryInDirection(const VisiblePosition&amp; vp, SelectionDirection direction)
+{
+    return directionIsDownstream(direction) ? vp.next() : vp.previous();
+}
+
+static VisiblePosition nextWordBoundaryInDirection(const VisiblePosition&amp; vp, SelectionDirection direction)
+{
+    bool useDownstream = directionIsDownstream(direction);
+    bool withinUnitOfGranularity = withinTextUnitOfGranularity(vp, WordGranularity, direction);
+    VisiblePosition result;
+    
+    if (useDownstream) {
+        if (withinUnitOfGranularity)
+            result = endOfWord(vp, RightWordIfOnBoundary);
+        else {
+            VisiblePosition start = startOfWord(vp, RightWordIfOnBoundary);
+            if (start &gt; vp &amp;&amp; start != endOfWord(start))
+                result = start;
+            else {
+                // Do same thing as backwards traveling below.
+                start = vp;
+                while (true) {
+                    result = startOfWord(nextWordPosition(start), RightWordIfOnBoundary);
+
+                    if (result == start)
+                        break;
+
+                    // We failed to find a word boundary.
+                    if (result.isNull() || result &lt; start)
+                        return VisiblePosition();
+
+                    // We consider successs also the case where start is before element and result is after.
+                    // This covers moving past images like words.
+                    if (result != endOfWord(result)
+                        || (result.deepEquivalent().anchorNode() == start.deepEquivalent().anchorNode()
+                            &amp;&amp; result.deepEquivalent().anchorType() == Position::PositionIsAfterAnchor
+                            &amp;&amp; start.deepEquivalent().anchorType() == Position::PositionIsBeforeAnchor))
+                        break;
+
+                    start = result;
+                }
+            }
+        }
+    } else {
+        if (withinUnitOfGranularity)
+            result = startOfWord(vp, LeftWordIfOnBoundary);
+        else {
+            // This is complicated because:
+            //   When given &quot;Blah blah.|&quot;, endOfWord is &quot;Blah blah|.&quot;, and previousWordPosition is &quot;Blah| blah.&quot;
+            //   When given &quot;Blah blah. |&quot;, endOfWord is &quot;Blah blah.| &quot;, and previousWordPosition is &quot;Blah |blah. &quot;.
+            VisiblePosition end = endOfWord(vp, LeftWordIfOnBoundary);
+            if (end &lt; vp &amp;&amp; end != startOfWord(end))
+                result = end;
+            else {
+                end = vp;
+                while (true) {
+                    result = endOfWord(previousWordPosition(end), RightWordIfOnBoundary);
+
+                    if (result == end)
+                        break;
+
+                    if (result.isNull() || result &gt; end)
+                        return VisiblePosition();
+
+                    if (result != startOfWord(result))
+                        break;
+
+                    end = result;
+                }
+            }
+        }
+    }
+    
+    if (result == vp)
+        return VisiblePosition();
+    
+    return result;
+}
+
+static VisiblePosition nextSentenceBoundaryInDirection(const VisiblePosition&amp; vp, SelectionDirection direction)
+{
+    bool useDownstream = directionIsDownstream(direction);
+    bool withinUnitOfGranularity = withinTextUnitOfGranularity(vp, SentenceGranularity, direction);
+    VisiblePosition result;
+
+    if (withinUnitOfGranularity)
+        result = useDownstream ? endOfSentence(vp) : startOfSentence(vp);
+    else {
+        result = useDownstream ? nextSentencePosition(vp) : previousSentencePosition(vp);
+        if (result.isNull() || result == vp)
+            return VisiblePosition();
+
+        result = useDownstream ? startOfSentence(vp) : endOfSentence(vp);
+    }
+
+    if (result == vp)
+        return VisiblePosition();
+
+    ASSERT(useDownstream ? (result &gt; vp) : (result &lt; vp));
+
+    return result;
+}
+
+static VisiblePosition nextLineBoundaryInDirection(const VisiblePosition&amp; vp, SelectionDirection direction)
+{
+    bool useDownstream = directionIsDownstream(direction);
+    VisiblePosition result = vp;
+
+    if (useDownstream) {
+        result.setAffinity(DOWNSTREAM);
+        result = isEndOfLine(result) ? startOfLine(nextLinePosition(result, result.lineDirectionPointForBlockDirectionNavigation())) : endOfLine(result);
+    } else {
+        result.setAffinity(VP_UPSTREAM_IF_POSSIBLE);
+        result = isStartOfLine(result) ? endOfLine(previousLinePosition(result, result.lineDirectionPointForBlockDirectionNavigation())) : startOfLine(result);
+    }
+
+    return result;
+}
+
+static VisiblePosition nextParagraphBoundaryInDirection(const VisiblePosition&amp; vp, SelectionDirection direction)
+{
+    bool useDownstream = directionIsDownstream(direction);
+    bool withinUnitOfGranularity = withinTextUnitOfGranularity(vp, ParagraphGranularity, direction);
+    VisiblePosition result;
+
+    if (!withinUnitOfGranularity)
+        result =  useDownstream ? startOfParagraph(nextParagraphPosition(vp, vp.lineDirectionPointForBlockDirectionNavigation())) : endOfParagraph(previousParagraphPosition(vp, vp.lineDirectionPointForBlockDirectionNavigation()));
+    else
+        result = useDownstream ? endOfParagraph(vp) : startOfParagraph(vp);
+
+    return result;
+}
+
+static VisiblePosition nextDocumentBoundaryInDirection(const VisiblePosition&amp; vp, SelectionDirection direction)
+{
+    return directionIsDownstream(direction) ? endOfDocument(vp) : startOfDocument(vp);
+}
+
+VisiblePosition positionOfNextBoundaryOfGranularity(const VisiblePosition&amp; vp, TextGranularity granularity, SelectionDirection direction)
+{
+    switch (granularity) {
+    case CharacterGranularity:
+        return nextCharacterBoundaryInDirection(vp, direction);
+    case WordGranularity:
+        return nextWordBoundaryInDirection(vp, direction);
+    case SentenceGranularity:
+        return nextSentenceBoundaryInDirection(vp, direction);
+    case LineGranularity:
+        return nextLineBoundaryInDirection(vp, direction);
+    case ParagraphGranularity:
+        return nextParagraphBoundaryInDirection(vp, direction);
+    case DocumentGranularity:
+        return nextDocumentBoundaryInDirection(vp, direction);
+    default:
+        ASSERT_NOT_REACHED();
+        return VisiblePosition();
+    }
+}
+
+PassRefPtr&lt;Range&gt; enclosingTextUnitOfGranularity(const VisiblePosition&amp; vp, TextGranularity granularity, SelectionDirection direction)
+{
+    // This is particularly inefficient.  We could easily obtain the answer with the boundaries computed below.
+    if (!withinTextUnitOfGranularity(vp, granularity, direction))
+        return 0;
+
+    VisiblePosition prevBoundary;
+    VisiblePosition nextBoundary;
+    bool useDownstream = directionIsDownstream(direction);
+
+    switch (granularity) {
+        case CharacterGranularity:
+            prevBoundary = vp;
+            nextBoundary = prevBoundary.next();
+            break;
+
+        case WordGranularity:
+            // NB: &quot;Left&quot; and &quot;Right&quot; in this context apparently mean &quot;upstream/previous&quot; and &quot;downstream/next&quot;.
+            if (useDownstream) {
+                prevBoundary = startOfWord(vp, RightWordIfOnBoundary);
+                nextBoundary = endOfWord(vp, RightWordIfOnBoundary);
+            } else {
+                prevBoundary = startOfWord(vp, LeftWordIfOnBoundary);
+                nextBoundary = endOfWord(vp, LeftWordIfOnBoundary);
+            }
+            break;
+
+        case SentenceGranularity:
+            prevBoundary = startOfSentence(vp);
+            nextBoundary = endOfSentence(vp);
+            break;
+
+        case LineGranularity:
+            prevBoundary = startOfLine(vp);
+            nextBoundary = endOfLine(vp);
+
+            if (prevBoundary == nextBoundary) {
+                nextBoundary = nextLinePosition(nextBoundary, 0);
+                nextBoundary.setAffinity(UPSTREAM);
+                if (!inSameLine(prevBoundary, nextBoundary))
+                    nextBoundary = vp.next();
+            }
+            break;
+
+        case ParagraphGranularity:
+            prevBoundary = startOfParagraph(vp);
+            nextBoundary = endOfParagraph(vp);
+            break;
+
+        case DocumentGranularity:
+            prevBoundary = startOfDocument(vp);
+            nextBoundary = endOfDocument(vp);
+            break;
+
+        default:
+            ASSERT_NOT_REACHED();
+            return 0;
+    }
+
+    if (prevBoundary.isNull() || nextBoundary.isNull())
+        return 0;
+
+    if (vp &lt; prevBoundary || vp &gt; nextBoundary)
+        return 0;
+
+    RefPtr&lt;Range&gt; range = Range::create(prevBoundary.deepEquivalent().deprecatedNode()-&gt;document(), prevBoundary, nextBoundary);
+
+    return range;
+}
+
+int distanceBetweenPositions(const VisiblePosition&amp; vp, const VisiblePosition&amp; other)
+{
+    if (vp.isNull() || other.isNull())
+        return 0;
+
+    bool thisIsStart = (vp &lt; other);
+
+    // Start must come first in the Range constructor.
+    RefPtr&lt;Range&gt; range = Range::create(vp.deepEquivalent().deprecatedNode()-&gt;document(),
+                                        (thisIsStart ? vp : other),
+                                        (thisIsStart ? other : vp));
+    int distance = TextIterator::rangeLength(range.get());
+
+    return (thisIsStart ? -distance : distance);
+}
+
+PassRefPtr&lt;Range&gt; wordRangeFromPosition(const VisiblePosition&amp; position)
+{
+    ASSERT(position.isNotNull());
+
+    RefPtr&lt;Range&gt; range = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionBackward);
+
+    if (!range) {
+        // We could be at the start of a word, try forward.
+        range = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionForward);
+    }
+    if (range)
+        return range;
+
+    VisiblePosition currentPosition = position;
+    do {
+        currentPosition = positionOfNextBoundaryOfGranularity(currentPosition, WordGranularity, DirectionBackward);
+    } while (currentPosition.isNotNull() &amp;&amp; !atBoundaryOfGranularity(currentPosition, WordGranularity, DirectionBackward));
+
+    // If the position is an empty paragraph and at the end of the document
+    // the word iterator could not pass the paragraph boundary, therefore iterating to
+    // the previous line is required.
+    if (currentPosition.isNull() &amp;&amp; isEndOfDocument(position)) {
+        VisiblePosition previousLinePosition = positionOfNextBoundaryOfGranularity(position, LineGranularity, DirectionBackward);
+        if (previousLinePosition.isNotNull()) {
+            currentPosition = positionOfNextBoundaryOfGranularity(previousLinePosition, WordGranularity, DirectionBackward);
+            if (currentPosition.isNull())
+                currentPosition = previousLinePosition;
+        }
+    }
+
+    if (currentPosition.isNull())
+        currentPosition = positionOfNextBoundaryOfGranularity(position, WordGranularity, DirectionForward);
+
+    if (currentPosition.isNotNull()) {
+        range = Range::create(position.deepEquivalent().deprecatedNode()-&gt;document(), currentPosition, position);
+        ASSERT(range);
+    }
+    return range;
+}
+
+VisiblePosition closestWordBoundaryForPosition(const VisiblePosition&amp; position)
+{
+    VisiblePosition result;
+
+    // move the the position at the end of the word
+    if (atBoundaryOfGranularity(position, LineGranularity, DirectionForward)) {
+        // Don't cross line boundaries.
+        result = position;
+    } else if (withinTextUnitOfGranularity(position, WordGranularity, DirectionForward)) {
+        // The position lies within a word.
+        RefPtr&lt;Range&gt; wordRange = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionForward);
+
+        result = wordRange-&gt;startPosition();
+        if (distanceBetweenPositions(position, result) &gt; 1)
+            result = wordRange-&gt;endPosition();
+    } else if (atBoundaryOfGranularity(position, WordGranularity, DirectionBackward)) {
+        // The position is at the end of a word.
+        result = position;
+    } else {
+        // The position is not within a word.
+        // Go to the next boundary.
+        result = positionOfNextBoundaryOfGranularity(position, WordGranularity, DirectionForward);
+
+        // If there is no such boundary we go to the end of the element.
+        if (result.isNull())
+            result = endOfEditableContent(position);
+    }
+    return result;
+}
+
+#endif
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleUnitsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleUnits.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleUnits.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/VisibleUnits.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;EditingBoundary.h&quot;
</span><span class="cx"> #include &quot;TextDirection.h&quot;
</span><ins>+#include &quot;VisibleSelection.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -95,6 +96,15 @@
</span><span class="cx"> VisiblePosition endOfEditableContent(const VisiblePosition&amp;);
</span><span class="cx"> bool isEndOfEditableOrNonEditableContent(const VisiblePosition&amp;);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool atBoundaryOfGranularity(const VisiblePosition&amp;, TextGranularity, SelectionDirection);
+bool withinTextUnitOfGranularity(const VisiblePosition&amp;, TextGranularity, SelectionDirection);
+VisiblePosition positionOfNextBoundaryOfGranularity(const VisiblePosition&amp;, TextGranularity, SelectionDirection);
+PassRefPtr&lt;Range&gt; enclosingTextUnitOfGranularity(const VisiblePosition&amp;, TextGranularity, SelectionDirection);
+int distanceBetweenPositions(const VisiblePosition&amp;, const VisiblePosition&amp;);
+PassRefPtr&lt;Range&gt; wordRangeFromPosition(const VisiblePosition&amp; position);
+VisiblePosition closestWordBoundaryForPosition(const VisiblePosition&amp; position);
+#endif
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // VisibleUnits_h
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingiosDictationCommandIOScpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp                                (rev 0)
+++ trunk/Source/WebCore/editing/ios/DictationCommandIOS.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;DictationCommandIOS.h&quot;
+
+#include &quot;Document.h&quot;
+#include &quot;DocumentMarkerController.h&quot;
+#include &quot;Element.h&quot;
+#include &quot;Position.h&quot;
+#include &quot;Range.h&quot;
+#include &quot;SmartReplace.h&quot;
+#include &quot;TextIterator.h&quot;
+#include &quot;VisibleUnits.h&quot;
+
+namespace WebCore {
+
+DictationCommandIOS::DictationCommandIOS(Document&amp; document, PassOwnPtr&lt;Vector&lt;Vector&lt;String&gt; &gt; &gt; dictationPhrases, RetainPtr&lt;id&gt; metadata)
+    : CompositeEditCommand(document)
+    , m_dictationPhrases(dictationPhrases)
+    , m_metadata(metadata)
+{
+}
+
+DictationCommandIOS::~DictationCommandIOS()
+{
+}
+
+void DictationCommandIOS::doApply()
+{
+    VisiblePosition insertionPosition(startingSelection().visibleStart());
+    
+    unsigned resultLength = 0;
+    size_t dictationPhraseCount = m_dictationPhrases-&gt;size();
+    for (size_t i = 0; i &lt; dictationPhraseCount; i++) {
+    
+        const String&amp; firstInterpretation = m_dictationPhrases-&gt;at(i)[0];
+        resultLength += firstInterpretation.length();
+        inputText(firstInterpretation, true);
+        
+        const Vector&lt;String&gt;&amp; interpretations = m_dictationPhrases-&gt;at(i);
+        
+        if (interpretations.size() &gt; 1)
+            document().markers().addDictationPhraseWithAlternativesMarker(endingSelection().toNormalizedRange().get(), interpretations);
+            
+        setEndingSelection(VisibleSelection(endingSelection().visibleEnd()));
+    }
+    
+    VisiblePosition afterResults(endingSelection().visibleEnd());
+    
+    Element* root = afterResults.rootEditableElement();
+    // FIXME: Add the result marker using a Position cached before results are inserted, instead of relying on TextIterators.
+    RefPtr&lt;Range&gt; rangeToEnd = Range::create(document(), createLegacyEditingPosition((Node *)root, 0), afterResults.deepEquivalent());
+    int endIndex = TextIterator::rangeLength(rangeToEnd.get(), true);
+    int startIndex = endIndex - resultLength;
+    
+    if (startIndex &gt;= 0) {
+        RefPtr&lt;Range&gt; resultRange = TextIterator::rangeFromLocationAndLength(document().documentElement(), startIndex, endIndex, true);
+        document().markers().addDictationResultMarker(resultRange.get(), m_metadata);
+    }
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingiosDictationCommandIOSh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/editing/ios/DictationCommandIOS.h (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ios/DictationCommandIOS.h                                (rev 0)
+++ trunk/Source/WebCore/editing/ios/DictationCommandIOS.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DictationCommandIOS_h
+#define DictationCommandIOS_h
+
+#include &quot;CompositeEditCommand.h&quot;
+
+#import &lt;wtf/RetainPtr.h&gt;
+
+typedef struct objc_object *id;
+
+namespace WebCore {
+
+class DictationCommandIOS : public CompositeEditCommand {
+public:
+    static PassRefPtr&lt;DictationCommandIOS&gt; create(Document&amp; document, PassOwnPtr&lt;Vector&lt;Vector&lt;String&gt; &gt; &gt; dictationPhrase, RetainPtr&lt;id&gt; metadata)
+    {
+        return adoptRef(new DictationCommandIOS(document, dictationPhrase, metadata));
+    }
+    
+    virtual ~DictationCommandIOS();
+private:
+    DictationCommandIOS(Document&amp; document, PassOwnPtr&lt;Vector&lt;Vector&lt;String&gt; &gt; &gt; dictationPhrase, RetainPtr&lt;id&gt; metadata);
+    
+    virtual void doApply();
+    virtual EditAction editingAction() const { return EditActionDictation; }
+    
+    OwnPtr&lt;Vector&lt;Vector&lt;String&gt; &gt; &gt; m_dictationPhrases;
+    RetainPtr&lt;id&gt; m_metadata;
+};
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingmacFrameSelectionMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/FrameSelectionMac.mm (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/FrameSelectionMac.mm        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/editing/mac/FrameSelectionMac.mm        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> static CGRect accessibilityConvertScreenRect(CGRect bounds)
</span><span class="cx"> {
</span><span class="cx">     NSArray *screens = [NSScreen screens];
</span><span class="lines">@@ -43,6 +44,7 @@
</span><span class="cx">     
</span><span class="cx">     return bounds;
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx">     
</span><span class="cx">     
</span><span class="cx"> void FrameSelection::notifyAccessibilityForSelectionChange()
</span><span class="lines">@@ -54,6 +56,7 @@
</span><span class="cx">             cache-&gt;postNotification(m_selection.start().deprecatedNode()-&gt;renderer(), AXObjectCache::AXSelectedTextChanged, TargetObservableParent);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     // if zoom feature is enabled, insertion point changes should update the zoom
</span><span class="cx">     if (!UAZoomEnabled() || !m_selection.isCaret())
</span><span class="cx">         return;
</span><span class="lines">@@ -76,6 +79,7 @@
</span><span class="cx">     cgViewRect = accessibilityConvertScreenRect(cgViewRect);
</span><span class="cx"> 
</span><span class="cx">     UAZoomChangeFocus(&amp;cgViewRect, &amp;cgCaretRect, kUAZoomFocusTypeInsertionPoint);
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiAsyncFileStreamcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/AsyncFileStream.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/AsyncFileStream.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/fileapi/AsyncFileStream.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -44,6 +44,10 @@
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static PassRefPtr&lt;FileThread&gt; createFileThread()
</span></span></pre></div>
<a id="trunkSourceWebCoregenerateexportfile"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/generate-export-file (0 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/generate-export-file                                (rev 0)
+++ trunk/Source/WebCore/generate-export-file        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -0,0 +1,155 @@
</span><ins>+#!/usr/bin/perl -w
+#
+# Copyright (C) 2007, 2008, 2009, 2010 Apple Inc.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use warnings;
+
+use File::Basename;
+use File::Find;
+use File::Temp qw(tempfile);
+use Getopt::Long;
+
+sub preprocessorFlags();
+sub preprocessorMacros($\@);
+sub process($$$);
+
+my $showHelp = 0;
+my $verbose = 1;
+
+my $result = GetOptions(
+    &quot;help&quot;        =&gt; \$showHelp,
+    &quot;verbose&quot;     =&gt; \$verbose,
+);
+if (!$result || $showHelp || scalar(@ARGV) != 2) {
+    print STDERR basename($0) . &quot; [-h|--help] [-v|--verbose] infile outfile\n&quot;;
+    exit 1;
+}
+
+my $inFile = shift @ARGV;
+my $outFile = shift @ARGV;
+
+my $arch;
+if ($outFile =~ /\.([^.]+)\.exp$/) {
+    $arch = $1;
+}
+die &quot;Unknown arch!&quot; if !defined($arch) || !$arch;
+
+print &quot;Processing $inFile for $arch...\n&quot; if $verbose;
+process($inFile, $outFile, $arch);
+
+exit 0;
+
+sub preprocessorFlags()
+{
+    my @features = split(/\s+/, $ENV{GCC_PREPROCESSOR_DEFINITIONS});
+    return @features;
+}
+
+sub preprocessorMacros($\@)
+{
+    my ($cc, $cc_args) = @_;
+
+    my @args = @$cc_args;
+
+    push(@args, map { &quot;-D&quot; . $_ } preprocessorFlags());
+
+    push(@args, qw(-include wtf/Platform.h -include wtf/Assertions.h));
+    # Set framework search paths to find &lt;JavaScriptCore/Platform.h&gt;.  Without these, cc
+    # finds /System/Library/Frameworks/JavaScriptCore.framework/PrivateHeaders/Platform.h
+    # or complains if you don't have that installed.  We search BUILT_PRODUCTS_DIR first
+    # for local developer builds, then the installation path for B&amp;I builds.
+    push(@args, &quot;-F&quot; . $ENV{BUILT_PRODUCTS_DIR}) if $ENV{BUILT_PRODUCTS_DIR};
+    push(@args, &quot;-I&quot; . $ENV{BUILT_PRODUCTS_DIR} . &quot;/usr/local/include&quot;) if $ENV{BUILT_PRODUCTS_DIR};
+    push(@args, &quot;-I&quot; . $ENV{BUILT_PRODUCTS_DIR} . $ENV{SDKROOT} . &quot;/usr/local/include&quot;) if $ENV{BUILT_PRODUCTS_DIR};
+    # Xcode 3.1 is required for SDKROOT to be set.
+    if (exists $ENV{SYSTEM_LIBRARY_DIR} &amp;&amp; $ENV{SYSTEM_LIBRARY_DIR}) {
+        my $frameworkSearchPath = $ENV{SDKROOT} . $ENV{SYSTEM_LIBRARY_DIR};
+        if ($ENV{PLATFORM_NAME} eq &quot;iphoneos&quot; || $ENV{PLATFORM_NAME} eq &quot;iphonesimulator&quot;) {
+            $frameworkSearchPath .= &quot;/PrivateFrameworks&quot;;
+        } else {
+            $frameworkSearchPath .= &quot;/Frameworks&quot;;
+        }
+        push(@args, &quot;-F&quot; . $frameworkSearchPath);
+    }
+
+    push(@args, &quot;-I&quot; . $ENV{BUILT_PRODUCTS_DIR} . $ENV{SDKROOT} . &quot;/usr/local/include&quot;) if $ENV{BUILT_PRODUCTS_DIR};
+    push(@args, &quot;-I&quot; . $ENV{SDKROOT} . &quot;/usr/local/include&quot;);
+
+    # Print out #define lines for all macros.
+    push(@args, qw(-dM /dev/null));
+
+    print join(&quot; &quot;, $cc, @args), &quot;\n&quot; if $verbose;
+    local $/ = undef;
+    open(CC, &quot;-|&quot;, $cc, @args) or die &quot;$!&quot;;
+    my $macros = &lt;CC&gt;;
+    close(CC);
+
+    return $macros;
+}
+
+sub process($$$)
+{
+    my ($inFile, $outFile, $arch) = @_;
+
+    if (!exists $ENV{SDKROOT} or !$ENV{SDKROOT}) {
+        die &quot;SDKROOT environment variable not found&quot;;
+    }
+
+    chomp (my $cc = `xcrun -find cc`);
+
+    # Run cpp (-E) but don't print the line number info (-P).
+    my @args = qw(-E -P);
+
+    # Provide a default source type since *.in isn't a known file extension.
+    push(@args, qw(-std=gnu++11 -x c++));
+
+    # Make sure cc knows which SDK we're using.
+    push(@args, &quot;-isysroot&quot;, $ENV{SDKROOT});
+
+    push(@args, &quot;-arch&quot;, $arch);
+
+    my $macros = preprocessorMacros($cc, @args);
+
+    push(@args, &quot;-o&quot;, $outFile);
+    push(@args, &quot;-&quot;);
+
+    print join(&quot; &quot;, $cc, @args), &quot;\n&quot; if $verbose;
+    open(CC, &quot;|-&quot;, $cc, @args) or die &quot;$!&quot;;
+    open(IN, &quot;&lt;&quot;, $inFile) or die &quot;$!&quot;;
+
+    print CC $macros;
+    while (my $line = &lt;IN&gt;) {
+        next if ($line =~ /^#/ &amp;&amp; $line !~ /^#\s*(if|ifdef|ifndef|else|elif|endif)/);
+        print CC $line;
+    }
+
+    close(IN);
+    close(CC);
+
+    my $fileCount = chmod 0644, $outFile;
+    if ($fileCount != 1) {
+        die &quot;Could not chmod 0644 $outFile: $!&quot;;
+    }
+}
+
</ins><span class="cx">Property changes on: trunk/Source/WebCore/generate-export-file
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="trunkSourceWebCoreinspectorInspectorCountersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCounters.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCounters.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/inspector/InspectorCounters.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -35,7 +35,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorFrontendHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorFrontendHost.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -77,8 +77,10 @@
</span><span class="cx">     void append(const String&amp; url, const String&amp; content);
</span><span class="cx">     void close(const String&amp; url);
</span><span class="cx"> 
</span><ins>+#if ENABLE(CONTEXT_MENUS)
</ins><span class="cx">     // Called from [Custom] implementations.
</span><span class="cx">     void showContextMenu(Event*, const Vector&lt;ContextMenuItem&gt;&amp; items);
</span><ins>+#endif
</ins><span class="cx">     void sendMessageToBackend(const String&amp; message);
</span><span class="cx">     void dispatchEventAsContextMenuEvent(Event*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoremakeexportfilegenerator"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/make-export-file-generator (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/make-export-file-generator        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/make-export-file-generator        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> require 'erb'
</span><span class="cx"> 
</span><span class="cx"> def line_for_output line
</span><del>-  return line.chomp if line =~ /#/
</del><ins>+  return line.chomp if line =~ /^#\s*(if|ifdef|ifndef|else|elif|endif)/
</ins><span class="cx">   &quot;    validateAndPrint(\&quot;#{line.chomp}\&quot;);&quot;
</span><span class="cx"> end
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginPackageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/PluginPackage.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginPackage.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/plugins/PluginPackage.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -30,7 +30,9 @@
</span><span class="cx"> #include &quot;FileSystem.h&quot;
</span><span class="cx"> #include &quot;PluginQuirkSet.h&quot;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><ins>+#if ENABLE(NETSCAPE_PLUGIN_API)
</ins><span class="cx"> #include &quot;npruntime_internal.h&quot;
</span><ins>+#endif
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="lines">@@ -70,7 +72,9 @@
</span><span class="cx">         bool isEnabled() const { return m_isEnabled; }
</span><span class="cx">         void setEnabled(bool);
</span><span class="cx"> 
</span><ins>+#if ENABLE(NETSCAPE_PLUGIN_API)
</ins><span class="cx">         const NPPluginFuncs* pluginFuncs() const { return &amp;m_pluginFuncs; }
</span><ins>+#endif
</ins><span class="cx">         int compareFileVersion(const PlatformModuleVersion&amp;) const;
</span><span class="cx">         int compare(const PluginPackage&amp;) const;
</span><span class="cx">         PluginQuirkSet quirks() const { return m_quirks; }
</span><span class="lines">@@ -109,9 +113,11 @@
</span><span class="cx">         PlatformModule m_module;
</span><span class="cx">         time_t m_lastModified;
</span><span class="cx"> 
</span><ins>+#if ENABLE(NETSCAPE_PLUGIN_API)
</ins><span class="cx">         NPP_ShutdownProcPtr m_NPP_Shutdown;
</span><span class="cx">         NPPluginFuncs m_pluginFuncs;
</span><span class="cx">         NPNetscapeFuncs m_browserFuncs;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">         void freeLibrarySoon();
</span><span class="cx">         void freeLibraryTimerFired(Timer&lt;PluginPackage&gt;*);
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsPluginViewBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/PluginViewBase.h (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/PluginViewBase.h        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/plugins/PluginViewBase.h        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -46,7 +46,12 @@
</span><span class="cx"> public:
</span><span class="cx"> #if USE(ACCELERATED_COMPOSITING)
</span><span class="cx">     virtual PlatformLayer* platformLayer() const { return 0; }
</span><ins>+#if PLATFORM(IOS)
+    virtual bool willProvidePluginLayer() const { return false; }
+    virtual void attachPluginLayer() { }
+    virtual void detachPluginLayer() { }
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     virtual JSC::JSObject* scriptObject(JSC::JSGlobalObject*) { return 0; }
</span><span class="cx">     virtual void storageBlockingStateChanged() { }
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveForDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveForDocument.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/style/StyleResolveForDocument.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -75,6 +75,10 @@
</span><span class="cx">     }
</span><span class="cx">     // This overrides any -webkit-user-modify inherited from the parent iframe.
</span><span class="cx">     documentStyle.get().setUserModify(document.inDesignMode() ? READ_WRITE : READ_ONLY);
</span><ins>+#if PLATFORM(IOS)
+    if (document.inDesignMode())
+        documentStyle.get().setTextSizeAdjust(TextSizeAdjustment(NoTextSizeAdjustment));
+#endif
</ins><span class="cx"> 
</span><span class="cx">     Element* docElement = document.documentElement();
</span><span class="cx">     RenderObject* docElementRenderer = docElement ? docElement-&gt;renderer() : 0;
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveTree.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveTree.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/style/StyleResolveTree.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -769,17 +769,15 @@
</span><span class="cx">     if (!renderer)
</span><span class="cx">         return VISIBLE;
</span><span class="cx"> 
</span><del>-    RenderStyle* style = renderer-&gt;style();
-    if (!style)
-        return VISIBLE;
</del><ins>+    RenderStyle&amp; style = renderer-&gt;style();
</ins><span class="cx"> 
</span><del>-    Length width(style-&gt;width());
-    Length height(style-&gt;height());
</del><ins>+    Length width(style.width());
+    Length height(style.height());
</ins><span class="cx">     if ((width.isFixed() &amp;&amp; width.value() &lt;= 0) || (height.isFixed() &amp;&amp; height.value() &lt;= 0))
</span><span class="cx">         return HIDDEN;
</span><span class="cx"> 
</span><del>-    Length top(style-&gt;top());
-    Length left(style-&gt;left());
</del><ins>+    Length top(style.top());
+    Length left(style.left());
</ins><span class="cx">     if (left.isFixed() &amp;&amp; width.isFixed() &amp;&amp; -left.value() &gt;= width.value())
</span><span class="cx">         return HIDDEN;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/testing/Internals.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -1968,7 +1968,7 @@
</span><span class="cx">     frameView-&gt;setTracksRepaints(false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if USE(LAZY_NATIVE_CURSOR)
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; USE(LAZY_NATIVE_CURSOR)
</ins><span class="cx"> static const char* cursorTypeToString(Cursor::Type cursorType)
</span><span class="cx"> {
</span><span class="cx">     switch (cursorType) {
</span><span class="lines">@@ -2031,9 +2031,9 @@
</span><span class="cx">         return String();
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS) &amp;&amp; USE(LAZY_NATIVE_CURSOR)
</ins><span class="cx">     Cursor cursor = document-&gt;frame()-&gt;eventHandler().currentMouseCursor();
</span><span class="cx"> 
</span><del>-#if USE(LAZY_NATIVE_CURSOR)
</del><span class="cx">     StringBuilder result;
</span><span class="cx">     result.append(&quot;type=&quot;);
</span><span class="cx">     result.append(cursorTypeToString(cursor.type()));
</span><span class="lines">@@ -2132,8 +2132,12 @@
</span><span class="cx">     if (!renderer-&gt;isMenuList())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     RenderMenuList* menuList = toRenderMenuList(renderer);
</span><span class="cx">     return menuList-&gt;popupIsVisible();
</span><ins>+#else
+    return false;
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String Internals::captionsStyleSheetOverride(ExceptionCode&amp; ec)
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerThread.cpp (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerThread.cpp        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebCore/workers/WorkerThread.cpp        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -43,6 +43,10 @@
</span><span class="cx"> #include &quot;DatabaseTask.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static Mutex&amp; threadSetMutex()
</span><span class="lines">@@ -141,6 +145,11 @@
</span><span class="cx"> 
</span><span class="cx"> void WorkerThread::workerThread()
</span><span class="cx"> {
</span><ins>+    // Propagate the mainThread's fenv to workers.
+#if PLATFORM(IOS)
+    fesetenv(&amp;mainThreadFEnv);
+#endif
+
</ins><span class="cx">     {
</span><span class="cx">         MutexLocker lock(m_threadCreationMutex);
</span><span class="cx">         m_workerGlobalScope = createWorkerGlobalScope(m_startupData-&gt;m_scriptURL, m_startupData-&gt;m_userAgent, std::move(m_startupData-&gt;m_groupSettings), m_startupData-&gt;m_contentSecurityPolicy, m_startupData-&gt;m_contentSecurityPolicyType, m_startupData-&gt;m_topOrigin.release());
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebKit/ChangeLog        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2014-01-10  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] Upstream WebCore and Tools miscellaneous changes
+        https://bugs.webkit.org/show_bug.cgi?id=126698
+
+        Reviewed by David Kilzer.
+
+        * WebKit.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-01-09  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove the WebKit layer of the Blackberry port
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -2137,7 +2137,7 @@
</span><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                         shellPath = /bin/sh;
</span><del>-                        shellScript = &quot;exec ${SRCROOT}/mac/postprocess-headers.sh&quot;;
</del><ins>+                        shellScript = &quot;postProcessInDirectory() {\n    cd \&quot;$1\&quot;\n\n    if [[ ${PLATFORM_NAME} == iphoneos ]]; then\n        local unifdefOptions=\&quot;-DTARGET_OS_EMBEDDED=1 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=0 -DENABLE_IOS_TOUCH_EVENTS=1 -DENABLE_IOS_GESTURE_EVENTS=1\&quot;;\n    elif [[ ${PLATFORM_NAME} == iphonesimulator ]]; then\n        local unifdefOptions=\&quot;-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=1 -DENABLE_IOS_TOUCH_EVENTS=1 -DENABLE_IOS_GESTURE_EVENTS=1\&quot;;\n    else\n        local unifdefOptions=\&quot;-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=0 -DTARGET_IPHONE_SIMULATOR=0 -DENABLE_IOS_TOUCH_EVENTS=0 -DENABLE_IOS_GESTURE_EVENTS=0\&quot;;\n    fi\n\n    for header in $(find . -name '*.h' -type f); do\n        unifdef -B ${unifdefOptions} -o ${header}.unifdef ${header}\n        case $? in\n        0)\n            rm ${header}.unifdef\n            ;;\n        1)\n            mv ${header}{.unifdef,}\n            ;;\n        *)\n            exit 1\n            ;;\n        esac\n    done\n}\n\npostProcessInDirectory \&quot;${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\&quot;\npostProcessInDirectory \&quot;${TARGET_BUILD_DIR}/${PRIVATE_HEADERS_FOLDER_PATH}\&quot;&quot;;
</ins><span class="cx">                 };
</span><span class="cx">                 A55DEAA516703F9F003DB841 /* Check For Inappropriate Macros in External Headers */ = {
</span><span class="cx">                         isa = PBXShellScriptBuildPhase;
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2014-01-10  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] Upstream WebCore and Tools miscellaneous changes
+        https://bugs.webkit.org/show_bug.cgi?id=126698
+
+        Reviewed by David Kilzer.
+
+        * MigrateHeaders.make:
+
</ins><span class="cx"> 2014-01-08  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add WTF::StringView and use it for grammar checking
</span></span></pre></div>
<a id="trunkSourceWebKitmacMigrateHeadersmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/MigrateHeaders.make (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/MigrateHeaders.make        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Source/WebKit/mac/MigrateHeaders.make        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -190,10 +190,52 @@
</span><span class="cx">     $(PUBLIC_HEADERS_DIR)/nptypes.h \
</span><span class="cx"> #
</span><span class="cx"> 
</span><ins>+ifeq ($(findstring WTF_PLATFORM_IOS,$(FEATURE_DEFINES)), WTF_PLATFORM_IOS)
+
+all : \
+    $(PUBLIC_HEADERS_DIR)/DOMGestureEvent.h \
+    $(PRIVATE_HEADERS_DIR)/DOMHTMLTextAreaElementPrivate.h \
+    $(PUBLIC_HEADERS_DIR)/DOMTouch.h \
+    $(PUBLIC_HEADERS_DIR)/DOMTouchEvent.h \
+    $(PUBLIC_HEADERS_DIR)/DOMTouchList.h \
+    $(PRIVATE_HEADERS_DIR)/DOMUIKitExtensions.h \
+    $(PRIVATE_HEADERS_DIR)/KeyEventCodesIOS.h \
+    $(PRIVATE_HEADERS_DIR)/MediaPlayerProxy.h \
+    $(PRIVATE_HEADERS_DIR)/PluginData.h \
+    $(PRIVATE_HEADERS_DIR)/ScrollTypes.h \
+    $(PRIVATE_HEADERS_DIR)/SystemMemory.h \
+    $(PRIVATE_HEADERS_DIR)/WAKAppKitStubs.h \
+    $(PRIVATE_HEADERS_DIR)/WAKResponder.h \
+    $(PRIVATE_HEADERS_DIR)/WAKScrollView.h \
+    $(PRIVATE_HEADERS_DIR)/WAKView.h \
+    $(PRIVATE_HEADERS_DIR)/WAKViewPrivate.h \
+    $(PRIVATE_HEADERS_DIR)/WAKWindow.h \
+    $(PRIVATE_HEADERS_DIR)/WKContentObservation.h \
+    $(PRIVATE_HEADERS_DIR)/WKGraphics.h \
+    $(PRIVATE_HEADERS_DIR)/WKTypes.h \
+    $(PRIVATE_HEADERS_DIR)/WKUtilities.h \
+    $(PRIVATE_HEADERS_DIR)/WKView.h \
+    $(PRIVATE_HEADERS_DIR)/WebAutocapitalize.h \
+    $(PRIVATE_HEADERS_DIR)/WebCoreFrameView.h \
+    $(PRIVATE_HEADERS_DIR)/WebCoreThread.h \
+    $(PRIVATE_HEADERS_DIR)/WebCoreThreadMessage.h \
+    $(PRIVATE_HEADERS_DIR)/WebCoreThreadRun.h \
+    $(PRIVATE_HEADERS_DIR)/WebEvent.h \
+    $(PRIVATE_HEADERS_DIR)/WebEventRegion.h \
+
+endif
+
</ins><span class="cx"> REPLACE_RULES = -e s/\&lt;WebCore/\&lt;WebKit/ -e s/DOMDOMImplementation/DOMImplementation/
</span><span class="cx"> HEADER_MIGRATE_CMD = sed $(REPLACE_RULES) $&lt; &gt; $@
</span><span class="cx"> PUBLIC_HEADER_CHECK_CMD = @if grep -q &quot;AVAILABLE.*TBD&quot; &quot;$&lt;&quot;; then line=$$(awk &quot;/AVAILABLE.*TBD/ { print FNR; exit }&quot; &quot;$&lt;&quot; ); echo &quot;$&lt;:$$line: error: A class within a public header has unspecified availability.&quot;; false; fi
</span><span class="cx"> 
</span><ins>+ifeq ($(findstring WTF_PLATFORM_IOS,$(FEATURE_DEFINES)), WTF_PLATFORM_IOS)
+
+$(PRIVATE_HEADERS_DIR)/WAKScrollView.h : WAKScrollView.h MigrateHeaders.make
+    cat $&lt; $(PROCESS_HEADER_FOR_MACOSX_TARGET_CMD) &gt; $@
+
+endif
+
</ins><span class="cx"> $(PUBLIC_HEADERS_DIR)/DOM% : DOMDOM% MigrateHeaders.make
</span><span class="cx">         $(PUBLIC_HEADER_CHECK_CMD)
</span><span class="cx">         $(HEADER_MIGRATE_CMD)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Tools/ChangeLog        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-01-10  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] Upstream WebCore and Tools miscellaneous changes
+        https://bugs.webkit.org/show_bug.cgi?id=126698
+
+        Reviewed by David Kilzer.
+
+        * Scripts/check-for-inappropriate-objc-class-names:
+        * Scripts/check-for-webkit-framework-include-consistency:
+
</ins><span class="cx"> 2014-01-09  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] Promote WKBackForwardList{,Item}.h to public
</span></span></pre></div>
<a id="trunkToolsScriptscheckforinappropriateobjcclassnames"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/check-for-inappropriate-objc-class-names (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/check-for-inappropriate-objc-class-names        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Tools/Scripts/check-for-inappropriate-objc-class-names        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -78,6 +78,34 @@
</span><span class="cx">     }
</span><span class="cx">     close NM;
</span><span class="cx"> 
</span><ins>+    # begin PLATFORM(IOS)
+    # On iOS put exceptions in place for existing bad names. Future bad names will
+    # be caught and should be fixed immediately. Fixing these is covered by:
+    # &lt;rdar://problem/10365008&gt; Fix Inappropriate Objective-C Class Names found by build phase
+    my %exceptions = (
+        # WebCore
+        &quot;WKQuadObject&quot; =&gt; 1,
+        &quot;TileCacheTombstone&quot; =&gt; 1,
+        &quot;TileHostLayer&quot; =&gt; 1,
+        &quot;TileLayer&quot; =&gt; 1,
+        &quot;WAKResponder&quot; =&gt; 1,
+        &quot;NSCursor&quot; =&gt; 1,
+        &quot;WAKClipView&quot; =&gt; 1,
+        &quot;WAKScrollView&quot; =&gt; 1,
+        &quot;WAKView&quot; =&gt; 1,
+        &quot;WAKWindow&quot; =&gt; 1,
+        # WebKit2
+        &quot;UIWKRemoteView&quot; =&gt; 1,
+        &quot;UIWKView&quot; =&gt; 1,
+        &quot;UIWKViewData&quot; =&gt; 1
+    );
+    my @realBadNames;
+    for my $className (@badNames) {
+        push(@realBadNames, $className) unless exists($exceptions{$className});
+    }
+    @badNames = @realBadNames;
+    # end PLATFORM(IOS)
+
</ins><span class="cx">     if (@badNames) {
</span><span class="cx"> 
</span><span class="cx">         my $shortName = $executablePath;
</span></span></pre></div>
<a id="trunkToolsScriptscheckforwebkitframeworkincludeconsistency"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/check-for-webkit-framework-include-consistency (161637 => 161638)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/check-for-webkit-framework-include-consistency        2014-01-10 16:55:05 UTC (rev 161637)
+++ trunk/Tools/Scripts/check-for-webkit-framework-include-consistency        2014-01-10 17:06:52 UTC (rev 161638)
</span><span class="lines">@@ -74,6 +74,10 @@
</span><span class="cx">     return
</span><span class="cx">   end
</span><span class="cx"> 
</span><ins>+  # iOS we want to keep the WAK headers private, even if a public header includes them,
+  # so we are going to not show warnings for WAK headers.
+  return if framework == &quot;WebKit&quot; and included_header_name =~ /^WAK/
+
</ins><span class="cx">   header_type = $HEADER_NAMES_TO_TYPE[included_header_name]
</span><span class="cx"> 
</span><span class="cx">   if not header_type
</span></span></pre>
</div>
</div>

</body>
</html>