Changeset 161638 in webkit
- Timestamp:
- Jan 10, 2014, 9:06:52 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 27 added
- 107 edited
- 2 copied
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Configurations/Base.xcconfig (modified) (4 diffs)
-
Source/WebCore/Configurations/WebCore.xcconfig (modified) (4 diffs)
-
Source/WebCore/Configurations/WebCoreTestSupport.xcconfig (modified) (1 diff)
-
Source/WebCore/Configurations/iOS.xcconfig (added)
-
Source/WebCore/DerivedSources.make (modified) (6 diffs)
-
Source/WebCore/English.lproj/Localizable.strings (modified) (3 diffs)
-
Source/WebCore/Modules/airplay (added)
-
Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp (copied) (copied from trunk/Source/WebCore/editing/TextAffinity.h ) (2 diffs)
-
Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h (added)
-
Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl (copied) (copied from trunk/Source/WebCore/editing/DeleteButton.h ) (3 diffs)
-
Source/WebCore/Modules/geolocation/Geolocation.cpp (modified) (7 diffs)
-
Source/WebCore/Modules/geolocation/Geolocation.h (modified) (2 diffs)
-
Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp (modified) (1 diff)
-
Source/WebCore/Modules/geolocation/NavigatorGeolocation.h (modified) (1 diff)
-
Source/WebCore/Modules/speech/SpeechSynthesis.cpp (modified) (3 diffs)
-
Source/WebCore/Modules/speech/SpeechSynthesis.h (modified) (2 diffs)
-
Source/WebCore/Modules/webaudio/AudioContext.cpp (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/AudioContext.h (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp (modified) (1 diff)
-
Source/WebCore/Modules/webdatabase/Database.cpp (modified) (1 diff)
-
Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp (modified) (3 diffs)
-
Source/WebCore/Modules/webdatabase/DatabaseContext.cpp (modified) (3 diffs)
-
Source/WebCore/Modules/webdatabase/DatabaseContext.h (modified) (3 diffs)
-
Source/WebCore/Modules/webdatabase/DatabaseManagerClient.h (modified) (1 diff)
-
Source/WebCore/Modules/webdatabase/DatabaseTask.cpp (modified) (2 diffs)
-
Source/WebCore/Modules/webdatabase/DatabaseTask.h (modified) (5 diffs)
-
Source/WebCore/Modules/webdatabase/DatabaseThread.cpp (modified) (4 diffs)
-
Source/WebCore/Modules/webdatabase/DatabaseThread.h (modified) (2 diffs)
-
Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp (modified) (8 diffs)
-
Source/WebCore/Modules/webdatabase/DatabaseTracker.h (modified) (1 diff)
-
Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp (modified) (1 diff)
-
Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h (modified) (1 diff)
-
Source/WebCore/Resources/DictationPhraseWithAlternativesDot.png (added)
-
Source/WebCore/Resources/DictationPhraseWithAlternativesDot@2x.png (added)
-
Source/WebCore/Resources/SpellingDot.png (added)
-
Source/WebCore/Resources/SpellingDot@2x.png (added)
-
Source/WebCore/Resources/decrementArrow.tiff (added)
-
Source/WebCore/Resources/hScrollControl_left.png (added)
-
Source/WebCore/Resources/hScrollControl_middle.png (added)
-
Source/WebCore/Resources/hScrollControl_right.png (added)
-
Source/WebCore/Resources/incrementArrow.tiff (added)
-
Source/WebCore/Resources/markedLeft.png (added)
-
Source/WebCore/Resources/markedMiddle.png (added)
-
Source/WebCore/Resources/markedRight.png (added)
-
Source/WebCore/Resources/vScrollControl_bottom.png (added)
-
Source/WebCore/Resources/vScrollControl_middle.png (added)
-
Source/WebCore/Resources/vScrollControl_top.png (added)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (34 diffs)
-
Source/WebCore/bindings/js/GCController.cpp (modified) (2 diffs)
-
Source/WebCore/bindings/js/GCController.h (modified) (1 diff)
-
Source/WebCore/bindings/js/JSCallbackData.h (modified) (1 diff)
-
Source/WebCore/bindings/js/JSDOMWindowBase.cpp (modified) (5 diffs)
-
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (modified) (2 diffs)
-
Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/js/JSMainThreadExecState.h (modified) (1 diff)
-
Source/WebCore/bindings/js/JSTouchCustom.cpp (modified) (2 diffs)
-
Source/WebCore/bindings/js/JSTouchListCustom.cpp (modified) (2 diffs)
-
Source/WebCore/bindings/js/PageScriptDebugServer.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/ScriptController.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/ScriptDebugServer.cpp (modified) (4 diffs)
-
Source/WebCore/bindings/js/ios (added)
-
Source/WebCore/bindings/js/ios/TouchConstructors.cpp (added)
-
Source/WebCore/bindings/objc/DOM.mm (modified) (16 diffs)
-
Source/WebCore/bindings/objc/DOMEvents.h (modified) (1 diff)
-
Source/WebCore/bindings/objc/DOMEvents.mm (modified) (2 diffs)
-
Source/WebCore/bindings/objc/DOMExtensions.h (modified) (2 diffs)
-
Source/WebCore/bindings/objc/DOMHTML.mm (modified) (4 diffs)
-
Source/WebCore/bindings/objc/DOMInternal.h (modified) (1 diff)
-
Source/WebCore/bindings/objc/DOMInternal.mm (modified) (4 diffs)
-
Source/WebCore/bindings/objc/DOMPrivate.h (modified) (6 diffs)
-
Source/WebCore/bindings/objc/DOMUIKitExtensions.h (added)
-
Source/WebCore/bindings/objc/DOMUIKitExtensions.mm (added)
-
Source/WebCore/bindings/objc/PublicDOMInterfaces.h (modified) (1 diff)
-
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (modified) (11 diffs)
-
Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm (modified) (28 diffs)
-
Source/WebCore/bindings/scripts/IDLAttributes.txt (modified) (1 diff)
-
Source/WebCore/bindings/scripts/preprocessor.pm (modified) (1 diff)
-
Source/WebCore/bridge/objc/objc_class.mm (modified) (1 diff)
-
Source/WebCore/bridge/objc/objc_instance.mm (modified) (1 diff)
-
Source/WebCore/config.h (modified) (2 diffs)
-
Source/WebCore/dom/Document.cpp (modified) (1 diff)
-
Source/WebCore/dom/Document.h (modified) (2 diffs)
-
Source/WebCore/dom/Document.idl (modified) (1 diff)
-
Source/WebCore/dom/ios (added)
-
Source/WebCore/dom/ios/TouchEvents.cpp (added)
-
Source/WebCore/editing/ApplyStyleCommand.cpp (modified) (1 diff)
-
Source/WebCore/editing/CompositeEditCommand.cpp (modified) (6 diffs)
-
Source/WebCore/editing/CompositeEditCommand.h (modified) (1 diff)
-
Source/WebCore/editing/DeleteButton.h (modified) (1 diff)
-
Source/WebCore/editing/DeleteButtonController.cpp (modified) (2 diffs)
-
Source/WebCore/editing/DeleteSelectionCommand.cpp (modified) (1 diff)
-
Source/WebCore/editing/DeleteSelectionCommand.h (modified) (1 diff)
-
Source/WebCore/editing/EditAction.h (modified) (1 diff)
-
Source/WebCore/editing/EditCommand.h (modified) (1 diff)
-
Source/WebCore/editing/EditingStyle.cpp (modified) (1 diff)
-
Source/WebCore/editing/Editor.cpp (modified) (29 diffs)
-
Source/WebCore/editing/Editor.h (modified) (5 diffs)
-
Source/WebCore/editing/EditorCommand.cpp (modified) (5 diffs)
-
Source/WebCore/editing/FrameSelection.cpp (modified) (21 diffs)
-
Source/WebCore/editing/FrameSelection.h (modified) (3 diffs)
-
Source/WebCore/editing/InsertIntoTextNodeCommand.cpp (modified) (2 diffs)
-
Source/WebCore/editing/InsertIntoTextNodeCommand.h (modified) (1 diff)
-
Source/WebCore/editing/InsertTextCommand.h (modified) (1 diff)
-
Source/WebCore/editing/ReplaceSelectionCommand.cpp (modified) (1 diff)
-
Source/WebCore/editing/TextAffinity.h (modified) (1 diff)
-
Source/WebCore/editing/TextCheckingHelper.cpp (modified) (4 diffs)
-
Source/WebCore/editing/TextGranularity.h (modified) (1 diff)
-
Source/WebCore/editing/TextIterator.cpp (modified) (1 diff)
-
Source/WebCore/editing/TypingCommand.cpp (modified) (7 diffs)
-
Source/WebCore/editing/TypingCommand.h (modified) (2 diffs)
-
Source/WebCore/editing/VisiblePosition.h (modified) (1 diff)
-
Source/WebCore/editing/VisibleSelection.cpp (modified) (3 diffs)
-
Source/WebCore/editing/VisibleUnits.cpp (modified) (5 diffs)
-
Source/WebCore/editing/VisibleUnits.h (modified) (2 diffs)
-
Source/WebCore/editing/ios/DictationCommandIOS.cpp (added)
-
Source/WebCore/editing/ios/DictationCommandIOS.h (added)
-
Source/WebCore/editing/mac/FrameSelectionMac.mm (modified) (4 diffs)
-
Source/WebCore/fileapi/AsyncFileStream.cpp (modified) (1 diff)
-
Source/WebCore/generate-export-file (added)
-
Source/WebCore/inspector/InspectorCounters.h (modified) (1 diff)
-
Source/WebCore/inspector/InspectorFrontendHost.h (modified) (1 diff)
-
Source/WebCore/make-export-file-generator (modified) (1 diff)
-
Source/WebCore/plugins/PluginPackage.h (modified) (3 diffs)
-
Source/WebCore/plugins/PluginViewBase.h (modified) (1 diff)
-
Source/WebCore/style/StyleResolveForDocument.cpp (modified) (1 diff)
-
Source/WebCore/style/StyleResolveTree.cpp (modified) (1 diff)
-
Source/WebCore/testing/Internals.cpp (modified) (3 diffs)
-
Source/WebCore/workers/WorkerThread.cpp (modified) (2 diffs)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/WebKit.xcodeproj/project.pbxproj (modified) (1 diff)
-
Source/WebKit/mac/ChangeLog (modified) (1 diff)
-
Source/WebKit/mac/MigrateHeaders.make (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/Scripts/check-for-inappropriate-objc-class-names (modified) (1 diff)
-
Tools/Scripts/check-for-webkit-framework-include-consistency (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r161637 r161638 1 2014-01-10 Daniel Bates <dabates@apple.com> 2 3 [iOS] Upstream WebCore and Tools miscellaneous changes 4 https://bugs.webkit.org/show_bug.cgi?id=126698 5 6 Reviewed by David Kilzer. 7 8 * Configurations/Base.xcconfig: 9 * Configurations/WebCore.xcconfig: 10 * Configurations/WebCoreTestSupport.xcconfig: 11 * Configurations/iOS.xcconfig: Added. 12 * DerivedSources.make: 13 * English.lproj/Localizable.strings: 14 * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp: Copied from Source/WebCore/editing/TextAffinity.h. 15 (WebCore::stringForPlaybackTargetAvailability): 16 (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent): 17 * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h: Added. 18 (WebCore::WebKitPlaybackTargetAvailabilityEventInit::WebKitPlaybackTargetAvailabilityEventInit): 19 (WebCore::WebKitPlaybackTargetAvailabilityEvent::~WebKitPlaybackTargetAvailabilityEvent): 20 (WebCore::WebKitPlaybackTargetAvailabilityEvent::create): 21 (WebCore::WebKitPlaybackTargetAvailabilityEvent::availability): 22 * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl: Copied from Source/WebCore/editing/DeleteButton.h. 23 * Modules/geolocation/Geolocation.cpp: 24 (WebCore::Geolocation::Geolocation): 25 (WebCore::Geolocation::canSuspend): 26 (WebCore::Geolocation::suspend): 27 (WebCore::Geolocation::resume): 28 (WebCore::Geolocation::resumeTimerFired): 29 (WebCore::Geolocation::resetAllGeolocationPermission): 30 (WebCore::Geolocation::stop): 31 (WebCore::Geolocation::setIsAllowed): 32 (WebCore::Geolocation::positionChanged): 33 (WebCore::Geolocation::setError): 34 * Modules/geolocation/Geolocation.h: 35 * Modules/geolocation/NavigatorGeolocation.cpp: 36 (WebCore::NavigatorGeolocation::resetAllGeolocationPermission): 37 * Modules/geolocation/NavigatorGeolocation.h: 38 * Modules/speech/SpeechSynthesis.cpp: 39 (WebCore::SpeechSynthesis::SpeechSynthesis): 40 (WebCore::SpeechSynthesis::speak): 41 * Modules/speech/SpeechSynthesis.h: 42 (WebCore::SpeechSynthesis::userGestureRequiredForSpeechStart): 43 (WebCore::SpeechSynthesis::removeBehaviorRestriction): 44 * Modules/webaudio/AudioContext.cpp: 45 * Modules/webaudio/AudioContext.h: 46 * Modules/webaudio/AudioScheduledSourceNode.cpp: 47 * Modules/webdatabase/Database.cpp: 48 * Modules/webdatabase/DatabaseBackendBase.cpp: 49 (WebCore::DatabaseBackendBase::performOpenAndVerify): 50 (WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded): 51 * Modules/webdatabase/DatabaseContext.cpp: 52 (WebCore::DatabaseContext::DatabaseContext): 53 (WebCore::DatabaseContext::databaseThread): 54 (WebCore::DatabaseContext::setPaused): 55 * Modules/webdatabase/DatabaseContext.h: 56 * Modules/webdatabase/DatabaseManagerClient.h: 57 * Modules/webdatabase/DatabaseTask.cpp: 58 (WebCore::DatabaseTask::performTask): 59 (WebCore::Database::DatabaseTransactionTask::shouldPerformWhilePaused): 60 * Modules/webdatabase/DatabaseTask.h: 61 * Modules/webdatabase/DatabaseThread.cpp: 62 (WebCore::DatabaseThread::DatabaseThread): 63 (WebCore::DatabaseThread::requestTermination): 64 (WebCore::DatabaseUnpauseTask::create): 65 (WebCore::DatabaseUnpauseTask::shouldPerformWhilePaused): 66 (WebCore::DatabaseUnpauseTask::DatabaseUnpauseTask): 67 (WebCore::DatabaseUnpauseTask::doPerformTask): 68 (WebCore::DatabaseUnpauseTask::debugTaskName): 69 (WebCore::DatabaseThread::setPaused): 70 (WebCore::DatabaseThread::handlePausedQueue): 71 (WebCore::DatabaseThread::databaseThread): 72 * Modules/webdatabase/DatabaseThread.h: 73 * Modules/webdatabase/DatabaseTracker.cpp: 74 (WebCore::DatabaseTracker::setQuota): 75 (WebCore::DatabaseTracker::deleteOrigin): 76 (WebCore::DatabaseTracker::deleteDatabase): 77 (WebCore::DatabaseTracker::deleteDatabaseFile): 78 (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): 79 (WebCore::isZeroByteFile): 80 (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty): 81 (WebCore::DatabaseTracker::openDatabaseMutex): 82 (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled): 83 (WebCore::DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish): 84 (WebCore::DatabaseTracker::setDatabasesPaused): 85 * Modules/webdatabase/DatabaseTracker.h: 86 * Modules/webdatabase/SQLTransactionBackend.cpp: 87 (WebCore::SQLTransactionBackend::shouldPerformWhilePaused): 88 * Modules/webdatabase/SQLTransactionBackend.h: 89 * Resources/DictationPhraseWithAlternativesDot.png: Added. 90 * Resources/DictationPhraseWithAlternativesDot@2x.png: Added. 91 * Resources/SpellingDot.png: Added. 92 * Resources/SpellingDot@2x.png: Added. 93 * Resources/decrementArrow.tiff: Added. 94 * Resources/hScrollControl_left.png: Added. 95 * Resources/hScrollControl_middle.png: Added. 96 * Resources/hScrollControl_right.png: Added. 97 * Resources/incrementArrow.tiff: Added. 98 * Resources/markedLeft.png: Added. 99 * Resources/markedMiddle.png: Added. 100 * Resources/markedRight.png: Added. 101 * Resources/vScrollControl_bottom.png: Added. 102 * Resources/vScrollControl_middle.png: Added. 103 * Resources/vScrollControl_top.png: Added. 104 * WebCore.xcodeproj/project.pbxproj: 105 * bindings/js/GCController.cpp: 106 (WebCore::GCController::garbageCollectNow): 107 (WebCore::GCController::releaseExecutableMemory): 108 * bindings/js/GCController.h: 109 * bindings/js/JSCallbackData.h: 110 (WebCore::JSCallbackData::~JSCallbackData): 111 * bindings/js/JSDOMWindowBase.cpp: 112 (WebCore::JSDOMWindowBase::supportsProfiling): 113 (WebCore::JSDOMWindowBase::shouldInterruptScriptBeforeTimeout): 114 (WebCore::JSDOMWindowBase::commonVM): 115 (WebCore::JSDOMWindowBase::commonVMExists): 116 (WebCore::JSDOMWindowBase::commonVMInternal): 117 * bindings/js/JSDOMWindowCustom.cpp: 118 (WebCore::JSDOMWindow::touch): 119 (WebCore::JSDOMWindow::touchList): 120 * bindings/js/JSDeviceOrientationEventCustom.cpp: 121 (WebCore::JSDeviceOrientationEvent::webkitCompassHeading): 122 (WebCore::JSDeviceOrientationEvent::webkitCompassAccuracy): 123 (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent): 124 * bindings/js/JSMainThreadExecState.h: 125 * bindings/js/JSTouchCustom.cpp: 126 * bindings/js/JSTouchListCustom.cpp: 127 * bindings/js/PageScriptDebugServer.cpp: 128 (WebCore::PageScriptDebugServer::didContinue): 129 * bindings/js/ScriptController.cpp: 130 (WebCore::ScriptController::initializeThreading): 131 * bindings/js/ScriptDebugServer.cpp: 132 (WebCore::ScriptDebugServer::handlePause): 133 * bindings/js/ios/TouchConstructors.cpp: Added. 134 * bindings/objc/DOM.mm: 135 (WebCore::wkQuadFromFloatQuad): 136 (WebCore::kit): 137 (WebCore::min4): 138 (WebCore::max4): 139 (WebCore::emptyQuad): 140 (-[WKQuadObject initWithQuad:]): 141 (-[WKQuadObject quad]): 142 (-[WKQuadObject boundingBox]): 143 (-[DOMNode boundingBox]): 144 (-[DOMNode absoluteQuad]): 145 (-[DOMNode absoluteQuadAndInsideFixedPosition:]): 146 (-[DOMNode boundingBoxUsingTransforms]): 147 (-[DOMNode lineBoxQuads]): 148 (-[DOMNode _linkElement]): 149 (-[DOMNode hrefURL]): 150 (-[DOMNode hrefTarget]): 151 (-[DOMNode hrefFrame]): 152 (-[DOMNode hrefLabel]): 153 (-[DOMNode hrefTitle]): 154 (-[DOMNode boundingFrame]): 155 (-[DOMNode innerFrameQuad]): 156 (-[DOMNode computedFontSize]): 157 (-[DOMNode nextFocusNode]): 158 (-[DOMNode previousFocusNode]): 159 (-[DOMRange boundingBox]): 160 (-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]): 161 (-[DOMElement _font]): 162 (-[DOMHTMLLinkElement _mediaQueryMatchesForOrientation:]): 163 (-[DOMHTMLLinkElement _mediaQueryMatches]): 164 * bindings/objc/DOMEvents.h: 165 * bindings/objc/DOMEvents.mm: 166 (kitClass): 167 * bindings/objc/DOMExtensions.h: 168 * bindings/objc/DOMHTML.mm: 169 (-[DOMHTMLElement scrollYOffset]): 170 (-[DOMHTMLElement setScrollXOffset:scrollYOffset:]): 171 (-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]): 172 (-[DOMHTMLElement absolutePosition::::]): 173 (-[DOMHTMLInputElement _autocapitalizeType]): 174 (-[DOMHTMLTextAreaElement _autocapitalizeType]): 175 (-[DOMHTMLInputElement setValueWithChangeEvent:]): 176 (-[DOMHTMLInputElement setValueAsNumberWithChangeEvent:]): 177 * bindings/objc/DOMInternal.h: 178 * bindings/objc/DOMInternal.mm: 179 (wrapperCacheLock): 180 (getDOMWrapper): 181 (addDOMWrapper): 182 (removeDOMWrapper): 183 * bindings/objc/DOMPrivate.h: 184 * bindings/objc/DOMUIKitExtensions.h: Added. 185 * bindings/objc/DOMUIKitExtensions.mm: Added. 186 * bindings/objc/PublicDOMInterfaces.h: 187 * bindings/scripts/CodeGeneratorJS.pm: 188 (GenerateHeaderContentHeader): 189 (GenerateImplementationContentHeader): 190 (GenerateHeader): 191 (GenerateImplementation): 192 (GenerateCallbackImplementation): 193 * bindings/scripts/CodeGeneratorObjC.pm: 194 (ReadPublicInterfaces): 195 (GetClassName): 196 (IsCoreFoundationType): 197 (GetObjCType): 198 (AddIncludesForType): 199 (GenerateHeader): 200 (GenerateImplementation): 201 (WriteData): 202 * bindings/scripts/IDLAttributes.txt: 203 * bindings/scripts/preprocessor.pm: 204 (applyPreprocessor): 205 * bridge/objc/objc_class.mm: 206 (JSC::Bindings::ObjcClass::fieldNamed): 207 * bridge/objc/objc_instance.mm: 208 * config.h: 209 * dom/Document.cpp: 210 (WebCore::Document::addAutoSizingNode): 211 * dom/Document.h: 212 * dom/Document.idl: 213 * dom/ios/TouchEvents.cpp: Added. 214 * editing/ApplyStyleCommand.cpp: 215 (WebCore::ApplyStyleCommand::applyBlockStyle): 216 * editing/CompositeEditCommand.cpp: 217 (WebCore::EditCommandComposition::unapply): 218 (WebCore::CompositeEditCommand::apply): 219 (WebCore::CompositeEditCommand::inputText): 220 (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): 221 (WebCore::CompositeEditCommand::moveParagraphs): 222 * editing/CompositeEditCommand.h: 223 * editing/DeleteButton.h: 224 * editing/DeleteButtonController.cpp: 225 (WebCore::DeleteButtonController::enable): 226 (WebCore::DeleteButtonController::disable): 227 * editing/DeleteSelectionCommand.cpp: 228 (WebCore::DeleteSelectionCommand::doApply): 229 * editing/DeleteSelectionCommand.h: 230 * editing/EditAction.h: 231 * editing/EditCommand.h: 232 (WebCore::EditCommand::isInsertTextCommand): 233 * editing/EditingStyle.cpp: 234 * editing/Editor.cpp: 235 (WebCore::ClearTextCommand::ClearTextCommand): 236 (WebCore::ClearTextCommand::editingAction): 237 (WebCore::ClearTextCommand::CreateAndApply): 238 (WebCore::Editor::handleTextEvent): 239 (WebCore::Editor::clearText): 240 (WebCore::Editor::insertDictationPhrases): 241 (WebCore::Editor::setDictationPhrasesAsChildOfElement): 242 (WebCore::Editor::confirmMarkedText): 243 (WebCore::Editor::setTextAsChildOfElement): 244 (WebCore::Editor::notifyComponentsOnChangedSelection): 245 (WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): 246 (WebCore::Editor::copy): 247 (WebCore::Editor::setBaseWritingDirection): 248 (WebCore::Editor::setComposition): 249 (WebCore::Editor::showSpellingGuessPanel): 250 (WebCore::Editor::markMisspellingsAfterTypingToWord): 251 (WebCore::Editor::markMisspellingsOrBadGrammar): 252 (WebCore::Editor::changeBackToReplacedString): 253 (WebCore::Editor::updateMarkersForWordsAffectedByEditing): 254 (WebCore::Editor::setIgnoreCompositionSelectionChange): 255 (WebCore::Editor::changeSelectionAfterCommand): 256 (WebCore::Editor::shouldChangeSelection): 257 (WebCore::Editor::respondToChangedSelection): 258 (WebCore::Editor::resolveTextCheckingTypeMask): 259 * editing/Editor.h: 260 * editing/EditorCommand.cpp: 261 (WebCore::executeClearText): 262 (WebCore::enabledCopy): 263 (WebCore::enabledCut): 264 (WebCore::enabledClearText): 265 (WebCore::createCommandMap): 266 * editing/FrameSelection.cpp: 267 (WebCore::FrameSelection::FrameSelection): 268 (WebCore::FrameSelection::setSelection): 269 (WebCore::FrameSelection::modifyExtendingRight): 270 (WebCore::FrameSelection::modifyExtendingForward): 271 (WebCore::FrameSelection::modifyMovingRight): 272 (WebCore::FrameSelection::modifyMovingForward): 273 (WebCore::FrameSelection::modifyExtendingLeft): 274 (WebCore::FrameSelection::modifyExtendingBackward): 275 (WebCore::FrameSelection::modifyMovingLeft): 276 (WebCore::FrameSelection::modifyMovingBackward): 277 (WebCore::FrameSelection::setSelectedRange): 278 (WebCore::FrameSelection::focusedOrActiveStateChanged): 279 (WebCore::FrameSelection::updateAppearance): 280 (WebCore::FrameSelection::shouldDeleteSelection): 281 (WebCore::FrameSelection::revealSelection): 282 (WebCore::FrameSelection::setSelectionFromNone): 283 (WebCore::FrameSelection::shouldChangeSelection): 284 (WebCore::FrameSelection::expandSelectionToElementContainingCaretSelection): 285 (WebCore::FrameSelection::elementRangeContainingCaretSelection): 286 (WebCore::FrameSelection::expandSelectionToWordContainingCaretSelection): 287 (WebCore::FrameSelection::wordRangeContainingCaretSelection): 288 (WebCore::FrameSelection::expandSelectionToStartOfWordContainingCaretSelection): 289 (WebCore::FrameSelection::characterInRelationToCaretSelection): 290 (WebCore::FrameSelection::characterBeforeCaretSelection): 291 (WebCore::FrameSelection::characterAfterCaretSelection): 292 (WebCore::FrameSelection::wordOffsetInRange): 293 (WebCore::FrameSelection::spaceFollowsWordInRange): 294 (WebCore::FrameSelection::selectionAtDocumentStart): 295 (WebCore::FrameSelection::selectionAtSentenceStart): 296 (WebCore::FrameSelection::selectionAtWordStart): 297 (WebCore::FrameSelection::rangeByMovingCurrentSelection): 298 (WebCore::FrameSelection::rangeByExtendingCurrentSelection): 299 (WebCore::FrameSelection::selectRangeOnElement): 300 (WebCore::FrameSelection::wordSelectionContainingCaretSelection): 301 (WebCore::FrameSelection::actualSelectionAtSentenceStart): 302 (WebCore::FrameSelection::rangeByAlteringCurrentSelection): 303 (WebCore::FrameSelection::clearCurrentSelection): 304 (WebCore::FrameSelection::setCaretBlinks): 305 (WebCore::FrameSelection::setCaretColor): 306 * editing/FrameSelection.h: 307 (WebCore::FrameSelection::suppressCloseTyping): 308 (WebCore::FrameSelection::restoreCloseTyping): 309 (WebCore::FrameSelection::setUpdateAppearanceEnabled): 310 (WebCore::FrameSelection::suppressScrolling): 311 (WebCore::FrameSelection::restoreScrolling): 312 * editing/InsertIntoTextNodeCommand.cpp: 313 (WebCore::InsertIntoTextNodeCommand::doReapply): 314 * editing/InsertIntoTextNodeCommand.h: 315 * editing/InsertTextCommand.h: 316 * editing/ReplaceSelectionCommand.cpp: 317 (WebCore::ReplaceSelectionCommand::doApply): 318 * editing/TextAffinity.h: 319 * editing/TextCheckingHelper.cpp: 320 * editing/TextGranularity.h: 321 * editing/TextIterator.cpp: 322 (WebCore::isRendererReplacedElement): 323 * editing/TypingCommand.cpp: 324 (WebCore::TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping): 325 (WebCore::TypingCommand::markMisspellingsAfterTyping): 326 (WebCore::TypingCommand::deleteKeyPressed): 327 (WebCore::TypingCommand::forwardDeleteKeyPressed): 328 (WebCore::FriendlyEditCommand::setEndingSelection): 329 (WebCore::TypingCommand::setEndingSelectionOnLastInsertCommand): 330 * editing/TypingCommand.h: 331 * editing/VisiblePosition.h: 332 (WebCore::operator<): 333 (WebCore::operator>): 334 (WebCore::operator<=): 335 (WebCore::operator>=): 336 * editing/VisibleSelection.cpp: 337 (WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity): 338 (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries): 339 * editing/VisibleUnits.cpp: 340 (WebCore::previousBoundary): 341 (WebCore::nextBoundary): 342 (WebCore::startOfDocument): 343 (WebCore::endOfDocument): 344 (WebCore::directionIsDownstream): 345 (WebCore::atBoundaryOfGranularity): 346 (WebCore::withinTextUnitOfGranularity): 347 (WebCore::nextCharacterBoundaryInDirection): 348 (WebCore::nextWordBoundaryInDirection): 349 (WebCore::nextSentenceBoundaryInDirection): 350 (WebCore::nextLineBoundaryInDirection): 351 (WebCore::nextParagraphBoundaryInDirection): 352 (WebCore::nextDocumentBoundaryInDirection): 353 (WebCore::positionOfNextBoundaryOfGranularity): 354 (WebCore::enclosingTextUnitOfGranularity): 355 (WebCore::distanceBetweenPositions): 356 (WebCore::wordRangeFromPosition): 357 (WebCore::closestWordBoundaryForPosition): 358 * editing/VisibleUnits.h: 359 * editing/ios/DictationCommandIOS.cpp: Added. 360 * editing/ios/DictationCommandIOS.h: Added. 361 (WebCore::DictationCommandIOS::create): 362 (WebCore::DictationCommandIOS::editingAction): 363 * editing/mac/FrameSelectionMac.mm: 364 (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): 365 * fileapi/AsyncFileStream.cpp: 366 * generate-export-file: Added. 367 * inspector/InspectorCounters.h: 368 * inspector/InspectorFrontendHost.h: 369 * make-export-file-generator: 370 * plugins/PluginPackage.h: 371 * plugins/PluginViewBase.h: 372 (WebCore::PluginViewBase::willProvidePluginLayer): 373 (WebCore::PluginViewBase::attachPluginLayer): 374 (WebCore::PluginViewBase::detachPluginLayer): 375 * style/StyleResolveForDocument.cpp: 376 (WebCore::Style::resolveForDocument): 377 * style/StyleResolveTree.cpp: 378 (WebCore::Style::elementImplicitVisibility): 379 * testing/Internals.cpp: 380 (WebCore::Internals::getCurrentCursorInfo): 381 (WebCore::Internals::isSelectPopupVisible): 382 * workers/WorkerThread.cpp: 383 (WebCore::WorkerThread::workerThread): 384 1 385 2014-01-10 Daniel Bates <dabates@apple.com> 2 386 -
trunk/Source/WebCore/Configurations/Base.xcconfig
r159669 r161638 21 21 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 22 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 24 #include "iOS.xcconfig" 23 25 24 26 CLANG_CXX_LANGUAGE_STANDARD = gnu++0x; … … 57 59 GCC_WARN_64_TO_32_BIT_CONVERSION_armv7 = YES; 58 60 GCC_WARN_64_TO_32_BIT_CONVERSION_armv7s = YES; 61 GCC_WARN_64_TO_32_BIT_CONVERSION_arm64 = NO; 59 62 GCC_WARN_64_TO_32_BIT_CONVERSION_i386 = YES; 60 63 GCC_WARN_64_TO_32_BIT_CONVERSION_x86_64 = NO; … … 83 86 84 87 GCC_OPTIMIZATION_LEVEL = $(GCC_OPTIMIZATION_LEVEL_$(CURRENT_VARIANT)); 85 GCC_OPTIMIZATION_LEVEL_normal = 2; 88 GCC_OPTIMIZATION_LEVEL_normal = $(GCC_OPTIMIZATION_LEVEL_normal_$(PLATFORM_NAME)); 89 GCC_OPTIMIZATION_LEVEL_normal_iphoneos = 3; 90 GCC_OPTIMIZATION_LEVEL_normal_iphonesimulator = 3; 91 GCC_OPTIMIZATION_LEVEL_normal_macosx = 2; 86 92 GCC_OPTIMIZATION_LEVEL_debug = 0; 87 93 … … 94 100 DEAD_CODE_STRIPPING = $(DEAD_CODE_STRIPPING_$(CURRENT_VARIANT)); 95 101 96 SECTORDER_FLAGS = -Wl,-order_file,WebCore.order; 102 SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(PLATFORM_NAME)); 103 SECTORDER_FLAGS_iphoneos = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/WebCore.order; 104 SECTORDER_FLAGS_macosx = -Wl,-order_file,WebCore.order; 97 105 98 106 WEBCORE_SQLITE3_HEADER_SEARCH_PATHS = $(NEXT_ROOT)/usr/local/include/WebCoreSQLite3; -
trunk/Source/WebCore/Configurations/WebCore.xcconfig
r161610 r161638 34 34 EXPORTED_SYMBOLS_FILE_i386_iphonesimulator = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.LP64.i386.exp; 35 35 EXPORTED_SYMBOLS_FILE_i386_macosx = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.exp; 36 EXPORTED_SYMBOLS_FILE_ppc = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.exp; 37 EXPORTED_SYMBOLS_FILE_x86_64 = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.LP64.exp; 36 EXPORTED_SYMBOLS_FILE_x86_64 = $(EXPORTED_SYMBOLS_FILE_x86_64_$(PLATFORM_NAME)); 37 EXPORTED_SYMBOLS_FILE_x86_64_iphonesimulator = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.LP64.x86_64.exp; 38 EXPORTED_SYMBOLS_FILE_x86_64_macosx = $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/WebCore.LP64.exp; 38 39 GCC_PREFIX_HEADER = WebCorePrefix.h; 39 40 GCC_PREPROCESSOR_DEFINITIONS = $(DEBUG_DEFINES) $(FEATURE_DEFINES) WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST $(GCC_PREPROCESSOR_DEFINITIONS); … … 52 53 STAGED_FRAMEWORKS_SEARCH_PATH_YES = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari; 53 54 54 HEADER_SEARCH_PATHS = ForwardingHeaders icu /usr/include/libxslt /usr/include/libxml2 "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore" "${BUILT_PRODUCTS_DIR}/usr/local/include" $(HEADER_SEARCH_PATHS); 55 WEBKITADDITIONS_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include/WebKitAdditions $(SDKROOT)/usr/local/include/WebKitAdditions; 56 57 HEADER_SEARCH_PATHS = ForwardingHeaders icu /usr/include/libxslt /usr/include/libxml2 $(SQLITE3_HEADER_SEARCH_PATHS) "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore" "$(BUILT_PRODUCTS_DIR)/usr/local/include" $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) $(HEADER_SEARCH_PATHS); 55 58 INFOPLIST_FILE = Info.plist; 56 59 INSTALL_PATH = $(INSTALL_PATH_$(PLATFORM_NAME)); … … 69 72 OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport; 70 73 OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_$(PLATFORM_NAME)); 71 OTHER_LDFLAGS_iphoneos = $(OTHER_LDFLAGS_ BASE) -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework QuartzCore;72 OTHER_LDFLAGS_iphonesimulator = $(OTHER_LDFLAGS_ iphoneos);74 OTHER_LDFLAGS_iphoneos = $(OTHER_LDFLAGS_iphonesimulator) -framework IOSurface; 75 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; 73 76 OTHER_LDFLAGS_macosx = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -umbrella WebKit -allowable_client WebKit2 -framework IOSurface; 74 77 … … 103 106 JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Release = $(JAVASCRIPTCORE_PRIVATE_HEADERS_engineering); 104 107 JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Debug = $(JAVASCRIPTCORE_PRIVATE_HEADERS_engineering); 105 JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production = $(SDKROOT)$(PRODUCTION_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders; 108 JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production = $(JAVASCRIPTCORE_PRIVATE_HEADERS_Production_$(PLATFORM_NAME)); 109 JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production_iphoneos = $(SDKROOT)/$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaScriptCore.framework/Headers; 110 JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production_iphonesimulator = $(JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production_iphoneos); 111 JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production_macosx = $(SDKROOT)$(PRODUCTION_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders; 106 112 JAVASCRIPTCORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/JavaScriptCore.framework/PrivateHeaders; 107 113 108 114 EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME)); 109 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;115 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; 110 116 EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos); 111 117 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; -
trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig
r157667 r161638 27 27 PRIVATE_HEADERS_FOLDER_PATH_Debug = WebCoreTestSupport; 28 28 PRIVATE_HEADERS_FOLDER_PATH_Release = $(PRIVATE_HEADERS_FOLDER_PATH_Debug); 29 PRIVATE_HEADERS_FOLDER_PATH_Production = /usr/local/include/WebCoreTestSupport; 29 PRIVATE_HEADERS_FOLDER_PATH_Production = $(PRIVATE_HEADERS_FOLDER_PATH_Production_$(PLATFORM_NAME)); 30 PRIVATE_HEADERS_FOLDER_PATH_Production_iphoneos = /usr/local/include/WebCoreTestSupport; 31 PRIVATE_HEADERS_FOLDER_PATH_Production_iphonesimulator = $(INDIGO_INSTALL_PATH_PREFIX)$(PRIVATE_HEADERS_FOLDER_PATH_Production_iphoneos); 32 PRIVATE_HEADERS_FOLDER_PATH_Production_macosx = /usr/local/include/WebCoreTestSupport; 30 33 31 INSTALL_PATH = $(INSTALL_PATH_$(CONFIGURATION)); 32 INSTALL_PATH_Production = /usr/local/lib; 34 INSTALL_PATH = $(INSTALL_PATH_$(CONFIGURATION)_$(PLATFORM_NAME)); 35 INSTALL_PATH_Production_iphoneos = /usr/local/lib; 36 INSTALL_PATH_Production_iphonesimulator = $(INDIGO_INSTALL_PATH_PREFIX)$(INSTALL_PATH_Production_iphoneos); 37 INSTALL_PATH_Production_macosx = /usr/local/lib; 33 38 34 39 SKIP_INSTALL = $(SKIP_INSTALL_$(FORCE_TOOL_INSTALL)); -
trunk/Source/WebCore/DerivedSources.make
r161563 r161638 29 29 VPATH = \ 30 30 $(WebCore) \ 31 $(WebCore)/Modules/airplay \ 31 32 $(WebCore)/Modules/encryptedmedia \ 32 33 $(WebCore)/Modules/geolocation \ … … 68 69 69 70 BINDING_IDLS = \ 71 $(WebCore)/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl \ 70 72 $(WebCore)/Modules/encryptedmedia/MediaKeyMessageEvent.idl \ 71 73 $(WebCore)/Modules/encryptedmedia/MediaKeyNeededEvent.idl \ … … 305 307 $(WebCore)/dom/Text.idl \ 306 308 $(WebCore)/dom/TextEvent.idl \ 307 $(WebCore)/dom/Touch.idl \308 $(WebCore)/dom/TouchEvent.idl \309 $(WebCore)/dom/TouchList.idl \310 309 $(WebCore)/dom/TransitionEvent.idl \ 311 310 $(WebCore)/dom/TreeWalker.idl \ … … 720 719 endif 721 720 721 ifeq ($(shell $(CC) -isysroot $(SDKROOT) -std=gnu++11 -x c++ -E -P -dM -F $(BUILT_PRODUCTS_DIR) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep ' WTF_PLATFORM_IOS ' | cut -d' ' -f3), 1) 722 WTF_PLATFORM_IOS = 1 723 else 724 WTF_PLATFORM_IOS = 0 725 endif 726 722 727 ifeq ($(shell $(CC) -std=gnu++11 -x c++ -E -P -dM $(SDK_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep ENABLE_ORIENTATION_EVENTS | cut -d' ' -f3), 1) 723 728 ENABLE_ORIENTATION_EVENTS = 1 … … 726 731 ifeq ($(PLATFORM_FEATURE_DEFINES),) 727 732 PLATFORM_FEATURE_DEFINES = Configurations/FeatureDefines.xcconfig 733 endif 734 735 ifeq ($(WTF_PLATFORM_IOS), 1) 736 737 ADDITIONAL_BINDING_IDLS = \ 738 GestureEvent.idl \ 739 Touch.idl \ 740 TouchEvent.idl \ 741 TouchList.idl 742 743 BINDING_IDLS += $(ADDITIONAL_BINDING_IDLS) 744 745 all : $(ADDITIONAL_BINDING_IDLS:%.idl=JS%.h) 746 747 vpath %.idl $(BUILT_PRODUCTS_DIR)/usr/local/include $(SDKROOT)/usr/local/include 748 749 $(ADDITIONAL_BINDING_IDLS) : % : WebKitAdditions/% 750 cp $< . 751 752 else 753 754 BINDING_IDLS += \ 755 $(WebCore)/dom/Touch.idl \ 756 $(WebCore)/dom/TouchEvent.idl \ 757 $(WebCore)/dom/TouchList.idl 758 728 759 endif 729 760 … … 1157 1188 ifneq ($(ACTION),installhdrs) 1158 1189 1190 ifeq ($(WTF_PLATFORM_IOS),1) 1191 1192 ifeq ($(findstring armv6,$(ARCHS)), armv6) 1193 WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.armv6.exp 1194 endif 1195 ifeq ($(findstring armv7f,$(ARCHS)), armv7f) 1196 WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.armv7f.exp 1197 endif 1198 ifeq ($(findstring armv7s,$(ARCHS)), armv7s) 1199 WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.armv7s.exp 1200 endif 1201 ifeq ($(findstring armv7,$(ARCHS)), armv7) 1202 WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.armv7.exp 1203 endif 1204 ifeq ($(findstring arm64,$(ARCHS)), arm64) 1205 WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.arm64.exp 1206 endif 1207 ifeq ($(findstring i386,$(ARCHS)), i386) 1208 WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.i386.exp 1209 endif 1210 ifeq ($(findstring x86_64,$(ARCHS)), x86_64) 1211 WEBCORE_EXPORT_FILES := $(WEBCORE_EXPORT_FILES) WebCore.LP64.x86_64.exp 1212 endif 1213 1214 all : $(WEBCORE_EXPORT_FILES) 1215 1216 WebCore.%.exp : generate-export-file WebCore.exp.in 1217 $^ $@ 1218 1219 # Switch NSRect, NSSize and NSPoint with their CG counterparts for the 64-bit exports file. 1220 WebCore.LP64.%.exp : WebCore.%.exp 1221 cat $^ | sed -e s/7_NSRect/6CGRect/ -e s/7_NSSize/6CGSize/ -e s/8_NSPoint/7CGPoint/ > $@ 1222 1223 else 1224 1159 1225 all : WebCore.exp WebCore.LP64.exp 1160 1226 1161 1227 WebCore.exp : $(BUILT_PRODUCTS_DIR)/WebCoreExportFileGenerator 1162 $^> $@1228 $^ | grep -v '^# ' | sed -e 's/^#//' > $@ 1163 1229 1164 1230 # Switch NSRect, NSSize and NSPoint with their CG counterparts for the 64-bit exports file. 1165 1231 WebCore.LP64.exp : WebCore.exp 1166 1232 cat $^ | sed -e s/7_NSRect/6CGRect/ -e s/7_NSSize/6CGSize/ -e s/8_NSPoint/7CGPoint/ > $@ 1233 1234 endif # WTF_PLATFORM_IOS 1167 1235 1168 1236 endif # installhdrs -
trunk/Source/WebCore/English.lproj/Localizable.strings
r161004 r161638 113 113 "Choose Files" = "Choose Files"; 114 114 115 /* PLATFORM(IOS) title for file button used in HTML forms for media files */ 116 "Choose Media (Single)" = "Choose Photo"; 117 118 /* PLATFORM(IOS) title for file button used in HTML5 forms for multiple media files */ 119 "Choose Media (Multiple)" = "Choose Photos"; 120 115 121 /* menu item in Recent Searches menu that empties menu's contents */ 116 122 "Clear Recent Searches" = "Clear Recent Searches"; … … 158 164 "Default" = "Default"; 159 165 166 /* PLATFORM(IOS) Undo action name */ 167 "Delete (Undo action name)" = "Delete"; 168 169 /* PLATFORM(IOS) Undo action name */ 170 "Dictation (Undo action name)" = "Dictation"; 171 160 172 /* text to display in <details> tag when it has no <summary> child */ 161 173 "Details" = "Details"; … … 782 794 "no files selected" = "no files selected"; 783 795 796 /* PLATFORM(IOS) text to display in file button used in HTML forms for media files when no media file is selected */ 797 "no media selected (single)" = "no photo selected"; 798 799 /* 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 */ 800 "no media selected (multiple)" = "no photos selected"; 801 784 802 /* HTTP result code string */ 785 803 "no longer exists" = "no longer exists"; -
trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp
r161637 r161638 1 1 /* 2 * Copyright (C) 20 04 Apple Computer, Inc.All rights reserved.2 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 26 #i fndef TextAffinity_h27 # define TextAffinity_h26 #include "config.h" 27 #include "WebKitPlaybackTargetAvailabilityEvent.h" 28 28 29 #ifdef __OBJC__ 30 #include <AppKit/NSTextView.h> 31 #endif 29 #if ENABLE(IOS_AIRPLAY) 32 30 33 31 namespace WebCore { 34 32 35 // These match the AppKit values for these concepts. 36 // From NSTextView.h: 37 // NSSelectionAffinityUpstream = 0 38 // NSSelectionAffinityDownstream = 1 39 enum EAffinity { UPSTREAM = 0, DOWNSTREAM = 1 }; 33 static const AtomicString& stringForPlaybackTargetAvailability(bool available) 34 { 35 DEFINE_STATIC_LOCAL(AtomicString, availableString, ("available", AtomicString::ConstructFromLiteral)); 36 DEFINE_STATIC_LOCAL(AtomicString, notAvailableString, ("not-available", AtomicString::ConstructFromLiteral)); 37 38 return available ? availableString : notAvailableString; 39 } 40 41 WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent() 42 { 43 } 44 45 WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent(const AtomicString& eventType, bool available) 46 : Event(eventType, false, false) 47 , m_availability(stringForPlaybackTargetAvailability(available)) 48 { 49 } 50 51 WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent(const AtomicString& eventType, const WebKitPlaybackTargetAvailabilityEventInit& initializer) 52 : Event(eventType, initializer) 53 , m_availability(initializer.availability) 54 { 55 } 40 56 41 57 } // namespace WebCore 42 58 43 #ifdef __OBJC__ 44 45 inline NSSelectionAffinity kit(WebCore::EAffinity affinity) 46 { 47 return static_cast<NSSelectionAffinity>(affinity); 48 } 49 50 inline WebCore::EAffinity core(NSSelectionAffinity affinity) 51 { 52 return static_cast<WebCore::EAffinity>(affinity); 53 } 54 55 #endif 56 57 #endif // TextAffinity_h 59 #endif // ENABLE(IOS_AIRPLAY) -
trunk/Source/WebCore/Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl
r161637 r161638 1 1 /* 2 * Copyright (C) 20 06, 2010 Apple Inc. All rights reserved.2 * Copyright (C) 2013 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 11 11 * documentation and/or other materials provided with the distribution. 12 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY13 * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY 14 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR … … 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * 24 25 */ 25 26 26 #ifndef DeleteButton_h 27 #define DeleteButton_h 28 29 #include "HTMLImageElement.h" 30 31 namespace WebCore { 32 33 class DeleteButton : public HTMLImageElement { 34 public: 35 static PassRefPtr<DeleteButton> create(Document&); 36 37 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; } 38 39 private: 40 explicit DeleteButton(Document&); 41 42 virtual void defaultEventHandler(Event*); 27 [ 28 Conditional=IOS_AIRPLAY, 29 ConstructorTemplate=Event 30 ] interface WebKitPlaybackTargetAvailabilityEvent : Event { 31 [InitializedByEventConstructor] readonly attribute DOMString availability; 43 32 }; 44 33 45 } // namespace46 47 #endif -
trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp
r154967 r161638 236 236 : ActiveDOMObject(context) 237 237 , m_allowGeolocation(Unknown) 238 #if PLATFORM(IOS) 239 , m_isSuspended(false) 240 , m_hasChangedPosition(false) 241 , m_resumeTimer(this, &Geolocation::resumeTimerFired) 242 #endif 238 243 { 239 244 } … … 258 263 return document() ? document()->page() : 0; 259 264 } 265 266 #if PLATFORM(IOS) 267 bool Geolocation::canSuspend() const 268 { 269 return !hasListeners(); 270 } 271 272 void Geolocation::suspend(ReasonForSuspension reason) 273 { 274 // Allow pages that no longer have listeners to enter the page cache. 275 // Have them stop updating and reset geolocation permissions when the page is resumed. 276 if (reason == ActiveDOMObject::DocumentWillBecomeInactive) { 277 ASSERT(!hasListeners()); 278 stop(); 279 m_resetOnResume = true; 280 } 281 282 // Suspend GeoNotifier timeout timers. 283 if (hasListeners()) 284 stopTimers(); 285 286 m_isSuspended = true; 287 m_resumeTimer.stop(); 288 ActiveDOMObject::suspend(reason); 289 } 290 291 void Geolocation::resume() 292 { 293 ASSERT(WebThreadIsLockedOrDisabled()); 294 ActiveDOMObject::resume(); 295 296 if (!m_resumeTimer.isActive()) 297 m_resumeTimer.startOneShot(0); 298 } 299 300 void Geolocation::resumeTimerFired(Timer<Geolocation>*) 301 { 302 m_isSuspended = false; 303 304 if (m_resetOnResume) { 305 resetAllGeolocationPermission(); 306 m_resetOnResume = false; 307 } 308 309 // Resume GeoNotifier timeout timers. 310 if (hasListeners()) { 311 GeoNotifierSet::const_iterator end = m_oneShots.end(); 312 for (GeoNotifierSet::const_iterator it = m_oneShots.begin(); it != end; ++it) 313 (*it)->startTimerIfNeeded(); 314 GeoNotifierVector watcherCopy; 315 m_watchers.getNotifiersVector(watcherCopy); 316 for (size_t i = 0; i < watcherCopy.size(); ++i) 317 watcherCopy[i]->startTimerIfNeeded(); 318 } 319 320 if ((isAllowed() || isDenied()) && !m_pendingForPermissionNotifiers.isEmpty()) { 321 // The pending permission was granted while the object was suspended. 322 setIsAllowed(isAllowed()); 323 ASSERT(!m_hasChangedPosition); 324 ASSERT(!m_errorWaitingForResume); 325 return; 326 } 327 328 if (isDenied() && hasListeners()) { 329 // The permission was revoked while the object was suspended. 330 setIsAllowed(false); 331 return; 332 } 333 334 if (m_hasChangedPosition) { 335 positionChanged(); 336 m_hasChangedPosition = false; 337 } 338 339 if (m_errorWaitingForResume) { 340 handleError(m_errorWaitingForResume.get()); 341 m_errorWaitingForResume = nullptr; 342 } 343 } 344 345 void Geolocation::resetAllGeolocationPermission() 346 { 347 if (m_isSuspended) { 348 m_resetOnResume = true; 349 return; 350 } 351 352 if (m_allowGeolocation == InProgress) { 353 Page* page = this->page(); 354 if (page) 355 GeolocationController::from(page)->cancelPermissionRequest(this); 356 357 // This return is not technically correct as GeolocationController::cancelPermissionRequest() should have cleared the active request. 358 // 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. :( 359 return; 360 } 361 362 // 1) Reset our own state. 363 stopUpdating(); 364 m_allowGeolocation = Unknown; 365 m_hasChangedPosition = false; 366 m_errorWaitingForResume = nullptr; 367 368 // 2) Request new permission for the active notifiers. 369 stopTimers(); 370 371 // Go over the one shot and re-request permission. 372 GeoNotifierSet::iterator end = m_oneShots.end(); 373 for (GeoNotifierSet::iterator it = m_oneShots.begin(); it != end; ++it) 374 startRequest((*it).get()); 375 // Go over the watchers and re-request permission. 376 GeoNotifierVector watcherCopy; 377 m_watchers.getNotifiersVector(watcherCopy); 378 for (size_t i = 0; i < watcherCopy.size(); ++i) 379 startRequest(watcherCopy[i].get()); 380 } 381 #endif // PLATFORM(IOS) 260 382 261 383 void Geolocation::stop() … … 268 390 cancelAllRequests(); 269 391 stopUpdating(); 392 #if PLATFORM(IOS) 393 m_hasChangedPosition = false; 394 m_errorWaitingForResume = nullptr; 395 #endif // PLATFORM(IOS) 270 396 m_pendingForPermissionNotifiers.clear(); 271 397 } … … 430 556 m_allowGeolocation = allowed ? Yes : No; 431 557 558 #if PLATFORM(IOS) 559 if (m_isSuspended) 560 return; 561 #endif 562 432 563 // Permission request was made during the startRequest process 433 564 if (!m_pendingForPermissionNotifiers.isEmpty()) { … … 442 573 handleError(error.get()); 443 574 m_requestsAwaitingCachedPosition.clear(); 575 #if PLATFORM(IOS) 576 m_hasChangedPosition = false; 577 m_errorWaitingForResume = nullptr; 578 #endif 579 444 580 return; 445 581 } … … 621 757 stopTimers(); 622 758 759 #if PLATFORM(IOS) 760 if (m_isSuspended) { 761 m_hasChangedPosition = true; 762 return; 763 } 764 #endif 765 623 766 makeSuccessCallbacks(); 624 767 } … … 626 769 void Geolocation::setError(GeolocationError* error) 627 770 { 771 #if PLATFORM(IOS) 772 if (m_isSuspended) { 773 m_errorWaitingForResume = createPositionError(error); 774 return; 775 } 776 #endif 628 777 RefPtr<PositionError> positionError = createPositionError(error); 629 778 handleError(positionError.get()); -
trunk/Source/WebCore/Modules/geolocation/Geolocation.h
r157653 r161638 55 55 ~Geolocation(); 56 56 57 #if PLATFORM(IOS) 58 virtual bool canSuspend() const OVERRIDE; 59 virtual void suspend(ReasonForSuspension) OVERRIDE; 60 virtual void resume() OVERRIDE; 61 void resetAllGeolocationPermission(); 62 #endif // PLATFORM(IOS) 57 63 Document* document() const; 58 64 Frame* frame() const; … … 175 181 No 176 182 } m_allowGeolocation; 183 #if PLATFORM(IOS) 184 bool m_isSuspended; 185 bool m_resetOnResume; 186 bool m_hasChangedPosition; 187 RefPtr<PositionError> m_errorWaitingForResume; 188 189 void resumeTimerFired(Timer<Geolocation>*); 190 Timer<Geolocation> m_resumeTimer; 191 #endif // PLATFORM(IOS) 177 192 178 193 GeoNotifierSet m_requestsAwaitingCachedPosition; -
trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp
r140509 r161638 58 58 } 59 59 60 #if PLATFORM(IOS) 61 void NavigatorGeolocation::resetAllGeolocationPermission() 62 { 63 if (m_geolocation) 64 m_geolocation->resetAllGeolocationPermission(); 65 } 66 #endif // PLATFORM(IOS) 67 60 68 Geolocation* NavigatorGeolocation::geolocation(Navigator* navigator) 61 69 { -
trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h
r140509 r161638 40 40 Geolocation* geolocation() const; 41 41 42 #if PLATFORM(IOS) 43 void resetAllGeolocationPermission(); 44 #endif // PLATFORM(IOS) 45 42 46 private: 43 47 NavigatorGeolocation(Frame*); -
trunk/Source/WebCore/Modules/speech/SpeechSynthesis.cpp
r157653 r161638 31 31 #include "PlatformSpeechSynthesisVoice.h" 32 32 #include "PlatformSpeechSynthesizer.h" 33 #include "ScriptController.h" 33 34 #include "SpeechSynthesisEvent.h" 34 35 #include "SpeechSynthesisUtterance.h" … … 45 46 : m_currentSpeechUtterance(0) 46 47 , m_isPaused(false) 48 #if PLATFORM(IOS) 49 , m_restrictions(RequireUserGestureForSpeechStartRestriction) 50 #endif 47 51 { 48 52 } … … 113 117 if (!utterance) 114 118 return; 119 120 // Like Audio, we should require that the user interact to start a speech synthesis session. 121 #if PLATFORM(IOS) 122 if (ScriptController::processingUserGesture()) 123 removeBehaviorRestriction(RequireUserGestureForSpeechStartRestriction); 124 else if (userGestureRequiredForSpeechStart()) 125 return; 126 #endif 115 127 116 128 m_utteranceQueue.append(utterance); -
trunk/Source/WebCore/Modules/speech/SpeechSynthesis.h
r157653 r161638 77 77 void fireEvent(const AtomicString& type, SpeechSynthesisUtterance*, unsigned long charIndex, const String& name); 78 78 79 #if PLATFORM(IOS) 80 // Restrictions to change default behaviors. 81 enum BehaviorRestrictionFlags { 82 NoRestrictions = 0, 83 RequireUserGestureForSpeechStartRestriction = 1 << 0, 84 }; 85 typedef unsigned BehaviorRestrictions; 86 87 bool userGestureRequiredForSpeechStart() const { return m_restrictions & RequireUserGestureForSpeechStartRestriction; } 88 void removeBehaviorRestriction(BehaviorRestrictions restriction) { m_restrictions &= ~restriction; } 89 #endif 90 79 91 OwnPtr<PlatformSpeechSynthesizer> m_platformSpeechSynthesizer; 80 92 Vector<RefPtr<SpeechSynthesisVoice>> m_voiceList; … … 82 94 Deque<RefPtr<SpeechSynthesisUtterance>> m_utteranceQueue; 83 95 bool m_isPaused; 96 #if PLATFORM(IOS) 97 BehaviorRestrictions m_restrictions; 98 #endif 84 99 }; 85 100 -
trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp
r159931 r161638 81 81 #endif 82 82 83 #if PLATFORM(IOS) 84 #include "ScriptController.h" 85 #include "Settings.h" 86 #endif 87 83 88 #include <runtime/ArrayBuffer.h> 84 89 #include <wtf/Atomics.h> -
trunk/Source/WebCore/Modules/webaudio/AudioContext.h
r158365 r161638 97 97 98 98 Document* document() const; // ASSERTs if document no longer exists. 99 bool hasDocument();100 99 101 100 AudioDestinationNode* destination() { return m_destinationNode.get(); } -
trunk/Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp
r157971 r161638 36 36 #include <wtf/MathExtras.h> 37 37 38 #if PLATFORM(IOS) 39 #include "ScriptController.h" 40 #endif 41 38 42 namespace WebCore { 39 43 -
trunk/Source/WebCore/Modules/webdatabase/Database.cpp
r157075 r161638 61 61 #include <wtf/text/CString.h> 62 62 63 #if PLATFORM(IOS) 64 #include "SQLiteDatabaseTracker.h" 65 #endif 66 63 67 namespace WebCore { 64 68 -
trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp
r157337 r161638 53 53 #include <wtf/text/StringHash.h> 54 54 55 #if PLATFORM(IOS) 56 #include "SQLiteDatabaseTracker.h" 57 #endif 58 55 59 // Registering "opened" databases with the DatabaseTracker 56 60 // ======================================================= … … 315 319 const int maxSqliteBusyWaitTime = 30000; 316 320 321 #if PLATFORM(IOS) 322 { 323 // Make sure we wait till the background removal of the empty database files finished before trying to open any database. 324 MutexLocker locker(DatabaseTracker::openDatabaseMutex()); 325 } 326 SQLiteTransactionInProgressAutoCounter transactionCounter; 327 #endif 328 317 329 if (!m_sqliteDatabase.open(m_filename, true)) { 318 330 errorMessage = formatErrorMessage("unable to open database", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg()); … … 565 577 void DatabaseBackendBase::incrementalVacuumIfNeeded() 566 578 { 579 #if PLATFORM(IOS) 580 SQLiteTransactionInProgressAutoCounter transactionCounter; 581 #endif 567 582 int64_t freeSpaceSize = m_sqliteDatabase.freeSpaceSize(); 568 583 int64_t totalSize = m_sqliteDatabase.totalSize(); -
trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
r154272 r161638 103 103 , m_isRegistered(true) // will register on construction below. 104 104 , m_hasRequestedTermination(false) 105 #if PLATFORM(IOS) 106 , m_paused(false) 107 #endif //PLATFORM(IOS) 105 108 { 106 109 // ActiveDOMObject expects this to be called to set internal flags. … … 162 165 { 163 166 if (!m_databaseThread && !m_hasOpenDatabases) { 167 #if PLATFORM(IOS) 168 MutexLocker lock(m_databaseThreadMutex); 169 #endif //PLATFORM(IOS) 164 170 // It's OK to ask for the m_databaseThread after we've requested 165 171 // termination because we're still using it to execute the closing … … 173 179 if (!m_databaseThread->start()) 174 180 m_databaseThread = 0; 181 #if PLATFORM(IOS) 182 if (m_databaseThread) 183 m_databaseThread->setPaused(m_paused); 184 #endif //PLATFORM(IOS) 175 185 } 176 186 177 187 return m_databaseThread.get(); 178 188 } 189 190 #if PLATFORM(IOS) 191 void DatabaseContext::setPaused(bool paused) 192 { 193 MutexLocker lock(m_databaseThreadMutex); 194 195 m_paused = paused; 196 if (m_databaseThread) 197 m_databaseThread->setPaused(m_paused); 198 } 199 #endif // PLATFORM(IOS) 179 200 180 201 bool DatabaseContext::stopDatabases(DatabaseTaskSynchronizer* cleanupSync) -
trunk/Source/WebCore/Modules/webdatabase/DatabaseContext.h
r141928 r161638 36 36 #include <wtf/ThreadSafeRefCounted.h> 37 37 38 #if PLATFORM(IOS) 39 #include <wtf/Threading.h> 40 #endif // PLATFORM(IOS) 41 38 42 namespace WebCore { 39 43 … … 54 58 PassRefPtr<DatabaseBackendContext> backend(); 55 59 DatabaseThread* databaseThread(); 60 #if PLATFORM(IOS) 61 void setPaused(bool); 62 #endif // PLATFORM(IOS) 56 63 57 64 void setHasOpenDatabases() { m_hasOpenDatabases = true; } … … 76 83 friend class DatabaseBackendContext; 77 84 friend class DatabaseManager; 85 86 #if PLATFORM(IOS) 87 Mutex m_databaseThreadMutex; 88 bool m_paused; 89 #endif // PLATFORM(IOS) 78 90 }; 79 91 -
trunk/Source/WebCore/Modules/webdatabase/DatabaseManagerClient.h
r137520 r161638 39 39 virtual void dispatchDidModifyOrigin(SecurityOrigin*) = 0; 40 40 virtual void dispatchDidModifyDatabase(SecurityOrigin*, const String& databaseName) = 0; 41 42 #if PLATFORM(IOS) 43 virtual void dispatchDidAddNewOrigin(SecurityOrigin*) = 0; 44 virtual void dispatchDidDeleteDatabase() = 0; 45 virtual void dispatchDidDeleteDatabaseOrigin() = 0; 46 #endif 41 47 }; 42 48 -
trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.cpp
r143551 r161638 86 86 LOG(StorageAPI, "Performing %s %p\n", debugTaskName(), this); 87 87 88 #if !PLATFORM(IOS) 88 89 m_database->resetAuthorizer(); 90 #else 91 if (m_database) 92 m_database->resetAuthorizer(); 93 #endif 94 89 95 doPerformTask(); 90 96 … … 169 175 } 170 176 177 #if PLATFORM(IOS) 178 bool Database::DatabaseTransactionTask::shouldPerformWhilePaused() const 179 { 180 return m_transaction->shouldPerformWhilePaused(); 181 } 182 #endif 183 171 184 void DatabaseBackend::DatabaseTransactionTask::doPerformTask() 172 185 { -
trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.h
r156972 r161638 76 76 virtual ~DatabaseTask(); 77 77 78 #if PLATFORM(IOS) 79 virtual bool shouldPerformWhilePaused() const = 0; 80 #endif 81 78 82 void performTask(); 79 83 … … 105 109 return std::unique_ptr<DatabaseOpenTask>(new DatabaseOpenTask(db, setVersionInNewDatabase, synchronizer, error, errorMessage, success)); 106 110 } 111 112 #if PLATFORM(IOS) 113 virtual bool shouldPerformWhilePaused() const OVERRIDE { return true; } 114 #endif 107 115 108 116 private: … … 127 135 } 128 136 137 #if PLATFORM(IOS) 138 virtual bool shouldPerformWhilePaused() const OVERRIDE { return true; } 139 #endif 140 129 141 private: 130 142 DatabaseCloseTask(DatabaseBackend*, DatabaseTaskSynchronizer*); … … 146 158 } 147 159 160 #if PLATFORM(IOS) 161 virtual bool shouldPerformWhilePaused() const OVERRIDE; 162 #endif 163 148 164 SQLTransactionBackend* transaction() const { return m_transaction.get(); } 149 165 … … 167 183 } 168 184 185 #if PLATFORM(IOS) 186 virtual bool shouldPerformWhilePaused() const OVERRIDE { return true; } 187 #endif 188 169 189 private: 170 190 DatabaseTableNamesTask(DatabaseBackend*, DatabaseTaskSynchronizer*, Vector<String>& names); -
trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.cpp
r156972 r161638 43 43 DatabaseThread::DatabaseThread() 44 44 : m_threadID(0) 45 #if PLATFORM(IOS) 46 , m_paused(false) 47 #endif 45 48 , m_transactionClient(adoptPtr(new SQLTransactionClient())) 46 49 , m_transactionCoordinator(adoptPtr(new SQLTransactionCoordinator())) … … 78 81 m_cleanupSync = cleanupSync; 79 82 LOG(StorageAPI, "DatabaseThread %p was asked to terminate\n", this); 83 #if PLATFORM(IOS) 84 m_pausedQueue.kill(); 85 #endif 80 86 m_queue.kill(); 81 87 } … … 99 105 } 100 106 107 #if PLATFORM(IOS) 108 class DatabaseUnpauseTask : public DatabaseTask { 109 public: 110 static std::unique_ptr<DatabaseUnpauseTask> create(DatabaseThread* thread) 111 { 112 return std::unique_ptr<DatabaseUnpauseTask>(new DatabaseUnpauseTask(thread)); 113 } 114 115 virtual bool shouldPerformWhilePaused() const 116 { 117 // Since we're not locking the DatabaseThread::m_paused in the main database thread loop, it's possible that 118 // a DatabaseUnpauseTask might be added to the m_pausedQueue and performed from within ::handlePausedQueue. 119 // To protect against this, we allow it to be performed even if the database is paused. 120 // If the thread is paused when it is being performed, the tasks from the paused queue will simply be 121 // requeued instead of performed. 122 return true; 123 } 124 125 private: 126 DatabaseUnpauseTask(DatabaseThread* thread) 127 : DatabaseTask(0, 0) 128 , m_thread(thread) 129 {} 130 131 virtual void doPerformTask() 132 { 133 m_thread->handlePausedQueue(); 134 } 135 #if !LOG_DISABLED 136 virtual const char* debugTaskName() const { return "DatabaseUnpauseTask"; } 137 #endif 138 139 DatabaseThread* m_thread; 140 }; 141 142 143 void DatabaseThread::setPaused(bool paused) 144 { 145 if (m_paused == paused) 146 return; 147 148 MutexLocker pausedLocker(m_pausedMutex); 149 m_paused = paused; 150 if (!m_paused) 151 scheduleTask(DatabaseUnpauseTask::create(this)); 152 } 153 154 void DatabaseThread::handlePausedQueue() 155 { 156 Vector<std::unique_ptr<DatabaseTask> > pausedTasks; 157 while (auto task = m_pausedQueue.tryGetMessage()) 158 pausedTasks.append(std::move(task)); 159 160 for (unsigned i = 0; i < pausedTasks.size(); ++i) { 161 AutodrainedPool pool; 162 163 std::unique_ptr<DatabaseTask> task(pausedTasks[i].release()); 164 { 165 MutexLocker pausedLocker(m_pausedMutex); 166 if (m_paused) { 167 m_pausedQueue.append(std::move(task)); 168 continue; 169 } 170 } 171 172 if (terminationRequested()) 173 break; 174 175 task->performTask(); 176 } 177 } 178 #endif //PLATFORM(IOS) 179 180 101 181 void DatabaseThread::databaseThread() 102 182 { … … 110 190 AutodrainedPool pool; 111 191 192 #if PLATFORM(IOS) 193 if (!m_paused || task->shouldPerformWhilePaused()) 194 task->performTask(); 195 else 196 m_pausedQueue.append(std::move(task)); 197 #else 112 198 task->performTask(); 199 #endif 113 200 } 114 201 -
trunk/Source/WebCore/Modules/webdatabase/DatabaseThread.h
r157653 r161638 70 70 SQLTransactionCoordinator* transactionCoordinator() { return m_transactionCoordinator.get(); } 71 71 72 #if PLATFORM(IOS) 73 void setPaused(bool); 74 void handlePausedQueue(); 75 #endif 76 72 77 private: 73 78 DatabaseThread(); … … 81 86 82 87 MessageQueue<DatabaseTask> m_queue; 88 #if PLATFORM(IOS) 89 MessageQueue<DatabaseTask> m_pausedQueue; 90 Mutex m_pausedMutex; 91 volatile bool m_paused; 92 #endif 83 93 84 94 // This set keeps track of the open databases that have been used on this thread. -
trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp
r161309 r161638 34 34 #include "Chrome.h" 35 35 #include "ChromeClient.h" 36 #include "Database.h" 36 37 #include "DatabaseBackendBase.h" 37 38 #include "DatabaseBackendContext.h" … … 51 52 #include <wtf/text/CString.h> 52 53 54 #if PLATFORM(IOS) 55 #include "WebCoreThread.h" 56 #endif 57 53 58 namespace WebCore { 54 59 … … 742 747 if (!m_database.isOpen()) 743 748 return; 749 750 #if PLATFORM(IOS) 751 bool insertedNewOrigin = false; 752 #endif 744 753 745 754 bool originEntryExists = hasEntryForOriginNoLock(origin); … … 754 763 if (statement.step() != SQLResultDone) 755 764 LOG_ERROR("Unable to establish origin %s in the tracker", origin->databaseIdentifier().ascii().data()); 765 #if PLATFORM(IOS) 766 else 767 insertedNewOrigin = true; 768 #endif 756 769 } 757 770 } else { … … 770 783 771 784 if (m_client) 785 #if PLATFORM(IOS) 786 { 787 if (insertedNewOrigin) 788 m_client->dispatchDidAddNewOrigin(origin); 789 #endif 772 790 m_client->dispatchDidModifyOrigin(origin); 791 #if PLATFORM(IOS) 792 } 793 #endif 773 794 } 774 795 … … 898 919 if (m_client) { 899 920 m_client->dispatchDidModifyOrigin(origin); 921 #if PLATFORM(IOS) 922 m_client->dispatchDidDeleteDatabaseOrigin(); 923 #endif 900 924 for (unsigned i = 0; i < databaseNames.size(); ++i) 901 925 m_client->dispatchDidModifyDatabase(origin, databaseNames[i]); … … 1063 1087 m_client->dispatchDidModifyOrigin(origin); 1064 1088 m_client->dispatchDidModifyDatabase(origin, name); 1089 #if PLATFORM(IOS) 1090 m_client->dispatchDidDeleteDatabase(); 1091 #endif 1065 1092 } 1066 1093 doneDeletingDatabase(origin, name); … … 1111 1138 deletedDatabases[i]->markAsDeletedAndClose(); 1112 1139 1140 #if !PLATFORM(IOS) 1113 1141 return SQLiteFileSystem::deleteDatabaseFile(fullPath); 1114 } 1142 #else 1143 // On the phone, other background processes may still be accessing this database. Deleting the database directly 1144 // would nuke the POSIX file locks, potentially causing Safari/WebApp to corrupt the new db if it's running in the background. 1145 // We'll instead truncate the database file to 0 bytes. If another process is operating on this same database file after 1146 // the truncation, it should get an error since the database file is no longer valid. When Safari is launched 1147 // next time, it'll go through the database files and clean up any zero-bytes ones. 1148 SQLiteDatabase database; 1149 if (database.open(fullPath)) 1150 return SQLiteFileSystem::truncateDatabaseFile(database.sqlite3Handle()); 1151 return false; 1152 #endif 1153 } 1154 1155 #if PLATFORM(IOS) 1156 void DatabaseTracker::removeDeletedOpenedDatabases() 1157 { 1158 // This is called when another app has deleted a database. Go through all opened databases in this 1159 // tracker and close any that's no longer being tracked in the database. 1160 1161 { 1162 // Acquire the lock before calling openTrackerDatabase. 1163 MutexLocker lockDatabase(m_databaseGuard); 1164 openTrackerDatabase(DontCreateIfDoesNotExist); 1165 } 1166 1167 if (!m_database.isOpen()) 1168 return; 1169 1170 // Keep track of which opened databases have been deleted. 1171 Vector<RefPtr<Database> > deletedDatabases; 1172 typedef HashMap<RefPtr<SecurityOrigin>, Vector<String> > DeletedDatabaseMap; 1173 DeletedDatabaseMap deletedDatabaseMap; 1174 1175 // Make sure not to hold the m_openDatabaseMapGuard mutex when calling 1176 // Database::markAsDeletedAndClose(), since that can cause a deadlock 1177 // during the synchronous DatabaseThread call it triggers. 1178 { 1179 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); 1180 if (m_openDatabaseMap) { 1181 DatabaseOriginMap::const_iterator originMapEnd = m_openDatabaseMap->end(); 1182 for (DatabaseOriginMap::const_iterator originMapIt = m_openDatabaseMap->begin(); originMapIt != originMapEnd; ++originMapIt) { 1183 RefPtr<SecurityOrigin> origin = originMapIt->key; 1184 DatabaseNameMap* databaseNameMap = originMapIt->value; 1185 Vector<String> deletedDatabaseNamesForThisOrigin; 1186 1187 // Loop through all opened databases in this origin. Get the current database file path of each database and see if 1188 // it still matches the path stored in the opened database object. 1189 DatabaseNameMap::const_iterator dbNameMapEnd = databaseNameMap->end(); 1190 for (DatabaseNameMap::const_iterator dbNameMapIt = databaseNameMap->begin(); dbNameMapIt != dbNameMapEnd; ++dbNameMapIt) { 1191 String databaseName = dbNameMapIt->key; 1192 String databaseFileName; 1193 SQLiteStatement statement(m_database, "SELECT path FROM Databases WHERE origin=? AND name=?;"); 1194 if (statement.prepare() == SQLResultOk) { 1195 statement.bindText(1, origin->databaseIdentifier()); 1196 statement.bindText(2, databaseName); 1197 if (statement.step() == SQLResultRow) 1198 databaseFileName = statement.getColumnText(0); 1199 statement.finalize(); 1200 } 1201 1202 bool foundDeletedDatabase = false; 1203 DatabaseSet* databaseSet = dbNameMapIt->value; 1204 DatabaseSet::const_iterator dbEnd = databaseSet->end(); 1205 for (DatabaseSet::const_iterator dbIt = databaseSet->begin(); dbIt != dbEnd; ++dbIt) { 1206 Database* db = static_cast<Database*>(*dbIt); 1207 1208 // We are done if this database has already been marked as deleted. 1209 if (db->deleted()) 1210 continue; 1211 1212 // 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. 1213 if (databaseFileName.isNull() || databaseFileName != pathGetFileName(db->fileName())) { 1214 deletedDatabases.append(db); 1215 foundDeletedDatabase = true; 1216 } 1217 } 1218 1219 // If the database no longer exists, we should remember to remove it from the OriginQuotaManager later. 1220 if (foundDeletedDatabase && databaseFileName.isNull()) 1221 deletedDatabaseNamesForThisOrigin.append(databaseName); 1222 } 1223 1224 if (!deletedDatabaseNamesForThisOrigin.isEmpty()) 1225 deletedDatabaseMap.set(origin, deletedDatabaseNamesForThisOrigin); 1226 } 1227 } 1228 } 1229 1230 for (unsigned i = 0; i < deletedDatabases.size(); ++i) 1231 deletedDatabases[i]->markAsDeletedAndClose(); 1232 1233 DeletedDatabaseMap::const_iterator end = deletedDatabaseMap.end(); 1234 for (DeletedDatabaseMap::const_iterator it = deletedDatabaseMap.begin(); it != end; ++it) { 1235 SecurityOrigin* origin = it->key.get(); 1236 if (m_client) 1237 m_client->dispatchDidModifyOrigin(origin); 1238 1239 const Vector<String>& databaseNames = it->value; 1240 for (unsigned i = 0; i < databaseNames.size(); ++i) { 1241 if (m_client) 1242 m_client->dispatchDidModifyDatabase(origin, databaseNames[i]); 1243 } 1244 } 1245 } 1246 1247 static bool isZeroByteFile(const String& path) 1248 { 1249 long long size = 0; 1250 return getFileSize(path, size) && !size; 1251 } 1252 1253 bool DatabaseTracker::deleteDatabaseFileIfEmpty(const String& path) 1254 { 1255 if (!isZeroByteFile(path)) 1256 return false; 1257 1258 SQLiteDatabase database; 1259 if (!database.open(path)) 1260 return false; 1261 1262 // Specify that we want the exclusive locking mode, so after the next read, 1263 // we'll be holding the lock to this database file. 1264 SQLiteStatement lockStatement(database, "PRAGMA locking_mode=EXCLUSIVE;"); 1265 if (lockStatement.prepare() != SQLResultOk) 1266 return false; 1267 int result = lockStatement.step(); 1268 if (result != SQLResultRow && result != SQLResultDone) 1269 return false; 1270 lockStatement.finalize(); 1271 1272 // Every sqlite database has a sqlite_master table that contains the schema for the database. 1273 // http://www.sqlite.org/faq.html#q7 1274 SQLiteStatement readStatement(database, "SELECT * FROM sqlite_master LIMIT 1;"); 1275 if (readStatement.prepare() != SQLResultOk) 1276 return false; 1277 // We shouldn't expect any result. 1278 if (readStatement.step() != SQLResultDone) 1279 return false; 1280 readStatement.finalize(); 1281 1282 // At this point, we hold the exclusive lock to this file. Double-check again to make sure 1283 // it's still zero bytes. 1284 if (!isZeroByteFile(path)) 1285 return false; 1286 1287 return SQLiteFileSystem::deleteDatabaseFile(path); 1288 } 1289 1290 Mutex& DatabaseTracker::openDatabaseMutex() 1291 { 1292 DEFINE_STATIC_LOCAL(Mutex, mutex, ()); 1293 return mutex; 1294 } 1295 1296 void DatabaseTracker::emptyDatabaseFilesRemovalTaskWillBeScheduled() 1297 { 1298 // Lock the database from opening any database until we are done with scanning the file system for 1299 // zero byte database files to remove. 1300 openDatabaseMutex().lock(); 1301 } 1302 1303 void DatabaseTracker::emptyDatabaseFilesRemovalTaskDidFinish() 1304 { 1305 openDatabaseMutex().unlock(); 1306 } 1307 1308 void DatabaseTracker::setDatabasesPaused(bool paused) 1309 { 1310 MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard); 1311 if (!m_openDatabaseMap) 1312 return; 1313 1314 // This walking is - sadly - the only reliable way to get at each open database thread. 1315 // This will be cleaner once <rdar://problem/5680441> or some other DB thread consolidation takes place. 1316 DatabaseOriginMap::iterator i = m_openDatabaseMap.get()->begin(); 1317 DatabaseOriginMap::iterator end = m_openDatabaseMap.get()->end(); 1318 1319 for (; i != end; ++i) { 1320 DatabaseNameMap* databaseNameMap = i->value; 1321 DatabaseNameMap::iterator j = databaseNameMap->begin(); 1322 DatabaseNameMap::iterator dbNameMapEnd = databaseNameMap->end(); 1323 for (; j != dbNameMapEnd; ++j) { 1324 DatabaseSet* databaseSet = j->value; 1325 DatabaseSet::iterator k = databaseSet->begin(); 1326 DatabaseSet::iterator dbSetEnd = databaseSet->end(); 1327 for (; k != dbSetEnd; ++k) { 1328 DatabaseContext* context = (*k)->databaseContext(); 1329 context->setPaused(paused); 1330 } 1331 } 1332 } 1333 } 1334 1335 #endif 1115 1336 1116 1337 void DatabaseTracker::setClient(DatabaseManagerClient* client) -
trunk/Source/WebCore/Modules/webdatabase/DatabaseTracker.h
r157653 r161638 101 101 bool deleteDatabase(SecurityOrigin*, const String& name); 102 102 103 #if PLATFORM(IOS) 104 void removeDeletedOpenedDatabases(); 105 static bool deleteDatabaseFileIfEmpty(const String&); 106 107 // MobileSafari will grab this mutex on the main thread before dispatching the task to 108 // clean up zero byte database files. Any operations to open new database will have to 109 // wait for that task to finish by waiting on this mutex. 110 static Mutex& openDatabaseMutex(); 111 112 static void emptyDatabaseFilesRemovalTaskWillBeScheduled(); 113 static void emptyDatabaseFilesRemovalTaskDidFinish(); 114 115 void setDatabasesPaused(bool); 116 #endif 117 103 118 void setClient(DatabaseManagerClient*); 104 119 -
trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp
r157653 r161638 519 519 } 520 520 521 #if PLATFORM(IOS) 522 bool SQLTransactionBackend::shouldPerformWhilePaused() const 523 { 524 // SQLTransactions should only run-while-paused if they have progressed passed the first transaction step. 525 return m_nextState != SQLTransactionState::AcquireLock; 526 } 527 #endif 528 521 529 void SQLTransactionBackend::executeSQL(PassOwnPtr<AbstractSQLStatement> statement, 522 530 const String& sqlStatement, const Vector<SQLValue>& arguments, int permissions) -
trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h
r157653 r161638 68 68 void lockAcquired(); 69 69 void performNextStep(); 70 71 #if PLATFORM(IOS) 72 bool shouldPerformWhilePaused() const; 73 #endif 70 74 71 75 DatabaseBackend* database() { return m_database.get(); } -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r161628 r161638 64 64 01D3CF8614BD0A3000FE9970 /* WebGLSharedObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 01D3CF8014BD0A3000FE9970 /* WebGLSharedObject.cpp */; }; 65 65 01D3CF8714BD0A3000FE9970 /* WebGLSharedObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 01D3CF8114BD0A3000FE9970 /* WebGLSharedObject.h */; }; 66 01E6C2E41194B2820050821C /* SpellingDot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 01E6C2E31194B2820050821C /* SpellingDot@2x.png */; }; 66 67 0562F9461573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0562F9441573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp */; }; 67 68 0562F9471573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 0562F9451573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h */; }; … … 3568 3569 A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */; }; 3569 3570 A1C7FAA2133A5D3500D6732D /* JSXPathResultCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1C7FAA1133A5D3500D6732D /* JSXPathResultCustom.cpp */; }; 3571 A1DE712D18612AC100734192 /* TouchEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1DE712B18612AC100734192 /* TouchEvents.cpp */; }; 3572 A1DE71321861322200734192 /* TouchConstructors.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1DE71301861322200734192 /* TouchConstructors.cpp */; }; 3570 3573 A1E1154413015C3D0054AC8C /* DistantLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */; }; 3571 3574 A1E1154613015C4E0054AC8C /* PointLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154513015C4E0054AC8C /* PointLightSource.cpp */; }; … … 3640 3643 A5AFB350115151A700B045CB /* StepRange.h in Headers */ = {isa = PBXBuildFile; fileRef = A5AFB34E115151A700B045CB /* StepRange.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3641 3644 A5C566AB127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C566AA127A3AAD00E8A3FF /* DiskImageCacheClientIOS.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3645 A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */; }; 3646 A5DEBDA416FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */; }; 3642 3647 A5F6E16B132ED46E008EDAE3 /* Autocapitalize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */; }; 3643 3648 A5F9EF701266750D00FCCF52 /* DiskImageCacheIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5F9EF6E1266750D00FCCF52 /* DiskImageCacheIOS.mm */; }; … … 5329 5334 BE88E0E11715D2A200658D98 /* VideoTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE88E0D51715D2A200658D98 /* VideoTrackList.cpp */; }; 5330 5335 BE88E0E21715D2A200658D98 /* VideoTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = BE88E0D61715D2A200658D98 /* VideoTrackList.h */; }; 5336 BE8C753110681324001E93F5 /* SpellingDot.png in Resources */ = {isa = PBXBuildFile; fileRef = BE8C753010681324001E93F5 /* SpellingDot.png */; }; 5331 5337 BE8EF042171C8FF9009B48C3 /* JSAudioTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE8EF03E171C8FF9009B48C3 /* JSAudioTrack.cpp */; }; 5332 5338 BE8EF043171C8FF9009B48C3 /* JSAudioTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = BE8EF03F171C8FF9009B48C3 /* JSAudioTrack.h */; }; … … 5581 5587 D01A27AD10C9BFD800026A42 /* SpaceSplitString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */; }; 5582 5588 D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */ = {isa = PBXBuildFile; fileRef = D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5589 D02B64B214089E56006EFA21 /* DictationPhraseWithAlternativesDot.png in Resources */ = {isa = PBXBuildFile; fileRef = D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */; }; 5590 D02B64B314089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */; }; 5583 5591 D05CED290A40BB2C00C5AF38 /* FormatBlockCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */; }; 5584 5592 D05CED2A0A40BB2C00C5AF38 /* FormatBlockCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */; }; … … 5593 5601 D0B0556909C6700100307E43 /* CreateLinkCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0B0556709C6700100307E43 /* CreateLinkCommand.cpp */; }; 5594 5602 D0BC54491443AC4A00E105DA /* CachedStyleSheetClient.h in Headers */ = {isa = PBXBuildFile; fileRef = D0BC54481443AC4A00E105DA /* CachedStyleSheetClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5603 D0BD4F5C1408850F006839B6 /* DictationCommandIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0BD4F5A1408850F006839B6 /* DictationCommandIOS.cpp */; }; 5604 D0BD4F5D1408850F006839B6 /* DictationCommandIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = D0BD4F5B1408850F006839B6 /* DictationCommandIOS.h */; }; 5595 5605 D0CE58F8125E4CC200F3F199 /* ResourceLoadScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0CE58F6125E4CC200F3F199 /* ResourceLoadScheduler.cpp */; }; 5596 5606 D0CE58F9125E4CC200F3F199 /* ResourceLoadScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = D0CE58F7125E4CC200F3F199 /* ResourceLoadScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 6457 6467 FEBC5F3116BD0CC300659BD3 /* DatabaseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEBC5F2F16BD0CC300659BD3 /* DatabaseBase.cpp */; }; 6458 6468 FEBC5F3216BD0CC300659BD3 /* DatabaseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6469 FED13D2A0CEA91DF00D89466 /* DOMUIKitExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = FED13D260CEA91DF00D89466 /* DOMUIKitExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6470 FED13D2B0CEA91DF00D89466 /* DOMUIKitExtensions.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D270CEA91DF00D89466 /* DOMUIKitExtensions.mm */; }; 6459 6471 FED13D3A0CEA934600D89466 /* EditorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D390CEA934600D89466 /* EditorIOS.mm */; }; 6460 6472 FED13D3D0CEA936A00D89466 /* FrameIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D3B0CEA936A00D89466 /* FrameIOS.mm */; }; … … 6739 6751 01D3CF8014BD0A3000FE9970 /* WebGLSharedObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLSharedObject.cpp; path = canvas/WebGLSharedObject.cpp; sourceTree = "<group>"; }; 6740 6752 01D3CF8114BD0A3000FE9970 /* WebGLSharedObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLSharedObject.h; path = canvas/WebGLSharedObject.h; sourceTree = "<group>"; }; 6753 01E6C2E31194B2820050821C /* SpellingDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "SpellingDot@2x.png"; sourceTree = "<group>"; }; 6741 6754 0562F9441573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSSVGDocumentValue.cpp; sourceTree = "<group>"; }; 6742 6755 0562F9451573ECEB0031CA16 /* WebKitCSSSVGDocumentValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSSVGDocumentValue.h; sourceTree = "<group>"; }; … … 10521 10534 A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElementFactory.h; sourceTree = "<group>"; }; 10522 10535 A1C7FAA1133A5D3500D6732D /* JSXPathResultCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXPathResultCustom.cpp; sourceTree = "<group>"; }; 10536 A1DE712B18612AC100734192 /* TouchEvents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TouchEvents.cpp; sourceTree = "<group>"; }; 10537 A1DE71301861322200734192 /* TouchConstructors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TouchConstructors.cpp; sourceTree = "<group>"; }; 10523 10538 A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DistantLightSource.cpp; path = filters/DistantLightSource.cpp; sourceTree = "<group>"; }; 10524 10539 A1E1154513015C4E0054AC8C /* PointLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PointLightSource.cpp; path = filters/PointLightSource.cpp; sourceTree = "<group>"; }; … … 10602 10617 A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyEventCocoa.h; path = cocoa/KeyEventCocoa.h; sourceTree = "<group>"; }; 10603 10618 A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = KeyEventCocoa.mm; path = cocoa/KeyEventCocoa.mm; sourceTree = "<group>"; }; 10619 A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitPlaybackTargetAvailabilityEvent.cpp; sourceTree = "<group>"; }; 10620 A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitPlaybackTargetAvailabilityEvent.h; sourceTree = "<group>"; }; 10621 A5DEBDA116FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitPlaybackTargetAvailabilityEvent.idl; sourceTree = "<group>"; }; 10604 10622 A5F6E16C132ED46E008EDAE3 /* Autocapitalize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Autocapitalize.cpp; sourceTree = "<group>"; }; 10605 10623 A5F9EF6E1266750D00FCCF52 /* DiskImageCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiskImageCacheIOS.mm; sourceTree = "<group>"; }; … … 12535 12553 BE88E0D61715D2A200658D98 /* VideoTrackList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackList.h; sourceTree = "<group>"; }; 12536 12554 BE88E0D71715D2A200658D98 /* VideoTrackList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VideoTrackList.idl; sourceTree = "<group>"; }; 12555 BE8C753010681324001E93F5 /* SpellingDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = SpellingDot.png; sourceTree = "<group>"; }; 12537 12556 BE8EF03E171C8FF9009B48C3 /* JSAudioTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioTrack.cpp; sourceTree = "<group>"; }; 12538 12557 BE8EF03F171C8FF9009B48C3 /* JSAudioTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAudioTrack.h; sourceTree = "<group>"; }; … … 12847 12866 D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceSplitString.cpp; sourceTree = "<group>"; }; 12848 12867 D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = "<group>"; }; 12868 D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = DictationPhraseWithAlternativesDot.png; sourceTree = "<group>"; }; 12869 D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "DictationPhraseWithAlternativesDot@2x.png"; sourceTree = "<group>"; }; 12849 12870 D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormatBlockCommand.cpp; sourceTree = "<group>"; }; 12850 12871 D05CED280A40BB2C00C5AF38 /* FormatBlockCommand.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FormatBlockCommand.h; sourceTree = "<group>"; }; … … 12859 12880 D0B0556709C6700100307E43 /* CreateLinkCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CreateLinkCommand.cpp; sourceTree = "<group>"; }; 12860 12881 D0BC54481443AC4A00E105DA /* CachedStyleSheetClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedStyleSheetClient.h; sourceTree = "<group>"; }; 12882 D0BD4F5A1408850F006839B6 /* DictationCommandIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationCommandIOS.cpp; sourceTree = "<group>"; }; 12883 D0BD4F5B1408850F006839B6 /* DictationCommandIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictationCommandIOS.h; sourceTree = "<group>"; }; 12861 12884 D0CE58F6125E4CC200F3F199 /* ResourceLoadScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadScheduler.cpp; sourceTree = "<group>"; }; 12862 12885 D0CE58F7125E4CC200F3F199 /* ResourceLoadScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadScheduler.h; sourceTree = "<group>"; }; … … 13818 13841 FEBC5F2F16BD0CC300659BD3 /* DatabaseBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseBase.cpp; sourceTree = "<group>"; }; 13819 13842 FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseBase.h; sourceTree = "<group>"; }; 13843 FED13D260CEA91DF00D89466 /* DOMUIKitExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMUIKitExtensions.h; sourceTree = "<group>"; }; 13844 FED13D270CEA91DF00D89466 /* DOMUIKitExtensions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMUIKitExtensions.mm; sourceTree = "<group>"; }; 13820 13845 FED13D390CEA934600D89466 /* EditorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorIOS.mm; sourceTree = "<group>"; }; 13821 13846 FED13D3B0CEA936A00D89466 /* FrameIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameIOS.mm; sourceTree = "<group>"; }; … … 13826 13851 FEE1811116C319E800084849 /* SQLTransactionBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLTransactionBackend.cpp; sourceTree = "<group>"; }; 13827 13852 FEE1811216C319E800084849 /* SQLTransactionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLTransactionBackend.h; sourceTree = "<group>"; }; 13853 FEE7D6610D99AD16005351F6 /* iOS.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = iOS.xcconfig; sourceTree = "<group>"; }; 13828 13854 FF945EC9161F7F3600971BC8 /* PseudoElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PseudoElement.cpp; sourceTree = "<group>"; }; 13829 13855 FF945ECA161F7F3600971BC8 /* PseudoElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoElement.h; sourceTree = "<group>"; }; … … 14413 14439 children = ( 14414 14440 CD0DBB3E142274E600280263 /* audio */, 14441 65998A650E5F5FD3004E097A /* images */, 14415 14442 46F9D5DA0B0D60170028EE36 /* aliasCursor.png */, 14416 14443 46D4F2460AF97E810035385A /* cellCursor.png */, … … 14919 14946 1CDD45E40BA9C84600F90147 /* DebugRelease.xcconfig */, 14920 14947 449098B10F8F82520076A327 /* FeatureDefines.xcconfig */, 14948 FEE7D6610D99AD16005351F6 /* iOS.xcconfig */, 14921 14949 1C904DF90BA9D2C80081E9D0 /* Version.xcconfig */, 14922 14950 1CDD45E50BA9C84600F90147 /* WebCore.xcconfig */, … … 15280 15308 isa = PBXGroup; 15281 15309 children = ( 15310 D0BD4F5A1408850F006839B6 /* DictationCommandIOS.cpp */, 15311 D0BD4F5B1408850F006839B6 /* DictationCommandIOS.h */, 15282 15312 FED13D390CEA934600D89466 /* EditorIOS.mm */, 15283 15313 ); … … 15999 16029 ); 16000 16030 path = mac; 16031 sourceTree = "<group>"; 16032 }; 16033 65998A650E5F5FD3004E097A /* images */ = { 16034 isa = PBXGroup; 16035 children = ( 16036 D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */, 16037 D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */, 16038 BE8C753010681324001E93F5 /* SpellingDot.png */, 16039 01E6C2E31194B2820050821C /* SpellingDot@2x.png */, 16040 ); 16041 name = images; 16001 16042 sourceTree = "<group>"; 16002 16043 }; … … 17424 17465 isa = PBXGroup; 17425 17466 children = ( 17467 CE26169D187E6554007955F3 /* airplay */, 17426 17468 072AE1DE183C0513000A5988 /* plugins */, 17427 17469 CDA98DBD16014E0800FEA3B1 /* encryptedmedia */, … … 20199 20241 BC1A37A7097C715F0019F3D8 /* DOMStylesheets.h */, 20200 20242 BC1A37A8097C715F0019F3D8 /* DOMTraversal.h */, 20243 FED13D260CEA91DF00D89466 /* DOMUIKitExtensions.h */, 20244 FED13D270CEA91DF00D89466 /* DOMUIKitExtensions.mm */, 20201 20245 BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */, 20202 20246 BC1A37AA097C715F0019F3D8 /* DOMViews.h */, … … 20613 20657 isa = PBXGroup; 20614 20658 children = ( 20659 CE261694187E6469007955F3 /* ios */, 20615 20660 BC6C49F10D7DBA0500FFA558 /* JSImageConstructor.cpp */, 20616 20661 BC6C49F20D7DBA0500FFA558 /* JSImageConstructor.h */, … … 20921 20966 ); 20922 20967 path = mediasource; 20968 sourceTree = "<group>"; 20969 }; 20970 CE261694187E6469007955F3 /* ios */ = { 20971 isa = PBXGroup; 20972 children = ( 20973 A1DE71301861322200734192 /* TouchConstructors.cpp */, 20974 ); 20975 path = ios; 20976 sourceTree = "<group>"; 20977 }; 20978 CE26169D187E6554007955F3 /* airplay */ = { 20979 isa = PBXGroup; 20980 children = ( 20981 A5DEBD9F16FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp */, 20982 A5DEBDA016FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h */, 20983 A5DEBDA116FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.idl */, 20984 ); 20985 path = airplay; 20986 sourceTree = "<group>"; 20987 }; 20988 CE2616A4187E65C1007955F3 /* ios */ = { 20989 isa = PBXGroup; 20990 children = ( 20991 A1DE712B18612AC100734192 /* TouchEvents.cpp */, 20992 ); 20993 path = ios; 20923 20994 sourceTree = "<group>"; 20924 20995 }; … … 21792 21863 isa = PBXGroup; 21793 21864 children = ( 21865 CE2616A4187E65C1007955F3 /* ios */, 21794 21866 E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */, 21795 21867 E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */, … … 23356 23428 0705851317FA7107005F2BCB /* JSMediaStreamCapabilities.h in Headers */, 23357 23429 BC53DA601143141A000D817E /* DOMObjectHashTableMap.h in Headers */, 23430 FED13D2A0CEA91DF00D89466 /* DOMUIKitExtensions.h in Headers */, 23358 23431 85C7F5D00AAFB8D9004014DD /* DOMOverflowEvent.h in Headers */, 23359 23432 85989DCF0ACC8BBD00A0BC51 /* DOMOverflowEventInternal.h in Headers */, … … 25029 25102 514BC843161CF05C004D52F4 /* ResourceBuffer.h in Headers */, 25030 25103 7EE6846A12D26E3800E79415 /* ResourceError.h in Headers */, 25104 D0BD4F5D1408850F006839B6 /* DictationCommandIOS.h in Headers */, 25031 25105 934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */, 25032 25106 514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */, … … 25696 25770 F513A3EA15FF4841001526DB /* ValidationMessageClient.h in Headers */, 25697 25771 15C7708D100D3C6B005BA267 /* ValidityState.h in Headers */, 25772 A5DEBDA416FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.h in Headers */, 25698 25773 FD3160AF12B026F700C1A359 /* VectorMath.h in Headers */, 25699 25774 BCA257151293C010007A263D /* VerticalPositionCache.h in Headers */, … … 26060 26135 buildActionMask = 2147483647; 26061 26136 files = ( 26137 D02B64B214089E56006EFA21 /* DictationPhraseWithAlternativesDot.png in Resources */, 26062 26138 46F9D5DD0B0D60170028EE36 /* aliasCursor.png in Resources */, 26139 D02B64B314089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png in Resources */, 26063 26140 46D4F2490AF97E810035385A /* cellCursor.png in Resources */, 26064 26141 93153BDE141959F400FCF5BE /* deleteButton.png in Resources */, 26142 BE8C753110681324001E93F5 /* SpellingDot.png in Resources */, 26065 26143 93153BCD1417FBBF00FCF5BE /* deleteButton@2x.png in Resources */, 26066 26144 93153BE014195A2800FCF5BE /* deleteButtonPressed.png in Resources */, … … 26069 26147 85136C9A0AED665900F90A3D /* eastWestResizeCursor.png in Resources */, 26070 26148 85136C9B0AED665900F90A3D /* helpCursor.png in Resources */, 26149 01E6C2E41194B2820050821C /* SpellingDot@2x.png in Resources */, 26071 26150 7CC7E3D717208C0F003C5277 /* IDNScriptWhiteList.txt in Resources */, 26072 26151 93153BE414195B2A00FCF5BE /* inputSpeech.png in Resources */, … … 26493 26572 BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */, 26494 26573 4A6E9FC313C17D1D0046A7F8 /* CSSFontFeatureValue.cpp in Sources */, 26574 A5DEBDA316FB908700836FE0 /* WebKitPlaybackTargetAvailabilityEvent.cpp in Sources */, 26495 26575 BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */, 26496 26576 A80E6CF10A1989CA007FB8C5 /* CSSFontValue.cpp in Sources */, … … 27194 27274 F55B3DC11251F12D003EF269 /* ImageInputType.cpp in Sources */, 27195 27275 51D719E6181106E00016DC51 /* IDBOpenDBRequest.cpp in Sources */, 27276 FED13D2B0CEA91DF00D89466 /* DOMUIKitExtensions.mm in Sources */, 27196 27277 089582550E857A7E00F82C83 /* ImageLoader.cpp in Sources */, 27197 27278 B275357B0B053814002CE64F /* ImageMac.mm in Sources */, … … 27375 27456 65DF31F509D1CC60000BE325 /* JSDocumentType.cpp in Sources */, 27376 27457 1AC2260C0DB69F190089B669 /* JSDOMApplicationCache.cpp in Sources */, 27458 A1DE712D18612AC100734192 /* TouchEvents.cpp in Sources */, 27377 27459 93B70D6309EB0C7C009D8468 /* JSDOMBinding.cpp in Sources */, 27378 27460 BC60D7C00D29A46300B9918F /* JSDOMCoreException.cpp in Sources */, … … 27538 27620 D6489D25166FFCF1007C031B /* JSHTMLTemplateElement.cpp in Sources */, 27539 27621 D6F7960D166FFECE0076DD18 /* JSHTMLTemplateElementCustom.cpp in Sources */, 27622 A1DE71321861322200734192 /* TouchConstructors.cpp in Sources */, 27540 27623 A80E7E9E0A1A83E3007FB8C5 /* JSHTMLTextAreaElement.cpp in Sources */, 27541 27624 A80E7B130A19D606007FB8C5 /* JSHTMLTitleElement.cpp in Sources */, … … 29061 29144 4476531B133170990006B789 /* SSLKeyGeneratorIOS.cpp in Sources */, 29062 29145 1AB7FC7A0A8B92EC00D9D37B /* XPathPath.cpp in Sources */, 29146 D0BD4F5C1408850F006839B6 /* DictationCommandIOS.cpp in Sources */, 29063 29147 1AB7FC7C0A8B92EC00D9D37B /* XPathPredicate.cpp in Sources */, 29064 29148 1AB7FC7E0A8B92EC00D9D37B /* XPathResult.cpp in Sources */, -
trunk/Source/WebCore/bindings/js/GCController.cpp
r156804 r161638 82 82 { 83 83 JSLockHolder lock(JSDOMWindow::commonVM()); 84 #if PLATFORM(IOS) 85 // If JavaScript was never run in this process, there's no need to call GC which will 86 // end up creating a VM unnecessarily. 87 if (!JSDOMWindow::commonVMExists()) 88 return; 89 #endif 84 90 if (!JSDOMWindow::commonVM()->heap.isBusy()) 85 91 JSDOMWindow::commonVM()->heap.collectAllGarbage(); … … 98 104 } 99 105 106 #if PLATFORM(IOS) 107 void GCController::releaseExecutableMemory() 108 { 109 JSLockHolder lock(JSDOMWindow::commonVM()); 110 111 if (!JSDOMWindow::commonVMExists()) 112 return; 113 114 // We shouldn't have any javascript running on our stack when this function is called. The 115 // following line asserts that. 116 ASSERT(!JSDOMWindow::commonVM()->dynamicGlobalObject); 117 118 // But be safe in release builds just in case... 119 if (JSDOMWindow::commonVM()->dynamicGlobalObject) 120 return; 121 122 JSDOMWindow::commonVM()->releaseExecutableMemory(); 123 } 124 #endif 125 100 126 void GCController::setJavaScriptGarbageCollectorTimerEnabled(bool enable) 101 127 { -
trunk/Source/WebCore/bindings/js/GCController.h
r156804 r161638 45 45 46 46 void garbageCollectOnAlternateThreadForDebugging(bool waitUntilDone); // Used for stress testing. 47 #if PLATFORM(IOS) 48 void releaseExecutableMemory(); 49 #endif 47 50 void setJavaScriptGarbageCollectorTimerEnabled(bool); 48 51 void discardAllCompiledCode(); -
trunk/Source/WebCore/bindings/js/JSCallbackData.h
r157075 r161638 59 59 ~JSCallbackData() 60 60 { 61 #if !PLATFORM(IOS) 61 62 ASSERT(m_thread == currentThread()); 63 #endif 62 64 } 63 65 -
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
r161241 r161638 41 41 #include <wtf/MainThread.h> 42 42 43 #if PLATFORM(IOS) 44 #include "ChromeClient.h" 45 #include "WebSafeGCActivityCallbackIOS.h" 46 #include "WebSafeIncrementalSweeperIOS.h" 47 #endif 48 43 49 using namespace JSC; 44 50 … … 111 117 return false; 112 118 119 #if ENABLE(INSPECTOR) 113 120 return page->inspectorController()->profilerEnabled(); 121 #else 122 return false; 123 #endif // ENABLE(INSPECTOR) 114 124 #endif 115 125 } … … 167 177 168 178 #if PLATFORM(IOS) 169 if (page->chrome().client() ->isStopping())179 if (page->chrome().client().isStopping()) 170 180 return true; 171 181 #endif … … 203 213 ASSERT(isMainThread()); 204 214 215 #if !PLATFORM(IOS) 205 216 static VM* vm = 0; 217 #else 218 VM*& vm = commonVMInternal(); 219 #endif 206 220 if (!vm) { 207 221 ScriptController::initializeThreading(); 208 222 vm = VM::createLeaked(LargeHeap).leakRef(); 223 #if PLATFORM(IOS) 224 PassOwnPtr<WebSafeGCActivityCallback> activityCallback = WebSafeGCActivityCallback::create(&vm->heap); 225 vm->heap.setActivityCallback(activityCallback); 226 PassOwnPtr<WebSafeIncrementalSweeper> incrementalSweeper = WebSafeIncrementalSweeper::create(&vm->heap); 227 vm->heap.setIncrementalSweeper(incrementalSweeper); 228 vm->makeUsableFromMultipleThreads(); 229 vm->heap.machineThreads().addCurrentThread(); 230 #else 209 231 vm->exclusiveThread = currentThread(); 232 #endif // !PLATFORM(IOS) 210 233 initNormalWorldClientData(vm); 211 234 } … … 213 236 return vm; 214 237 } 238 239 #if PLATFORM(IOS) 240 bool JSDOMWindowBase::commonVMExists() 241 { 242 return commonVMInternal(); 243 } 244 245 VM*& JSDOMWindowBase::commonVMInternal() 246 { 247 ASSERT(isMainThread()); 248 static VM* commonVM; 249 return commonVM; 250 } 251 #endif 215 252 216 253 // JSDOMGlobalObject* is ignored, accessing a window in any context will -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r161220 r161638 40 40 #if ENABLE(SHARED_WORKERS) 41 41 #include "JSSharedWorker.h" 42 #endif 43 44 #if ENABLE(IOS_TOUCH_EVENTS) 45 #include "JSTouchConstructor.h" 46 #include "JSTouchListConstructor.h" 42 47 #endif 43 48 … … 453 458 } 454 459 460 #if ENABLE(IOS_TOUCH_EVENTS) 461 JSValue JSDOMWindow::touch(ExecState* exec) const 462 { 463 return getDOMConstructor<JSTouchConstructor>(exec->vm(), this); 464 } 465 466 JSValue JSDOMWindow::touchList(ExecState* exec) const 467 { 468 return getDOMConstructor<JSTouchListConstructor>(exec->vm(), this); 469 } 470 #endif 471 455 472 // Custom functions 456 473 -
trunk/Source/WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp
r157274 r161638 61 61 } 62 62 63 #if PLATFORM(IOS) 64 JSValue JSDeviceOrientationEvent::webkitCompassHeading(ExecState*) const 65 { 66 DeviceOrientationEvent& imp = impl(); 67 if (!imp.orientation()->canProvideCompassHeading()) 68 return jsNull(); 69 return jsNumber(imp.orientation()->compassHeading()); 70 } 71 72 JSValue JSDeviceOrientationEvent::webkitCompassAccuracy(ExecState*) const 73 { 74 DeviceOrientationEvent& imp = impl(); 75 if (!imp.orientation()->canProvideCompassAccuracy()) 76 return jsNull(); 77 return jsNumber(imp.orientation()->compassAccuracy()); 78 } 79 #endif 80 81 #if !PLATFORM(IOS) 63 82 JSValue JSDeviceOrientationEvent::absolute(ExecState*) const 64 83 { … … 68 87 return jsBoolean(imp.orientation()->absolute()); 69 88 } 89 #endif 70 90 71 91 JSValue JSDeviceOrientationEvent::initDeviceOrientationEvent(ExecState* exec) … … 82 102 bool gammaProvided = !exec->argument(5).isUndefinedOrNull(); 83 103 double gamma = exec->argument(5).toNumber(exec); 104 #if PLATFORM(IOS) 105 bool compassHeadingProvided = !exec->argument(6).isUndefinedOrNull(); 106 double compassHeading = exec->argument(6).toNumber(exec); 107 bool compassAccuracyProvided = !exec->argument(7).isUndefinedOrNull(); 108 double compassAccuracy = exec->argument(7).toNumber(exec); 109 RefPtr<DeviceOrientationData> orientation = DeviceOrientationData::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma, compassHeadingProvided, compassHeading, compassAccuracyProvided, compassAccuracy); 110 #else 84 111 bool absoluteProvided = !exec->argument(6).isUndefinedOrNull(); 85 112 bool absolute = exec->argument(6).toBoolean(exec); 86 113 RefPtr<DeviceOrientationData> orientation = DeviceOrientationData::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma, absoluteProvided, absolute); 114 #endif 87 115 impl().initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get()); 88 116 return jsUndefined(); -
trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h
r161563 r161638 30 30 #include <runtime/Completion.h> 31 31 #include <wtf/MainThread.h> 32 33 #if PLATFORM(IOS) 34 #include "WebCoreThread.h" 35 #endif 32 36 33 37 namespace WebCore { -
trunk/Source/WebCore/bindings/js/JSTouchCustom.cpp
r95901 r161638 26 26 #include "config.h" 27 27 28 #if !PLATFORM(IOS) 28 29 #if ENABLE(TOUCH_EVENTS) 29 30 … … 47 48 48 49 #endif // ENABLE(TOUCH_EVENTS) 50 #endif // !PLATFORM(IOS) -
trunk/Source/WebCore/bindings/js/JSTouchListCustom.cpp
r95901 r161638 26 26 #include "config.h" 27 27 28 #if !PLATFORM(IOS) 28 29 #if ENABLE(TOUCH_EVENTS) 29 30 … … 47 48 48 49 #endif // ENABLE(TOUCH_EVENTS) 50 #endif // !PLATFORM(IOS) -
trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp
r159605 r161638 149 149 // Page can be null if we are continuing because the Page closed. 150 150 Page* page = toPage(globalObject); 151 #if PLATFORM(IOS) 152 // FIXME: Can this happen in open source too, or is this iOS (multi-threaded) only? 153 if (!page) 154 return; 155 #endif 151 156 ASSERT(!page || page == m_pausedPage); 152 157 -
trunk/Source/WebCore/bindings/js/ScriptController.cpp
r160457 r161638 62 62 void ScriptController::initializeThreading() 63 63 { 64 #if !PLATFORM(IOS) 64 65 JSC::initializeThreading(); 65 66 WTF::initializeMainThread(); 67 #endif 66 68 } 67 69 -
trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp
r160682 r161638 35 35 36 36 #include "ContentSearchUtils.h" 37 #include "EventLoop.h" 37 38 #include "Frame.h" 38 39 #include "JSDOMWindowCustom.h" … … 50 51 #include <wtf/text/WTFString.h> 51 52 53 #if PLATFORM(IOS) 54 #include "JSDOMWindowBase.h" 55 #include "WebCoreThreadInternal.h" 56 #endif 57 52 58 using namespace JSC; 53 59 … … 296 302 TimerBase::fireTimersInNestedEventLoop(); 297 303 304 #if PLATFORM(IOS) 305 // On iOS, running an EventLoop causes us to run a nested WebRunLoop. 306 // Since the WebThread is autoreleased at the end of run loop iterations 307 // we need to gracefully handle releasing and reacquiring the lock. 308 ASSERT(WebThreadIsLockedOrDisabled()); 309 { 310 if (WebThreadIsEnabled()) 311 JSC::JSLock::DropAllLocks dropAllLocks(WebCore::JSDOMWindowBase::commonVM(), JSC::JSLock::DropAllLocks::AlwaysDropLocks); 312 WebRunLoopEnableNested(); 313 #endif 314 298 315 m_runningNestedMessageLoop = true; 299 316 m_doneProcessingDebuggerEvents = false; … … 301 318 m_runningNestedMessageLoop = false; 302 319 320 #if PLATFORM(IOS) 321 WebRunLoopDisableNested(); 322 } 323 ASSERT(WebThreadIsLockedOrDisabled()); 324 #endif 303 325 didContinue(vmEntryGlobalObject); 304 326 dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidContinue, vmEntryGlobalObject); -
trunk/Source/WebCore/bindings/objc/DOM.mm
r160152 r161638 53 53 #import <JavaScriptCore/APICast.h> 54 54 #import <wtf/HashMap.h> 55 56 #if PLATFORM(IOS) 57 #import "FocusController.h" 58 #import "HTMLLinkElement.h" 59 #import "KeyboardEvent.h" 60 #import "URL.h" 61 #import "MediaList.h" 62 #import "MediaQueryEvaluator.h" 63 #import "NodeRenderStyle.h" 64 #import "Page.h" 65 #import "RenderView.h" 66 #import "Touch.h" 67 #import "WAKAppKitStubs.h" 68 #import "WAKWindow.h" 69 #import "WebCoreThreadMessage.h" 70 #endif 55 71 56 72 using namespace JSC; … … 177 193 } 178 194 195 #if PLATFORM(IOS) 196 static WKQuad wkQuadFromFloatQuad(const FloatQuad& inQuad) 197 { 198 WKQuad theQuad; 199 theQuad.p1 = inQuad.p1(); 200 theQuad.p2 = inQuad.p2(); 201 theQuad.p3 = inQuad.p3(); 202 theQuad.p4 = inQuad.p4(); 203 204 return theQuad; 205 } 206 207 static NSArray *kit(const Vector<FloatQuad>& quads) 208 { 209 size_t size = quads.size(); 210 NSMutableArray *array = [NSMutableArray arrayWithCapacity:size]; 211 for (size_t i = 0; i < size; ++i) { 212 WKQuadObject* quadObject = [[WKQuadObject alloc] initWithQuad:wkQuadFromFloatQuad(quads[i])]; 213 [array addObject:quadObject]; 214 [quadObject release]; 215 } 216 return array; 217 } 218 219 static inline float min4(float a, float b, float c, float d) 220 { 221 return std::min(std::min(a, b), std::min(c, d)); 222 } 223 224 static inline float max4(float a, float b, float c, float d) 225 { 226 return std::max(std::max(a, b), std::max(c, d)); 227 } 228 229 static inline WKQuad emptyQuad() 230 { 231 WKQuad zeroQuad = { CGPointZero, CGPointZero, CGPointZero, CGPointZero }; 232 return zeroQuad; 233 } 234 #endif 235 179 236 } // namespace WebCore 237 238 #if PLATFORM(IOS) 239 @implementation WKQuadObject 240 241 - (id)initWithQuad:(WKQuad)quad 242 { 243 if ((self = [super init])) 244 { 245 _quad = quad; 246 } 247 return self; 248 } 249 250 - (WKQuad)quad 251 { 252 return _quad; 253 } 254 255 - (CGRect)boundingBox 256 { 257 float left = WebCore::min4(_quad.p1.x, _quad.p2.x, _quad.p3.x, _quad.p4.x); 258 float top = WebCore::min4(_quad.p1.y, _quad.p2.y, _quad.p3.y, _quad.p4.y); 259 260 float right = WebCore::max4(_quad.p1.x, _quad.p2.x, _quad.p3.x, _quad.p4.x); 261 float bottom = WebCore::max4(_quad.p1.y, _quad.p2.y, _quad.p3.y, _quad.p4.y); 262 263 return CGRectMake(left, top, right - left, bottom - top); 264 } 265 266 @end 267 #endif 180 268 181 269 @implementation DOMNode (WebCoreInternal) … … 264 352 @implementation DOMNode (DOMNodeExtensions) 265 353 354 #if PLATFORM(IOS) 355 - (CGRect)boundingBox 356 #else 266 357 - (NSRect)boundingBox 358 #endif 267 359 { 268 360 // FIXME: Could we move this function to WebCore::Node and autogenerate? … … 270 362 WebCore::RenderObject* renderer = core(self)->renderer(); 271 363 if (!renderer) 364 #if PLATFORM(IOS) 365 return CGRectZero; 366 #else 272 367 return NSZeroRect; 368 #endif 273 369 return renderer->absoluteBoundingBoxRect(); 274 370 } … … 279 375 } 280 376 377 #if PLATFORM(IOS) 378 // quad in page coordinates, taking transforms into account. c.f. - (NSRect)boundingBox; 379 - (WKQuad)absoluteQuad 380 { 381 return [self absoluteQuadAndInsideFixedPosition:0]; 382 } 383 384 - (WKQuad)absoluteQuadAndInsideFixedPosition:(BOOL *)insideFixed 385 { 386 core(self)->document().updateLayoutIgnorePendingStylesheets(); 387 WebCore::RenderObject *renderer = core(self)->renderer(); 388 if (renderer) { 389 Vector<FloatQuad> quads; 390 bool wasFixed = false; 391 renderer->absoluteQuads(quads, &wasFixed); 392 if (insideFixed) 393 *insideFixed = wasFixed; 394 395 if (quads.size() == 0) 396 return WebCore::emptyQuad(); 397 398 if (quads.size() == 1) 399 return wkQuadFromFloatQuad(quads[0]); 400 401 FloatRect boundingRect = quads[0].boundingBox(); 402 for (size_t i = 1; i < quads.size(); ++i) 403 boundingRect.unite(quads[i].boundingBox()); 404 405 return wkQuadFromFloatQuad(boundingRect); 406 } 407 408 return WebCore::emptyQuad(); 409 } 410 411 // this method is like - (CGRect)boundingBox, but it accounts for for transforms 412 - (CGRect)boundingBoxUsingTransforms 413 { 414 core(self)->document().updateLayoutIgnorePendingStylesheets(); 415 WebCore::RenderObject* renderer = core(self)->renderer(); 416 if (!renderer) 417 return CGRectZero; 418 return renderer->absoluteBoundingBoxRect(true); 419 } 420 421 // returns array of WKQuadObject 422 - (NSArray *)lineBoxQuads 423 { 424 core(self)->document().updateLayoutIgnorePendingStylesheets(); 425 WebCore::RenderObject *renderer = core(self)->renderer(); 426 if (renderer) { 427 Vector<WebCore::FloatQuad> quads; 428 renderer->absoluteQuads(quads); 429 return kit(quads); 430 } 431 return nil; 432 } 433 434 - (Element *)_linkElement 435 { 436 WebCore::Node* node = core(self); 437 438 while (node) { 439 if (node->isLink()) 440 return static_cast<WebCore::Element*>(node); 441 node = node->parentNode(); 442 } 443 444 return 0; 445 } 446 447 - (NSURL *)hrefURL 448 { 449 Element *link= [self _linkElement]; 450 if (link) 451 return link->document().completeURL(stripLeadingAndTrailingHTMLSpaces(link->getAttribute(HTMLNames::hrefAttr))); 452 453 return nil; 454 } 455 456 - (NSString *)hrefTarget 457 { 458 Element *target = [self _linkElement]; 459 460 if(target) return target->getAttribute(HTMLNames::targetAttr); 461 462 return nil; 463 } 464 465 - (CGRect)hrefFrame 466 { 467 RenderObject *renderer = [self _linkElement]->renderer(); 468 469 if(renderer) return renderer->absoluteBoundingBoxRect(); 470 471 return NSZeroRect; 472 } 473 474 - (NSString *)hrefLabel 475 { 476 Element *link= [self _linkElement]; 477 478 if (!link) return nil; 479 480 return link->textContent(); 481 } 482 483 - (NSString *)hrefTitle 484 { 485 Element *link= [self _linkElement]; 486 487 if (!link) return nil; 488 489 return link->document().displayStringModifiedByEncoding(static_cast<HTMLElement *>(link)->title()); 490 } 491 492 - (CGRect)boundingFrame 493 { 494 return [self boundingBox]; 495 } 496 497 - (WKQuad)innerFrameQuad // takes transforms into account 498 { 499 core(self)->document().updateLayoutIgnorePendingStylesheets(); 500 RenderObject* renderer = core(self)->renderer(); 501 if (!renderer) 502 return emptyQuad(); 503 504 RenderStyle& style = renderer->style(); 505 IntRect boundingBox = renderer->absoluteBoundingBoxRect(true /* use transforms*/); 506 507 boundingBox.move(style.borderLeftWidth(), style.borderTopWidth()); 508 boundingBox.setWidth(boundingBox.width() - style.borderLeftWidth() - style.borderRightWidth()); 509 boundingBox.setHeight(boundingBox.height() - style.borderBottomWidth() - style.borderTopWidth()); 510 511 // FIXME: This function advertises returning a quad, but it actually returns a bounding box (so there is no rotation, for instance). 512 return wkQuadFromFloatQuad(FloatQuad(boundingBox)); 513 } 514 515 - (float)computedFontSize 516 { 517 WebCore::Node *node = core(self); 518 RenderStyle *style = node->renderStyle(); 519 if (!style) 520 return 0.0f; 521 return style->fontDescription().computedSize(); 522 } 523 524 - (DOMNode *)nextFocusNode 525 { 526 Page *page = core(self)->document().page(); 527 if (!page) 528 return nil; 529 530 RefPtr<KeyboardEvent> key = KeyboardEvent::create(); 531 return kit(page->focusController().nextFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&core(self)->document()), core(self), key.get())); 532 } 533 534 - (DOMNode *)previousFocusNode 535 { 536 Page *page = core(self)->document().page(); 537 if (!page) 538 return nil; 539 540 RefPtr<KeyboardEvent> key = KeyboardEvent::create(); 541 return kit(page->focusController().previousFocusableElement(FocusNavigationScope::focusNavigationScopeOf(&core(self)->document()), core(self), key.get())); 542 } 543 544 #endif // PLATFORM(IOS) 545 281 546 @end 282 547 283 548 @implementation DOMNode (DOMNodeExtensionsPendingPublic) 284 549 550 #if !PLATFORM(IOS) 285 551 - (NSImage *)renderedImage 286 552 { … … 292 558 return [createDragImageForNode(*frame, *node).leakRef() autorelease]; 293 559 } 560 #endif 294 561 295 562 - (NSArray *)textRects … … 322 589 @implementation DOMRange (DOMRangeExtensions) 323 590 591 #if PLATFORM(IOS) 592 - (CGRect)boundingBox 593 #else 324 594 - (NSRect)boundingBox 595 #endif 325 596 { 326 597 // FIXME: The call to updateLayoutIgnorePendingStylesheets should be moved into WebCore::Range. … … 329 600 } 330 601 602 #if !PLATFORM(IOS) 331 603 - (NSImage *)renderedImageForcingBlackText:(BOOL)forceBlackText 604 #else 605 - (CGImageRef)renderedImageForcingBlackText:(BOOL)forceBlackText 606 #endif 332 607 { 333 608 WebCore::Range* range = core(self); … … 361 636 @implementation DOMElement (DOMElementAppKitExtensions) 362 637 638 #if !PLATFORM(IOS) 363 639 - (NSImage*)image 364 640 { … … 372 648 return cachedImage->imageForRenderer(toRenderImage(renderer))->getNSImage(); 373 649 } 650 #endif 374 651 375 652 @end … … 377 654 @implementation DOMElement (WebPrivate) 378 655 656 #if !PLATFORM(IOS) 379 657 - (NSFont *)_font 380 658 { … … 385 663 return renderer->style().font().primaryFont()->getNSFont(); 386 664 } 387 665 #else 666 - (CTFontRef)_font 667 { 668 RenderObject* renderer = core(self)->renderer(); 669 if (!renderer) 670 return nil; 671 return renderer->style().font().primaryFont()->getCTFont(); 672 } 673 #endif 674 675 #if !PLATFORM(IOS) 388 676 - (NSData *)_imageTIFFRepresentation 389 677 { … … 397 685 return (NSData *)cachedImage->imageForRenderer(renderer)->getTIFFRepresentation(); 398 686 } 687 #endif 399 688 400 689 - (NSURL *)_getURLAttribute:(NSString *)name … … 416 705 @end 417 706 707 #if PLATFORM(IOS) 708 @implementation DOMHTMLLinkElement (WebPrivate) 709 - (BOOL)_mediaQueryMatchesForOrientation:(int)orientation 710 { 711 Document& document = static_cast<HTMLLinkElement*>(core(self))->document(); 712 FrameView* frameView = document.frame() ? document.frame()->view() : 0; 713 if (!frameView) 714 return false; 715 int layoutWidth = frameView->layoutWidth(); 716 int layoutHeight = frameView->layoutHeight(); 717 IntSize savedFixedLayoutSize = frameView->fixedLayoutSize(); 718 bool savedUseFixedLayout = frameView->useFixedLayout(); 719 if ((orientation == WebMediaQueryOrientationPortrait && layoutWidth > layoutHeight) || 720 (orientation == WebMediaQueryOrientationLandscape && layoutWidth < layoutHeight)) { 721 // temporarily swap the orientation for the evaluation 722 frameView->setFixedLayoutSize(IntSize(layoutHeight, layoutWidth)); 723 frameView->setUseFixedLayout(true); 724 } 725 726 bool result = [self _mediaQueryMatches]; 727 728 frameView->setFixedLayoutSize(savedFixedLayoutSize); 729 frameView->setUseFixedLayout(savedUseFixedLayout); 730 731 return result; 732 } 733 734 - (BOOL)_mediaQueryMatches 735 { 736 HTMLLinkElement* link = static_cast<HTMLLinkElement*>(core(self)); 737 String media = link->getAttribute(HTMLNames::mediaAttr); 738 if (media.isEmpty()) 739 return true; 740 Document& document = link->document(); 741 742 RefPtr<MediaQuerySet> mediaQuerySet = MediaQuerySet::createAllowingDescriptionSyntax(media); 743 MediaQueryEvaluator screenEval("screen", document.frame(), document.renderView() ? &document.renderView()->style() : 0); 744 745 return screenEval.eval(mediaQuerySet.get()); 746 } 747 @end 748 #endif 749 418 750 //------------------------------------------------------------------------------------------ 419 751 // DOMRange … … 443 775 @implementation DOMRGBColor (WebPrivate) 444 776 777 #if !PLATFORM(IOS) 445 778 // FIXME: This should be removed as soon as all internal Apple uses of it have been replaced with 446 779 // calls to the public method - (NSColor *)color. … … 449 782 return [self color]; 450 783 } 784 #endif 451 785 452 786 @end -
trunk/Source/WebCore/bindings/objc/DOMEvents.h
r138992 r161638 41 41 #import <WebCore/DOMUIEvent.h> 42 42 #import <WebCore/DOMWheelEvent.h> 43 44 #if defined(ENABLE_IOS_TOUCH_EVENTS) && ENABLE_IOS_TOUCH_EVENTS 45 #import <WebCore/DOMTouchEvent.h> 46 #endif 47 48 #if defined(ENABLE_IOS_GESTURE_EVENTS) && ENABLE_IOS_GESTURE_EVENTS 49 #import <WebCore/DOMGestureEvent.h> 50 #endif -
trunk/Source/WebCore/bindings/objc/DOMEvents.mm
r156241 r161638 41 41 #import "EventNames.h" 42 42 43 #if ENABLE(TOUCH_EVENTS) 44 #import "DOMTouchEvent.h" 45 #endif 46 47 #if ENABLE(IOS_GESTURE_EVENTS) 48 #import "DOMGestureEvent.h" 49 #endif 50 43 51 using WebCore::eventNames; 44 52 … … 55 63 return [DOMTextEvent class]; 56 64 if (desiredInterface == WebCore::WheelEventInterfaceType) 57 return [DOMWheelEvent class]; 65 return [DOMWheelEvent class]; 66 #if PLATFORM(IOS) && ENABLE(TOUCH_EVENTS) 67 if (desiredInterface == WebCore::TouchEventInterfaceType) 68 return [DOMTouchEvent class]; 69 #endif 70 #if ENABLE(IOS_GESTURE_EVENTS) 71 if (desiredInterface == WebCore::GestureEventInterfaceType) 72 return [DOMGestureEvent class]; 73 #endif 58 74 return [DOMUIEvent class]; 59 75 } -
trunk/Source/WebCore/bindings/objc/DOMExtensions.h
r161406 r161638 44 44 #import <WebCore/DOMRange.h> 45 45 46 #if defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED 47 #import <CoreGraphics/CoreGraphics.h> 48 #endif 49 46 50 @class NSArray; 47 51 @class NSImage; 48 52 @class NSURL; 49 53 54 55 #if defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED 56 @interface DOMHTMLElement (DOMHTMLElementExtensions) 57 - (int)scrollXOffset; 58 - (int)scrollYOffset; 59 - (void)setScrollXOffset:(int)x scrollYOffset:(int)y; 60 - (void)setScrollXOffset:(int)x scrollYOffset:(int)y adjustForIOSCaret:(BOOL)adjustForIOSCaret; 61 - (void)absolutePosition:(int *)x :(int *)y :(int *)w :(int *)h; 62 @end 63 #endif 64 65 #if defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED 66 typedef struct _WKQuad { 67 CGPoint p1; 68 CGPoint p2; 69 CGPoint p3; 70 CGPoint p4; 71 } WKQuad; 72 73 @interface WKQuadObject : NSObject 74 { 75 WKQuad _quad; 76 } 77 78 - (id)initWithQuad:(WKQuad)quad; 79 - (WKQuad)quad; 80 - (CGRect)boundingBox; 81 @end 82 #endif 83 50 84 @interface DOMNode (DOMNodeExtensions) 85 #if defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED 86 - (CGRect)boundingBox; 87 #else 51 88 - (NSRect)boundingBox WEBKIT_AVAILABLE_MAC(10_5); 89 #endif 52 90 - (NSArray *)lineBoxRects WEBKIT_AVAILABLE_MAC(10_5); 91 92 #if defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED 93 - (CGRect)boundingBoxUsingTransforms; // takes transforms into account 94 95 - (WKQuad)absoluteQuad; 96 - (WKQuad)absoluteQuadAndInsideFixedPosition:(BOOL *)insideFixed; 97 - (NSArray *)lineBoxQuads; // returns array of WKQuadObject 98 99 - (NSURL *)hrefURL; 100 - (CGRect)hrefFrame; 101 - (NSString *)hrefTarget; 102 - (NSString *)hrefLabel; 103 - (NSString *)hrefTitle; 104 - (CGRect)boundingFrame; 105 - (WKQuad)innerFrameQuad; // takes transforms into account 106 - (float)computedFontSize; 107 - (DOMNode *)nextFocusNode; 108 - (DOMNode *)previousFocusNode; 109 #endif 53 110 @end 54 111 55 112 @interface DOMElement (DOMElementAppKitExtensions) 113 #if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED 56 114 - (NSImage *)image WEBKIT_AVAILABLE_MAC(10_5); 115 #endif 57 116 @end 58 117 … … 61 120 - (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text WEBKIT_AVAILABLE_MAC(10_5); 62 121 @end 122 123 #if defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED 124 @interface DOMHTMLAreaElement (DOMHTMLAreaElementExtensions) 125 - (CGRect)boundingFrameForOwner:(DOMNode *)anOwner; 126 @end 127 128 @interface DOMHTMLSelectElement (DOMHTMLSelectElementExtensions) 129 - (DOMNode *)listItemAtIndex:(int)anIndex; 130 @end 131 #endif -
trunk/Source/WebCore/bindings/objc/DOMHTML.mm
r157058 r161638 50 50 #import "markup.h" 51 51 52 #if PLATFORM(IOS) 53 #import "Autocapitalize.h" 54 #import "DOMHTMLElementInternal.h" 55 #import "HTMLTextFormControlElement.h" 56 #import "JSMainThreadExecState.h" 57 #import "RenderLayer.h" 58 #import "WAKWindow.h" 59 #import "WebCoreThreadMessage.h" 60 #endif 61 62 #if PLATFORM(IOS) 63 64 using namespace WebCore; 65 66 @implementation DOMHTMLElement (DOMHTMLElementExtensions) 67 68 - (int)scrollXOffset 69 { 70 RenderObject *renderer = core(self)->renderer(); 71 if (!renderer) 72 return 0; 73 74 if (!renderer->isRenderBlockFlow()) 75 renderer = renderer->containingBlock(); 76 77 if (!renderer->isBox() || !renderer->hasOverflowClip()) 78 return 0; 79 80 RenderBox *renderBox = toRenderBox(renderer); 81 return renderBox->layer()->scrollXOffset(); 82 } 83 84 - (int)scrollYOffset 85 { 86 RenderObject *renderer = core(self)->renderer(); 87 if (!renderer) 88 return 0; 89 90 if (!renderer->isRenderBlockFlow()) 91 renderer = renderer->containingBlock(); 92 if (!renderer->isBox() || !renderer->hasOverflowClip()) 93 return 0; 94 95 RenderBox *renderBox = toRenderBox(renderer); 96 return renderBox->layer()->scrollYOffset(); 97 } 98 99 - (void)setScrollXOffset:(int)x scrollYOffset:(int)y 100 { 101 [self setScrollXOffset:x scrollYOffset:y adjustForIOSCaret:NO]; 102 } 103 104 - (void)setScrollXOffset:(int)x scrollYOffset:(int)y adjustForIOSCaret:(BOOL)adjustForIOSCaret 105 { 106 RenderObject *renderer = core(self)->renderer(); 107 if (!renderer) 108 return; 109 110 if (!renderer->isRenderBlockFlow()) 111 renderer = renderer->containingBlock(); 112 if (!renderer->hasOverflowClip() || !renderer->isBox()) 113 return; 114 115 RenderBox *renderBox = toRenderBox(renderer); 116 RenderLayer *layer = renderBox->layer(); 117 if (adjustForIOSCaret) 118 layer->setAdjustForIOSCaretWhenScrolling(true); 119 layer->scrollToOffset(IntSize(x, y)); 120 if (adjustForIOSCaret) 121 layer->setAdjustForIOSCaretWhenScrolling(false); 122 } 123 124 - (void)absolutePosition:(int *)x :(int *)y :(int *)w :(int *)h { 125 RenderBox *renderer = core(self)->renderBox(); 126 if (renderer) { 127 if (w) 128 *w = renderer->width(); 129 if (h) 130 *h = renderer->width(); 131 if (x && y) { 132 FloatPoint floatPoint(*x, *y); 133 renderer->localToAbsolute(floatPoint); 134 IntPoint point = roundedIntPoint(floatPoint); 135 *x = point.x(); 136 *y = point.y(); 137 } 138 } 139 } 140 141 @end 142 143 #endif // PLATFORM(IOS) 144 52 145 //------------------------------------------------------------------------------------------ 53 146 // DOMHTMLDocument … … 91 184 } 92 185 186 #if !PLATFORM(IOS) 93 187 - (NSRect)_rectOnScreen 94 188 { … … 106 200 return result; 107 201 } 202 #endif 108 203 109 204 - (void)_replaceCharactersInRange:(NSRange)targetRange withString:(NSString *)replacementString selectingFromIndex:(int)index … … 182 277 @end 183 278 279 #if PLATFORM(IOS) 280 @implementation DOMHTMLInputElement (AutocapitalizeAdditions) 281 282 - (WebAutocapitalizeType)_autocapitalizeType 283 { 284 WebCore::HTMLInputElement* inputElement = core(self); 285 return static_cast<WebAutocapitalizeType>(inputElement->autocapitalizeType()); 286 } 287 288 @end 289 290 @implementation DOMHTMLTextAreaElement (AutocapitalizeAdditions) 291 292 - (WebAutocapitalizeType)_autocapitalizeType 293 { 294 WebCore::HTMLTextAreaElement* textareaElement = core(self); 295 return static_cast<WebAutocapitalizeType>(textareaElement->autocapitalizeType()); 296 } 297 298 @end 299 300 @implementation DOMHTMLInputElement (WebInputChangeEventAdditions) 301 302 - (void)setValueWithChangeEvent:(NSString *)newValue 303 { 304 WebCore::JSMainThreadNullState state; 305 core(self)->setValue(newValue, DispatchInputAndChangeEvent); 306 } 307 308 - (void)setValueAsNumberWithChangeEvent:(double)newValueAsNumber 309 { 310 WebCore::JSMainThreadNullState state; 311 WebCore::ExceptionCode ec = 0; 312 core(self)->setValueAsNumber(newValueAsNumber, ec, DispatchInputAndChangeEvent); 313 } 314 315 @end 316 #endif 317 184 318 Class kitClass(WebCore::HTMLCollection* collection) 185 319 { -
trunk/Source/WebCore/bindings/objc/DOMInternal.h
r97771 r161638 46 46 class NodeFilter; 47 47 class XPathNSResolver; 48 #if ENABLE(TOUCH_EVENTS) 49 class Touch; 50 #endif 48 51 } 49 52 -
trunk/Source/WebCore/bindings/objc/DOMInternal.mm
r154877 r161638 34 34 #import "runtime_root.h" 35 35 36 #if PLATFORM(IOS) 37 #define NEEDS_WRAPPER_CACHE_LOCK 1 38 #endif 39 36 40 //------------------------------------------------------------------------------------------ 37 41 // Wrapping WebCore implementation objects 38 42 39 43 static NSMapTable* DOMWrapperCache; 44 45 #ifdef NEEDS_WRAPPER_CACHE_LOCK 46 static Mutex& wrapperCacheLock() 47 { 48 DEFINE_STATIC_LOCAL(Mutex, wrapperCacheMutex, ()); 49 return wrapperCacheMutex; 50 } 51 #endif 40 52 41 53 #if COMPILER(CLANG) … … 58 70 NSObject* getDOMWrapper(DOMObjectInternal* impl) 59 71 { 72 #ifdef NEEDS_WRAPPER_CACHE_LOCK 73 MutexLocker locker(wrapperCacheLock()); 74 #endif 60 75 if (!DOMWrapperCache) 61 76 return nil; … … 65 80 void addDOMWrapper(NSObject* wrapper, DOMObjectInternal* impl) 66 81 { 82 #ifdef NEEDS_WRAPPER_CACHE_LOCK 83 MutexLocker locker(wrapperCacheLock()); 84 #endif 67 85 if (!DOMWrapperCache) 68 86 DOMWrapperCache = createWrapperCache(); … … 72 90 void removeDOMWrapper(DOMObjectInternal* impl) 73 91 { 92 #ifdef NEEDS_WRAPPER_CACHE_LOCK 93 MutexLocker locker(wrapperCacheLock()); 94 #endif 74 95 if (!DOMWrapperCache) 75 96 return; -
trunk/Source/WebCore/bindings/objc/DOMPrivate.h
r138851 r161638 27 27 #import <WebCore/DOM.h> 28 28 29 #if defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED 30 #import <WebCore/WebAutocapitalize.h> 31 #import <CoreText/CoreText.h> 32 #endif 33 29 34 @interface DOMNode (DOMNodeExtensionsPendingPublic) 35 #if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED 30 36 - (NSImage *)renderedImage; 37 #endif 31 38 - (NSArray *)textRects; 32 39 @end … … 39 46 // calls to the public method - (NSColor *)color. 40 47 @interface DOMRGBColor (WebPrivate) 48 #if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED 41 49 - (NSColor *)_color; 50 #endif 42 51 @end 43 52 … … 49 58 50 59 @interface DOMRange (DOMRangeExtensions) 60 #if defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED 61 - (CGRect)boundingBox; 62 #else 51 63 - (NSRect)boundingBox; 64 #endif 65 #if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED 52 66 - (NSImage *)renderedImageForcingBlackText:(BOOL)forceBlackText; 67 #else 68 - (CGImageRef)renderedImageForcingBlackText:(BOOL)forceBlackText; 69 #endif 53 70 - (NSArray *)lineBoxRects; // Deprecated. Use textRects instead. 54 71 - (NSArray *)textRects; … … 56 73 57 74 @interface DOMElement (WebPrivate) 75 #if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED 58 76 - (NSFont *)_font; 59 77 - (NSData *)_imageTIFFRepresentation; 78 #else 79 - (CTFontRef)_font; 80 #endif 60 81 - (NSURL *)_getURLAttribute:(NSString *)name; 61 82 - (BOOL)isFocused; … … 82 103 - (BOOL)_isAutofilled; 83 104 - (BOOL)_isTextField; 105 #if !defined(TARGET_OS_EMBEDDED) || !TARGET_OS_EMBEDDED 84 106 - (NSRect)_rectOnScreen; // bounding box of the text field, in screen coordinates 107 #endif 85 108 - (void)_replaceCharactersInRange:(NSRange)targetRange withString:(NSString *)replacementString selectingFromIndex:(int)index; 86 109 - (NSRange)_selectedRange; … … 106 129 - (void)_activateItemAtIndex:(int)index allowMultipleSelection:(BOOL)allowMultipleSelection; 107 130 @end 131 132 #if defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED 133 enum { WebMediaQueryOrientationCurrent, WebMediaQueryOrientationPortrait, WebMediaQueryOrientationLandscape }; 134 @interface DOMHTMLLinkElement (WebPrivate) 135 - (BOOL)_mediaQueryMatchesForOrientation:(int)orientation; 136 - (BOOL)_mediaQueryMatches; 137 @end 138 139 // These changes are useful to get the AutocapitalizeType on particular form controls. 140 @interface DOMHTMLInputElement (AutocapitalizeAdditions) 141 - (WebAutocapitalizeType)_autocapitalizeType; 142 @end 143 144 @interface DOMHTMLTextAreaElement (AutocapitalizeAdditions) 145 - (WebAutocapitalizeType)_autocapitalizeType; 146 @end 147 148 // These are used by Date and Time input types because the generated ObjC methods default to not dispatching events. 149 @interface DOMHTMLInputElement (WebInputChangeEventAdditions) 150 - (void)setValueWithChangeEvent:(NSString *)newValue; 151 - (void)setValueAsNumberWithChangeEvent:(double)newValueAsNumber; 152 @end 153 #endif // defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED -
trunk/Source/WebCore/bindings/objc/PublicDOMInterfaces.h
r161415 r161638 26 26 // All public DOM class interfaces, properties and methods need to be in this file. 27 27 // Anything not in the file will be generated into the appropriate private header file. 28 29 #include <wtf/Platform.h> 28 30 29 31 #ifndef OBJC_CODE_GENERATION -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r161220 r161638 50 50 my $currentCachedAttribute = 0; 51 51 52 my $beginAppleCopyrightForHeaderFiles = <<END; 53 // ------- Begin Apple Copyright ------- 54 /* 55 * Copyright (C) 2008, Apple Inc. All rights reserved. 56 * 57 * Permission is granted by Apple to use this file to the extent 58 * necessary to relink with LGPL WebKit files. 59 * 60 * No license or rights are granted by Apple expressly or by 61 * implication, estoppel, or otherwise, to Apple patents and 62 * trademarks. For the sake of clarity, no license or rights are 63 * granted by Apple expressly or by implication, estoppel, or otherwise, 64 * under any Apple patents, copyrights and trademarks to underlying 65 * implementations of any application programming interfaces (APIs) 66 * or to any functionality that is invoked by calling any API. 67 */ 68 69 END 70 my $beginAppleCopyrightForSourceFiles = <<END; 71 // ------- Begin Apple Copyright ------- 72 /* 73 * Copyright (C) 2008, Apple Inc. All rights reserved. 74 * 75 * No license or rights are granted by Apple expressly or by implication, 76 * estoppel, or otherwise, to Apple copyrights, patents, trademarks, trade 77 * secrets or other rights. 78 */ 79 80 END 81 my $endAppleCopyright = <<END; 82 // ------- End Apple Copyright ------- 83 84 END 85 52 86 # Default .h template 53 87 my $headerTemplate = << "EOF"; … … 449 483 my $className = "JS" . $interface->name; 450 484 451 my @headerContentHeader = split("\r", $headerTemplate); 485 my @headerContentHeader; 486 if ($interface->extendedAttributes->{"AppleCopyright"}) { 487 @headerContentHeader = split("\r", $beginAppleCopyrightForHeaderFiles); 488 } else { 489 @headerContentHeader = split("\r", $headerTemplate); 490 } 452 491 453 492 # - Add header protection … … 465 504 my $className = "JS" . $interface->name; 466 505 467 my @implContentHeader = split("\r", $headerTemplate); 506 my @implContentHeader; 507 if ($interface->extendedAttributes->{"AppleCopyright"}) { 508 @implContentHeader = split("\r", $beginAppleCopyrightForSourceFiles); 509 } else { 510 @implContentHeader = split("\r", $headerTemplate); 511 } 468 512 469 513 push(@implContentHeader, "\n#include \"config.h\"\n"); … … 868 912 869 913 if ($numCustomFunctions > 0) { 914 my $inAppleCopyright = 0; 870 915 push(@headerContent, "\n // Custom functions\n"); 871 916 foreach my $function (@{$interface->functions}) { 917 # PLATFORM_IOS 918 my $needsAppleCopyright = $function->signature->extendedAttributes->{"AppleCopyright"}; 919 if ($needsAppleCopyright) { 920 if (!$inAppleCopyright) { 921 push(@headerContent, $beginAppleCopyrightForHeaderFiles); 922 $inAppleCopyright = 1; 923 } 924 } elsif ($inAppleCopyright) { 925 push(@headerContent, $endAppleCopyright); 926 $inAppleCopyright = 0; 927 } 928 # end PLATFORM_IOS 872 929 next unless HasCustomMethod($function->signature->extendedAttributes); 873 930 next if $function->{overloads} && $function->{overloadIndex} != 1; … … 878 935 push(@headerContent, "#endif\n") if $conditionalString; 879 936 } 937 push(@headerContent, $endAppleCopyright) if $inAppleCopyright; 880 938 } 881 939 … … 1044 1102 1045 1103 if ($numFunctions > 0) { 1104 my $inAppleCopyright = 0; 1046 1105 push(@headerContent,"// Functions\n\n"); 1047 1106 foreach my $function (@{$interface->functions}) { 1048 1107 next if $function->{overloadIndex} && $function->{overloadIndex} > 1; 1108 my $needsAppleCopyright = $function->signature->extendedAttributes->{"AppleCopyright"}; 1109 if ($needsAppleCopyright) { 1110 if (!$inAppleCopyright) { 1111 push(@headerContent, $beginAppleCopyrightForHeaderFiles); 1112 $inAppleCopyright = 1; 1113 } 1114 } elsif ($inAppleCopyright) { 1115 push(@headerContent, $endAppleCopyright); 1116 $inAppleCopyright = 0; 1117 } 1118 1049 1119 my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); 1050 1120 push(@headerContent, "#if ${conditionalString}\n") if $conditionalString; … … 1053 1123 push(@headerContent, "#endif\n") if $conditionalString; 1054 1124 } 1125 1126 push(@headerContent, $endAppleCopyright) if $inAppleCopyright; 1055 1127 } 1056 1128 … … 1095 1167 push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditionalString; 1096 1168 push(@headerContent, "#endif\n"); 1169 1170 if ($interface->extendedAttributes->{"AppleCopyright"}) { 1171 push(@headerContent, split("\r", $endAppleCopyright)); 1172 } 1097 1173 } 1098 1174 … … 2383 2459 # Functions 2384 2460 if ($numFunctions > 0) { 2461 my $inAppleCopyright = 0; 2385 2462 foreach my $function (@{$interface->functions}) { 2463 my $needsAppleCopyright = $function->signature->extendedAttributes->{"AppleCopyright"}; 2464 if ($needsAppleCopyright) { 2465 if (!$inAppleCopyright) { 2466 push(@implContent, $beginAppleCopyrightForSourceFiles); 2467 $inAppleCopyright = 1; 2468 } 2469 } elsif ($inAppleCopyright) { 2470 push(@implContent, $endAppleCopyright); 2471 $inAppleCopyright = 0; 2472 } 2473 2386 2474 my $isCustom = HasCustomMethod($function->signature->extendedAttributes); 2387 2475 my $isOverloaded = $function->{overloads} && @{$function->{overloads}} > 1; … … 2498 2586 2499 2587 } 2588 2589 push(@implContent, $endAppleCopyright) if $inAppleCopyright; 2590 2500 2591 } 2501 2592 … … 3230 3321 my $conditionalString = $codeGenerator->GenerateConditionalString($interface); 3231 3322 push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString; 3323 3324 if ($interface->extendedAttributes->{"AppleCopyright"}) { 3325 push(@implContent, split("\r", $endAppleCopyright)); 3326 } 3232 3327 } 3233 3328 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
r161406 r161638 49 49 my @internalHeaderContent = (); 50 50 51 my @implConditionalIncludes = (); 51 52 my @implContentHeader = (); 52 53 my @implContent = (); 53 54 my %implIncludes = (); 54 55 my @depsContent = (); 56 57 my $beginAppleCopyrightForHeaderFiles = <<END; 58 // ------- Begin Apple Copyright ------- 59 /* 60 * Copyright (C) 2008, Apple Inc. All rights reserved. 61 * 62 * Permission is granted by Apple to use this file to the extent 63 * necessary to relink with LGPL WebKit files. 64 * 65 * No license or rights are granted by Apple expressly or by 66 * implication, estoppel, or otherwise, to Apple patents and 67 * trademarks. For the sake of clarity, no license or rights are 68 * granted by Apple expressly or by implication, estoppel, or otherwise, 69 * under any Apple patents, copyrights and trademarks to underlying 70 * implementations of any application programming interfaces (APIs) 71 * or to any functionality that is invoked by calling any API. 72 */ 73 74 END 75 my $beginAppleCopyrightForSourceFiles = <<END; 76 // ------- Begin Apple Copyright ------- 77 /* 78 * Copyright (C) 2008, Apple Inc. All rights reserved. 79 * 80 * No license or rights are granted by Apple expressly or by implication, 81 * estoppel, or otherwise, to Apple copyrights, patents, trademarks, trade 82 * secrets or other rights. 83 */ 84 85 END 86 my $endAppleCopyright = <<END; 87 // ------- End Apple Copyright ------- 88 89 END 55 90 56 91 # Hashes … … 77 112 78 113 # Constants 114 my $buildingForIPhone = ($ENV{PLATFORM_NAME} eq "iphoneos" or $ENV{PLATFORM_NAME} eq "iphonesimulator"); 79 115 my $nullableInit = "bool isNull = false;"; 80 116 my $exceptionInit = "WebCore::ExceptionCode ec = 0;"; … … 215 251 %publicInterfaces = (); 216 252 253 my @args = qw(-E -P -x objective-c); 254 # Set include path to find <wtf/Platform.h>. We search BUILT_PRODUCTS_DIR 255 # first for local developer builds, then the installation path for B&I 256 # builds. 257 push(@args, "-I" . $ENV{BUILT_PRODUCTS_DIR} . "/usr/local/include") if $ENV{BUILT_PRODUCTS_DIR}; 258 push(@args, "-I" . $ENV{BUILT_PRODUCTS_DIR} . $ENV{SDKROOT} . "/usr/local/include") if $ENV{BUILT_PRODUCTS_DIR}; 259 260 # Xcode 3.1 is required for SDKROOT to be set. 261 if ($ENV{SDKROOT} && $ENV{SYSTEM_LIBRARY_DIR}) { 262 push(@args, "-I" . $ENV{BUILT_PRODUCTS_DIR} . $ENV{SDKROOT} . "/usr/local/include") if $ENV{BUILT_PRODUCTS_DIR}; 263 push(@args, "-I" . $ENV{SDKROOT} . "/usr/local/include"); 264 } 217 265 my $fileName = "WebCore/bindings/objc/PublicDOMInterfaces.h"; 218 266 my $gccLocation = ""; … … 226 274 $gccLocation = "/usr/bin/gcc"; 227 275 } 228 open FILE, "-|", $gccLocation, "-E", "-P", "-x", "objective-c", 276 277 if ($ENV{SDKROOT}) { 278 # PLATFORM(IOS) 279 push(@args, "-isysroot", $ENV{SDKROOT}); 280 } 281 282 open FILE, "-|", $gccLocation, @args, 229 283 (map { "-D$_" } split(/ +/, $defines)), "-DOBJC_CODE_GENERATION", $fileName or die "Could not open $fileName"; 230 284 my @documentContent = <FILE>; … … 354 408 # special cases 355 409 return "NSString" if $codeGenerator->IsStringType($name) or $name eq "SerializedScriptValue"; 410 return "CGColorRef" if $name eq "Color" and $buildingForIPhone; 356 411 return "NS$name" if IsNativeObjCType($name); 357 412 return "BOOL" if $name eq "boolean"; … … 484 539 } 485 540 541 sub IsCoreFoundationType 542 { 543 my $type = shift; 544 545 return 1 if $type =~ /^(CF|CG)[A-Za-z]+Ref$/; 546 return 0; 547 } 548 486 549 sub SkipFunction 487 550 { … … 519 582 } 520 583 521 522 584 sub GetObjCType 523 585 { … … 528 590 return $name if $codeGenerator->IsPrimitiveType($type) or $type eq "DOMTimeStamp"; 529 591 return "unsigned short" if $type eq "CompareHow"; 592 return $name if IsCoreFoundationType($name); 530 593 return "$name *"; 531 594 } … … 613 676 if (IsNativeObjCType($type)) { 614 677 if ($type eq "Color") { 615 $implIncludes{"ColorMac.h"} = 1; 678 if ($buildingForIPhone) { 679 $implIncludes{"ColorSpace.h"} = 1; 680 } else { 681 $implIncludes{"ColorMac.h"} = 1; 682 } 616 683 } 617 684 return; … … 753 820 754 821 # - Add default header template 755 @headerContentHeader = split("\r", $headerLicenseTemplate); 822 if ($interface->extendedAttributes->{"AppleCopyright"}) { 823 @headerContentHeader = split("\r", $beginAppleCopyrightForHeaderFiles); 824 } else { 825 @headerContentHeader = split("\r", $headerLicenseTemplate); 826 } 756 827 push(@headerContentHeader, "\n"); 757 828 … … 849 920 my $publicInterfaceKey = $property . ";"; 850 921 922 # FIXME: This only works for the getter, but not the setter. Need to refactor this code. 923 if ($buildingForTigerOrEarlier && !$buildingForIPhone || IsCoreFoundationType($attributeType)) { 924 $publicInterfaceKey = "- (" . $attributeType . ")" . $attributeName . ";"; 925 } 926 851 927 my $availabilityMacro = ""; 852 928 if (defined $publicInterfaces{$publicInterfaceKey} and length $publicInterfaces{$publicInterfaceKey}) { … … 876 952 } 877 953 878 $property .= $declarationSuffix; 879 push(@headerAttributes, $property) if $public; 880 push(@privateHeaderAttributes, $property) unless $public; 954 if (!IsCoreFoundationType($attributeType)) { 955 $property .= $declarationSuffix; 956 push(@headerAttributes, $property) if $public; 957 push(@privateHeaderAttributes, $property) unless $public; 958 } else { 959 my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature); 960 if ($attributeConditionalString) { 961 push(@headerAttributes, "#if ${attributeConditionalString}\n") if $public; 962 push(@privateHeaderAttributes, "#if ${attributeConditionalString}\n") unless $public; 963 } 964 965 # - GETTER 966 my $getter = "- (" . $attributeType . ")" . $attributeName . $declarationSuffix; 967 push(@headerAttributes, $getter) if $public; 968 push(@privateHeaderAttributes, $getter) unless $public; 969 970 # - SETTER 971 if (!$attribute->isReadOnly) { 972 my $setter = "- (void)$setterName(" . $attributeType . ")new" . ucfirst($attributeName) . $declarationSuffix; 973 push(@headerAttributes, $setter) if $public; 974 push(@privateHeaderAttributes, $setter) unless $public; 975 } 976 977 if ($attributeConditionalString) { 978 push(@headerAttributes, "#endif\n") if $public; 979 push(@privateHeaderAttributes, "#endif\n") unless $public; 980 } 981 } 881 982 } 882 983 … … 890 991 # - Add functions. 891 992 if ($numFunctions > 0) { 993 my %inAppleCopyright = (public => 0, private => 0); 892 994 foreach my $function (@{$interface->functions}) { 893 995 next if SkipFunction($function); … … 897 999 my $returnType = GetObjCType($function->signature->type); 898 1000 my $needsDeprecatedVersion = (@{$function->parameters} > 1 and $function->signature->extendedAttributes->{"ObjCLegacyUnnamedParameters"}); 1001 my $needsAppleCopyright = $function->signature->extendedAttributes->{"AppleCopyright"}; 899 1002 my $numberOfParameters = @{$function->parameters}; 900 1003 my %typesToForwardDeclare = ($function->signature->type => 1); … … 951 1054 } 952 1055 1056 if ($needsAppleCopyright) { 1057 if (!$inAppleCopyright{$public ? "public" : "private"}) { 1058 push(@headerFunctions, $beginAppleCopyrightForHeaderFiles) if $public; 1059 push(@privateHeaderFunctions, $beginAppleCopyrightForHeaderFiles) unless $public; 1060 $inAppleCopyright{$public ? "public" : "private"} = 1; 1061 } 1062 } elsif ($inAppleCopyright{$public ? "public" : "private"}) { 1063 push(@headerFunctions, $endAppleCopyright) if $public; 1064 push(@privateHeaderFunctions, $endAppleCopyright) unless $public; 1065 $inAppleCopyright{$public ? "public" : "private"} = 0; 1066 } 1067 953 1068 my $functionConditionalString = $codeGenerator->GenerateConditionalString($function->signature); 954 1069 if ($functionConditionalString) { … … 992 1107 } 993 1108 1109 push(@headerFunctions, $endAppleCopyright) if $inAppleCopyright{"public"}; 1110 push(@privateHeaderFunctions, $endAppleCopyright) if $inAppleCopyright{"private"}; 1111 994 1112 if (@headerFunctions > 0) { 995 1113 push(@headerContent, "\n") if @headerAttributes > 0; … … 1012 1130 } 1013 1131 1132 if ($interface->extendedAttributes->{"AppleCopyright"}) { 1133 push(@headerContent, split("\r", $endAppleCopyright)); 1134 } 1135 1014 1136 my %alwaysGenerateForNoSVGBuild = map { $_ => 1 } qw(DOMHTMLEmbedElement DOMHTMLObjectElement); 1015 1137 1016 1138 if (@privateHeaderAttributes > 0 or @privateHeaderFunctions > 0 or exists $alwaysGenerateForNoSVGBuild{$className}) { 1017 1139 # - Private category @interface 1018 @privateHeaderContentHeader = split("\r", $headerLicenseTemplate); 1140 if ($interface->extendedAttributes->{"AppleCopyright"}) { 1141 @privateHeaderContentHeader = split("\r", $beginAppleCopyrightForHeaderFiles); 1142 } else { 1143 @privateHeaderContentHeader = split("\r", $headerLicenseTemplate); 1144 } 1019 1145 push(@privateHeaderContentHeader, "\n"); 1020 1146 … … 1028 1154 push(@privateHeaderContent, @privateHeaderFunctions) if @privateHeaderFunctions > 0; 1029 1155 push(@privateHeaderContent, "\@end\n"); 1156 1157 if ($interface->extendedAttributes->{"AppleCopyright"}) { 1158 push(@privateHeaderContent, split("\r", $endAppleCopyright)); 1159 } 1030 1160 } 1031 1161 … … 1040 1170 1041 1171 # Generate interface definitions. 1042 @internalHeaderContent = split("\r", $implementationLicenseTemplate); 1172 if ($interface->extendedAttributes->{"AppleCopyright"}) { 1173 @internalHeaderContent = split("\r", $beginAppleCopyrightForHeaderFiles); 1174 } else { 1175 @internalHeaderContent = split("\r", $implementationLicenseTemplate); 1176 } 1043 1177 1044 1178 push(@internalHeaderContent, "\n#import <WebCore/$className.h>\n\n"); … … 1109 1243 1110 1244 # - Add default header template. 1111 @implContentHeader = split("\r", $implementationLicenseTemplate); 1245 if ($interface->extendedAttributes->{"AppleCopyright"}) { 1246 @implContentHeader = split("\r", $beginAppleCopyrightForSourceFiles); 1247 } else { 1248 @implContentHeader = split("\r", $implementationLicenseTemplate); 1249 } 1112 1250 1113 1251 # - INCLUDES - … … 1336 1474 $getterContentTail .= ")"; 1337 1475 } elsif ($idlType eq "Color") { 1338 $getterContentHead = "WebCore::nsColor($getterContentHead"; 1339 $getterContentTail .= ")"; 1476 if ($buildingForIPhone) { 1477 $getterContentHead = "WebCore::cachedCGColor($getterContentHead"; 1478 $getterContentTail .= ", WebCore::ColorSpaceDeviceRGB)"; 1479 } else { 1480 $getterContentHead = "WebCore::nsColor($getterContentHead"; 1481 $getterContentTail .= ")"; 1482 } 1340 1483 } elsif ($attribute->signature->type eq "SerializedScriptValue") { 1341 1484 $getterContentHead = "$getterContentHead"; … … 1508 1651 # - Functions 1509 1652 if ($numFunctions > 0) { 1653 my $inAppleCopyright = 0; 1510 1654 foreach my $function (@{$interface->functions}) { 1511 1655 next if SkipFunction($function); … … 1515 1659 my $functionName = $function->signature->name; 1516 1660 my $returnType = GetObjCType($function->signature->type); 1661 my $needsAppleCopyright = $function->signature->extendedAttributes->{"AppleCopyright"}; 1517 1662 my $hasParameters = @{$function->parameters}; 1518 1663 my $raisesExceptions = $function->signature->extendedAttributes->{"RaisesException"}; … … 1725 1870 } 1726 1871 1872 if ($needsAppleCopyright) { 1873 if (!$inAppleCopyright) { 1874 push(@implContent, $beginAppleCopyrightForSourceFiles); 1875 $inAppleCopyright = 1; 1876 } 1877 } elsif ($inAppleCopyright) { 1878 push(@implContent, $endAppleCopyright); 1879 $inAppleCopyright = 0; 1880 } 1881 1727 1882 my $conditionalString = $codeGenerator->GenerateConditionalString($function->signature); 1728 1883 push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString; … … 1751 1906 %needsCustom = (); 1752 1907 } 1908 push(@implContent, $endAppleCopyright) if $inAppleCopyright; 1753 1909 } 1754 1910 1755 1911 # END implementation 1756 1912 push(@implContent, "\@end\n"); 1913 1914 if ($interface->extendedAttributes->{"AppleCopyright"}) { 1915 push(@implContent, split("\r", $endAppleCopyright)); 1916 } 1757 1917 1758 1918 # Generate internal interfaces … … 1793 1953 push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString; 1794 1954 1955 if ($interface->extendedAttributes->{"AppleCopyright"}) { 1956 push(@implContent, split("\r", $endAppleCopyright)); 1957 } 1958 1795 1959 # - Generate dependencies. 1796 1960 if ($writeDependencies && @ancestorInterfaceNames) { … … 1804 1968 { 1805 1969 my $object = shift; 1806 my $ dataNode = shift;1970 my $interface = shift; 1807 1971 my $outputDir = shift; 1808 1972 1809 1973 # Open files for writing... 1810 my $name = $ dataNode->name;1974 my $name = $interface->name; 1811 1975 my $prefix = FileNamePrefix; 1812 1976 my $headerFileName = "$outputDir/$prefix$name.h"; … … 1818 1982 # Write public header. 1819 1983 my $contents = join "", @headerContentHeader; 1820 map { $contents .= "\@class $_;\n"} sort keys(%headerForwardDeclarations);1984 map { $contents .= (IsCoreFoundationType($_) ? "typedef struct " . substr($_, 0, -3) . "* $_;\n" : "\@class $_;\n") } sort keys(%headerForwardDeclarations); 1821 1985 map { $contents .= "\@protocol $_;\n" } sort keys(%headerForwardDeclarationsForProtocols); 1822 1986 -
trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt
r160775 r161638 108 108 TypedArray=* 109 109 URL 110 111 # PLATFORM(IOS) 112 AppleCopyright -
trunk/Source/WebCore/bindings/scripts/preprocessor.pm
r151619 r161638 58 58 } 59 59 60 push(@args, "-I" . $ENV{BUILT_PRODUCTS_DIR} . "/usr/local/include") if $ENV{BUILT_PRODUCTS_DIR}; 61 push(@args, "-isysroot", $ENV{SDKROOT}) if $ENV{SDKROOT}; 62 60 63 # Remove double quotations from $defines and extract macros. 61 64 # For example, if $defines is ' "A=1" "B=1" C=1 "" D ', -
trunk/Source/WebCore/bridge/objc/objc_class.mm
r149255 r161638 162 162 RetainPtr<CFStringRef> fieldName = adoptCF(CFStringCreateWithCString(NULL, jsName.data(), kCFStringEncodingASCII)); 163 163 id targetObject = (static_cast<ObjcInstance*>(instance))->getObject(); 164 #if PLATFORM(IOS) 165 id attributes = [targetObject respondsToSelector:@selector(attributeKeys)] ? [targetObject performSelector:@selector(attributeKeys)] : nil; 166 #else 164 167 id attributes = [targetObject attributeKeys]; 168 #endif 165 169 if (attributes) { 166 170 // Class overrides attributeKeys, use that array of key names. -
trunk/Source/WebCore/bridge/objc/objc_instance.mm
r159605 r161638 38 38 #import <wtf/Assertions.h> 39 39 40 #if PLATFORM(IOS) 41 #import <Foundation/NSMapTable.h> 42 #endif // PLATFORM(IOS) 43 40 44 #ifdef NDEBUG 41 45 #define OBJC_LOG(formatAndArgs...) ((void)0) -
trunk/Source/WebCore/config.h
r156302 r161638 101 101 #endif 102 102 103 #if PLATFORM(MAC) 103 #if PLATFORM(MAC) && !PLATFORM(IOS) 104 104 // New theme 105 105 #define WTF_USE_NEW_THEME 1 … … 126 126 #endif 127 127 128 #if PLATFORM(IOS) 129 #define WEBCORE_NAVIGATOR_PLATFORM wkGetPlatformNameForNavigator(); 130 #define WEBCORE_NAVIGATOR_VENDOR wkGetVendorNameForNavigator(); 131 #endif 132 128 133 // FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define WTF_USE_AVFOUNDATION on the Mac. 129 134 // https://bugs.webkit.org/show_bug.cgi?id=67334 -
trunk/Source/WebCore/dom/Document.cpp
r161464 r161638 4790 4790 void Document::addAutoSizingNode(Node* node, float candidateSize) 4791 4791 { 4792 TextAutoSizingKey key( node->renderer()->style(), &document());4792 TextAutoSizingKey key(&node->renderer()->style(), &document()); 4793 4793 TextAutoSizingMap::AddResult result = m_textAutoSizedNodes.add(key, nullptr); 4794 4794 if (result.isNewEntry) -
trunk/Source/WebCore/dom/Document.h
r161259 r161638 166 166 #if ENABLE(TOUCH_EVENTS) 167 167 #if PLATFORM(IOS) 168 #include "DocumentIOSForward.h"169 #endif 168 #include <WebKitAdditions/DocumentIOSForward.h> 169 #endif // PLATFORM(IOS) 170 170 class Touch; 171 171 class TouchList; … … 1115 1115 #if ENABLE(TOUCH_EVENTS) 1116 1116 #if PLATFORM(IOS) 1117 #include "DocumentIOS.h"1117 #include <WebKitAdditions/DocumentIOS.h> 1118 1118 #else 1119 1119 PassRefPtr<Touch> createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force, ExceptionCode&) const; -
trunk/Source/WebCore/dom/Document.idl
r160775 r161638 324 324 // and/or modifying the bindings scripts to support generating more complicated conditional code. 325 325 #if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS 326 #include "DocumentIOS.idl"326 #include <WebKitAdditions/DocumentIOS.idl> 327 327 #else 328 328 [ReturnNewObject, RaisesException] Touch createTouch([Default=Undefined] optional DOMWindow window, -
trunk/Source/WebCore/editing/ApplyStyleCommand.cpp
r161196 r161638 256 256 return; 257 257 258 #if !PLATFORM(IOS) 258 259 // Save and restore the selection endpoints using their indices in the document, since 260 #else 261 // Save and restore the selection endpoints using their indices in the editable root, since 262 #endif 259 263 // addBlockStyleIfNeeded may moveParagraphs, which can remove these endpoints. 260 264 // Calculate start and end indices from the start of the tree that they're in. 265 #if !PLATFORM(IOS) 261 266 Node* scope = highestAncestor(visibleStart.deepEquivalent().deprecatedNode()); 267 #else 268 Node* scope = highestEditableRoot(visibleStart.deepEquivalent()); 269 #endif 262 270 RefPtr<Range> startRange = Range::create(document(), firstPositionInNode(scope), visibleStart.deepEquivalent().parentAnchoredEquivalent()); 263 271 RefPtr<Range> endRange = Range::create(document(), firstPositionInNode(scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent()); -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r160966 r161638 73 73 #endif 74 74 75 #if PLATFORM(IOS) 76 #include "BreakBlockquoteCommand.h" 77 #endif 78 75 79 namespace WebCore { 76 80 … … 103 107 // if one is necessary (like for the creation of VisiblePositions). 104 108 m_document->updateLayoutIgnorePendingStylesheets(); 109 #if PLATFORM(IOS) 110 // FIXME: Where should iPhone code deal with the composition? 111 // Since editing commands don't save/restore the composition, undoing without fixing 112 // up the composition will leave a stale, invalid composition, as in <rdar://problem/6831637>. 113 // Desktop handles this in -[WebHTMLView _updateSelectionForInputManager], but the phone 114 // goes another route. 115 frame->editor().cancelComposition(); 116 #endif 105 117 106 118 { … … 191 203 case EditActionCut: 192 204 case EditActionUnspecified: 205 #if PLATFORM(IOS) 206 case EditActionDelete: 207 case EditActionDictation: 208 #endif 193 209 break; 194 210 default: … … 487 503 } 488 504 505 #if PLATFORM(IOS) 506 void CompositeEditCommand::inputText(const String& text, bool selectInsertedText) 507 { 508 unsigned offset = 0; 509 unsigned length = text.length(); 510 511 RefPtr<ContainerNode> scope; 512 unsigned startIndex = indexForVisiblePosition(endingSelection().visibleStart(), scope); 513 514 size_t newline; 515 do { 516 newline = text.find('\n', offset); 517 if (newline != offset) { 518 int substringLength = newline == notFound ? length - offset : newline - offset; 519 RefPtr<InsertTextCommand> command = InsertTextCommand::create(document(), text.substring(offset, substringLength), false); 520 applyCommandToComposite(command); 521 } 522 if (newline != notFound) { 523 VisiblePosition caret(endingSelection().visibleStart()); 524 if (enclosingNodeOfType(caret.deepEquivalent(), &isMailBlockquote)) { 525 // FIXME: Breaking a blockquote when the caret is just after a space will collapse the 526 // space. Modify startIndex or length to compensate for this so that the ending selection 527 // will be positioned correctly. 528 // <rdar://problem/9914462> breaking a Mail blockquote just after a space collapses the space 529 if (caret.previous().characterAfter() == ' ') { 530 if (!offset && !startIndex) 531 startIndex--; 532 else if (!length) 533 length--; 534 } 535 applyCommandToComposite(BreakBlockquoteCommand::create(document())); 536 } else 537 insertLineBreak(); 538 } 539 540 offset = newline + 1; 541 } while (newline != notFound && offset != length); 542 543 if (selectInsertedText) 544 setEndingSelection(VisibleSelection(visiblePositionForIndex(startIndex, scope.get()), visiblePositionForIndex(startIndex + length, scope.get()))); 545 } 546 #endif 547 489 548 void CompositeEditCommand::insertTextIntoNode(PassRefPtr<Text> node, unsigned offset, const String& text) 490 549 { … … 536 595 RefPtr<Range> newRange = Range::create(document(), node, offset, node, offset + replacementText.length()); 537 596 for (size_t i = 0; i < markers.size(); ++i) 597 #if PLATFORM(IOS) 598 markerController.addMarker(newRange.get(), markers[i].type(), markers[i].description(), markers[i].alternatives(), markers[i].metadata()); 599 #else 538 600 markerController.addMarker(newRange.get(), markers[i].type(), markers[i].description()); 601 #endif // PLATFORM(IOS) 539 602 } 540 603 … … 1202 1265 // too, <div><b><br></b></div> for example. Save it so that we can preserve it later. 1203 1266 RefPtr<EditingStyle> styleInEmptyParagraph; 1267 #if !PLATFORM(IOS) 1204 1268 if (startOfParagraphToMove == endOfParagraphToMove && preserveStyle) { 1269 #else 1270 if (startOfParagraphToMove == endOfParagraphToMove && preserveStyle && isRichlyEditablePosition(destination.deepEquivalent())) { 1271 #endif 1205 1272 styleInEmptyParagraph = EditingStyle::create(startOfParagraphToMove.deepEquivalent()); 1206 1273 styleInEmptyParagraph->mergeTypingStyle(document()); -
trunk/Source/WebCore/editing/CompositeEditCommand.h
r157653 r161638 105 105 void deleteSelection(const VisibleSelection&, bool smartDelete = false, bool mergeBlocksAfterDelete = true, bool replace = false, bool expandForSpecialElements = true, bool sanitizeMarkup = true); 106 106 virtual void deleteTextFromNode(PassRefPtr<Text>, unsigned offset, unsigned count); 107 #if PLATFORM(IOS) 108 void inputText(const String&, bool selectInsertedText = false); 109 #endif 107 110 bool isRemovableBlock(const Node*); 108 111 void insertNodeAfter(PassRefPtr<Node>, PassRefPtr<Node> refChild); -
trunk/Source/WebCore/editing/DeleteButton.h
r155786 r161638 35 35 static PassRefPtr<DeleteButton> create(Document&); 36 36 37 #if !PLATFORM(IOS) 37 38 virtual bool willRespondToMouseClickEvents() OVERRIDE { return true; } 39 #endif // !PLATFORM(IOS) 38 40 39 41 private: -
trunk/Source/WebCore/editing/DeleteButtonController.cpp
r160966 r161638 332 332 void DeleteButtonController::enable() 333 333 { 334 #if !PLATFORM(IOS) 334 335 ASSERT(m_disableStack > 0); 335 336 if (m_disableStack > 0) … … 342 343 show(enclosingDeletableElement(m_frame.selection().selection())); 343 344 } 345 #endif 344 346 } 345 347 346 348 void DeleteButtonController::disable() 347 349 { 350 #if !PLATFORM(IOS) 348 351 if (enabled()) 349 352 hide(); 350 353 m_disableStack++; 354 #endif 351 355 } 352 356 -
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
r160966 r161638 862 862 } 863 863 864 #if PLATFORM(IOS) 865 // This checking is due to iphone shows the last entered character momentarily, removing and adding back the 866 // space when deleting password cause space been showed insecurely. 867 bool isSecure = NO; 868 Node* node = m_endingPosition.deprecatedNode(); 869 if (node && node->isTextNode()) { 870 Text* textNode = static_cast<Text*>(node); 871 if (textNode->length() > 0) { 872 RenderObject* renderer = textNode->renderer(); 873 isSecure = renderer->style().textSecurity() != TSNONE; 874 } 875 } 876 877 if (!isSecure) 878 rebalanceWhitespaceAt(m_endingPosition); 879 #else 864 880 rebalanceWhitespaceAt(m_endingPosition); 881 #endif 865 882 866 883 calculateTypingStyleAfterDelete(); -
trunk/Source/WebCore/editing/DeleteSelectionCommand.h
r154938 r161638 44 44 } 45 45 46 protected: 47 DeleteSelectionCommand(Document&, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool santizeMarkup); 48 46 49 private: 47 DeleteSelectionCommand(Document&, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool santizeMarkup);48 50 DeleteSelectionCommand(const VisibleSelection&, bool smartDelete, bool mergeBlocksAfterDelete, bool replace, bool expandForSpecialElements, bool sanitizeMarkup); 49 51 -
trunk/Source/WebCore/editing/EditAction.h
r141799 r161638 58 58 EditActionBold, 59 59 EditActionItalics, 60 #if PLATFORM(IOS) 61 EditActionDelete, 62 EditActionDictation, 63 #endif 60 64 EditActionPaste, 61 65 EditActionPasteFont, -
trunk/Source/WebCore/editing/EditCommand.h
r157081 r161638 52 52 const VisibleSelection& endingSelection() const { return m_endingSelection; } 53 53 54 #if PLATFORM(IOS) 55 virtual bool isInsertTextCommand() const { return false; } 56 #endif 57 54 58 virtual bool isSimpleEditCommand() const { return false; } 55 59 virtual bool isCompositeEditCommand() const { return false; } -
trunk/Source/WebCore/editing/EditingStyle.cpp
r160966 r161638 72 72 CSSPropertyWidows, 73 73 CSSPropertyWordSpacing, 74 #if PLATFORM(IOS) 75 CSSPropertyWebkitTapHighlightColor, 76 CSSPropertyWebkitCompositionFillColor, 77 #endif 74 78 CSSPropertyWebkitTextDecorationsInEffect, 75 79 CSSPropertyWebkitTextFillColor, -
trunk/Source/WebCore/editing/Editor.cpp
r160966 r161638 96 96 #endif 97 97 98 #if PLATFORM(IOS) 99 #include "DictationCommandIOS.h" 100 #include <wtf/text/StringBuilder.h> 101 #include <wtf/text/WTFString.h> 102 #endif 103 98 104 namespace WebCore { 105 106 #if PLATFORM(IOS) 107 class ClearTextCommand : public DeleteSelectionCommand { 108 public: 109 ClearTextCommand(Document& document); 110 static void CreateAndApply(const RefPtr<Frame> frame); 111 112 private: 113 virtual EditAction editingAction() const; 114 }; 115 116 ClearTextCommand::ClearTextCommand(Document& document) 117 : DeleteSelectionCommand(document, false, true, false, false, true) 118 { 119 } 120 121 EditAction ClearTextCommand::editingAction() const 122 { 123 return EditActionDelete; 124 } 125 126 void ClearTextCommand::CreateAndApply(const RefPtr<Frame> frame) 127 { 128 if (frame->selection().isNone()) 129 return; 130 131 // Don't leave around stale composition state. 132 frame->editor().clear(); 133 134 const VisibleSelection oldSelection = frame->selection().selection(); 135 frame->selection().selectAll(); 136 RefPtr<ClearTextCommand> clearCommand = adoptRef(new ClearTextCommand(*frame->document())); 137 clearCommand->setStartingSelection(oldSelection); 138 applyCommand(clearCommand.release()); 139 } 140 #endif 99 141 100 142 using namespace HTMLNames; … … 219 261 if (event->isPaste()) { 220 262 if (event->pastingFragment()) 263 #if PLATFORM(IOS) 264 { 265 if (client()->performsTwoStepPaste(event->pastingFragment())) 266 return true; 267 #endif 221 268 replaceSelectionWithFragment(event->pastingFragment(), false, event->shouldSmartReplace(), event->shouldMatchStyle()); 269 #if PLATFORM(IOS) 270 } 271 #endif 222 272 else 223 273 replaceSelectionWithText(event->data(), false, event->shouldSmartReplace()); … … 392 442 } 393 443 444 #if PLATFORM(IOS) 445 void Editor::clearText() 446 { 447 ClearTextCommand::CreateAndApply(&m_frame); 448 } 449 450 void Editor::insertDictationPhrases(PassOwnPtr<Vector<Vector<String> > > dictationPhrases, RetainPtr<id> metadata) 451 { 452 if (m_frame.selection().isNone()) 453 return; 454 455 if (dictationPhrases->isEmpty()) 456 return; 457 458 applyCommand(DictationCommandIOS::create(document(), dictationPhrases, metadata)); 459 } 460 461 void Editor::setDictationPhrasesAsChildOfElement(PassOwnPtr<Vector<Vector<String> > > dictationPhrases, RetainPtr<id> metadata, Element* element) 462 { 463 // Clear the composition. 464 clear(); 465 466 // Clear the Undo stack, since the operations that follow are not Undoable, and will corrupt the stack. Some day 467 // we could make them Undoable, and let callers clear the Undo stack explicitly if they wish. 468 clearUndoRedoOperations(); 469 470 m_frame.selection().clear(); 471 472 element->removeChildren(); 473 474 if (dictationPhrases->isEmpty()) { 475 client()->respondToChangedContents(); 476 return; 477 } 478 479 ExceptionCode ec; 480 RefPtr<Range> context = document().createRange(); 481 context->selectNodeContents(element, ec); 482 483 StringBuilder dictationPhrasesBuilder; 484 size_t dictationPhraseCount = dictationPhrases->size(); 485 for (size_t i = 0; i < dictationPhraseCount; i++) { 486 const String& firstInterpretation = dictationPhrases->at(i)[0]; 487 dictationPhrasesBuilder.append(firstInterpretation); 488 } 489 String serializedDictationPhrases = dictationPhrasesBuilder.toString(); 490 491 element->appendChild(createFragmentFromText(*context.get(), serializedDictationPhrases), ec); 492 493 // We need a layout in order to add markers below. 494 document().updateLayout(); 495 496 if (!element->firstChild()->isTextNode()) { 497 // Shouldn't happen. 498 ASSERT(element->firstChild()->isTextNode()); 499 return; 500 } 501 502 Text* textNode = static_cast<Text*>(element->firstChild()); 503 int previousDictationPhraseStart = 0; 504 for (size_t i = 0; i < dictationPhraseCount; i++) { 505 const Vector<String>& interpretations = dictationPhrases->at(i); 506 int dictationPhraseLength = interpretations[0].length(); 507 int dictationPhraseEnd = previousDictationPhraseStart + dictationPhraseLength; 508 if (interpretations.size() > 1) { 509 RefPtr<Range> dictationPhraseRange = Range::create(document(), textNode, previousDictationPhraseStart, textNode, dictationPhraseEnd); 510 document().markers().addDictationPhraseWithAlternativesMarker(dictationPhraseRange.get(), interpretations); 511 } 512 previousDictationPhraseStart = dictationPhraseEnd; 513 } 514 515 RefPtr<Range> resultRange = Range::create(document(), textNode, 0, textNode, textNode->length()); 516 document().markers().addDictationResultMarker(resultRange.get(), metadata); 517 518 client()->respondToChangedContents(); 519 } 520 #endif 521 394 522 void Editor::pasteAsPlainText(const String& pastingText, bool smartReplace) 395 523 { … … 508 636 } 509 637 638 #if PLATFORM(IOS) 639 void Editor::confirmMarkedText() 640 { 641 // FIXME: This is a hacky workaround for the keyboard calling this method too late - 642 // after the selection and focus have already changed. See <rdar://problem/5975559> 643 Element* focused = document().focusedElement(); 644 Node* composition = compositionNode(); 645 646 if (composition && focused && focused != composition && !composition->isDescendantOrShadowDescendantOf(focused)) { 647 cancelComposition(); 648 document().setFocusedElement(focused); 649 } else 650 confirmComposition(); 651 } 652 653 void Editor::setTextAsChildOfElement(const String& text, Element* elem) 654 { 655 // Clear the composition 656 clear(); 657 658 // Clear the Undo stack, since the operations that follow are not Undoable, and will corrupt the stack. Some day 659 // we could make them Undoable, and let callers clear the Undo stack explicitly if they wish. 660 clearUndoRedoOperations(); 661 662 // If the element is empty already and we're not adding text, we can early return and avoid clearing/setting 663 // a selection at [0, 0] and the expense involved in creation VisiblePositions. 664 if (!elem->firstChild() && text.isEmpty()) 665 return; 666 667 // As a side effect this function sets a caret selection after the inserted content. Much of what 668 // follows is more expensive if there is a selection, so clear it since it's going to change anyway. 669 m_frame.selection().clear(); 670 671 // clear out all current children of element 672 elem->removeChildren(); 673 674 if (text.length()) { 675 // insert new text 676 // remove element from tree while doing it 677 // FIXME: The element we're inserting into is often the body element. It seems strange to be removing it 678 // (even if it is only temporary). ReplaceSelectionCommand doesn't bother doing this when it inserts 679 // content, why should we here? 680 ExceptionCode ec; 681 RefPtr<Node> parent = elem->parentNode(); 682 RefPtr<Node> siblingAfter = elem->nextSibling(); 683 if (parent) 684 elem->remove(ec); 685 686 RefPtr<Range> context = document().createRange(); 687 context->selectNodeContents(elem, ec); 688 RefPtr<DocumentFragment> fragment = createFragmentFromText(*context.get(), text); 689 elem->appendChild(fragment, ec); 690 691 // restore element to document 692 if (parent) { 693 if (siblingAfter) 694 parent->insertBefore(elem, siblingAfter.get(), ec); 695 else 696 parent->appendChild(elem, ec); 697 } 698 } 699 700 // set the selection to the end 701 VisibleSelection selection; 702 703 Position pos = createLegacyEditingPosition(elem, elem->childNodeCount()); 704 705 VisiblePosition visiblePos(pos, VP_DEFAULT_AFFINITY); 706 if (visiblePos.isNull()) 707 return; 708 709 selection.setBase(visiblePos); 710 selection.setExtent(visiblePos); 711 712 m_frame.selection().setSelection(selection); 713 714 client()->respondToChangedContents(); 715 } 716 #endif 717 510 718 bool Editor::shouldDeleteRange(Range* range) const 511 719 { … … 547 755 void Editor::notifyComponentsOnChangedSelection(const VisibleSelection& oldSelection, FrameSelection::SetSelectionOptions options) 548 756 { 757 #if PLATFORM(IOS) 758 // FIXME: Merge this to open source https://bugs.webkit.org/show_bug.cgi?id=38830 759 if (m_ignoreCompositionSelectionChange) 760 return; 761 #endif 762 549 763 if (client()) 550 764 client()->respondToChangedSelection(&m_frame); … … 705 919 m_lastEditCommand.clear(); 706 920 } 921 #if PLATFORM(IOS) 922 // If the selection is adjusted from UIKit without closing the typing, the typing command may 923 // have a stale selection. 924 void Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping() 925 { 926 TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping(&m_frame, m_frame.selection().selection()); 927 } 928 #endif 707 929 708 930 // Returns whether caller should continue with "the default processing", which is the same as … … 1089 1311 } else { 1090 1312 if (HTMLImageElement* imageElement = imageElementFromImageDocument(document())) { 1091 #if (PLATFORM(MAC) && !PLATFORM(IOS)) || PLATFORM(EFL) || PLATFORM(NIX)1313 #if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX) 1092 1314 writeImageToPasteboard(*Pasteboard::createForCopyAndPaste(), *imageElement, document().url(), document().title()); 1093 1315 #else … … 1095 1317 #endif 1096 1318 } else { 1097 #if (PLATFORM(MAC) && !PLATFORM(IOS)) || PLATFORM(EFL) || PLATFORM(NIX)1319 #if PLATFORM(MAC) || PLATFORM(EFL) || PLATFORM(NIX) 1098 1320 writeSelectionToPasteboard(*Pasteboard::createForCopyAndPaste()); 1099 1321 #else … … 1170 1392 } 1171 1393 1394 #if !PLATFORM(IOS) 1172 1395 void Editor::copyURL(const URL& url, const String& title) 1173 1396 { … … 1204 1427 #endif 1205 1428 } 1429 #endif 1206 1430 1207 1431 bool Editor::isContinuousSpellCheckingEnabled() const … … 1414 1638 void Editor::setBaseWritingDirection(WritingDirection direction) 1415 1639 { 1640 #if PLATFORM(IOS) 1641 if (inSameParagraph(m_frame.selection().selection().visibleStart(), m_frame.selection().selection().visibleEnd()) && 1642 baseWritingDirectionForSelectionStart() == direction) 1643 return; 1644 #endif 1645 1416 1646 Element* focusedElement = document().focusedElement(); 1417 1647 if (focusedElement && isHTMLTextFormControlElement(*focusedElement)) { … … 1561 1791 return; 1562 1792 } 1793 1794 #if PLATFORM(IOS) 1795 client()->startDelayingAndCoalescingContentChangeNotifications(); 1796 #endif 1563 1797 1564 1798 Element* target = document().focusedElement(); … … 1637 1871 1638 1872 setIgnoreCompositionSelectionChange(false); 1873 1874 #if PLATFORM(IOS) 1875 client()->stopDelayingAndCoalescingContentChangeNotifications(); 1876 #endif 1639 1877 } 1640 1878 … … 1669 1907 } 1670 1908 1909 #if !PLATFORM(IOS) 1671 1910 void Editor::advanceToNextMisspelling(bool startBeforeSelection) 1672 1911 { … … 1841 2080 } 1842 2081 } 2082 #endif // !PLATFORM(IOS) 1843 2083 1844 2084 String Editor::misspelledWordAtCaretOrRange(Node* clickedNode) const … … 1955 2195 return; 1956 2196 } 1957 2197 2198 #if !PLATFORM(IOS) 1958 2199 advanceToNextMisspelling(true); 2200 #endif 1959 2201 client()->showSpellingUI(true); 1960 2202 } … … 1983 2225 void Editor::markMisspellingsAfterTypingToWord(const VisiblePosition &wordStart, const VisibleSelection& selectionAfterTyping, bool doReplacement) 1984 2226 { 2227 #if PLATFORM(IOS) 2228 UNUSED_PARAM(selectionAfterTyping); 2229 UNUSED_PARAM(doReplacement); 2230 TextCheckingTypeMask textCheckingOptions = 0; 2231 if (isContinuousSpellCheckingEnabled()) 2232 textCheckingOptions |= TextCheckingTypeSpelling; 2233 if (!(textCheckingOptions & TextCheckingTypeSpelling)) 2234 return; 2235 2236 VisibleSelection adjacentWords = VisibleSelection(startOfWord(wordStart, LeftWordIfOnBoundary), endOfWord(wordStart, RightWordIfOnBoundary)); 2237 markAllMisspellingsAndBadGrammarInRanges(textCheckingOptions, adjacentWords.toNormalizedRange().get(), adjacentWords.toNormalizedRange().get()); 2238 #else 1985 2239 #if !USE(AUTOMATIC_TEXT_REPLACEMENT) 1986 2240 UNUSED_PARAM(doReplacement); … … 2057 2311 // Check grammar of entire sentence 2058 2312 markBadGrammar(VisibleSelection(startOfSentence(wordStart), endOfSentence(wordStart))); 2313 #endif 2059 2314 } 2060 2315 2061 2316 void Editor::markMisspellingsOrBadGrammar(const VisibleSelection& selection, bool checkSpelling, RefPtr<Range>& firstMisspellingRange) 2062 2317 { 2318 #if !PLATFORM(IOS) 2063 2319 // This function is called with a selection already expanded to word boundaries. 2064 2320 // Might be nice to assert that here. … … 2096 2352 #endif 2097 2353 } 2354 #else 2355 UNUSED_PARAM(selection); 2356 UNUSED_PARAM(checkSpelling); 2357 UNUSED_PARAM(firstMisspellingRange); 2358 #endif // !PLATFORM(IOS) 2098 2359 } 2099 2360 … … 2373 2634 void Editor::changeBackToReplacedString(const String& replacedString) 2374 2635 { 2636 #if !PLATFORM(IOS) 2375 2637 ASSERT(unifiedTextCheckerEnabled()); 2376 2638 … … 2388 2650 changedRange->startContainer()->document().markers().addMarker(changedRange.get(), DocumentMarker::Replacement, String()); 2389 2651 m_alternativeTextController->markReversed(changedRange.get()); 2652 #else 2653 ASSERT_NOT_REACHED(); 2654 UNUSED_PARAM(replacedString); 2655 #endif // !PLATFORM(IOS) 2390 2656 } 2391 2657 … … 2488 2754 m_alternativeTextController->removeDictationAlternativesForMarker(markers[i]); 2489 2755 2756 #if PLATFORM(IOS) 2757 document().markers().removeMarkers(wordRange.get(), DocumentMarker::Spelling | DocumentMarker::CorrectionIndicator | DocumentMarker::SpellCheckingExemption | DocumentMarker::DictationAlternatives | DocumentMarker::DictationPhraseWithAlternatives, DocumentMarkerController::RemovePartiallyOverlappingMarker); 2758 #else 2490 2759 document().markers().removeMarkers(wordRange.get(), DocumentMarker::Spelling | DocumentMarker::Grammar | DocumentMarker::CorrectionIndicator | DocumentMarker::SpellCheckingExemption | DocumentMarker::DictationAlternatives, DocumentMarkerController::RemovePartiallyOverlappingMarker); 2760 #endif 2491 2761 document().markers().clearDescriptionOnMarkersIntersectingRange(wordRange.get(), DocumentMarker::Replacement); 2492 2762 } … … 2528 2798 2529 2799 m_ignoreCompositionSelectionChange = ignore; 2800 #if PLATFORM(IOS) 2801 // FIXME: Merge this to open source https://bugs.webkit.org/show_bug.cgi?id=38830 2802 if (!ignore) 2803 notifyComponentsOnChangedSelection(m_frame.selection().selection(), 0); 2804 #endif 2530 2805 if (!ignore) 2531 2806 revealSelectionAfterEditingOperation(ScrollAlignment::alignToEdgeIfNeeded, RevealExtent); … … 2657 2932 // does not call EditorClient::respondToChangedSelection(), which, on the Mac, sends selection change notifications and 2658 2933 // starts a new kill ring sequence, but we want to do these things (matches AppKit). 2934 #if PLATFORM(IOS) 2935 // FIXME: Merge this to open source https://bugs.webkit.org/show_bug.cgi?id=38830 2936 if (m_ignoreCompositionSelectionChange) 2937 return; 2938 #endif 2659 2939 if (selectionDidNotChangeDOMPosition && client()) 2660 2940 client()->respondToChangedSelection(&m_frame); … … 2728 3008 bool Editor::shouldChangeSelection(const VisibleSelection& oldSelection, const VisibleSelection& newSelection, EAffinity affinity, bool stillSelecting) const 2729 3009 { 3010 #if PLATFORM(IOS) 3011 if (m_frame.selectionChangeCallbacksDisabled()) 3012 return true; 3013 #endif 2730 3014 return client() && client()->shouldChangeSelectedRange(oldSelection.toNormalizedRange().get(), newSelection.toNormalizedRange().get(), affinity, stillSelecting); 2731 3015 } … … 3022 3306 if (m_frame.selection().selection().isContentEditable() || caretBrowsing) { 3023 3307 VisiblePosition newStart(m_frame.selection().selection().visibleStart()); 3308 #if !PLATFORM(IOS) 3024 3309 newAdjacentWords = VisibleSelection(startOfWord(newStart, LeftWordIfOnBoundary), endOfWord(newStart, RightWordIfOnBoundary)); 3310 #else 3311 // If this bug gets fixed, this PLATFORM(IOS) code could be removed: 3312 // <rdar://problem/7259611> Word boundary code on iPhone gives different results than desktop 3313 EWordSide startWordSide = LeftWordIfOnBoundary; 3314 UChar32 c = newStart.characterBefore(); 3315 // FIXME: VisiblePosition::characterAfter() and characterBefore() do not emit newlines the same 3316 // way as TextIterator, so we do an isStartOfParagraph check here. 3317 if (isSpaceOrNewline(c) || c == 0xA0 || isStartOfParagraph(newStart)) { 3318 startWordSide = RightWordIfOnBoundary; 3319 } 3320 newAdjacentWords = VisibleSelection(startOfWord(newStart, startWordSide), endOfWord(newStart, RightWordIfOnBoundary)); 3321 #endif // !PLATFORM(IOS) 3025 3322 if (isContinuousGrammarCheckingEnabled) 3026 3323 newSelectedSentence = VisibleSelection(startOfSentence(newStart), endOfSentence(newStart)); … … 3104 3401 bool shouldMarkSpelling = textCheckingOptions & TextCheckingTypeSpelling; 3105 3402 bool shouldMarkGrammar = textCheckingOptions & TextCheckingTypeGrammar; 3403 #if !PLATFORM(IOS) 3106 3404 bool shouldShowCorrectionPanel = textCheckingOptions & TextCheckingTypeShowCorrectionPanel; 3107 3405 bool shouldCheckForCorrection = shouldShowCorrectionPanel || (textCheckingOptions & TextCheckingTypeCorrection); 3406 #endif 3108 3407 3109 3408 TextCheckingTypeMask checkingTypes = 0; … … 3112 3411 if (shouldMarkGrammar) 3113 3412 checkingTypes |= TextCheckingTypeGrammar; 3413 #if !PLATFORM(IOS) 3114 3414 if (shouldCheckForCorrection) 3115 3415 checkingTypes |= TextCheckingTypeCorrection; … … 3132 3432 } 3133 3433 #endif 3434 #endif // !PLATFORM(IOS) 3134 3435 3135 3436 return checkingTypes; -
trunk/Source/WebCore/editing/Editor.h
r160045 r161638 127 127 void performDelete(); 128 128 129 #if !PLATFORM(IOS) 129 130 void copyURL(const URL&, const String& title); 130 131 void copyURL(const URL&, const String& title, Pasteboard&); 131 132 void copyImage(const HitTestResult&); 133 #endif 132 134 133 135 String readPlainTextFromPasteboard(Pasteboard&); … … 162 164 163 165 void clearLastEditCommand(); 166 #if PLATFORM(IOS) 167 void ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping(); 168 #endif 164 169 165 170 bool deleteWithDirection(SelectionDirection, TextGranularity, bool killRing, bool isTypingAction); 166 171 void deleteSelectionWithSmartDelete(bool smartDelete); 172 #if PLATFORM(IOS) 173 void clearText(); 174 void removeUnchangeableStyles(); 175 #endif 176 167 177 bool dispatchCPPEvent(const AtomicString&, ClipboardAccessPolicy); 168 178 … … 236 246 237 247 void markAllMisspellingsAndBadGrammarInRanges(TextCheckingTypeMask, Range* spellingRange, Range* grammarRange); 248 #if PLATFORM(IOS) 249 NO_RETURN_DUE_TO_ASSERT 250 #endif 238 251 void changeBackToReplacedString(const String& replacedString); 239 252 253 #if !PLATFORM(IOS) 240 254 void advanceToNextMisspelling(bool startBeforeSelection = false); 255 #endif // !PLATFORM(IOS) 241 256 void showSpellingGuessPanel(); 242 257 bool spellingPanelIsShowing(); … … 304 319 305 320 PassRefPtr<Range> selectedRange(); 321 322 #if PLATFORM(IOS) 323 void confirmMarkedText(); 324 void setTextAsChildOfElement(const String&, Element*); 325 void setTextAlignmentForChangedBaseWritingDirection(WritingDirection); 326 void insertDictationPhrases(PassOwnPtr<Vector<Vector<String> > > dictationPhrases, RetainPtr<id> metadata); 327 void setDictationPhrasesAsChildOfElement(PassOwnPtr<Vector<Vector<String> > > dictationPhrases, RetainPtr<id> metadata, Element* element); 328 #endif 306 329 307 330 void addToKillRing(Range*, bool prepend); … … 401 424 const SimpleFontData* fontForSelection(bool&) const; 402 425 NSDictionary* fontAttributesForSelectionStart() const; 426 String stringSelectionForPasteboard(); 427 String stringSelectionForPasteboardWithImageAltText(); 428 PassRefPtr<DocumentFragment> webContentFromPasteboard(Pasteboard&, Range& context, bool allowPlainText, bool& chosePlainText); 429 #if !PLATFORM(IOS) 403 430 bool canCopyExcludingStandaloneImages(); 404 431 void takeFindStringFromSelection(); 405 432 void readSelectionFromPasteboard(const String& pasteboardName); 406 String stringSelectionForPasteboard();407 String stringSelectionForPasteboardWithImageAltText();408 433 PassRefPtr<SharedBuffer> dataSelectionForPasteboard(const String& pasteboardName); 409 PassRefPtr<DocumentFragment> webContentFromPasteboard(Pasteboard&, Range& context, bool allowPlainText, bool& chosePlainText); 434 #endif // !PLATFORM(IOS) 410 435 #endif 411 436 -
trunk/Source/WebCore/editing/EditorCommand.cpp
r160966 r161638 303 303 } 304 304 305 #if PLATFORM(IOS) 306 static bool executeClearText(Frame& frame, Event*, EditorCommandSource, const String&) 307 { 308 frame.editor().clearText(); 309 return true; 310 } 311 #endif 312 305 313 static bool executeDefaultParagraphSeparator(Frame& frame, Event*, EditorCommandSource, const String& value) 306 314 { … … 1094 1102 } 1095 1103 1096 #if PLATFORM(MAC) 1104 #if PLATFORM(MAC) && !PLATFORM(IOS) 1097 1105 static bool executeTakeFindStringFromSelection(Frame& frame, Event*, EditorCommandSource, const String&) 1098 1106 { … … 1238 1246 static bool enabledCopy(Frame& frame, Event*, EditorCommandSource) 1239 1247 { 1248 #if !PLATFORM(IOS) 1240 1249 return frame.editor().canDHTMLCopy() || frame.editor().canCopy(); 1250 #else 1251 return frame.editor().canCopy(); 1252 #endif 1241 1253 } 1242 1254 1243 1255 static bool enabledCut(Frame& frame, Event*, EditorCommandSource) 1244 1256 { 1257 #if !PLATFORM(IOS) 1245 1258 return frame.editor().canDHTMLCut() || frame.editor().canCut(); 1246 } 1259 #else 1260 return frame.editor().canCut(); 1261 #endif 1262 } 1263 1264 #if PLATFORM(IOS) 1265 static bool enabledClearText(Frame& frame, Event*, EditorCommandSource) 1266 { 1267 UNUSED_PARAM(frame); 1268 return false; 1269 } 1270 #endif 1247 1271 1248 1272 static bool enabledInEditableText(Frame& frame, Event* event, EditorCommandSource) … … 1297 1321 } 1298 1322 1299 #if PLATFORM(MAC) 1323 #if PLATFORM(MAC) && !PLATFORM(IOS) 1300 1324 static bool enabledTakeFindStringFromSelection(Frame& frame, Event*, EditorCommandSource) 1301 1325 { … … 1604 1628 #endif 1605 1629 1606 #if PLATFORM(MAC) 1630 #if PLATFORM(MAC) && !PLATFORM(IOS) 1607 1631 { "TakeFindStringFromSelection", { executeTakeFindStringFromSelection, supportedFromMenuOrKeyBinding, enabledTakeFindStringFromSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1632 #endif 1633 #if PLATFORM(IOS) 1634 { "ClearText", { executeClearText, supported, enabledClearText, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } }, 1635 #endif 1636 1637 #if PLATFORM(GTK) || PLATFORM(QT) 1638 { "PasteGlobalSelection", { executePasteGlobalSelection, supportedFromMenuOrKeyBinding, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } }, 1608 1639 #endif 1609 1640 }; -
trunk/Source/WebCore/editing/FrameSelection.cpp
r161026 r161638 66 66 #include <wtf/text/CString.h> 67 67 68 #if PLATFORM(IOS) 69 #include "Chrome.h" 70 #include "ChromeClient.h" 71 #include "Color.h" 72 #include "RenderLayer.h" 73 #include "RenderObject.h" 74 #include "RenderStyle.h" 75 #endif 76 68 77 #define EDIT_DEBUG 0 69 78 … … 108 117 , m_focused(frame && frame->page() && frame->page()->focusController().focusedFrame() == frame) 109 118 , m_shouldShowBlockCursor(false) 119 #if PLATFORM(IOS) 120 , m_updateAppearanceEnabled(false) 121 , m_caretBlinks(true) 122 , m_closeTypingSuppressions(0) 123 , m_scrollingSuppressCount(0) 124 #endif 110 125 { 111 126 if (shouldAlwaysUseDirectionalSelection(m_frame)) … … 269 284 m_granularity = granularity; 270 285 286 #if PLATFORM(IOS) 287 if (closeTyping && m_closeTypingSuppressions == 0) 288 #else 271 289 if (closeTyping) 290 #endif 272 291 TypingCommand::closeTyping(m_frame); 273 292 … … 621 640 pos = modifyExtendingForward(granularity); 622 641 break; 642 #if PLATFORM(IOS) 643 case DocumentGranularity: 644 ASSERT_NOT_REACHED(); 645 break; 646 #endif 623 647 } 624 648 #if ENABLE(USERSELECT_ALL) … … 647 671 pos = nextParagraphPosition(pos, lineDirectionPointForBlockDirectionNavigation(EXTENT)); 648 672 break; 673 #if PLATFORM(IOS) 674 case DocumentGranularity: 675 ASSERT_NOT_REACHED(); 676 break; 677 #endif 649 678 case SentenceBoundary: 650 679 pos = endOfSentence(endForPlatform()); … … 704 733 pos = rightBoundaryOfLine(startForPlatform(), directionOfEnclosingBlock()); 705 734 break; 735 #if PLATFORM(IOS) 736 case DocumentGranularity: 737 ASSERT_NOT_REACHED(); 738 break; 739 #endif 706 740 } 707 741 return pos; … … 736 770 pos = nextParagraphPosition(endForPlatform(), lineDirectionPointForBlockDirectionNavigation(START)); 737 771 break; 772 #if PLATFORM(IOS) 773 case DocumentGranularity: 774 ASSERT_NOT_REACHED(); 775 break; 776 #endif 738 777 case SentenceBoundary: 739 778 pos = endOfSentence(endForPlatform()); … … 792 831 pos = modifyExtendingBackward(granularity); 793 832 break; 833 #if PLATFORM(IOS) 834 case DocumentGranularity: 835 ASSERT_NOT_REACHED(); 836 break; 837 #endif 794 838 } 795 839 #if ENABLE(USERSELECT_ALL) … … 839 883 pos = startOfDocument(pos); 840 884 break; 885 #if PLATFORM(IOS) 886 case DocumentGranularity: 887 ASSERT_NOT_REACHED(); 888 break; 889 #endif 841 890 } 842 891 #if ENABLE(USERSELECT_ALL) … … 878 927 pos = leftBoundaryOfLine(startForPlatform(), directionOfEnclosingBlock()); 879 928 break; 929 #if PLATFORM(IOS) 930 case DocumentGranularity: 931 ASSERT_NOT_REACHED(); 932 break; 933 #endif 880 934 } 881 935 return pos; … … 920 974 pos = startOfDocument(pos); 921 975 break; 976 #if PLATFORM(IOS) 977 case DocumentGranularity: 978 ASSERT_NOT_REACHED(); 979 break; 980 #endif 922 981 } 923 982 return pos; … … 1669 1728 VisiblePosition visibleStart(range->startPosition(), collapsed ? affinity : DOWNSTREAM); 1670 1729 VisiblePosition visibleEnd(range->endPosition(), SEL_DEFAULT_AFFINITY); 1730 #if PLATFORM(IOS) 1731 if (range->startContainer() && visibleStart.isNull()) 1732 return false; 1733 if (range->endContainer() && visibleEnd.isNull()) 1734 return false; 1735 #endif 1671 1736 setSelection(VisibleSelection(visibleStart, visibleEnd), ClearTypingStyle | (closeTyping ? CloseTyping : 0)); 1672 1737 return true; … … 1686 1751 document->updateStyleIfNeeded(); 1687 1752 1753 #if USE(UIKIT_EDITING) 1754 // Caret blinking (blinks | does not blink) 1755 if (activeAndFocused) 1756 setSelectionFromNone(); 1757 setCaretVisible(activeAndFocused); 1758 #else 1688 1759 // Because RenderObject::selectionBackgroundColor() and 1689 1760 // RenderObject::selectionForegroundColor() check if the frame is active, … … 1709 1780 renderer->theme().stateChanged(renderer, FocusState); 1710 1781 } 1782 #endif 1711 1783 } 1712 1784 … … 1739 1811 void FrameSelection::updateAppearance() 1740 1812 { 1813 #if PLATFORM(IOS) 1814 if (!m_updateAppearanceEnabled) 1815 return; 1816 #endif 1817 1741 1818 // Paint a block cursor instead of a caret in overtype mode unless the caret is at the end of a line (in this case 1742 1819 // the FrameSelection will paint a blinking caret as usual). … … 1913 1990 bool FrameSelection::shouldDeleteSelection(const VisibleSelection& selection) const 1914 1991 { 1992 #if PLATFORM(IOS) 1993 if (m_frame->selectionChangeCallbacksDisabled()) 1994 return true; 1995 #endif 1915 1996 return m_frame->editor().client()->shouldDeleteRange(selection.toNormalizedRange().get()); 1916 1997 } … … 2011 2092 ASSERT(start.deprecatedNode()); 2012 2093 if (start.deprecatedNode() && start.deprecatedNode()->renderer()) { 2094 #if PLATFORM(IOS) 2095 if (RenderLayer* layer = start.deprecatedNode()->renderer()->enclosingLayer()) { 2096 if (!m_scrollingSuppressCount) { 2097 layer->setAdjustForIOSCaretWhenScrolling(true); 2098 layer->scrollRectToVisible(rect, alignment, alignment); 2099 layer->setAdjustForIOSCaretWhenScrolling(false); 2100 updateAppearance(); 2101 if (m_frame->page()) 2102 m_frame->page()->chrome().client().notifyRevealedSelectionByScrollingFrame(m_frame); 2103 } 2104 } 2105 #else 2013 2106 // FIXME: This code only handles scrolling the startContainer's layer, but 2014 2107 // the selection rect could intersect more than just that. … … 2016 2109 if (start.deprecatedNode()->renderer()->scrollRectToVisible(rect, alignment, alignment)) 2017 2110 updateAppearance(); 2111 #endif 2018 2112 } 2019 2113 } … … 2025 2119 2026 2120 Document* document = m_frame->document(); 2121 #if !PLATFORM(IOS) 2027 2122 bool caretBrowsing = m_frame->settings().caretBrowsingEnabled(); 2028 2123 if (!isNone() || !(document->hasEditableStyle() || caretBrowsing)) 2029 2124 return; 2125 #else 2126 if (!document || !(isNone() || isStartOfDocument(VisiblePosition(selection().start(), selection().affinity()))) || !document->rendererIsEditable()) 2127 return; 2128 #endif 2030 2129 2031 2130 Node* node = document->documentElement(); … … 2038 2137 bool FrameSelection::shouldChangeSelection(const VisibleSelection& newSelection) const 2039 2138 { 2139 #if PLATFORM(IOS) 2140 if (m_frame->selectionChangeCallbacksDisabled()) 2141 return true; 2142 #endif 2040 2143 return m_frame->editor().shouldChangeSelection(selection(), newSelection, newSelection.affinity(), false); 2041 2144 } … … 2073 2176 #endif 2074 2177 2178 #if PLATFORM(IOS) 2179 void FrameSelection::expandSelectionToElementContainingCaretSelection() 2180 { 2181 RefPtr<Range> range = elementRangeContainingCaretSelection(); 2182 if (!range) 2183 return; 2184 VisibleSelection selection(range.get(), DOWNSTREAM); 2185 setSelection(selection); 2186 } 2187 2188 PassRefPtr<Range> FrameSelection::elementRangeContainingCaretSelection() const 2189 { 2190 if (m_selection.isNone()) 2191 return nullptr; 2192 2193 VisibleSelection selection = m_selection; 2194 if (selection.isNone()) 2195 return nullptr; 2196 2197 VisiblePosition visiblePos(selection.start(), VP_DEFAULT_AFFINITY); 2198 if (visiblePos.isNull()) 2199 return nullptr; 2200 2201 Node* node = visiblePos.deepEquivalent().deprecatedNode(); 2202 Element* element = deprecatedEnclosingBlockFlowElement(node); 2203 if (!element) 2204 return nullptr; 2205 2206 Position startPos = createLegacyEditingPosition(element, 0); 2207 Position endPos = createLegacyEditingPosition(element, element->childNodeCount()); 2208 2209 VisiblePosition startVisiblePos(startPos, VP_DEFAULT_AFFINITY); 2210 VisiblePosition endVisiblePos(endPos, VP_DEFAULT_AFFINITY); 2211 if (startVisiblePos.isNull() || endVisiblePos.isNull()) 2212 return nullptr; 2213 2214 selection.setBase(startVisiblePos); 2215 selection.setExtent(endVisiblePos); 2216 2217 return selection.toNormalizedRange(); 2218 } 2219 2220 void FrameSelection::expandSelectionToWordContainingCaretSelection() 2221 { 2222 VisibleSelection selection(wordSelectionContainingCaretSelection(m_selection)); 2223 if (selection.isCaretOrRange()) 2224 setSelection(selection); 2225 } 2226 2227 PassRefPtr<Range> FrameSelection::wordRangeContainingCaretSelection() 2228 { 2229 return wordSelectionContainingCaretSelection(m_selection).toNormalizedRange(); 2230 } 2231 2232 void FrameSelection::expandSelectionToStartOfWordContainingCaretSelection() 2233 { 2234 if (m_selection.isNone() || isStartOfDocument(m_selection.start())) 2235 return; 2236 2237 VisiblePosition s1(m_selection.start()); 2238 VisiblePosition e1(m_selection.end()); 2239 2240 VisibleSelection expanded(wordSelectionContainingCaretSelection(m_selection)); 2241 VisiblePosition s2(expanded.start()); 2242 2243 // Don't allow the start to become greater after the expansion. 2244 if (s2.isNull() || s2 > s1) 2245 s2 = s1; 2246 2247 moveTo(s2, e1); 2248 } 2249 2250 UChar FrameSelection::characterInRelationToCaretSelection(int amount) const 2251 { 2252 if (m_selection.isNone()) 2253 return 0; 2254 2255 VisibleSelection selection = m_selection; 2256 ASSERT(selection.isCaretOrRange()); 2257 2258 VisiblePosition visiblePosition(selection.start(), VP_DEFAULT_AFFINITY); 2259 2260 if (amount < 0) { 2261 int count = abs(amount); 2262 for (int i = 0; i < count; i++) 2263 visiblePosition = visiblePosition.previous(); 2264 return visiblePosition.characterBefore(); 2265 } 2266 for (int i = 0; i < amount; i++) 2267 visiblePosition = visiblePosition.next(); 2268 return visiblePosition.characterAfter(); 2269 } 2270 2271 UChar FrameSelection::characterBeforeCaretSelection() const 2272 { 2273 if (m_selection.isNone()) 2274 return 0; 2275 2276 VisibleSelection selection = m_selection; 2277 ASSERT(selection.isCaretOrRange()); 2278 2279 VisiblePosition visiblePosition(selection.start(), VP_DEFAULT_AFFINITY); 2280 return visiblePosition.characterBefore(); 2281 } 2282 2283 UChar FrameSelection::characterAfterCaretSelection() const 2284 { 2285 if (m_selection.isNone()) 2286 return 0; 2287 2288 VisibleSelection selection = m_selection; 2289 ASSERT(selection.isCaretOrRange()); 2290 2291 VisiblePosition visiblePosition(selection.end(), VP_DEFAULT_AFFINITY); 2292 return visiblePosition.characterAfter(); 2293 } 2294 2295 int FrameSelection::wordOffsetInRange(const Range *range) const 2296 { 2297 if (!range) 2298 return -1; 2299 2300 VisibleSelection selection = m_selection; 2301 if (!selection.isCaret()) 2302 return -1; 2303 2304 // FIXME: This will only work in cases where the selection remains in 2305 // the same node after it is expanded. Improve to handle more complicated 2306 // cases. 2307 ExceptionCode ec = 0; 2308 int result = selection.start().deprecatedEditingOffset() - range->startOffset(ec); 2309 ASSERT(!ec); 2310 if (result < 0) 2311 result = 0; 2312 return result; 2313 } 2314 2315 bool FrameSelection::spaceFollowsWordInRange(const Range *range) const 2316 { 2317 if (!range) 2318 return false; 2319 ExceptionCode ec = 0; 2320 Node* node = range->endContainer(ec); 2321 ASSERT(!ec); 2322 int endOffset = range->endOffset(ec); 2323 ASSERT(!ec); 2324 VisiblePosition pos(createLegacyEditingPosition(node, endOffset), VP_DEFAULT_AFFINITY); 2325 return isSpaceOrNewline(pos.characterAfter()); 2326 } 2327 2328 bool FrameSelection::selectionAtDocumentStart() const 2329 { 2330 VisibleSelection selection = m_selection; 2331 if (selection.isNone()) 2332 return false; 2333 2334 Position startPos(selection.start()); 2335 VisiblePosition pos(createLegacyEditingPosition(startPos.deprecatedNode(), startPos.deprecatedEditingOffset()), VP_DEFAULT_AFFINITY); 2336 if (pos.isNull()) 2337 return false; 2338 2339 return isStartOfDocument(pos); 2340 } 2341 2342 bool FrameSelection::selectionAtSentenceStart() const 2343 { 2344 VisibleSelection selection = m_selection; 2345 if (selection.isNone()) 2346 return false; 2347 2348 return actualSelectionAtSentenceStart(selection); 2349 } 2350 2351 bool FrameSelection::selectionAtWordStart() const 2352 { 2353 VisibleSelection selection = m_selection; 2354 if (selection.isNone()) 2355 return false; 2356 2357 Position startPos(selection.start()); 2358 VisiblePosition pos(createLegacyEditingPosition(startPos.deprecatedNode(), startPos.deprecatedEditingOffset()), VP_DEFAULT_AFFINITY); 2359 if (pos.isNull()) 2360 return false; 2361 2362 if (isStartOfParagraph(pos)) 2363 return true; 2364 2365 bool result = true; 2366 unsigned previousCount = 0; 2367 for (pos = pos.previous(); !pos.isNull(); pos = pos.previous()) { 2368 previousCount++; 2369 if (isStartOfParagraph(pos)) { 2370 if (previousCount == 1) 2371 result = false; 2372 break; 2373 } 2374 UChar c(pos.characterAfter()); 2375 if (c) { 2376 result = isSpaceOrNewline(c) || c == 0xA0 || (u_ispunct(c) && c != ',' && c != '-' && c != '\''); 2377 break; 2378 } 2379 } 2380 2381 return result; 2382 } 2383 2384 PassRefPtr<Range> FrameSelection::rangeByMovingCurrentSelection(int amount) const 2385 { 2386 return rangeByAlteringCurrentSelection(AlterationMove, amount); 2387 } 2388 2389 PassRefPtr<Range> FrameSelection::rangeByExtendingCurrentSelection(int amount) const 2390 { 2391 return rangeByAlteringCurrentSelection(AlterationExtend, amount); 2392 } 2393 2394 void FrameSelection::selectRangeOnElement(unsigned location, unsigned length, Node* node) 2395 { 2396 RefPtr<Range> resultRange = m_frame->document()->createRange(); 2397 ExceptionCode ec = 0; 2398 resultRange->setStart(node, location, ec); 2399 ASSERT(!ec); 2400 resultRange->setEnd(node, location + length, ec); 2401 ASSERT(!ec); 2402 VisibleSelection selection = VisibleSelection(resultRange.get(), SEL_DEFAULT_AFFINITY); 2403 setSelection(selection, true); 2404 } 2405 2406 VisibleSelection FrameSelection::wordSelectionContainingCaretSelection(const VisibleSelection& selection) 2407 { 2408 if (selection.isNone()) 2409 return VisibleSelection(); 2410 2411 ASSERT(selection.isCaretOrRange()); 2412 FrameSelection frameSelection; 2413 frameSelection.setSelection(selection); 2414 2415 Position startPosBeforeExpansion(selection.start()); 2416 Position endPosBeforeExpansion(selection.end()); 2417 VisiblePosition startVisiblePosBeforeExpansion(startPosBeforeExpansion, VP_DEFAULT_AFFINITY); 2418 VisiblePosition endVisiblePosBeforeExpansion(endPosBeforeExpansion, VP_DEFAULT_AFFINITY); 2419 if (endVisiblePosBeforeExpansion.isNull()) 2420 return VisibleSelection(); 2421 2422 if (isEndOfParagraph(endVisiblePosBeforeExpansion)) { 2423 UChar c(endVisiblePosBeforeExpansion.characterBefore()); 2424 if (isSpaceOrNewline(c) || c == 0xA0) { 2425 // End of paragraph with space. 2426 return VisibleSelection(); 2427 } 2428 } 2429 2430 // If at end of paragraph, move backwards one character. 2431 // This has the effect of selecting the word on the line (which is 2432 // what we want, rather than selecting past the end of the line). 2433 if (isEndOfParagraph(endVisiblePosBeforeExpansion) && !isStartOfParagraph(endVisiblePosBeforeExpansion)) 2434 frameSelection.modify(FrameSelection::AlterationMove, DirectionBackward, CharacterGranularity); 2435 2436 VisibleSelection newSelection = frameSelection.selection(); 2437 newSelection.expandUsingGranularity(WordGranularity); 2438 frameSelection.setSelection(newSelection, frameSelection.granularity()); 2439 2440 Position startPos(frameSelection.selection().start()); 2441 Position endPos(frameSelection.selection().end()); 2442 2443 // Expansion cannot be allowed to change selection so that it is no longer 2444 // touches (or contains) the original, unexpanded selection. 2445 // Enforce this on the way into these additional calculations to give them 2446 // the best chance to yield a suitable answer. 2447 if (startPos > startPosBeforeExpansion) 2448 startPos = startPosBeforeExpansion; 2449 if (endPos < endPosBeforeExpansion) 2450 endPos = endPosBeforeExpansion; 2451 2452 VisiblePosition startVisiblePos(startPos, VP_DEFAULT_AFFINITY); 2453 VisiblePosition endVisiblePos(endPos, VP_DEFAULT_AFFINITY); 2454 2455 if (startVisiblePos.isNull() || endVisiblePos.isNull()) { 2456 // Start or end is nil 2457 return VisibleSelection(); 2458 } 2459 2460 if (isEndOfLine(endVisiblePosBeforeExpansion)) { 2461 VisiblePosition previous(endVisiblePos.previous()); 2462 if (previous == endVisiblePos) { 2463 // Empty document 2464 return VisibleSelection(); 2465 } 2466 UChar c(previous.characterAfter()); 2467 if (isSpaceOrNewline(c) || c == 0xA0) { 2468 // Space at end of line 2469 return VisibleSelection(); 2470 } 2471 } 2472 2473 // Expansion has selected past end of line. 2474 // Try repositioning backwards. 2475 if (isEndOfLine(startVisiblePos) && isStartOfLine(endVisiblePos)) { 2476 VisiblePosition previous(startVisiblePos.previous()); 2477 if (isEndOfLine(previous)) { 2478 // On empty line 2479 return VisibleSelection(); 2480 } 2481 UChar c(previous.characterAfter()); 2482 if (isSpaceOrNewline(c) || c == 0xA0) { 2483 // Space at end of line 2484 return VisibleSelection(); 2485 } 2486 frameSelection.moveTo(startVisiblePos); 2487 frameSelection.modify(FrameSelection::AlterationExtend, DirectionBackward, WordGranularity); 2488 startPos = frameSelection.selection().start(); 2489 endPos = frameSelection.selection().end(); 2490 startVisiblePos = VisiblePosition(startPos, VP_DEFAULT_AFFINITY); 2491 endVisiblePos = VisiblePosition(endPos, VP_DEFAULT_AFFINITY); 2492 if (startVisiblePos.isNull() || endVisiblePos.isNull()) { 2493 // Start or end is nil 2494 return VisibleSelection(); 2495 } 2496 } 2497 2498 // Now loop backwards until we find a non-space. 2499 while (endVisiblePos != startVisiblePos) { 2500 VisiblePosition previous(endVisiblePos.previous()); 2501 UChar c(previous.characterAfter()); 2502 if (!isSpaceOrNewline(c) && c != 0xA0) 2503 break; 2504 endVisiblePos = previous; 2505 } 2506 2507 // Expansion cannot be allowed to change selection so that it is no longer 2508 // touches (or contains) the original, unexpanded selection. 2509 // Enforce this on the way out of the function to preserve the invariant. 2510 if (startVisiblePos > startVisiblePosBeforeExpansion) 2511 startVisiblePos = startVisiblePosBeforeExpansion; 2512 if (endVisiblePos < endVisiblePosBeforeExpansion) 2513 endVisiblePos = endVisiblePosBeforeExpansion; 2514 2515 return VisibleSelection(startVisiblePos, endVisiblePos); 2516 } 2517 2518 bool FrameSelection::actualSelectionAtSentenceStart(const VisibleSelection& sel) const 2519 { 2520 Position startPos(sel.start()); 2521 VisiblePosition pos(createLegacyEditingPosition(startPos.deprecatedNode(), startPos.deprecatedEditingOffset()), VP_DEFAULT_AFFINITY); 2522 if (pos.isNull()) 2523 return false; 2524 2525 if (isStartOfParagraph(pos)) 2526 return true; 2527 2528 bool result = true; 2529 bool sawSpace = false; 2530 unsigned previousCount = 0; 2531 for (pos = pos.previous(); !pos.isNull(); pos = pos.previous()) { 2532 previousCount++; 2533 if (isStartOfParagraph(pos)) { 2534 if (previousCount == 1 || (previousCount == 2 && sawSpace)) 2535 result = false; 2536 break; 2537 } 2538 UChar c(pos.characterAfter()); 2539 if (c) { 2540 if (isSpaceOrNewline(c) || c == 0xA0) { 2541 sawSpace = true; 2542 } 2543 else { 2544 result = (c == '.' || c == '!' || c == '?'); 2545 break; 2546 } 2547 } 2548 } 2549 2550 return result; 2551 } 2552 2553 PassRefPtr<Range> FrameSelection::rangeByAlteringCurrentSelection(EAlteration alteration, int amount) const 2554 { 2555 if (m_selection.isNone()) 2556 return nullptr; 2557 2558 if (!amount) 2559 return toNormalizedRange(); 2560 2561 FrameSelection frameSelection; 2562 frameSelection.setSelection(m_selection); 2563 SelectionDirection direction = amount > 0 ? DirectionForward : DirectionBackward; 2564 for (int i = 0; i < abs(amount); i++) 2565 frameSelection.modify(alteration, direction, CharacterGranularity); 2566 return frameSelection.toNormalizedRange(); 2567 } 2568 2569 void FrameSelection::clearCurrentSelection() 2570 { 2571 setSelection(VisibleSelection()); 2572 } 2573 2574 void FrameSelection::setCaretBlinks(bool caretBlinks) 2575 { 2576 if (m_caretBlinks == caretBlinks) 2577 return; 2578 #if ENABLE(TEXT_CARET) 2579 m_frame->document()->updateLayoutIgnorePendingStylesheets(); 2580 if (m_caretPaint) { 2581 m_caretPaint = false; 2582 invalidateCaretRect(); 2583 } 2584 #endif 2585 if (caretBlinks) 2586 setFocusedElementIfNeeded(); 2587 m_caretBlinks = caretBlinks; 2588 updateAppearance(); 2589 } 2590 2591 void FrameSelection::setCaretColor(const Color& caretColor) 2592 { 2593 if (m_caretColor != caretColor) { 2594 m_caretColor = caretColor; 2595 if (caretIsVisible() && m_caretBlinks && isCaret()) 2596 invalidateCaretRect(); 2597 } 2598 } 2599 #endif // PLATFORM(IOS) 2600 2075 2601 } 2076 2602 -
trunk/Source/WebCore/editing/FrameSelection.h
r160966 r161638 36 36 #include <wtf/Noncopyable.h> 37 37 38 #if PLATFORM(IOS) 39 #include "Color.h" 40 #endif 41 38 42 namespace WebCore { 39 43 … … 229 233 #endif 230 234 235 #if PLATFORM(IOS) 236 public: 237 void expandSelectionToElementContainingCaretSelection(); 238 PassRefPtr<Range> elementRangeContainingCaretSelection() const; 239 void expandSelectionToWordContainingCaretSelection(); 240 PassRefPtr<Range> wordRangeContainingCaretSelection(); 241 void expandSelectionToStartOfWordContainingCaretSelection(); 242 UChar characterInRelationToCaretSelection(int amount) const; 243 UChar characterBeforeCaretSelection() const; 244 UChar characterAfterCaretSelection() const; 245 int wordOffsetInRange(const Range*) const; 246 bool spaceFollowsWordInRange(const Range*) const; 247 bool selectionAtDocumentStart() const; 248 bool selectionAtSentenceStart() const; 249 bool selectionAtWordStart() const; 250 PassRefPtr<Range> rangeByMovingCurrentSelection(int amount) const; 251 PassRefPtr<Range> rangeByExtendingCurrentSelection(int amount) const; 252 void selectRangeOnElement(unsigned location, unsigned length, Node*); 253 void suppressCloseTyping() { ++m_closeTypingSuppressions; } 254 void restoreCloseTyping() { --m_closeTypingSuppressions; } 255 void clearCurrentSelection(); 256 void setCaretBlinks(bool caretBlinks = true); 257 void setCaretColor(const Color&); 258 static VisibleSelection wordSelectionContainingCaretSelection(const VisibleSelection&); 259 void setUpdateAppearanceEnabled(bool enabled) { m_updateAppearanceEnabled = enabled; } 260 void suppressScrolling() { ++m_scrollingSuppressCount; } 261 void restoreScrolling() 262 { 263 ASSERT(m_scrollingSuppressCount); 264 --m_scrollingSuppressCount; 265 } 266 private: 267 bool actualSelectionAtSentenceStart(const VisibleSelection&) const; 268 PassRefPtr<Range> rangeByAlteringCurrentSelection(EAlteration, int amount) const; 269 public: 270 #endif 271 231 272 bool shouldChangeSelection(const VisibleSelection&) const; 232 273 bool shouldDeleteSelection(const VisibleSelection&) const; … … 310 351 bool m_focused : 1; 311 352 bool m_shouldShowBlockCursor : 1; 353 354 #if PLATFORM(IOS) 355 bool m_updateAppearanceEnabled : 1; 356 bool m_caretBlinks : 1; 357 Color m_caretColor; 358 int m_closeTypingSuppressions; 359 int m_scrollingSuppressCount; 360 #endif 312 361 }; 313 362 -
trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp
r160966 r161638 33 33 #include "Settings.h" 34 34 #include "Text.h" 35 #if PLATFORM(IOS) 36 #include "RenderText.h" 37 #endif 35 38 36 39 namespace WebCore { … … 69 72 } 70 73 74 #if PLATFORM(IOS) 75 void InsertIntoTextNodeCommand::doReapply() 76 { 77 ExceptionCode ec; 78 m_node->insertData(m_offset, m_text, ec); 79 } 80 #endif 81 71 82 void InsertIntoTextNodeCommand::doUnapply() 72 83 { -
trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.h
r102527 r161638 45 45 virtual void doApply() OVERRIDE; 46 46 virtual void doUnapply() OVERRIDE; 47 #if PLATFORM(IOS) 48 virtual void doReapply() OVERRIDE; 49 #endif 47 50 48 51 #ifndef NDEBUG -
trunk/Source/WebCore/editing/InsertTextCommand.h
r154938 r161638 69 69 virtual void doApply(); 70 70 71 #if PLATFORM(IOS) 72 virtual bool isInsertTextCommand() const OVERRIDE { return true; } 73 #endif 74 71 75 Position positionInsideTextNode(const Position&); 72 76 Position insertTab(const Position&); -
trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp
r161196 r161638 900 900 return; 901 901 902 #if PLATFORM(IOS) 903 // In plain text only regions, we create style-less fragments, so the inserted content will automatically 904 // match the style of the surrounding area and so we can avoid unnecessary work below for m_matchStyle. 905 if (!selection.isContentRichlyEditable()) 906 m_matchStyle = false; 907 #endif 908 902 909 ReplacementFragment fragment(document(), m_documentFragment.get(), selection); 903 910 if (performTrivialReplace(fragment)) -
trunk/Source/WebCore/editing/TextAffinity.h
r55633 r161638 28 28 29 29 #ifdef __OBJC__ 30 #if !PLATFORM(IOS) 30 31 #include <AppKit/NSTextView.h> 32 #else 33 #include "WAKAppKitStubs.h" 34 #endif // !PLATFORM(IOS) 31 35 #endif 32 36 -
trunk/Source/WebCore/editing/TextCheckingHelper.cpp
r161518 r161638 234 234 } 235 235 236 #if !PLATFORM(IOS) 236 237 String TextCheckingHelper::findFirstMisspelling(int& firstMisspellingOffset, bool markAll, RefPtr<Range>& firstMisspellingRange) 237 238 { … … 414 415 return firstFoundItem; 415 416 } 417 #endif // !PLATFORM(IOS) 416 418 417 419 #if USE(GRAMMAR_CHECKING) … … 613 615 614 616 617 #if !PLATFORM(IOS) 615 618 void TextCheckingHelper::markAllMisspellings(RefPtr<Range>& firstMisspellingRange) 616 619 { … … 631 634 } 632 635 #endif 636 #endif // !PLATFORM(IOS) 633 637 634 638 bool TextCheckingHelper::unifiedTextCheckerEnabled() const -
trunk/Source/WebCore/editing/TextGranularity.h
r102252 r161638 37 37 LineGranularity, 38 38 ParagraphGranularity, 39 #if PLATFORM(IOS) 40 DocumentGranularity, 41 #endif 39 42 SentenceBoundary, 40 43 LineBoundary, -
trunk/Source/WebCore/editing/TextIterator.cpp
r158743 r161638 251 251 return false; 252 252 253 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) 254 if (renderer->isImage() || renderer->isMedia()) 255 return true; 256 if (renderer->isWidget()) { 257 if (renderer->node() && renderer->node()->isElementNode()) { 258 Element* element = toElement(renderer->node()); 259 if (element->hasTagName(videoTag) || !element->hasTagName(audioTag)) 260 return false; // See <rdar://problem/6893793>. 261 } 262 return true; 263 } 264 #else 253 265 if (renderer->isImage() || renderer->isWidget() || renderer->isMedia()) 254 266 return true; 267 #endif 255 268 256 269 if (renderer->node() && renderer->node()->isElementNode()) { -
trunk/Source/WebCore/editing/TypingCommand.cpp
r158350 r161638 237 237 } 238 238 239 #if PLATFORM(IOS) 240 void TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping(Frame* frame, const VisibleSelection& newSelection) 241 { 242 if (RefPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) { 243 lastTypingCommand->setEndingSelection(newSelection); 244 lastTypingCommand->setEndingSelectionOnLastInsertCommand(newSelection); 245 } 246 } 247 #endif 248 239 249 void TypingCommand::doApply() 240 250 { … … 282 292 Frame& frame = this->frame(); 283 293 284 #if PLATFORM(MAC) 294 #if PLATFORM(MAC) && !PLATFORM(IOS) 285 295 if (!frame.editor().isContinuousSpellCheckingEnabled() 286 296 && !frame.editor().isAutomaticQuoteSubstitutionEnabled() … … 300 310 VisiblePosition previous = start.previous(); 301 311 if (previous.isNotNull()) { 312 #if !PLATFORM(IOS) 302 313 VisiblePosition p1 = startOfWord(previous, LeftWordIfOnBoundary); 303 314 VisiblePosition p2 = startOfWord(start, LeftWordIfOnBoundary); … … 310 321 } else if (commandType == TypingCommand::InsertText) 311 322 frame.editor().startAlternativeTextUITimer(); 323 #else 324 UNUSED_PARAM(commandType); 325 // If this bug gets fixed, this PLATFORM(IOS) code could be removed: 326 // <rdar://problem/7259611> Word boundary code on iPhone gives different results than desktop 327 EWordSide startWordSide = LeftWordIfOnBoundary; 328 UChar32 c = previous.characterAfter(); 329 // FIXME: VisiblePosition::characterAfter() and characterBefore() do not emit newlines the same 330 // way as TextIterator, so we do an isEndOfParagraph check here. 331 if (isSpaceOrNewline(c) || c == 0xA0 || isEndOfParagraph(previous)) { 332 startWordSide = RightWordIfOnBoundary; 333 } 334 VisiblePosition p1 = startOfWord(previous, startWordSide); 335 VisiblePosition p2 = startOfWord(start, startWordSide); 336 if (p1 != p2) 337 frame.editor().markMisspellingsAfterTypingToWord(p1, endingSelection(), false); 338 #endif // !PLATFORM(IOS) 312 339 } 313 340 } … … 488 515 489 516 ASSERT(!selectionToDelete.isNone()); 490 if (selectionToDelete.isNone()) 491 return; 517 if (selectionToDelete.isNone()) { 518 #if PLATFORM(IOS) 519 // Workaround for this bug: 520 // <rdar://problem/4653755> UIKit text widgets should use WebKit editing API to manipulate text 521 setEndingSelection(frame.selection().selection()); 522 closeTyping(&frame); 523 #endif 524 return; 525 } 492 526 493 527 if (selectionToDelete.isCaret() || !frame.selection().shouldDeleteSelection(selectionToDelete)) … … 579 613 580 614 ASSERT(!selectionToDelete.isNone()); 581 if (selectionToDelete.isNone()) 582 return; 615 if (selectionToDelete.isNone()) { 616 #if PLATFORM(IOS) 617 // Workaround for this bug: 618 // <rdar://problem/4653755> UIKit text widgets should use WebKit editing API to manipulate text 619 setEndingSelection(frame.selection().selection()); 620 closeTyping(&frame); 621 #endif 622 return; 623 } 583 624 584 625 if (selectionToDelete.isCaret() || !frame.selection().shouldDeleteSelection(selectionToDelete)) … … 600 641 } 601 642 643 #if PLATFORM(IOS) 644 class FriendlyEditCommand : public EditCommand { 645 public: 646 void setEndingSelection(const VisibleSelection& selection) 647 { 648 EditCommand::setEndingSelection(selection); 649 } 650 }; 651 652 void TypingCommand::setEndingSelectionOnLastInsertCommand(const VisibleSelection& selection) 653 { 654 if (!m_commands.isEmpty()) { 655 EditCommand* lastCommand = m_commands.last().get(); 656 if (lastCommand->isInsertTextCommand()) 657 static_cast<FriendlyEditCommand*>(lastCommand)->setEndingSelection(selection); 658 } 659 } 660 #endif 661 602 662 void TypingCommand::updatePreservesTypingStyle(ETypingCommand commandType) 603 663 { -
trunk/Source/WebCore/editing/TypingCommand.h
r156941 r161638 67 67 static void insertParagraphSeparatorInQuotedContent(Document&); 68 68 static void closeTyping(Frame*); 69 #if PLATFORM(IOS) 70 static void ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping(Frame*, const VisibleSelection&); 71 #endif 69 72 70 73 void insertText(const String &text, bool selectInsertedText); … … 77 80 void deleteSelection(bool smartDelete); 78 81 void setCompositionType(TextCompositionType type) { m_compositionType = type; } 82 83 #if PLATFORM(IOS) 84 void setEndingSelectionOnLastInsertCommand(const VisibleSelection& selection); 85 #endif 79 86 80 87 private: -
trunk/Source/WebCore/editing/VisiblePosition.h
r127300 r161638 128 128 return !(a == b); 129 129 } 130 131 #if PLATFORM(IOS) 132 inline bool operator<(const VisiblePosition& a, const VisiblePosition& b) 133 { 134 return a.deepEquivalent() < b.deepEquivalent(); 135 } 136 137 inline bool operator>(const VisiblePosition& a, const VisiblePosition& b) 138 { 139 return a.deepEquivalent() > b.deepEquivalent(); 140 } 141 142 inline bool operator<=(const VisiblePosition& a, const VisiblePosition& b) 143 { 144 return a.deepEquivalent() <= b.deepEquivalent(); 145 } 146 147 inline bool operator>=(const VisiblePosition& a, const VisiblePosition& b) 148 { 149 return a.deepEquivalent() >= b.deepEquivalent(); 150 } 151 #endif 130 152 131 153 PassRefPtr<Range> makeRange(const VisiblePosition&, const VisiblePosition&); -
trunk/Source/WebCore/editing/VisibleSelection.cpp
r160966 r161638 322 322 323 323 m_end = end.deepEquivalent(); 324 #if PLATFORM(IOS) 325 // End must not be before start. 326 if (m_start.deprecatedNode() == m_end.deprecatedNode() && m_start.deprecatedEditingOffset() > m_end.deprecatedEditingOffset()) { 327 Position swap(m_start); 328 m_start = m_end; 329 m_end = swap; 330 } 331 #endif 324 332 break; 325 333 } … … 385 393 m_end = endOfSentence(VisiblePosition(m_end, m_affinity)).deepEquivalent(); 386 394 break; 395 #if PLATFORM(IOS) 396 case DocumentGranularity: 397 ASSERT_NOT_REACHED(); 398 break; 399 #endif 387 400 } 388 401 … … 519 532 if (m_base.isNull() || m_start.isNull() || m_end.isNull()) 520 533 return; 534 535 #if PLATFORM(IOS) 536 // Early return in the caret case (the state hasn't actually been set yet, so we can't use isCaret()) to avoid the 537 // expense of computing highestEditableRoot. 538 if (m_base == m_start && m_base == m_end) 539 return; 540 #endif 521 541 522 542 Node* baseRoot = highestEditableRoot(m_base); -
trunk/Source/WebCore/editing/VisibleUnits.cpp
r160966 r161638 498 498 // Treat bullets used in the text security mode as regular characters when looking for boundaries 499 499 String iteratorString(it.characters(), it.length()); 500 #if PLATFORM(IOS) 501 iteratorString = iteratorString.impl()->fill('x'); 502 #else 500 503 iteratorString.fill('x'); 504 #endif 501 505 string.insert(0, iteratorString.characters(), iteratorString.length()); 502 506 } … … 572 576 // Treat bullets used in the text security mode as regular characters when looking for boundaries 573 577 String iteratorString(it.characters(), it.length()); 578 #if PLATFORM(IOS) 579 iteratorString = iteratorString.impl()->fill('x'); 580 #else 574 581 iteratorString.fill('x'); 582 #endif 575 583 string.append(iteratorString.characters(), iteratorString.length()); 576 584 } … … 1333 1341 return VisiblePosition(); 1334 1342 1343 #if PLATFORM(IOS) 1344 // The canonicalization of the position at (documentElement, 0) can turn the visible 1345 // position to null, even when there's a valid candidate to be had, because the root HTML element 1346 // is not content editable. So we construct directly from the valid candidate. 1347 // FIXME: Merge this to Open Source. https://bugs.webkit.org/show_bug.cgi?id=56437 1348 Position firstCandidate = nextCandidate(createLegacyEditingPosition(node->document().documentElement(), 0)); 1349 if (firstCandidate.isNull()) 1350 return VisiblePosition(); 1351 return VisiblePosition(firstCandidate); 1352 #else 1335 1353 return VisiblePosition(firstPositionInNode(node->document().documentElement()), DOWNSTREAM); 1354 #endif 1336 1355 } 1337 1356 … … 1346 1365 return VisiblePosition(); 1347 1366 1367 #if PLATFORM(IOS) 1368 // (As above, in startOfDocument.) The canonicalization can reject valid visible positions 1369 // when descending from the root element, so we construct the visible position directly from a 1370 // valid candidate. 1371 // FIXME: Merge this to Open Source. https://bugs.webkit.org/show_bug.cgi?id=56437 1372 #endif 1348 1373 Element* doc = node->document().documentElement(); 1374 #if PLATFORM(IOS) 1375 Position lastPosition = createLegacyEditingPosition(node->document().documentElement(), doc->childNodeCount()); 1376 Position lastCandidate = previousCandidate(lastPosition); 1377 if (lastCandidate.isNull()) 1378 return VisiblePosition(); 1379 return VisiblePosition(lastCandidate); 1380 #endif 1349 1381 return VisiblePosition(lastPositionInNode(doc), DOWNSTREAM); 1350 1382 } … … 1414 1446 } 1415 1447 1416 } 1448 #if PLATFORM(IOS) 1449 static bool directionIsDownstream(SelectionDirection direction) 1450 { 1451 if (direction == DirectionBackward) 1452 return false; 1453 else if (direction == DirectionForward) 1454 return true; 1455 1456 // FIXME: this code doesn't take into account the original direction of the element. 1457 // I'm not fixing this now because I'm afraid there is some code in UIKit relying on 1458 // this wrong behavior. 1459 return direction == DirectionRight; 1460 } 1461 1462 bool atBoundaryOfGranularity(const VisiblePosition& vp, TextGranularity granularity, SelectionDirection direction) 1463 { 1464 if (granularity == CharacterGranularity) 1465 return true; 1466 1467 VisiblePosition boundary; 1468 1469 bool useDownstream = directionIsDownstream(direction); 1470 1471 switch (granularity) { 1472 case WordGranularity: 1473 // visible_units claims erroneously that the start and the end 1474 // of a paragraph are the end and start of a word, respectively. 1475 if ((useDownstream && isStartOfParagraph(vp)) || (!useDownstream && isEndOfParagraph(vp))) 1476 return false; 1477 1478 // Note that "Left" and "Right" in this context apparently mean "upstream/previous" and "downstream/next". 1479 boundary = useDownstream ? endOfWord(vp, LeftWordIfOnBoundary) : startOfWord(vp, RightWordIfOnBoundary); 1480 break; 1481 1482 case SentenceGranularity: 1483 boundary = useDownstream ? endOfSentence(vp) : startOfSentence(vp); 1484 break; 1485 1486 case LineGranularity: 1487 // Affinity has to be set to get right boundary of the line. 1488 boundary = vp; 1489 boundary.setAffinity(useDownstream ? VP_UPSTREAM_IF_POSSIBLE : DOWNSTREAM); 1490 boundary = useDownstream ? endOfLine(boundary) : startOfLine(boundary); 1491 break; 1492 1493 case ParagraphGranularity: 1494 boundary = useDownstream ? endOfParagraph(vp) : startOfParagraph(vp); 1495 break; 1496 1497 case DocumentGranularity: 1498 boundary = useDownstream ? endOfDocument(vp) : startOfDocument(vp); 1499 break; 1500 1501 default: 1502 ASSERT_NOT_REACHED(); 1503 break; 1504 } 1505 1506 return vp == boundary; 1507 } 1508 1509 bool withinTextUnitOfGranularity(const VisiblePosition& vp, TextGranularity granularity, SelectionDirection direction) 1510 { 1511 if (granularity == CharacterGranularity || granularity == DocumentGranularity) 1512 return true; 1513 1514 bool useDownstream = directionIsDownstream(direction); 1515 1516 VisiblePosition prevBoundary; 1517 VisiblePosition nextBoundary; 1518 1519 switch (granularity) { 1520 case WordGranularity: 1521 // Note that "Left" and "Right" in this context apparently mean "upstream/previous" and "downstream/next". 1522 prevBoundary = startOfWord(vp, (useDownstream ? RightWordIfOnBoundary : LeftWordIfOnBoundary)); 1523 nextBoundary = endOfWord(vp, (useDownstream ? RightWordIfOnBoundary : LeftWordIfOnBoundary)); 1524 1525 // Workaround for <rdar://problem/7259611> Word boundary code on iPhone gives different results than desktop 1526 if (endOfWord(prevBoundary, RightWordIfOnBoundary) != nextBoundary) 1527 return false; 1528 1529 break; 1530 1531 case SentenceGranularity: 1532 prevBoundary = startOfSentence(vp); 1533 nextBoundary = endOfSentence(vp); 1534 break; 1535 1536 case LineGranularity: 1537 prevBoundary = startOfLine(vp); 1538 nextBoundary = endOfLine(vp); 1539 1540 if (prevBoundary == nextBoundary) { 1541 nextBoundary = nextLinePosition(nextBoundary, 0); 1542 nextBoundary.setAffinity(UPSTREAM); 1543 if (!inSameLine(prevBoundary, nextBoundary)) 1544 nextBoundary = vp.next(); 1545 } 1546 break; 1547 1548 case ParagraphGranularity: 1549 prevBoundary = startOfParagraph(vp); 1550 nextBoundary = endOfParagraph(vp); 1551 break; 1552 1553 default: 1554 ASSERT_NOT_REACHED(); 1555 break; 1556 } 1557 1558 if (prevBoundary == nextBoundary) 1559 return false; 1560 1561 if (vp == prevBoundary) 1562 return useDownstream; 1563 1564 if (vp == nextBoundary) 1565 return !useDownstream; 1566 1567 return (prevBoundary < vp && vp < nextBoundary); 1568 } 1569 1570 static VisiblePosition nextCharacterBoundaryInDirection(const VisiblePosition& vp, SelectionDirection direction) 1571 { 1572 return directionIsDownstream(direction) ? vp.next() : vp.previous(); 1573 } 1574 1575 static VisiblePosition nextWordBoundaryInDirection(const VisiblePosition& vp, SelectionDirection direction) 1576 { 1577 bool useDownstream = directionIsDownstream(direction); 1578 bool withinUnitOfGranularity = withinTextUnitOfGranularity(vp, WordGranularity, direction); 1579 VisiblePosition result; 1580 1581 if (useDownstream) { 1582 if (withinUnitOfGranularity) 1583 result = endOfWord(vp, RightWordIfOnBoundary); 1584 else { 1585 VisiblePosition start = startOfWord(vp, RightWordIfOnBoundary); 1586 if (start > vp && start != endOfWord(start)) 1587 result = start; 1588 else { 1589 // Do same thing as backwards traveling below. 1590 start = vp; 1591 while (true) { 1592 result = startOfWord(nextWordPosition(start), RightWordIfOnBoundary); 1593 1594 if (result == start) 1595 break; 1596 1597 // We failed to find a word boundary. 1598 if (result.isNull() || result < start) 1599 return VisiblePosition(); 1600 1601 // We consider successs also the case where start is before element and result is after. 1602 // This covers moving past images like words. 1603 if (result != endOfWord(result) 1604 || (result.deepEquivalent().anchorNode() == start.deepEquivalent().anchorNode() 1605 && result.deepEquivalent().anchorType() == Position::PositionIsAfterAnchor 1606 && start.deepEquivalent().anchorType() == Position::PositionIsBeforeAnchor)) 1607 break; 1608 1609 start = result; 1610 } 1611 } 1612 } 1613 } else { 1614 if (withinUnitOfGranularity) 1615 result = startOfWord(vp, LeftWordIfOnBoundary); 1616 else { 1617 // This is complicated because: 1618 // When given "Blah blah.|", endOfWord is "Blah blah|.", and previousWordPosition is "Blah| blah." 1619 // When given "Blah blah. |", endOfWord is "Blah blah.| ", and previousWordPosition is "Blah |blah. ". 1620 VisiblePosition end = endOfWord(vp, LeftWordIfOnBoundary); 1621 if (end < vp && end != startOfWord(end)) 1622 result = end; 1623 else { 1624 end = vp; 1625 while (true) { 1626 result = endOfWord(previousWordPosition(end), RightWordIfOnBoundary); 1627 1628 if (result == end) 1629 break; 1630 1631 if (result.isNull() || result > end) 1632 return VisiblePosition(); 1633 1634 if (result != startOfWord(result)) 1635 break; 1636 1637 end = result; 1638 } 1639 } 1640 } 1641 } 1642 1643 if (result == vp) 1644 return VisiblePosition(); 1645 1646 return result; 1647 } 1648 1649 static VisiblePosition nextSentenceBoundaryInDirection(const VisiblePosition& vp, SelectionDirection direction) 1650 { 1651 bool useDownstream = directionIsDownstream(direction); 1652 bool withinUnitOfGranularity = withinTextUnitOfGranularity(vp, SentenceGranularity, direction); 1653 VisiblePosition result; 1654 1655 if (withinUnitOfGranularity) 1656 result = useDownstream ? endOfSentence(vp) : startOfSentence(vp); 1657 else { 1658 result = useDownstream ? nextSentencePosition(vp) : previousSentencePosition(vp); 1659 if (result.isNull() || result == vp) 1660 return VisiblePosition(); 1661 1662 result = useDownstream ? startOfSentence(vp) : endOfSentence(vp); 1663 } 1664 1665 if (result == vp) 1666 return VisiblePosition(); 1667 1668 ASSERT(useDownstream ? (result > vp) : (result < vp)); 1669 1670 return result; 1671 } 1672 1673 static VisiblePosition nextLineBoundaryInDirection(const VisiblePosition& vp, SelectionDirection direction) 1674 { 1675 bool useDownstream = directionIsDownstream(direction); 1676 VisiblePosition result = vp; 1677 1678 if (useDownstream) { 1679 result.setAffinity(DOWNSTREAM); 1680 result = isEndOfLine(result) ? startOfLine(nextLinePosition(result, result.lineDirectionPointForBlockDirectionNavigation())) : endOfLine(result); 1681 } else { 1682 result.setAffinity(VP_UPSTREAM_IF_POSSIBLE); 1683 result = isStartOfLine(result) ? endOfLine(previousLinePosition(result, result.lineDirectionPointForBlockDirectionNavigation())) : startOfLine(result); 1684 } 1685 1686 return result; 1687 } 1688 1689 static VisiblePosition nextParagraphBoundaryInDirection(const VisiblePosition& vp, SelectionDirection direction) 1690 { 1691 bool useDownstream = directionIsDownstream(direction); 1692 bool withinUnitOfGranularity = withinTextUnitOfGranularity(vp, ParagraphGranularity, direction); 1693 VisiblePosition result; 1694 1695 if (!withinUnitOfGranularity) 1696 result = useDownstream ? startOfParagraph(nextParagraphPosition(vp, vp.lineDirectionPointForBlockDirectionNavigation())) : endOfParagraph(previousParagraphPosition(vp, vp.lineDirectionPointForBlockDirectionNavigation())); 1697 else 1698 result = useDownstream ? endOfParagraph(vp) : startOfParagraph(vp); 1699 1700 return result; 1701 } 1702 1703 static VisiblePosition nextDocumentBoundaryInDirection(const VisiblePosition& vp, SelectionDirection direction) 1704 { 1705 return directionIsDownstream(direction) ? endOfDocument(vp) : startOfDocument(vp); 1706 } 1707 1708 VisiblePosition positionOfNextBoundaryOfGranularity(const VisiblePosition& vp, TextGranularity granularity, SelectionDirection direction) 1709 { 1710 switch (granularity) { 1711 case CharacterGranularity: 1712 return nextCharacterBoundaryInDirection(vp, direction); 1713 case WordGranularity: 1714 return nextWordBoundaryInDirection(vp, direction); 1715 case SentenceGranularity: 1716 return nextSentenceBoundaryInDirection(vp, direction); 1717 case LineGranularity: 1718 return nextLineBoundaryInDirection(vp, direction); 1719 case ParagraphGranularity: 1720 return nextParagraphBoundaryInDirection(vp, direction); 1721 case DocumentGranularity: 1722 return nextDocumentBoundaryInDirection(vp, direction); 1723 default: 1724 ASSERT_NOT_REACHED(); 1725 return VisiblePosition(); 1726 } 1727 } 1728 1729 PassRefPtr<Range> enclosingTextUnitOfGranularity(const VisiblePosition& vp, TextGranularity granularity, SelectionDirection direction) 1730 { 1731 // This is particularly inefficient. We could easily obtain the answer with the boundaries computed below. 1732 if (!withinTextUnitOfGranularity(vp, granularity, direction)) 1733 return 0; 1734 1735 VisiblePosition prevBoundary; 1736 VisiblePosition nextBoundary; 1737 bool useDownstream = directionIsDownstream(direction); 1738 1739 switch (granularity) { 1740 case CharacterGranularity: 1741 prevBoundary = vp; 1742 nextBoundary = prevBoundary.next(); 1743 break; 1744 1745 case WordGranularity: 1746 // NB: "Left" and "Right" in this context apparently mean "upstream/previous" and "downstream/next". 1747 if (useDownstream) { 1748 prevBoundary = startOfWord(vp, RightWordIfOnBoundary); 1749 nextBoundary = endOfWord(vp, RightWordIfOnBoundary); 1750 } else { 1751 prevBoundary = startOfWord(vp, LeftWordIfOnBoundary); 1752 nextBoundary = endOfWord(vp, LeftWordIfOnBoundary); 1753 } 1754 break; 1755 1756 case SentenceGranularity: 1757 prevBoundary = startOfSentence(vp); 1758 nextBoundary = endOfSentence(vp); 1759 break; 1760 1761 case LineGranularity: 1762 prevBoundary = startOfLine(vp); 1763 nextBoundary = endOfLine(vp); 1764 1765 if (prevBoundary == nextBoundary) { 1766 nextBoundary = nextLinePosition(nextBoundary, 0); 1767 nextBoundary.setAffinity(UPSTREAM); 1768 if (!inSameLine(prevBoundary, nextBoundary)) 1769 nextBoundary = vp.next(); 1770 } 1771 break; 1772 1773 case ParagraphGranularity: 1774 prevBoundary = startOfParagraph(vp); 1775 nextBoundary = endOfParagraph(vp); 1776 break; 1777 1778 case DocumentGranularity: 1779 prevBoundary = startOfDocument(vp); 1780 nextBoundary = endOfDocument(vp); 1781 break; 1782 1783 default: 1784 ASSERT_NOT_REACHED(); 1785 return 0; 1786 } 1787 1788 if (prevBoundary.isNull() || nextBoundary.isNull()) 1789 return 0; 1790 1791 if (vp < prevBoundary || vp > nextBoundary) 1792 return 0; 1793 1794 RefPtr<Range> range = Range::create(prevBoundary.deepEquivalent().deprecatedNode()->document(), prevBoundary, nextBoundary); 1795 1796 return range; 1797 } 1798 1799 int distanceBetweenPositions(const VisiblePosition& vp, const VisiblePosition& other) 1800 { 1801 if (vp.isNull() || other.isNull()) 1802 return 0; 1803 1804 bool thisIsStart = (vp < other); 1805 1806 // Start must come first in the Range constructor. 1807 RefPtr<Range> range = Range::create(vp.deepEquivalent().deprecatedNode()->document(), 1808 (thisIsStart ? vp : other), 1809 (thisIsStart ? other : vp)); 1810 int distance = TextIterator::rangeLength(range.get()); 1811 1812 return (thisIsStart ? -distance : distance); 1813 } 1814 1815 PassRefPtr<Range> wordRangeFromPosition(const VisiblePosition& position) 1816 { 1817 ASSERT(position.isNotNull()); 1818 1819 RefPtr<Range> range = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionBackward); 1820 1821 if (!range) { 1822 // We could be at the start of a word, try forward. 1823 range = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionForward); 1824 } 1825 if (range) 1826 return range; 1827 1828 VisiblePosition currentPosition = position; 1829 do { 1830 currentPosition = positionOfNextBoundaryOfGranularity(currentPosition, WordGranularity, DirectionBackward); 1831 } while (currentPosition.isNotNull() && !atBoundaryOfGranularity(currentPosition, WordGranularity, DirectionBackward)); 1832 1833 // If the position is an empty paragraph and at the end of the document 1834 // the word iterator could not pass the paragraph boundary, therefore iterating to 1835 // the previous line is required. 1836 if (currentPosition.isNull() && isEndOfDocument(position)) { 1837 VisiblePosition previousLinePosition = positionOfNextBoundaryOfGranularity(position, LineGranularity, DirectionBackward); 1838 if (previousLinePosition.isNotNull()) { 1839 currentPosition = positionOfNextBoundaryOfGranularity(previousLinePosition, WordGranularity, DirectionBackward); 1840 if (currentPosition.isNull()) 1841 currentPosition = previousLinePosition; 1842 } 1843 } 1844 1845 if (currentPosition.isNull()) 1846 currentPosition = positionOfNextBoundaryOfGranularity(position, WordGranularity, DirectionForward); 1847 1848 if (currentPosition.isNotNull()) { 1849 range = Range::create(position.deepEquivalent().deprecatedNode()->document(), currentPosition, position); 1850 ASSERT(range); 1851 } 1852 return range; 1853 } 1854 1855 VisiblePosition closestWordBoundaryForPosition(const VisiblePosition& position) 1856 { 1857 VisiblePosition result; 1858 1859 // move the the position at the end of the word 1860 if (atBoundaryOfGranularity(position, LineGranularity, DirectionForward)) { 1861 // Don't cross line boundaries. 1862 result = position; 1863 } else if (withinTextUnitOfGranularity(position, WordGranularity, DirectionForward)) { 1864 // The position lies within a word. 1865 RefPtr<Range> wordRange = enclosingTextUnitOfGranularity(position, WordGranularity, DirectionForward); 1866 1867 result = wordRange->startPosition(); 1868 if (distanceBetweenPositions(position, result) > 1) 1869 result = wordRange->endPosition(); 1870 } else if (atBoundaryOfGranularity(position, WordGranularity, DirectionBackward)) { 1871 // The position is at the end of a word. 1872 result = position; 1873 } else { 1874 // The position is not within a word. 1875 // Go to the next boundary. 1876 result = positionOfNextBoundaryOfGranularity(position, WordGranularity, DirectionForward); 1877 1878 // If there is no such boundary we go to the end of the element. 1879 if (result.isNull()) 1880 result = endOfEditableContent(position); 1881 } 1882 return result; 1883 } 1884 1885 #endif 1886 1887 } -
trunk/Source/WebCore/editing/VisibleUnits.h
r151947 r161638 29 29 #include "EditingBoundary.h" 30 30 #include "TextDirection.h" 31 #include "VisibleSelection.h" 31 32 32 33 namespace WebCore { … … 96 97 bool isEndOfEditableOrNonEditableContent(const VisiblePosition&); 97 98 99 #if PLATFORM(IOS) 100 bool atBoundaryOfGranularity(const VisiblePosition&, TextGranularity, SelectionDirection); 101 bool withinTextUnitOfGranularity(const VisiblePosition&, TextGranularity, SelectionDirection); 102 VisiblePosition positionOfNextBoundaryOfGranularity(const VisiblePosition&, TextGranularity, SelectionDirection); 103 PassRefPtr<Range> enclosingTextUnitOfGranularity(const VisiblePosition&, TextGranularity, SelectionDirection); 104 int distanceBetweenPositions(const VisiblePosition&, const VisiblePosition&); 105 PassRefPtr<Range> wordRangeFromPosition(const VisiblePosition& position); 106 VisiblePosition closestWordBoundaryForPosition(const VisiblePosition& position); 107 #endif 98 108 } // namespace WebCore 99 109 -
trunk/Source/WebCore/editing/mac/FrameSelectionMac.mm
r156339 r161638 33 33 namespace WebCore { 34 34 35 #if !PLATFORM(IOS) 35 36 static CGRect accessibilityConvertScreenRect(CGRect bounds) 36 37 { … … 44 45 return bounds; 45 46 } 47 #endif // !PLATFORM(IOS) 46 48 47 49 … … 55 57 } 56 58 59 #if !PLATFORM(IOS) 57 60 // if zoom feature is enabled, insertion point changes should update the zoom 58 61 if (!UAZoomEnabled() || !m_selection.isCaret()) … … 77 80 78 81 UAZoomChangeFocus(&cgViewRect, &cgCaretRect, kUAZoomFocusTypeInsertionPoint); 82 #endif // !PLATFORM(IOS) 79 83 } 80 84 -
trunk/Source/WebCore/fileapi/AsyncFileStream.cpp
r156550 r161638 45 45 #include <wtf/text/WTFString.h> 46 46 47 #if PLATFORM(IOS) 48 #include "WebCoreThread.h" 49 #endif 50 47 51 namespace WebCore { 48 52 -
trunk/Source/WebCore/inspector/InspectorCounters.h
r155251 r161638 36 36 #if !ASSERT_DISABLED 37 37 #include <wtf/MainThread.h> 38 #if PLATFORM(IOS) 39 #include "WebCoreThread.h" 40 #endif 38 41 #endif 39 42 -
trunk/Source/WebCore/inspector/InspectorFrontendHost.h
r161385 r161638 78 78 void close(const String& url); 79 79 80 #if ENABLE(CONTEXT_MENUS) 80 81 // Called from [Custom] implementations. 81 82 void showContextMenu(Event*, const Vector<ContextMenuItem>& items); 83 #endif 82 84 void sendMessageToBackend(const String& message); 83 85 void dispatchEventAsContextMenuEvent(Event*); -
trunk/Source/WebCore/make-export-file-generator
r157496 r161638 30 30 31 31 def line_for_output line 32 return line.chomp if line =~ / #/32 return line.chomp if line =~ /^#\s*(if|ifdef|ifndef|else|elif|endif)/ 33 33 " validateAndPrint(\"#{line.chomp}\");" 34 34 end -
trunk/Source/WebCore/plugins/PluginPackage.h
r132302 r161638 31 31 #include "PluginQuirkSet.h" 32 32 #include "Timer.h" 33 #if ENABLE(NETSCAPE_PLUGIN_API) 33 34 #include "npruntime_internal.h" 35 #endif 34 36 #include <wtf/HashMap.h> 35 37 #include <wtf/RefCounted.h> … … 71 73 void setEnabled(bool); 72 74 75 #if ENABLE(NETSCAPE_PLUGIN_API) 73 76 const NPPluginFuncs* pluginFuncs() const { return &m_pluginFuncs; } 77 #endif 74 78 int compareFileVersion(const PlatformModuleVersion&) const; 75 79 int compare(const PluginPackage&) const; … … 110 114 time_t m_lastModified; 111 115 116 #if ENABLE(NETSCAPE_PLUGIN_API) 112 117 NPP_ShutdownProcPtr m_NPP_Shutdown; 113 118 NPPluginFuncs m_pluginFuncs; 114 119 NPNetscapeFuncs m_browserFuncs; 120 #endif 115 121 116 122 void freeLibrarySoon(); -
trunk/Source/WebCore/plugins/PluginViewBase.h
r159023 r161638 47 47 #if USE(ACCELERATED_COMPOSITING) 48 48 virtual PlatformLayer* platformLayer() const { return 0; } 49 #if PLATFORM(IOS) 50 virtual bool willProvidePluginLayer() const { return false; } 51 virtual void attachPluginLayer() { } 52 virtual void detachPluginLayer() { } 53 #endif 49 54 #endif 50 55 -
trunk/Source/WebCore/style/StyleResolveForDocument.cpp
r158163 r161638 76 76 // This overrides any -webkit-user-modify inherited from the parent iframe. 77 77 documentStyle.get().setUserModify(document.inDesignMode() ? READ_WRITE : READ_ONLY); 78 #if PLATFORM(IOS) 79 if (document.inDesignMode()) 80 documentStyle.get().setTextSizeAdjust(TextSizeAdjustment(NoTextSizeAdjustment)); 81 #endif 78 82 79 83 Element* docElement = document.documentElement(); -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r161208 r161638 770 770 return VISIBLE; 771 771 772 RenderStyle* style = renderer->style(); 773 if (!style) 774 return VISIBLE; 775 776 Length width(style->width()); 777 Length height(style->height()); 772 RenderStyle& style = renderer->style(); 773 774 Length width(style.width()); 775 Length height(style.height()); 778 776 if ((width.isFixed() && width.value() <= 0) || (height.isFixed() && height.value() <= 0)) 779 777 return HIDDEN; 780 778 781 Length top(style ->top());782 Length left(style ->left());779 Length top(style.top()); 780 Length left(style.left()); 783 781 if (left.isFixed() && width.isFixed() && -left.value() >= width.value()) 784 782 return HIDDEN; -
trunk/Source/WebCore/testing/Internals.cpp
r161481 r161638 1969 1969 } 1970 1970 1971 #if USE(LAZY_NATIVE_CURSOR)1971 #if !PLATFORM(IOS) && USE(LAZY_NATIVE_CURSOR) 1972 1972 static const char* cursorTypeToString(Cursor::Type cursorType) 1973 1973 { … … 2032 2032 } 2033 2033 2034 #if !PLATFORM(IOS) && USE(LAZY_NATIVE_CURSOR) 2034 2035 Cursor cursor = document->frame()->eventHandler().currentMouseCursor(); 2035 2036 2036 #if USE(LAZY_NATIVE_CURSOR)2037 2037 StringBuilder result; 2038 2038 result.append("type="); … … 2133 2133 return false; 2134 2134 2135 #if !PLATFORM(IOS) 2135 2136 RenderMenuList* menuList = toRenderMenuList(renderer); 2136 2137 return menuList->popupIsVisible(); 2138 #else 2139 return false; 2140 #endif // !PLATFORM(IOS) 2137 2141 } 2138 2142 -
trunk/Source/WebCore/workers/WorkerThread.cpp
r160457 r161638 44 44 #endif 45 45 46 #if PLATFORM(IOS) 47 #include "WebCoreThread.h" 48 #endif 49 46 50 namespace WebCore { 47 51 … … 142 146 void WorkerThread::workerThread() 143 147 { 148 // Propagate the mainThread's fenv to workers. 149 #if PLATFORM(IOS) 150 fesetenv(&mainThreadFEnv); 151 #endif 152 144 153 { 145 154 MutexLocker lock(m_threadCreationMutex); -
trunk/Source/WebKit/ChangeLog
r161591 r161638 1 2014-01-10 Daniel Bates <dabates@apple.com> 2 3 [iOS] Upstream WebCore and Tools miscellaneous changes 4 https://bugs.webkit.org/show_bug.cgi?id=126698 5 6 Reviewed by David Kilzer. 7 8 * WebKit.xcodeproj/project.pbxproj: 9 1 10 2014-01-09 Benjamin Poulain <bpoulain@apple.com> 2 11 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r161332 r161638 2138 2138 runOnlyForDeploymentPostprocessing = 0; 2139 2139 shellPath = /bin/sh; 2140 shellScript = " exec ${SRCROOT}/mac/postprocess-headers.sh";2140 shellScript = "postProcessInDirectory() {\n cd \"$1\"\n\n if [[ ${PLATFORM_NAME} == iphoneos ]]; then\n local unifdefOptions=\"-DTARGET_OS_EMBEDDED=1 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=0 -DENABLE_IOS_TOUCH_EVENTS=1 -DENABLE_IOS_GESTURE_EVENTS=1\";\n elif [[ ${PLATFORM_NAME} == iphonesimulator ]]; then\n local unifdefOptions=\"-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=1 -DENABLE_IOS_TOUCH_EVENTS=1 -DENABLE_IOS_GESTURE_EVENTS=1\";\n else\n local unifdefOptions=\"-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=0 -DTARGET_IPHONE_SIMULATOR=0 -DENABLE_IOS_TOUCH_EVENTS=0 -DENABLE_IOS_GESTURE_EVENTS=0\";\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 \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\npostProcessInDirectory \"${TARGET_BUILD_DIR}/${PRIVATE_HEADERS_FOLDER_PATH}\""; 2141 2141 }; 2142 2142 A55DEAA516703F9F003DB841 /* Check For Inappropriate Macros in External Headers */ = { -
trunk/Source/WebKit/mac/ChangeLog
r161518 r161638 1 2014-01-10 Daniel Bates <dabates@apple.com> 2 3 [iOS] Upstream WebCore and Tools miscellaneous changes 4 https://bugs.webkit.org/show_bug.cgi?id=126698 5 6 Reviewed by David Kilzer. 7 8 * MigrateHeaders.make: 9 1 10 2014-01-08 Anders Carlsson <andersca@apple.com> 2 11 -
trunk/Source/WebKit/mac/MigrateHeaders.make
r161415 r161638 191 191 # 192 192 193 ifeq ($(findstring WTF_PLATFORM_IOS,$(FEATURE_DEFINES)), WTF_PLATFORM_IOS) 194 195 all : \ 196 $(PUBLIC_HEADERS_DIR)/DOMGestureEvent.h \ 197 $(PRIVATE_HEADERS_DIR)/DOMHTMLTextAreaElementPrivate.h \ 198 $(PUBLIC_HEADERS_DIR)/DOMTouch.h \ 199 $(PUBLIC_HEADERS_DIR)/DOMTouchEvent.h \ 200 $(PUBLIC_HEADERS_DIR)/DOMTouchList.h \ 201 $(PRIVATE_HEADERS_DIR)/DOMUIKitExtensions.h \ 202 $(PRIVATE_HEADERS_DIR)/KeyEventCodesIOS.h \ 203 $(PRIVATE_HEADERS_DIR)/MediaPlayerProxy.h \ 204 $(PRIVATE_HEADERS_DIR)/PluginData.h \ 205 $(PRIVATE_HEADERS_DIR)/ScrollTypes.h \ 206 $(PRIVATE_HEADERS_DIR)/SystemMemory.h \ 207 $(PRIVATE_HEADERS_DIR)/WAKAppKitStubs.h \ 208 $(PRIVATE_HEADERS_DIR)/WAKResponder.h \ 209 $(PRIVATE_HEADERS_DIR)/WAKScrollView.h \ 210 $(PRIVATE_HEADERS_DIR)/WAKView.h \ 211 $(PRIVATE_HEADERS_DIR)/WAKViewPrivate.h \ 212 $(PRIVATE_HEADERS_DIR)/WAKWindow.h \ 213 $(PRIVATE_HEADERS_DIR)/WKContentObservation.h \ 214 $(PRIVATE_HEADERS_DIR)/WKGraphics.h \ 215 $(PRIVATE_HEADERS_DIR)/WKTypes.h \ 216 $(PRIVATE_HEADERS_DIR)/WKUtilities.h \ 217 $(PRIVATE_HEADERS_DIR)/WKView.h \ 218 $(PRIVATE_HEADERS_DIR)/WebAutocapitalize.h \ 219 $(PRIVATE_HEADERS_DIR)/WebCoreFrameView.h \ 220 $(PRIVATE_HEADERS_DIR)/WebCoreThread.h \ 221 $(PRIVATE_HEADERS_DIR)/WebCoreThreadMessage.h \ 222 $(PRIVATE_HEADERS_DIR)/WebCoreThreadRun.h \ 223 $(PRIVATE_HEADERS_DIR)/WebEvent.h \ 224 $(PRIVATE_HEADERS_DIR)/WebEventRegion.h \ 225 226 endif 227 193 228 REPLACE_RULES = -e s/\<WebCore/\<WebKit/ -e s/DOMDOMImplementation/DOMImplementation/ 194 229 HEADER_MIGRATE_CMD = sed $(REPLACE_RULES) $< > $@ 195 230 PUBLIC_HEADER_CHECK_CMD = @if grep -q "AVAILABLE.*TBD" "$<"; then line=$$(awk "/AVAILABLE.*TBD/ { print FNR; exit }" "$<" ); echo "$<:$$line: error: A class within a public header has unspecified availability."; false; fi 196 231 232 ifeq ($(findstring WTF_PLATFORM_IOS,$(FEATURE_DEFINES)), WTF_PLATFORM_IOS) 233 234 $(PRIVATE_HEADERS_DIR)/WAKScrollView.h : WAKScrollView.h MigrateHeaders.make 235 cat $< $(PROCESS_HEADER_FOR_MACOSX_TARGET_CMD) > $@ 236 237 endif 238 197 239 $(PUBLIC_HEADERS_DIR)/DOM% : DOMDOM% MigrateHeaders.make 198 240 $(PUBLIC_HEADER_CHECK_CMD) -
trunk/Tools/ChangeLog
r161619 r161638 1 2014-01-10 Daniel Bates <dabates@apple.com> 2 3 [iOS] Upstream WebCore and Tools miscellaneous changes 4 https://bugs.webkit.org/show_bug.cgi?id=126698 5 6 Reviewed by David Kilzer. 7 8 * Scripts/check-for-inappropriate-objc-class-names: 9 * Scripts/check-for-webkit-framework-include-consistency: 10 1 11 2014-01-09 Dan Bernstein <mitz@apple.com> 2 12 -
trunk/Tools/Scripts/check-for-inappropriate-objc-class-names
r111771 r161638 79 79 close NM; 80 80 81 # begin PLATFORM(IOS) 82 # On iOS put exceptions in place for existing bad names. Future bad names will 83 # be caught and should be fixed immediately. Fixing these is covered by: 84 # <rdar://problem/10365008> Fix Inappropriate Objective-C Class Names found by build phase 85 my %exceptions = ( 86 # WebCore 87 "WKQuadObject" => 1, 88 "TileCacheTombstone" => 1, 89 "TileHostLayer" => 1, 90 "TileLayer" => 1, 91 "WAKResponder" => 1, 92 "NSCursor" => 1, 93 "WAKClipView" => 1, 94 "WAKScrollView" => 1, 95 "WAKView" => 1, 96 "WAKWindow" => 1, 97 # WebKit2 98 "UIWKRemoteView" => 1, 99 "UIWKView" => 1, 100 "UIWKViewData" => 1 101 ); 102 my @realBadNames; 103 for my $className (@badNames) { 104 push(@realBadNames, $className) unless exists($exceptions{$className}); 105 } 106 @badNames = @realBadNames; 107 # end PLATFORM(IOS) 108 81 109 if (@badNames) { 82 110 -
trunk/Tools/Scripts/check-for-webkit-framework-include-consistency
r161566 r161638 75 75 end 76 76 77 # iOS we want to keep the WAK headers private, even if a public header includes them, 78 # so we are going to not show warnings for WAK headers. 79 return if framework == "WebKit" and included_header_name =~ /^WAK/ 80 77 81 header_type = $HEADER_NAMES_TO_TYPE[included_header_name] 78 82
Note:
See TracChangeset
for help on using the changeset viewer.