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

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

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

Rubber-stamped by David Kilzer.

Source/WebCore:

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* platform/ContentFilter.h:
* platform/DragData.h:
* platform/FileChooser.cpp:
(WebCore::FileChooser::chooseMediaFiles):
* platform/FileChooser.h:
* platform/FileSystem.cpp:
(WebCore::setMetadataURL):
* platform/FileSystem.h:
* platform/KillRingNone.cpp:
* platform/LocalizedStrings.cpp:
(WebCore::fileButtonChooseMediaFileLabel):
(WebCore::fileButtonChooseMultipleMediaFilesLabel):
(WebCore::fileButtonNoMediaFileSelectedLabel):
(WebCore::fileButtonNoMediaFilesSelectedLabel):
* platform/LocalizedStrings.h:
* platform/Logging.h:
* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes):
(WebCore::initializeSupportedNonImageMimeTypes):
(WebCore::initializeUnsupportedTextMIMETypes):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::MemoryPressureHandler):
* platform/MemoryPressureHandler.h:
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::event):
* platform/PlatformMouseEvent.h:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/PlatformScreen.h:
* platform/RuntimeApplicationChecks.cpp:
(WebCore::mainBundleIsEqualTo):
* platform/RuntimeApplicationChecksIOS.h: Copied from Source/WebCore/platform/graphics/StringTruncator.h.
* platform/RuntimeApplicationChecksIOS.mm: Added.
* platform/ScrollAnimator.cpp:
(WebCore::ScrollAnimator::handleTouchEvent):
* platform/ScrollAnimator.h:
* platform/ScrollTypes.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::unscaledVisibleContentSize):
(WebCore::ScrollView::visibleContentRect):
* platform/ScrollView.h:
(WebCore::ScrollView::actualScrollX):
(WebCore::ScrollView::actualScrollY):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::handleTouchEvent):
(WebCore::ScrollableArea::isPinnedInBothDirections):
(WebCore::ScrollableArea::isPinnedHorizontallyInDirection):
(WebCore::ScrollableArea::isPinnedVerticallyInDirection):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::isTouchScrollable):
(WebCore::ScrollableArea::isOverflowScroll):
(WebCore::ScrollableArea::didStartScroll):
(WebCore::ScrollableArea::didEndScroll):
(WebCore::ScrollableArea::didUpdateScroll):
(WebCore::ScrollableArea::setIsUserScroll):
(WebCore::ScrollableArea::isHorizontalScrollerPinnedToMinimumPosition):
(WebCore::ScrollableArea::isHorizontalScrollerPinnedToMaximumPosition):
(WebCore::ScrollableArea::isVerticalScrollerPinnedToMinimumPosition):
(WebCore::ScrollableArea::isVerticalScrollerPinnedToMaximumPosition):
* platform/Scrollbar.cpp:
* platform/Scrollbar.h:
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::SharedBuffer):
(WebCore::SharedBuffer::createPurgeableBuffer):
(WebCore::SharedBuffer::data):
* platform/SharedBuffer.h:
(WebCore::SharedBuffer::shouldUsePurgeableMemory):
* platform/SuddenTermination.h:
* platform/Supplementable.h:
(WebCore::Supplementable::provideSupplement):
(WebCore::Supplementable::removeSupplement):
(WebCore::Supplementable::requireSupplement):
* platform/SystemMemory.h: Copied from Source/WebCore/platform/graphics/StringTruncator.h.
* platform/ThreadCheck.h:
* platform/ThreadGlobalData.cpp:
(WebCore::ThreadGlobalData::ThreadGlobalData):
(WebCore::ThreadGlobalData::destroy):
(WebCore::ThreadGlobalData::setWebCoreThreadData):
(WebCore::threadGlobalData):
* platform/ThreadGlobalData.h:
* platform/ThreadTimers.cpp:
(WebCore::ThreadTimers::ThreadTimers):
(WebCore::ThreadTimers::sharedTimerFiredInternal):
* platform/Timer.cpp:
(WebCore::TimerBase::start):
(WebCore::TimerBase::stop):
(WebCore::TimerBase::setNextFireTime):
* platform/Timer.h:
(WebCore::TimerBase::isActive):
* platform/URL.cpp:
(WebCore::enableURLSchemeCanonicalization):
(WebCore::equal):
(WebCore::URL::parse):
* platform/URL.h:
* platform/Widget.h:
* platform/audio/ios/AudioDestinationIOS.cpp:
* platform/audio/ios/AudioDestinationIOS.h:
* platform/audio/ios/AudioFileReaderIOS.cpp: Copied from Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp.
(WebCore::createAudioBufferList):
(WebCore::destroyAudioBufferList):
(WebCore::AudioFileReader::AudioFileReader):
(WebCore::AudioFileReader::~AudioFileReader):
(WebCore::AudioFileReader::readProc):
(WebCore::AudioFileReader::getSizeProc):
(WebCore::AudioFileReader::createBus):
(WebCore::createBusFromAudioFile):
(WebCore::createBusFromInMemoryAudioFile):
* platform/audio/ios/AudioFileReaderIOS.h: Copied from Source/WebCore/platform/graphics/StringTruncator.h.
(WebCore::AudioFileReader::data):
(WebCore::AudioFileReader::dataSize):
* platform/audio/ios/AudioSessionIOS.mm:
(SOFT_LINK_POINTER):
(-[WebAudioSessionHelper initWithCallback:WebCore::]):
(-[WebAudioSessionHelper dealloc]):
(-[WebAudioSessionHelper interruption:]):
(WebCore::AudioSession::setCategory):
* platform/audio/mac/AudioDestinationMac.cpp:
* platform/audio/mac/AudioFileReaderMac.cpp:
(WebCore::AudioFileReader::AudioFileReader):
(WebCore::createBusFromAudioFile):
(WebCore::createBusFromInMemoryAudioFile):
* platform/audio/mac/AudioSessionMac.cpp:
* platform/audio/mac/MediaSessionManagerMac.cpp:
(MediaSessionManager::updateSessionState):
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::SharedBuffer):
* platform/cf/URLCF.cpp:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::windowsKeyCodeForCharCode):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::BitmapImage):
(WebCore::BitmapImage::destroyDecodedDataIfNecessary):
(WebCore::BitmapImage::cacheFrame):
(WebCore::BitmapImage::cacheFrameInfo):
(WebCore::BitmapImage::updateSize):
(WebCore::BitmapImage::originalSize):
(WebCore::BitmapImage::originalSizeRespectingOrientation):
(WebCore::BitmapImage::dataChanged):
(WebCore::BitmapImage::ensureFrameInfoIsCached):
(WebCore::BitmapImage::frameAtIndex):
(WebCore::BitmapImage::frameIsCompleteAtIndex):
(WebCore::BitmapImage::frameDurationAtIndex):
(WebCore::BitmapImage::frameHasAlphaAtIndex):
(WebCore::BitmapImage::frameOrientationAtIndex):
(WebCore::BitmapImage::startAnimation):
(WebCore::BitmapImage::internalAdvanceAnimation):
* platform/graphics/BitmapImage.h:
(WebCore::FrameData::FrameData):
* platform/graphics/Color.cpp:
(WebCore::Color::isDark):
* platform/graphics/Color.h:
* platform/graphics/DisplayRefreshMonitor.h:
* platform/graphics/FloatPoint.h:
* platform/graphics/FloatRect.h:
* platform/graphics/FloatSize.h:
* platform/graphics/Font.cpp:
(WebCore::Font::drawText):
(WebCore::Font::width):
* platform/graphics/Font.h:
* platform/graphics/FontCache.cpp:
(initFontCacheLockOnce):
(FontLocker::FontLocker):
(FontLocker::~FontLocker):
(WebCore::fontCache):
(WebCore::FontCache::getCachedFontPlatformData):
(WebCore::FontCache::getCachedFontData):
(WebCore::FontCache::releaseFontData):
(WebCore::FontCache::purgeInactiveFontDataIfNeeded):
(WebCore::FontCache::purgeInactiveFontData):
* platform/graphics/FontCache.h:
* platform/graphics/FontFastPath.cpp:
(WebCore::Font::drawSimpleText):
(WebCore::Font::drawGlyphBuffer):
* platform/graphics/FontGlyphs.h:
* platform/graphics/FontPlatformData.cpp:
(WebCore::FontPlatformData::FontPlatformData):
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::font):
(WebCore::FontPlatformData::roundsGlyphAdvances):
(WebCore::FontPlatformData::hash):
(WebCore::FontPlatformData::hashTableDeletedFontValue):
* platform/graphics/GlyphPageTreeNode.cpp:
(WebCore::GlyphPageTreeNode::initializePage):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::GraphicsContext):
(WebCore::GraphicsContext::drawRaisedEllipse):
(WebCore::GraphicsContext::drawText):
(WebCore::GraphicsContext::drawBidiText):
(WebCore::GraphicsContext::clipRoundedRect):
(WebCore::GraphicsContext::emojiDrawingEnabled):
(WebCore::GraphicsContext::setEmojiDrawingEnabled):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContextState::GraphicsContextState):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::willBeDestroyed):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::contentsLayerForMedia):
(WebCore::GraphicsLayer::pixelAlignmentOffset):
(WebCore::GraphicsLayer::hasFlattenedPerspectiveTransform):
* platform/graphics/Icon.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::isSubsampled):
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.h:
* platform/graphics/IntSize.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::installedMediaEngines):
(WebCore::MediaPlayer::isCurrentPlaybackTargetWireless):
(WebCore::MediaPlayer::showPlaybackTargetPicker):
(WebCore::MediaPlayer::hasWirelessPlaybackTargets):
(WebCore::MediaPlayer::wirelessVideoPlaybackDisabled):
(WebCore::MediaPlayer::setWirelessVideoPlaybackDisabled):
(WebCore::MediaPlayer::setHasPlaybackTargetAvailabilityListeners):
(WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
(WebCore::MediaPlayer::playbackTargetAvailabilityChanged):
(WebCore::MediaPlayer::attributeChanged):
(WebCore::MediaPlayer::readyForPlayback):
(WebCore::MediaPlayer::volumeChanged):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
(WebCore::MediaPlayerClient::mediaPlayerPlaybackTargetAvailabilityChanged):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::volume):
(WebCore::MediaPlayerPrivateInterface::isCurrentPlaybackTargetWireless):
(WebCore::MediaPlayerPrivateInterface::showPlaybackTargetPicker):
(WebCore::MediaPlayerPrivateInterface::hasWirelessPlaybackTargets):
(WebCore::MediaPlayerPrivateInterface::wirelessVideoPlaybackDisabled):
(WebCore::MediaPlayerPrivateInterface::setWirelessVideoPlaybackDisabled):
(WebCore::MediaPlayerPrivateInterface::setHasPlaybackTargetAvailabilityListeners):
(WebCore::MediaPlayerPrivateInterface::attributeChanged):
(WebCore::MediaPlayerPrivateInterface::readyForPlayback):
* platform/graphics/SimpleFontData.cpp:
(WebCore::SimpleFontData::SimpleFontData):
* platform/graphics/SimpleFontData.h:
* platform/graphics/StringTruncator.cpp:
(WebCore::centerTruncateToBuffer):
(WebCore::rightTruncateToBuffer):
(WebCore::rightClipToCharacterBuffer):
(WebCore::rightClipToWordBuffer):
(WebCore::leftTruncateToBuffer):
(WebCore::truncateString):
(WebCore::StringTruncator::centerTruncate):
(WebCore::StringTruncator::rightTruncate):
(WebCore::StringTruncator::leftTruncate):
(WebCore::StringTruncator::rightClipToCharacter):
(WebCore::StringTruncator::rightClipToWord):
* platform/graphics/StringTruncator.h:
* platform/graphics/TextTrackRepresentation.cpp:
* platform/graphics/WidthIterator.h:
(WebCore::WidthIterator::supportsTypesettingFeatures):
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
(WebCore::AVTrackPrivateAVFObjCImpl::label):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded):
(WebCore::wkAVAssetResolvedURL):
* platform/graphics/blackberry/FontBlackBerry.cpp:
(WebCore::Font::drawComplexText):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::supportsAcceleratedFilterAnimations):
(WebCore::GraphicsLayerCA::setContentsToImage):
(WebCore::GraphicsLayerCA::contentsLayerForMedia):
(WebCore::GraphicsLayerCA::computeVisibleRect):
(WebCore::GraphicsLayerCA::updateGeometry):
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
(WebCore::GraphicsLayerCA::updateContentsRects):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
(WebCore::GraphicsLayerCA::setupContentsLayer):
(WebCore::GraphicsLayerCA::mediaLayerMustBeUpdatedOnMainThread):
(WebCore::GraphicsLayerCA::computePixelAlignment):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCAFilters.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
(WebCore::currentRunLoop):
(WebCore::LayerFlushScheduler::schedule):
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(-[WebAnimationDelegate animationDidStart:]):
(PlatformCALayerMac::setContentsScale):
(PlatformCALayer::isWebLayer):
(PlatformCALayer::setBoundsOnMainThread):
(PlatformCALayer::setPositionOnMainThread):
(PlatformCALayer::setAnchorPointOnMainThread):
(PlatformCALayer::setTileSize):
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::platformCALayerPaintContents):
(WebCore::TileController::removeAllTiles):
(WebCore::TileController::removeAllSecondaryTiles):
(WebCore::TileController::removeTilesInCohort):
(WebCore::TileController::revalidateTiles):
(WebCore::TileController::createTileLayer):
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::Font::drawComplexText):
* platform/graphics/cg/BitmapImageCG.cpp:
(WebCore::FrameData::clear):
(WebCore::BitmapImage::BitmapImage):
(WebCore::BitmapImage::checkForSolidColor):
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::copyUnscaledFrameAtIndex):
* platform/graphics/cg/ColorCG.cpp:
(WebCore::createCGColorWithDeviceWhite):
(WebCore::createCGColorWithDeviceRGBA):
(WebCore::Color::Color):
* platform/graphics/cg/FloatPointCG.cpp:
* platform/graphics/cg/FloatRectCG.cpp:
* platform/graphics/cg/FloatSizeCG.cpp:
* platform/graphics/cg/GradientCG.cpp:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::sRGBColorSpaceRef):
(WebCore::setStrokeAndFillColor):
(WebCore::GraphicsContext::platformInit):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::createIOSurface):
(WebCore::ImageBuffer::ImageBuffer):
(WebCore::ImageBuffer::draw):
(WebCore::jpegUTI):
(WebCore::utiFromMIMEType):
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData):
(WebCore::ImageBufferData::putData):
* platform/graphics/cg/ImageBufferDataCG.h:
* platform/graphics/cg/ImageCG.cpp:
(WebCore::drawPatternCallback):
(WebCore::Image::drawPattern):
* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageSource::ImageSource):
(WebCore::imageSourceOptions):
(WebCore::ImageSource::imageSourceOptions):
(WebCore::ImageSource::frameSizeAtIndex):
(WebCore::ImageSource::originalSize):
(WebCore::ImageSource::createFrameAtIndex):
* platform/graphics/cg/ImageSourceCGMac.mm:
* platform/graphics/cg/IntPointCG.cpp:
* platform/graphics/cg/IntRectCG.cpp:
* platform/graphics/cg/IntSizeCG.cpp:
* platform/graphics/cg/PDFDocumentImage.cpp:
* platform/graphics/cg/PathCG.cpp:
* platform/graphics/cg/PatternCG.cpp:
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::~FontPlatformData):
(WebCore::FontPlatformData::platformDataInit):
(WebCore::FontPlatformData::platformDataAssign):
(WebCore::FontPlatformData::platformIsEqual):
(WebCore::FontPlatformData::setFont):
(WebCore::FontPlatformData::allowsLigatures):
(WebCore::FontPlatformData::ctFont):
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm: Added.
(WebCore::DisplayRefreshMonitor::~DisplayRefreshMonitor):
(WebCore::DisplayRefreshMonitor::requestRefreshCallback):
(WebCore::DisplayRefreshMonitor::displayLinkFired):
* platform/graphics/ios/FontCacheIOS.mm: Added.
* platform/graphics/ios/FontServicesIOS.h: Added.
* platform/graphics/ios/FontServicesIOS.mm: Added.
(WebCore::FontServicesIOS::FontServicesIOS):
* platform/graphics/ios/GraphicsContext3DIOS.h: Added.
* platform/graphics/ios/IconIOS.mm: Copied from Source/WebCore/platform/mac/DisplaySleepDisabler.cpp.
* platform/graphics/ios/InbandTextTrackPrivateAVFIOS.h: Copied from Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h.
(WebCore::InbandTextTrackPrivateAVFIOS::create):
(WebCore::InbandTextTrackPrivateAVFIOS::internalID):
* platform/graphics/ios/InbandTextTrackPrivateAVFIOS.mm: Copied from Source/WebCore/platform/graphics/mac/IntRectMac.mm.
(WebCore::InbandTextTrackPrivateAVFIOS::InbandTextTrackPrivateAVFIOS):
(WebCore::InbandTextTrackPrivateAVFIOS::~InbandTextTrackPrivateAVFIOS):
(WebCore::InbandTextTrackPrivateAVFIOS::kind):
* platform/graphics/ios/MediaPlayerPrivateIOS.h: Added.
* platform/graphics/ios/MediaPlayerPrivateIOS.mm: Added.
* platform/graphics/ios/SimpleFontDataIOS.mm: Added.
(WebCore::fontFamilyShouldNotBeUsedForArabic):
(WebCore::fontHasVerticalGlyphs):
(WebCore::SimpleFontData::platformInit):
(WebCore::SimpleFontData::platformCharWidthInit):
(WebCore::SimpleFontData::platformCreateScaledFontData):
(WebCore::SimpleFontData::containsCharacters):
(WebCore::SimpleFontData::determinePitch):
(WebCore::SimpleFontData::platformWidthForGlyph):
* platform/graphics/ios/TextTrackRepresentationIOS.h: Copied from Source/WebCore/platform/graphics/TextTrackRepresentation.cpp.
* platform/graphics/ios/TextTrackRepresentationIOS.mm: Added.
* platform/graphics/mac/ColorMac.h:
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/FloatPointMac.mm:
* platform/graphics/mac/FloatRectMac.mm:
* platform/graphics/mac/FloatSizeMac.mm:
* platform/graphics/mac/FontCacheMac.mm:
* platform/graphics/mac/FontComplexTextMac.cpp:
(WebCore::Font::drawComplexText):
(WebCore::Font::fontDataForCombiningCharacterSequence):
* platform/graphics/mac/FontCustomPlatformData.cpp:
* platform/graphics/mac/FontMac.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
(WebCore::Font::drawGlyphs):
* platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::endPaint):
* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContext::drawFocusRing):
(WebCore::createDotPattern):
(WebCore::GraphicsContext::drawLineForDocumentMarker):
* platform/graphics/mac/IconMac.mm:
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::invalidatePlatformData):
* platform/graphics/mac/IntPointMac.mm:
* platform/graphics/mac/IntRectMac.mm:
* platform/graphics/mac/IntSizeMac.mm:
* platform/graphics/mac/MediaPlayerProxy.h:
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
* platform/graphics/mac/SimpleFontDataMac.mm:
* platform/graphics/mac/WebGLLayer.h:
* platform/graphics/mac/WebGLLayer.mm:
(-[WebGLLayer copyImageSnapshotWithColorSpace:]):
(-[WebGLLayer display]):
* platform/graphics/mac/WebLayer.mm:
(WebCore::drawLayerContents):
(-[WebSimpleLayer display]):
(-[WebSimpleLayer drawInContext:]):
* platform/graphics/mac/WebTiledLayer.mm:
(+[WebTiledLayer shouldDrawOnMainThread]):
(-[WebTiledLayer display]):
(-[WebTiledLayer drawInContext:]):
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::blitFramebuffer):
(WebCore::Extensions3DOpenGL::bindVertexArrayOES):
(WebCore::Extensions3DOpenGL::supportsExtension):
(WebCore::Extensions3DOpenGL::drawBuffersEXT):
* platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
(WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
(WebCore::GraphicsContext3D::renderbufferStorage):
(WebCore::GraphicsContext3D::getIntegerv):
(WebCore::GraphicsContext3D::texImage2D):
(WebCore::GraphicsContext3D::depthRange):
(WebCore::GraphicsContext3D::clearDepth):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::multiply):
* platform/graphics/win/FontWin.cpp:
(WebCore::Font::drawComplexText):
* platform/graphics/wince/FontWinCE.cpp:
(WebCore::Font::drawComplexText):
* platform/ios/ContentFilterIOS.mm: Copied from Source/WebCore/platform/ContentFilter.h.
* platform/ios/DeviceMotionClientIOS.h: Added.
(WebCore::DeviceMotionClientIOS::create):
* platform/ios/DeviceMotionClientIOS.mm: Added.
* platform/ios/DeviceOrientationClientIOS.h: Added.
(WebCore::DeviceOrientationClientIOS::create):
* platform/ios/DeviceOrientationClientIOS.mm: Added.
* platform/ios/KeyEventIOS.mm:
* platform/ios/MIMETypeRegistryIOS.mm: Copied from Source/WebCore/platform/network/mac/CredentialStorageMac.mm.
* platform/ios/MemoryPressureHandlerIOS.mm: Added.
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::write):
(WebCore::Pasteboard::resourceMIMEType):
(WebCore::Pasteboard::writePlainText):
(WebCore::Pasteboard::read):
(WebCore::supportedImageTypes):
(WebCore::Pasteboard::supportedPasteboardTypes):
(WebCore::Pasteboard::hasData):
(WebCore::Pasteboard::readString):
* platform/ios/PlatformEventFactoryIOS.h: Copied from Source/WebCore/platform/mac/DisplaySleepDisabler.h.
* platform/ios/PlatformEventFactoryIOS.mm: Added.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
* platform/ios/PlatformScreenIOS.mm: Added.
* platform/ios/PlatformSpeechSynthesizerIOS.mm: Added.
* platform/ios/SSLKeyGeneratorIOS.cpp: Added.
* platform/ios/ScrollAnimatorIOS.h: Copied from Source/WebCore/platform/mac/DisplaySleepDisabler.h.
* platform/ios/ScrollAnimatorIOS.mm: Added.
* platform/ios/ScrollViewIOS.mm: Added.
* platform/ios/ScrollbarThemeIOS.h: Added.
* platform/ios/ScrollbarThemeIOS.mm: Added.
* platform/ios/SelectionRect.cpp: Added.
* platform/ios/SelectionRect.h: Added.
* platform/ios/SoundIOS.mm: Copied from Source/WebCore/platform/text/mac/CharsetData.h.
* platform/ios/SystemMemoryIOS.cpp: Added.
* platform/ios/ThemeIOS.h: Copied from Source/WebCore/platform/KillRingNone.cpp.
* platform/ios/ThemeIOS.mm: Copied from Source/WebCore/platform/KillRingNone.cpp.
* platform/ios/TileCache.h: Added.
(WebCore::TileCache::isSpeculativeTileCreationEnabled):
* platform/ios/TileCache.mm: Added.
* platform/ios/TileGrid.h: Added.
* platform/ios/TileGrid.mm: Added.
* platform/ios/TileGridTile.h: Copied from Source/WebCore/platform/ContentFilter.h.
* platform/ios/TileGridTile.mm: Added.
* platform/ios/TileLayer.h: Copied from Source/WebCore/platform/mac/DisplaySleepDisabler.h.
* platform/ios/TileLayer.mm: Added.
* platform/ios/TileLayerPool.mm: Added.
* platform/ios/WebCoreMotionManager.h: Copied from Source/WebCore/platform/KillRingNone.cpp.
* platform/ios/WebCoreMotionManager.mm: Added.
* platform/ios/WebCoreSystemInterfaceIOS.h: Added.
* platform/ios/WebCoreSystemInterfaceIOS.mm: Added.
* platform/ios/WebEvent.h: Added.
* platform/ios/WebEvent.mm: Added.
* platform/ios/WidgetIOS.mm: Added.
* platform/mac/DisplaySleepDisabler.cpp:
(WebCore::DisplaySleepDisabler::DisplaySleepDisabler):
(WebCore::DisplaySleepDisabler::~DisplaySleepDisabler):
* platform/mac/DisplaySleepDisabler.h:
* platform/mac/FileSystemMac.mm:
* platform/mac/KillRingMac.mm:
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::install):
(WebCore::MemoryPressureHandler::releaseMemory):
* platform/mac/PlatformClockCM.mm:
(PlatformClockCM::PlatformClockCM):
* platform/mac/SoftLinking.h:
* platform/mac/SystemVersionMac.mm:
* platform/mac/WebCoreFullScreenPlaceholderView.h:
* platform/mac/WebCoreFullScreenPlaceholderView.mm:
* platform/mac/WebCoreFullScreenWarningView.h:
* platform/mac/WebCoreFullScreenWarningView.mm:
* platform/mac/WebCoreFullScreenWindow.h:
* platform/mac/WebCoreFullScreenWindow.mm:
* platform/mac/WebCoreNSCellExtras.h:
* platform/mac/WebCoreNSCellExtras.m:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebFontCache.mm:
(+[WebFontCache fontWithFamily:traits:size:]):
* platform/network/BlobRegistry.cpp:
* platform/network/BlobRegistryImpl.cpp:
* platform/network/Credential.h:
* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::set):
(WebCore::CredentialStorage::clearCredentials):
* platform/network/CredentialStorage.h:
* platform/network/NetworkStateNotifier.h:
* platform/network/ResourceHandle.cpp:
(WebCore::builtinResourceHandleConstructorMap):
(WebCore::ResourceHandle::continueWillSendRequest):
(WebCore::ResourceHandle::continueDidReceiveResponse):
(WebCore::ResourceHandle::continueShouldUseCredentialStorage):
(WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setDefaultAllowCookies):
(WebCore::ResourceRequestBase::defaultAllowCookies):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::ResourceRequestBase):
* platform/network/cf/CredentialStorageCFNet.cpp:
(WebCore::CredentialStorage::saveToPersistentStorage):
* platform/network/cf/DNSCFNet.cpp:
* platform/network/cf/ProxyServerCFNet.cpp:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
(WebCore::ResourceRequest::setMainResourceRequest):
(WebCore::ResourceRequest::isMainResourceRequest):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::updateFromDelegatePreservingOldHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::applyWebArchiveHackForMail):
(WebCore::initializeHTTPConnectionSettingsOnStartup):
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::reportErrorToClient):
* platform/network/ios/NetworkStateNotifierIOS.cpp: Copied from Source/WebCore/platform/KillRingNone.cpp.
(WebCore::NetworkStateNotifier::NetworkStateNotifier):
(WebCore::NetworkStateNotifier::setIsOnLine):
* platform/network/ios/QuickLook.h: Added.
* platform/network/ios/QuickLook.mm: Added.
* platform/network/ios/ResourceHandleIOS.mm: Added.
* platform/network/ios/WebCoreURLResponseIOS.h: Copied from Source/WebCore/platform/graphics/StringTruncator.h.
* platform/network/ios/WebCoreURLResponseIOS.mm: Added.
* platform/network/mac/AuthenticationMac.mm:
(WebCore::mac):
* platform/network/mac/CredentialStorageMac.mm:
(WebCore::CredentialStorage::saveToPersistentStorage):
* platform/network/mac/ResourceErrorMac.mm:
(dictionaryThatCanCode):
(-[WebCustomNSURLError encodeWithCoder:]):
(NSErrorFromCFError):
(WebCore::ResourceError::nsError):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::synchronousWillSendRequestEnabled):
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::schedule):
(WebCore::ResourceHandle::unschedule):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
* platform/network/mac/ResourceRequestMac.mm:
(WebCore::ResourceRequest::ResourceRequest):
(WebCore::ResourceRequest::updateNSURLRequest):
(WebCore::ResourceRequest::applyWebArchiveHackForMail):
(WebCore::ResourceRequest::useQuickLookResourceCachingQuirks):
* platform/network/mac/UTIUtilities.mm:
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connectionShouldUseCredentialStorage:]):
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]):
(-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]):
(-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
(-[WebCoreResourceHandleAsDelegate connection:didFailWithError:]):
* platform/sql/SQLiteDatabase.h:
(WebCore::SQLiteDatabase::sqlite3Handle):
* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::truncateDatabaseFile):
* platform/sql/SQLiteFileSystem.h:
* platform/sql/SQLiteTransaction.cpp:
(WebCore::SQLiteTransaction::begin):
(WebCore::SQLiteTransaction::commit):
(WebCore::SQLiteTransaction::rollback):
(WebCore::SQLiteTransaction::stop):
* platform/sql/ios/SQLiteDatabaseTracker.cpp: Added.
* platform/sql/ios/SQLiteDatabaseTracker.h: Copied from Source/WebCore/platform/MemoryPressureHandler.cpp.
* platform/sql/ios/SQLiteDatabaseTrackerClient.h: Copied from Source/WebCore/platform/KillRingNone.cpp.
* platform/text/PlatformLocale.cpp:
* platform/text/PlatformLocale.h:
* platform/text/TextBreakIteratorICU.cpp:
(WebCore::cursorMovementIterator):
* platform/text/TextCodecICU.cpp:
(WebCore::TextCodecICU::registerEncodingNames):
(WebCore::TextCodecICU::registerCodecs):
* platform/text/TextEncodingRegistry.cpp:
(WebCore::extendTextCodecMaps):
* platform/text/cf/HyphenationCF.cpp:
(WebCore::canHyphenate):
* platform/text/ios/LocalizedDateCache.h: Copied from Source/WebCore/platform/MemoryPressureHandler.h.
* platform/text/ios/LocalizedDateCache.mm: Added.
* platform/text/mac/CharsetData.h:
* platform/text/mac/LocaleMac.h:
* platform/text/mac/LocaleMac.mm:
(WebCore::LocaleMac::formatDateTime):
(WebCore::LocaleMac::maximumWidthForDateType):
* platform/text/mac/TextBoundaries.mm:
(WebCore::isSkipCharacter):
(WebCore::isWhitespaceCharacter):
(WebCore::isWordDelimitingCharacter):
(WebCore::isSymbolCharacter):
(WebCore::isAmbiguousBoundaryCharacter):
(WebCore::tokenizerForString):
(WebCore::findSimpleWordBoundary):
(WebCore::findComplexWordBoundary):
(WebCore::findWordBoundary):
(WebCore::findNextWordFromIndex):
* platform/text/mac/TextCodecMac.cpp:
* platform/text/mac/TextCodecMac.h:

Source/WTF:

* wtf/MainThread.cpp:
(WTF::canAccessThreadLocalDataForThread):
* wtf/MainThread.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfMainThreadcpp">trunk/Source/WTF/wtf/MainThread.cpp</a></li>
<li><a href="#trunkSourceWTFwtfMainThreadh">trunk/Source/WTF/wtf/MainThread.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformContentFilterh">trunk/Source/WebCore/platform/ContentFilter.h</a></li>
<li><a href="#trunkSourceWebCoreplatformDragDatah">trunk/Source/WebCore/platform/DragData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformFileChoosercpp">trunk/Source/WebCore/platform/FileChooser.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformFileChooserh">trunk/Source/WebCore/platform/FileChooser.h</a></li>
<li><a href="#trunkSourceWebCoreplatformFileSystemcpp">trunk/Source/WebCore/platform/FileSystem.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformFileSystemh">trunk/Source/WebCore/platform/FileSystem.h</a></li>
<li><a href="#trunkSourceWebCoreplatformKillRingNonecpp">trunk/Source/WebCore/platform/KillRingNone.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformLocalizedStringscpp">trunk/Source/WebCore/platform/LocalizedStrings.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformLocalizedStringsh">trunk/Source/WebCore/platform/LocalizedStrings.h</a></li>
<li><a href="#trunkSourceWebCoreplatformLoggingh">trunk/Source/WebCore/platform/Logging.h</a></li>
<li><a href="#trunkSourceWebCoreplatformMIMETypeRegistrycpp">trunk/Source/WebCore/platform/MIMETypeRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlercpp">trunk/Source/WebCore/platform/MemoryPressureHandler.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlerh">trunk/Source/WebCore/platform/MemoryPressureHandler.h</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformKeyboardEventh">trunk/Source/WebCore/platform/PlatformKeyboardEvent.h</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformMouseEventh">trunk/Source/WebCore/platform/PlatformMouseEvent.h</a></li>
<li><a href="#trunkSourceWebCoreplatformPlatformScreenh">trunk/Source/WebCore/platform/PlatformScreen.h</a></li>
<li><a href="#trunkSourceWebCoreplatformRuntimeApplicationCheckscpp">trunk/Source/WebCore/platform/RuntimeApplicationChecks.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollAnimatorcpp">trunk/Source/WebCore/platform/ScrollAnimator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollAnimatorh">trunk/Source/WebCore/platform/ScrollAnimator.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollTypesh">trunk/Source/WebCore/platform/ScrollTypes.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewcpp">trunk/Source/WebCore/platform/ScrollView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewh">trunk/Source/WebCore/platform/ScrollView.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreacpp">trunk/Source/WebCore/platform/ScrollableArea.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreah">trunk/Source/WebCore/platform/ScrollableArea.h</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollbarcpp">trunk/Source/WebCore/platform/Scrollbar.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollbarh">trunk/Source/WebCore/platform/Scrollbar.h</a></li>
<li><a href="#trunkSourceWebCoreplatformSharedBuffercpp">trunk/Source/WebCore/platform/SharedBuffer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformSharedBufferh">trunk/Source/WebCore/platform/SharedBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformSuddenTerminationh">trunk/Source/WebCore/platform/SuddenTermination.h</a></li>
<li><a href="#trunkSourceWebCoreplatformSupplementableh">trunk/Source/WebCore/platform/Supplementable.h</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadCheckh">trunk/Source/WebCore/platform/ThreadCheck.h</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadGlobalDatacpp">trunk/Source/WebCore/platform/ThreadGlobalData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadGlobalDatah">trunk/Source/WebCore/platform/ThreadGlobalData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadTimerscpp">trunk/Source/WebCore/platform/ThreadTimers.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformTimercpp">trunk/Source/WebCore/platform/Timer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformTimerh">trunk/Source/WebCore/platform/Timer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformURLcpp">trunk/Source/WebCore/platform/URL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformURLh">trunk/Source/WebCore/platform/URL.h</a></li>
<li><a href="#trunkSourceWebCoreplatformWidgeth">trunk/Source/WebCore/platform/Widget.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioiosAudioDestinationIOScpp">trunk/Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioiosAudioDestinationIOSh">trunk/Source/WebCore/platform/audio/ios/AudioDestinationIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioiosAudioSessionIOSmm">trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacAudioDestinationMaccpp">trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacAudioFileReaderMaccpp">trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacAudioSessionMaccpp">trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudiomacMediaSessionManagerMaccpp">trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcfSharedBufferCFcpp">trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcfURLCFcpp">trunk/Source/WebCore/platform/cf/URLCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaKeyEventCocoamm">trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsBitmapImagecpp">trunk/Source/WebCore/platform/graphics/BitmapImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsBitmapImageh">trunk/Source/WebCore/platform/graphics/BitmapImage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorcpp">trunk/Source/WebCore/platform/graphics/Color.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsColorh">trunk/Source/WebCore/platform/graphics/Color.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorh">trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFloatPointh">trunk/Source/WebCore/platform/graphics/FloatPoint.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFloatRecth">trunk/Source/WebCore/platform/graphics/FloatRect.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFloatSizeh">trunk/Source/WebCore/platform/graphics/FloatSize.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontcpp">trunk/Source/WebCore/platform/graphics/Font.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFonth">trunk/Source/WebCore/platform/graphics/Font.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCachecpp">trunk/Source/WebCore/platform/graphics/FontCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCacheh">trunk/Source/WebCore/platform/graphics/FontCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontFastPathcpp">trunk/Source/WebCore/platform/graphics/FontFastPath.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontGlyphsh">trunk/Source/WebCore/platform/graphics/FontGlyphs.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontPlatformDatacpp">trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontPlatformDatah">trunk/Source/WebCore/platform/graphics/FontPlatformData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGlyphPageTreeNodecpp">trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContextcpp">trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContexth">trunk/Source/WebCore/platform/graphics/GraphicsContext.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContext3Dh">trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayercpp">trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerh">trunk/Source/WebCore/platform/graphics/GraphicsLayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsIconh">trunk/Source/WebCore/platform/graphics/Icon.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImagecpp">trunk/Source/WebCore/platform/graphics/Image.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageSourceh">trunk/Source/WebCore/platform/graphics/ImageSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsIntPointh">trunk/Source/WebCore/platform/graphics/IntPoint.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsIntRecth">trunk/Source/WebCore/platform/graphics/IntRect.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsIntSizeh">trunk/Source/WebCore/platform/graphics/IntSize.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh">trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSimpleFontDatacpp">trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSimpleFontDatah">trunk/Source/WebCore/platform/graphics/SimpleFontData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsStringTruncatorcpp">trunk/Source/WebCore/platform/graphics/StringTruncator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsStringTruncatorh">trunk/Source/WebCore/platform/graphics/StringTruncator.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsTextTrackRepresentationcpp">trunk/Source/WebCore/platform/graphics/TextTrackRepresentation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsWidthIteratorh">trunk/Source/WebCore/platform/graphics/WidthIterator.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationAVTrackPrivateAVFObjCImplmm">trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsblackberryFontBlackBerrycpp">trunk/Source/WebCore/platform/graphics/blackberry/FontBlackBerry.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCAFiltersh">trunk/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaPlatformCALayerh">trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacLayerFlushSchedulerMaccpp">trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacTileControllermm">trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoFontCairoHarfbuzzNGcpp">trunk/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgBitmapImageCGcpp">trunk/Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgColorCGcpp">trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgFloatPointCGcpp">trunk/Source/WebCore/platform/graphics/cg/FloatPointCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgFloatRectCGcpp">trunk/Source/WebCore/platform/graphics/cg/FloatRectCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgFloatSizeCGcpp">trunk/Source/WebCore/platform/graphics/cg/FloatSizeCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgGradientCGcpp">trunk/Source/WebCore/platform/graphics/cg/GradientCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp">trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferCGcpp">trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferDataCGcpp">trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageBufferDataCGh">trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageCGcpp">trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageSourceCGcpp">trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgImageSourceCGMacmm">trunk/Source/WebCore/platform/graphics/cg/ImageSourceCGMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgIntPointCGcpp">trunk/Source/WebCore/platform/graphics/cg/IntPointCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgIntRectCGcpp">trunk/Source/WebCore/platform/graphics/cg/IntRectCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgIntSizeCGcpp">trunk/Source/WebCore/platform/graphics/cg/IntSizeCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgPDFDocumentImagecpp">trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgPathCGcpp">trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgPatternCGcpp">trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontPlatformDataCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacColorMach">trunk/Source/WebCore/platform/graphics/mac/ColorMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp">trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllerCoreTextmm">trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFloatPointMacmm">trunk/Source/WebCore/platform/graphics/mac/FloatPointMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFloatRectMacmm">trunk/Source/WebCore/platform/graphics/mac/FloatRectMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFloatSizeMacmm">trunk/Source/WebCore/platform/graphics/mac/FloatSizeMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFontCacheMacmm">trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFontComplexTextMaccpp">trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFontCustomPlatformDatacpp">trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFontMacmm">trunk/Source/WebCore/platform/graphics/mac/FontMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacGlyphPageTreeNodeMaccpp">trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacGraphicsContext3DMacmm">trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacGraphicsContextMacmm">trunk/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacIconMacmm">trunk/Source/WebCore/platform/graphics/mac/IconMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacImageMacmm">trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacIntPointMacmm">trunk/Source/WebCore/platform/graphics/mac/IntPointMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacIntRectMacmm">trunk/Source/WebCore/platform/graphics/mac/IntRectMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacIntSizeMacmm">trunk/Source/WebCore/platform/graphics/mac/IntSizeMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaPlayerProxyh">trunk/Source/WebCore/platform/graphics/mac/MediaPlayerProxy.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacSimpleFontDataCoreTextcpp">trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacSimpleFontDataMacmm">trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacWebGLLayerh">trunk/Source/WebCore/platform/graphics/mac/WebGLLayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacWebGLLayermm">trunk/Source/WebCore/platform/graphics/mac/WebGLLayer.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacWebLayermm">trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacWebTiledLayermm">trunk/Source/WebCore/platform/graphics/mac/WebTiledLayer.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglExtensions3DOpenGLcpp">trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglExtensions3DOpenGLCommoncpp">trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLcpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLCommoncpp">trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstransformsTransformationMatrixcpp">trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinFontWincpp">trunk/Source/WebCore/platform/graphics/win/FontWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinceFontWinCEcpp">trunk/Source/WebCore/platform/graphics/wince/FontWinCE.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformiosKeyEventIOSmm">trunk/Source/WebCore/platform/ios/KeyEventIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPasteboardIOSmm">trunk/Source/WebCore/platform/ios/PasteboardIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformPasteboardIOSmm">trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacDisplaySleepDisablercpp">trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacDisplaySleepDisablerh">trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacFileSystemMacmm">trunk/Source/WebCore/platform/mac/FileSystemMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacKillRingMacmm">trunk/Source/WebCore/platform/mac/KillRingMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacMemoryPressureHandlerMacmm">trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPlatformClockCMmm">trunk/Source/WebCore/platform/mac/PlatformClockCM.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacSoftLinkingh">trunk/Source/WebCore/platform/mac/SoftLinking.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacSystemVersionMacmm">trunk/Source/WebCore/platform/mac/SystemVersionMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreFullScreenPlaceholderViewh">trunk/Source/WebCore/platform/mac/WebCoreFullScreenPlaceholderView.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreFullScreenPlaceholderViewmm">trunk/Source/WebCore/platform/mac/WebCoreFullScreenPlaceholderView.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreFullScreenWarningViewh">trunk/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreFullScreenWarningViewmm">trunk/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreFullScreenWindowh">trunk/Source/WebCore/platform/mac/WebCoreFullScreenWindow.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreFullScreenWindowmm">trunk/Source/WebCore/platform/mac/WebCoreFullScreenWindow.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreNSCellExtrash">trunk/Source/WebCore/platform/mac/WebCoreNSCellExtras.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreNSCellExtrasm">trunk/Source/WebCore/platform/mac/WebCoreNSCellExtras.m</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreSystemInterfaceh">trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebFontCachemm">trunk/Source/WebCore/platform/mac/WebFontCache.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistrycpp">trunk/Source/WebCore/platform/network/BlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp">trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkCredentialh">trunk/Source/WebCore/platform/network/Credential.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkCredentialStoragecpp">trunk/Source/WebCore/platform/network/CredentialStorage.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkCredentialStorageh">trunk/Source/WebCore/platform/network/CredentialStorage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkNetworkStateNotifierh">trunk/Source/WebCore/platform/network/NetworkStateNotifier.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandlecpp">trunk/Source/WebCore/platform/network/ResourceHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceRequestBasecpp">trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceRequestBaseh">trunk/Source/WebCore/platform/network/ResourceRequestBase.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfCredentialStorageCFNetcpp">trunk/Source/WebCore/platform/network/cf/CredentialStorageCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfDNSCFNetcpp">trunk/Source/WebCore/platform/network/cf/DNSCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfProxyServerCFNetcpp">trunk/Source/WebCore/platform/network/cf/ProxyServerCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfResourceRequesth">trunk/Source/WebCore/platform/network/cf/ResourceRequest.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfResourceRequestCFNetcpp">trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfSocketStreamHandleCFNetcpp">trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacAuthenticationMacmm">trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacCredentialStorageMacmm">trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacResourceErrorMacmm">trunk/Source/WebCore/platform/network/mac/ResourceErrorMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm">trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacResourceRequestMacmm">trunk/Source/WebCore/platform/network/mac/ResourceRequestMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacUTIUtilitiesmm">trunk/Source/WebCore/platform/network/mac/UTIUtilities.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacWebCoreResourceHandleAsDelegatemm">trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteDatabaseh">trunk/Source/WebCore/platform/sql/SQLiteDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteFileSystemcpp">trunk/Source/WebCore/platform/sql/SQLiteFileSystem.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteFileSystemh">trunk/Source/WebCore/platform/sql/SQLiteFileSystem.h</a></li>
<li><a href="#trunkSourceWebCoreplatformsqlSQLiteTransactioncpp">trunk/Source/WebCore/platform/sql/SQLiteTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextPlatformLocalecpp">trunk/Source/WebCore/platform/text/PlatformLocale.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextPlatformLocaleh">trunk/Source/WebCore/platform/text/PlatformLocale.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextBreakIteratorICUcpp">trunk/Source/WebCore/platform/text/TextBreakIteratorICU.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextCodecICUcpp">trunk/Source/WebCore/platform/text/TextCodecICU.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextEncodingRegistrycpp">trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextcfHyphenationCFcpp">trunk/Source/WebCore/platform/text/cf/HyphenationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextmacCharsetDatah">trunk/Source/WebCore/platform/text/mac/CharsetData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextmacLocaleMach">trunk/Source/WebCore/platform/text/mac/LocaleMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextmacLocaleMacmm">trunk/Source/WebCore/platform/text/mac/LocaleMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformtextmacTextBoundariesmm">trunk/Source/WebCore/platform/text/mac/TextBoundaries.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformtextmacTextCodecMaccpp">trunk/Source/WebCore/platform/text/mac/TextCodecMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextmacTextCodecMach">trunk/Source/WebCore/platform/text/mac/TextCodecMac.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformRuntimeApplicationChecksIOSh">trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformRuntimeApplicationChecksIOSmm">trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformSystemMemoryh">trunk/Source/WebCore/platform/SystemMemory.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioiosAudioFileReaderIOScpp">trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioiosAudioFileReaderIOSh">trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.h</a></li>
<li>trunk/Source/WebCore/platform/graphics/ios/</li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosDisplayRefreshMonitorIOSmm">trunk/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosFontCacheIOSmm">trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosFontServicesIOSh">trunk/Source/WebCore/platform/graphics/ios/FontServicesIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosFontServicesIOSmm">trunk/Source/WebCore/platform/graphics/ios/FontServicesIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosGraphicsContext3DIOSh">trunk/Source/WebCore/platform/graphics/ios/GraphicsContext3DIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosIconIOSmm">trunk/Source/WebCore/platform/graphics/ios/IconIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosInbandTextTrackPrivateAVFIOSh">trunk/Source/WebCore/platform/graphics/ios/InbandTextTrackPrivateAVFIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosInbandTextTrackPrivateAVFIOSmm">trunk/Source/WebCore/platform/graphics/ios/InbandTextTrackPrivateAVFIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosMediaPlayerPrivateIOSh">trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosMediaPlayerPrivateIOSmm">trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosSimpleFontDataIOSmm">trunk/Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosTextTrackRepresentationIOSh">trunk/Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosTextTrackRepresentationIOSmm">trunk/Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosContentFilterIOSmm">trunk/Source/WebCore/platform/ios/ContentFilterIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosDeviceMotionClientIOSh">trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosDeviceMotionClientIOSmm">trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosDeviceOrientationClientIOSh">trunk/Source/WebCore/platform/ios/DeviceOrientationClientIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosDeviceOrientationClientIOSmm">trunk/Source/WebCore/platform/ios/DeviceOrientationClientIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosMIMETypeRegistryIOSmm">trunk/Source/WebCore/platform/ios/MIMETypeRegistryIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosMemoryPressureHandlerIOSmm">trunk/Source/WebCore/platform/ios/MemoryPressureHandlerIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformEventFactoryIOSh">trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformEventFactoryIOSmm">trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformScreenIOSmm">trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPlatformSpeechSynthesizerIOSmm">trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosSSLKeyGeneratorIOScpp">trunk/Source/WebCore/platform/ios/SSLKeyGeneratorIOS.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformiosScrollAnimatorIOSh">trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosScrollAnimatorIOSmm">trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosScrollViewIOSmm">trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosScrollbarThemeIOSh">trunk/Source/WebCore/platform/ios/ScrollbarThemeIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosScrollbarThemeIOSmm">trunk/Source/WebCore/platform/ios/ScrollbarThemeIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosSelectionRectcpp">trunk/Source/WebCore/platform/ios/SelectionRect.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformiosSelectionRecth">trunk/Source/WebCore/platform/ios/SelectionRect.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosSoundIOSmm">trunk/Source/WebCore/platform/ios/SoundIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosSystemMemoryIOScpp">trunk/Source/WebCore/platform/ios/SystemMemoryIOS.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformiosThemeIOSh">trunk/Source/WebCore/platform/ios/ThemeIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosThemeIOSmm">trunk/Source/WebCore/platform/ios/ThemeIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosTileCacheh">trunk/Source/WebCore/platform/ios/TileCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosTileCachemm">trunk/Source/WebCore/platform/ios/TileCache.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosTileGridh">trunk/Source/WebCore/platform/ios/TileGrid.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosTileGridmm">trunk/Source/WebCore/platform/ios/TileGrid.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosTileGridTileh">trunk/Source/WebCore/platform/ios/TileGridTile.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosTileGridTilemm">trunk/Source/WebCore/platform/ios/TileGridTile.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosTileLayerh">trunk/Source/WebCore/platform/ios/TileLayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosTileLayermm">trunk/Source/WebCore/platform/ios/TileLayer.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosTileLayerPoolh">trunk/Source/WebCore/platform/ios/TileLayerPool.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosTileLayerPoolmm">trunk/Source/WebCore/platform/ios/TileLayerPool.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebCoreMotionManagerh">trunk/Source/WebCore/platform/ios/WebCoreMotionManager.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebCoreMotionManagermm">trunk/Source/WebCore/platform/ios/WebCoreMotionManager.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebCoreSystemInterfaceIOSh">trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebCoreSystemInterfaceIOSmm">trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebEventh">trunk/Source/WebCore/platform/ios/WebEvent.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWebEventmm">trunk/Source/WebCore/platform/ios/WebEvent.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformiosWidgetIOSmm">trunk/Source/WebCore/platform/ios/WidgetIOS.mm</a></li>
<li>trunk/Source/WebCore/platform/network/ios/</li>
<li><a href="#trunkSourceWebCoreplatformnetworkiosNetworkStateNotifierIOScpp">trunk/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkiosQuickLookh">trunk/Source/WebCore/platform/network/ios/QuickLook.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkiosQuickLookmm">trunk/Source/WebCore/platform/network/ios/QuickLook.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkiosResourceHandleIOSmm">trunk/Source/WebCore/platform/network/ios/ResourceHandleIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkiosWebCoreURLResponseIOSh">trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkiosWebCoreURLResponseIOSmm">trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm</a></li>
<li>trunk/Source/WebCore/platform/sql/ios/</li>
<li><a href="#trunkSourceWebCoreplatformsqliosSQLiteDatabaseTrackercpp">trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformsqliosSQLiteDatabaseTrackerh">trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.h</a></li>
<li><a href="#trunkSourceWebCoreplatformsqliosSQLiteDatabaseTrackerClienth">trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTrackerClient.h</a></li>
<li>trunk/Source/WebCore/platform/text/ios/</li>
<li><a href="#trunkSourceWebCoreplatformtextiosLocalizedDateCacheh">trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextiosLocalizedDateCachemm">trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WTF/ChangeLog        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-01-09  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] Upstream WebCore/platform changes
+        https://bugs.webkit.org/show_bug.cgi?id=126654
+
+        Rubber-stamped by David Kilzer.
+
+        * wtf/MainThread.cpp:
+        (WTF::canAccessThreadLocalDataForThread):
+        * wtf/MainThread.h:
+
</ins><span class="cx"> 2014-01-09  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r161540.
</span></span></pre></div>
<a id="trunkSourceWTFwtfMainThreadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/MainThread.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/MainThread.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WTF/wtf/MainThread.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -266,6 +266,13 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !USE(WEB_THREAD)
+bool canAccessThreadLocalDataForThread(ThreadIdentifier threadId)
+{
+    return threadId == currentThread();
+}
+#endif
+
</ins><span class="cx"> #if ENABLE(PARALLEL_GC)
</span><span class="cx"> static ThreadSpecific&lt;bool&gt;* isGCThread;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWTFwtfMainThreadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/MainThread.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/MainThread.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WTF/wtf/MainThread.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -55,13 +55,14 @@
</span><span class="cx"> 
</span><span class="cx"> WTF_EXPORT_PRIVATE bool isMainThread();
</span><span class="cx"> 
</span><ins>+WTF_EXPORT_PRIVATE bool canAccessThreadLocalDataForThread(ThreadIdentifier);
+
</ins><span class="cx"> #if USE(WEB_THREAD)
</span><span class="cx"> WTF_EXPORT_PRIVATE bool isWebThread();
</span><span class="cx"> WTF_EXPORT_PRIVATE bool isUIThread();
</span><span class="cx"> WTF_EXPORT_PRIVATE void initializeWebThread();
</span><span class="cx"> WTF_EXPORT_PRIVATE void initializeApplicationUIThreadIdentifier();
</span><span class="cx"> WTF_EXPORT_PRIVATE void initializeWebThreadIdentifier();
</span><del>-WTF_EXPORT_PRIVATE bool canAccessThreadLocalDataForThread(ThreadIdentifier);
</del><span class="cx"> void initializeWebThreadPlatform();
</span><span class="cx"> #else
</span><span class="cx"> inline bool isWebThread() { return isMainThread(); }
</span><span class="lines">@@ -102,11 +103,13 @@
</span><span class="cx"> using WTF::setMainThreadCallbacksPaused;
</span><span class="cx"> using WTF::isMainThread;
</span><span class="cx"> using WTF::isMainThreadOrGCThread;
</span><ins>+using WTF::canAccessThreadLocalDataForThread;
+using WTF::isUIThread;
+using WTF::isWebThread;
</ins><span class="cx"> #if USE(WEB_THREAD)
</span><span class="cx"> using WTF::initializeWebThread;
</span><span class="cx"> using WTF::initializeApplicationUIThreadIdentifier;
</span><span class="cx"> using WTF::initializeWebThreadIdentifier;
</span><del>-using WTF::canAccessThreadLocalDataForThread;
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #endif // MainThread_h
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/ChangeLog        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -1,3 +1,657 @@
</span><ins>+2014-01-09  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        [iOS] Upstream WebCore/platform changes
+        https://bugs.webkit.org/show_bug.cgi?id=126654
+
+        Rubber-stamped by David Kilzer.
+
+        * WebCore.exp.in:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/ContentFilter.h:
+        * platform/DragData.h:
+        * platform/FileChooser.cpp:
+        (WebCore::FileChooser::chooseMediaFiles):
+        * platform/FileChooser.h:
+        * platform/FileSystem.cpp:
+        (WebCore::setMetadataURL):
+        * platform/FileSystem.h:
+        * platform/KillRingNone.cpp:
+        * platform/LocalizedStrings.cpp:
+        (WebCore::fileButtonChooseMediaFileLabel):
+        (WebCore::fileButtonChooseMultipleMediaFilesLabel):
+        (WebCore::fileButtonNoMediaFileSelectedLabel):
+        (WebCore::fileButtonNoMediaFilesSelectedLabel):
+        * platform/LocalizedStrings.h:
+        * platform/Logging.h:
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::initializeSupportedImageMIMETypes):
+        (WebCore::initializeSupportedNonImageMimeTypes):
+        (WebCore::initializeUnsupportedTextMIMETypes):
+        * platform/MemoryPressureHandler.cpp:
+        (WebCore::MemoryPressureHandler::MemoryPressureHandler):
+        * platform/MemoryPressureHandler.h:
+        * platform/PlatformKeyboardEvent.h:
+        (WebCore::PlatformKeyboardEvent::event):
+        * platform/PlatformMouseEvent.h:
+        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+        * platform/PlatformScreen.h:
+        * platform/RuntimeApplicationChecks.cpp:
+        (WebCore::mainBundleIsEqualTo):
+        * platform/RuntimeApplicationChecksIOS.h: Copied from Source/WebCore/platform/graphics/StringTruncator.h.
+        * platform/RuntimeApplicationChecksIOS.mm: Added.
+        * platform/ScrollAnimator.cpp:
+        (WebCore::ScrollAnimator::handleTouchEvent):
+        * platform/ScrollAnimator.h:
+        * platform/ScrollTypes.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::unscaledVisibleContentSize):
+        (WebCore::ScrollView::visibleContentRect):
+        * platform/ScrollView.h:
+        (WebCore::ScrollView::actualScrollX):
+        (WebCore::ScrollView::actualScrollY):
+        * platform/ScrollableArea.cpp:
+        (WebCore::ScrollableArea::handleTouchEvent):
+        (WebCore::ScrollableArea::isPinnedInBothDirections):
+        (WebCore::ScrollableArea::isPinnedHorizontallyInDirection):
+        (WebCore::ScrollableArea::isPinnedVerticallyInDirection):
+        * platform/ScrollableArea.h:
+        (WebCore::ScrollableArea::isTouchScrollable):
+        (WebCore::ScrollableArea::isOverflowScroll):
+        (WebCore::ScrollableArea::didStartScroll):
+        (WebCore::ScrollableArea::didEndScroll):
+        (WebCore::ScrollableArea::didUpdateScroll):
+        (WebCore::ScrollableArea::setIsUserScroll):
+        (WebCore::ScrollableArea::isHorizontalScrollerPinnedToMinimumPosition):
+        (WebCore::ScrollableArea::isHorizontalScrollerPinnedToMaximumPosition):
+        (WebCore::ScrollableArea::isVerticalScrollerPinnedToMinimumPosition):
+        (WebCore::ScrollableArea::isVerticalScrollerPinnedToMaximumPosition):
+        * platform/Scrollbar.cpp:
+        * platform/Scrollbar.h:
+        * platform/SharedBuffer.cpp:
+        (WebCore::SharedBuffer::SharedBuffer):
+        (WebCore::SharedBuffer::createPurgeableBuffer):
+        (WebCore::SharedBuffer::data):
+        * platform/SharedBuffer.h:
+        (WebCore::SharedBuffer::shouldUsePurgeableMemory):
+        * platform/SuddenTermination.h:
+        * platform/Supplementable.h:
+        (WebCore::Supplementable::provideSupplement):
+        (WebCore::Supplementable::removeSupplement):
+        (WebCore::Supplementable::requireSupplement):
+        * platform/SystemMemory.h: Copied from Source/WebCore/platform/graphics/StringTruncator.h.
+        * platform/ThreadCheck.h:
+        * platform/ThreadGlobalData.cpp:
+        (WebCore::ThreadGlobalData::ThreadGlobalData):
+        (WebCore::ThreadGlobalData::destroy):
+        (WebCore::ThreadGlobalData::setWebCoreThreadData):
+        (WebCore::threadGlobalData):
+        * platform/ThreadGlobalData.h:
+        * platform/ThreadTimers.cpp:
+        (WebCore::ThreadTimers::ThreadTimers):
+        (WebCore::ThreadTimers::sharedTimerFiredInternal):
+        * platform/Timer.cpp:
+        (WebCore::TimerBase::start):
+        (WebCore::TimerBase::stop):
+        (WebCore::TimerBase::setNextFireTime):
+        * platform/Timer.h:
+        (WebCore::TimerBase::isActive):
+        * platform/URL.cpp:
+        (WebCore::enableURLSchemeCanonicalization):
+        (WebCore::equal):
+        (WebCore::URL::parse):
+        * platform/URL.h:
+        * platform/Widget.h:
+        * platform/audio/ios/AudioDestinationIOS.cpp:
+        * platform/audio/ios/AudioDestinationIOS.h:
+        * platform/audio/ios/AudioFileReaderIOS.cpp: Copied from Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp.
+        (WebCore::createAudioBufferList):
+        (WebCore::destroyAudioBufferList):
+        (WebCore::AudioFileReader::AudioFileReader):
+        (WebCore::AudioFileReader::~AudioFileReader):
+        (WebCore::AudioFileReader::readProc):
+        (WebCore::AudioFileReader::getSizeProc):
+        (WebCore::AudioFileReader::createBus):
+        (WebCore::createBusFromAudioFile):
+        (WebCore::createBusFromInMemoryAudioFile):
+        * platform/audio/ios/AudioFileReaderIOS.h: Copied from Source/WebCore/platform/graphics/StringTruncator.h.
+        (WebCore::AudioFileReader::data):
+        (WebCore::AudioFileReader::dataSize):
+        * platform/audio/ios/AudioSessionIOS.mm:
+        (SOFT_LINK_POINTER):
+        (-[WebAudioSessionHelper initWithCallback:WebCore::]):
+        (-[WebAudioSessionHelper dealloc]):
+        (-[WebAudioSessionHelper interruption:]):
+        (WebCore::AudioSession::setCategory):
+        * platform/audio/mac/AudioDestinationMac.cpp:
+        * platform/audio/mac/AudioFileReaderMac.cpp:
+        (WebCore::AudioFileReader::AudioFileReader):
+        (WebCore::createBusFromAudioFile):
+        (WebCore::createBusFromInMemoryAudioFile):
+        * platform/audio/mac/AudioSessionMac.cpp:
+        * platform/audio/mac/MediaSessionManagerMac.cpp:
+        (MediaSessionManager::updateSessionState):
+        * platform/cf/SharedBufferCF.cpp:
+        (WebCore::SharedBuffer::SharedBuffer):
+        * platform/cf/URLCF.cpp:
+        * platform/cocoa/KeyEventCocoa.mm:
+        (WebCore::windowsKeyCodeForCharCode):
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::BitmapImage):
+        (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
+        (WebCore::BitmapImage::cacheFrame):
+        (WebCore::BitmapImage::cacheFrameInfo):
+        (WebCore::BitmapImage::updateSize):
+        (WebCore::BitmapImage::originalSize):
+        (WebCore::BitmapImage::originalSizeRespectingOrientation):
+        (WebCore::BitmapImage::dataChanged):
+        (WebCore::BitmapImage::ensureFrameInfoIsCached):
+        (WebCore::BitmapImage::frameAtIndex):
+        (WebCore::BitmapImage::frameIsCompleteAtIndex):
+        (WebCore::BitmapImage::frameDurationAtIndex):
+        (WebCore::BitmapImage::frameHasAlphaAtIndex):
+        (WebCore::BitmapImage::frameOrientationAtIndex):
+        (WebCore::BitmapImage::startAnimation):
+        (WebCore::BitmapImage::internalAdvanceAnimation):
+        * platform/graphics/BitmapImage.h:
+        (WebCore::FrameData::FrameData):
+        * platform/graphics/Color.cpp:
+        (WebCore::Color::isDark):
+        * platform/graphics/Color.h:
+        * platform/graphics/DisplayRefreshMonitor.h:
+        * platform/graphics/FloatPoint.h:
+        * platform/graphics/FloatRect.h:
+        * platform/graphics/FloatSize.h:
+        * platform/graphics/Font.cpp:
+        (WebCore::Font::drawText):
+        (WebCore::Font::width):
+        * platform/graphics/Font.h:
+        * platform/graphics/FontCache.cpp:
+        (initFontCacheLockOnce):
+        (FontLocker::FontLocker):
+        (FontLocker::~FontLocker):
+        (WebCore::fontCache):
+        (WebCore::FontCache::getCachedFontPlatformData):
+        (WebCore::FontCache::getCachedFontData):
+        (WebCore::FontCache::releaseFontData):
+        (WebCore::FontCache::purgeInactiveFontDataIfNeeded):
+        (WebCore::FontCache::purgeInactiveFontData):
+        * platform/graphics/FontCache.h:
+        * platform/graphics/FontFastPath.cpp:
+        (WebCore::Font::drawSimpleText):
+        (WebCore::Font::drawGlyphBuffer):
+        * platform/graphics/FontGlyphs.h:
+        * platform/graphics/FontPlatformData.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+        * platform/graphics/FontPlatformData.h:
+        (WebCore::FontPlatformData::font):
+        (WebCore::FontPlatformData::roundsGlyphAdvances):
+        (WebCore::FontPlatformData::hash):
+        (WebCore::FontPlatformData::hashTableDeletedFontValue):
+        * platform/graphics/GlyphPageTreeNode.cpp:
+        (WebCore::GlyphPageTreeNode::initializePage):
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::GraphicsContext):
+        (WebCore::GraphicsContext::drawRaisedEllipse):
+        (WebCore::GraphicsContext::drawText):
+        (WebCore::GraphicsContext::drawBidiText):
+        (WebCore::GraphicsContext::clipRoundedRect):
+        (WebCore::GraphicsContext::emojiDrawingEnabled):
+        (WebCore::GraphicsContext::setEmojiDrawingEnabled):
+        * platform/graphics/GraphicsContext.h:
+        (WebCore::GraphicsContextState::GraphicsContextState):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::willBeDestroyed):
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::contentsLayerForMedia):
+        (WebCore::GraphicsLayer::pixelAlignmentOffset):
+        (WebCore::GraphicsLayer::hasFlattenedPerspectiveTransform):
+        * platform/graphics/Icon.h:
+        * platform/graphics/Image.cpp:
+        (WebCore::Image::drawTiled):
+        * platform/graphics/ImageSource.h:
+        (WebCore::ImageSource::isSubsampled):
+        * platform/graphics/IntPoint.h:
+        * platform/graphics/IntRect.h:
+        * platform/graphics/IntSize.h:
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::installedMediaEngines):
+        (WebCore::MediaPlayer::isCurrentPlaybackTargetWireless):
+        (WebCore::MediaPlayer::showPlaybackTargetPicker):
+        (WebCore::MediaPlayer::hasWirelessPlaybackTargets):
+        (WebCore::MediaPlayer::wirelessVideoPlaybackDisabled):
+        (WebCore::MediaPlayer::setWirelessVideoPlaybackDisabled):
+        (WebCore::MediaPlayer::setHasPlaybackTargetAvailabilityListeners):
+        (WebCore::MediaPlayer::currentPlaybackTargetIsWirelessChanged):
+        (WebCore::MediaPlayer::playbackTargetAvailabilityChanged):
+        (WebCore::MediaPlayer::attributeChanged):
+        (WebCore::MediaPlayer::readyForPlayback):
+        (WebCore::MediaPlayer::volumeChanged):
+        * platform/graphics/MediaPlayer.h:
+        (WebCore::MediaPlayerClient::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
+        (WebCore::MediaPlayerClient::mediaPlayerPlaybackTargetAvailabilityChanged):
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::volume):
+        (WebCore::MediaPlayerPrivateInterface::isCurrentPlaybackTargetWireless):
+        (WebCore::MediaPlayerPrivateInterface::showPlaybackTargetPicker):
+        (WebCore::MediaPlayerPrivateInterface::hasWirelessPlaybackTargets):
+        (WebCore::MediaPlayerPrivateInterface::wirelessVideoPlaybackDisabled):
+        (WebCore::MediaPlayerPrivateInterface::setWirelessVideoPlaybackDisabled):
+        (WebCore::MediaPlayerPrivateInterface::setHasPlaybackTargetAvailabilityListeners):
+        (WebCore::MediaPlayerPrivateInterface::attributeChanged):
+        (WebCore::MediaPlayerPrivateInterface::readyForPlayback):
+        * platform/graphics/SimpleFontData.cpp:
+        (WebCore::SimpleFontData::SimpleFontData):
+        * platform/graphics/SimpleFontData.h:
+        * platform/graphics/StringTruncator.cpp:
+        (WebCore::centerTruncateToBuffer):
+        (WebCore::rightTruncateToBuffer):
+        (WebCore::rightClipToCharacterBuffer):
+        (WebCore::rightClipToWordBuffer):
+        (WebCore::leftTruncateToBuffer):
+        (WebCore::truncateString):
+        (WebCore::StringTruncator::centerTruncate):
+        (WebCore::StringTruncator::rightTruncate):
+        (WebCore::StringTruncator::leftTruncate):
+        (WebCore::StringTruncator::rightClipToCharacter):
+        (WebCore::StringTruncator::rightClipToWord):
+        * platform/graphics/StringTruncator.h:
+        * platform/graphics/TextTrackRepresentation.cpp:
+        * platform/graphics/WidthIterator.h:
+        (WebCore::WidthIterator::supportsTypesettingFeatures):
+        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
+        (WebCore::AVTrackPrivateAVFObjCImpl::label):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded):
+        (WebCore::wkAVAssetResolvedURL):
+        * platform/graphics/blackberry/FontBlackBerry.cpp:
+        (WebCore::Font::drawComplexText):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::supportsAcceleratedFilterAnimations):
+        (WebCore::GraphicsLayerCA::setContentsToImage):
+        (WebCore::GraphicsLayerCA::contentsLayerForMedia):
+        (WebCore::GraphicsLayerCA::computeVisibleRect):
+        (WebCore::GraphicsLayerCA::updateGeometry):
+        (WebCore::GraphicsLayerCA::ensureStructuralLayer):
+        (WebCore::GraphicsLayerCA::updateContentsRects):
+        (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
+        (WebCore::GraphicsLayerCA::setupContentsLayer):
+        (WebCore::GraphicsLayerCA::mediaLayerMustBeUpdatedOnMainThread):
+        (WebCore::GraphicsLayerCA::computePixelAlignment):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * platform/graphics/ca/PlatformCAFilters.h:
+        * platform/graphics/ca/PlatformCALayer.h:
+        * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
+        (WebCore::currentRunLoop):
+        (WebCore::LayerFlushScheduler::schedule):
+        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+        (-[WebAnimationDelegate animationDidStart:]):
+        (PlatformCALayerMac::setContentsScale):
+        (PlatformCALayer::isWebLayer):
+        (PlatformCALayer::setBoundsOnMainThread):
+        (PlatformCALayer::setPositionOnMainThread):
+        (PlatformCALayer::setAnchorPointOnMainThread):
+        (PlatformCALayer::setTileSize):
+        * platform/graphics/ca/mac/TileController.mm:
+        (WebCore::TileController::platformCALayerPaintContents):
+        (WebCore::TileController::removeAllTiles):
+        (WebCore::TileController::removeAllSecondaryTiles):
+        (WebCore::TileController::removeTilesInCohort):
+        (WebCore::TileController::revalidateTiles):
+        (WebCore::TileController::createTileLayer):
+        * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
+        (WebCore::Font::drawComplexText):
+        * platform/graphics/cg/BitmapImageCG.cpp:
+        (WebCore::FrameData::clear):
+        (WebCore::BitmapImage::BitmapImage):
+        (WebCore::BitmapImage::checkForSolidColor):
+        (WebCore::BitmapImage::draw):
+        (WebCore::BitmapImage::copyUnscaledFrameAtIndex):
+        * platform/graphics/cg/ColorCG.cpp:
+        (WebCore::createCGColorWithDeviceWhite):
+        (WebCore::createCGColorWithDeviceRGBA):
+        (WebCore::Color::Color):
+        * platform/graphics/cg/FloatPointCG.cpp:
+        * platform/graphics/cg/FloatRectCG.cpp:
+        * platform/graphics/cg/FloatSizeCG.cpp:
+        * platform/graphics/cg/GradientCG.cpp:
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::sRGBColorSpaceRef):
+        (WebCore::setStrokeAndFillColor):
+        (WebCore::GraphicsContext::platformInit):
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::createIOSurface):
+        (WebCore::ImageBuffer::ImageBuffer):
+        (WebCore::ImageBuffer::draw):
+        (WebCore::jpegUTI):
+        (WebCore::utiFromMIMEType):
+        * platform/graphics/cg/ImageBufferDataCG.cpp:
+        (WebCore::ImageBufferData::getData):
+        (WebCore::ImageBufferData::putData):
+        * platform/graphics/cg/ImageBufferDataCG.h:
+        * platform/graphics/cg/ImageCG.cpp:
+        (WebCore::drawPatternCallback):
+        (WebCore::Image::drawPattern):
+        * platform/graphics/cg/ImageSourceCG.cpp:
+        (WebCore::ImageSource::ImageSource):
+        (WebCore::imageSourceOptions):
+        (WebCore::ImageSource::imageSourceOptions):
+        (WebCore::ImageSource::frameSizeAtIndex):
+        (WebCore::ImageSource::originalSize):
+        (WebCore::ImageSource::createFrameAtIndex):
+        * platform/graphics/cg/ImageSourceCGMac.mm:
+        * platform/graphics/cg/IntPointCG.cpp:
+        * platform/graphics/cg/IntRectCG.cpp:
+        * platform/graphics/cg/IntSizeCG.cpp:
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        * platform/graphics/cg/PathCG.cpp:
+        * platform/graphics/cg/PatternCG.cpp:
+        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
+        (WebCore::FontPlatformData::FontPlatformData):
+        (WebCore::FontPlatformData::~FontPlatformData):
+        (WebCore::FontPlatformData::platformDataInit):
+        (WebCore::FontPlatformData::platformDataAssign):
+        (WebCore::FontPlatformData::platformIsEqual):
+        (WebCore::FontPlatformData::setFont):
+        (WebCore::FontPlatformData::allowsLigatures):
+        (WebCore::FontPlatformData::ctFont):
+        * platform/graphics/ios/DisplayRefreshMonitorIOS.mm: Added.
+        (WebCore::DisplayRefreshMonitor::~DisplayRefreshMonitor):
+        (WebCore::DisplayRefreshMonitor::requestRefreshCallback):
+        (WebCore::DisplayRefreshMonitor::displayLinkFired):
+        * platform/graphics/ios/FontCacheIOS.mm: Added.
+        * platform/graphics/ios/FontServicesIOS.h: Added.
+        * platform/graphics/ios/FontServicesIOS.mm: Added.
+        (WebCore::FontServicesIOS::FontServicesIOS):
+        * platform/graphics/ios/GraphicsContext3DIOS.h: Added.
+        * platform/graphics/ios/IconIOS.mm: Copied from Source/WebCore/platform/mac/DisplaySleepDisabler.cpp.
+        * platform/graphics/ios/InbandTextTrackPrivateAVFIOS.h: Copied from Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h.
+        (WebCore::InbandTextTrackPrivateAVFIOS::create):
+        (WebCore::InbandTextTrackPrivateAVFIOS::internalID):
+        * platform/graphics/ios/InbandTextTrackPrivateAVFIOS.mm: Copied from Source/WebCore/platform/graphics/mac/IntRectMac.mm.
+        (WebCore::InbandTextTrackPrivateAVFIOS::InbandTextTrackPrivateAVFIOS):
+        (WebCore::InbandTextTrackPrivateAVFIOS::~InbandTextTrackPrivateAVFIOS):
+        (WebCore::InbandTextTrackPrivateAVFIOS::kind):
+        * platform/graphics/ios/MediaPlayerPrivateIOS.h: Added.
+        * platform/graphics/ios/MediaPlayerPrivateIOS.mm: Added.
+        * platform/graphics/ios/SimpleFontDataIOS.mm: Added.
+        (WebCore::fontFamilyShouldNotBeUsedForArabic):
+        (WebCore::fontHasVerticalGlyphs):
+        (WebCore::SimpleFontData::platformInit):
+        (WebCore::SimpleFontData::platformCharWidthInit):
+        (WebCore::SimpleFontData::platformCreateScaledFontData):
+        (WebCore::SimpleFontData::containsCharacters):
+        (WebCore::SimpleFontData::determinePitch):
+        (WebCore::SimpleFontData::platformWidthForGlyph):
+        * platform/graphics/ios/TextTrackRepresentationIOS.h: Copied from Source/WebCore/platform/graphics/TextTrackRepresentation.cpp.
+        * platform/graphics/ios/TextTrackRepresentationIOS.mm: Added.
+        * platform/graphics/mac/ColorMac.h:
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
+        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
+        * platform/graphics/mac/FloatPointMac.mm:
+        * platform/graphics/mac/FloatRectMac.mm:
+        * platform/graphics/mac/FloatSizeMac.mm:
+        * platform/graphics/mac/FontCacheMac.mm:
+        * platform/graphics/mac/FontComplexTextMac.cpp:
+        (WebCore::Font::drawComplexText):
+        (WebCore::Font::fontDataForCombiningCharacterSequence):
+        * platform/graphics/mac/FontCustomPlatformData.cpp:
+        * platform/graphics/mac/FontMac.mm:
+        (WebCore::showLetterpressedGlyphsWithAdvances):
+        (WebCore::Font::drawGlyphs):
+        * platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
+        (WebCore::GlyphPage::fill):
+        * platform/graphics/mac/GraphicsContext3DMac.mm:
+        (WebCore::GraphicsContext3D::GraphicsContext3D):
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        (WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable):
+        (WebCore::GraphicsContext3D::makeContextCurrent):
+        (WebCore::GraphicsContext3D::endPaint):
+        * platform/graphics/mac/GraphicsContextMac.mm:
+        (WebCore::GraphicsContext::drawFocusRing):
+        (WebCore::createDotPattern):
+        (WebCore::GraphicsContext::drawLineForDocumentMarker):
+        * platform/graphics/mac/IconMac.mm:
+        * platform/graphics/mac/ImageMac.mm:
+        (WebCore::BitmapImage::invalidatePlatformData):
+        * platform/graphics/mac/IntPointMac.mm:
+        * platform/graphics/mac/IntRectMac.mm:
+        * platform/graphics/mac/IntSizeMac.mm:
+        * platform/graphics/mac/MediaPlayerProxy.h:
+        * platform/graphics/mac/SimpleFontDataCoreText.cpp:
+        * platform/graphics/mac/SimpleFontDataMac.mm:
+        * platform/graphics/mac/WebGLLayer.h:
+        * platform/graphics/mac/WebGLLayer.mm:
+        (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
+        (-[WebGLLayer display]):
+        * platform/graphics/mac/WebLayer.mm:
+        (WebCore::drawLayerContents):
+        (-[WebSimpleLayer display]):
+        (-[WebSimpleLayer drawInContext:]):
+        * platform/graphics/mac/WebTiledLayer.mm:
+        (+[WebTiledLayer shouldDrawOnMainThread]):
+        (-[WebTiledLayer display]):
+        (-[WebTiledLayer drawInContext:]):
+        * platform/graphics/opengl/Extensions3DOpenGL.cpp:
+        (WebCore::Extensions3DOpenGL::blitFramebuffer):
+        (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
+        (WebCore::Extensions3DOpenGL::supportsExtension):
+        (WebCore::Extensions3DOpenGL::drawBuffersEXT):
+        * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
+        (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
+        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+        (WebCore::GraphicsContext3D::reshapeFBOs):
+        (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
+        (WebCore::GraphicsContext3D::renderbufferStorage):
+        (WebCore::GraphicsContext3D::getIntegerv):
+        (WebCore::GraphicsContext3D::texImage2D):
+        (WebCore::GraphicsContext3D::depthRange):
+        (WebCore::GraphicsContext3D::clearDepth):
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+        (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
+        * platform/graphics/transforms/TransformationMatrix.cpp:
+        (WebCore::TransformationMatrix::multiply):
+        * platform/graphics/win/FontWin.cpp:
+        (WebCore::Font::drawComplexText):
+        * platform/graphics/wince/FontWinCE.cpp:
+        (WebCore::Font::drawComplexText):
+        * platform/ios/ContentFilterIOS.mm: Copied from Source/WebCore/platform/ContentFilter.h.
+        * platform/ios/DeviceMotionClientIOS.h: Added.
+        (WebCore::DeviceMotionClientIOS::create):
+        * platform/ios/DeviceMotionClientIOS.mm: Added.
+        * platform/ios/DeviceOrientationClientIOS.h: Added.
+        (WebCore::DeviceOrientationClientIOS::create):
+        * platform/ios/DeviceOrientationClientIOS.mm: Added.
+        * platform/ios/KeyEventIOS.mm:
+        * platform/ios/MIMETypeRegistryIOS.mm: Copied from Source/WebCore/platform/network/mac/CredentialStorageMac.mm.
+        * platform/ios/MemoryPressureHandlerIOS.mm: Added.
+        * platform/ios/PasteboardIOS.mm:
+        (WebCore::Pasteboard::write):
+        (WebCore::Pasteboard::resourceMIMEType):
+        (WebCore::Pasteboard::writePlainText):
+        (WebCore::Pasteboard::read):
+        (WebCore::supportedImageTypes):
+        (WebCore::Pasteboard::supportedPasteboardTypes):
+        (WebCore::Pasteboard::hasData):
+        (WebCore::Pasteboard::readString):
+        * platform/ios/PlatformEventFactoryIOS.h: Copied from Source/WebCore/platform/mac/DisplaySleepDisabler.h.
+        * platform/ios/PlatformEventFactoryIOS.mm: Added.
+        * platform/ios/PlatformPasteboardIOS.mm:
+        (WebCore::PlatformPasteboard::write):
+        * platform/ios/PlatformScreenIOS.mm: Added.
+        * platform/ios/PlatformSpeechSynthesizerIOS.mm: Added.
+        * platform/ios/SSLKeyGeneratorIOS.cpp: Added.
+        * platform/ios/ScrollAnimatorIOS.h: Copied from Source/WebCore/platform/mac/DisplaySleepDisabler.h.
+        * platform/ios/ScrollAnimatorIOS.mm: Added.
+        * platform/ios/ScrollViewIOS.mm: Added.
+        * platform/ios/ScrollbarThemeIOS.h: Added.
+        * platform/ios/ScrollbarThemeIOS.mm: Added.
+        * platform/ios/SelectionRect.cpp: Added.
+        * platform/ios/SelectionRect.h: Added.
+        * platform/ios/SoundIOS.mm: Copied from Source/WebCore/platform/text/mac/CharsetData.h.
+        * platform/ios/SystemMemoryIOS.cpp: Added.
+        * platform/ios/ThemeIOS.h: Copied from Source/WebCore/platform/KillRingNone.cpp.
+        * platform/ios/ThemeIOS.mm: Copied from Source/WebCore/platform/KillRingNone.cpp.
+        * platform/ios/TileCache.h: Added.
+        (WebCore::TileCache::isSpeculativeTileCreationEnabled):
+        * platform/ios/TileCache.mm: Added.
+        * platform/ios/TileGrid.h: Added.
+        * platform/ios/TileGrid.mm: Added.
+        * platform/ios/TileGridTile.h: Copied from Source/WebCore/platform/ContentFilter.h.
+        * platform/ios/TileGridTile.mm: Added.
+        * platform/ios/TileLayer.h: Copied from Source/WebCore/platform/mac/DisplaySleepDisabler.h.
+        * platform/ios/TileLayer.mm: Added.
+        * platform/ios/TileLayerPool.mm: Added.
+        * platform/ios/WebCoreMotionManager.h: Copied from Source/WebCore/platform/KillRingNone.cpp.
+        * platform/ios/WebCoreMotionManager.mm: Added.
+        * platform/ios/WebCoreSystemInterfaceIOS.h: Added.
+        * platform/ios/WebCoreSystemInterfaceIOS.mm: Added.
+        * platform/ios/WebEvent.h: Added.
+        * platform/ios/WebEvent.mm: Added.
+        * platform/ios/WidgetIOS.mm: Added.
+        * platform/mac/DisplaySleepDisabler.cpp:
+        (WebCore::DisplaySleepDisabler::DisplaySleepDisabler):
+        (WebCore::DisplaySleepDisabler::~DisplaySleepDisabler):
+        * platform/mac/DisplaySleepDisabler.h:
+        * platform/mac/FileSystemMac.mm:
+        * platform/mac/KillRingMac.mm:
+        * platform/mac/MemoryPressureHandlerMac.mm:
+        (WebCore::MemoryPressureHandler::install):
+        (WebCore::MemoryPressureHandler::releaseMemory):
+        * platform/mac/PlatformClockCM.mm:
+        (PlatformClockCM::PlatformClockCM):
+        * platform/mac/SoftLinking.h:
+        * platform/mac/SystemVersionMac.mm:
+        * platform/mac/WebCoreFullScreenPlaceholderView.h:
+        * platform/mac/WebCoreFullScreenPlaceholderView.mm:
+        * platform/mac/WebCoreFullScreenWarningView.h:
+        * platform/mac/WebCoreFullScreenWarningView.mm:
+        * platform/mac/WebCoreFullScreenWindow.h:
+        * platform/mac/WebCoreFullScreenWindow.mm:
+        * platform/mac/WebCoreNSCellExtras.h:
+        * platform/mac/WebCoreNSCellExtras.m:
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebFontCache.mm:
+        (+[WebFontCache fontWithFamily:traits:size:]):
+        * platform/network/BlobRegistry.cpp:
+        * platform/network/BlobRegistryImpl.cpp:
+        * platform/network/Credential.h:
+        * platform/network/CredentialStorage.cpp:
+        (WebCore::CredentialStorage::set):
+        (WebCore::CredentialStorage::clearCredentials):
+        * platform/network/CredentialStorage.h:
+        * platform/network/NetworkStateNotifier.h:
+        * platform/network/ResourceHandle.cpp:
+        (WebCore::builtinResourceHandleConstructorMap):
+        (WebCore::ResourceHandle::continueWillSendRequest):
+        (WebCore::ResourceHandle::continueDidReceiveResponse):
+        (WebCore::ResourceHandle::continueShouldUseCredentialStorage):
+        (WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace):
+        * platform/network/ResourceRequestBase.cpp:
+        (WebCore::ResourceRequestBase::setDefaultAllowCookies):
+        (WebCore::ResourceRequestBase::defaultAllowCookies):
+        * platform/network/ResourceRequestBase.h:
+        (WebCore::ResourceRequestBase::ResourceRequestBase):
+        * platform/network/cf/CredentialStorageCFNet.cpp:
+        (WebCore::CredentialStorage::saveToPersistentStorage):
+        * platform/network/cf/DNSCFNet.cpp:
+        * platform/network/cf/ProxyServerCFNet.cpp:
+        * platform/network/cf/ResourceRequest.h:
+        (WebCore::ResourceRequest::ResourceRequest):
+        (WebCore::ResourceRequest::setMainResourceRequest):
+        (WebCore::ResourceRequest::isMainResourceRequest):
+        * platform/network/cf/ResourceRequestCFNet.cpp:
+        (WebCore::ResourceRequest::updateFromDelegatePreservingOldHTTPBody):
+        (WebCore::ResourceRequest::doUpdateResourceRequest):
+        (WebCore::ResourceRequest::applyWebArchiveHackForMail):
+        (WebCore::initializeHTTPConnectionSettingsOnStartup):
+        * platform/network/cf/SocketStreamHandleCFNet.cpp:
+        (WebCore::SocketStreamHandle::reportErrorToClient):
+        * platform/network/ios/NetworkStateNotifierIOS.cpp: Copied from Source/WebCore/platform/KillRingNone.cpp.
+        (WebCore::NetworkStateNotifier::NetworkStateNotifier):
+        (WebCore::NetworkStateNotifier::setIsOnLine):
+        * platform/network/ios/QuickLook.h: Added.
+        * platform/network/ios/QuickLook.mm: Added.
+        * platform/network/ios/ResourceHandleIOS.mm: Added.
+        * platform/network/ios/WebCoreURLResponseIOS.h: Copied from Source/WebCore/platform/graphics/StringTruncator.h.
+        * platform/network/ios/WebCoreURLResponseIOS.mm: Added.
+        * platform/network/mac/AuthenticationMac.mm:
+        (WebCore::mac):
+        * platform/network/mac/CredentialStorageMac.mm:
+        (WebCore::CredentialStorage::saveToPersistentStorage):
+        * platform/network/mac/ResourceErrorMac.mm:
+        (dictionaryThatCanCode):
+        (-[WebCustomNSURLError encodeWithCoder:]):
+        (NSErrorFromCFError):
+        (WebCore::ResourceError::nsError):
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::synchronousWillSendRequestEnabled):
+        (WebCore::ResourceHandle::createNSURLConnection):
+        (WebCore::ResourceHandle::start):
+        (WebCore::ResourceHandle::schedule):
+        (WebCore::ResourceHandle::unschedule):
+        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
+        (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
+        * platform/network/mac/ResourceRequestMac.mm:
+        (WebCore::ResourceRequest::ResourceRequest):
+        (WebCore::ResourceRequest::updateNSURLRequest):
+        (WebCore::ResourceRequest::applyWebArchiveHackForMail):
+        (WebCore::ResourceRequest::useQuickLookResourceCachingQuirks):
+        * platform/network/mac/UTIUtilities.mm:
+        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
+        (-[WebCoreResourceHandleAsDelegate connectionShouldUseCredentialStorage:]):
+        (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
+        (-[WebCoreResourceHandleAsDelegate connection:didReceiveDataArray:]):
+        (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]):
+        (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
+        (-[WebCoreResourceHandleAsDelegate connection:didFailWithError:]):
+        * platform/sql/SQLiteDatabase.h:
+        (WebCore::SQLiteDatabase::sqlite3Handle):
+        * platform/sql/SQLiteFileSystem.cpp:
+        (WebCore::SQLiteFileSystem::truncateDatabaseFile):
+        * platform/sql/SQLiteFileSystem.h:
+        * platform/sql/SQLiteTransaction.cpp:
+        (WebCore::SQLiteTransaction::begin):
+        (WebCore::SQLiteTransaction::commit):
+        (WebCore::SQLiteTransaction::rollback):
+        (WebCore::SQLiteTransaction::stop):
+        * platform/sql/ios/SQLiteDatabaseTracker.cpp: Added.
+        * platform/sql/ios/SQLiteDatabaseTracker.h: Copied from Source/WebCore/platform/MemoryPressureHandler.cpp.
+        * platform/sql/ios/SQLiteDatabaseTrackerClient.h: Copied from Source/WebCore/platform/KillRingNone.cpp.
+        * platform/text/PlatformLocale.cpp:
+        * platform/text/PlatformLocale.h:
+        * platform/text/TextBreakIteratorICU.cpp:
+        (WebCore::cursorMovementIterator):
+        * platform/text/TextCodecICU.cpp:
+        (WebCore::TextCodecICU::registerEncodingNames):
+        (WebCore::TextCodecICU::registerCodecs):
+        * platform/text/TextEncodingRegistry.cpp:
+        (WebCore::extendTextCodecMaps):
+        * platform/text/cf/HyphenationCF.cpp:
+        (WebCore::canHyphenate):
+        * platform/text/ios/LocalizedDateCache.h: Copied from Source/WebCore/platform/MemoryPressureHandler.h.
+        * platform/text/ios/LocalizedDateCache.mm: Added.
+        * platform/text/mac/CharsetData.h:
+        * platform/text/mac/LocaleMac.h:
+        * platform/text/mac/LocaleMac.mm:
+        (WebCore::LocaleMac::formatDateTime):
+        (WebCore::LocaleMac::maximumWidthForDateType):
+        * platform/text/mac/TextBoundaries.mm:
+        (WebCore::isSkipCharacter):
+        (WebCore::isWhitespaceCharacter):
+        (WebCore::isWordDelimitingCharacter):
+        (WebCore::isSymbolCharacter):
+        (WebCore::isAmbiguousBoundaryCharacter):
+        (WebCore::tokenizerForString):
+        (WebCore::findSimpleWordBoundary):
+        (WebCore::findComplexWordBoundary):
+        (WebCore::findWordBoundary):
+        (WebCore::findNextWordFromIndex):
+        * platform/text/mac/TextCodecMac.cpp:
+        * platform/text/mac/TextCodecMac.h:
+
</ins><span class="cx"> 2014-01-09  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Consolidate developerExtrasEnabled to just InspectorEnvironment
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -1917,6 +1917,9 @@
</span><span class="cx"> _wkSignalCFReadStreamError
</span><span class="cx"> _wkSignalCFReadStreamHasBytes
</span><span class="cx"> 
</span><ins>+__ZN7WebCore27applicationIsAdobeInstallerEv
+__ZN7WebCore27applicationIsMicrosoftMyDayEv
+
</ins><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> .objc_class_name_DOMAttr
</span><span class="cx"> .objc_class_name_DOMCDATASection
</span><span class="lines">@@ -2045,8 +2048,6 @@
</span><span class="cx"> __ZN7WebCore26contextMenuItemTagOpenLinkEv
</span><span class="cx"> __ZN7WebCore26pdfDocumentTypeDescriptionEv
</span><span class="cx"> __ZN7WebCore26usesTestModeFocusRingColorEv
</span><del>-__ZN7WebCore27applicationIsAdobeInstallerEv
-__ZN7WebCore27applicationIsMicrosoftMyDayEv
</del><span class="cx"> __ZN7WebCore27contextMenuItemTagShowFontsEv
</span><span class="cx"> __ZN7WebCore27contextMenuItemTagUnderlineEv
</span><span class="cx"> __ZN7WebCore28contextMenuItemTagCapitalizeEv
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -170,6 +170,8 @@
</span><span class="cx">                 073BE34E17D180B2002BD431 /* RTCSessionDescriptionDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BAB17CF0AD400848E51 /* RTCSessionDescriptionDescriptor.cpp */; };
</span><span class="cx">                 073BE34F17D18183002BD431 /* RTCIceCandidateDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BA617CF0AD400848E51 /* RTCIceCandidateDescriptor.cpp */; };
</span><span class="cx">                 073BE35017D181A6002BD431 /* RTCPeerConnectionHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221BA817CF0AD400848E51 /* RTCPeerConnectionHandler.cpp */; };
</span><ins>+                074300A50F4B8BCF008076CD /* MediaPlayerPrivateIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 074300A30F4B8BCF008076CD /* MediaPlayerPrivateIOS.mm */; };
+                074300A60F4B8BCF008076CD /* MediaPlayerPrivateIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 074300A40F4B8BCF008076CD /* MediaPlayerPrivateIOS.h */; };
</ins><span class="cx">                 0753860214489E9800B78452 /* CachedTextTrack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0753860014489E9800B78452 /* CachedTextTrack.cpp */; };
</span><span class="cx">                 0753860314489E9800B78452 /* CachedTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 0753860114489E9800B78452 /* CachedTextTrack.h */; };
</span><span class="cx">                 076306D017E1478D005A7C4E /* MediaStreamTrackSourcesCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 076306CC17E1478D005A7C4E /* MediaStreamTrackSourcesCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -333,6 +335,8 @@
</span><span class="cx">                 07DC5FD417D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07DC5FD317D3EEE90099F890 /* JSRTCStatsResponseCustom.cpp */; };
</span><span class="cx">                 07E116B11489C9A100EC5ACE /* JSTextTrackCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07E116B01489C9A100EC5ACE /* JSTextTrackCustom.cpp */; };
</span><span class="cx">                 07E117071489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07E117061489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp */; };
</span><ins>+                07ED35A216D6DCC9002248F3 /* InbandTextTrackPrivateAVFIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07357C7716D2DF0D00ED99E7 /* InbandTextTrackPrivateAVFIOS.mm */; };
+                07ED35A316D6DCE2002248F3 /* InbandTextTrackPrivateAVFIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 07357C7616D2DF0D00ED99E7 /* InbandTextTrackPrivateAVFIOS.h */; };
</ins><span class="cx">                 07F944161864D046005D31CB /* MediaSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAE8C081746B95700532D78 /* MediaSessionManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 07FFDE68181AED420072D409 /* MediaStreamTrackPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07FFDE66181AED420072D409 /* MediaStreamTrackPrivate.cpp */; };
</span><span class="cx">                 07FFDE69181AED420072D409 /* MediaStreamTrackPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FFDE67181AED420072D409 /* MediaStreamTrackPrivate.h */; };
</span><span class="lines">@@ -451,6 +455,8 @@
</span><span class="cx">                 0F13163E16ED0CC80035CC04 /* PlatformCAFilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F13163D16ED0CC80035CC04 /* PlatformCAFilters.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F13164016ED0CDE0035CC04 /* PlatformCAFiltersMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersMac.mm */; };
</span><span class="cx">                 0F15DA8A0F3AAEE70000CE47 /* AnimationControllerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15DA890F3AAEE70000CE47 /* AnimationControllerPrivate.h */; };
</span><ins>+                0F1774801378B772009DA76A /* ScrollAnimatorIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F17747E1378B771009DA76A /* ScrollAnimatorIOS.h */; };
+                0F1774811378B772009DA76A /* ScrollAnimatorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F17747F1378B772009DA76A /* ScrollAnimatorIOS.mm */; };
</ins><span class="cx">                 0F29C16E1300C2E2002D794E /* AccessibilityAllInOne.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F29C16D1300C2E2002D794E /* AccessibilityAllInOne.cpp */; };
</span><span class="cx">                 0F3DD44F12F5EA1B000D9190 /* ShadowBlur.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F3DD44D12F5EA1B000D9190 /* ShadowBlur.cpp */; };
</span><span class="cx">                 0F3DD45012F5EA1B000D9190 /* ShadowBlur.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F3DD44E12F5EA1B000D9190 /* ShadowBlur.h */; };
</span><span class="lines">@@ -475,6 +481,7 @@
</span><span class="cx">                 0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0F6383DD18615B29003E5DB5 /* ThreadedScrollingTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6383DB18615B29003E5DB5 /* ThreadedScrollingTree.cpp */; };
</span><span class="cx">                 0F6383DE18615B29003E5DB5 /* ThreadedScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6383DC18615B29003E5DB5 /* ThreadedScrollingTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                0F97A658155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F97A657155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm */; };
</ins><span class="cx">                 0FA24D79162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FA24D77162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp */; };
</span><span class="cx">                 0FA24D7A162DF91900A3F4C0 /* GraphicsLayerUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 0FA88EBD16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FA88EBC16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm */; };
</span><span class="lines">@@ -886,6 +893,7 @@
</span><span class="cx">                 1F3C3BEA135CAF3C00B8C1AC /* MediaControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1F3C3BE8135CAF3C00B8C1AC /* MediaControls.cpp */; };
</span><span class="cx">                 1F3C3BEB135CAF3C00B8C1AC /* MediaControls.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F3C3BE9135CAF3C00B8C1AC /* MediaControls.h */; };
</span><span class="cx">                 1F3F19531499CA7600A5AEA7 /* PODFreeListArena.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F3F19521499CA7600A5AEA7 /* PODFreeListArena.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                1F68D4AE14BB9DCA007B5C62 /* MemoryPressureHandlerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F68D4AD14BB9DCA007B5C62 /* MemoryPressureHandlerIOS.mm */; };
</ins><span class="cx">                 1FAFBF1815A5FA6E00083A20 /* UTIUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1FAFBF1715A5FA5200083A20 /* UTIUtilities.mm */; };
</span><span class="cx">                 1FAFBF1915A5FA7400083A20 /* UTIUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FAFBF1615A5FA5200083A20 /* UTIUtilities.h */; };
</span><span class="cx">                 1FC40FB91655CCB60040F29E /* SubimageCacheWithTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1FC40FB81655C5910040F29E /* SubimageCacheWithTimer.cpp */; };
</span><span class="lines">@@ -917,6 +925,8 @@
</span><span class="cx">                 265541391489811C000DFC5D /* KeyEventCodesIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 265541371489811C000DFC5D /* KeyEventCodesIOS.h */; };
</span><span class="cx">                 2655413A1489811C000DFC5D /* KeyEventIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 265541381489811C000DFC5D /* KeyEventIOS.mm */; };
</span><span class="cx">                 265541521489B233000DFC5D /* CursorIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2655414B1489AA2B000DFC5D /* CursorIOS.cpp */; };
</span><ins>+                26601EBF14B3B9AD0012C0FE /* PlatformEventFactoryIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 26601EBD14B3B9AD0012C0FE /* PlatformEventFactoryIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                26601EC014B3B9AD0012C0FE /* PlatformEventFactoryIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26601EBE14B3B9AD0012C0FE /* PlatformEventFactoryIOS.mm */; };
</ins><span class="cx">                 269239961505E1AA009E57FC /* JSIDBVersionChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 269239921505E1AA009E57FC /* JSIDBVersionChangeEvent.h */; };
</span><span class="cx">                 26B9998F1803AE7200D01121 /* RegisterAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B9998E1803AE7200D01121 /* RegisterAllocator.h */; };
</span><span class="cx">                 26B999911803B3C900D01121 /* StackAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B999901803B3C900D01121 /* StackAllocator.h */; };
</span><span class="lines">@@ -933,6 +943,7 @@
</span><span class="cx">                 26FAE4CD1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 26FAE4C91852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h */; };
</span><span class="cx">                 26FAE4CE1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FAE4CA1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.cpp */; };
</span><span class="cx">                 26FAE4CF1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 26FAE4CB1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.h */; };
</span><ins>+                2903716516BA11BC00FEFDF0 /* ContentFilterIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2903716416BA11BC00FEFDF0 /* ContentFilterIOS.mm */; };
</ins><span class="cx">                 2917B5611473496C0052C9D0 /* LayerFlushScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */; };
</span><span class="cx">                 2917B5621473496C0052C9D0 /* LayerFlushScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -1085,6 +1096,10 @@
</span><span class="cx">                 31313F651443B35F006E2A90 /* FilterEffectRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31313F631443B35E006E2A90 /* FilterEffectRenderer.cpp */; };
</span><span class="cx">                 31313F661443B35F006E2A90 /* FilterEffectRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 31313F641443B35E006E2A90 /* FilterEffectRenderer.h */; };
</span><span class="cx">                 3138A9E51474434600B0ED12 /* StyleShader.h in Headers */ = {isa = PBXBuildFile; fileRef = 3138A9E41474434600B0ED12 /* StyleShader.h */; };
</span><ins>+                3140379B124BEA7F00AF40E4 /* WebCoreMotionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 31403797124BEA7F00AF40E4 /* WebCoreMotionManager.h */; };
+                3140379C124BEA7F00AF40E4 /* WebCoreMotionManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31403798124BEA7F00AF40E4 /* WebCoreMotionManager.mm */; };
+                3140379D124BEA7F00AF40E4 /* DeviceOrientationClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 31403799124BEA7F00AF40E4 /* DeviceOrientationClientIOS.h */; };
+                3140379E124BEA7F00AF40E4 /* DeviceOrientationClientIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3140379A124BEA7F00AF40E4 /* DeviceOrientationClientIOS.mm */; };
</ins><span class="cx">                 3146FE6E184420A8001A937C /* OESTextureFloatLinear.h in Headers */ = {isa = PBXBuildFile; fileRef = 3146FE6618442087001A937C /* OESTextureFloatLinear.h */; };
</span><span class="cx">                 3146FE6F184420AA001A937C /* OESTextureFloatLinear.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3146FE6518442087001A937C /* OESTextureFloatLinear.cpp */; };
</span><span class="cx">                 3146FE7418442370001A937C /* JSOESTextureFloatLinear.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3146FE7018442367001A937C /* JSOESTextureFloatLinear.cpp */; };
</span><span class="lines">@@ -1122,6 +1137,7 @@
</span><span class="cx">                 319AE063142D6B24006563A1 /* StyleFilterData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 319AE061142D6B24006563A1 /* StyleFilterData.cpp */; };
</span><span class="cx">                 319AE064142D6B24006563A1 /* StyleFilterData.h in Headers */ = {isa = PBXBuildFile; fileRef = 319AE062142D6B24006563A1 /* StyleFilterData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 319FBD5F15D2F464009640A6 /* CachedImageClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 319FBD5D15D2F444009640A6 /* CachedImageClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                31AB5000122878A2001A7DB0 /* GraphicsContext3DIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 31AB4FFF122878A2001A7DB0 /* GraphicsContext3DIOS.h */; };
</ins><span class="cx">                 31C0FF210E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF1B0E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp */; };
</span><span class="cx">                 31C0FF220E4CEB6E007D6FE5 /* WebKitAnimationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF1C0E4CEB6E007D6FE5 /* WebKitAnimationEvent.h */; };
</span><span class="cx">                 31C0FF240E4CEB6E007D6FE5 /* WebKitTransitionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF1E0E4CEB6E007D6FE5 /* WebKitTransitionEvent.cpp */; };
</span><span class="lines">@@ -1137,6 +1153,8 @@
</span><span class="cx">                 31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31C0FF470E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm */; };
</span><span class="cx">                 31C0FF4E0E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */; };
</span><span class="cx">                 31D591B316697A6C00E6BF02 /* PlugInClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D591B116697A6C00E6BF02 /* PlugInClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                31EAF97E121435A400E7C1BF /* DeviceMotionClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 31EAF97C121435A400E7C1BF /* DeviceMotionClientIOS.h */; };
+                31EAF97F121435A400E7C1BF /* DeviceMotionClientIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31EAF97D121435A400E7C1BF /* DeviceMotionClientIOS.mm */; };
</ins><span class="cx">                 31EC1E2814FF60EE00C94662 /* JSNotificationPermissionCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31EC1E2614FF60EE00C94662 /* JSNotificationPermissionCallback.cpp */; };
</span><span class="cx">                 31EC1E2914FF60EE00C94662 /* JSNotificationPermissionCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 31EC1E2714FF60EE00C94662 /* JSNotificationPermissionCallback.h */; };
</span><span class="cx">                 31FB1A57120A5D0600DC02A0 /* DeviceMotionClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31FB1A4F120A5D0600DC02A0 /* DeviceMotionClient.h */; };
</span><span class="lines">@@ -1177,6 +1195,7 @@
</span><span class="cx">                 371F53E90D2704F900ECE0D5 /* CSSUnicodeRangeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F53E70D2704F900ECE0D5 /* CSSUnicodeRangeValue.h */; };
</span><span class="cx">                 371F53EA0D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F53E80D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp */; };
</span><span class="cx">                 37202199106213C600F25C4B /* FontSmoothingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 37202198106213C600F25C4B /* FontSmoothingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                3727DFD5142AAE4500D449CB /* FontCacheIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3727DFD4142AAE4500D449CB /* FontCacheIOS.mm */; };
</ins><span class="cx">                 372C00C4129611F1005C9575 /* TextBoundaries.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 372C00C3129611F1005C9575 /* TextBoundaries.cpp */; };
</span><span class="cx">                 372C00D9129619F8005C9575 /* FindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 372C00D8129619F8005C9575 /* FindOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 3744570F0DB05FA500AE0992 /* SVGGlyphMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 3744570E0DB05FA500AE0992 /* SVGGlyphMap.h */; };
</span><span class="lines">@@ -1211,6 +1230,7 @@
</span><span class="cx">                 37DDCDA71384501C0008B793 /* MHTMLParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 37DDCDA31384501C0008B793 /* MHTMLParser.h */; };
</span><span class="cx">                 37E3524B12450C5200BAF5D9 /* InputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37E3524A12450C5200BAF5D9 /* InputType.cpp */; };
</span><span class="cx">                 37E3524D12450C6600BAF5D9 /* InputType.h in Headers */ = {isa = PBXBuildFile; fileRef = 37E3524C12450C6600BAF5D9 /* InputType.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                37E65950163B10C200EB4574 /* SimpleFontDataIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37E6594F163B10C200EB4574 /* SimpleFontDataIOS.mm */; };
</ins><span class="cx">                 37F567CE165358F400DDE92B /* PopupOpeningObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 3772B09516535856000A49CA /* PopupOpeningObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 37F818FD0D657606005E1F05 /* WebCoreURLResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F818FB0D657606005E1F05 /* WebCoreURLResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 37F818FE0D657606005E1F05 /* WebCoreURLResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37F818FC0D657606005E1F05 /* WebCoreURLResponse.mm */; };
</span><span class="lines">@@ -1395,11 +1415,16 @@
</span><span class="cx">                 441B055E0CD77A48007C1F18 /* DOMHTMLIFrameElementPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 4429AAFD0CB84EA5007647C5 /* DOMHTMLIFrameElementPrivate.h */; };
</span><span class="cx">                 441B05600CD77A65007C1F18 /* DOMHTMLObjectElementPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 4429AAFF0CB84EC3007647C5 /* DOMHTMLObjectElementPrivate.h */; };
</span><span class="cx">                 442ABCD617D9262F00D30715 /* SynchronousLoaderClientCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 442ABCD517D9262F00D30715 /* SynchronousLoaderClientCFNet.cpp */; };
</span><ins>+                442AF7A9102CDDEA008FD4D3 /* QuickLook.h in Headers */ = {isa = PBXBuildFile; fileRef = 442AF7A7102CDDEA008FD4D3 /* QuickLook.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                442AF7AA102CDDEA008FD4D3 /* QuickLook.mm in Sources */ = {isa = PBXBuildFile; fileRef = 442AF7A8102CDDEA008FD4D3 /* QuickLook.mm */; };
</ins><span class="cx">                 44311CD612E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 44311CD412E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h */; };
</span><span class="cx">                 44311CD712E4E22D000A8D19 /* DOMDocumentPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 44311CD512E4E22D000A8D19 /* DOMDocumentPrivate.h */; };
</span><span class="cx">                 44311CD812E4E24B000A8D19 /* DOMDocumentPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 44311CD512E4E22D000A8D19 /* DOMDocumentPrivate.h */; };
</span><span class="cx">                 44311CD912E4E257000A8D19 /* DOMDocumentFragmentPrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 44311CD412E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h */; };
</span><span class="cx">                 44311F8212E4E66C000A8D19 /* DOMDocumentFragmentInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 85E711450AC5D5340053270F /* DOMDocumentFragmentInternal.h */; };
</span><ins>+                443F04270E75C8FB007E5407 /* NetworkStateNotifierIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 443F04260E75C8FB007E5407 /* NetworkStateNotifierIOS.cpp */; };
+                444D4E230F708B2E003158E0 /* WebCoreURLResponseIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */; };
+                4476531B133170990006B789 /* SSLKeyGeneratorIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4476531A133170990006B789 /* SSLKeyGeneratorIOS.cpp */; };
</ins><span class="cx">                 447958041643B49A001E0A7F /* ParsedContentType.h in Headers */ = {isa = PBXBuildFile; fileRef = 447958031643B47B001E0A7F /* ParsedContentType.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 447958051643B4B2001E0A7F /* ParsedContentType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 447958021643B47B001E0A7F /* ParsedContentType.cpp */; };
</span><span class="cx">                 448A29BF0A46D9CB0030759F /* JSHTMLOptionsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 448A29BD0A46D9CB0030759F /* JSHTMLOptionsCollection.h */; };
</span><span class="lines">@@ -1411,8 +1436,16 @@
</span><span class="cx">                 4496E3A0139813A5003EE32A /* JSSVGMPathElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4496E39F139813A5003EE32A /* JSSVGMPathElement.h */; };
</span><span class="cx">                 4496E3A2139813CB003EE32A /* JSSVGMPathElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4496E3A1139813CB003EE32A /* JSSVGMPathElement.cpp */; };
</span><span class="cx">                 449B19F50FA72ECE0015CA4A /* HTMLParserQuirks.h in Headers */ = {isa = PBXBuildFile; fileRef = 449B19F30FA72ECE0015CA4A /* HTMLParserQuirks.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                44A20DB90F84166C00B3E1FE /* WebCoreURLResponseIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A20DB80F84166C00B3E1FE /* WebCoreURLResponseIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 44A28AAC12DFB8AC00AE923B /* MathMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A28AAB12DFB8AC00AE923B /* MathMLElementFactory.h */; };
</span><span class="cx">                 44A28AAF12DFB8BF00AE923B /* MathMLNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A28AAE12DFB8BF00AE923B /* MathMLNames.h */; };
</span><ins>+                44C363F00FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C363EE0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                44C363F10FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 44C363EF0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm */; };
+                44C3CFE81556BE5D00013609 /* WebCoreSystemInterfaceIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C3CFE71556BE5D00013609 /* WebCoreSystemInterfaceIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                44C991820F3D1E0D00586670 /* ScrollbarThemeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 44C991810F3D1E0D00586670 /* ScrollbarThemeIOS.mm */; };
+                44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C991850F3D1EBE00586670 /* ScrollbarThemeIOS.h */; };
+                44C9919F0F3D210E00586670 /* ThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C9919D0F3D210E00586670 /* ThemeIOS.h */; };
+                44C991A00F3D210E00586670 /* ThemeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 44C9919E0F3D210E00586670 /* ThemeIOS.mm */; };
</ins><span class="cx">                 44DAB5B115A623580097C1E4 /* Extensions3DOpenGLCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44DAB5AF15A623580097C1E4 /* Extensions3DOpenGLCommon.cpp */; };
</span><span class="cx">                 44DAB5B215A623580097C1E4 /* Extensions3DOpenGLCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 44DAB5B015A623580097C1E4 /* Extensions3DOpenGLCommon.h */; };
</span><span class="cx">                 45099C411370A7800058D513 /* IconURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45099C401370A7800058D513 /* IconURL.cpp */; };
</span><span class="lines">@@ -2237,8 +2270,12 @@
</span><span class="cx">                 7E12E91015FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E12E90E15FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp */; };
</span><span class="cx">                 7E33CD01127F340D00BE8F17 /* PurgePriority.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E33CD00127F340D00BE8F17 /* PurgePriority.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7E37EF2E1339208800B29250 /* SubresourceLoaderCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */; };
</span><ins>+                7E428CE513E3407F003B661C /* ResourceHandleIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E428CE413E3407F003B661C /* ResourceHandleIOS.mm */; };
</ins><span class="cx">                 7E46F6FA1627A2CA00062223 /* JSOESElementIndexUint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */; };
</span><span class="cx">                 7E46F6FB1627A2CA00062223 /* JSOESElementIndexUint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */; };
</span><ins>+                7E474E1E12494DC900235364 /* SQLiteDatabaseTrackerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                7E474E1F12494DC900235364 /* SQLiteDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                7E474E2012494DC900235364 /* SQLiteDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */; };
</ins><span class="cx">                 7E5D7A76161D3F8F00896C34 /* OESElementIndexUint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */; };
</span><span class="cx">                 7E5D7A77161D3F8F00896C34 /* OESElementIndexUint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */; };
</span><span class="cx">                 7E66E23316D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E66E23116D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp */; };
</span><span class="lines">@@ -3536,6 +3573,8 @@
</span><span class="cx">                 A502C5DF13049B3500FC7D53 /* WebSafeGCActivityCallbackIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A502C5DD13049B3500FC7D53 /* WebSafeGCActivityCallbackIOS.h */; };
</span><span class="cx">                 A513B3D7114B1666001C429B /* KeyEventCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A5C974CF11485FF10066F2AB /* KeyEventCocoa.h */; };
</span><span class="cx">                 A513B3D8114B166A001C429B /* KeyEventCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5C974D011485FF10066F2AB /* KeyEventCocoa.mm */; };
</span><ins>+                A516E8B7136E04DB0076C3C0 /* LocalizedDateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A516E8B4136E04DB0076C3C0 /* LocalizedDateCache.h */; };
+                A516E8B8136E04DB0076C3C0 /* LocalizedDateCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = A516E8B5136E04DB0076C3C0 /* LocalizedDateCache.mm */; };
</ins><span class="cx">                 A54A82EC15228D2F00C72BA6 /* DOMNodePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */; };
</span><span class="cx">                 A54A82F115228DF600C72BA6 /* DOMNodePrivate.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = A54A82EA15228CA300C72BA6 /* DOMNodePrivate.h */; };
</span><span class="cx">                 A5732B0A136A161D005C8D7C /* DateComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5732B08136A161D005C8D7C /* DateComponents.cpp */; };
</span><span class="lines">@@ -4010,6 +4049,7 @@
</span><span class="cx">                 A9D248070D757E7D00FDF959 /* JSDOMMimeType.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D248030D757E7D00FDF959 /* JSDOMMimeType.h */; };
</span><span class="cx">                 A9D248080D757E7D00FDF959 /* JSDOMMimeTypeArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9D248040D757E7D00FDF959 /* JSDOMMimeTypeArray.cpp */; };
</span><span class="cx">                 A9D248090D757E7D00FDF959 /* JSDOMMimeTypeArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D248050D757E7D00FDF959 /* JSDOMMimeTypeArray.h */; };
</span><ins>+                AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerIOS.mm */; };
</ins><span class="cx">                 AA21ECCA0ABF0FBA002B834C /* CSSCursorImageValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA0978ED0ABAA6E100874480 /* CSSCursorImageValue.cpp */; };
</span><span class="cx">                 AA21ECCD0ABF0FC6002B834C /* CSSCursorImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AA0978EE0ABAA6E100874480 /* CSSCursorImageValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 AA2A5ACD16A485FA00975A25 /* SpeechSynthesisVoice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AA2A5AC616A485D500975A25 /* SpeechSynthesisVoice.cpp */; };
</span><span class="lines">@@ -5259,6 +5299,8 @@
</span><span class="cx">                 BE8EF04C171C9014009B48C3 /* JSVideoTrackList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE8EF048171C9014009B48C3 /* JSVideoTrackList.cpp */; };
</span><span class="cx">                 BE8EF04D171C9014009B48C3 /* JSVideoTrackList.h in Headers */ = {isa = PBXBuildFile; fileRef = BE8EF049171C9014009B48C3 /* JSVideoTrackList.h */; };
</span><span class="cx">                 BE913D80181EF92400DCB09E /* TrackPrivateBase.h in Headers */ = {isa = PBXBuildFile; fileRef = BE913D7F181EF8E500DCB09E /* TrackPrivateBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                BEA807C80F714A0300524199 /* SelectionRect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA807C60F714A0300524199 /* SelectionRect.cpp */; };
+                BEA807C90F714A0300524199 /* SelectionRect.h in Headers */ = {isa = PBXBuildFile; fileRef = BEA807C70F714A0300524199 /* SelectionRect.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 BEF29EEB1715DD0900C4B4C9 /* AudioTrackPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BEF29EE91715DD0900C4B4C9 /* AudioTrackPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BEF29EEC1715DD0900C4B4C9 /* VideoTrackPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = BEF29EEA1715DD0900C4B4C9 /* VideoTrackPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C046E1AC1208A9FE00BA2CF7 /* LocalizedStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C046E1AB1208A9FE00BA2CF7 /* LocalizedStrings.cpp */; };
</span><span class="lines">@@ -5302,6 +5344,8 @@
</span><span class="cx">                 C55E38C010040D5D00A56BDB /* StorageNamespaceImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C55E38BC10040D5D00A56BDB /* StorageNamespaceImpl.cpp */; };
</span><span class="cx">                 C572EE1F1201C9BC007D8F82 /* JSIDBIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = C572EE1D1201C9BC007D8F82 /* JSIDBIndex.h */; };
</span><span class="cx">                 C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C57FEDE01212EE9C0097BE65 /* FileSystem.cpp */; };
</span><ins>+                C58361A91744523F00173511 /* FontServicesIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C58361A71744523F00173511 /* FontServicesIOS.h */; };
+                C58361AA1744523F00173511 /* FontServicesIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C58361A81744523F00173511 /* FontServicesIOS.mm */; };
</ins><span class="cx">                 C585A66211D4FAC5004C3E4B /* IDBBindingUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C585A66011D4FAC5004C3E4B /* IDBBindingUtilities.cpp */; };
</span><span class="cx">                 C585A66311D4FAC5004C3E4B /* IDBBindingUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = C585A66111D4FAC5004C3E4B /* IDBBindingUtilities.h */; };
</span><span class="cx">                 C585A67D11D4FB08004C3E4B /* JSIDBAny.h in Headers */ = {isa = PBXBuildFile; fileRef = C585A66511D4FB07004C3E4B /* JSIDBAny.h */; };
</span><span class="lines">@@ -5375,6 +5419,8 @@
</span><span class="cx">                 CD54A763180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CD54A761180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h */; };
</span><span class="cx">                 CD54DE4717468B6F005E5B36 /* MediaSessionManagerMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4517468B6F005E5B36 /* MediaSessionManagerMac.cpp */; };
</span><span class="cx">                 CD54DE4B17469C6D005E5B36 /* AudioSessionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */; };
</span><ins>+                CD5596911475B678001D0BD0 /* AudioFileReaderIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD55968F1475B678001D0BD0 /* AudioFileReaderIOS.cpp */; };
+                CD5596921475B678001D0BD0 /* AudioFileReaderIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5596901475B678001D0BD0 /* AudioFileReaderIOS.h */; };
</ins><span class="cx">                 CD61FE671794AADB004101EB /* MediaSourceRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B1A942E115B5CE2200D525D1 /* MediaSourceRegistry.cpp */; };
</span><span class="cx">                 CD61FE681794AADB004101EB /* MediaSourceRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = B1A942E215B5CE2200D525D1 /* MediaSourceRegistry.h */; };
</span><span class="cx">                 CD641EB31818F5ED00EE4C41 /* MediaSourcePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CD641EB11818F5ED00EE4C41 /* MediaSourcePrivate.h */; };
</span><span class="lines">@@ -5439,6 +5485,7 @@
</span><span class="cx">                 CDC8B5AA18047FF10016E685 /* SourceBufferPrivateAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC8B5A818047FF10016E685 /* SourceBufferPrivateAVFObjC.mm */; };
</span><span class="cx">                 CDC8B5AB18047FF10016E685 /* SourceBufferPrivateAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5A918047FF10016E685 /* SourceBufferPrivateAVFObjC.h */; };
</span><span class="cx">                 CDC8B5AD1804AE5D0016E685 /* SourceBufferPrivateClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */; };
</span><ins>+                CDCA82961679100F00875714 /* TextTrackRepresentationIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA82941679100F00875714 /* TextTrackRepresentationIOS.mm */; };
</ins><span class="cx">                 CDD525D7145B6DD0008D204D /* JSHTMLMediaElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDF65CCC145B6AFE00C4C7AA /* JSHTMLMediaElementCustom.cpp */; };
</span><span class="cx">                 CDD7089618359F6F002B3DC6 /* SampleMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDD7089418359F6E002B3DC6 /* SampleMap.cpp */; };
</span><span class="cx">                 CDD7089718359F6F002B3DC6 /* SampleMap.h in Headers */ = {isa = PBXBuildFile; fileRef = CDD7089518359F6F002B3DC6 /* SampleMap.h */; };
</span><span class="lines">@@ -5795,6 +5842,8 @@
</span><span class="cx">                 E1FF8F6C180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */; };
</span><span class="cx">                 E1FF8F6D180DB5BE00132674 /* CryptoAlgorithmRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */; };
</span><span class="cx">                 E401C27517CE53EC00C41A35 /* ElementIteratorAssertions.h in Headers */ = {isa = PBXBuildFile; fileRef = E401C27417CE53EC00C41A35 /* ElementIteratorAssertions.h */; };
</span><ins>+                E424A39E1330DF0100CF6DC9 /* TileGridTile.h in Headers */ = {isa = PBXBuildFile; fileRef = E424A39D1330DF0100CF6DC9 /* TileGridTile.h */; };
+                E424A3A01330DF1E00CF6DC9 /* TileGridTile.mm in Sources */ = {isa = PBXBuildFile; fileRef = E424A39F1330DF1E00CF6DC9 /* TileGridTile.mm */; };
</ins><span class="cx">                 E425A49A18292B840020CFCF /* CollectionIndexCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E425A49918292B840020CFCF /* CollectionIndexCache.h */; };
</span><span class="cx">                 E4295FA412B0614E00D1ACE0 /* ResourceLoadPriority.h in Headers */ = {isa = PBXBuildFile; fileRef = E4295FA312B0614E00D1ACE0 /* ResourceLoadPriority.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E43105B816750F0C00DB2FB8 /* NodeTraversal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E43105B716750F0C00DB2FB8 /* NodeTraversal.cpp */; };
</span><span class="lines">@@ -5840,8 +5889,15 @@
</span><span class="cx">                 E44EE3A817577EBD00EEE8CF /* FontGenericFamilies.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E44EE3A617576E5500EEE8CF /* FontGenericFamilies.cpp */; };
</span><span class="cx">                 E45322AB140CE267005A0F92 /* SelectorQuery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45322A9140CE267005A0F92 /* SelectorQuery.cpp */; };
</span><span class="cx">                 E45322AC140CE267005A0F92 /* SelectorQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = E45322AA140CE267005A0F92 /* SelectorQuery.h */; };
</span><ins>+                E453901D0EAFCACA003695C8 /* MIMETypeRegistryIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390180EAFCACA003695C8 /* MIMETypeRegistryIOS.mm */; };
</ins><span class="cx">                 E453901E0EAFCACA003695C8 /* PasteboardIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390190EAFCACA003695C8 /* PasteboardIOS.mm */; };
</span><ins>+                E45390430EAFD637003695C8 /* PlatformScreenIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390320EAFD637003695C8 /* PlatformScreenIOS.mm */; };
+                E45390450EAFD637003695C8 /* ScrollViewIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390340EAFD637003695C8 /* ScrollViewIOS.mm */; };
</ins><span class="cx">                 E45390460EAFD637003695C8 /* SharedTimerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390350EAFD637003695C8 /* SharedTimerIOS.mm */; };
</span><ins>+                E45390470EAFD637003695C8 /* SoundIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390360EAFD637003695C8 /* SoundIOS.mm */; };
+                E45390490EAFD637003695C8 /* WebCoreSystemInterfaceIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390380EAFD637003695C8 /* WebCoreSystemInterfaceIOS.mm */; };
+                E453904D0EAFD637003695C8 /* WidgetIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E453903C0EAFD637003695C8 /* WidgetIOS.mm */; };
+                E45390AE0EAFF4B5003695C8 /* SystemMemoryIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45390AD0EAFF4B5003695C8 /* SystemMemoryIOS.cpp */; };
</ins><span class="cx">                 E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E462A4A0113E71BE004A4220 /* IntPointHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E46A2B1C17CA65B9000DBCD8 /* ElementDescendantIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E46A2B1B17CA65B9000DBCD8 /* ElementDescendantIterator.h */; };
</span><span class="cx">                 E46A2B1E17CA76B1000DBCD8 /* ElementChildIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E46A2B1D17CA76B1000DBCD8 /* ElementChildIterator.h */; };
</span><span class="lines">@@ -5868,6 +5924,10 @@
</span><span class="cx">                 E4AFD00E0DAF335500F5F55C /* SMILTimeContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFD0080DAF335400F5F55C /* SMILTimeContainer.h */; };
</span><span class="cx">                 E4AFD00F0DAF335500F5F55C /* SVGSMILElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4AFD0090DAF335400F5F55C /* SVGSMILElement.cpp */; };
</span><span class="cx">                 E4AFD0100DAF335500F5F55C /* SVGSMILElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFD00A0DAF335400F5F55C /* SVGSMILElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                E4B65A58132FA8E70070E7BE /* TileGrid.h in Headers */ = {isa = PBXBuildFile; fileRef = E4B65A57132FA8E70070E7BE /* TileGrid.h */; };
+                E4B65A5A132FAAF90070E7BE /* TileGrid.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4B65A59132FAAF90070E7BE /* TileGrid.mm */; };
+                E4B65A5C132FACB00070E7BE /* TileLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E4B65A5B132FACB00070E7BE /* TileLayer.h */; };
+                E4B65A5E132FADB60070E7BE /* TileLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4B65A5D132FADB60070E7BE /* TileLayer.mm */; };
</ins><span class="cx">                 E4BBED0E14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4BBED0C14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.cpp */; };
</span><span class="cx">                 E4BBED0F14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = E4BBED0D14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.h */; };
</span><span class="cx">                 E4BBED4C14FCDBA1003F0B98 /* StyleRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4BBED4A14FCDBA1003F0B98 /* StyleRule.cpp */; };
</span><span class="lines">@@ -5876,6 +5936,8 @@
</span><span class="cx">                 E4C1789B0EE6903800824D69 /* CSSSelectorList.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C178960EE6903800824D69 /* CSSSelectorList.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E4C279580CF9741900E97B98 /* RenderMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C279560CF9741900E97B98 /* RenderMedia.cpp */; };
</span><span class="cx">                 E4C279590CF9741900E97B98 /* RenderMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C279570CF9741900E97B98 /* RenderMedia.h */; };
</span><ins>+                E4C3B1FA0F0E4161009693F6 /* TileCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C3B1F90F0E4161009693F6 /* TileCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                E4C3B1FC0F0E4170009693F6 /* TileCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4C3B1FB0F0E4170009693F6 /* TileCache.mm */; };
</ins><span class="cx">                 E4C91A0E1802343100A17F6D /* TextPaintStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C91A0D1802343100A17F6D /* TextPaintStyle.h */; };
</span><span class="cx">                 E4C91A101802343900A17F6D /* TextPaintStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4C91A0F1802343900A17F6D /* TextPaintStyle.cpp */; };
</span><span class="cx">                 E4C91A16180999F100A17F6D /* RenderTextLineBoxes.h in Headers */ = {isa = PBXBuildFile; fileRef = E4C91A15180999F100A17F6D /* RenderTextLineBoxes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -5891,6 +5953,8 @@
</span><span class="cx">                 E4D988B617BFEB210084FB88 /* TextNodeTraversal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D988B517BFEB210084FB88 /* TextNodeTraversal.cpp */; };
</span><span class="cx">                 E4DEAA1717A93DC3000E0430 /* StyleResolveTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4DEAA1517A93DC3000E0430 /* StyleResolveTree.cpp */; };
</span><span class="cx">                 E4DEAA1817A93DC3000E0430 /* StyleResolveTree.h in Headers */ = {isa = PBXBuildFile; fileRef = E4DEAA1617A93DC3000E0430 /* StyleResolveTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                E4E39AFB1330EFA8003AB274 /* TileLayerPool.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E39AFA1330EFA8003AB274 /* TileLayerPool.h */; };
+                E4E39AFD1330EFC6003AB274 /* TileLayerPool.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4E39AFC1330EFC5003AB274 /* TileLayerPool.mm */; };
</ins><span class="cx">                 E4E9B1191810916F003ACCDF /* SimpleLineLayoutResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E9B1181810916F003ACCDF /* SimpleLineLayoutResolver.h */; };
</span><span class="cx">                 E4E9B11B18145692003ACCDF /* SimpleLineLayoutFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4E9B11A18145692003ACCDF /* SimpleLineLayoutFunctions.cpp */; };
</span><span class="cx">                 E4E9B11D1814569C003ACCDF /* SimpleLineLayoutFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E9B11C1814569C003ACCDF /* SimpleLineLayoutFunctions.h */; };
</span><span class="lines">@@ -6315,6 +6379,8 @@
</span><span class="cx">                 FDF7E9C313AC21DB00A51EAC /* JSAudioBufferCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FDF7E9C113AC21DB00A51EAC /* JSAudioBufferCallback.cpp */; };
</span><span class="cx">                 FDF7E9C413AC21DB00A51EAC /* JSAudioBufferCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = FDF7E9C213AC21DB00A51EAC /* JSAudioBufferCallback.h */; };
</span><span class="cx">                 FE09DB49169E2D6E00622557 /* DatabaseError.h in Headers */ = {isa = PBXBuildFile; fileRef = FE09DB46169E2D6E00622557 /* DatabaseError.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                FE0D84E910484348001A179E /* WebEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = FE0D84E810484348001A179E /* WebEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                FE0D84EB1048436E001A179E /* WebEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE0D84EA1048436E001A179E /* WebEvent.mm */; };
</ins><span class="cx">                 FE115FAB167988CD00249134 /* AbstractDatabaseServer.h in Headers */ = {isa = PBXBuildFile; fileRef = FE115FA9167988CD00249134 /* AbstractDatabaseServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FE16CFD3169D1DED00D3A0C7 /* DatabaseBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE16CFCF169D1DEC00D3A0C7 /* DatabaseBackend.cpp */; };
</span><span class="cx">                 FE16CFD4169D1DED00D3A0C7 /* DatabaseBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = FE16CFD0169D1DEC00D3A0C7 /* DatabaseBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -6353,6 +6419,7 @@
</span><span class="cx">                 FEBC5F3216BD0CC300659BD3 /* DatabaseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FED13D3A0CEA934600D89466 /* EditorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D390CEA934600D89466 /* EditorIOS.mm */; };
</span><span class="cx">                 FED13D3D0CEA936A00D89466 /* FrameIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D3B0CEA936A00D89466 /* FrameIOS.mm */; };
</span><ins>+                FED13D400CEA939400D89466 /* IconIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D3F0CEA939400D89466 /* IconIOS.mm */; };
</ins><span class="cx">                 FED13D520CEA949700D89466 /* RenderThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = FED13D500CEA949700D89466 /* RenderThemeIOS.h */; };
</span><span class="cx">                 FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F75A059AF170D8FAA5B8CABE /* MathMLSelectElement.cpp */; };
</span><span class="cx">                 FEDEF84116797108000E444A /* DatabaseStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDEF83F16797108000E444A /* DatabaseStrategy.cpp */; };
</span><span class="lines">@@ -6830,6 +6897,8 @@
</span><span class="cx">                 072AE1E3183C0741000A5988 /* QuickTimePluginReplacement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = QuickTimePluginReplacement.idl; path = plugins/QuickTimePluginReplacement.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 072AE1E4183C0741000A5988 /* QuickTimePluginReplacement.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = QuickTimePluginReplacement.js; path = plugins/QuickTimePluginReplacement.js; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 072CA86016CB4DC3008AE131 /* CaptionUserPreferences.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CaptionUserPreferences.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                07357C7616D2DF0D00ED99E7 /* InbandTextTrackPrivateAVFIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandTextTrackPrivateAVFIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                07357C7716D2DF0D00ED99E7 /* InbandTextTrackPrivateAVFIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InbandTextTrackPrivateAVFIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07367DDD172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InbandTextTrackPrivateLegacyAVFObjC.h; path = objc/InbandTextTrackPrivateLegacyAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 07367DDE172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InbandTextTrackPrivateLegacyAVFObjC.mm; path = objc/InbandTextTrackPrivateLegacyAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -6844,6 +6913,8 @@
</span><span class="cx">                 073BE34517D17E7A002BD431 /* JSNavigatorUserMediaErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorUserMediaErrorCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 073BE34617D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNavigatorUserMediaSuccessCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 073BE34717D17E7A002BD431 /* JSNavigatorUserMediaSuccessCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNavigatorUserMediaSuccessCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                074300A30F4B8BCF008076CD /* MediaPlayerPrivateIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MediaPlayerPrivateIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                074300A40F4B8BCF008076CD /* MediaPlayerPrivateIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerPrivateIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0753860014489E9800B78452 /* CachedTextTrack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedTextTrack.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0753860114489E9800B78452 /* CachedTextTrack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedTextTrack.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 076306CC17E1478D005A7C4E /* MediaStreamTrackSourcesCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamTrackSourcesCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7080,6 +7151,8 @@
</span><span class="cx">                 0F13163D16ED0CC80035CC04 /* PlatformCAFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformCAFilters.h; path = ca/PlatformCAFilters.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlatformCAFiltersMac.mm; path = ca/mac/PlatformCAFiltersMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F15DA890F3AAEE70000CE47 /* AnimationControllerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationControllerPrivate.h; path = animation/AnimationControllerPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0F17747E1378B771009DA76A /* ScrollAnimatorIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollAnimatorIOS.h; path = ios/ScrollAnimatorIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0F17747F1378B772009DA76A /* ScrollAnimatorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollAnimatorIOS.mm; path = ios/ScrollAnimatorIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0F29C16D1300C2E2002D794E /* AccessibilityAllInOne.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityAllInOne.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F3DD44D12F5EA1B000D9190 /* ShadowBlur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShadowBlur.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F3DD44E12F5EA1B000D9190 /* ShadowBlur.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowBlur.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7104,6 +7177,7 @@
</span><span class="cx">                 0F605AEB15F94848004DF0C0 /* ScrollingConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollingConstraints.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F6383DB18615B29003E5DB5 /* ThreadedScrollingTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadedScrollingTree.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F6383DC18615B29003E5DB5 /* ThreadedScrollingTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadedScrollingTree.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                0F97A657155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DisplayRefreshMonitorIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0FA24D77162DF91900A3F4C0 /* GraphicsLayerUpdater.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsLayerUpdater.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsLayerUpdater.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0FA88EBC16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingStateScrollingNodeMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7550,6 +7624,7 @@
</span><span class="cx">                 1F3C3BE8135CAF3C00B8C1AC /* MediaControls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControls.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1F3C3BE9135CAF3C00B8C1AC /* MediaControls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaControls.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1F3F19521499CA7600A5AEA7 /* PODFreeListArena.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PODFreeListArena.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1F68D4AD14BB9DCA007B5C62 /* MemoryPressureHandlerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MemoryPressureHandlerIOS.mm; path = ios/MemoryPressureHandlerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1FAFBF1615A5FA5200083A20 /* UTIUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTIUtilities.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1FAFBF1715A5FA5200083A20 /* UTIUtilities.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UTIUtilities.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1FC40FB71655C5910040F29E /* SubimageCacheWithTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubimageCacheWithTimer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7589,6 +7664,8 @@
</span><span class="cx">                 265541371489811C000DFC5D /* KeyEventCodesIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyEventCodesIOS.h; path = ios/KeyEventCodesIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 265541381489811C000DFC5D /* KeyEventIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = KeyEventIOS.mm; path = ios/KeyEventIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2655414B1489AA2B000DFC5D /* CursorIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CursorIOS.cpp; path = ios/CursorIOS.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                26601EBD14B3B9AD0012C0FE /* PlatformEventFactoryIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformEventFactoryIOS.h; path = ios/PlatformEventFactoryIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                26601EBE14B3B9AD0012C0FE /* PlatformEventFactoryIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlatformEventFactoryIOS.mm; path = ios/PlatformEventFactoryIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 269239911505E1AA009E57FC /* JSIDBVersionChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBVersionChangeEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 269239921505E1AA009E57FC /* JSIDBVersionChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBVersionChangeEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26B9998E1803AE7200D01121 /* RegisterAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterAllocator.h; path = cssjit/RegisterAllocator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7606,6 +7683,7 @@
</span><span class="cx">                 26FAE4C91852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceHandleCFURLConnectionDelegate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26FAE4CA1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SynchronousResourceHandleCFURLConnectionDelegate.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 26FAE4CB1852E3A5004C8C46 /* SynchronousResourceHandleCFURLConnectionDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SynchronousResourceHandleCFURLConnectionDelegate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2903716416BA11BC00FEFDF0 /* ContentFilterIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ContentFilterIOS.mm; path = ios/ContentFilterIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LayerFlushScheduler.cpp; path = ca/LayerFlushScheduler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LayerFlushScheduler.h; path = ca/LayerFlushScheduler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LayerFlushSchedulerClient.h; path = ca/LayerFlushSchedulerClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7780,6 +7858,10 @@
</span><span class="cx">                 31313F631443B35E006E2A90 /* FilterEffectRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FilterEffectRenderer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31313F641443B35E006E2A90 /* FilterEffectRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilterEffectRenderer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3138A9E41474434600B0ED12 /* StyleShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleShader.h; path = style/StyleShader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                31403797124BEA7F00AF40E4 /* WebCoreMotionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebCoreMotionManager.h; path = ios/WebCoreMotionManager.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                31403798124BEA7F00AF40E4 /* WebCoreMotionManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebCoreMotionManager.mm; path = ios/WebCoreMotionManager.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                31403799124BEA7F00AF40E4 /* DeviceOrientationClientIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeviceOrientationClientIOS.h; path = ios/DeviceOrientationClientIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                3140379A124BEA7F00AF40E4 /* DeviceOrientationClientIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DeviceOrientationClientIOS.mm; path = ios/DeviceOrientationClientIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 3146FE6518442087001A937C /* OESTextureFloatLinear.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OESTextureFloatLinear.cpp; path = canvas/OESTextureFloatLinear.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3146FE6618442087001A937C /* OESTextureFloatLinear.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OESTextureFloatLinear.h; path = canvas/OESTextureFloatLinear.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3146FE6718442087001A937C /* OESTextureFloatLinear.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OESTextureFloatLinear.idl; path = canvas/OESTextureFloatLinear.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7820,6 +7902,7 @@
</span><span class="cx">                 319AE061142D6B24006563A1 /* StyleFilterData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StyleFilterData.cpp; path = style/StyleFilterData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 319AE062142D6B24006563A1 /* StyleFilterData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleFilterData.h; path = style/StyleFilterData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 319FBD5D15D2F444009640A6 /* CachedImageClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedImageClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                31AB4FFF122878A2001A7DB0 /* GraphicsContext3DIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContext3DIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 31C0FF1B0E4CEB6E007D6FE5 /* WebKitAnimationEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitAnimationEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31C0FF1C0E4CEB6E007D6FE5 /* WebKitAnimationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAnimationEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31C0FF1D0E4CEB6E007D6FE5 /* WebKitAnimationEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitAnimationEvent.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7839,6 +7922,8 @@
</span><span class="cx">                 31D591B116697A6C00E6BF02 /* PlugInClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlugInClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31E8D8BA160BC94B004CE8F5 /* RenderSnapshottedPlugIn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSnapshottedPlugIn.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31E8D8BB160BC94C004CE8F5 /* RenderSnapshottedPlugIn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSnapshottedPlugIn.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                31EAF97C121435A400E7C1BF /* DeviceMotionClientIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeviceMotionClientIOS.h; path = ios/DeviceMotionClientIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                31EAF97D121435A400E7C1BF /* DeviceMotionClientIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DeviceMotionClientIOS.mm; path = ios/DeviceMotionClientIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 31EC1D5014FEFD0800C94662 /* NotificationPermissionCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NotificationPermissionCallback.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31EC1DAC14FF26EA00C94662 /* NotificationPermissionCallback.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NotificationPermissionCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31EC1E2614FF60EE00C94662 /* JSNotificationPermissionCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNotificationPermissionCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7884,6 +7969,7 @@
</span><span class="cx">                 371F53E70D2704F900ECE0D5 /* CSSUnicodeRangeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSUnicodeRangeValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 371F53E80D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSUnicodeRangeValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37202198106213C600F25C4B /* FontSmoothingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSmoothingMode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                3727DFD4142AAE4500D449CB /* FontCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FontCacheIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 372C00C3129611F1005C9575 /* TextBoundaries.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBoundaries.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 372C00D8129619F8005C9575 /* FindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindOptions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 3744570E0DB05FA500AE0992 /* SVGGlyphMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGGlyphMap.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -7921,6 +8007,7 @@
</span><span class="cx">                 37DDCDA31384501C0008B793 /* MHTMLParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MHTMLParser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37E3524A12450C5200BAF5D9 /* InputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputType.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37E3524C12450C6600BAF5D9 /* InputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                37E6594F163B10C200EB4574 /* SimpleFontDataIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleFontDataIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 37F818FB0D657606005E1F05 /* WebCoreURLResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreURLResponse.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37F818FC0D657606005E1F05 /* WebCoreURLResponse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreURLResponse.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 37FC96DA1104ED71003E1FAD /* TrailingFloatsRootInlineBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrailingFloatsRootInlineBox.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -8143,8 +8230,13 @@
</span><span class="cx">                 4429AAFF0CB84EC3007647C5 /* DOMHTMLObjectElementPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLObjectElementPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4429AB070CB84F81007647C5 /* DOMTextEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMTextEventInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 442ABCD517D9262F00D30715 /* SynchronousLoaderClientCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SynchronousLoaderClientCFNet.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                442AF7A7102CDDEA008FD4D3 /* QuickLook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuickLook.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                442AF7A8102CDDEA008FD4D3 /* QuickLook.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QuickLook.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 44311CD412E4E22D000A8D19 /* DOMDocumentFragmentPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDocumentFragmentPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 44311CD512E4E22D000A8D19 /* DOMDocumentPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMDocumentPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                443F04260E75C8FB007E5407 /* NetworkStateNotifierIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkStateNotifierIOS.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreURLResponseIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                4476531A133170990006B789 /* SSLKeyGeneratorIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SSLKeyGeneratorIOS.cpp; path = ios/SSLKeyGeneratorIOS.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 447958021643B47B001E0A7F /* ParsedContentType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParsedContentType.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 447958031643B47B001E0A7F /* ParsedContentType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParsedContentType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 448A29BD0A46D9CB0030759F /* JSHTMLOptionsCollection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLOptionsCollection.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -8157,8 +8249,16 @@
</span><span class="cx">                 4496E39F139813A5003EE32A /* JSSVGMPathElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGMPathElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4496E3A1139813CB003EE32A /* JSSVGMPathElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGMPathElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 449B19F30FA72ECE0015CA4A /* HTMLParserQuirks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLParserQuirks.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                44A20DB80F84166C00B3E1FE /* WebCoreURLResponseIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreURLResponseIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 44A28AAB12DFB8AC00AE923B /* MathMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLElementFactory.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 44A28AAE12DFB8BF00AE923B /* MathMLNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLNames.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                44C363EE0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeApplicationChecksIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                44C363EF0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RuntimeApplicationChecksIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                44C3CFE71556BE5D00013609 /* WebCoreSystemInterfaceIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebCoreSystemInterfaceIOS.h; path = ios/WebCoreSystemInterfaceIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                44C991810F3D1E0D00586670 /* ScrollbarThemeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollbarThemeIOS.mm; path = ios/ScrollbarThemeIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                44C991850F3D1EBE00586670 /* ScrollbarThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollbarThemeIOS.h; path = ios/ScrollbarThemeIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                44C9919D0F3D210E00586670 /* ThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThemeIOS.h; path = ios/ThemeIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                44C9919E0F3D210E00586670 /* ThemeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ThemeIOS.mm; path = ios/ThemeIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 44D8DA98139545BE00337B75 /* SVGMPathElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SVGMPathElement.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 44D8DA9A139545CD00337B75 /* SVGAnimateMotionElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SVGAnimateMotionElement.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 44DAB5AF15A623580097C1E4 /* Extensions3DOpenGLCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Extensions3DOpenGLCommon.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -9066,8 +9166,12 @@
</span><span class="cx">                 7E12E90E15FA5D3A005E4126 /* CustomFilterMeshGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CustomFilterMeshGenerator.cpp; path = filters/CustomFilterMeshGenerator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7E33CD00127F340D00BE8F17 /* PurgePriority.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurgePriority.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SubresourceLoaderCF.cpp; path = cf/SubresourceLoaderCF.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7E428CE413E3407F003B661C /* ResourceHandleIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceHandleIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7E46F6F81627A2C900062223 /* JSOESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESElementIndexUint.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7E46F6F91627A2C900062223 /* JSOESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESElementIndexUint.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteDatabaseTrackerClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteDatabaseTracker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLiteDatabaseTracker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7E5D7A73161D3F8F00896C34 /* OESElementIndexUint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OESElementIndexUint.cpp; path = canvas/OESElementIndexUint.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7E5D7A74161D3F8F00896C34 /* OESElementIndexUint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OESElementIndexUint.h; path = canvas/OESElementIndexUint.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7E66E23116D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebGLCompressedTextureATC.cpp; path = canvas/WebGLCompressedTextureATC.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -10384,6 +10488,8 @@
</span><span class="cx">                 A456FA2511AD4A830020B420 /* LabelsNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelsNodeList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A501920C132EBF2E008BFE55 /* Autocapitalize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Autocapitalize.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A502C5DD13049B3500FC7D53 /* WebSafeGCActivityCallbackIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSafeGCActivityCallbackIOS.h; path = ios/WebSafeGCActivityCallbackIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                A516E8B4136E04DB0076C3C0 /* LocalizedDateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizedDateCache.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                A516E8B5136E04DB0076C3C0 /* LocalizedDateCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LocalizedDateCache.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A518225317E28CF100A9BA1D /* Scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Scripts; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A518225417E2A0D400A9BA1D /* InspectorOverlayPage.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = InspectorOverlayPage.css; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A518225517E2A0D400A9BA1D /* InspectorOverlayPage.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = InspectorOverlayPage.js; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -10960,6 +11066,7 @@
</span><span class="cx">                 AAD766EA157E502F00E85423 /* InspectorCanvasInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCanvasInstrumentation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AAE27B7416CBFC0D00623043 /* PlatformSpeechSynthesizerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformSpeechSynthesizerMock.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AAE27B7516CBFC0D00623043 /* PlatformSpeechSynthesizerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformSpeechSynthesizerMock.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlatformSpeechSynthesizerIOS.mm; path = ios/PlatformSpeechSynthesizerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 AAF5B7B11524B4BD0004CB49 /* WebSocketFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketFrame.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AB23A32509BBA7D00067CC53 /* BeforeTextInsertedEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = BeforeTextInsertedEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 AB23A32609BBA7D00067CC53 /* BeforeTextInsertedEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = BeforeTextInsertedEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12362,6 +12469,8 @@
</span><span class="cx">                 BE91FC8B06133666005E3790 /* Position.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Position.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 BE91FC8C06133666005E3790 /* Position.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Position.cpp; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 BE983D95052A2E0A00892D85 /* WebCoreKeyboardUIMode.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreKeyboardUIMode.h; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; usesTabs = 0; };
</span><ins>+                BEA807C60F714A0300524199 /* SelectionRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SelectionRect.cpp; path = ios/SelectionRect.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                BEA807C70F714A0300524199 /* SelectionRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectionRect.h; path = ios/SelectionRect.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 BEF29EE91715DD0900C4B4C9 /* AudioTrackPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioTrackPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 BEF29EEA1715DD0900C4B4C9 /* VideoTrackPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoTrackPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C046E1AB1208A9FE00BA2CF7 /* LocalizedStrings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LocalizedStrings.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12406,6 +12515,8 @@
</span><span class="cx">                 C55E38BC10040D5D00A56BDB /* StorageNamespaceImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespaceImpl.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C572EE1D1201C9BC007D8F82 /* JSIDBIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBIndex.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C57FEDE01212EE9C0097BE65 /* FileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystem.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                C58361A71744523F00173511 /* FontServicesIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontServicesIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                C58361A81744523F00173511 /* FontServicesIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FontServicesIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 C585A66011D4FAC5004C3E4B /* IDBBindingUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBBindingUtilities.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C585A66111D4FAC5004C3E4B /* IDBBindingUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBBindingUtilities.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C585A66511D4FB07004C3E4B /* JSIDBAny.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBAny.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12495,6 +12606,8 @@
</span><span class="cx">                 CD54A761180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioTrackPrivateMediaSourceAVFObjC.h; path = objc/AudioTrackPrivateMediaSourceAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD54DE4517468B6F005E5B36 /* MediaSessionManagerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaSessionManagerMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD54DE4917469C6D005E5B36 /* AudioSessionMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioSessionMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CD55968F1475B678001D0BD0 /* AudioFileReaderIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AudioFileReaderIOS.cpp; path = ios/AudioFileReaderIOS.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                CD5596901475B678001D0BD0 /* AudioFileReaderIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioFileReaderIOS.h; path = ios/AudioFileReaderIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CD641EB11818F5ED00EE4C41 /* MediaSourcePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaSourcePrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD641EB21818F5ED00EE4C41 /* SourceBufferPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CD641EBD1819B35900EE4C41 /* MediaTimeMac.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTimeMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12590,6 +12703,7 @@
</span><span class="cx">                 CDC8B5A818047FF10016E685 /* SourceBufferPrivateAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SourceBufferPrivateAVFObjC.mm; path = objc/SourceBufferPrivateAVFObjC.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDC8B5A918047FF10016E685 /* SourceBufferPrivateAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SourceBufferPrivateAVFObjC.h; path = objc/SourceBufferPrivateAVFObjC.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDC8B5AC1804AE5D0016E685 /* SourceBufferPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SourceBufferPrivateClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CDCA82941679100F00875714 /* TextTrackRepresentationIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextTrackRepresentationIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CDCE5CD014633BC900D47CCA /* EventTargetFactory.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EventTargetFactory.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDD1E525167BA56400CE820B /* TextTrackRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRepresentation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CDD7089418359F6E002B3DC6 /* SampleMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SampleMap.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12646,6 +12760,7 @@
</span><span class="cx">                 CECADFCC1537791D00E37068 /* TextInsertionBaseCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInsertionBaseCommand.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CECCFC3A141973D5002A0AC1 /* DecodeEscapeSequences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DecodeEscapeSequences.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CEDA12D6152CA1CB00D9E08D /* AlternativeTextClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlternativeTextClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                CEEC6034187DD962003E43BB /* TextTrackRepresentationIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextTrackRepresentationIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 CEF418CC1179678C009D112C /* ViewportArguments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewportArguments.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CEF418CD1179678C009D112C /* ViewportArguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewportArguments.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 D000EBA011BDAFD400C47726 /* FrameLoaderStateMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameLoaderStateMachine.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12982,6 +13097,8 @@
</span><span class="cx">                 E406F3FB1198307D009D59D6 /* ColorData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertyNames.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSValueKeywords.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E424A39D1330DF0100CF6DC9 /* TileGridTile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileGridTile.h; path = ios/TileGridTile.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E424A39F1330DF1E00CF6DC9 /* TileGridTile.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TileGridTile.mm; path = ios/TileGridTile.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E425A49918292B840020CFCF /* CollectionIndexCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectionIndexCache.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4295FA312B0614E00D1ACE0 /* ResourceLoadPriority.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadPriority.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E43105B716750F0C00DB2FB8 /* NodeTraversal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NodeTraversal.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13019,8 +13136,15 @@
</span><span class="cx">                 E44EE3A717576E5500EEE8CF /* FontGenericFamilies.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontGenericFamilies.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E45322A9140CE267005A0F92 /* SelectorQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectorQuery.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E45322AA140CE267005A0F92 /* SelectorQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorQuery.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E45390180EAFCACA003695C8 /* MIMETypeRegistryIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MIMETypeRegistryIOS.mm; path = ios/MIMETypeRegistryIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E45390190EAFCACA003695C8 /* PasteboardIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PasteboardIOS.mm; path = ios/PasteboardIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E45390320EAFD637003695C8 /* PlatformScreenIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlatformScreenIOS.mm; path = ios/PlatformScreenIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E45390340EAFD637003695C8 /* ScrollViewIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollViewIOS.mm; path = ios/ScrollViewIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E45390350EAFD637003695C8 /* SharedTimerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SharedTimerIOS.mm; path = ios/SharedTimerIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E45390360EAFD637003695C8 /* SoundIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SoundIOS.mm; path = ios/SoundIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E45390380EAFD637003695C8 /* WebCoreSystemInterfaceIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebCoreSystemInterfaceIOS.mm; path = ios/WebCoreSystemInterfaceIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E453903C0EAFD637003695C8 /* WidgetIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WidgetIOS.mm; path = ios/WidgetIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E45390AD0EAFF4B5003695C8 /* SystemMemoryIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemMemoryIOS.cpp; path = ios/SystemMemoryIOS.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E462A4A0113E71BE004A4220 /* IntPointHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntPointHash.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E46A2B1B17CA65B9000DBCD8 /* ElementDescendantIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementDescendantIterator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E46A2B1D17CA76B1000DBCD8 /* ElementChildIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementChildIterator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13064,6 +13188,10 @@
</span><span class="cx">                 E4B423800CBFB73C00AF2ECE /* JSHTMLMediaElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLMediaElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4B423850CBFB73C00AF2ECE /* JSProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSProgressEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4B423860CBFB73C00AF2ECE /* JSProgressEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSProgressEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E4B65A57132FA8E70070E7BE /* TileGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileGrid.h; path = ios/TileGrid.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E4B65A59132FAAF90070E7BE /* TileGrid.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TileGrid.mm; path = ios/TileGrid.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E4B65A5B132FACB00070E7BE /* TileLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileLayer.h; path = ios/TileLayer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E4B65A5D132FADB60070E7BE /* TileLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TileLayer.mm; path = ios/TileLayer.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E4BBED0C14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PropertySetCSSStyleDeclaration.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4BBED0D14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertySetCSSStyleDeclaration.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4BBED4A14FCDBA1003F0B98 /* StyleRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleRule.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13072,6 +13200,8 @@
</span><span class="cx">                 E4C178960EE6903800824D69 /* CSSSelectorList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSelectorList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4C279560CF9741900E97B98 /* RenderMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMedia.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4C279570CF9741900E97B98 /* RenderMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMedia.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E4C3B1F90F0E4161009693F6 /* TileCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileCache.h; path = ios/TileCache.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E4C3B1FB0F0E4170009693F6 /* TileCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TileCache.mm; path = ios/TileCache.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E4C91A0D1802343100A17F6D /* TextPaintStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextPaintStyle.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4C91A0F1802343900A17F6D /* TextPaintStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextPaintStyle.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4C91A15180999F100A17F6D /* RenderTextLineBoxes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTextLineBoxes.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13087,6 +13217,8 @@
</span><span class="cx">                 E4D988B517BFEB210084FB88 /* TextNodeTraversal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextNodeTraversal.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4DEAA1517A93DC3000E0430 /* StyleResolveTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleResolveTree.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4DEAA1617A93DC3000E0430 /* StyleResolveTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleResolveTree.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E4E39AFA1330EFA8003AB274 /* TileLayerPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TileLayerPool.h; path = ios/TileLayerPool.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E4E39AFC1330EFC5003AB274 /* TileLayerPool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TileLayerPool.mm; path = ios/TileLayerPool.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E4E9B1181810916F003ACCDF /* SimpleLineLayoutResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutResolver.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4E9B11A18145692003ACCDF /* SimpleLineLayoutFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayoutFunctions.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4E9B11C1814569C003ACCDF /* SimpleLineLayoutFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayoutFunctions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13569,6 +13701,8 @@
</span><span class="cx">                 FDF7E9C113AC21DB00A51EAC /* JSAudioBufferCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioBufferCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FDF7E9C213AC21DB00A51EAC /* JSAudioBufferCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAudioBufferCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE09DB46169E2D6E00622557 /* DatabaseError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseError.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FE0D84E810484348001A179E /* WebEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebEvent.h; path = ios/WebEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                FE0D84EA1048436E001A179E /* WebEvent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebEvent.mm; path = ios/WebEvent.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FE115FA9167988CD00249134 /* AbstractDatabaseServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractDatabaseServer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE16CFCF169D1DEC00D3A0C7 /* DatabaseBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseBackend.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FE16CFD0169D1DEC00D3A0C7 /* DatabaseBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseBackend.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13607,6 +13741,7 @@
</span><span class="cx">                 FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FED13D390CEA934600D89466 /* EditorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FED13D3B0CEA936A00D89466 /* FrameIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FrameIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                FED13D3F0CEA939400D89466 /* IconIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IconIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 FED13D500CEA949700D89466 /* RenderThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderThemeIOS.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEDEF83F16797108000E444A /* DatabaseStrategy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseStrategy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEDEF84016797108000E444A /* DatabaseStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseStrategy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14291,6 +14426,7 @@
</span><span class="cx">                 1A2E6E560CC551E0004A2062 /* sql */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                7E474E1912494DA900235364 /* ios */,
</ins><span class="cx">                                 1A2E6E780CC556D5004A2062 /* SQLiteAuthorizer.cpp */,
</span><span class="cx">                                 1A2246430CC98DDB00C05240 /* SQLiteDatabase.cpp */,
</span><span class="cx">                                 1A2246440CC98DDB00C05240 /* SQLiteDatabase.h */,
</span><span class="lines">@@ -15028,6 +15164,26 @@
</span><span class="cx">                         name = mathml;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                441AF0A70EBA7BBF0044ED4B /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                0F97A657155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm */,
+                                3727DFD4142AAE4500D449CB /* FontCacheIOS.mm */,
+                                C58361A71744523F00173511 /* FontServicesIOS.h */,
+                                C58361A81744523F00173511 /* FontServicesIOS.mm */,
+                                31AB4FFF122878A2001A7DB0 /* GraphicsContext3DIOS.h */,
+                                FED13D3F0CEA939400D89466 /* IconIOS.mm */,
+                                07357C7616D2DF0D00ED99E7 /* InbandTextTrackPrivateAVFIOS.h */,
+                                07357C7716D2DF0D00ED99E7 /* InbandTextTrackPrivateAVFIOS.mm */,
+                                074300A40F4B8BCF008076CD /* MediaPlayerPrivateIOS.h */,
+                                074300A30F4B8BCF008076CD /* MediaPlayerPrivateIOS.mm */,
+                                37E6594F163B10C200EB4574 /* SimpleFontDataIOS.mm */,
+                                CEEC6034187DD962003E43BB /* TextTrackRepresentationIOS.h */,
+                                CDCA82941679100F00875714 /* TextTrackRepresentationIOS.mm */,
+                        );
+                        path = ios;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 443292C10EBA6D7300E62016 /* ios */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -15045,6 +15201,19 @@
</span><span class="cx">                         name = Exports;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                4497D58C0EBA854F00A10552 /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                443F04260E75C8FB007E5407 /* NetworkStateNotifierIOS.cpp */,
+                                442AF7A7102CDDEA008FD4D3 /* QuickLook.h */,
+                                442AF7A8102CDDEA008FD4D3 /* QuickLook.mm */,
+                                7E428CE413E3407F003B661C /* ResourceHandleIOS.mm */,
+                                44A20DB80F84166C00B3E1FE /* WebCoreURLResponseIOS.h */,
+                                444D4E210F708B2E003158E0 /* WebCoreURLResponseIOS.mm */,
+                        );
+                        path = ios;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 49484FAE102CF01E00187DD3 /* canvas */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -15543,6 +15712,7 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 B2F34FE70E82F81700F627CD /* cf */,
</span><ins>+                                4497D58C0EBA854F00A10552 /* ios */,
</ins><span class="cx">                                 656B84E70AEA1DAE00A095B4 /* mac */,
</span><span class="cx">                                 934F71370D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp */,
</span><span class="cx">                                 934F71390D5A6F1000018D69 /* AuthenticationChallengeBase.h */,
</span><span class="lines">@@ -15928,6 +16098,17 @@
</span><span class="cx">                         tabWidth = 4;
</span><span class="cx">                         usesTabs = 0;
</span><span class="cx">                 };
</span><ins>+                7E474E1912494DA900235364 /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                7E474E1D12494DC900235364 /* SQLiteDatabaseTracker.cpp */,
+                                7E474E1C12494DC900235364 /* SQLiteDatabaseTracker.h */,
+                                7E474E1B12494DC900235364 /* SQLiteDatabaseTrackerClient.h */,
+                        );
+                        name = ios;
+                        path = sql/ios;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 7EE6847312D26E5500E79415 /* cf */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -17534,20 +17715,71 @@
</span><span class="cx">                         name = parser;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                A516E8B2136E04C00076C3C0 /* ios */ = {
+                        isa = PBXGroup;
+                        children = (
+                                A516E8B4136E04DB0076C3C0 /* LocalizedDateCache.h */,
+                                A516E8B5136E04DB0076C3C0 /* LocalizedDateCache.mm */,
+                        );
+                        path = ios;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 A59E3C1B11580F340072928E /* ios */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                2903716416BA11BC00FEFDF0 /* ContentFilterIOS.mm */,
</ins><span class="cx">                                 2655414B1489AA2B000DFC5D /* CursorIOS.cpp */,
</span><ins>+                                31EAF97C121435A400E7C1BF /* DeviceMotionClientIOS.h */,
+                                31EAF97D121435A400E7C1BF /* DeviceMotionClientIOS.mm */,
+                                31403799124BEA7F00AF40E4 /* DeviceOrientationClientIOS.h */,
+                                3140379A124BEA7F00AF40E4 /* DeviceOrientationClientIOS.mm */,
</ins><span class="cx">                                 26F40D4914904A6300CA67C4 /* EventLoopIOS.mm */,
</span><span class="cx">                                 26C17A3C1491D2D400D12BA2 /* FileSystemIOS.h */,
</span><span class="cx">                                 26C17A3D1491D2D400D12BA2 /* FileSystemIOS.mm */,
</span><span class="cx">                                 265541371489811C000DFC5D /* KeyEventCodesIOS.h */,
</span><span class="cx">                                 265541381489811C000DFC5D /* KeyEventIOS.mm */,
</span><ins>+                                1F68D4AD14BB9DCA007B5C62 /* MemoryPressureHandlerIOS.mm */,
+                                E45390180EAFCACA003695C8 /* MIMETypeRegistryIOS.mm */,
</ins><span class="cx">                                 E45390190EAFCACA003695C8 /* PasteboardIOS.mm */,
</span><ins>+                                26601EBD14B3B9AD0012C0FE /* PlatformEventFactoryIOS.h */,
+                                26601EBE14B3B9AD0012C0FE /* PlatformEventFactoryIOS.mm */,
</ins><span class="cx">                                 C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */,
</span><ins>+                                E45390320EAFD637003695C8 /* PlatformScreenIOS.mm */,
+                                AAE3755D17429BCC006200C2 /* PlatformSpeechSynthesizerIOS.mm */,
+                                44C363EE0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h */,
+                                44C363EF0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm */,
+                                0F17747E1378B771009DA76A /* ScrollAnimatorIOS.h */,
+                                0F17747F1378B772009DA76A /* ScrollAnimatorIOS.mm */,
+                                44C991850F3D1EBE00586670 /* ScrollbarThemeIOS.h */,
+                                44C991810F3D1E0D00586670 /* ScrollbarThemeIOS.mm */,
+                                E45390340EAFD637003695C8 /* ScrollViewIOS.mm */,
+                                BEA807C60F714A0300524199 /* SelectionRect.cpp */,
+                                BEA807C70F714A0300524199 /* SelectionRect.h */,
</ins><span class="cx">                                 E45390350EAFD637003695C8 /* SharedTimerIOS.mm */,
</span><ins>+                                E45390360EAFD637003695C8 /* SoundIOS.mm */,
+                                4476531A133170990006B789 /* SSLKeyGeneratorIOS.cpp */,
+                                E45390AD0EAFF4B5003695C8 /* SystemMemoryIOS.cpp */,
+                                44C9919D0F3D210E00586670 /* ThemeIOS.h */,
+                                44C9919E0F3D210E00586670 /* ThemeIOS.mm */,
+                                E4C3B1F90F0E4161009693F6 /* TileCache.h */,
+                                E4C3B1FB0F0E4170009693F6 /* TileCache.mm */,
+                                E4B65A57132FA8E70070E7BE /* TileGrid.h */,
+                                E4B65A59132FAAF90070E7BE /* TileGrid.mm */,
+                                E424A39D1330DF0100CF6DC9 /* TileGridTile.h */,
+                                E424A39F1330DF1E00CF6DC9 /* TileGridTile.mm */,
+                                E4B65A5B132FACB00070E7BE /* TileLayer.h */,
+                                E4B65A5D132FADB60070E7BE /* TileLayer.mm */,
+                                E4E39AFA1330EFA8003AB274 /* TileLayerPool.h */,
+                                E4E39AFC1330EFC5003AB274 /* TileLayerPool.mm */,
+                                31403797124BEA7F00AF40E4 /* WebCoreMotionManager.h */,
+                                31403798124BEA7F00AF40E4 /* WebCoreMotionManager.mm */,
+                                44C3CFE71556BE5D00013609 /* WebCoreSystemInterfaceIOS.h */,
+                                E45390380EAFD637003695C8 /* WebCoreSystemInterfaceIOS.mm */,
+                                FE0D84E810484348001A179E /* WebEvent.h */,
+                                FE0D84EA1048436E001A179E /* WebEvent.mm */,
</ins><span class="cx">                                 A502C5DD13049B3500FC7D53 /* WebSafeGCActivityCallbackIOS.h */,
</span><span class="cx">                                 C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */,
</span><ins>+                                E453903C0EAFD637003695C8 /* WidgetIOS.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = ios;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -19372,6 +19604,7 @@
</span><span class="cx">                                 9332AB3B16515D7700D827EC /* cpu */,
</span><span class="cx">                                 A75E8B7F0E1DE2B0007F2481 /* filters */,
</span><span class="cx">                                 498770C11242C50D002226BA /* gpu */,
</span><ins>+                                441AF0A70EBA7BBF0044ED4B /* ios */,
</ins><span class="cx">                                 B27535490B053814002CE64F /* mac */,
</span><span class="cx">                                 FBC220DD1237FBEB00BCF788 /* opengl */,
</span><span class="cx">                                 F4EAF4AB10C74268009100D3 /* opentype */,
</span><span class="lines">@@ -19546,6 +19779,7 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 B2B264590D00A77E000ACC1D /* cf */,
</span><ins>+                                A516E8B2136E04C00076C3C0 /* ios */,
</ins><span class="cx">                                 B2C3D9F90D006C1D00EF6F26 /* mac */,
</span><span class="cx">                                 37C61F0012095C87007A3C67 /* AtomicStringKeyedMRUCache.h */,
</span><span class="cx">                                 B2C3D9F20D006C1D00EF6F26 /* BidiContext.cpp */,
</span><span class="lines">@@ -20448,6 +20682,8 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 CD0EEE0B14743E35003EAFA2 /* AudioDestinationIOS.cpp */,
</span><span class="cx">                                 CD0EEE0A14743E34003EAFA2 /* AudioDestinationIOS.h */,
</span><ins>+                                CD55968F1475B678001D0BD0 /* AudioFileReaderIOS.cpp */,
+                                CD5596901475B678001D0BD0 /* AudioFileReaderIOS.h */,
</ins><span class="cx">                                 CDA79825170A279000D45C55 /* AudioSessionIOS.mm */,
</span><span class="cx">                         );
</span><span class="cx">                         name = ios;
</span><span class="lines">@@ -22247,6 +22483,7 @@
</span><span class="cx">                                 CEDA12D7152CA1CB00D9E08D /* AlternativeTextClient.h in Headers */,
</span><span class="cx">                                 CE08C3D2152B599A0021B8C2 /* AlternativeTextController.h in Headers */,
</span><span class="cx">                                 CE7B2DB31586ABAD0098B3FA /* AlternativeTextUIController.h in Headers */,
</span><ins>+                                FE0D84E910484348001A179E /* WebEvent.h in Headers */,
</ins><span class="cx">                                 FD31603E12B0267600C1A359 /* AnalyserNode.h in Headers */,
</span><span class="cx">                                 CDE3A85817F6020400C5BE20 /* AudioTrackPrivateAVFObjC.h in Headers */,
</span><span class="cx">                                 490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */,
</span><span class="lines">@@ -22388,6 +22625,7 @@
</span><span class="cx">                                 BCB16C1C0979C3BD00467741 /* CachedImage.h in Headers */,
</span><span class="cx">                                 319FBD5F15D2F464009640A6 /* CachedImageClient.h in Headers */,
</span><span class="cx">                                 510184690B08602A004A825F /* CachedPage.h in Headers */,
</span><ins>+                                E424A39E1330DF0100CF6DC9 /* TileGridTile.h in Headers */,
</ins><span class="cx">                                 D0EDA775143E303C0028E383 /* CachedRawResource.h in Headers */,
</span><span class="cx">                                 E1B533491717DEE300F205F9 /* CachedRawResourceClient.h in Headers */,
</span><span class="cx">                                 BCB16C200979C3BD00467741 /* CachedResource.h in Headers */,
</span><span class="lines">@@ -22581,6 +22819,7 @@
</span><span class="cx">                                 078E091417D14D1C00420AA1 /* MediaConstraintsImpl.h in Headers */,
</span><span class="cx">                                 A80E6CE90A1989CA007FB8C5 /* CSSValueList.h in Headers */,
</span><span class="cx">                                 E49BD9FA131FD2ED003C56F0 /* CSSValuePool.h in Headers */,
</span><ins>+                                E4B65A58132FA8E70070E7BE /* TileGrid.h in Headers */,
</ins><span class="cx">                                 93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
</span><span class="cx">                                 BC2272A20E82E87C00E7F975 /* CursorData.h in Headers */,
</span><span class="cx">                                 868160D618766A130021E79D /* UserActivity.h in Headers */,
</span><span class="lines">@@ -23023,6 +23262,7 @@
</span><span class="cx">                                 85526CD20AB0B7D9000302EA /* DOMTreeWalker.h in Headers */,
</span><span class="cx">                                 850B41C30AD9E7E700A6ED4F /* DOMTreeWalkerInternal.h in Headers */,
</span><span class="cx">                                 85C7F4910AAF79DC004014DD /* DOMUIEvent.h in Headers */,
</span><ins>+                                44C9919F0F3D210E00586670 /* ThemeIOS.h in Headers */,
</ins><span class="cx">                                 85989DD00ACC8BBD00A0BC51 /* DOMUIEventInternal.h in Headers */,
</span><span class="cx">                                 2E37DFDB12DBAFB800A6B233 /* DOMURL.h in Headers */,
</span><span class="cx">                                 15C770A6100D41CD005BA267 /* DOMValidityState.h in Headers */,
</span><span class="lines">@@ -23191,6 +23431,7 @@
</span><span class="cx">                                 845E72F80FD261EE00A87D79 /* Filter.h in Headers */,
</span><span class="cx">                                 08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */,
</span><span class="cx">                                 31313F661443B35F006E2A90 /* FilterEffectRenderer.h in Headers */,
</span><ins>+                                44C3CFE81556BE5D00013609 /* WebCoreSystemInterfaceIOS.h in Headers */,
</ins><span class="cx">                                 49ECEB6E1499790D00CDD3A4 /* FilterOperation.h in Headers */,
</span><span class="cx">                                 49ECEB701499790D00CDD3A4 /* FilterOperations.h in Headers */,
</span><span class="cx">                                 372C00D9129619F8005C9575 /* FindOptions.h in Headers */,
</span><span class="lines">@@ -23278,6 +23519,7 @@
</span><span class="cx">                                 0873B86B136064EA00A522C2 /* GlyphPage.h in Headers */,
</span><span class="cx">                                 B2C3DA6E0D006CD600EF6F26 /* GlyphPageTreeNode.h in Headers */,
</span><span class="cx">                                 BC53C5F50DA56B920021EB5D /* Gradient.h in Headers */,
</span><ins>+                                7E474E1E12494DC900235364 /* SQLiteDatabaseTrackerClient.h in Headers */,
</ins><span class="cx">                                 B22279640D00BF220071B782 /* GradientAttributes.h in Headers */,
</span><span class="cx">                                 B2A015A90AF6CD53006BCE0E /* GraphicsContext.h in Headers */,
</span><span class="cx">                                 49C7B9FC1042D3650009D447 /* GraphicsContext3D.h in Headers */,
</span><span class="lines">@@ -23394,6 +23636,7 @@
</span><span class="cx">                                 A81369DC097374F600D74463 /* HTMLOptionElement.h in Headers */,
</span><span class="cx">                                 A81369DA097374F600D74463 /* HTMLOptionsCollection.h in Headers */,
</span><span class="cx">                                 4AD01009127E642A0015035F /* HTMLOutputElement.h in Headers */,
</span><ins>+                                44C363F00FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h in Headers */,
</ins><span class="cx">                                 51D719F8181106E00016DC51 /* IndexedDB.h in Headers */,
</span><span class="cx">                                 A8EA7CB50A192B9C00A8EF5F /* HTMLParagraphElement.h in Headers */,
</span><span class="cx">                                 A871D4580A127CBC00B12A68 /* HTMLParamElement.h in Headers */,
</span><span class="lines">@@ -23481,6 +23724,7 @@
</span><span class="cx">                                 BC7F44A80B9E324E00A9D081 /* ImageObserver.h in Headers */,
</span><span class="cx">                                 2D5A5931152525D00036EE51 /* ImageOrientation.h in Headers */,
</span><span class="cx">                                 49291E4B134172C800E753DE /* ImageRenderingMode.h in Headers */,
</span><ins>+                                E4C3B1FA0F0E4161009693F6 /* TileCache.h in Headers */,
</ins><span class="cx">                                 B27535710B053814002CE64F /* ImageSource.h in Headers */,
</span><span class="cx">                                 4B3480940EEF50D400AC1B41 /* ImageSourceCG.h in Headers */,
</span><span class="cx">                                 316FE1180E6E1DA700BF6088 /* ImplicitAnimation.h in Headers */,
</span><span class="lines">@@ -23547,6 +23791,7 @@
</span><span class="cx">                                 7AF11A5A12E727490061F23C /* InspectorRuntimeAgent.h in Headers */,
</span><span class="cx">                                 82AB1774125C826700C5069D /* InspectorStyleSheet.h in Headers */,
</span><span class="cx">                                 82889B4D13C62392009A6156 /* InspectorStyleTextEditor.h in Headers */,
</span><ins>+                                31EAF97E121435A400E7C1BF /* DeviceMotionClientIOS.h in Headers */,
</ins><span class="cx">                                 754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */,
</span><span class="cx">                                 578DA20F1520EBA3006141C1 /* InspectorWebTypeBuilders.h in Headers */,
</span><span class="cx">                                 F3810C1C1365A49600ED6E33 /* InspectorWorkerAgent.h in Headers */,
</span><span class="lines">@@ -23606,6 +23851,7 @@
</span><span class="cx">                                 975CA2A21303679D00E99AD9 /* JSCrypto.h in Headers */,
</span><span class="cx">                                 BC46C1FB0C0DDC8F0020CFC3 /* JSCSSCharsetRule.h in Headers */,
</span><span class="cx">                                 409EBDC316B7F3A600CBA3FC /* JSCSSFontFaceLoadEvent.h in Headers */,
</span><ins>+                                7E474E1F12494DC900235364 /* SQLiteDatabaseTracker.h in Headers */,
</ins><span class="cx">                                 BC46C1FD0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h in Headers */,
</span><span class="cx">                                 BC46C1FF0C0DDC8F0020CFC3 /* JSCSSImportRule.h in Headers */,
</span><span class="cx">                                 BC46C2010C0DDC8F0020CFC3 /* JSCSSMediaRule.h in Headers */,
</span><span class="lines">@@ -23632,6 +23878,7 @@
</span><span class="cx">                                 31FB1A66120A5D3F00DC02A0 /* JSDeviceMotionEvent.h in Headers */,
</span><span class="cx">                                 59A86008119DAFA100DEF1EF /* JSDeviceOrientationEvent.h in Headers */,
</span><span class="cx">                                 BCE4389C140B1BA8005E437E /* JSDictionary.h in Headers */,
</span><ins>+                                44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */,
</ins><span class="cx">                                 E4AE7C1A17D232350009FB31 /* ElementAncestorIterator.h in Headers */,
</span><span class="cx">                                 3146FE7518442370001A937C /* JSOESTextureFloatLinear.h in Headers */,
</span><span class="cx">                                 659DDC8309E198BA001BF3C6 /* JSDocument.h in Headers */,
</span><span class="lines">@@ -23652,6 +23899,7 @@
</span><span class="cx">                                 E19AC3F31824DC7900349426 /* CryptoAlgorithmSHA384.h in Headers */,
</span><span class="cx">                                 FB91392A16AE4FC0001FE682 /* JSDOMPath.h in Headers */,
</span><span class="cx">                                 A9D247FF0D757E6900FDF959 /* JSDOMPlugin.h in Headers */,
</span><ins>+                                3140379B124BEA7F00AF40E4 /* WebCoreMotionManager.h in Headers */,
</ins><span class="cx">                                 A9D248010D757E6900FDF959 /* JSDOMPluginArray.h in Headers */,
</span><span class="cx">                                 E19727161820549E00592D51 /* CryptoKeyType.h in Headers */,
</span><span class="cx">                                 BC5A86B60C3367E800EEA649 /* JSDOMSelection.h in Headers */,
</span><span class="lines">@@ -23680,6 +23928,7 @@
</span><span class="cx">                                 3314ACEC10892086000F0E56 /* JSExceptionBase.h in Headers */,
</span><span class="cx">                                 6EBF0E7712A9868800DB170A /* JSEXTDrawBuffers.h in Headers */,
</span><span class="cx">                                 7728698414FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.h in Headers */,
</span><ins>+                                E4E39AFB1330EFA8003AB274 /* TileLayerPool.h in Headers */,
</ins><span class="cx">                                 BC00F0150E0A189500FD04E3 /* JSFile.h in Headers */,
</span><span class="cx">                                 2E3BC0CB117D3E0800B9409A /* JSFileError.h in Headers */,
</span><span class="cx">                                 898785F1122E1E87003AABDA /* JSFileException.h in Headers */,
</span><span class="lines">@@ -23694,6 +23943,7 @@
</span><span class="cx">                                 FE80DA660E9C4703000D6F75 /* JSGeoposition.h in Headers */,
</span><span class="cx">                                 07969DAC17D14151007FF842 /* JSRTCDataChannel.h in Headers */,
</span><span class="cx">                                 8482B7521198CB6B00BFB005 /* JSHashChangeEvent.h in Headers */,
</span><ins>+                                BEA807C90F714A0300524199 /* SelectionRect.h in Headers */,
</ins><span class="cx">                                 BC94D14F0C275C68006BC617 /* JSHistory.h in Headers */,
</span><span class="cx">                                 BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */,
</span><span class="cx">                                 1A4A2DF00A1B852A00C807F8 /* JSHTMLAnchorElement.h in Headers */,
</span><span class="lines">@@ -23752,6 +24002,7 @@
</span><span class="cx">                                 1A85B1EB0A1B240500D8C87C /* JSHTMLOListElement.h in Headers */,
</span><span class="cx">                                 A80E7E9B0A1A83E3007FB8C5 /* JSHTMLOptGroupElement.h in Headers */,
</span><span class="cx">                                 A80E7E990A1A83E3007FB8C5 /* JSHTMLOptionElement.h in Headers */,
</span><ins>+                                C58361A91744523F00173511 /* FontServicesIOS.h in Headers */,
</ins><span class="cx">                                 448A29BF0A46D9CB0030759F /* JSHTMLOptionsCollection.h in Headers */,
</span><span class="cx">                                 4AD0173D127E82860015035F /* JSHTMLOutputElement.h in Headers */,
</span><span class="cx">                                 1AE2ABA70A1CE90500B42B25 /* JSHTMLParagraphElement.h in Headers */,
</span><span class="lines">@@ -23801,6 +24052,7 @@
</span><span class="cx">                                 935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */,
</span><span class="cx">                                 BCE1C43C0D9830D3003B02F2 /* JSLocation.h in Headers */,
</span><span class="cx">                                 FD23A12613F5FA5900F67001 /* JSMediaElementAudioSourceNode.h in Headers */,
</span><ins>+                                26601EBF14B3B9AD0012C0FE /* PlatformEventFactoryIOS.h in Headers */,
</ins><span class="cx">                                 E44614190CD6826900FADA75 /* JSMediaError.h in Headers */,
</span><span class="cx">                                 BC3C39B70C0D3D8D005F4D7A /* JSMediaList.h in Headers */,
</span><span class="cx">                                 D3A94A47122DC40F00A37BBC /* JSMediaQueryList.h in Headers */,
</span><span class="lines">@@ -24076,6 +24328,7 @@
</span><span class="cx">                                 6E3FAD3914733F4000E42306 /* JSWebGLCompressedTextureS3TC.h in Headers */,
</span><span class="cx">                                 6EE8A77310F803F3005A4A24 /* JSWebGLContextAttributes.h in Headers */,
</span><span class="cx">                                 BC2CBF4E140F1ABD003879BE /* JSWebGLContextEvent.h in Headers */,
</span><ins>+                                074300A60F4B8BCF008076CD /* MediaPlayerPrivateIOS.h in Headers */,
</ins><span class="cx">                                 6E3FAD3914733F4011E42307 /* JSWebGLDebugRendererInfo.h in Headers */,
</span><span class="cx">                                 6E3FAD3914733F4022E42307 /* JSWebGLDebugShaders.h in Headers */,
</span><span class="cx">                                 6E3FAD3914733F4000E42307 /* JSWebGLDepthTexture.h in Headers */,
</span><span class="lines">@@ -24088,6 +24341,7 @@
</span><span class="cx">                                 51C9611B183D2B8000D2002E /* IDBDatabaseMetadata.h in Headers */,
</span><span class="cx">                                 A07D3356152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h in Headers */,
</span><span class="cx">                                 49C7B9A51042D2D30009D447 /* JSWebGLTexture.h in Headers */,
</span><ins>+                                3140379D124BEA7F00AF40E4 /* DeviceOrientationClientIOS.h in Headers */,
</ins><span class="cx">                                 078E091517D14D1C00420AA1 /* MediaStream.h in Headers */,
</span><span class="cx">                                 0C45342810CDBBFA00869157 /* JSWebGLUniformLocation.h in Headers */,
</span><span class="cx">                                 77EF62F412F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.h in Headers */,
</span><span class="lines">@@ -24348,6 +24602,7 @@
</span><span class="cx">                                 9377ABA015DEFEEF0031FD04 /* Pagination.h in Headers */,
</span><span class="cx">                                 0885067F11DA045B00182B98 /* PaintInfo.h in Headers */,
</span><span class="cx">                                 0885068011DA045B00182B98 /* PaintPhase.h in Headers */,
</span><ins>+                                07ED35A316D6DCE2002248F3 /* InbandTextTrackPrivateAVFIOS.h in Headers */,
</ins><span class="cx">                                 A80E6CFB0A1989CA007FB8C5 /* Pair.h in Headers */,
</span><span class="cx">                                 FD3160A312B026F700C1A359 /* Panner.h in Headers */,
</span><span class="cx">                                 FD31601A12B0267600C1A359 /* PannerNode.h in Headers */,
</span><span class="lines">@@ -24563,6 +24818,7 @@
</span><span class="cx">                                 2B365C841525119E0091D27B /* RenderSVGEllipse.h in Headers */,
</span><span class="cx">                                 43C092BC12D9E4EE00A989C3 /* RenderSVGForeignObject.h in Headers */,
</span><span class="cx">                                 436708C512D9CA4B00044234 /* RenderSVGGradientStop.h in Headers */,
</span><ins>+                                31AB5000122878A2001A7DB0 /* GraphicsContext3DIOS.h in Headers */,
</ins><span class="cx">                                 436708C712D9CA4B00044234 /* RenderSVGHiddenContainer.h in Headers */,
</span><span class="cx">                                 436708C912D9CA4B00044234 /* RenderSVGImage.h in Headers */,
</span><span class="cx">                                 0854B0151255E4E600B9CDD0 /* RenderSVGInline.h in Headers */,
</span><span class="lines">@@ -24571,6 +24827,7 @@
</span><span class="cx">                                 CD3A496217A9D01B00274E42 /* SourceBuffer.h in Headers */,
</span><span class="cx">                                 436708CB12D9CA4B00044234 /* RenderSVGModelObject.h in Headers */,
</span><span class="cx">                                 E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */,
</span><ins>+                                0F1774801378B772009DA76A /* ScrollAnimatorIOS.h in Headers */,
</ins><span class="cx">                                 ADDF1AD71257CD9A0003A759 /* RenderSVGPath.h in Headers */,
</span><span class="cx">                                 A10BB5851484E3A700B2E87A /* RenderSVGRect.h in Headers */,
</span><span class="cx">                                 436708CD12D9CA4B00044234 /* RenderSVGResource.h in Headers */,
</span><span class="lines">@@ -24753,6 +25010,7 @@
</span><span class="cx">                                 E1B7839C163740A70007B692 /* SharedWorkerStrategy.h in Headers */,
</span><span class="cx">                                 41D168EE10226E89009BC827 /* SharedWorkerThread.h in Headers */,
</span><span class="cx">                                 B2C3DA650D006CD600EF6F26 /* SimpleFontData.h in Headers */,
</span><ins>+                                E4B65A5C132FACB00070E7BE /* TileLayer.h in Headers */,
</ins><span class="cx">                                 C5A1EA7D152BCF08004D00B6 /* SimplifyMarkupCommand.h in Headers */,
</span><span class="cx">                                 31741AAD16636609008A5B7E /* SimulatedClickOptions.h in Headers */,
</span><span class="cx">                                 FD00D7A514A3F61900734011 /* SincResampler.h in Headers */,
</span><span class="lines">@@ -24828,6 +25086,7 @@
</span><span class="cx">                                 51BE37E00DAEE00E001085FC /* StorageArea.h in Headers */,
</span><span class="cx">                                 C5160EEB1004543A00A7CEE2 /* StorageAreaImpl.h in Headers */,
</span><span class="cx">                                 C5102ECF0FD9EF8C00FAFF04 /* StorageAreaSync.h in Headers */,
</span><ins>+                                CD5596921475B678001D0BD0 /* AudioFileReaderIOS.h in Headers */,
</ins><span class="cx">                                 51E0BABB0DA5547100A9E417 /* StorageEvent.h in Headers */,
</span><span class="cx">                                 B56576E817DA94E200A56BDC /* DOMConstructorWithDocument.h in Headers */,
</span><span class="cx">                                 C5EBDD84105EDDEC0056816F /* StorageEventDispatcher.h in Headers */,
</span><span class="lines">@@ -24984,6 +25243,7 @@
</span><span class="cx">                                 B22279FA0D00BF220071B782 /* SVGFEOffsetElement.h in Headers */,
</span><span class="cx">                                 B22279FD0D00BF220071B782 /* SVGFEPointLightElement.h in Headers */,
</span><span class="cx">                                 B2227A000D00BF220071B782 /* SVGFESpecularLightingElement.h in Headers */,
</span><ins>+                                44A20DB90F84166C00B3E1FE /* WebCoreURLResponseIOS.h in Headers */,
</ins><span class="cx">                                 B2227A030D00BF220071B782 /* SVGFESpotLightElement.h in Headers */,
</span><span class="cx">                                 078E091917D14D1C00420AA1 /* MediaStreamTrackEvent.h in Headers */,
</span><span class="cx">                                 B2227A060D00BF220071B782 /* SVGFETileElement.h in Headers */,
</span><span class="lines">@@ -25207,6 +25467,7 @@
</span><span class="cx">                                 97BC84A512370DC8000C6161 /* TextViewSourceParser.h in Headers */,
</span><span class="cx">                                 BCE658FF0EA9248A007E4533 /* Theme.h in Headers */,
</span><span class="cx">                                 BCE659E60EA92FB2007E4533 /* ThemeMac.h in Headers */,
</span><ins>+                                442AF7A9102CDDEA008FD4D3 /* QuickLook.h in Headers */,
</ins><span class="cx">                                 BCE659A90EA927B9007E4533 /* ThemeTypes.h in Headers */,
</span><span class="cx">                                 976D6C95122B8A3D001FD1F7 /* ThreadableBlobRegistry.h in Headers */,
</span><span class="cx">                                 0B90561B0F2578BF0095FF6A /* ThreadableLoader.h in Headers */,
</span><span class="lines">@@ -25221,6 +25482,7 @@
</span><span class="cx">                                 1AF89A421518FDEA00E547B5 /* TiledBacking.h in Headers */,
</span><span class="cx">                                 498770F31242C535002226BA /* TilingData.h in Headers */,
</span><span class="cx">                                 F55B3DDC1251F12D003EF269 /* TimeInputType.h in Headers */,
</span><ins>+                                A516E8B7136E04DB0076C3C0 /* LocalizedDateCache.h in Headers */,
</ins><span class="cx">                                 7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */,
</span><span class="cx">                                 51D719B7181106E00016DC51 /* DOMWindowIndexedDatabase.h in Headers */,
</span><span class="cx">                                 9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
</span><span class="lines">@@ -25888,6 +26150,7 @@
</span><span class="cx">                                 FD8C46EB154608E700A5910C /* AudioScheduledSourceNode.cpp in Sources */,
</span><span class="cx">                                 FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */,
</span><span class="cx">                                 078E090317D14CEE00420AA1 /* MediaStreamTrackEvent.cpp in Sources */,
</span><ins>+                                444D4E230F708B2E003158E0 /* WebCoreURLResponseIOS.mm in Sources */,
</ins><span class="cx">                                 CDA79824170A258300D45C55 /* AudioSession.cpp in Sources */,
</span><span class="cx">                                 CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */,
</span><span class="cx">                                 CD54DE4B17469C6D005E5B36 /* AudioSessionMac.cpp in Sources */,
</span><span class="lines">@@ -25897,6 +26160,7 @@
</span><span class="cx">                                 BE88E0D81715D2A200658D98 /* AudioTrack.cpp in Sources */,
</span><span class="cx">                                 BE88E0DB1715D2A200658D98 /* AudioTrackList.cpp in Sources */,
</span><span class="cx">                                 FD31608A12B026F700C1A359 /* AudioUtilities.cpp in Sources */,
</span><ins>+                                7E428CE513E3407F003B661C /* ResourceHandleIOS.mm in Sources */,
</ins><span class="cx">                                 934F71380D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp in Sources */,
</span><span class="cx">                                 514C764D0CE9234E007EF3CD /* AuthenticationMac.mm in Sources */,
</span><span class="cx">                                 45830D4D1679B4F800ACF8C3 /* AutoscrollController.cpp in Sources */,
</span><span class="lines">@@ -25962,6 +26226,7 @@
</span><span class="cx">                                 49AE2D96134EE5F90072920A /* CalculationValue.cpp in Sources */,
</span><span class="cx">                                 B1827493134CA4C100B98C2D /* CallbackFunction.cpp in Sources */,
</span><span class="cx">                                 6E4E91AC10F7FB3100A2779C /* CanvasContextAttributes.cpp in Sources */,
</span><ins>+                                3140379C124BEA7F00AF40E4 /* WebCoreMotionManager.mm in Sources */,
</ins><span class="cx">                                 49484FC1102CF23C00187DD3 /* CanvasGradient.cpp in Sources */,
</span><span class="cx">                                 FB91392716AE4C34001FE682 /* CanvasPathMethods.cpp in Sources */,
</span><span class="cx">                                 49484FC4102CF23C00187DD3 /* CanvasPattern.cpp in Sources */,
</span><span class="lines">@@ -26028,12 +26293,14 @@
</span><span class="cx">                                 97627B8D14FB3CEE002CDCA1 /* ContextDestructionObserver.cpp in Sources */,
</span><span class="cx">                                 065AD4F60B0C2EDA005A2B1D /* ContextMenuController.cpp in Sources */,
</span><span class="cx">                                 07D07B141834158800ABDD3C /* JSRTCSessionDescriptionCustom.cpp in Sources */,
</span><ins>+                                7E474E2012494DC900235364 /* SQLiteDatabaseTracker.cpp in Sources */,
</ins><span class="cx">                                 06027CB30B1CC03D00884B2D /* ContextMenuItemMac.mm in Sources */,
</span><span class="cx">                                 93B6A0EA0B0BCA8400F5027A /* ContextMenuMac.mm in Sources */,
</span><span class="cx">                                 FD31602812B0267600C1A359 /* ConvolverNode.cpp in Sources */,
</span><span class="cx">                                 E1424C93164B52C800F32D40 /* CookieJar.cpp in Sources */,
</span><span class="cx">                                 E1424C90164B460B00F32D40 /* CookieJarMac.mm in Sources */,
</span><span class="cx">                                 7EE6846312D26E3800E79415 /* CookieStorageCFNet.cpp in Sources */,
</span><ins>+                                37E65950163B10C200EB4574 /* SimpleFontDataIOS.mm in Sources */,
</ins><span class="cx">                                 E13F01F11270E19000DFBA71 /* CookieStorageMac.mm in Sources */,
</span><span class="cx">                                 9746AF2114F4DDE6003E7A72 /* Coordinates.cpp in Sources */,
</span><span class="cx">                                 BC5EB9500E82056B00B25965 /* CounterDirectives.cpp in Sources */,
</span><span class="lines">@@ -26139,6 +26406,7 @@
</span><span class="cx">                                 FE456F181677D74E005EDDF9 /* DatabaseManager.cpp in Sources */,
</span><span class="cx">                                 FEB26D28167A8F2A00FDD26B /* DatabaseServer.cpp in Sources */,
</span><span class="cx">                                 FEDEF84116797108000E444A /* DatabaseStrategy.cpp in Sources */,
</span><ins>+                                E4E39AFD1330EFC6003AB274 /* TileLayerPool.mm in Sources */,
</ins><span class="cx">                                 97BC6A2A1505F081001B74AC /* DatabaseSync.cpp in Sources */,
</span><span class="cx">                                 97BC6A2D1505F081001B74AC /* DatabaseTask.cpp in Sources */,
</span><span class="cx">                                 97BC6A2F1505F081001B74AC /* DatabaseThread.cpp in Sources */,
</span><span class="lines">@@ -26274,6 +26542,7 @@
</span><span class="cx">                                 F5C041E40FFCA96D00839D4A /* DOMHTMLDataListElement.mm in Sources */,
</span><span class="cx">                                 E157A8E818184C67009F821D /* JSCryptoKeyCustom.cpp in Sources */,
</span><span class="cx">                                 0705852317FDC140005F2BCB /* MediaTrackConstraints.cpp in Sources */,
</span><ins>+                                FED13D400CEA939400D89466 /* IconIOS.mm in Sources */,
</ins><span class="cx">                                 E125F8311822F11B00D84CD9 /* CryptoAlgorithmHMAC.cpp in Sources */,
</span><span class="cx">                                 D359D792129CA3C00006E5D2 /* DOMHTMLDetailsElement.mm in Sources */,
</span><span class="cx">                                 85BA4D0C0AA688680088052D /* DOMHTMLDirectoryElement.mm in Sources */,
</span><span class="lines">@@ -26335,6 +26604,7 @@
</span><span class="cx">                                 85BA4D180AA688680088052D /* DOMHTMLUListElement.mm in Sources */,
</span><span class="cx">                                 A8185F3E09765766005826D9 /* DOMImplementation.cpp in Sources */,
</span><span class="cx">                                 93C841FF09CE858300DFF5E5 /* DOMImplementationFront.cpp in Sources */,
</span><ins>+                                26601EC014B3B9AD0012C0FE /* PlatformEventFactoryIOS.mm in Sources */,
</ins><span class="cx">                                 BC1A37BA097C715F0019F3D8 /* DOMInternal.mm in Sources */,
</span><span class="cx">                                 85FF315B0AAFBFCB00374F38 /* DOMKeyboardEvent.mm in Sources */,
</span><span class="cx">                                 850656FF0AAB4763002D15C0 /* DOMMediaList.mm in Sources */,
</span><span class="lines">@@ -26417,6 +26687,7 @@
</span><span class="cx">                                 498770DB1242C535002226BA /* DrawingBuffer.cpp in Sources */,
</span><span class="cx">                                 CDC8B5A6180474F70016E685 /* MediaSourcePrivateAVFObjC.mm in Sources */,
</span><span class="cx">                                 498771531243F9FA002226BA /* DrawingBufferMac.mm in Sources */,
</span><ins>+                                31EAF97F121435A400E7C1BF /* DeviceMotionClientIOS.mm in Sources */,
</ins><span class="cx">                                 078E091217D14CEE00420AA1 /* UserMediaController.cpp in Sources */,
</span><span class="cx">                                 FD6ED2C7136B8E66003CF072 /* DynamicsCompressor.cpp in Sources */,
</span><span class="cx">                                 FD537356137B653B00008DCE /* DynamicsCompressorKernel.cpp in Sources */,
</span><span class="lines">@@ -26618,6 +26889,7 @@
</span><span class="cx">                                 07969DBD17D14151007FF842 /* JSRTCSessionDescriptionCallback.cpp in Sources */,
</span><span class="cx">                                 A871DE290A152AC800B12A68 /* HTMLBodyElement.cpp in Sources */,
</span><span class="cx">                                 A8CFF7A80A156978000A4234 /* HTMLBRElement.cpp in Sources */,
</span><ins>+                                1F68D4AE14BB9DCA007B5C62 /* MemoryPressureHandlerIOS.mm in Sources */,
</ins><span class="cx">                                 A81369D3097374F600D74463 /* HTMLButtonElement.cpp in Sources */,
</span><span class="cx">                                 93F19AFD08245E59001E9ABC /* HTMLCanvasElement.cpp in Sources */,
</span><span class="cx">                                 A8DF3FD1097FA0FC0052981B /* HTMLCollection.cpp in Sources */,
</span><span class="lines">@@ -26629,8 +26901,10 @@
</span><span class="cx">                                 A8EA7CB10A192B9C00A8EF5F /* HTMLDivElement.cpp in Sources */,
</span><span class="cx">                                 A8EA79F50A1916DF00A8EF5F /* HTMLDListElement.cpp in Sources */,
</span><span class="cx">                                 93F19A9108245E59001E9ABC /* HTMLDocument.cpp in Sources */,
</span><ins>+                                44C991820F3D1E0D00586670 /* ScrollbarThemeIOS.mm in Sources */,
</ins><span class="cx">                                 977B3866122883E900B81FF8 /* HTMLDocumentParser.cpp in Sources */,
</span><span class="cx">                                 93309DE7099E64920056E581 /* htmlediting.cpp in Sources */,
</span><ins>+                                A516E8B8136E04DB0076C3C0 /* LocalizedDateCache.mm in Sources */,
</ins><span class="cx">                                 93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */,
</span><span class="cx">                                 E157A8F018185425009F821D /* JSCryptoAlgorithmBuilder.cpp in Sources */,
</span><span class="cx">                                 A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */,
</span><span class="lines">@@ -26861,6 +27135,7 @@
</span><span class="cx">                                 70F546E8B8B5D7DC54EE144E /* JSBeforeUnloadEvent.cpp in Sources */,
</span><span class="cx">                                 FDF09DC81399B62200688E5B /* JSBiquadFilterNode.cpp in Sources */,
</span><span class="cx">                                 FD8AA63C1695148E00D2EA68 /* JSBiquadFilterNodeCustom.cpp in Sources */,
</span><ins>+                                3140379E124BEA7F00AF40E4 /* DeviceOrientationClientIOS.mm in Sources */,
</ins><span class="cx">                                 2E2D99CD10E2BBDA00496337 /* JSBlob.cpp in Sources */,
</span><span class="cx">                                 8931DE5B14C44C44000DC9D2 /* JSBlobCustom.cpp in Sources */,
</span><span class="cx">                                 1449E287107D4DB400B5793F /* JSCallbackData.cpp in Sources */,
</span><span class="lines">@@ -26869,6 +27144,7 @@
</span><span class="cx">                                 65DF323B09D1DE65000BE325 /* JSCanvasPattern.cpp in Sources */,
</span><span class="cx">                                 49EED1421051969400099FAB /* JSCanvasRenderingContext.cpp in Sources */,
</span><span class="cx">                                 49EED1441051969400099FAB /* JSCanvasRenderingContext2D.cpp in Sources */,
</span><ins>+                                CDCA82961679100F00875714 /* TextTrackRepresentationIOS.mm in Sources */,
</ins><span class="cx">                                 49EED14E1051971A00099FAB /* JSCanvasRenderingContext2DCustom.cpp in Sources */,
</span><span class="cx">                                 49EED1501051971A00099FAB /* JSCanvasRenderingContextCustom.cpp in Sources */,
</span><span class="cx">                                 93F9B7A00BA6032600854064 /* JSCDATASection.cpp in Sources */,
</span><span class="lines">@@ -26903,6 +27179,7 @@
</span><span class="cx">                                 BC46C1EE0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp in Sources */,
</span><span class="cx">                                 A8D05FA70A23B301005E7203 /* JSCSSRuleList.cpp in Sources */,
</span><span class="cx">                                 070363E5181A1CDC00C074A5 /* AVMediaCaptureSource.mm in Sources */,
</span><ins>+                                E45390AE0EAFF4B5003695C8 /* SystemMemoryIOS.cpp in Sources */,
</ins><span class="cx">                                 9392262F10321084006E7D5D /* JSCSSRuleListCustom.cpp in Sources */,
</span><span class="cx">                                 142011B60A003133008303F9 /* JSCSSStyleDeclaration.cpp in Sources */,
</span><span class="cx">                                 FFB698CF183402BB00158A31 /* LineInfo.cpp in Sources */,
</span><span class="lines">@@ -26930,6 +27207,7 @@
</span><span class="cx">                                 59A86006119DAF7F00DEF1EF /* JSDeviceOrientationEvent.cpp in Sources */,
</span><span class="cx">                                 590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */,
</span><span class="cx">                                 BCE438A2140C0DC0005E437E /* JSDictionary.cpp in Sources */,
</span><ins>+                                44C363F10FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm in Sources */,
</ins><span class="cx">                                 659DDC8209E198BA001BF3C6 /* JSDocument.cpp in Sources */,
</span><span class="cx">                                 49C7BA8D1042F5B10009D447 /* JSDocumentCustom.cpp in Sources */,
</span><span class="cx">                                 1A494EDE0A123F4C00FDAFC1 /* JSDocumentFragment.cpp in Sources */,
</span><span class="lines">@@ -26941,6 +27219,7 @@
</span><span class="cx">                                 2E0888D41148848A00AF4265 /* JSDOMFormData.cpp in Sources */,
</span><span class="cx">                                 2E0888E6114884E200AF4265 /* JSDOMFormDataCustom.cpp in Sources */,
</span><span class="cx">                                 E1C36CBD0EB08062007410BC /* JSDOMGlobalObject.cpp in Sources */,
</span><ins>+                                07ED35A216D6DCC9002248F3 /* InbandTextTrackPrivateAVFIOS.mm in Sources */,
</ins><span class="cx">                                 65DF31F709D1CC60000BE325 /* JSDOMImplementation.cpp in Sources */,
</span><span class="cx">                                 A9D248060D757E7D00FDF959 /* JSDOMMimeType.cpp in Sources */,
</span><span class="cx">                                 A9D248080D757E7D00FDF959 /* JSDOMMimeTypeArray.cpp in Sources */,
</span><span class="lines">@@ -26983,6 +27262,7 @@
</span><span class="cx">                                 BC6090200E91B8EC000C68B5 /* JSEventTargetCustom.cpp in Sources */,
</span><span class="cx">                                 3314ACEB10892086000F0E56 /* JSExceptionBase.cpp in Sources */,
</span><span class="cx">                                 6EBF0E7612A9868800DB170A /* JSEXTDrawBuffers.cpp in Sources */,
</span><ins>+                                E45390490EAFD637003695C8 /* WebCoreSystemInterfaceIOS.mm in Sources */,
</ins><span class="cx">                                 7728698314FD9ADA00F484DC /* JSEXTTextureFilterAnisotropic.cpp in Sources */,
</span><span class="cx">                                 BC00F0140E0A189500FD04E3 /* JSFile.cpp in Sources */,
</span><span class="cx">                                 2E3BC0CA117D3E0800B9409A /* JSFileError.cpp in Sources */,
</span><span class="lines">@@ -27128,6 +27408,7 @@
</span><span class="cx">                                 CDA98E0416039E1A00FEA3B1 /* JSMediaKeys.cpp in Sources */,
</span><span class="cx">                                 07969DC317D14151007FF842 /* JSRTCStatsResponse.cpp in Sources */,
</span><span class="cx">                                 CDA98E0616039E1F00FEA3B1 /* JSMediaKeySession.cpp in Sources */,
</span><ins>+                                074300A50F4B8BCF008076CD /* MediaPlayerPrivateIOS.mm in Sources */,
</ins><span class="cx">                                 BC3C39B60C0D3D8D005F4D7A /* JSMediaList.cpp in Sources */,
</span><span class="cx">                                 D3A94A46122DC40F00A37BBC /* JSMediaQueryList.cpp in Sources */,
</span><span class="cx">                                 CD641EBF1819B36000EE4C41 /* MediaTimeMac.cpp in Sources */,
</span><span class="lines">@@ -27216,6 +27497,7 @@
</span><span class="cx">                                 51DCE8020CAC9F1C00488358 /* JSSQLResultSetRowListCustom.cpp in Sources */,
</span><span class="cx">                                 51EAC5671815ED3E004F1BA4 /* IDBTransactionCoordinator.cpp in Sources */,
</span><span class="cx">                                 B59DD6A611902A62007E9684 /* JSSQLStatementCallback.cpp in Sources */,
</span><ins>+                                AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerIOS.mm in Sources */,
</ins><span class="cx">                                 B59DD6AA11902A71007E9684 /* JSSQLStatementErrorCallback.cpp in Sources */,
</span><span class="cx">                                 514C76380CE9225E007EF3CD /* JSSQLTransaction.cpp in Sources */,
</span><span class="cx">                                 B59DD69E11902A42007E9684 /* JSSQLTransactionCallback.cpp in Sources */,
</span><span class="lines">@@ -27283,6 +27565,7 @@
</span><span class="cx">                                 B2FA3D760AB75A6F000E5AC4 /* JSSVGFEDistantLightElement.cpp in Sources */,
</span><span class="cx">                                 4358E87C1360A2EE00E4748C /* JSSVGFEDropShadowElement.cpp in Sources */,
</span><span class="cx">                                 B2FA3D780AB75A6F000E5AC4 /* JSSVGFEFloodElement.cpp in Sources */,
</span><ins>+                                44C991A00F3D210E00586670 /* ThemeIOS.mm in Sources */,
</ins><span class="cx">                                 B2FA3D7A0AB75A6F000E5AC4 /* JSSVGFEFuncAElement.cpp in Sources */,
</span><span class="cx">                                 B2FA3D7C0AB75A6F000E5AC4 /* JSSVGFEFuncBElement.cpp in Sources */,
</span><span class="cx">                                 B2FA3D7E0AB75A6F000E5AC4 /* JSSVGFEFuncGElement.cpp in Sources */,
</span><span class="lines">@@ -27306,6 +27589,7 @@
</span><span class="cx">                                 A83B79030CCAFF15000B0825 /* JSSVGFontFaceNameElement.cpp in Sources */,
</span><span class="cx">                                 A83B78FF0CCAFF15000B0825 /* JSSVGFontFaceSrcElement.cpp in Sources */,
</span><span class="cx">                                 A83B78FD0CCAFF15000B0825 /* JSSVGFontFaceUriElement.cpp in Sources */,
</span><ins>+                                E453904D0EAFD637003695C8 /* WidgetIOS.mm in Sources */,
</ins><span class="cx">                                 B2FA3D980AB75A6F000E5AC4 /* JSSVGForeignObjectElement.cpp in Sources */,
</span><span class="cx">                                 B2FA3D9A0AB75A6F000E5AC4 /* JSSVGGElement.cpp in Sources */,
</span><span class="cx">                                 B27B28270CEF0C0700D39D54 /* JSSVGGlyphElement.cpp in Sources */,
</span><span class="lines">@@ -27315,6 +27599,7 @@
</span><span class="cx">                                 85174EC2BCCAF17EAE3F46F8 /* JSSVGGraphicsElement.cpp in Sources */,
</span><span class="cx">                                 8485227B1190162C006EDC7F /* JSSVGHKernElement.cpp in Sources */,
</span><span class="cx">                                 B2FA3D9E0AB75A6F000E5AC4 /* JSSVGImageElement.cpp in Sources */,
</span><ins>+                                E424A3A01330DF1E00CF6DC9 /* TileGridTile.mm in Sources */,
</ins><span class="cx">                                 B2FA3DA00AB75A6F000E5AC4 /* JSSVGLength.cpp in Sources */,
</span><span class="cx">                                 077664FC183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp in Sources */,
</span><span class="cx">                                 08E4FE460E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp in Sources */,
</span><span class="lines">@@ -27341,6 +27626,7 @@
</span><span class="cx">                                 B2FA3DC00AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicRel.cpp in Sources */,
</span><span class="cx">                                 B2FA3DC20AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothAbs.cpp in Sources */,
</span><span class="cx">                                 B2FA3DC40AB75A6F000E5AC4 /* JSSVGPathSegCurvetoCubicSmoothRel.cpp in Sources */,
</span><ins>+                                E4B65A5E132FADB60070E7BE /* TileLayer.mm in Sources */,
</ins><span class="cx">                                 B2FA3DC60AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticAbs.cpp in Sources */,
</span><span class="cx">                                 B2FA3DC80AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticRel.cpp in Sources */,
</span><span class="cx">                                 B2FA3DCA0AB75A6F000E5AC4 /* JSSVGPathSegCurvetoQuadraticSmoothAbs.cpp in Sources */,
</span><span class="lines">@@ -27384,6 +27670,7 @@
</span><span class="cx">                                 B2FA3E0E0AB75A6F000E5AC4 /* JSSVGTRefElement.cpp in Sources */,
</span><span class="cx">                                 070363D6181A146500C074A5 /* MediaStreamSourceStates.cpp in Sources */,
</span><span class="cx">                                 B2FA3E100AB75A6F000E5AC4 /* JSSVGTSpanElement.cpp in Sources */,
</span><ins>+                                E45390430EAFD637003695C8 /* PlatformScreenIOS.mm in Sources */,
</ins><span class="cx">                                 B2FA3E120AB75A6F000E5AC4 /* JSSVGUnitTypes.cpp in Sources */,
</span><span class="cx">                                 E125F85118283A5600D84CD9 /* JSCryptoKeySerializationJWK.cpp in Sources */,
</span><span class="cx">                                 B2FA3E140AB75A6F000E5AC4 /* JSSVGUseElement.cpp in Sources */,
</span><span class="lines">@@ -27483,6 +27770,7 @@
</span><span class="cx">                                 BCEFE1EA0DCA5F6400739219 /* JSXSLTProcessor.cpp in Sources */,
</span><span class="cx">                                 BCEFE1E50DCA5F3300739219 /* JSXSLTProcessorCustom.cpp in Sources */,
</span><span class="cx">                                 85031B430A44EFC700F992E0 /* KeyboardEvent.cpp in Sources */,
</span><ins>+                                C58361AA1744523F00173511 /* FontServicesIOS.mm in Sources */,
</ins><span class="cx">                                 A513B3D8114B166A001C429B /* KeyEventCocoa.mm in Sources */,
</span><span class="cx">                                 2655413A1489811C000DFC5D /* KeyEventIOS.mm in Sources */,
</span><span class="cx">                                 511EF2C117F0FD3500E4FA16 /* JSIDBCursor.cpp in Sources */,
</span><span class="lines">@@ -27544,10 +27832,12 @@
</span><span class="cx">                                 510194441836F7E400925523 /* IDBCursorBackendOperations.cpp in Sources */,
</span><span class="cx">                                 FABE72F41059C1EB00D999DD /* MathMLElement.cpp in Sources */,
</span><span class="cx">                                 FABE72FD1059C21100D999DD /* MathMLElementFactory.cpp in Sources */,
</span><ins>+                                BEA807C80F714A0300524199 /* SelectionRect.cpp in Sources */,
</ins><span class="cx">                                 FABE72F61059C1EB00D999DD /* MathMLInlineContainerElement.cpp in Sources */,
</span><span class="cx">                                 FABE72F81059C1EB00D999DD /* MathMLMathElement.cpp in Sources */,
</span><span class="cx">                                 FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */,
</span><span class="cx">                                 FA654A6B1108ABED002615E0 /* MathMLTextElement.cpp in Sources */,
</span><ins>+                                E45390450EAFD637003695C8 /* ScrollViewIOS.mm in Sources */,
</ins><span class="cx">                                 49D5DC2B0F423A73008F20FD /* Matrix3DTransformOperation.cpp in Sources */,
</span><span class="cx">                                 49E911C60EF86D47009D0CAF /* MatrixTransformOperation.cpp in Sources */,
</span><span class="cx">                                 417253AA1354BBBC00360F2A /* MediaControlElements.cpp in Sources */,
</span><span class="lines">@@ -27583,11 +27873,13 @@
</span><span class="cx">                                 93309DF9099E64920056E581 /* MergeIdenticalElementsCommand.cpp in Sources */,
</span><span class="cx">                                 E1ADECCF0E76AD8B004A1A5E /* MessageChannel.cpp in Sources */,
</span><span class="cx">                                 75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */,
</span><ins>+                                443F04270E75C8FB007E5407 /* NetworkStateNotifierIOS.cpp in Sources */,
</ins><span class="cx">                                 E1ADECC00E76ACF1004A1A5E /* MessagePort.cpp in Sources */,
</span><span class="cx">                                 A78E526F1346BD1700AD9C31 /* MeterShadowElement.cpp in Sources */,
</span><span class="cx">                                 37DDCD9413844FD50008B793 /* MIMEHeader.cpp in Sources */,
</span><span class="cx">                                 BC772C4E0C4EB3040083285F /* MIMETypeRegistry.cpp in Sources */,
</span><span class="cx">                                 BC772C5E0C4EB3440083285F /* MIMETypeRegistryMac.mm in Sources */,
</span><ins>+                                E45390470EAFD637003695C8 /* SoundIOS.mm in Sources */,
</ins><span class="cx">                                 52F10865162B6DA4009AC81E /* MixedContentChecker.cpp in Sources */,
</span><span class="cx">                                 C6D74AE409AA290A000B0A52 /* ModifySelectionListLevel.cpp in Sources */,
</span><span class="cx">                                 F55B3DC51251F12D003EF269 /* MonthInputType.cpp in Sources */,
</span><span class="lines">@@ -27675,6 +27967,7 @@
</span><span class="cx">                                 E1284AEA10447DEE00EAEB52 /* PageTransitionEvent.cpp in Sources */,
</span><span class="cx">                                 516730A3182D8FBB003FAF5C /* IDBCursorBackend.cpp in Sources */,
</span><span class="cx">                                 51E1ECC20C91C90400DC255B /* PageURLRecord.cpp in Sources */,
</span><ins>+                                3727DFD5142AAE4500D449CB /* FontCacheIOS.mm in Sources */,
</ins><span class="cx">                                 FFD5B97A135CC97800D5E92A /* PageVisibilityState.cpp in Sources */,
</span><span class="cx">                                 FD3160A212B026F700C1A359 /* Panner.cpp in Sources */,
</span><span class="cx">                                 FD31601912B0267600C1A359 /* PannerNode.cpp in Sources */,
</span><span class="lines">@@ -27703,6 +27996,7 @@
</span><span class="cx">                                 4958782212A57DDF007238AC /* PlatformCALayerMac.mm in Sources */,
</span><span class="cx">                                 CDEA763014608A53008B31F1 /* PlatformClockCA.cpp in Sources */,
</span><span class="cx">                                 CDAA8D0A14D71B2E0061EA60 /* PlatformClockCM.mm in Sources */,
</span><ins>+                                442AF7AA102CDDEA008FD4D3 /* QuickLook.mm in Sources */,
</ins><span class="cx">                                 BCAA486F14A052530088FAC4 /* PlatformEventFactoryMac.mm in Sources */,
</span><span class="cx">                                 F544F78815CFB2A800AF33A8 /* PlatformLocale.cpp in Sources */,
</span><span class="cx">                                 41BF700F0FE86F61005E8DEC /* PlatformMessagePortChannel.cpp in Sources */,
</span><span class="lines">@@ -27791,6 +28085,7 @@
</span><span class="cx">                                 BCEA4877097D93020094C9E4 /* RenderInline.cpp in Sources */,
</span><span class="cx">                                 BCEA4879097D93020094C9E4 /* RenderLayer.cpp in Sources */,
</span><span class="cx">                                 0F580D000F12DE9B0051D689 /* RenderLayerBacking.cpp in Sources */,
</span><ins>+                                E453901D0EAFCACA003695C8 /* MIMETypeRegistryIOS.mm in Sources */,
</ins><span class="cx">                                 0F580CFE0F12DE9B0051D689 /* RenderLayerCompositor.cpp in Sources */,
</span><span class="cx">                                 50D10D991545F5760096D288 /* RenderLayerFilterInfo.cpp in Sources */,
</span><span class="cx">                                 3C244FEBA375AC633F88BE6F /* RenderLayerModelObject.cpp in Sources */,
</span><span class="lines">@@ -27850,6 +28145,7 @@
</span><span class="cx">                                 A8DF4AEA0980C42C0052981B /* RenderTableCell.cpp in Sources */,
</span><span class="cx">                                 A8DF4AE80980C42C0052981B /* RenderTableCol.cpp in Sources */,
</span><span class="cx">                                 A8DF4AF00980C42C0052981B /* RenderTableRow.cpp in Sources */,
</span><ins>+                                E4B65A5A132FAAF90070E7BE /* TileGrid.mm in Sources */,
</ins><span class="cx">                                 A8DF4AED0980C42C0052981B /* RenderTableSection.cpp in Sources */,
</span><span class="cx">                                 BCEA488B097D93020094C9E4 /* RenderText.cpp in Sources */,
</span><span class="cx">                                 AB67D1A8097F3AE300F9392E /* RenderTextControl.cpp in Sources */,
</span><span class="lines">@@ -27948,6 +28244,7 @@
</span><span class="cx">                                 0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */,
</span><span class="cx">                                 1AF62EE714DA22A70041556C /* ScrollingCoordinator.cpp in Sources */,
</span><span class="cx">                                 1AF62EE614DA22A70041556C /* ScrollingCoordinatorMac.mm in Sources */,
</span><ins>+                                CD5596911475B678001D0BD0 /* AudioFileReaderIOS.cpp in Sources */,
</ins><span class="cx">                                 93C38BFE164473C700091EB2 /* ScrollingStateFixedNode.cpp in Sources */,
</span><span class="cx">                                 931CBD0C161A44E900E4C874 /* ScrollingStateNode.cpp in Sources */,
</span><span class="cx">                                 931CBD13161A44F800E4C874 /* ScrollingStateNodeMac.mm in Sources */,
</span><span class="lines">@@ -27986,6 +28283,7 @@
</span><span class="cx">                                 BC5EB8C30E82031B00B25965 /* ShadowData.cpp in Sources */,
</span><span class="cx">                                 A6D169621346B49B000EB770 /* ShadowRoot.cpp in Sources */,
</span><span class="cx">                                 FD45A953175D3FB800C21EC8 /* Shape.cpp in Sources */,
</span><ins>+                                2903716516BA11BC00FEFDF0 /* ContentFilterIOS.mm in Sources */,
</ins><span class="cx">                                 FD45A954175D3FB800C21EC8 /* ShapeInfo.cpp in Sources */,
</span><span class="cx">                                 FD45A955175D3FB800C21EC8 /* ShapeInsideInfo.cpp in Sources */,
</span><span class="cx">                                 FD45A956175D3FB800C21EC8 /* ShapeOutsideInfo.cpp in Sources */,
</span><span class="lines">@@ -28177,6 +28475,7 @@
</span><span class="cx">                                 CDE3A85717F6020400C5BE20 /* AudioTrackPrivateAVFObjC.mm in Sources */,
</span><span class="cx">                                 B22279B30D00BF220071B782 /* SVGDocument.cpp in Sources */,
</span><span class="cx">                                 B28C6A270D00C44800334AA4 /* SVGDocumentExtensions.cpp in Sources */,
</span><ins>+                                0F1774811378B772009DA76A /* ScrollAnimatorIOS.mm in Sources */,
</ins><span class="cx">                                 B22279B60D00BF220071B782 /* SVGElement.cpp in Sources */,
</span><span class="cx">                                 A833C8520A2CF52800D57664 /* SVGElementFactory.cpp in Sources */,
</span><span class="cx">                                 B22279B90D00BF220071B782 /* SVGElementInstance.cpp in Sources */,
</span><span class="lines">@@ -28269,6 +28568,7 @@
</span><span class="cx">                                 B2227A580D00BF220071B782 /* SVGPathElement.cpp in Sources */,
</span><span class="cx">                                 8476C9EF11DF6A5800555B02 /* SVGPathParser.cpp in Sources */,
</span><span class="cx">                                 B2227A800D00BF220071B782 /* SVGPathSegList.cpp in Sources */,
</span><ins>+                                FE0D84EB1048436E001A179E /* WebEvent.mm in Sources */,
</ins><span class="cx">                                 8476C9E511DF6A0B00555B02 /* SVGPathSegListBuilder.cpp in Sources */,
</span><span class="cx">                                 CDF2B0181820540700F2B424 /* MockTracks.cpp in Sources */,
</span><span class="cx">                                 08FF102012950F5A00F00276 /* SVGPathSegListPropertyTearOff.cpp in Sources */,
</span><span class="lines">@@ -28371,6 +28671,7 @@
</span><span class="cx">                                 498770F01242C535002226BA /* Texture.cpp in Sources */,
</span><span class="cx">                                 97BC84A412370DC8000C6161 /* TextViewSourceParser.cpp in Sources */,
</span><span class="cx">                                 BCE65D320EAD1211007E4533 /* Theme.cpp in Sources */,
</span><ins>+                                E4C3B1FC0F0E4170009693F6 /* TileCache.mm in Sources */,
</ins><span class="cx">                                 BCE659E90EA92FFA007E4533 /* ThemeMac.mm in Sources */,
</span><span class="cx">                                 976D6C94122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp in Sources */,
</span><span class="cx">                                 0B90561E0F257E930095FF6A /* ThreadableLoader.cpp in Sources */,
</span><span class="lines">@@ -28459,6 +28760,7 @@
</span><span class="cx">                                 7E66E23316D6EB6C00F7E7FF /* WebGLCompressedTextureATC.cpp in Sources */,
</span><span class="cx">                                 7E66E23317E6EB6C00F7E7FF /* WebGLCompressedTexturePVRTC.cpp in Sources */,
</span><span class="cx">                                 6E3FAE8E14733FDB00E42306 /* WebGLCompressedTextureS3TC.cpp in Sources */,
</span><ins>+                                0F97A658155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm in Sources */,
</ins><span class="cx">                                 6E4E91AE10F7FB3100A2779C /* WebGLContextAttributes.cpp in Sources */,
</span><span class="cx">                                 93F6F1ED127F70B10055CB06 /* WebGLContextEvent.cpp in Sources */,
</span><span class="cx">                                 01D3CF8214BD0A3000FE9970 /* WebGLContextGroup.cpp in Sources */,
</span><span class="lines">@@ -28584,6 +28886,7 @@
</span><span class="cx">                                 E1EC299F0BB04C6B00EA187B /* XPathNodeSet.cpp in Sources */,
</span><span class="cx">                                 1AB7FC750A8B92EC00D9D37B /* XPathNSResolver.cpp in Sources */,
</span><span class="cx">                                 1AB7FC780A8B92EC00D9D37B /* XPathParser.cpp in Sources */,
</span><ins>+                                4476531B133170990006B789 /* SSLKeyGeneratorIOS.cpp in Sources */,
</ins><span class="cx">                                 1AB7FC7A0A8B92EC00D9D37B /* XPathPath.cpp in Sources */,
</span><span class="cx">                                 1AB7FC7C0A8B92EC00D9D37B /* XPathPredicate.cpp in Sources */,
</span><span class="cx">                                 1AB7FC7E0A8B92EC00D9D37B /* XPathResult.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformContentFilterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ContentFilter.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ContentFilter.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ContentFilter.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -32,6 +32,10 @@
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;wtf/Functional.h&gt;
+#endif
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> OBJC_CLASS WebFilterEvaluator;
</span><span class="cx"> #endif
</span><span class="lines">@@ -51,6 +55,11 @@
</span><span class="cx">     bool didBlockData() const;
</span><span class="cx">     const char* getReplacementData(int&amp; length) const;
</span><span class="cx">     
</span><ins>+#if PLATFORM(IOS)
+    static const char* scheme();
+    void requestUnblockAndDispatchIfSuccessful(Function&lt;void()&gt;);
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit ContentFilter(const ResourceResponse&amp;);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformDragDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/DragData.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/DragData.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/DragData.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -55,11 +55,10 @@
</span><span class="cx"> class DataObjectGtk;
</span><span class="cx"> }
</span><span class="cx"> typedef WebCore::DataObjectGtk* DragDataRef;
</span><del>-#elif PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(NIX)
</del><ins>+#elif PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(NIX) || PLATFORM(IOS)
</ins><span class="cx"> typedef void* DragDataRef;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Frame;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileChoosercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/FileChooser.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileChooser.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/FileChooser.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -75,6 +75,25 @@
</span><span class="cx">     m_client-&gt;filesChosen(files);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+// FIXME: This function is almost identical to FileChooser::chooseFiles(). We should merge this function
+// with FileChooser::chooseFiles() and hence remove the PLATFORM(IOS)-guard.
+void FileChooser::chooseMediaFiles(const Vector&lt;String&gt;&amp; filenames, const String&amp; displayString, Icon* icon)
+{
+    // FIXME: This is inelegant. We should not be looking at settings here.
+    if (m_settings.selectedFiles == filenames)
+        return;
+
+    if (!m_client)
+        return;
+
+    Vector&lt;FileChooserFileInfo&gt; files;
+    for (auto filename : filenames)
+        files.append(FileChooserFileInfo(filename));
+    m_client-&gt;filesChosen(files, displayString, icon);
+}
+#endif
+
</ins><span class="cx"> void FileChooser::chooseFiles(const Vector&lt;FileChooserFileInfo&gt;&amp; files)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: This is inelegant. We should not be looking at settings here.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileChooserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/FileChooser.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileChooser.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/FileChooser.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class FileChooser;
</span><ins>+class Icon;
</ins><span class="cx"> 
</span><span class="cx"> struct FileChooserFileInfo {
</span><span class="cx">     FileChooserFileInfo(const String&amp; path, const String&amp; displayName = String())
</span><span class="lines">@@ -70,6 +71,11 @@
</span><span class="cx">     virtual ~FileChooserClient() { }
</span><span class="cx"> 
</span><span class="cx">     virtual void filesChosen(const Vector&lt;FileChooserFileInfo&gt;&amp;) = 0;
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: This function is almost identical to FileChooser::filesChosen(). We should merge this
+    // function with FileChooser::filesChosen() and hence remove the PLATFORM(IOS)-guard.
+    virtual void filesChosen(const Vector&lt;FileChooserFileInfo&gt;&amp;, const String&amp; displayString, Icon*) = 0;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class FileChooser : public RefCounted&lt;FileChooser&gt; {
</span><span class="lines">@@ -81,6 +87,11 @@
</span><span class="cx"> 
</span><span class="cx">     void chooseFile(const String&amp; path);
</span><span class="cx">     void chooseFiles(const Vector&lt;String&gt;&amp; paths);
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: This function is almost identical to FileChooser::chooseFiles(). We should merge this
+    // function with FileChooser::chooseFiles() and hence remove the PLATFORM(IOS)-guard.
+    void chooseMediaFiles(const Vector&lt;String&gt;&amp; paths, const String&amp; displayString, Icon*);
+#endif    
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: We should probably just pass file paths that could be virtual paths with proper display names rather than passing structs.
</span><span class="cx">     void chooseFiles(const Vector&lt;FileChooserFileInfo&gt;&amp; files);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileSystemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/FileSystem.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileSystem.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/FileSystem.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -97,6 +97,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(MAC) || PLATFORM(IOS)
</span><span class="cx"> 
</span><ins>+void setMetadataURL(String&amp;, const String&amp;, const String&amp;)
+{
+}
+
</ins><span class="cx"> bool canExcludeFromBackup()
</span><span class="cx"> {
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformFileSystemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/FileSystem.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/FileSystem.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/FileSystem.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -151,6 +151,8 @@
</span><span class="cx"> String pathGetFileName(const String&amp;);
</span><span class="cx"> String directoryName(const String&amp;);
</span><span class="cx"> 
</span><ins>+void setMetadataURL(String&amp; URLString, const String&amp; referrer, const String&amp; path);
+
</ins><span class="cx"> bool canExcludeFromBackup(); // Returns true if any file can ever be excluded from backup.
</span><span class="cx"> bool excludeFromBackup(const String&amp;); // Returns true if successful.
</span><span class="cx"> 
</span><span class="lines">@@ -189,10 +191,6 @@
</span><span class="cx"> RetainPtr&lt;CFURLRef&gt; pathAsURL(const String&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
-void setMetadataURL(String&amp; URLString, const String&amp; referrer, const String&amp; path);
-#endif
-
</del><span class="cx"> #if PLATFORM(GTK) || PLATFORM(NIX)
</span><span class="cx"> String filenameToString(const char*);
</span><span class="cx"> String filenameForDisplay(const String&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformKillRingNonecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/KillRingNone.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/KillRingNone.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/KillRingNone.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -50,3 +50,4 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><ins>+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformLocalizedStringscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/LocalizedStrings.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(CONTEXT_MENUS)
</ins><span class="cx"> static String truncatedStringForLookupMenuItem(const String&amp; original)
</span><span class="cx"> {
</span><span class="cx">     if (original.isEmpty())
</span><span class="lines">@@ -84,6 +85,7 @@
</span><span class="cx">     unsigned numberOfCharacters = numCharactersInGraphemeClusters(trimmed, maxNumberOfGraphemeClustersInLookupMenuItem);
</span><span class="cx">     return numberOfCharacters == trimmed.length() ? trimmed : trimmed.left(numberOfCharacters) + ellipsis;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> String inputElementAltText()
</span><span class="cx"> {
</span><span class="lines">@@ -797,6 +799,26 @@
</span><span class="cx">         return formatLocalizedString(WEB_UI_STRING(&quot;%zu Items&quot;, &quot;Present the number of selected &lt;option&gt; items in a &lt;select multiple&gt; element (iOS only)&quot;), count);
</span><span class="cx">     }
</span><span class="cx"> }
</span><ins>+
+String fileButtonChooseMediaFileLabel()
+{
+    return WEB_UI_STRING(&quot;Choose Media (Single)&quot;, &quot;Title for file button used in HTML forms for media files&quot;);
+}
+
+String fileButtonChooseMultipleMediaFilesLabel()
+{
+    return WEB_UI_STRING(&quot;Choose Media (Multiple)&quot;, &quot;Title for file button used in HTML5 forms for multiple media files&quot;);
+}
+
+String fileButtonNoMediaFileSelectedLabel()
+{
+    return WEB_UI_STRING(&quot;no media selected (single)&quot;, &quot;Text to display in file button used in HTML forms for media files when no media file is selected&quot;);
+}
+
+String fileButtonNoMediaFilesSelectedLabel()
+{
+    return WEB_UI_STRING(&quot;no media selected (multiple)&quot;, &quot;Text to display in file button used in HTML forms for media files when no media files are selected and the button allows multiple files to be selected&quot;);
+}
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> String imageTitle(const String&amp; filename, const IntSize&amp; size)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLocalizedStringsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/LocalizedStrings.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -145,6 +145,7 @@
</span><span class="cx">     String contextMenuItemTagInspectElement();
</span><span class="cx"> #endif // ENABLE(CONTEXT_MENUS)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     String searchMenuNoRecentSearchesText();
</span><span class="cx">     String searchMenuRecentSearchesText();
</span><span class="cx">     String searchMenuClearRecentSearchesText();
</span><span class="lines">@@ -171,6 +172,7 @@
</span><span class="cx">     String AXMenuListPopupActionVerb();
</span><span class="cx">     String AXLinkActionVerb();
</span><span class="cx">     String AXListItemActionVerb();
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(INPUT_TYPE_WEEK)
</span><span class="cx">     // weekFormatInLDML() returns week and year format in LDML, Unicode
</span><span class="lines">@@ -206,6 +208,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     String htmlSelectMultipleItems(size_t num);
</span><ins>+    String fileButtonChooseMediaFileLabel();
+    String fileButtonChooseMultipleMediaFilesLabel();
+    String fileButtonNoMediaFileSelectedLabel();
+    String fileButtonNoMediaFilesSelectedLabel();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     String imageTitle(const String&amp; filename, const IntSize&amp; size);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLoggingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Logging.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Logging.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/Logging.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx">     M(LiveConnect) \
</span><span class="cx">     M(Loading) \
</span><span class="cx">     M(Media) \
</span><ins>+    M(MemoryPressure) \
</ins><span class="cx">     M(Network) \
</span><span class="cx">     M(NotYetImplemented) \
</span><span class="cx">     M(PageCache) \
</span><span class="lines">@@ -61,6 +62,7 @@
</span><span class="cx">     M(Plugins) \
</span><span class="cx">     M(PopupBlocking) \
</span><span class="cx">     M(Progress) \
</span><ins>+    M(RemoteInspector) \
</ins><span class="cx">     M(ResourceLoading) \
</span><span class="cx">     M(SQLDatabase) \
</span><span class="cx">     M(SpellingAndGrammar) \
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMIMETypeRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MIMETypeRegistry.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -36,7 +36,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> #include &quot;ImageSourceCG.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;ImageIO/CGImageDestination.h&gt;
+#endif
</ins><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -224,6 +228,34 @@
</span><span class="cx">     supportedImageMIMETypes-&gt;remove(&quot;application/pdf&quot;);
</span><span class="cx">     supportedImageMIMETypes-&gt;remove(&quot;application/postscript&quot;);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // Add malformed image mimetype for compatibility with Mail and to handle malformed mimetypes from the net
+    // These were removed for &lt;rdar://problem/6564538&gt; Re-enable UTI code in WebCore now that MobileCoreServices exists
+    // But Mail relies on at least image/tif reported as being supported (should be image/tiff).
+    // This can be removed when Mail addresses:
+    // &lt;rdar://problem/7879510&gt; Mail should use standard image mimetypes 
+    // and we fix sniffing so that it corrects items such as image/jpg -&gt; image/jpeg.
+    static const char* malformedMIMETypes[] = {
+        // JPEG (image/jpeg)
+        &quot;image/jpg&quot;, &quot;image/jp_&quot;, &quot;image/jpe_&quot;, &quot;application/jpg&quot;, &quot;application/x-jpg&quot;, &quot;image/pipeg&quot;,
+        &quot;image/vnd.switfview-jpeg&quot;, &quot;image/x-xbitmap&quot;,
+        // GIF (image/gif)
+        &quot;image/gi_&quot;,
+        // PNG (image/png)
+        &quot;application/png&quot;, &quot;application/x-png&quot;,
+        // TIFF (image/tiff)
+        &quot;image/x-tif&quot;, &quot;image/tif&quot;, &quot;image/x-tiff&quot;, &quot;application/tif&quot;, &quot;application/x-tif&quot;, &quot;application/tiff&quot;,
+        &quot;application/x-tiff&quot;,
+        // BMP (image/bmp, image/x-bitmap)
+        &quot;image/x-bmp&quot;, &quot;image/x-win-bitmap&quot;, &quot;image/x-windows-bmp&quot;, &quot;image/ms-bmp&quot;, &quot;image/x-ms-bmp&quot;,
+        &quot;application/bmp&quot;, &quot;application/x-bmp&quot;, &quot;application/x-win-bitmap&quot;,
+    };
+    for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(malformedMIMETypes); ++i) {
+        supportedImageMIMETypes-&gt;add(malformedMIMETypes[i]);
+        supportedImageResourceMIMETypes-&gt;add(malformedMIMETypes[i]);
+    }
+#endif
+
</ins><span class="cx"> #else
</span><span class="cx">     // assume that all implementations at least support the following standard
</span><span class="cx">     // image types:
</span><span class="lines">@@ -331,9 +363,11 @@
</span><span class="cx">         &quot;text/&quot;,
</span><span class="cx">         &quot;application/xml&quot;,
</span><span class="cx">         &quot;application/xhtml+xml&quot;,
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         &quot;application/vnd.wap.xhtml+xml&quot;,
</span><span class="cx">         &quot;application/rss+xml&quot;,
</span><span class="cx">         &quot;application/atom+xml&quot;,
</span><ins>+#endif
</ins><span class="cx">         &quot;application/json&quot;,
</span><span class="cx"> #if ENABLE(SVG)
</span><span class="cx">         &quot;image/svg+xml&quot;,
</span><span class="lines">@@ -440,7 +474,11 @@
</span><span class="cx">         &quot;text/x-qif&quot;,
</span><span class="cx">         &quot;text/x-csv&quot;,
</span><span class="cx">         &quot;text/x-vcf&quot;,
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         &quot;text/rtf&quot;,
</span><ins>+#else
+        &quot;text/vnd.sun.j2me.app-descriptor&quot;,
+#endif
</ins><span class="cx">     };
</span><span class="cx">     for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(types); ++i)
</span><span class="cx">       unsupportedTextMIMETypes-&gt;add(types[i]);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -40,6 +40,14 @@
</span><span class="cx">     : m_installed(false)
</span><span class="cx">     , m_lastRespondTime(0)
</span><span class="cx">     , m_lowMemoryHandler(releaseMemory)
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: Can we share more of this with OpenSource?
+    , m_receivedMemoryPressure(0)
+    , m_memoryPressureReason(MemoryPressureReasonNone)
+    , m_clearPressureOnMemoryRelease(true)
+    , m_releaseMemoryBlock(0)
+    , m_observer(0)
+#endif
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -49,7 +57,9 @@
</span><span class="cx"> void MemoryPressureHandler::uninstall() { }
</span><span class="cx"> void MemoryPressureHandler::holdOff(unsigned) { }
</span><span class="cx"> void MemoryPressureHandler::respondToMemoryPressure() { }
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> void MemoryPressureHandler::releaseMemory(bool) { }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,8 +29,20 @@
</span><span class="cx"> #include &lt;time.h&gt;
</span><span class="cx"> #include &lt;wtf/FastMalloc.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;wtf/ThreadingPrimitives.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+enum MemoryPressureReason {
+    MemoryPressureReasonNone = 0 &lt;&lt; 0,
+    MemoryPressureReasonVMPressure = 1 &lt;&lt; 0,
+    MemoryPressureReasonVMStatus = 1 &lt;&lt; 1,
+};
+#endif
+
</ins><span class="cx"> typedef void (*LowMemoryHandler)(bool critical);
</span><span class="cx"> 
</span><span class="cx"> class MemoryPressureHandler {
</span><span class="lines">@@ -46,6 +58,16 @@
</span><span class="cx">         m_lowMemoryHandler = handler;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: Can we share more of this with OpenSource?
+    void installMemoryReleaseBlock(void (^releaseMemoryBlock)(), bool clearPressureOnMemoryRelease = true);
+    void setReceivedMemoryPressure(MemoryPressureReason);
+    bool hasReceivedMemoryPressure();
+    void clearMemoryPressure();
+    bool shouldWaitForMemoryClearMessage();
+    void respondToMemoryPressureIfNeeded();
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     void uninstall();
</span><span class="cx"> 
</span><span class="lines">@@ -60,6 +82,15 @@
</span><span class="cx">     bool m_installed;
</span><span class="cx">     time_t m_lastRespondTime;
</span><span class="cx">     LowMemoryHandler m_lowMemoryHandler;
</span><ins>+
+#if PLATFORM(IOS)
+    uint32_t m_receivedMemoryPressure;
+    uint32_t m_memoryPressureReason;
+    bool m_clearPressureOnMemoryRelease;
+    void (^m_releaseMemoryBlock)();
+    CFRunLoopObserverRef m_observer;
+    Mutex m_observerMutex;
+#endif
</ins><span class="cx"> };
</span><span class="cx">  
</span><span class="cx"> // Function to obtain the global memory pressure object.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformKeyboardEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformKeyboardEvent.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformKeyboardEvent.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/PlatformKeyboardEvent.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -36,6 +36,14 @@
</span><span class="cx"> OBJC_CLASS NSEvent;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#ifdef __OBJC__
+@class WebEvent;
+#else
+class WebEvent;
+#endif
+#endif
+
</ins><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx"> typedef struct _GdkEventKey GdkEventKey;
</span><span class="cx"> #include &quot;CompositionResults.h&quot;
</span><span class="lines">@@ -127,8 +135,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         NSEvent* macEvent() const { return m_macEvent.get(); }
</span><ins>+#else
+        WebEvent *event() const { return m_Event.get(); }
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">         PlatformKeyboardEvent(HWND, WPARAM, LPARAM, Type, bool);
</span><span class="lines">@@ -170,8 +182,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         RetainPtr&lt;NSEvent&gt; m_macEvent;
</span><ins>+#else
+        RetainPtr&lt;WebEvent&gt; m_Event;
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx">         GdkEventKey* m_gdkEventKey;
</span><span class="cx">         CompositionResults m_compositionResults;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformMouseEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformMouseEvent.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformMouseEvent.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/PlatformMouseEvent.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">             , m_button(NoButton)
</span><span class="cx">             , m_clickCount(0)
</span><span class="cx">             , m_modifierFlags(0)
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">             , m_eventNumber(0)
</span><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx">             , m_didActivateWebView(false)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">             , m_button(button)
</span><span class="cx">             , m_clickCount(clickCount)
</span><span class="cx">             , m_modifierFlags(0)
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">             , m_eventNumber(0)
</span><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx">             , m_didActivateWebView(false)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx">         PlatformMouseEvent(const Evas_Event_Mouse_Move*, IntPoint);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">         int eventNumber() const { return m_eventNumber; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx">         int m_clickCount;
</span><span class="cx">         unsigned m_modifierFlags;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">         int m_eventNumber;
</span><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx">         bool m_didActivateWebView;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPlatformScreenh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PlatformScreen.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PlatformScreen.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/PlatformScreen.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> OBJC_CLASS NSScreen;
</span><span class="cx"> OBJC_CLASS NSWindow;
</span><span class="cx"> #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">     FloatRect screenAvailableRect(Widget*);
</span><span class="cx">     void screenColorProfile(ColorProfile&amp;);
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     NSScreen *screenForWindow(NSWindow *);
</span><span class="cx"> 
</span><span class="cx">     FloatRect toUserSpace(const NSRect&amp;, NSWindow *destination);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformRuntimeApplicationCheckscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -37,7 +37,9 @@
</span><span class="cx">     
</span><span class="cx"> static bool mainBundleIsEqualTo(const String&amp; bundleIdentifierString)
</span><span class="cx"> {
</span><del>-#if USE(CF)
</del><ins>+    // FIXME: We should consider merging this file with RuntimeApplicationChecksIOS.mm.
+    // Then we can remove the PLATFORM(IOS)-guard.
+#if USE(CF) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     CFBundleRef mainBundle = CFBundleGetMainBundle();
</span><span class="cx">     if (!mainBundle)
</span><span class="cx">         return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformRuntimeApplicationChecksIOShfromrev161588trunkSourceWebCoreplatformgraphicsStringTruncatorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.h (from rev 161588, trunk/Source/WebCore/platform/graphics/StringTruncator.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RuntimeApplicationChecksIOS_h
+#define RuntimeApplicationChecksIOS_h
+
+// FIXME: We should consider merging this file with RuntimeApplicationChecks.h.
+namespace WebCore {
+
+bool applicationIsMobileMail();
+bool applicationIsMobileSafari();
+bool applicationIsDumpRenderTree();
+bool applicationIsMobileStore();
+bool applicationIsWebApp();
+bool applicationIsOkCupid();
+bool applicationIsFacebook();
+bool applicationIsEpicurious();
+bool applicationIsDaijisenDictionary();
+bool applicationIsNASAHD();
+bool applicationIsMASH();
+bool applicationIsTheEconomistOnIPhone();
+bool applicationIsWebProcess();
+bool applicationIsIBooksOnIOS();
+
+} // namespace WebCore
+
+#endif // RuntimeApplicationChecksIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformRuntimeApplicationChecksIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecksIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,125 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;RuntimeApplicationChecksIOS.h&quot;
+
+// FIXME: We should consider merging this file with RuntimeApplicationChecks.cpp.
+#if PLATFORM(IOS)
+
+namespace WebCore {
+
+bool applicationIsMobileMail()
+{
+    static bool isMobileMail = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.apple.mobilemail&quot;];
+    return isMobileMail;
+}
+
+bool applicationIsMobileSafari()
+{
+    static bool isMobileSafari = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.apple.mobilesafari&quot;];
+    return isMobileSafari;
+}
+
+bool applicationIsDumpRenderTree()
+{
+    static bool isDumpRenderTree = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.apple.DumpRenderTree&quot;];
+    return isDumpRenderTree;
+}
+
+bool applicationIsMobileStore()
+{
+    static const bool isMobileStore = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.apple.MobileStore&quot;];
+    return isMobileStore;
+}
+
+bool applicationIsWebApp()
+{
+    static bool isWebApp = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.apple.webapp&quot;];
+    return isWebApp;
+}
+
+bool applicationIsOkCupid()
+{
+    static bool isOkCupid = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.okcupid.app&quot;];
+    return isOkCupid;
+}
+
+bool applicationIsFacebook()
+{
+    static bool isFacebook = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.facebook.Facebook&quot;];
+    return isFacebook;
+}
+
+bool applicationIsEpicurious()
+{
+    static bool isEpicurious = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.condenet.Epicurious&quot;];
+    return isEpicurious;
+}
+
+bool applicationIsDaijisenDictionary()
+{
+    static bool isDaijisenDictionary = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;jp.co.shogakukan.daijisen2009i&quot;];
+    return isDaijisenDictionary;
+}
+
+bool applicationIsNASAHD()
+{
+    static bool isNASAHD = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;gov.nasa.NASAHD&quot;];
+    return isNASAHD;
+}
+
+bool applicationIsMASH()
+{
+    static bool isMASH = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.magnateinteractive.mashgame&quot;]
+        || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.magnateinteractive.mashlitegame&quot;]
+        || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.magnateinteractive.mashchristmas&quot;]
+        || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.magnateinteractive.mashhalloween&quot;]
+        || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.magnateinteractive.mashvalentines&quot;];
+    return isMASH;
+}
+
+bool applicationIsTheEconomistOnIPhone()
+{
+    static bool isTheEconomistOnIPhone = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.economist.iphone&quot;];
+    return isTheEconomistOnIPhone;
+}
+
+// FIXME: this needs to be changed when the WebProcess is changed to an XPC service.
+bool applicationIsWebProcess()
+{
+    static bool isWebProcess = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.apple.WebKit.WebContent&quot;] || [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.apple.WebProcess&quot;];
+    return isWebProcess;
+}
+
+bool applicationIsIBooksOnIOS()
+{
+    static bool isIBooksOnIOS = [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@&quot;com.apple.iBooks&quot;];
+    return isIBooksOnIOS;
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollAnimatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollAnimator.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollAnimator.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ScrollAnimator.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-#if !ENABLE(SMOOTH_SCROLLING)
</del><ins>+#if !ENABLE(SMOOTH_SCROLLING) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> PassOwnPtr&lt;ScrollAnimator&gt; ScrollAnimator::create(ScrollableArea* scrollableArea)
</span><span class="cx"> {
</span><span class="cx">     return adoptPtr(new ScrollAnimator(scrollableArea));
</span><span class="lines">@@ -123,6 +123,13 @@
</span><span class="cx">     return handled;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(TOUCH_EVENTS)
+bool ScrollAnimator::handleTouchEvent(const PlatformTouchEvent&amp;)
+{
+    return false;
+}
+#endif
+
</ins><span class="cx"> void ScrollAnimator::setCurrentPosition(const FloatPoint&amp; position)
</span><span class="cx"> {
</span><span class="cx">     m_currentPosX = position.x();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollAnimatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollAnimator.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollAnimator.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ScrollAnimator.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class FloatPoint;
</span><ins>+class PlatformTouchEvent;
</ins><span class="cx"> class ScrollableArea;
</span><span class="cx"> class Scrollbar;
</span><span class="cx"> 
</span><span class="lines">@@ -62,6 +63,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool handleWheelEvent(const PlatformWheelEvent&amp;);
</span><span class="cx"> 
</span><ins>+#if ENABLE(TOUCH_EVENTS)
+    virtual bool handleTouchEvent(const PlatformTouchEvent&amp;);
+#endif
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     virtual void handleWheelEventPhase(PlatformWheelEventPhase) { }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollTypes.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollTypes.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ScrollTypes.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #ifndef ScrollTypes_h
</span><span class="cx"> #define ScrollTypes_h
</span><span class="cx"> 
</span><ins>+#ifdef __cplusplus
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx">     enum ScrollDirection {
</span><span class="lines">@@ -178,4 +180,6 @@
</span><span class="cx">     };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#endif // __cplusplus
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ScrollView.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -241,8 +241,10 @@
</span><span class="cx">     if (platformWidget())
</span><span class="cx">         return platformVisibleContentSize(scrollbarInclusion == IncludeScrollbars);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (!m_fixedVisibleContentRect.isEmpty())
</span><span class="cx">         return m_fixedVisibleContentRect.size();
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     int verticalScrollbarWidth = 0;
</span><span class="cx">     int horizontalScrollbarHeight = 0;
</span><span class="lines">@@ -264,8 +266,10 @@
</span><span class="cx">     if (platformWidget())
</span><span class="cx">         return platformVisibleContentRect(scollbarInclusion == IncludeScrollbars);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (!m_fixedVisibleContentRect.isEmpty())
</span><span class="cx">         return m_fixedVisibleContentRect;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     FloatSize visibleContentSize = unscaledVisibleContentSize(scollbarInclusion);
</span><span class="cx">     visibleContentSize.scale(1 / visibleContentScaleFactor());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ScrollView.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -35,6 +35,24 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#ifdef __OBJC__
+@class WAKScrollView;
+@class WAKView;
+#else
+class WAKScrollView;
+class WAKView;
+#endif
+
+#ifndef NSScrollView
+#define NSScrollView WAKScrollView
+#endif
+
+#ifndef NSView
+#define NSView WAKView
+#endif
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> #if PLATFORM(MAC) &amp;&amp; defined __OBJC__
</span><span class="cx"> @protocol WebCoreFrameScrollView;
</span><span class="cx"> #endif
</span><span class="lines">@@ -43,6 +61,7 @@
</span><span class="cx"> 
</span><span class="cx"> class HostWindow;
</span><span class="cx"> class Scrollbar;
</span><ins>+class TileCache;
</ins><span class="cx"> 
</span><span class="cx"> class ScrollView : public Widget, public ScrollableArea {
</span><span class="cx"> public:
</span><span class="lines">@@ -141,9 +160,20 @@
</span><span class="cx">     // the setFixedVisibleContentRect instead for the mainframe, though this must be updated manually, e.g just before resuming the page
</span><span class="cx">     // which usually will happen when panning, pinching and rotation ends, or when scale or position are changed manually.
</span><span class="cx">     virtual IntRect visibleContentRect(VisibleContentRectIncludesScrollbars = ExcludeScrollbars) const OVERRIDE;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     virtual void setFixedVisibleContentRect(const IntRect&amp; visibleContentRect) { m_fixedVisibleContentRect = visibleContentRect; }
</span><span class="cx">     IntRect fixedVisibleContentRect() const { return m_fixedVisibleContentRect; }
</span><ins>+#endif
</ins><span class="cx">     IntSize visibleSize() const { return visibleContentRect().size(); }
</span><ins>+#if PLATFORM(IOS)
+    // This is the area that is not covered by UI elements.
+    IntRect actualVisibleContentRect() const;
+    // This is the area that is partially or fully exposed, and may extend under overlapping UI elements.
+    IntRect visibleExtentContentRect() const;
+
+    void setActualScrollPosition(const IntPoint&amp;);
+    TileCache* tileCache();
+#endif
</ins><span class="cx">     virtual int visibleWidth() const OVERRIDE { return visibleContentRect().width(); }
</span><span class="cx">     virtual int visibleHeight() const OVERRIDE { return visibleContentRect().height(); }
</span><span class="cx"> 
</span><span class="lines">@@ -181,6 +211,11 @@
</span><span class="cx">     int scrollX() const { return scrollPosition().x(); }
</span><span class="cx">     int scrollY() const { return scrollPosition().y(); }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    int actualScrollX() const { return actualVisibleContentRect().x(); }
+    int actualScrollY() const { return actualVisibleContentRect().y(); }
+#endif
+
</ins><span class="cx">     // scrollOffset() anchors its (0,0) point at the top end of the header if this ScrollableArea
</span><span class="cx">     // has a header, so it is relative to the totalContentsSize(). scrollOffsetRelativeToDocument()
</span><span class="cx">     // anchors (0,0) at the top of the Document, which will be beneath any headers, so it is relative
</span><span class="lines">@@ -354,7 +389,9 @@
</span><span class="cx">     // whether it is safe to blit on scroll.
</span><span class="cx">     bool m_canBlitOnScroll;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     IntRect m_fixedVisibleContentRect;
</span><ins>+#endif
</ins><span class="cx">     IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but we will wait to make this change until more code is shared.
</span><span class="cx">     IntPoint m_cachedScrollPosition;
</span><span class="cx">     IntSize m_fixedLayoutSize;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -176,6 +176,13 @@
</span><span class="cx">     return scrollAnimator()-&gt;handleWheelEvent(wheelEvent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(TOUCH_EVENTS)
+bool ScrollableArea::handleTouchEvent(const PlatformTouchEvent&amp; touchEvent)
+{
+    return scrollAnimator()-&gt;handleTouchEvent(touchEvent);
+}
+#endif
+
</ins><span class="cx"> // NOTE: Only called from Internals for testing.
</span><span class="cx"> void ScrollableArea::setScrollOffsetFromInternals(const IntPoint&amp; offset)
</span><span class="cx"> {
</span><span class="lines">@@ -389,6 +396,31 @@
</span><span class="cx">         scrollAnimator-&gt;serviceScrollAnimations();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool ScrollableArea::isPinnedInBothDirections(const IntSize&amp; scrollDelta) const
+{
+    return isPinnedHorizontallyInDirection(scrollDelta.width()) &amp;&amp; isPinnedVerticallyInDirection(scrollDelta.height());
+}
+
+bool ScrollableArea::isPinnedHorizontallyInDirection(int horizontalScrollDelta) const
+{
+    if (horizontalScrollDelta &lt; 0 &amp;&amp; isHorizontalScrollerPinnedToMinimumPosition())
+        return true;
+    if (horizontalScrollDelta &gt; 0 &amp;&amp; isHorizontalScrollerPinnedToMaximumPosition())
+        return true;
+    return false;
+}
+
+bool ScrollableArea::isPinnedVerticallyInDirection(int verticalScrollDelta) const
+{
+    if (verticalScrollDelta &lt; 0 &amp;&amp; isVerticalScrollerPinnedToMinimumPosition())
+        return true;
+    if (verticalScrollDelta &gt; 0 &amp;&amp; isVerticalScrollerPinnedToMaximumPosition())
+        return true;
+    return false;
+}
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> IntPoint ScrollableArea::scrollPosition() const
</span><span class="cx"> {
</span><span class="cx">     int x = horizontalScrollbar() ? horizontalScrollbar()-&gt;value() : 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ScrollableArea.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> class FloatPoint;
</span><span class="cx"> class GraphicsContext;
</span><ins>+class PlatformTouchEvent;
</ins><span class="cx"> class PlatformWheelEvent;
</span><span class="cx"> class ScrollAnimator;
</span><span class="cx"> #if USE(ACCELERATED_COMPOSITING)
</span><span class="lines">@@ -57,6 +58,19 @@
</span><span class="cx"> 
</span><span class="cx">     bool handleWheelEvent(const PlatformWheelEvent&amp;);
</span><span class="cx"> 
</span><ins>+#if ENABLE(TOUCH_EVENTS)
+    virtual bool isTouchScrollable() const { return false; }
+    virtual bool handleTouchEvent(const PlatformTouchEvent&amp;);
+#endif
+
+#if PLATFORM(IOS)
+    virtual bool isOverflowScroll() const { return false; }
+    virtual void didStartScroll() { }
+    virtual void didEndScroll() { }
+    virtual void didUpdateScroll() { }
+    virtual void setIsUserScroll(bool) { }
+#endif
+
</ins><span class="cx">     // Functions for controlling if you can scroll past the end of the document.
</span><span class="cx">     bool constrainsScrollingToContentEdge() const { return m_constrainsScrollingToContentEdge; }
</span><span class="cx">     void setConstrainsScrollingToContentEdge(bool constrainsScrollingToContentEdge) { m_constrainsScrollingToContentEdge = constrainsScrollingToContentEdge; }
</span><span class="lines">@@ -182,6 +196,17 @@
</span><span class="cx">     virtual bool scheduleAnimation() { return false; }
</span><span class="cx">     void serviceScrollAnimations();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    bool isHorizontalScrollerPinnedToMinimumPosition() const { return !horizontalScrollbar() || scrollPosition(horizontalScrollbar()) &lt;= minimumScrollPosition().x(); }
+    bool isHorizontalScrollerPinnedToMaximumPosition() const { return !horizontalScrollbar() || scrollPosition(horizontalScrollbar()) &gt;= maximumScrollPosition().x(); }
+    bool isVerticalScrollerPinnedToMinimumPosition() const { return !verticalScrollbar() || scrollPosition(verticalScrollbar()) &lt;= minimumScrollPosition().y(); }
+    bool isVerticalScrollerPinnedToMaximumPosition() const { return !verticalScrollbar() || scrollPosition(verticalScrollbar()) &gt;= maximumScrollPosition().y(); } 
+
+    bool isPinnedInBothDirections(const IntSize&amp;) const; 
+    bool isPinnedHorizontallyInDirection(int horizontalScrollDelta) const; 
+    bool isPinnedVerticallyInDirection(int verticalScrollDelta) const;
+#endif
+
</ins><span class="cx"> #if USE(ACCELERATED_COMPOSITING)
</span><span class="cx">     virtual TiledBacking* tiledBacking() { return 0; }
</span><span class="cx">     virtual bool usesCompositedScrolling() const { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollbarcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Scrollbar.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Scrollbar.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/Scrollbar.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -334,6 +334,7 @@
</span><span class="cx">         theme()-&gt;invalidatePart(this, m_hoveredPart);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> bool Scrollbar::mouseMoved(const PlatformMouseEvent&amp; evt)
</span><span class="cx"> {
</span><span class="cx">     if (m_pressedPart == ThumbPart) {
</span><span class="lines">@@ -372,6 +373,7 @@
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> void Scrollbar::mouseEntered()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollbarh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Scrollbar.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Scrollbar.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/Scrollbar.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -125,7 +125,9 @@
</span><span class="cx">     // These methods are used for platform scrollbars to give :hover feedback.  They will not get called
</span><span class="cx">     // when the mouse went down in a scrollbar, since it is assumed the scrollbar will start
</span><span class="cx">     // grabbing all events in that case anyway.
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     bool mouseMoved(const PlatformMouseEvent&amp;);
</span><ins>+#endif
</ins><span class="cx">     void mouseEntered();
</span><span class="cx">     bool mouseExited();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformSharedBuffercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/SharedBuffer.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/SharedBuffer.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/SharedBuffer.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> 
</span><span class="cx"> SharedBuffer::SharedBuffer()
</span><span class="cx">     : m_size(0)
</span><ins>+    , m_shouldUsePurgeableMemory(false)
</ins><span class="cx"> #if ENABLE(DISK_IMAGE_CACHE)
</span><span class="cx">     , m_isMemoryMapped(false)
</span><span class="cx">     , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
</span><span class="lines">@@ -78,6 +79,7 @@
</span><span class="cx"> SharedBuffer::SharedBuffer(unsigned size)
</span><span class="cx">     : m_size(size)
</span><span class="cx">     , m_buffer(size)
</span><ins>+    , m_shouldUsePurgeableMemory(false)
</ins><span class="cx"> #if ENABLE(DISK_IMAGE_CACHE)
</span><span class="cx">     , m_isMemoryMapped(false)
</span><span class="cx">     , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
</span><span class="lines">@@ -89,6 +91,7 @@
</span><span class="cx"> 
</span><span class="cx"> SharedBuffer::SharedBuffer(const char* data, unsigned size)
</span><span class="cx">     : m_size(0)
</span><ins>+    , m_shouldUsePurgeableMemory(false)
</ins><span class="cx"> #if ENABLE(DISK_IMAGE_CACHE)
</span><span class="cx">     , m_isMemoryMapped(false)
</span><span class="cx">     , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
</span><span class="lines">@@ -101,6 +104,7 @@
</span><span class="cx"> 
</span><span class="cx"> SharedBuffer::SharedBuffer(const unsigned char* data, unsigned size)
</span><span class="cx">     : m_size(0)
</span><ins>+    , m_shouldUsePurgeableMemory(false)
</ins><span class="cx"> #if ENABLE(DISK_IMAGE_CACHE)
</span><span class="cx">     , m_isMemoryMapped(false)
</span><span class="cx">     , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
</span><span class="lines">@@ -210,6 +214,12 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+// Try to create a PurgeableBuffer. We can fail to create one for any of the
+// following reasons:
+//   - shouldUsePurgeableMemory is set to false.
+//   - the size of the buffer is less than the minimum size required by
+//     PurgeableBuffer (currently 16k).
+//   - PurgeableBuffer::createUninitialized() call fails.
</ins><span class="cx"> void SharedBuffer::createPurgeableBuffer() const
</span><span class="cx"> {
</span><span class="cx">     if (m_purgeableBuffer)
</span><span class="lines">@@ -226,6 +236,9 @@
</span><span class="cx">     if (!hasOneRef())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    if (!m_shouldUsePurgeableMemory)
+        return;
+
</ins><span class="cx">     char* destination = 0;
</span><span class="cx">     m_purgeableBuffer = PurgeableBuffer::createUninitialized(m_size, destination);
</span><span class="cx">     if (!m_purgeableBuffer)
</span><span class="lines">@@ -253,7 +266,9 @@
</span><span class="cx">     if (const char* buffer = singleDataArrayBuffer())
</span><span class="cx">         return buffer;
</span><span class="cx"> #endif
</span><del>-    
</del><ins>+
+    createPurgeableBuffer();
+
</ins><span class="cx">     if (m_purgeableBuffer)
</span><span class="cx">         return m_purgeableBuffer-&gt;data();
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformSharedBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/SharedBuffer.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/SharedBuffer.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/SharedBuffer.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -138,6 +138,8 @@
</span><span class="cx">     //      }
</span><span class="cx">     unsigned getSomeData(const char*&amp; data, unsigned position = 0) const;
</span><span class="cx"> 
</span><ins>+    void shouldUsePurgeableMemory(bool use) { m_shouldUsePurgeableMemory = use; }
+
</ins><span class="cx"> #if ENABLE(DISK_IMAGE_CACHE)
</span><span class="cx">     enum MemoryMappingState { QueuedForMapping, PreviouslyQueuedForMapping, SuccessAlreadyMapped, FailureCacheFull };
</span><span class="cx"> 
</span><span class="lines">@@ -187,6 +189,7 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned m_size;
</span><span class="cx">     mutable Vector&lt;char&gt; m_buffer;
</span><ins>+    bool m_shouldUsePurgeableMemory;
</ins><span class="cx">     mutable OwnPtr&lt;PurgeableBuffer&gt; m_purgeableBuffer;
</span><span class="cx"> #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span><span class="cx">     mutable Vector&lt;RetainPtr&lt;CFDataRef&gt;&gt; m_dataArray;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformSuddenTerminationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/SuddenTermination.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/SuddenTermination.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/SuddenTermination.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">     void disableSuddenTermination();
</span><span class="cx">     void enableSuddenTermination();
</span><span class="cx"> 
</span><del>-#if !PLATFORM(MAC)
</del><ins>+#if PLATFORM(IOS) || !PLATFORM(MAC)
</ins><span class="cx">     inline void disableSuddenTermination() { }
</span><span class="cx">     inline void enableSuddenTermination() { }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformSupplementableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Supplementable.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Supplementable.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/Supplementable.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><ins>+#include &lt;wtf/MainThread.h&gt;
</ins><span class="cx"> #include &lt;wtf/OwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/PassOwnPtr.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -99,20 +100,20 @@
</span><span class="cx"> public:
</span><span class="cx">     void provideSupplement(const char* key, PassOwnPtr&lt;Supplement&lt;T&gt;&gt; supplement)
</span><span class="cx">     {
</span><del>-        ASSERT(m_threadId == currentThread());
</del><ins>+        ASSERT(canAccessThreadLocalDataForThread(m_threadId));
</ins><span class="cx">         ASSERT(!m_supplements.get(key));
</span><span class="cx">         m_supplements.set(key, supplement);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     void removeSupplement(const char* key)
</span><span class="cx">     {
</span><del>-        ASSERT(m_threadId == currentThread());
</del><ins>+        ASSERT(canAccessThreadLocalDataForThread(m_threadId));
</ins><span class="cx">         m_supplements.remove(key);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Supplement&lt;T&gt;* requireSupplement(const char* key)
</span><span class="cx">     {
</span><del>-        ASSERT(m_threadId == currentThread());
</del><ins>+        ASSERT(canAccessThreadLocalDataForThread(m_threadId));
</ins><span class="cx">         return m_supplements.get(key);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformSystemMemoryhfromrev161588trunkSourceWebCoreplatformgraphicsStringTruncatorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/SystemMemory.h (from rev 161588, trunk/Source/WebCore/platform/graphics/StringTruncator.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/SystemMemory.h                                (rev 0)
+++ trunk/Source/WebCore/platform/SystemMemory.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SystemMemory_h
+#define SystemMemory_h
+
+namespace WebCore {
+int systemMemoryLevel(); // In [0, 100]
+size_t systemTotalMemory();
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadCheckh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadCheck.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadCheck.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ThreadCheck.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef ThreadCheck_h
</span><span class="cx"> #define ThreadCheck_h
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">     enum ThreadViolationBehavior {
</span><span class="cx">         NoThreadCheck,
</span><span class="lines">@@ -46,5 +47,9 @@
</span><span class="cx"> 
</span><span class="cx"> #define WebCoreThreadViolationCheckRoundOne() ::WebCore::reportThreadViolation(WTF_PRETTY_FUNCTION, WebCore::ThreadViolationRoundOne)
</span><span class="cx"> #define WebCoreThreadViolationCheckRoundTwo() ::WebCore::reportThreadViolation(WTF_PRETTY_FUNCTION, WebCore::ThreadViolationRoundTwo)
</span><ins>+#else
+#define WebCoreThreadViolationCheckRoundOne() do { } while (0)
+#define WebCoreThreadViolationCheckRoundTwo() do { } while (0)
+#endif // PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadGlobalDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadGlobalData.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadGlobalData.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ThreadGlobalData.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -50,6 +50,9 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> ThreadSpecific&lt;ThreadGlobalData&gt;* ThreadGlobalData::staticData;
</span><ins>+#if USE(WEB_THREAD)
+ThreadGlobalData* ThreadGlobalData::sharedMainThreadStaticData;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> ThreadGlobalData::ThreadGlobalData()
</span><span class="cx">     : m_cachedResourceRequestInitiators(adoptPtr(new CachedResourceRequestInitiators))
</span><span class="lines">@@ -61,7 +64,7 @@
</span><span class="cx"> #if USE(ICU_UNICODE)
</span><span class="cx">     , m_cachedConverterICU(adoptPtr(new ICUConverterWrapper))
</span><span class="cx"> #endif
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     , m_cachedConverterTEC(adoptPtr(new TECConverterWrapper))
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="lines">@@ -82,7 +85,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ThreadGlobalData::destroy()
</span><span class="cx"> {
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     m_cachedConverterTEC.clear();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -98,11 +101,35 @@
</span><span class="cx">     m_threadTimers.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WORKERS) &amp;&amp; USE(WEB_THREAD)
+void ThreadGlobalData::setWebCoreThreadData()
+{
+    ASSERT(isWebThread());
+    ASSERT(&amp;threadGlobalData() != ThreadGlobalData::sharedMainThreadStaticData);
+
+    // Set WebThread's ThreadGlobalData object to be the same as the main UI thread.
+    ThreadGlobalData::staticData-&gt;replace(ThreadGlobalData::sharedMainThreadStaticData);
+
+    ASSERT(&amp;threadGlobalData() == ThreadGlobalData::sharedMainThreadStaticData);
+}
+#endif
+
</ins><span class="cx"> ThreadGlobalData&amp; threadGlobalData() 
</span><span class="cx"> {
</span><ins>+#if USE(WEB_THREAD)
+    if (UNLIKELY(!ThreadGlobalData::staticData)) {
+        ThreadGlobalData::staticData = new ThreadSpecific&lt;ThreadGlobalData&gt;;
+        // WebThread and main UI thread need to share the same object. Save it in a static
+        // here, the WebThread will pick it up in setWebCoreThreadData().
+        if (pthread_main_np())
+            ThreadGlobalData::sharedMainThreadStaticData = *ThreadGlobalData::staticData;
+    }
+    return **ThreadGlobalData::staticData;
+#else
</ins><span class="cx">     if (!ThreadGlobalData::staticData)
</span><span class="cx">         ThreadGlobalData::staticData = new ThreadSpecific&lt;ThreadGlobalData&gt;;
</span><span class="cx">     return **ThreadGlobalData::staticData;
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadGlobalDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadGlobalData.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadGlobalData.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ThreadGlobalData.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -62,10 +62,14 @@
</span><span class="cx">         ICUConverterWrapper&amp; cachedConverterICU() { return *m_cachedConverterICU; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">         TECConverterWrapper&amp; cachedConverterTEC() { return *m_cachedConverterTEC; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(WORKERS) &amp;&amp; USE(WEB_THREAD)
+        void setWebCoreThreadData();
+#endif
+
</ins><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">         ThreadLocalInspectorCounters&amp; inspectorCounters() { return *m_inspectorCounters; }
</span><span class="cx"> #endif
</span><span class="lines">@@ -83,7 +87,7 @@
</span><span class="cx">         OwnPtr&lt;ICUConverterWrapper&gt; m_cachedConverterICU;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">         OwnPtr&lt;TECConverterWrapper&gt; m_cachedConverterTEC;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -92,10 +96,17 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">         static ThreadSpecific&lt;ThreadGlobalData&gt;* staticData;
</span><ins>+#if USE(WEB_THREAD)
+        static ThreadGlobalData* sharedMainThreadStaticData;
+#endif
</ins><span class="cx">         friend ThreadGlobalData&amp; threadGlobalData();
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+#if USE(WEB_THREAD)
+ThreadGlobalData&amp; threadGlobalData();
+#else
</ins><span class="cx"> ThreadGlobalData&amp; threadGlobalData() PURE_FUNCTION;
</span><ins>+#endif
</ins><span class="cx">     
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadTimerscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadTimers.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadTimers.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ThreadTimers.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -33,6 +33,10 @@
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> // Fire timers for this length of time, and then quit to let the run loop process user input events.
</span><span class="lines">@@ -54,7 +58,7 @@
</span><span class="cx">     , m_firingTimers(false)
</span><span class="cx">     , m_pendingSharedTimerFireTime(0)
</span><span class="cx"> {
</span><del>-    if (isMainThread())
</del><ins>+    if (isUIThread())
</ins><span class="cx">         setSharedTimer(mainThreadSharedTimer());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -105,6 +109,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ThreadTimers::sharedTimerFiredInternal()
</span><span class="cx"> {
</span><ins>+    ASSERT(isMainThread() || !isWebThread() &amp;&amp; !isUIThread());
</ins><span class="cx">     // Do a re-entrancy check.
</span><span class="cx">     if (m_firingTimers)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformTimercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Timer.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Timer.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/Timer.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include &lt;math.h&gt;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><ins>+#include &lt;wtf/MainThread.h&gt;
</ins><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -209,7 +210,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TimerBase::start(double nextFireInterval, double repeatInterval)
</span><span class="cx"> {
</span><del>-    ASSERT(m_thread == currentThread());
</del><ins>+    ASSERT(canAccessThreadLocalDataForThread(m_thread));
</ins><span class="cx"> 
</span><span class="cx">     m_repeatInterval = repeatInterval;
</span><span class="cx">     setNextFireTime(monotonicallyIncreasingTime() + nextFireInterval);
</span><span class="lines">@@ -217,7 +218,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TimerBase::stop()
</span><span class="cx"> {
</span><del>-    ASSERT(m_thread == currentThread());
</del><ins>+    ASSERT(canAccessThreadLocalDataForThread(m_thread));
</ins><span class="cx"> 
</span><span class="cx">     m_repeatInterval = 0;
</span><span class="cx">     setNextFireTime(0);
</span><span class="lines">@@ -368,7 +369,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TimerBase::setNextFireTime(double newUnalignedTime)
</span><span class="cx"> {
</span><del>-    ASSERT(m_thread == currentThread());
</del><ins>+    ASSERT(canAccessThreadLocalDataForThread(m_thread));
</ins><span class="cx">     ASSERT(!m_wasDeleted);
</span><span class="cx"> 
</span><span class="cx">     if (m_unalignedNextFireTime != newUnalignedTime)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformTimerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Timer.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Timer.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/Timer.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -30,6 +30,10 @@
</span><span class="cx"> #include &lt;wtf/Threading.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> // Time intervals are all in seconds.
</span><span class="lines">@@ -120,7 +124,18 @@
</span><span class="cx"> 
</span><span class="cx"> inline bool TimerBase::isActive() const
</span><span class="cx"> {
</span><ins>+    // FIXME: Write this in terms of USE(WEB_THREAD) instead of PLATFORM(IOS).
+#if !PLATFORM(IOS)
</ins><span class="cx">     ASSERT(m_thread == currentThread());
</span><ins>+#else
+    // On iOS timers are always run on the main thread or the Web Thread.
+    // Unless we have workers enabled in which case timers can run on other threads.
+#if ENABLE(WORKERS)
+    ASSERT(WebThreadIsCurrent() || pthread_main_np() || m_thread == currentThread());
+#else
+    ASSERT(WebThreadIsCurrent() || pthread_main_np());
+#endif
+#endif // PLATFORM(IOS)
</ins><span class="cx">     return m_nextFireTime;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URL.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URL.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/URL.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -986,9 +986,27 @@
</span><span class="cx">     parse(buffer.data(), &amp;string);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+static bool shouldCanonicalizeScheme = true;
+
+void enableURLSchemeCanonicalization(bool enableSchemeCanonicalization)
+{
+    shouldCanonicalizeScheme = enableSchemeCanonicalization;
+}
+#endif
+
</ins><span class="cx"> template&lt;size_t length&gt;
</span><span class="cx"> static inline bool equal(const char* a, const char (&amp;b)[length])
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (!shouldCanonicalizeScheme) {
+        for (size_t i = 0; i &lt; length; ++i) {
+            if (toASCIILower(a[i]) != b[i])
+                return false;
+        }
+        return true;
+    }
+#endif
</ins><span class="cx">     for (size_t i = 0; i &lt; length; ++i) {
</span><span class="cx">         if (a[i] != b[i])
</span><span class="cx">             return false;
</span><span class="lines">@@ -1262,8 +1280,18 @@
</span><span class="cx"> 
</span><span class="cx">     // copy in the scheme
</span><span class="cx">     const char *schemeEndPtr = url + schemeEnd;
</span><ins>+#if PLATFORM(IOS)
+    if (shouldCanonicalizeScheme || m_protocolIsInHTTPFamily) {
+        while (strPtr &lt; schemeEndPtr)
+            *p++ = toASCIILower(*strPtr++);
+    } else {
+        while (strPtr &lt; schemeEndPtr)
+            *p++ = *strPtr++;
+    }
+#else
</ins><span class="cx">     while (strPtr &lt; schemeEndPtr)
</span><span class="cx">         *p++ = toASCIILower(*strPtr++);
</span><ins>+#endif
</ins><span class="cx">     m_schemeEnd = p - buffer.data();
</span><span class="cx"> 
</span><span class="cx">     bool hostIsLocalHost = portEnd - userStart == 9
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URL.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URL.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/URL.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -332,6 +332,10 @@
</span><span class="cx">     return m_pathAfterLastSlash;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void enableURLSchemeCanonicalization(bool);
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformWidgeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Widget.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Widget.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/Widget.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -27,6 +27,12 @@
</span><span class="cx"> #ifndef Widget_h
</span><span class="cx"> #define Widget_h
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#ifndef NSView
+#define NSView WAKView
+#endif
+#endif
+
</ins><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="cx"> #include &quot;PlatformScreen.h&quot;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="lines">@@ -190,6 +196,9 @@
</span><span class="cx"> 
</span><span class="cx">     void removeFromSuperview();
</span><span class="cx"> #endif
</span><ins>+#if PLATFORM(IOS)
+    void addToSuperview(NSView*);
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(EFL)
</span><span class="cx">     void setEvasObject(Evas_Object*);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioiosAudioDestinationIOScpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/audio/ios/AudioDestinationIOS.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,10 +29,8 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> 
</span><del>-#if ENABLE(WEB_AUDIO)
</del><ins>+#if ENABLE(WEB_AUDIO) &amp;&amp; PLATFORM(IOS)
</ins><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-
</del><span class="cx"> #include &quot;AudioDestinationIOS.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AudioIOCallback.h&quot;
</span><span class="lines">@@ -262,6 +260,5 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-#endif // PLATFORM(IOS)
</del><ins>+#endif // ENABLE(WEB_AUDIO) &amp;&amp; PLATFORM(IOS)
</ins><span class="cx"> 
</span><del>-#endif // ENABLE(WEB_AUDIO)
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioiosAudioDestinationIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/ios/AudioDestinationIOS.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/AudioDestinationIOS.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/audio/ios/AudioDestinationIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -76,3 +76,4 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // AudioDestinationIOS_h
</span><ins>+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioiosAudioFileReaderIOScppfromrev161588trunkSourceWebCoreplatformaudiomacAudioFileReaderMaccpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.cpp (from rev 161588, trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,248 @@
</span><ins>+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;AudioFileReaderIOS.h&quot;
+
+#if ENABLE(WEB_AUDIO) &amp;&amp; PLATFORM(IOS)
+
+#include &quot;AudioBus.h&quot;
+#include &quot;AudioFileReader.h&quot;
+#include &quot;SoftLinking.h&quot;
+#include &lt;CoreFoundation/CoreFoundation.h&gt;
+#include &lt;wtf/CheckedArithmetic.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+
+SOFT_LINK_FRAMEWORK(AudioToolbox)
+SOFT_LINK(AudioToolbox, AudioFileClose, OSStatus, (AudioFileID inAudioFile), (inAudioFile))
+SOFT_LINK(AudioToolbox, AudioFileOpenWithCallbacks, OSStatus, (void *inClientData, AudioFile_ReadProc inReadFunc, AudioFile_WriteProc inWriteFunc, AudioFile_GetSizeProc inGetSizeFunc, AudioFile_SetSizeProc inSetSizeFunc, AudioFileTypeID inFileTypeHint, AudioFileID *outAudioFile), (inClientData, inReadFunc, inWriteFunc, inGetSizeFunc, inSetSizeFunc, inFileTypeHint, outAudioFile))
+SOFT_LINK(AudioToolbox, ExtAudioFileDispose, OSStatus, (ExtAudioFileRef inExtAudioFile), (inExtAudioFile))
+SOFT_LINK(AudioToolbox, ExtAudioFileGetProperty, OSStatus, (ExtAudioFileRef inExtAudioFile, ExtAudioFilePropertyID inPropertyID, UInt32 *ioPropertyDataSize, void *outPropertyData), (inExtAudioFile, inPropertyID, ioPropertyDataSize, outPropertyData))
+SOFT_LINK(AudioToolbox, ExtAudioFileRead, OSStatus, (ExtAudioFileRef inExtAudioFile, UInt32 *ioNumberFrames, AudioBufferList *ioData), (inExtAudioFile, ioNumberFrames, ioData))
+SOFT_LINK(AudioToolbox, ExtAudioFileSetProperty, OSStatus, (ExtAudioFileRef inExtAudioFile, ExtAudioFilePropertyID inPropertyID, UInt32 inPropertyDataSize, const void *inPropertyData), (inExtAudioFile, inPropertyID, inPropertyDataSize, inPropertyData))
+SOFT_LINK(AudioToolbox, ExtAudioFileWrapAudioFileID, OSStatus, (AudioFileID inFileID, Boolean inForWriting, ExtAudioFileRef *outExtAudioFile), (inFileID, inForWriting, outExtAudioFile))
+SOFT_LINK(AudioToolbox, ExtAudioFileOpenURL, OSStatus, (CFURLRef inURL, ExtAudioFileRef* outExtAudioFile), (inURL, outExtAudioFile))
+
+namespace WebCore {
+
+static WARN_UNUSED_RETURN AudioBufferList* createAudioBufferList(size_t numberOfBuffers)
+{
+    Checked&lt;size_t, RecordOverflow&gt; bufferListSize = sizeof(AudioBufferList) - sizeof(AudioBuffer);
+    bufferListSize += numberOfBuffers * sizeof(AudioBuffer);
+
+    AudioBufferList* bufferList = static_cast&lt;AudioBufferList*&gt;(calloc(1, bufferListSize.unsafeGet()));
+    if (bufferList)
+        bufferList-&gt;mNumberBuffers = numberOfBuffers;
+    return bufferList;
+}
+
+static inline void destroyAudioBufferList(AudioBufferList* bufferList)
+{
+    free(bufferList);
+}
+
+AudioFileReader::AudioFileReader(const char* filePath)
+    : m_data(0)
+    , m_dataSize(0)
+    , m_audioFileID(0)
+    , m_extAudioFileRef(nullptr)
+{
+    RetainPtr&lt;CFURLRef&gt; urlRef = adoptCF(CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, reinterpret_cast&lt;const UInt8*&gt;(filePath), strlen(filePath), false));
+    if (!urlRef)
+        return;
+    ExtAudioFileOpenURL(urlRef.get(), &amp;m_extAudioFileRef);
+}
+
+AudioFileReader::AudioFileReader(const void* data, size_t dataSize)
+    : m_data(data)
+    , m_dataSize(dataSize)
+    , m_audioFileID(0)
+    , m_extAudioFileRef(nullptr)
+{
+    if (AudioFileOpenWithCallbacks(this, readProc, 0, getSizeProc, 0, 0, &amp;m_audioFileID) != noErr)
+        return;
+
+    if (ExtAudioFileWrapAudioFileID(m_audioFileID, false, &amp;m_extAudioFileRef) != noErr)
+        m_extAudioFileRef = nullptr;
+}
+
+AudioFileReader::~AudioFileReader()
+{
+    if (m_extAudioFileRef)
+        ExtAudioFileDispose(m_extAudioFileRef);
+
+    m_extAudioFileRef = nullptr;
+
+    if (m_audioFileID)
+        AudioFileClose(m_audioFileID);
+
+    m_audioFileID = 0;
+}
+
+OSStatus AudioFileReader::readProc(void* clientData, SInt64 position, UInt32 requestCount, void* buffer, UInt32* actualCount)
+{
+    AudioFileReader* audioFileReader = static_cast&lt;AudioFileReader*&gt;(clientData);
+
+    size_t dataSize = audioFileReader-&gt;dataSize();
+    const void* data = audioFileReader-&gt;data();
+    size_t bytesToRead = 0;
+
+    if (static_cast&lt;UInt64&gt;(position) &lt; dataSize) {
+        size_t bytesAvailable = dataSize - static_cast&lt;size_t&gt;(position);
+        bytesToRead = requestCount &lt;= bytesAvailable ? requestCount : bytesAvailable;
+        memcpy(buffer, static_cast&lt;const char*&gt;(data) + position, bytesToRead);
+    }
+
+    if (actualCount)
+        *actualCount = bytesToRead;
+
+    return noErr;
+}
+
+SInt64 AudioFileReader::getSizeProc(void* clientData)
+{
+    return static_cast&lt;AudioFileReader*&gt;(clientData)-&gt;dataSize();
+}
+
+PassRefPtr&lt;AudioBus&gt; AudioFileReader::createBus(float sampleRate, bool mixToMono)
+{
+    if (!m_extAudioFileRef)
+        return nullptr;
+
+    // Get file's data format
+    UInt32 size = sizeof(m_fileDataFormat);
+    if (ExtAudioFileGetProperty(m_extAudioFileRef, kExtAudioFileProperty_FileDataFormat, &amp;size, &amp;m_fileDataFormat) != noErr)
+        return nullptr;
+
+    size_t numberOfChannels = m_fileDataFormat.mChannelsPerFrame;
+
+    // Number of frames
+    SInt64 numberOfFrames64 = 0;
+    size = sizeof(numberOfFrames64);
+    if (ExtAudioFileGetProperty(m_extAudioFileRef, kExtAudioFileProperty_FileLengthFrames, &amp;size, &amp;numberOfFrames64) != noErr)
+        return nullptr;
+
+    double fileSampleRate = m_fileDataFormat.mSampleRate;
+
+    // Make client format same number of channels as file format, but tweak a few things.
+    // Client format will be linear PCM (canonical), and potentially change sample-rate.
+    m_clientDataFormat = m_fileDataFormat;
+
+    const int bytesPerFloat = sizeof(Float32);
+    const int bitsPerByte = 8;
+    m_clientDataFormat.mFormatID = kAudioFormatLinearPCM;
+    m_clientDataFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kAudioFormatFlagIsNonInterleaved;
+    m_clientDataFormat.mBytesPerPacket = bytesPerFloat;
+    m_clientDataFormat.mFramesPerPacket = 1;
+    m_clientDataFormat.mBytesPerFrame = bytesPerFloat;
+    m_clientDataFormat.mChannelsPerFrame = numberOfChannels;
+    m_clientDataFormat.mBitsPerChannel = bitsPerByte * bytesPerFloat;
+
+    if (sampleRate)
+        m_clientDataFormat.mSampleRate = sampleRate;
+
+    if (ExtAudioFileSetProperty(m_extAudioFileRef, kExtAudioFileProperty_ClientDataFormat, sizeof(AudioStreamBasicDescription), &amp;m_clientDataFormat) != noErr)
+        return nullptr;
+
+    // Change numberOfFrames64 to destination sample-rate
+    numberOfFrames64 = numberOfFrames64 * (m_clientDataFormat.mSampleRate / fileSampleRate);
+    size_t numberOfFrames = static_cast&lt;size_t&gt;(numberOfFrames64);
+
+    size_t busChannelCount = mixToMono ? 1 : numberOfChannels;
+
+    // Create AudioBus where we'll put the PCM audio data
+    RefPtr&lt;AudioBus&gt; audioBus = AudioBus::create(busChannelCount, numberOfFrames);
+    audioBus-&gt;setSampleRate(m_clientDataFormat.mSampleRate); // save for later
+
+    // Only allocated in the mixToMono case; deallocated on destruction.
+    AudioFloatArray leftChannel;
+    AudioFloatArray rightChannel;
+
+    AudioBufferList* bufferList = createAudioBufferList(numberOfChannels);
+    if (!bufferList)
+        return nullptr;
+    const size_t bufferSize = numberOfFrames * sizeof(float);
+
+    if (mixToMono &amp;&amp; numberOfChannels == 2) {
+        leftChannel.allocate(numberOfFrames);
+        rightChannel.allocate(numberOfFrames);
+
+        bufferList-&gt;mBuffers[0].mNumberChannels = 1;
+        bufferList-&gt;mBuffers[0].mDataByteSize = bufferSize;
+        bufferList-&gt;mBuffers[0].mData = leftChannel.data();
+
+        bufferList-&gt;mBuffers[1].mNumberChannels = 1;
+        bufferList-&gt;mBuffers[1].mDataByteSize = bufferSize;
+        bufferList-&gt;mBuffers[1].mData = rightChannel.data();
+    } else {
+        ASSERT(!mixToMono || numberOfChannels == 1);
+
+        // For True-stereo (numberOfChannels == 4)
+        for (size_t i = 0; i &lt; numberOfChannels; ++i) {
+            audioBus-&gt;channel(i)-&gt;zero();
+            bufferList-&gt;mBuffers[i].mNumberChannels = 1;
+            bufferList-&gt;mBuffers[i].mDataByteSize = bufferSize;
+            bufferList-&gt;mBuffers[i].mData = audioBus-&gt;channel(i)-&gt;mutableData();
+        }
+    }
+
+    // Read from the file (or in-memory version)
+    UInt32 framesToRead = numberOfFrames;
+    if (ExtAudioFileRead(m_extAudioFileRef, &amp;framesToRead, bufferList) != noErr) {
+        destroyAudioBufferList(bufferList);
+        return nullptr;
+    }
+
+    if (mixToMono &amp;&amp; numberOfChannels == 2) {
+        // Mix stereo down to mono
+        float* destL = audioBus-&gt;channel(0)-&gt;mutableData();
+        for (size_t i = 0; i &lt; numberOfFrames; ++i)
+            destL[i] = 0.5f * (leftChannel[i] + rightChannel[i]);
+    }
+
+    destroyAudioBufferList(bufferList);
+
+    return audioBus.release();
+}
+
+PassRefPtr&lt;AudioBus&gt; createBusFromAudioFile(const char* filePath, bool mixToMono, float sampleRate)
+{
+    AudioFileReader reader(filePath);
+    return reader.createBus(sampleRate, mixToMono);
+}
+
+PassRefPtr&lt;AudioBus&gt; createBusFromInMemoryAudioFile(const void* data, size_t dataSize, bool mixToMono, float sampleRate)
+{
+    AudioFileReader reader(data, dataSize);
+    return reader.createBus(sampleRate, mixToMono);
+}
+
+} // WebCore
+
+#endif // ENABLE(WEB_AUDIO) &amp;&amp; PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioiosAudioFileReaderIOShfromrev161588trunkSourceWebCoreplatformgraphicsStringTruncatorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.h (from rev 161588, trunk/Source/WebCore/platform/graphics/StringTruncator.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/audio/ios/AudioFileReaderIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioFileReaderIOS_h
+#define AudioFileReaderIOS_h
+
+#include &lt;AudioToolbox/AudioFile.h&gt;
+#include &lt;AudioToolbox/ExtendedAudioFile.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace WebCore {
+
+class AudioBus;
+
+// Wrapper class for AudioFile and ExtAudioFile CoreAudio APIs for reading files and in-memory versions of them...
+
+class AudioFileReader {
+public:
+    AudioFileReader(const char* filePath);
+    AudioFileReader(const void* data, size_t dataSize);
+    ~AudioFileReader();
+
+    PassRefPtr&lt;AudioBus&gt; createBus(float sampleRate, bool mixToMono); // Returns nullptr on error
+
+    const void* data() const { return m_data; }
+    size_t dataSize() const { return m_dataSize; }
+
+private:
+    static OSStatus readProc(void* clientData, SInt64 position, UInt32 requestCount, void* buffer, UInt32* actualCount);
+    static SInt64 getSizeProc(void* clientData);
+
+    const void* m_data;
+    size_t m_dataSize;
+
+    AudioFileID m_audioFileID;
+    ExtAudioFileRef m_extAudioFileRef;
+
+    AudioStreamBasicDescription m_fileDataFormat;
+    AudioStreamBasicDescription m_clientDataFormat;
+};
+
+} // namespace WebCore
+
+#endif // AudioFileReaderIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioiosAudioSessionIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/audio/ios/AudioSessionIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> SOFT_LINK_POINTER(AVFoundation, AVAudioSessionCategoryRecord, NSString *)
</span><span class="cx"> SOFT_LINK_POINTER(AVFoundation, AVAudioSessionCategoryPlayAndRecord, NSString *)
</span><span class="cx"> SOFT_LINK_POINTER(AVFoundation, AVAudioSessionCategoryAudioProcessing, NSString *)
</span><del>-SOFT_LINK_POINTER(AVFoundation, AVAudioSessionInterruptionNotification, NSString *)
</del><span class="cx"> SOFT_LINK_POINTER(AVFoundation, AVAudioSessionInterruptionTypeKey, NSString *)
</span><span class="cx"> 
</span><span class="cx"> #define AVAudioSession getAVAudioSessionClass()
</span><span class="lines">@@ -52,9 +51,14 @@
</span><span class="cx"> #define AVAudioSessionCategoryRecord getAVAudioSessionCategoryRecord()
</span><span class="cx"> #define AVAudioSessionCategoryPlayAndRecord getAVAudioSessionCategoryPlayAndRecord()
</span><span class="cx"> #define AVAudioSessionCategoryAudioProcessing getAVAudioSessionCategoryAudioProcessing()
</span><del>-#define AVAudioSessionInterruptionNotification getAVAudioSessionInterruptionNotification()
</del><span class="cx"> #define AVAudioSessionInterruptionTypeKey getAVAudioSessionInterruptionTypeKey()
</span><span class="cx"> 
</span><ins>+static NSString * const WCAVAudioSessionInterruptionNotification = @&quot;AVAudioSessionInterruptionNotification&quot;;
+
+#if !ASSERT_DISABLED
+SOFT_LINK_POINTER(AVFoundation, AVAudioSessionInterruptionNotification, NSString *)
+#endif
+
</ins><span class="cx"> @interface WebAudioSessionHelper : NSObject {
</span><span class="cx">     WebCore::AudioSession* _callback;
</span><span class="cx"> }
</span><span class="lines">@@ -71,19 +75,25 @@
</span><span class="cx"> 
</span><span class="cx">     _callback = callback;
</span><span class="cx"> 
</span><del>-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(interruption:) name:AVAudioSessionInterruptionNotification object:[AVAudioSession sharedInstance]];
</del><ins>+    ASSERT([WCAVAudioSessionInterruptionNotification isEqualToString:getAVAudioSessionInterruptionNotification()]);
</ins><span class="cx"> 
</span><ins>+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(interruption:) name:WCAVAudioSessionInterruptionNotification object:nil];
+
</ins><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)dealloc
</span><span class="cx"> {
</span><del>-    [[NSNotificationCenter defaultCenter] removeObserver:self];
</del><ins>+    [[NSNotificationCenter defaultCenter] removeObserver:self name:WCAVAudioSessionInterruptionNotification object:nil];
</ins><span class="cx">     [super dealloc];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)interruption:(NSNotification *)notification
</span><span class="cx"> {
</span><ins>+    ASSERT([AVAudioSession sharedInstance] == [notification object]);
+    if ([AVAudioSession sharedInstance] != [notification object])
+        return;
+
</ins><span class="cx">     NSUInteger type = [[[notification userInfo] objectForKey:AVAudioSessionInterruptionTypeKey] unsignedIntegerValue];
</span><span class="cx">     if (type == AVAudioSessionInterruptionTypeBegan)
</span><span class="cx">         _callback-&gt;beganAudioInterruption();
</span><span class="lines">@@ -133,19 +143,26 @@
</span><span class="cx">     switch (newCategory) {
</span><span class="cx">     case AmbientSound:
</span><span class="cx">         categoryString = AVAudioSessionCategoryAmbient;
</span><ins>+        break;
</ins><span class="cx">     case SoloAmbientSound:
</span><span class="cx">         categoryString = AVAudioSessionCategorySoloAmbient;
</span><ins>+        break;
</ins><span class="cx">     case MediaPlayback:
</span><span class="cx">         categoryString = AVAudioSessionCategoryPlayback;
</span><ins>+        break;
</ins><span class="cx">     case RecordAudio:
</span><span class="cx">         categoryString = AVAudioSessionCategoryRecord;
</span><ins>+        break;
</ins><span class="cx">     case PlayAndRecord:
</span><span class="cx">         categoryString = AVAudioSessionCategoryPlayAndRecord;
</span><ins>+        break;
</ins><span class="cx">     case AudioProcessing:
</span><span class="cx">         categoryString = AVAudioSessionCategoryAudioProcessing;
</span><ins>+        break;
</ins><span class="cx">     case None:
</span><span class="cx">     default:
</span><span class="cx">         categoryString = nil;
</span><ins>+        break;
</ins><span class="cx">     }
</span><span class="cx">     NSError *error = nil;
</span><span class="cx">     [[AVAudioSession sharedInstance] setCategory:categoryString error:&amp;error];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacAudioDestinationMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -30,6 +30,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_AUDIO)
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
+
</ins><span class="cx"> #include &quot;AudioDestinationMac.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AudioIOCallback.h&quot;
</span><span class="lines">@@ -181,4 +183,6 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+#endif // PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
+
</ins><span class="cx"> #endif // ENABLE(WEB_AUDIO)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacAudioFileReaderMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/audio/mac/AudioFileReaderMac.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -30,6 +30,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_AUDIO)
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
+
</ins><span class="cx"> #include &quot;AudioFileReaderMac.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AudioBus.h&quot;
</span><span class="lines">@@ -58,7 +60,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> AudioFileReader::AudioFileReader(const char* filePath)
</span><del>-    : m_data(0)
</del><ins>+    : m_data(nullptr)
</ins><span class="cx">     , m_dataSize(0)
</span><span class="cx">     , m_audioFileID(0)
</span><span class="cx">     , m_extAudioFileRef(0)
</span><span class="lines">@@ -237,16 +239,16 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;AudioBus&gt; createBusFromAudioFile(const char* filePath, bool mixToMono, float sampleRate)
</span><span class="cx"> {
</span><del>-    AudioFileReader reader(filePath);
-    return reader.createBus(sampleRate, mixToMono);
</del><ins>+    return AudioFileReader(filePath).createBus(sampleRate, mixToMono);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;AudioBus&gt; createBusFromInMemoryAudioFile(const void* data, size_t dataSize, bool mixToMono, float sampleRate)
</span><span class="cx"> {
</span><del>-    AudioFileReader reader(data, dataSize);
-    return reader.createBus(sampleRate, mixToMono);
</del><ins>+    return AudioFileReader(data, dataSize).createBus(sampleRate, mixToMono);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-} // WebCore
</del><ins>+} // namespace WebCore
</ins><span class="cx"> 
</span><ins>+#endif // PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
+
</ins><span class="cx"> #endif // ENABLE(WEB_AUDIO)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacAudioSessionMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/audio/mac/AudioSessionMac.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;AudioSession.h&quot;
</span><span class="cx"> 
</span><del>-#if USE(AUDIO_SESSION) &amp;&amp; PLATFORM(MAC)
</del><ins>+#if USE(AUDIO_SESSION) &amp;&amp; PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;FloatConversion.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudiomacMediaSessionManagerMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/audio/mac/MediaSessionManagerMac.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">         AudioSession::sharedSession().setPreferredBufferSize(kWebAudioBufferSize);
</span><span class="cx">     // FIXME: &lt;http://webkit.org/b/116725&gt; Figure out why enabling the code below
</span><span class="cx">     // causes media LayoutTests to fail on 10.8.
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</del><ins>+#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</ins><span class="cx">     else if ((has(MediaSession::Video) || has(MediaSession::Audio)) &amp;&amp; Settings::lowPowerVideoAudioBufferSizeEnabled())
</span><span class="cx">         AudioSession::sharedSession().setPreferredBufferSize(kLowPowerVideoBufferSize);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfSharedBufferCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/cf/SharedBufferCF.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -38,13 +38,14 @@
</span><span class="cx"> 
</span><span class="cx"> SharedBuffer::SharedBuffer(CFDataRef cfData)
</span><span class="cx">     : m_size(0)
</span><del>-    , m_cfData(cfData)
</del><ins>+    , m_shouldUsePurgeableMemory(false)
</ins><span class="cx"> #if ENABLE(DISK_IMAGE_CACHE)
</span><span class="cx">     , m_isMemoryMapped(false)
</span><span class="cx">     , m_diskImageCacheId(DiskImageCache::invalidDiskCacheId)
</span><span class="cx">     , m_notifyMemoryMappedCallback(nullptr)
</span><span class="cx">     , m_notifyMemoryMappedCallbackData(nullptr)
</span><span class="cx"> #endif
</span><ins>+    , m_cfData(cfData)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcfURLCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cf/URLCF.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cf/URLCF.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/cf/URLCF.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -30,6 +30,11 @@
</span><span class="cx"> #include &lt;CoreFoundation/CFURL.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;RuntimeApplicationChecksIOS.h&quot;
+#include &lt;CoreFoundation/CFPriv.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> URL::URL(CFURLRef url)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaKeyEventCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/cocoa/KeyEventCocoa.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -531,9 +531,8 @@
</span><span class="cx">         case NSPrintFunctionKey: return VK_PRINT;
</span><span class="cx">         case NSExecuteFunctionKey: return VK_EXECUTE;
</span><span class="cx">         case NSPrintScreenFunctionKey: return VK_SNAPSHOT;
</span><del>-        case NSInsertFunctionKey: return VK_INSERT;
</del><span class="cx"> #if PLATFORM(IOS)
</span><del>-        case NSHelpFunctionKey: return VK_INSERT;
</del><ins>+        case NSInsertFunctionKey: case NSHelpFunctionKey: return VK_INSERT;
</ins><span class="cx"> 
</span><span class="cx">         case NSF1FunctionKey: return VK_F1;
</span><span class="cx">         case NSF2FunctionKey: return VK_F2;
</span><span class="lines">@@ -555,6 +554,8 @@
</span><span class="cx">         case NSF18FunctionKey: return VK_F18;
</span><span class="cx">         case NSF19FunctionKey: return VK_F19;
</span><span class="cx">         case NSF20FunctionKey: return VK_F20;
</span><ins>+#else
+        case NSInsertFunctionKey: return VK_INSERT;
</ins><span class="cx"> #endif
</span><span class="cx">         case NSF21FunctionKey: return VK_F21;
</span><span class="cx">         case NSF22FunctionKey: return VK_F22;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsBitmapImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/BitmapImage.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -37,8 +37,14 @@
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;limits&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+// FIXME: We should better integrate the iOS and non-iOS code in this class. Unlike other ports, the
+// iOS port caches the metadata for a frame without decoding the image.
</ins><span class="cx"> BitmapImage::BitmapImage(ImageObserver* observer)
</span><span class="cx">     : Image(observer)
</span><span class="cx">     , m_currentFrame(0)
</span><span class="lines">@@ -50,6 +56,11 @@
</span><span class="cx">     , m_decodedSize(0)
</span><span class="cx">     , m_decodedPropertiesSize(0)
</span><span class="cx">     , m_frameCount(0)
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: We should expose a setting to enable/disable progressive loading remove the PLATFORM(IOS)-guard.
+    , m_progressiveLoadChunkTime(0)
+    , m_progressiveLoadChunkCount(0)
+#endif
</ins><span class="cx">     , m_isSolidColor(false)
</span><span class="cx">     , m_checkedForSolidColor(false)
</span><span class="cx">     , m_animationFinished(false)
</span><span class="lines">@@ -100,7 +111,16 @@
</span><span class="cx"> {
</span><span class="cx">     // Animated images &gt;5MB are considered large enough that we'll only hang on
</span><span class="cx">     // to one frame at a time.
</span><ins>+#if PLATFORM(IOS)
+    static const unsigned cLargeAnimationCutoff = 2097152;
+
+     // If we have decoded frames but there is no encoded data, we shouldn't destroy
+     // the decoded image since we won't be able to reconstruct it later.
+     if (!data() &amp;&amp; m_frames.size())
+         return;
+#else
</ins><span class="cx">     static const unsigned cLargeAnimationCutoff = 5242880;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     // If we have decoded frames but there is no encoded data, we shouldn't destroy
</span><span class="cx">     // the decoded image since we won't be able to reconstruct it later.
</span><span class="lines">@@ -131,7 +151,11 @@
</span><span class="cx">         imageObserver()-&gt;decodedSizeChanged(this, -safeCast&lt;int&gt;(frameBytesCleared));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void BitmapImage::cacheFrame(size_t index, float scaleHint)
+#else
</ins><span class="cx"> void BitmapImage::cacheFrame(size_t index)
</span><ins>+#endif
</ins><span class="cx"> {
</span><span class="cx">     size_t numFrames = frameCount();
</span><span class="cx">     ASSERT(m_decodedSize == 0 || numFrames &gt; 1);
</span><span class="lines">@@ -139,7 +163,12 @@
</span><span class="cx">     if (m_frames.size() &lt; numFrames)
</span><span class="cx">         m_frames.grow(numFrames);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    m_frames[index].m_frame = m_source.createFrameAtIndex(index, &amp;scaleHint);
+    m_frames[index].m_scale = scaleHint;
+#else
</ins><span class="cx">     m_frames[index].m_frame = m_source.createFrameAtIndex(index);
</span><ins>+#endif
</ins><span class="cx">     if (numFrames == 1 &amp;&amp; m_frames[index].m_frame)
</span><span class="cx">         checkForSolidColor();
</span><span class="cx"> 
</span><span class="lines">@@ -166,6 +195,23 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void BitmapImage::cacheFrameInfo(size_t index)
+{
+    size_t numFrames = frameCount();
+
+    if (m_frames.size() &lt; numFrames)
+        m_frames.resize(numFrames);
+
+    ASSERT(!m_frames[index].m_haveInfo);
+
+    if (shouldAnimate())
+        m_frames[index].m_duration = m_source.frameDurationAtIndex(index);
+    m_frames[index].m_hasAlpha = m_source.frameHasAlphaAtIndex(index);
+    m_frames[index].m_haveInfo = true;
+}
+#endif
+
</ins><span class="cx"> void BitmapImage::didDecodeProperties() const
</span><span class="cx"> {
</span><span class="cx">     if (m_decodedSize)
</span><span class="lines">@@ -193,6 +239,10 @@
</span><span class="cx">     m_sizeRespectingOrientation = m_source.size(ImageOrientationDescription(RespectImageOrientation, description.imageOrientation()));
</span><span class="cx">     m_imageOrientation = static_cast&lt;unsigned&gt;(description.imageOrientation());
</span><span class="cx">     m_shouldRespectImageOrientation = static_cast&lt;unsigned&gt;(description.respectImageOrientation());
</span><ins>+#if PLATFORM(IOS)
+    m_originalSize = m_source.originalSize();
+    m_originalSizeRespectingOrientation = m_source.originalSize(RespectImageOrientation);
+#endif
</ins><span class="cx">     m_haveSize = true;
</span><span class="cx">     didDecodeProperties();
</span><span class="cx"> }
</span><span class="lines">@@ -209,6 +259,20 @@
</span><span class="cx">     return m_sizeRespectingOrientation;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+IntSize BitmapImage::originalSize() const
+{
+    updateSize();
+    return m_originalSize;
+}
+
+IntSize BitmapImage::originalSizeRespectingOrientation() const
+{
+    updateSize();
+    return m_originalSizeRespectingOrientation;
+}
+#endif
+
</ins><span class="cx"> IntSize BitmapImage::currentFrameSize() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_currentFrame || m_hasUniformFrameSize)
</span><span class="lines">@@ -227,6 +291,9 @@
</span><span class="cx"> 
</span><span class="cx"> bool BitmapImage::dataChanged(bool allDataReceived)
</span><span class="cx"> {
</span><ins>+    // Because we're modifying the current frame, clear its (now possibly
+    // inaccurate) metadata as well.
+#if !PLATFORM(IOS)
</ins><span class="cx">     // Clear all partially-decoded frames. For most image formats, there is only
</span><span class="cx">     // one frame, but at least GIF and ICO can have more. With GIFs, the frames
</span><span class="cx">     // come in order and we ask to decode them in order, waiting to request a
</span><span class="lines">@@ -254,11 +321,40 @@
</span><span class="cx">             frameBytesCleared += (m_frames[i].clear(true) ? frameBytes : 0);
</span><span class="cx">     }
</span><span class="cx">     destroyMetadataAndNotify(frameBytesCleared);
</span><ins>+#else
+    int deltaBytes = 0;
+    if (!m_frames.isEmpty()) {
+        int bytes = m_frames[m_frames.size() - 1].m_frameBytes;
+        if (m_frames[m_frames.size() - 1].clear(true)) {
+            deltaBytes += bytes;
+            deltaBytes += m_decodedPropertiesSize;
+            m_decodedPropertiesSize = 0;
+        }
+    }
+    destroyMetadataAndNotify(deltaBytes);
+#endif
</ins><span class="cx">     
</span><span class="cx">     // Feed all the data we've seen so far to the image decoder.
</span><span class="cx">     m_allDataReceived = allDataReceived;
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: We should expose a setting to enable/disable progressive loading and make this
+    // code conditional on it. Then we can remove the PLATFORM(IOS)-guard.
+    static const double chunkLoadIntervals[] = {0, 1, 3, 6, 15};
+    double interval = chunkLoadIntervals[std::min(m_progressiveLoadChunkCount, static_cast&lt;uint16_t&gt;(4))];
+
+    bool needsUpdate = false;
+    if (currentTime() - m_progressiveLoadChunkTime &gt; interval) { // The first time through, the chunk time will be 0 and the image will get an update.
+        needsUpdate = true;
+        m_progressiveLoadChunkTime = currentTime();
+        ASSERT(m_progressiveLoadChunkCount &lt;= std::numeric_limits&lt;uint16_t&gt;::max());
+        ++m_progressiveLoadChunkCount;
+    }
+    if (needsUpdate || allDataReceived)
+        m_source.setData(data(), allDataReceived);
+#else
</ins><span class="cx">     m_source.setData(data(), allDataReceived);
</span><del>-    
</del><ins>+#endif
+
</ins><span class="cx">     m_haveFrameCount = false;
</span><span class="cx">     m_hasUniformFrameSize = true;
</span><span class="cx">     return isSizeAvailable();
</span><span class="lines">@@ -293,6 +389,7 @@
</span><span class="cx">     return m_sizeAvailable;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> bool BitmapImage::ensureFrameIsCached(size_t index)
</span><span class="cx"> {
</span><span class="cx">     if (index &gt;= frameCount())
</span><span class="lines">@@ -302,25 +399,75 @@
</span><span class="cx">         cacheFrame(index);
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><ins>+#else
+bool BitmapImage::ensureFrameInfoIsCached(size_t index)
+{
+    if (index &gt;= frameCount())
+        return false;
</ins><span class="cx"> 
</span><ins>+    if (index &gt;= m_frames.size() || !m_frames[index].m_haveInfo)
+        cacheFrameInfo(index);
+    return true;
+}
+#endif
+
</ins><span class="cx"> PassNativeImagePtr BitmapImage::frameAtIndex(size_t index)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    return frameAtIndex(index, 1.0f);
+#else
</ins><span class="cx">     if (!ensureFrameIsCached(index))
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx">     return m_frames[index].m_frame;
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+PassNativeImagePtr BitmapImage::frameAtIndex(size_t index, float scaleHint)
+{
+    if (index &gt;= frameCount())
+        return nullptr;
+
+    if (index &gt;= m_frames.size() || !m_frames[index].m_frame)
+        cacheFrame(index, scaleHint);
+    else if (std::min(1.0f, scaleHint) &gt; m_frames[index].m_scale) {
+        // If the image is already cached, but at too small a size, re-decode a larger version.
+        int sizeChange = -m_frames[index].m_frameBytes;
+        ASSERT(static_cast&lt;int&gt;(m_decodedSize) + sizeChange &gt;= 0);
+        m_frames[index].clear(true);
+        invalidatePlatformData();
+        m_decodedSize += sizeChange;
+        if (imageObserver())
+            imageObserver()-&gt;decodedSizeChanged(this, sizeChange);
+
+        cacheFrame(index, scaleHint);
+    }
+    return m_frames[index].m_frame;
+}
+#endif
+
</ins><span class="cx"> bool BitmapImage::frameIsCompleteAtIndex(size_t index)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: cacheFrameInfo does not set m_isComplete. Should it?
+    if (!ensureFrameInfoIsCached(index))
+        return false;
+#else
</ins><span class="cx">     if (!ensureFrameIsCached(index))
</span><span class="cx">         return false;
</span><ins>+#endif
</ins><span class="cx">     return m_frames[index].m_isComplete;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> float BitmapImage::frameDurationAtIndex(size_t index)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (!ensureFrameInfoIsCached(index))
+        return 0;
+#else
</ins><span class="cx">     if (!ensureFrameIsCached(index))
</span><span class="cx">         return 0;
</span><ins>+#endif
</ins><span class="cx">     return m_frames[index].m_duration;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -331,9 +478,13 @@
</span><span class="cx"> 
</span><span class="cx"> bool BitmapImage::frameHasAlphaAtIndex(size_t index)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (!ensureFrameInfoIsCached(index))
+        return true; // FIXME: Why would an invalid index return true here?
+#else
</ins><span class="cx">     if (m_frames.size() &lt;= index)
</span><span class="cx">         return true;
</span><del>-
</del><ins>+#endif
</ins><span class="cx">     if (m_frames[index].m_haveMetadata)
</span><span class="cx">         return m_frames[index].m_hasAlpha;
</span><span class="cx"> 
</span><span class="lines">@@ -347,8 +498,14 @@
</span><span class="cx"> 
</span><span class="cx"> ImageOrientation BitmapImage::frameOrientationAtIndex(size_t index)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: cacheFrameInfo does not set m_orientation. Should it?
+    if (!ensureFrameInfoIsCached(index))
+        return DefaultImageOrientation;
+#else
</ins><span class="cx">     if (!ensureFrameIsCached(index))
</span><span class="cx">         return DefaultImageOrientation;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (m_frames[index].m_haveMetadata)
</span><span class="cx">         return m_frames[index].m_orientation;
</span><span class="lines">@@ -363,8 +520,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-
-
</del><span class="cx"> int BitmapImage::repetitionCount(bool imageKnownToBeComplete)
</span><span class="cx"> {
</span><span class="cx">     if ((m_repetitionCountStatus == Unknown) || ((m_repetitionCountStatus == Uncertain) &amp;&amp; imageKnownToBeComplete)) {
</span><span class="lines">@@ -412,12 +567,18 @@
</span><span class="cx">     const double currentDuration = frameDurationAtIndex(m_currentFrame);
</span><span class="cx">     m_desiredFrameStartTime += currentDuration;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     // When an animated image is more than five minutes out of date, the
</span><span class="cx">     // user probably doesn't care about resyncing and we could burn a lot of
</span><span class="cx">     // time looping through frames below.  Just reset the timings.
</span><span class="cx">     const double cAnimationResyncCutoff = 5 * 60;
</span><span class="cx">     if ((time - m_desiredFrameStartTime) &gt; cAnimationResyncCutoff)
</span><span class="cx">         m_desiredFrameStartTime = time + currentDuration;
</span><ins>+#else
+    // Maintaining frame-to-frame delays is more important than
+    // maintaining absolute animation timing, so reset the timings each frame.
+    m_desiredFrameStartTime = time + currentDuration;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     // The image may load more slowly than it's supposed to animate, so that by
</span><span class="cx">     // the time we reach the end of the first repetition, we're well behind.
</span><span class="lines">@@ -548,10 +709,12 @@
</span><span class="cx">     // Stop the animation.
</span><span class="cx">     stopAnimation();
</span><span class="cx">     
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     // See if anyone is still paying attention to this animation.  If not, we don't
</span><span class="cx">     // advance and will remain suspended at the current frame until the animation is resumed.
</span><span class="cx">     if (!skippingFrames &amp;&amp; imageObserver()-&gt;shouldPauseAnimation(this))
</span><span class="cx">         return false;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     ++m_currentFrame;
</span><span class="cx">     bool advancedAnimation = true;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsBitmapImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/BitmapImage.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -36,7 +36,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> OBJC_CLASS NSImage;
</span><ins>+#endif // PLATFORM(IOS)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="lines">@@ -67,6 +69,10 @@
</span><span class="cx">     FrameData()
</span><span class="cx">         : m_frame(0)
</span><span class="cx">         , m_orientation(DefaultImageOrientation)
</span><ins>+#if PLATFORM(IOS)
+        , m_scale(0)
+        , m_haveInfo(false)
+#endif
</ins><span class="cx">         , m_duration(0)
</span><span class="cx">         , m_haveMetadata(false)
</span><span class="cx">         , m_isComplete(false)
</span><span class="lines">@@ -86,6 +92,10 @@
</span><span class="cx"> 
</span><span class="cx">     NativeImagePtr m_frame;
</span><span class="cx">     ImageOrientation m_orientation;
</span><ins>+#if PLATFORM(IOS)
+    float m_scale;
+    bool m_haveInfo;
+#endif
</ins><span class="cx">     float m_duration;
</span><span class="cx">     bool m_haveMetadata : 1;
</span><span class="cx">     bool m_isComplete : 1;
</span><span class="lines">@@ -97,6 +107,9 @@
</span><span class="cx"> // BitmapImage Class
</span><span class="cx"> // =================================================
</span><span class="cx"> 
</span><ins>+// FIXME: We should better integrate the iOS and non-iOS code in this class. Unlike other ports, the
+// iOS port caches the metadata for a frame without decoding the image.
+
</ins><span class="cx"> class BitmapImage FINAL : public Image {
</span><span class="cx">     friend class GeneratedImage;
</span><span class="cx">     friend class CrossfadeGeneratedImage;
</span><span class="lines">@@ -122,6 +135,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual IntSize size() const OVERRIDE;
</span><span class="cx">     IntSize sizeRespectingOrientation(ImageOrientationDescription = ImageOrientationDescription()) const;
</span><ins>+#if PLATFORM(IOS)
+    virtual IntSize originalSize() const;
+    IntSize originalSizeRespectingOrientation() const;
+#endif
</ins><span class="cx">     IntSize currentFrameSize() const;
</span><span class="cx">     virtual bool getHotSpot(IntPoint&amp;) const OVERRIDE;
</span><span class="cx"> 
</span><span class="lines">@@ -141,7 +158,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     // Accessors for native image formats.
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     virtual NSImage* getNSImage() OVERRIDE;
</span><ins>+#endif
</ins><span class="cx">     virtual CFDataRef getTIFFRepresentation() OVERRIDE;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -195,6 +214,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     size_t currentFrame() const { return m_currentFrame; }
</span><ins>+#if PLATFORM(IOS)
+    PassNativeImagePtr frameAtIndex(size_t, float scaleHint);
+    PassNativeImagePtr copyUnscaledFrameAtIndex(size_t);
+#endif
</ins><span class="cx">     size_t frameCount();
</span><span class="cx">     PassNativeImagePtr frameAtIndex(size_t);
</span><span class="cx">     bool frameIsCompleteAtIndex(size_t);
</span><span class="lines">@@ -203,9 +226,18 @@
</span><span class="cx">     ImageOrientation frameOrientationAtIndex(size_t);
</span><span class="cx"> 
</span><span class="cx">     // Decodes and caches a frame. Never accessed except internally.
</span><ins>+#if PLATFORM(IOS)
+    void cacheFrame(size_t index, float scaleHint);
+
+    // Cache frame metadata without decoding image.
+    void cacheFrameInfo(size_t index);
+    // Called before accessing m_frames[index] for info without decoding. Returns false on index out of bounds.
+    bool ensureFrameInfoIsCached(size_t index);
+#else
</ins><span class="cx">     void cacheFrame(size_t index);
</span><span class="cx">     // Called before accessing m_frames[index]. Returns false on index out of bounds.
</span><span class="cx">     bool ensureFrameIsCached(size_t index);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     // Called to invalidate cached data.  When |destroyAll| is true, we wipe out
</span><span class="cx">     // the entire frame buffer cache and tell the image source to destroy
</span><span class="lines">@@ -268,6 +300,10 @@
</span><span class="cx">     mutable unsigned m_imageOrientation : 4; // ImageOrientationEnum
</span><span class="cx">     mutable unsigned m_shouldRespectImageOrientation : 1; // RespectImageOrientationEnum
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    mutable IntSize m_originalSize; // The size of the unsubsampled image.
+    mutable IntSize m_originalSizeRespectingOrientation;
+#endif
</ins><span class="cx">     size_t m_currentFrame; // The index of the current frame of animation.
</span><span class="cx">     Vector&lt;FrameData, 1&gt; m_frames; // An array of the cached frames of the animation. We have to ref frames to pin them in the cache.
</span><span class="cx"> 
</span><span class="lines">@@ -278,7 +314,9 @@
</span><span class="cx">     double m_desiredFrameStartTime;  // The system time at which we hope to see the next call to startAnimation().
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     mutable RetainPtr&lt;NSImage&gt; m_nsImage; // A cached NSImage of frame 0. Only built lazily if someone actually queries for one.
</span><ins>+#endif
</ins><span class="cx">     mutable RetainPtr&lt;CFDataRef&gt; m_tiffRep; // Cached TIFF rep for frame 0.  Only built lazily if someone queries for one.
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -288,6 +326,12 @@
</span><span class="cx">     mutable unsigned m_decodedPropertiesSize; // The size of data decoded by the source to determine image properties (e.g. size, frame count, etc).
</span><span class="cx">     size_t m_frameCount;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: We should expose a setting to enable/disable progressive loading remove the PLATFORM(IOS)-guard.
+    double m_progressiveLoadChunkTime;
+    uint16_t m_progressiveLoadChunkCount;
+#endif
+
</ins><span class="cx">     bool m_isSolidColor : 1; // Whether or not we are a 1x1 solid image.
</span><span class="cx">     bool m_checkedForSolidColor : 1; // Whether we've checked the frame for solid color.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Color.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Color.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/Color.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -310,6 +310,17 @@
</span><span class="cx">                  alpha());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool Color::isDark() const
+{
+    float red;
+    float green;
+    float blue;
+    float alpha;
+    getRGBA(red, green, blue, alpha);
+    float largestNonAlphaChannel = std::max(red, std::max(green, blue));
+    return alpha &gt; 0.5 &amp;&amp; largestNonAlphaChannel &lt; 0.5;
+}
+
</ins><span class="cx"> static int blendComponent(int c, int a)
</span><span class="cx"> {
</span><span class="cx">     // We use white.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsColorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Color.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Color.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/Color.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -34,6 +34,9 @@
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> #include &quot;ColorSpace.h&quot;
</span><span class="cx"> typedef struct CGColor* CGColorRef;
</span><ins>+#if PLATFORM(IOS)
+typedef struct CGColorSpace* CGColorSpaceRef;
+#endif // PLATFORM(IOS)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="lines">@@ -118,6 +121,8 @@
</span><span class="cx">     Color light() const;
</span><span class="cx">     Color dark() const;
</span><span class="cx"> 
</span><ins>+    bool isDark() const;
+
</ins><span class="cx">     // This is an implementation of Porter-Duff's &quot;source-over&quot; equation
</span><span class="cx">     Color blend(const Color&amp;) const;
</span><span class="cx">     Color blendWithWhite() const;
</span><span class="lines">@@ -145,7 +150,16 @@
</span><span class="cx">     static const RGBA32 gray = 0xFFA0A0A0;
</span><span class="cx">     static const RGBA32 lightGray = 0xFFC0C0C0;
</span><span class="cx">     static const RGBA32 transparent = 0x00000000;
</span><ins>+    static const RGBA32 cyan = 0xFF00FFFF;
</ins><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    static const RGBA32 tap = 0x4D1A1A1A;
+
+    // FIXME: This color shouldn't be iOS-specific. Once we fix up its usage in InlineTextBox::paintCompositionBackground()
+    // we should move it outside the PLATFORM(IOS)-guard. See &lt;https://bugs.webkit.org/show_bug.cgi?id=126296&gt;.
+    static const RGBA32 compositionFill = 0x3CAFC0E3;
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     RGBA32 m_color;
</span><span class="cx">     bool m_valid;
</span><span class="lines">@@ -200,6 +214,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> CGColorRef cachedCGColor(const Color&amp;, ColorSpace);
</span><ins>+#if PLATFORM(IOS)
+CGColorRef createCGColorWithDeviceWhite(CGFloat white, CGFloat alpha);
+#endif // PLATFORM(IOS)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsDisplayRefreshMonitorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -131,12 +131,19 @@
</span><span class="cx">     void stopAnimationClient();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> public:
</span><span class="cx">     void displayLinkFired(double nowSeconds, double outputTimeSeconds);
</span><span class="cx"> private:
</span><span class="cx">     CVDisplayLinkRef m_displayLink;
</span><span class="cx"> #endif
</span><ins>+
+#if PLATFORM(IOS)
+public:
+    void displayLinkFired(double nowSeconds);
+private:
+    void* m_displayLink;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> //
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFloatPointh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FloatPoint.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FloatPoint.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/FloatPoint.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -43,13 +43,13 @@
</span><span class="cx"> typedef struct CGPoint CGPoint;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> typedef struct CGPoint NSPoint;
</span><span class="cx"> #else
</span><span class="cx"> typedef struct _NSPoint NSPoint;
</span><span class="cx"> #endif
</span><del>-#endif
</del><ins>+#endif // PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -139,10 +139,12 @@
</span><span class="cx">     operator CGPoint() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if PLATFORM(MAC) &amp;&amp; !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
</span><span class="cx">     FloatPoint(const NSPoint&amp;);
</span><span class="cx">     operator NSPoint() const;
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(BLACKBERRY)
</span><span class="cx">     FloatPoint(const BlackBerry::Platform::FloatPoint&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFloatRecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FloatRect.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FloatRect.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/FloatRect.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -30,17 +30,21 @@
</span><span class="cx"> #include &quot;FloatPoint.h&quot;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;CoreGraphics/CGGeometry.h&gt;
+#endif
+
</ins><span class="cx"> #if USE(CG)
</span><span class="cx"> typedef struct CGRect CGRect;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> typedef struct CGRect NSRect;
</span><span class="cx"> #else
</span><span class="cx"> typedef struct _NSRect NSRect;
</span><span class="cx"> #endif
</span><del>-#endif
</del><ins>+#endif // PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(BLACKBERRY)
</span><span class="cx"> namespace BlackBerry {
</span><span class="lines">@@ -181,10 +185,12 @@
</span><span class="cx">     operator CGRect() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if PLATFORM(MAC) &amp;&amp; !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
</span><span class="cx">     FloatRect(const NSRect&amp;);
</span><span class="cx">     operator NSRect() const;
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CAIRO)
</span><span class="cx">     FloatRect(const cairo_rectangle_t&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFloatSizeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FloatSize.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FloatSize.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/FloatSize.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -39,17 +39,21 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
+
</ins><span class="cx"> #if USE(CG)
</span><span class="cx"> typedef struct CGSize CGSize;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> typedef struct CGSize NSSize;
</span><span class="cx"> #else
</span><span class="cx"> typedef struct _NSSize NSSize;
</span><span class="cx"> #endif
</span><del>-#endif
</del><ins>+#endif // PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -122,10 +126,12 @@
</span><span class="cx">     operator CGSize() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if (PLATFORM(MAC) &amp;&amp; !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES))
</span><span class="cx">     explicit FloatSize(const NSSize &amp;); // don't do this implicitly since it's lossy
</span><span class="cx">     operator NSSize() const;
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx">     void dump(PrintStream&amp; out) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Font.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Font.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/Font.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -50,6 +50,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+static PassRef&lt;FontGlyphs&gt; retrieveOrAddCachedFontGlyphs(const FontDescription&amp;, PassRefPtr&lt;FontSelector&gt;);
+
</ins><span class="cx"> const uint8_t Font::s_roundingHackCharacterTable[256] = {
</span><span class="cx">     0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*\t*/, 1 /*\n*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
</span><span class="cx">     1 /*space*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*-*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 /*?*/,
</span><span class="lines">@@ -116,6 +118,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: We should make this constructor platform-independent.
</ins><span class="cx"> Font::Font(const FontPlatformData&amp; fontData, bool isPrinterFont, FontSmoothingMode fontSmoothingMode)
</span><span class="cx">     : m_glyphs(FontGlyphs::createForPlatformFont(fontData))
</span><span class="cx">     , m_letterSpacing(0)
</span><span class="lines">@@ -125,8 +128,32 @@
</span><span class="cx"> {
</span><span class="cx">     m_fontDescription.setUsePrinterFont(isPrinterFont);
</span><span class="cx">     m_fontDescription.setFontSmoothing(fontSmoothingMode);
</span><ins>+#if PLATFORM(IOS)
+    m_fontDescription.setSpecifiedSize(CTFontGetSize(fontData.font()));
+    m_fontDescription.setComputedSize(CTFontGetSize(fontData.font()));
+    m_fontDescription.setItalic(CTFontGetSymbolicTraits(fontData.font()) &amp; kCTFontTraitItalic);
+    m_fontDescription.setWeight((CTFontGetSymbolicTraits(fontData.font()) &amp; kCTFontTraitBold) ? FontWeightBold : FontWeightNormal);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: We should make this constructor platform-independent.
+#if PLATFORM(IOS)
+Font::Font(const FontPlatformData&amp; fontData, PassRefPtr&lt;FontSelector&gt; fontSelector)
+    : m_glyphs(FontGlyphs::createForPlatformFont(fontData))
+    , m_letterSpacing(0)
+    , m_wordSpacing(0)
+    , m_typesettingFeatures(computeTypesettingFeatures())
+{
+    CTFontRef primaryFont = fontData.font();
+    m_fontDescription.setSpecifiedSize(CTFontGetSize(primaryFont));
+    m_fontDescription.setComputedSize(CTFontGetSize(primaryFont));
+    m_fontDescription.setItalic(CTFontGetSymbolicTraits(primaryFont) &amp; kCTFontTraitItalic);
+    m_fontDescription.setWeight((CTFontGetSymbolicTraits(primaryFont) &amp; kCTFontTraitBold) ? FontWeightBold : FontWeightNormal);
+    m_fontDescription.setUsePrinterFont(fontData.isPrinterFont());
+    m_glyphs = retrieveOrAddCachedFontGlyphs(m_fontDescription, fontSelector.get());
+}
+#endif
+
</ins><span class="cx"> Font::Font(const Font&amp; other)
</span><span class="cx">     : m_fontDescription(other.m_fontDescription)
</span><span class="cx">     , m_glyphs(other.m_glyphs)
</span><span class="lines">@@ -297,14 +324,14 @@
</span><span class="cx">     m_typesettingFeatures = computeTypesettingFeatures();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Font::drawText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const
</del><ins>+float Font::drawText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to, CustomFontNotReadyAction customFontNotReadyAction) const
</ins><span class="cx"> {
</span><span class="cx">     // Don't draw anything while we are using custom fonts that are in the process of loading,
</span><span class="cx">     // except if the 'force' argument is set to true (in which case it will use a fallback
</span><span class="cx">     // font).
</span><span class="cx">     if (loadingCustomFonts() &amp;&amp; customFontNotReadyAction == DoNotPaintIfFontNotReady)
</span><del>-        return;
-    
</del><ins>+        return 0;
+
</ins><span class="cx">     to = (to == -1 ? run.length() : to);
</span><span class="cx"> 
</span><span class="cx">     if (codePath(run) != Complex)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFonth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Font.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Font.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/Font.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -82,6 +82,11 @@
</span><span class="cx">     Font(const FontDescription&amp;, float letterSpacing, float wordSpacing);
</span><span class="cx">     // This constructor is only used if the platform wants to start with a native font.
</span><span class="cx">     Font(const FontPlatformData&amp;, bool isPrinting, FontSmoothingMode = AutoSmoothing);
</span><ins>+
+    // FIXME: We should make this constructor platform-independent.
+#if PLATFORM(IOS)
+    Font(const FontPlatformData&amp;, PassRefPtr&lt;FontSelector&gt;);
+#endif
</ins><span class="cx">     ~Font();
</span><span class="cx"> 
</span><span class="cx">     Font(const Font&amp;);
</span><span class="lines">@@ -98,7 +103,7 @@
</span><span class="cx">     void update(PassRefPtr&lt;FontSelector&gt;) const;
</span><span class="cx"> 
</span><span class="cx">     enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontNotReady };
</span><del>-    void drawText(GraphicsContext*, const TextRun&amp;, const FloatPoint&amp;, int from = 0, int to = -1, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
</del><ins>+    float drawText(GraphicsContext*, const TextRun&amp;, const FloatPoint&amp;, int from = 0, int to = -1, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
</ins><span class="cx">     void drawEmphasisMarks(GraphicsContext*, const TextRun&amp;, const AtomicString&amp; mark, const FloatPoint&amp;, int from = 0, int to = -1) const;
</span><span class="cx"> 
</span><span class="cx">     DashArray dashesForIntersectionsWithRect(const TextRun&amp;, const FloatPoint&amp; textOrigin, int from, int to, const FloatRect&amp; lineExtents) const;
</span><span class="lines">@@ -180,10 +185,10 @@
</span><span class="cx"> 
</span><span class="cx">     // Returns the initial in-stream advance.
</span><span class="cx">     float getGlyphsAndAdvancesForSimpleText(const TextRun&amp;, int from, int to, GlyphBuffer&amp;, ForTextEmphasisOrNot = NotForTextEmphasis) const;
</span><del>-    void drawSimpleText(GraphicsContext*, const TextRun&amp;, const FloatPoint&amp;, int from, int to) const;
</del><ins>+    float drawSimpleText(GraphicsContext*, const TextRun&amp;, const FloatPoint&amp;, int from, int to) const;
</ins><span class="cx">     void drawEmphasisMarksForSimpleText(GraphicsContext*, const TextRun&amp;, const AtomicString&amp; mark, const FloatPoint&amp;, int from, int to) const;
</span><span class="cx">     void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&amp;, int from, int to, const FloatPoint&amp;) const;
</span><del>-    void drawGlyphBuffer(GraphicsContext*, const TextRun&amp;, const GlyphBuffer&amp;, const FloatPoint&amp;) const;
</del><ins>+    void drawGlyphBuffer(GraphicsContext*, const TextRun&amp;, const GlyphBuffer&amp;, FloatPoint&amp;) const;
</ins><span class="cx">     void drawEmphasisMarks(GraphicsContext*, const TextRun&amp;, const GlyphBuffer&amp;, const AtomicString&amp;, const FloatPoint&amp;) const;
</span><span class="cx">     float floatWidthForSimpleText(const TextRun&amp;, HashSet&lt;const SimpleFontData*&gt;* fallbackFonts = 0, GlyphOverflow* = 0) const;
</span><span class="cx">     int offsetForPositionForSimpleText(const TextRun&amp;, float position, bool includePartialGlyphs) const;
</span><span class="lines">@@ -196,7 +201,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Returns the initial in-stream advance.
</span><span class="cx">     float getGlyphsAndAdvancesForComplexText(const TextRun&amp;, int from, int to, GlyphBuffer&amp;, ForTextEmphasisOrNot = NotForTextEmphasis) const;
</span><del>-    void drawComplexText(GraphicsContext*, const TextRun&amp;, const FloatPoint&amp;, int from, int to) const;
</del><ins>+    float drawComplexText(GraphicsContext*, const TextRun&amp;, const FloatPoint&amp;, int from, int to) const;
</ins><span class="cx">     void drawEmphasisMarksForComplexText(GraphicsContext*, const TextRun&amp;, const AtomicString&amp; mark, const FloatPoint&amp;, int from, int to) const;
</span><span class="cx">     float floatWidthForComplexText(const TextRun&amp;, HashSet&lt;const SimpleFontData*&gt;* fallbackFonts = 0, GlyphOverflow* = 0) const;
</span><span class="cx">     int offsetForPositionForComplexText(const TextRun&amp;, float position, bool includePartialGlyphs) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -45,14 +45,50 @@
</span><span class="cx"> #include &quot;OpenTypeVerticalData.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;MemoryPressureHandler.h&quot;
+#include &lt;wtf/Noncopyable.h&gt;
+
+// FIXME: We may be able to simplify this code using C++11 threading primitives, including std::call_once().
+static pthread_mutex_t fontDataLock;
+
+static void initFontCacheLockOnce()
+{
+    pthread_mutexattr_t mutexAttribute;
+    pthread_mutexattr_init(&amp;mutexAttribute);
+    pthread_mutexattr_settype(&amp;mutexAttribute, PTHREAD_MUTEX_RECURSIVE);
+    pthread_mutex_init(&amp;fontDataLock, &amp;mutexAttribute);
+    pthread_mutexattr_destroy(&amp;mutexAttribute);
+}
+
+static pthread_once_t initFontLockControl = PTHREAD_ONCE_INIT;
+
+class FontLocker {
+    WTF_MAKE_NONCOPYABLE(FontLocker);
+public:
+    FontLocker()
+    {
+        pthread_once(&amp;initFontLockControl, initFontCacheLockOnce);
+        int lockcode = pthread_mutex_lock(&amp;fontDataLock);
+        ASSERT_WITH_MESSAGE_UNUSED(lockcode, !lockcode, &quot;fontDataLock lock failed with code:%d&quot;, lockcode);    
+    }
+    ~FontLocker()
+    {
+        int lockcode = pthread_mutex_unlock(&amp;fontDataLock);
+        ASSERT_WITH_MESSAGE_UNUSED(lockcode, !lockcode, &quot;fontDataLock unlock failed with code:%d&quot;, lockcode);
+    }
+};
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> using namespace WTF;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+// FIXME: We should return a reference instead of a pointer since we never return a nullptr.
</ins><span class="cx"> FontCache* fontCache()
</span><span class="cx"> {
</span><del>-    DEFINE_STATIC_LOCAL(FontCache, globalFontCache, ());
-    return &amp;globalFontCache;
</del><ins>+    static NeverDestroyed&lt;FontCache&gt; globalFontCache;
+    return &amp;globalFontCache.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FontCache::FontCache()
</span><span class="lines">@@ -184,6 +220,10 @@
</span><span class="cx">                                                        const AtomicString&amp; passedFamilyName,
</span><span class="cx">                                                        bool checkingAlternateName)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    FontLocker fontLocker;
+#endif
+    
</ins><span class="cx"> #if OS(WINDOWS) &amp;&amp; ENABLE(OPENTYPE_VERTICAL)
</span><span class="cx">     // Leading &quot;@&quot; in the font name enables Windows vertical flow flag for the font.
</span><span class="cx">     // Because we do vertical flow by ourselves, we don't want to use the Windows feature.
</span><span class="lines">@@ -317,8 +357,15 @@
</span><span class="cx"> 
</span><span class="cx"> static FontDataCache* gFontDataCache = 0;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+const int cMaxInactiveFontData = 120;
+const int cTargetInactiveFontData = 100;
+const int cMaxUnderMemoryPressureInactiveFontData = 50;
+const int cTargetUnderMemoryPressureInactiveFontData = 30;
+#else
</ins><span class="cx"> const int cMaxInactiveFontData = 225;
</span><span class="cx"> const int cTargetInactiveFontData = 200;
</span><ins>+#endif
</ins><span class="cx"> static ListHashSet&lt;RefPtr&lt;SimpleFontData&gt;&gt;* gInactiveFontData = 0;
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;SimpleFontData&gt; FontCache::getCachedFontData(const FontDescription&amp; fontDescription, const AtomicString&amp; family, bool checkingAlternateName, ShouldRetain shouldRetain)
</span><span class="lines">@@ -340,6 +387,10 @@
</span><span class="cx">         ASSERT(m_purgePreventCount);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    FontLocker fontLocker;
+#endif
+    
</ins><span class="cx">     if (!gFontDataCache) {
</span><span class="cx">         gFontDataCache = new FontDataCache;
</span><span class="cx">         gInactiveFontData = new ListHashSet&lt;RefPtr&lt;SimpleFontData&gt;&gt;;
</span><span class="lines">@@ -380,6 +431,10 @@
</span><span class="cx">     ASSERT(gFontDataCache);
</span><span class="cx">     ASSERT(!fontData-&gt;isCustomFont());
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    FontLocker fontLocker;
+#endif
+    
</ins><span class="cx">     FontDataCache::iterator it = gFontDataCache-&gt;find(fontData-&gt;platformData());
</span><span class="cx">     ASSERT(it != gFontDataCache-&gt;end());
</span><span class="cx">     if (it == gFontDataCache-&gt;end())
</span><span class="lines">@@ -392,8 +447,17 @@
</span><span class="cx"> 
</span><span class="cx"> void FontCache::purgeInactiveFontDataIfNeeded()
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    bool underMemoryPressure = memoryPressureHandler().hasReceivedMemoryPressure();
+    int inactiveFontDataLimit = underMemoryPressure ? cMaxUnderMemoryPressureInactiveFontData : cMaxInactiveFontData;
+    int targetFontDataLimit = underMemoryPressure ? cTargetUnderMemoryPressureInactiveFontData : cTargetInactiveFontData;
+
+    if (gInactiveFontData &amp;&amp; !m_purgePreventCount &amp;&amp; gInactiveFontData-&gt;size() &gt; inactiveFontDataLimit)
+        purgeInactiveFontData(gInactiveFontData-&gt;size() - targetFontDataLimit);
+#else
</ins><span class="cx">     if (gInactiveFontData &amp;&amp; !m_purgePreventCount &amp;&amp; gInactiveFontData-&gt;size() &gt; cMaxInactiveFontData)
</span><span class="cx">         purgeInactiveFontData(gInactiveFontData-&gt;size() - cTargetInactiveFontData);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FontCache::purgeInactiveFontData(int count)
</span><span class="lines">@@ -409,6 +473,10 @@
</span><span class="cx"> 
</span><span class="cx">     isPurging = true;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    FontLocker fontLocker;
+#endif
+
</ins><span class="cx">     Vector&lt;RefPtr&lt;SimpleFontData&gt;, 20&gt; fontDataToDelete;
</span><span class="cx">     ListHashSet&lt;RefPtr&lt;SimpleFontData&gt;&gt;::iterator end = gInactiveFontData-&gt;end();
</span><span class="cx">     ListHashSet&lt;RefPtr&lt;SimpleFontData&gt;&gt;::iterator it = gInactiveFontData-&gt;begin();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -33,12 +33,17 @@
</span><span class="cx"> #include &quot;FontDescription.h&quot;
</span><span class="cx"> #include &lt;limits.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> #include &lt;wtf/unicode/Unicode.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;CoreText/CTFont.h&gt;
+#endif
+
</ins><span class="cx"> #if OS(WINDOWS)
</span><span class="cx"> #include &lt;windows.h&gt;
</span><span class="cx"> #include &lt;objidl.h&gt;
</span><span class="lines">@@ -100,9 +105,9 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class FontCache {
</span><ins>+    WTF_MAKE_NONCOPYABLE(FontCache); WTF_MAKE_FAST_ALLOCATED;
</ins><span class="cx">     friend class FontCachePurgePreventer;
</span><del>-
-    WTF_MAKE_NONCOPYABLE(FontCache); WTF_MAKE_FAST_ALLOCATED;
</del><ins>+    friend class NeverDestroyed&lt;FontCache&gt;;
</ins><span class="cx"> public:
</span><span class="cx">     friend FontCache* fontCache();
</span><span class="cx"> 
</span><span class="lines">@@ -117,6 +122,9 @@
</span><span class="cx">     // Also implemented by the platform.
</span><span class="cx">     void platformInit();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    static float weightOfCTFont(CTFontRef);
+#endif
</ins><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     IMLangFontLinkType* getFontLinkInterface();
</span><span class="cx">     static void comInitialize();
</span><span class="lines">@@ -178,6 +186,10 @@
</span><span class="cx">     FontPlatformData* getCachedFontPlatformData(const FontDescription&amp;, const AtomicString&amp; family, bool checkingAlternateName = false);
</span><span class="cx"> 
</span><span class="cx">     // These methods are implemented by each platform.
</span><ins>+#if PLATFORM(IOS)
+    FontPlatformData* getCustomFallbackFont(const UInt32, const FontDescription&amp;);
+    PassRefPtr&lt;SimpleFontData&gt; getSystemFontFallbackForCharacters(const FontDescription&amp;, const SimpleFontData*, const UChar* characters, int length);
+#endif
</ins><span class="cx">     PassOwnPtr&lt;FontPlatformData&gt; createFontPlatformData(const FontDescription&amp;, const AtomicString&amp; family);
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     PassRefPtr&lt;SimpleFontData&gt; similarFontPlatformData(const FontDescription&amp;);
</span><span class="lines">@@ -193,6 +205,9 @@
</span><span class="cx"> #endif
</span><span class="cx">     friend class SimpleFontData; // For getCachedFontData(const FontPlatformData*)
</span><span class="cx">     friend class FontGlyphs;
</span><ins>+#if PLATFORM(IOS)
+    friend class ComplexTextController;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> // Get the global fontCache.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontFastPathcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontFastPath.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontFastPath.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/FontFastPath.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">     return beforeWidth;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Font::drawSimpleText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to) const
</del><ins>+float Font::drawSimpleText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to) const
</ins><span class="cx"> {
</span><span class="cx">     // This glyph buffer holds our glyphs+advances+font data for each glyph.
</span><span class="cx">     GlyphBuffer glyphBuffer;
</span><span class="lines">@@ -166,10 +166,12 @@
</span><span class="cx">     float startX = point.x() + getGlyphsAndAdvancesForSimpleText(run, from, to, glyphBuffer);
</span><span class="cx"> 
</span><span class="cx">     if (glyphBuffer.isEmpty())
</span><del>-        return;
</del><ins>+        return 0;
</ins><span class="cx"> 
</span><span class="cx">     FloatPoint startPoint(startX, point.y());
</span><span class="cx">     drawGlyphBuffer(context, run, glyphBuffer, startPoint);
</span><ins>+
+    return startPoint.x() - startX;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Font::drawEmphasisMarksForSimpleText(GraphicsContext* context, const TextRun&amp; run, const AtomicString&amp; mark, const FloatPoint&amp; point, int from, int to) const
</span><span class="lines">@@ -183,8 +185,8 @@
</span><span class="cx">     drawEmphasisMarks(context, run, glyphBuffer, mark, FloatPoint(point.x() + initialAdvance, point.y()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Font::drawGlyphBuffer(GraphicsContext* context, const TextRun&amp; run, const GlyphBuffer&amp; glyphBuffer, const FloatPoint&amp; point) const
-{   
</del><ins>+void Font::drawGlyphBuffer(GraphicsContext* context, const TextRun&amp; run, const GlyphBuffer&amp; glyphBuffer, FloatPoint&amp; point) const
+{
</ins><span class="cx"> #if !ENABLE(SVG_FONTS)
</span><span class="cx">     UNUSED_PARAM(run);
</span><span class="cx"> #endif
</span><span class="lines">@@ -226,9 +228,11 @@
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx">     if (renderingContext &amp;&amp; fontData-&gt;isSVGFont())
</span><span class="cx">         renderingContext-&gt;drawSVGGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
</span><del>-    else
</del><ins>+    else {
</ins><span class="cx"> #endif
</span><span class="cx">         drawGlyphs(context, fontData, glyphBuffer, lastFrom, nextGlyph - lastFrom, startPoint);
</span><ins>+        point.setX(nextX);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline static float offsetToMiddleOfGlyph(const SimpleFontData* fontData, Glyph glyph)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontGlyphs.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -27,6 +27,10 @@
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class GlyphPageTreeNode;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontPlatformDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -33,6 +33,9 @@
</span><span class="cx">     : m_syntheticBold(false)
</span><span class="cx">     , m_syntheticOblique(false)
</span><span class="cx">     , m_orientation(Horizontal)
</span><ins>+#if PLATFORM(IOS)
+    , m_isEmoji(false)
+#endif
</ins><span class="cx">     , m_size(0)
</span><span class="cx">     , m_widthVariant(RegularWidth)
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="lines">@@ -60,6 +63,9 @@
</span><span class="cx">     : m_syntheticBold(false)
</span><span class="cx">     , m_syntheticOblique(false)
</span><span class="cx">     , m_orientation(Horizontal)
</span><ins>+#if PLATFORM(IOS)
+    , m_isEmoji(false)
+#endif
</ins><span class="cx">     , m_size(0)
</span><span class="cx">     , m_widthVariant(RegularWidth)
</span><span class="cx"> #if OS(DARWIN)
</span><span class="lines">@@ -85,6 +91,9 @@
</span><span class="cx">     : m_syntheticBold(syntheticBold)
</span><span class="cx">     , m_syntheticOblique(syntheticOblique)
</span><span class="cx">     , m_orientation(orientation)
</span><ins>+#if PLATFORM(IOS)
+    , m_isEmoji(false)
+#endif
</ins><span class="cx">     , m_size(size)
</span><span class="cx">     , m_widthVariant(widthVariant)
</span><span class="cx"> #if OS(DARWIN)
</span><span class="lines">@@ -111,6 +120,9 @@
</span><span class="cx">     : m_syntheticBold(syntheticBold)
</span><span class="cx">     , m_syntheticOblique(syntheticOblique)
</span><span class="cx">     , m_orientation(orientation)
</span><ins>+#if PLATFORM(IOS)
+    , m_isEmoji(false)
+#endif
</ins><span class="cx">     , m_size(size)
</span><span class="cx">     , m_widthVariant(widthVariant)
</span><span class="cx">     , m_font(0)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontPlatformDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontPlatformData.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontPlatformData.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/FontPlatformData.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -49,6 +49,10 @@
</span><span class="cx"> #if OS(DARWIN)
</span><span class="cx"> OBJC_CLASS NSFont;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
+
</ins><span class="cx"> typedef struct CGFont* CGFontRef;
</span><span class="cx"> typedef const struct __CTFont* CTFontRef;
</span><span class="cx"> #endif
</span><span class="lines">@@ -79,7 +83,7 @@
</span><span class="cx"> class FontDescription;
</span><span class="cx"> class SharedBuffer;
</span><span class="cx"> 
</span><del>-#if OS(DARWIN)
</del><ins>+#if OS(DARWIN) &amp;&amp; USE(APPKIT)
</ins><span class="cx"> inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast&lt;CTFontRef&gt;(nsFont); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -92,8 +96,14 @@
</span><span class="cx">     FontPlatformData(float size, bool syntheticBold, bool syntheticOblique, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
</span><span class="cx"> 
</span><span class="cx"> #if OS(DARWIN)
</span><ins>+#if USE(APPKIT)
</ins><span class="cx">     FontPlatformData(NSFont*, float size, bool isPrinterFont = false, bool syntheticBold = false, bool syntheticOblique = false,
</span><span class="cx">                      FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
</span><ins>+#else
+    FontPlatformData(CTFontRef, float size, bool isPrinterFont = false, bool syntheticBold = false, bool syntheticOblique = false,
+                     FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
+#endif
+
</ins><span class="cx"> #if USE(CG)
</span><span class="cx">     FontPlatformData(CGFontRef, float size, bool syntheticBold, bool syntheticOblique, FontOrientation, FontWidthVariant);
</span><span class="cx"> #endif
</span><span class="lines">@@ -107,11 +117,18 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    FontPlatformData(CTFontRef, float size, bool syntheticBold = false, bool syntheticOblique = false, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
+#endif
+
</ins><span class="cx">     ~FontPlatformData();
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     HFONT hfont() const { return m_font ? m_font-&gt;get() : 0; }
</span><span class="cx">     bool useGDI() const { return m_useGDI; }
</span><ins>+#elif PLATFORM(IOS)
+    CTFontRef font() const { return m_font; }
+    void setFont(CTFontRef);
</ins><span class="cx"> #elif OS(DARWIN)
</span><span class="cx">     NSFont* font() const { return m_font; }
</span><span class="cx">     void setFont(NSFont*);
</span><span class="lines">@@ -122,7 +139,12 @@
</span><span class="cx">     CGFontRef cgFont() const { return m_cgFont.get(); }
</span><span class="cx">     CTFontRef ctFont() const;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     bool roundsGlyphAdvances() const;
</span><ins>+#else
+    bool roundsGlyphAdvances() const { return false; }
+#endif // !PLATFORM(IOS)
+
</ins><span class="cx">     bool allowsLigatures() const;
</span><span class="cx"> #else
</span><span class="cx">     CGFontRef cgFont() const { return m_cgFont.get(); }
</span><span class="lines">@@ -153,10 +175,15 @@
</span><span class="cx"> #if PLATFORM(WIN) &amp;&amp; !USE(CAIRO)
</span><span class="cx">         return m_font ? m_font-&gt;hash() : 0;
</span><span class="cx"> #elif OS(DARWIN)
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if USE(CG)
</span><span class="cx">         ASSERT(m_font || !m_cgFont);
</span><span class="cx"> #endif
</span><span class="cx">         uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, static_cast&lt;uintptr_t&gt;(m_isPrinterFont &lt;&lt; 3 | m_orientation &lt;&lt; 2 | m_syntheticBold &lt;&lt; 1 | m_syntheticOblique) };
</span><ins>+#else
+        ASSERT(m_font || !m_cgFont || m_isEmoji);
+        uintptr_t hashCodes[3] = { static_cast&lt;uintptr_t&gt;(CFHash(m_font)), m_widthVariant, static_cast&lt;uintptr_t&gt;(m_isEmoji &lt;&lt; 4 | m_isPrinterFont &lt;&lt; 3 | m_orientation &lt;&lt; 2 | m_syntheticBold &lt;&lt; 1 | m_syntheticOblique) };
+#endif // !PLATFORM(IOS)
</ins><span class="cx">         return StringHasher::hashMemory&lt;sizeof(hashCodes)&gt;(hashCodes);
</span><span class="cx"> #elif USE(CAIRO)
</span><span class="cx">         return PtrHash&lt;cairo_scaled_font_t*&gt;::hash(m_scaledFont);
</span><span class="lines">@@ -203,7 +230,9 @@
</span><span class="cx">     bool platformIsEqual(const FontPlatformData&amp;) const;
</span><span class="cx">     void platformDataInit(const FontPlatformData&amp;);
</span><span class="cx">     const FontPlatformData&amp; platformDataAssign(const FontPlatformData&amp;);
</span><del>-#if OS(DARWIN)
</del><ins>+#if PLATFORM(IOS)
+    static CTFontRef hashTableDeletedFontValue() { return reinterpret_cast&lt;CTFontRef&gt;(-1); }
+#elif OS(DARWIN)
</ins><span class="cx">     // Load various data about the font specified by |nsFont| with the size fontSize into the following output paramters:
</span><span class="cx">     void loadFont(NSFont*, float fontSize, NSFont*&amp; outNSFont, CGFontRef&amp;);
</span><span class="cx">     static NSFont* hashTableDeletedFontValue() { return reinterpret_cast&lt;NSFont *&gt;(-1); }
</span><span class="lines">@@ -219,11 +248,16 @@
</span><span class="cx">     bool m_syntheticBold;
</span><span class="cx">     bool m_syntheticOblique;
</span><span class="cx">     FontOrientation m_orientation;
</span><ins>+#if PLATFORM(IOS)
+    bool m_isEmoji;
+#endif
</ins><span class="cx">     float m_size;
</span><span class="cx">     FontWidthVariant m_widthVariant;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-#if OS(DARWIN)
</del><ins>+#if PLATFORM(IOS)
+    CTFontRef m_font;
+#elif OS(DARWIN)
</ins><span class="cx">     NSFont* m_font;
</span><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx">     RefPtr&lt;SharedGDIObject&lt;HFONT&gt;&gt; m_font;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGlyphPageTreeNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -212,6 +212,14 @@
</span><span class="cx">                     m_page = GlyphPage::createForMixedFontData(this);
</span><span class="cx">                 else
</span><span class="cx">                     m_page = GlyphPage::createForSingleFontData(this, static_cast&lt;const SimpleFontData*&gt;(fontData));
</span><ins>+#if PLATFORM(IOS)
+                // FIXME: Times New Roman contains Arabic glyphs, but Core Text doesn't know how to shape them. See &lt;rdar://problem/9823975&gt;.
+                // Once we have the fix for &lt;rdar://problem/9823975&gt; then remove this code together with SimpleFontData::shouldNotBeUsedForArabic()
+                // in &lt;rdar://problem/12096835&gt;.
+                if (pageNumber == 6 &amp;&amp; static_cast&lt;const SimpleFontData*&gt;(fontData)-&gt;shouldNotBeUsedForArabic())
+                    haveGlyphs = false;
+                else
+#endif
</ins><span class="cx">                 haveGlyphs = fill(m_page.get(), 0, GlyphPage::size, buffer, bufferLength, static_cast&lt;const SimpleFontData*&gt;(fontData));
</span><span class="cx">             } else {
</span><span class="cx">                 m_page = GlyphPage::createForMixedFontData(this);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -76,12 +76,21 @@
</span><span class="cx">     int m_offset;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> GraphicsContext::GraphicsContext(PlatformGraphicsContext* platformGraphicsContext)
</span><span class="cx">     : m_updatingControlTints(false)
</span><span class="cx">     , m_transparencyCount(0)
</span><span class="cx"> {
</span><span class="cx">     platformInit(platformGraphicsContext);
</span><span class="cx"> }
</span><ins>+#else
+GraphicsContext::GraphicsContext(PlatformGraphicsContext* platformGraphicsContext, bool shouldUseContextColors)
+    : m_updatingControlTints(false)
+    , m_transparencyCount(0)
+{
+    platformInit(platformGraphicsContext, shouldUseContextColors);
+}
+#endif
</ins><span class="cx"> 
</span><span class="cx"> GraphicsContext::~GraphicsContext()
</span><span class="cx"> {
</span><span class="lines">@@ -115,6 +124,28 @@
</span><span class="cx">     restorePlatformState();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void GraphicsContext::drawRaisedEllipse(const FloatRect&amp; rect, const Color&amp; ellipseColor, ColorSpace ellipseColorSpace, const Color&amp; shadowColor, ColorSpace shadowColorSpace)
+{
+    if (paintingDisabled())
+        return;
+
+    save();
+
+    setStrokeColor(shadowColor, shadowColorSpace);
+    setFillColor(shadowColor, shadowColorSpace);
+
+    drawEllipse(FloatRect(rect.x(), rect.y() + 1, rect.width(), rect.height()));
+
+    setStrokeColor(ellipseColor, ellipseColorSpace);
+    setFillColor(ellipseColor, ellipseColorSpace);
+
+    drawEllipse(rect);  
+
+    restore();
+}
+#endif
+
</ins><span class="cx"> void GraphicsContext::setStrokeThickness(float thickness)
</span><span class="cx"> {
</span><span class="cx">     m_state.strokeThickness = thickness;
</span><span class="lines">@@ -404,6 +435,9 @@
</span><span class="cx">     return m_state.paintingDisabled;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: Replace the non-iOS implementation with the iOS implementation since the latter computes returns
+// the width of the drawn text. Ensure that there aren't noticeable differences in layout.
+#if !PLATFORM(IOS)
</ins><span class="cx"> #if !USE(WINGDI)
</span><span class="cx"> void GraphicsContext::drawText(const Font&amp; font, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to)
</span><span class="cx"> {
</span><span class="lines">@@ -413,7 +447,16 @@
</span><span class="cx">     font.drawText(this, run, point, from, to);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+#else
+float GraphicsContext::drawText(const Font&amp; font, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to)
+{
+    if (paintingDisabled())
+        return 0;
</ins><span class="cx"> 
</span><ins>+    return font.drawText(this, run, point, from, to);
+}
+#endif // !PLATFORM(IOS)
+
</ins><span class="cx"> void GraphicsContext::drawEmphasisMarks(const Font&amp; font, const TextRun&amp; run, const AtomicString&amp; mark, const FloatPoint&amp; point, int from, int to)
</span><span class="cx"> {
</span><span class="cx">     if (paintingDisabled())
</span><span class="lines">@@ -422,21 +465,44 @@
</span><span class="cx">     font.drawEmphasisMarks(this, run, mark, point, from, to);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: Better merge the iOS and non-iOS differences. In particular, make this method use the
+// returned width of the drawn text, Font::drawText(), instead of computing it. Ensure that there
+// aren't noticeable differences in layout with such a change.
+#if !PLATFORM(IOS)
</ins><span class="cx"> void GraphicsContext::drawBidiText(const Font&amp; font, const TextRun&amp; run, const FloatPoint&amp; point, Font::CustomFontNotReadyAction customFontNotReadyAction)
</span><ins>+#else
+float GraphicsContext::drawBidiText(const Font&amp; font, const TextRun&amp; run, const FloatPoint&amp; point, Font::CustomFontNotReadyAction customFontNotReadyAction, BidiStatus* status, int length)
+#endif
</ins><span class="cx"> {
</span><span class="cx">     if (paintingDisabled())
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         return;
</span><ins>+#else
+        return 0;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     BidiResolver&lt;TextRunIterator, BidiCharacterRun&gt; bidiResolver;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     bidiResolver.setStatus(BidiStatus(run.direction(), run.directionalOverride()));
</span><ins>+#else
+    bidiResolver.setStatus(status ? *status : BidiStatus(run.direction(), run.directionalOverride()));
+#endif
</ins><span class="cx">     bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&amp;run, 0));
</span><span class="cx"> 
</span><span class="cx">     // FIXME: This ownership should be reversed. We should pass BidiRunList
</span><span class="cx">     // to BidiResolver in createBidiRunsForLine.
</span><span class="cx">     BidiRunList&lt;BidiCharacterRun&gt;&amp; bidiRuns = bidiResolver.runs();
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     bidiResolver.createBidiRunsForLine(TextRunIterator(&amp;run, run.length()));
</span><ins>+#else
+    bidiResolver.createBidiRunsForLine(TextRunIterator(&amp;run, length &lt; 0 ? run.length() : length));
+#endif    
</ins><span class="cx">     if (!bidiRuns.runCount())
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         return;
</span><ins>+#else
+        return 0;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     FloatPoint currPoint = point;
</span><span class="cx">     BidiCharacterRun* bidiRun = bidiRuns.firstRun();
</span><span class="lines">@@ -446,15 +512,30 @@
</span><span class="cx">         subrun.setDirection(isRTL ? RTL : LTR);
</span><span class="cx">         subrun.setDirectionalOverride(bidiRun-&gt;dirOverride(false));
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         font.drawText(this, subrun, currPoint, 0, -1, customFontNotReadyAction);
</span><span class="cx"> 
</span><span class="cx">         bidiRun = bidiRun-&gt;next();
</span><span class="cx">         // FIXME: Have Font::drawText return the width of what it drew so that we don't have to re-measure here.
</span><span class="cx">         if (bidiRun)
</span><span class="cx">             currPoint.move(font.width(subrun), 0);
</span><ins>+#else
+        float width = font.drawText(this, subrun, currPoint, 0, -1, customFontNotReadyAction);
+        currPoint.move(width, 0);
+
+        bidiRun = bidiRun-&gt;next();
+#endif
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if (status)
+        *status = bidiResolver.status();
+#endif
</ins><span class="cx">     bidiRuns.deleteRuns();
</span><ins>+
+#if PLATFORM(IOS)
+    return currPoint.x() - static_cast&lt;float&gt;(point.x());
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsContext::drawHighlightForText(const Font&amp; font, const TextRun&amp; run, const FloatPoint&amp; point, int h, const Color&amp; backgroundColor, ColorSpace colorSpace, int from, int to)
</span><span class="lines">@@ -615,6 +696,18 @@
</span><span class="cx">     clip(path);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: Consider writing this in terms of a specialized RoundedRect that uses FloatRect and FloatSize radii.
+void GraphicsContext::clipRoundedRect(const FloatRect&amp; rect, const FloatSize&amp; topLeft, const FloatSize&amp; topRight,
+    const FloatSize&amp; bottomLeft, const FloatSize&amp; bottomRight)
+{
+    if (paintingDisabled())
+        return;
+
+    Path path;
+    path.addRoundedRect(rect, topLeft, topRight, bottomLeft, bottomRight);
+    clip(path);
+}
+
</ins><span class="cx"> void GraphicsContext::clipOutRoundedRect(const RoundedRect&amp; rect)
</span><span class="cx"> {
</span><span class="cx">     if (paintingDisabled())
</span><span class="lines">@@ -732,6 +825,18 @@
</span><span class="cx">     return m_state.blendMode;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool GraphicsContext::emojiDrawingEnabled()
+{
+    return m_state.emojiDrawingEnabled;
+}
+
+void GraphicsContext::setEmojiDrawingEnabled(bool emojiDrawingEnabled)
+{
+    m_state.emojiDrawingEnabled = emojiDrawingEnabled;
+}
+#endif
+
</ins><span class="cx"> void GraphicsContext::setDrawLuminanceMask(bool drawLuminanceMask)
</span><span class="cx"> {
</span><span class="cx">     m_state.drawLuminanceMask = drawLuminanceMask;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -93,6 +93,9 @@
</span><span class="cx">     class GraphicsContext3D;
</span><span class="cx">     class TextRun;
</span><span class="cx">     class TransformationMatrix;
</span><ins>+#if PLATFORM(IOS)
+    struct BidiStatus;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     enum TextDrawingMode {
</span><span class="cx">         TextModeFill = 1 &lt;&lt; 0,
</span><span class="lines">@@ -136,6 +139,10 @@
</span><span class="cx">             , shadowColorSpace(ColorSpaceDeviceRGB)
</span><span class="cx">             , compositeOperator(CompositeSourceOver)
</span><span class="cx">             , blendMode(BlendModeNormal)
</span><ins>+#if PLATFORM(IOS)
+            , emojiDrawingEnabled(true)
+            , shouldUseContextColors(true)
+#endif
</ins><span class="cx">             , shouldAntialias(true)
</span><span class="cx">             , shouldSmoothFonts(true)
</span><span class="cx">             , shouldSubpixelQuantizeFonts(true)
</span><span class="lines">@@ -177,6 +184,10 @@
</span><span class="cx">         CompositeOperator compositeOperator;
</span><span class="cx">         BlendMode blendMode;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        bool emojiDrawingEnabled : 1;
+        bool shouldUseContextColors : 1;
+#endif
</ins><span class="cx">         bool shouldAntialias : 1;
</span><span class="cx">         bool shouldSmoothFonts : 1;
</span><span class="cx">         bool shouldSubpixelQuantizeFonts : 1;
</span><span class="lines">@@ -188,10 +199,18 @@
</span><span class="cx">         bool drawLuminanceMask : 1;
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    void setStrokeAndFillColor(PlatformGraphicsContext*, CGColorRef);
+#endif
+
</ins><span class="cx">     class GraphicsContext {
</span><span class="cx">         WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx">     public:
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         GraphicsContext(PlatformGraphicsContext*);
</span><ins>+#else
+        GraphicsContext(PlatformGraphicsContext*, bool shouldUseContextColors = true);
+#endif
</ins><span class="cx">         ~GraphicsContext();
</span><span class="cx"> 
</span><span class="cx">         PlatformGraphicsContext* platformContext() const;
</span><span class="lines">@@ -243,7 +262,11 @@
</span><span class="cx">         void applyFillPattern();
</span><span class="cx">         void drawPath(const Path&amp;);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        void drawNativeImage(PassNativeImagePtr, const FloatSize&amp; selfSize, ColorSpace styleColorSpace, const FloatRect&amp; destRect, const FloatRect&amp; srcRect, float scale, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, ImageOrientation = DefaultImageOrientation);
+#else
</ins><span class="cx">         void drawNativeImage(PassNativeImagePtr, const FloatSize&amp; selfSize, ColorSpace styleColorSpace, const FloatRect&amp; destRect, const FloatRect&amp; srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, ImageOrientation = DefaultImageOrientation);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">         // Allow font smoothing (LCD antialiasing). Not part of the graphics state.
</span><span class="cx">         void setAllowsFontSmoothing(bool);
</span><span class="lines">@@ -264,7 +287,16 @@
</span><span class="cx">         // stroke color).
</span><span class="cx">         void drawRect(const IntRect&amp;);
</span><span class="cx">         void drawLine(const IntPoint&amp;, const IntPoint&amp;);
</span><ins>+
+#if PLATFORM(IOS)
+        void drawJoinedLines(CGPoint points[], unsigned count, bool antialias, CGLineCap = kCGLineCapButt);
+#endif
+
</ins><span class="cx">         void drawEllipse(const IntRect&amp;);
</span><ins>+#if PLATFORM(IOS)
+        void drawEllipse(const FloatRect&amp;);
+        void drawRaisedEllipse(const FloatRect&amp;, const Color&amp; ellipseColor, ColorSpace ellipseColorSpace, const Color&amp; shadowColor, ColorSpace shadowColorSpace);
+#endif
</ins><span class="cx">         void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntialias = false);
</span><span class="cx"> 
</span><span class="cx">         void fillPath(const Path&amp;);
</span><span class="lines">@@ -311,6 +343,10 @@
</span><span class="cx">         void clip(const IntRect&amp;);
</span><span class="cx">         void clip(const FloatRect&amp;);
</span><span class="cx">         void clipRoundedRect(const RoundedRect&amp;);
</span><ins>+
+        // FIXME: Consider writing this in terms of a specialized RoundedRect that uses FloatRect and FloatSize radii.
+        void clipRoundedRect(const FloatRect&amp;, const FloatSize&amp; topLeft, const FloatSize&amp; topRight, const FloatSize&amp; bottomLeft, const FloatSize&amp; bottomRight);
+
</ins><span class="cx">         void clipOut(const IntRect&amp;);
</span><span class="cx">         void clipOutRoundedRect(const RoundedRect&amp;);
</span><span class="cx">         void clipPath(const Path&amp;, WindRule);
</span><span class="lines">@@ -322,9 +358,22 @@
</span><span class="cx">         TextDrawingModeFlags textDrawingMode() const;
</span><span class="cx">         void setTextDrawingMode(TextDrawingModeFlags);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        bool emojiDrawingEnabled();
+        void setEmojiDrawingEnabled(bool);
+#endif
+        
+#if !PLATFORM(IOS)
</ins><span class="cx">         void drawText(const Font&amp;, const TextRun&amp;, const FloatPoint&amp;, int from = 0, int to = -1);
</span><ins>+#else
+        float drawText(const Font&amp;, const TextRun&amp;, const FloatPoint&amp;, int from = 0, int to = -1);
+#endif
</ins><span class="cx">         void drawEmphasisMarks(const Font&amp;, const TextRun&amp; , const AtomicString&amp; mark, const FloatPoint&amp;, int from = 0, int to = -1);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         void drawBidiText(const Font&amp;, const TextRun&amp;, const FloatPoint&amp;, Font::CustomFontNotReadyAction = Font::DoNotPaintIfFontNotReady);
</span><ins>+#else
+        float drawBidiText(const Font&amp;, const TextRun&amp;, const FloatPoint&amp;, Font::CustomFontNotReadyAction = Font::DoNotPaintIfFontNotReady, BidiStatus* = 0, int length = -1);
+#endif
</ins><span class="cx">         void drawHighlightForText(const Font&amp;, const TextRun&amp;, const FloatPoint&amp;, int h, const Color&amp; backgroundColor, ColorSpace, int from = 0, int to = -1);
</span><span class="cx"> 
</span><span class="cx">         enum RoundingMode {
</span><span class="lines">@@ -336,6 +385,9 @@
</span><span class="cx">         FloatRect computeLineBoundsForText(const FloatPoint&amp;, float width, bool printing);
</span><span class="cx">         void drawLineForText(const FloatPoint&amp;, float width, bool printing);
</span><span class="cx">         enum DocumentMarkerLineStyle {
</span><ins>+#if PLATFORM(IOS)
+            TextCheckingDictationPhraseWithAlternativesLineStyle,
+#endif
</ins><span class="cx">             DocumentMarkerSpellingLineStyle,
</span><span class="cx">             DocumentMarkerGrammarLineStyle,
</span><span class="cx">             DocumentMarkerAutocorrectionReplacementLineStyle,
</span><span class="lines">@@ -496,7 +548,11 @@
</span><span class="cx">         static void adjustLineToPixelBoundaries(FloatPoint&amp; p1, FloatPoint&amp; p2, float strokeWidth, StrokeStyle);
</span><span class="cx"> 
</span><span class="cx">     private:
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         void platformInit(PlatformGraphicsContext*);
</span><ins>+#else
+        void platformInit(PlatformGraphicsContext*, bool shouldUseContextColors);
+#endif
</ins><span class="cx">         void platformDestroy();
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN) &amp;&amp; !USE(WINGDI)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContext3Dh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -54,6 +54,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><ins>+#if PLATFORM(IOS)
+#include &lt;OpenGLES/ES2/gl.h&gt;
+#ifdef __OBJC__
+#import &lt;OpenGLES/EAGL.h&gt;
+#endif // __OBJC__
+#endif // PLATFORM(IOS)
</ins><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> OBJC_CLASS CALayer;
</span><span class="cx"> OBJC_CLASS WebGLLayer;
</span><span class="lines">@@ -61,7 +67,13 @@
</span><span class="cx"> typedef unsigned int GLuint;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(IOS)
+#ifdef __OBJC__
+typedef EAGLContext* PlatformGraphicsContext3D;
+#else
+typedef void* PlatformGraphicsContext3D;
+#endif // __OBJC__
+#elif PLATFORM(MAC)
</ins><span class="cx"> typedef struct _CGLContextObject *CGLContextObj;
</span><span class="cx"> 
</span><span class="cx"> typedef CGLContextObj PlatformGraphicsContext3D;
</span><span class="lines">@@ -791,6 +803,10 @@
</span><span class="cx">     PassRefPtr&lt;ImageData&gt; paintRenderingResultsToImageData(DrawingBuffer*);
</span><span class="cx">     bool paintCompositedResultsToCanvas(ImageBuffer*);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    void endPaint();
+#endif
+
</ins><span class="cx"> #if PLATFORM(BLACKBERRY)
</span><span class="cx">     bool paintsIntoCanvasBuffer() const;
</span><span class="cx"> #endif
</span><span class="lines">@@ -933,6 +949,10 @@
</span><span class="cx">     void readPixelsAndConvertToBGRAIfNecessary(int x, int y, int width, int height, unsigned char* pixels);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    bool setRenderbufferStorageFromDrawable(GC3Dsizei width, GC3Dsizei height);
+#endif
+
</ins><span class="cx"> #if PLATFORM(BLACKBERRY)
</span><span class="cx">     void logFrameBufferStatus(int line);
</span><span class="cx">     void readPixelsIMG(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, void* data);
</span><span class="lines">@@ -947,7 +967,10 @@
</span><span class="cx">     int m_currentWidth, m_currentHeight;
</span><span class="cx">     bool isResourceSafe();
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(IOS)
+    PlatformGraphicsContext3D m_contextObj;
+    RetainPtr&lt;PlatformLayer&gt; m_webGLLayer;
+#elif PLATFORM(MAC)
</ins><span class="cx">     CGLContextObj m_contextObj;
</span><span class="cx">     RetainPtr&lt;WebGLLayer&gt; m_webGLLayer;
</span><span class="cx"> #elif PLATFORM(WIN) &amp;&amp; USE(CA)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -117,7 +117,6 @@
</span><span class="cx">     if (m_client)
</span><span class="cx">         m_client-&gt;verifyNotPainting();
</span><span class="cx"> #endif
</span><del>-
</del><span class="cx">     if (m_replicaLayer)
</span><span class="cx">         m_replicaLayer-&gt;setReplicatedLayer(0);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -392,6 +392,9 @@
</span><span class="cx">     virtual void setContentsToImage(Image*) { }
</span><span class="cx">     virtual bool shouldDirectlyCompositeImage(Image*) const { return true; }
</span><span class="cx">     virtual void setContentsToMedia(PlatformLayer*) { } // video or plug-in
</span><ins>+#if PLATFORM(IOS)
+    virtual PlatformLayer* contentsLayerForMedia() const { return 0; }
+#endif
</ins><span class="cx">     // Pass an invalid color to remove the contents layer.
</span><span class="cx">     virtual void setContentsToSolidColor(const Color&amp;) { }
</span><span class="cx">     virtual void setContentsToCanvas(PlatformLayer*) { }
</span><span class="lines">@@ -442,6 +445,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void setMaintainsPixelAlignment(bool maintainsAlignment) { m_maintainsPixelAlignment = maintainsAlignment; }
</span><span class="cx">     virtual bool maintainsPixelAlignment() const { return m_maintainsPixelAlignment; }
</span><ins>+#if PLATFORM(IOS)
+    virtual FloatSize pixelAlignmentOffset() const { return FloatSize(); }
+    bool hasFlattenedPerspectiveTransform() const { return !preserves3D() &amp;&amp; m_childrenTransform.hasPerspective(); }
+#endif
</ins><span class="cx">     
</span><span class="cx">     virtual void setAppliesPageScale(bool appliesScale = true) { m_appliesPageScale = appliesScale; }
</span><span class="cx">     virtual bool appliesPageScale() const { return m_appliesPageScale; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsIconh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Icon.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Icon.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/Icon.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -26,8 +26,12 @@
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(IOS)
+#include &quot;NativeImagePtr.h&quot;
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
</ins><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><ins>+#elif PLATFORM(MAC)
+#include &lt;wtf/RetainPtr.h&gt;
</ins><span class="cx"> OBJC_CLASS NSImage;
</span><span class="cx"> #elif PLATFORM(WIN)
</span><span class="cx"> typedef struct HICON__* HICON;
</span><span class="lines">@@ -52,8 +56,16 @@
</span><span class="cx">     static PassRefPtr&lt;Icon&gt; create(HICON hIcon) { return adoptRef(new Icon(hIcon)); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: Make this work for non-iOS ports and remove the PLATFORM(IOS)-guard.
+    static PassRefPtr&lt;Icon&gt; createIconForImage(NativeImagePtr);
+#endif
+
</ins><span class="cx"> private:
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(IOS)
+    Icon(CGImageRef);
+    RetainPtr&lt;CGImageRef&gt; m_cgImage;
+#elif PLATFORM(MAC)
</ins><span class="cx">     Icon(NSImage*);
</span><span class="cx">     RetainPtr&lt;NSImage&gt; m_nsImage;
</span><span class="cx"> #elif PLATFORM(WIN)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Image.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Image.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/Image.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -130,11 +130,66 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // When using accelerated drawing on iOS, it's faster to stretch an image than to tile it.
+    if (ctxt-&gt;isAcceleratedContext()) {
+        if (size().width() == 1 &amp;&amp; intersection(oneTileRect, destRect).height() == destRect.height()) {
+            FloatRect visibleSrcRect;
+            visibleSrcRect.setX(0);
+            visibleSrcRect.setY((destRect.y() - oneTileRect.y()) / scale.height());
+            visibleSrcRect.setWidth(1);
+            visibleSrcRect.setHeight(destRect.height() / scale.height());
+            draw(ctxt, destRect, visibleSrcRect, styleColorSpace, op, BlendModeNormal, ImageOrientationDescription());
+            return;
+        }
+        if (size().height() == 1 &amp;&amp; intersection(oneTileRect, destRect).width() == destRect.width()) {
+            FloatRect visibleSrcRect;
+            visibleSrcRect.setX((destRect.x() - oneTileRect.x()) / scale.width());
+            visibleSrcRect.setY(0);
+            visibleSrcRect.setWidth(destRect.width() / scale.width());
+            visibleSrcRect.setHeight(1);
+            draw(ctxt, destRect, visibleSrcRect, styleColorSpace, op, BlendModeNormal, ImageOrientationDescription());
+            return;
+        }
+    }
+#endif
+
+#if PLATFORM(IOS)
+    // CGPattern uses lots of memory got caching when the tile size is large (&lt;rdar://problem/4691859&gt;,
+    // &lt;rdar://problem/6239505&gt;). Memory consumption depends on the transformed tile size which can get
+    // larger than the original tile if user zooms in enough.
+    const float maxPatternTilePixels = 512 * 512;
+    FloatRect transformedTileSize = ctxt-&gt;getCTM().mapRect(FloatRect(FloatPoint(), scaledTileSize));
+    float transformedTileSizePixels = transformedTileSize.width() * transformedTileSize.height();
+    if (transformedTileSizePixels &gt; maxPatternTilePixels) {
+        float fromY = (destRect.y() - oneTileRect.y()) / scale.height();
+        float toY = oneTileRect.y();
+        while (toY &lt; CGRectGetMaxY(destRect)) {
+            float fromX = (destRect.x() - oneTileRect.x()) / scale.width();
+            float toX = oneTileRect.x();
+            while (toX &lt; CGRectGetMaxX(destRect)) {
+                CGRect toRect = CGRectIntersection(destRect, CGRectMake(toX, toY, oneTileRect.width(), oneTileRect.height()));
+                CGRect fromRect = CGRectMake(fromX, fromY, toRect.size.width / scale.width(), toRect.size.height / scale.height());
+                draw(ctxt, toRect, fromRect, styleColorSpace, op, BlendModeNormal, ImageOrientationDescription());
+                toX += oneTileRect.width();
+                fromX = 0;
+            }
+            toY += oneTileRect.height();
+            fromY = 0;
+        }
+        return;
+    }
+#endif    
+
</ins><span class="cx">     AffineTransform patternTransform = AffineTransform().scaleNonUniform(scale.width(), scale.height());
</span><span class="cx">     FloatRect tileRect(FloatPoint(), intrinsicTileSize);
</span><span class="cx">     drawPattern(ctxt, tileRect, patternTransform, oneTileRect.location(), styleColorSpace, op, destRect, blendMode);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    startAnimation(false);
+#else
</ins><span class="cx">     startAnimation();
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: Merge with the other drawTiled eventually, since we need a combination of both for some things.
</span><span class="lines">@@ -168,7 +223,11 @@
</span><span class="cx">     
</span><span class="cx">     drawPattern(ctxt, srcRect, patternTransform, patternPhase, styleColorSpace, op, dstRect);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    startAnimation(false);
+#else
</ins><span class="cx">     startAnimation();
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageSource.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageSource.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/ImageSource.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -135,6 +135,11 @@
</span><span class="cx">     IntSize size(ImageOrientationDescription = ImageOrientationDescription()) const;
</span><span class="cx">     IntSize frameSizeAtIndex(size_t, ImageOrientationDescription = ImageOrientationDescription()) const;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    IntSize originalSize(RespectImageOrientationEnum = DoNotRespectImageOrientation) const;
+    bool isSubsampled() const { return m_baseSubsampling; }
+#endif
+
</ins><span class="cx">     bool getHotSpot(IntPoint&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     size_t bytesDecodedToDetermineProperties() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsIntPointh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/IntPoint.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/IntPoint.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/IntPoint.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if OS(DARWIN)
</span><span class="cx"> #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> typedef struct CGPoint NSPoint;
</span><span class="lines">@@ -41,6 +42,7 @@
</span><span class="cx"> typedef struct _NSPoint NSPoint;
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> typedef struct tagPOINT POINT;
</span><span class="lines">@@ -111,10 +113,12 @@
</span><span class="cx">     operator CGPoint() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if OS(DARWIN) &amp;&amp; !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
</span><span class="cx">     explicit IntPoint(const NSPoint&amp;); // don't do this implicitly since it's lossy
</span><span class="cx">     operator NSPoint() const;
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     IntPoint(const POINT&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsIntRecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/IntRect.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/IntRect.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/IntRect.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> typedef struct CGRect CGRect;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> typedef struct CGRect NSRect;
</span><span class="cx"> #else
</span><span class="lines">@@ -41,6 +41,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#ifndef NSRect
+#define NSRect CGRect
+#endif
+#endif
+
</ins><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> typedef struct tagRECT RECT;
</span><span class="cx"> #elif PLATFORM(GTK)
</span><span class="lines">@@ -192,9 +198,11 @@
</span><span class="cx">     operator CGRect() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if (PLATFORM(MAC) &amp;&amp; !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES))
</span><span class="cx">     operator NSRect() const;
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(BLACKBERRY)
</span><span class="cx">     IntRect(const BlackBerry::Platform::IntRect&amp;);
</span><span class="lines">@@ -252,9 +260,11 @@
</span><span class="cx"> IntRect enclosingIntRect(const CGRect&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if (PLATFORM(MAC) &amp;&amp; !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES))
</span><span class="cx"> IntRect enclosingIntRect(const NSRect&amp;);
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsIntSizeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/IntSize.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/IntSize.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/IntSize.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> typedef struct CGSize CGSize;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> typedef struct CGSize NSSize;
</span><span class="cx"> #else
</span><span class="lines">@@ -40,6 +40,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#ifndef NSSize
+#define NSSize CGSize
+#endif
+#endif
+
</ins><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> typedef struct tagSIZE SIZE;
</span><span class="cx"> #elif PLATFORM(BLACKBERRY)
</span><span class="lines">@@ -130,10 +136,12 @@
</span><span class="cx">     operator CGSize() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)    
</ins><span class="cx"> #if PLATFORM(MAC) &amp;&amp; !defined(NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES)
</span><span class="cx">     explicit IntSize(const NSSize &amp;); // don't do this implicitly since it's lossy
</span><span class="cx">     operator NSSize() const;
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     IntSize(const SIZE&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -54,7 +54,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><ins>+#if PLATFORM(IOS)
+#include &quot;MediaPlayerPrivateIOS.h&quot;
+#define PlatformMediaEngineClassName MediaPlayerPrivateIOS
+#else
</ins><span class="cx"> #include &quot;MediaPlayerPrivateQTKit.h&quot;
</span><ins>+#endif
</ins><span class="cx"> #if USE(AVFOUNDATION)
</span><span class="cx"> #include &quot;MediaPlayerPrivateAVFoundationObjC.h&quot;
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="lines">@@ -212,7 +217,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(AVFOUNDATION)
</span><span class="cx">         if (Settings::isAVFoundationEnabled()) {
</span><del>-#if PLATFORM(MAC) || PLATFORM(IOS)
</del><ins>+#if PLATFORM(MAC)
</ins><span class="cx">             MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(addMediaEngine);
</span><span class="cx"> #if ENABLE(MEDIA_SOURCE)
</span><span class="cx">             MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine(addMediaEngine);
</span><span class="lines">@@ -223,10 +228,12 @@
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">         if (Settings::isQTKitEnabled())
</span><span class="cx">             MediaPlayerPrivateQTKit::registerMediaEngine(addMediaEngine);
</span><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if defined(PlatformMediaEngineClassName)
</span><span class="cx">         PlatformMediaEngineClassName::registerMediaEngine(addMediaEngine);
</span><span class="lines">@@ -837,6 +844,50 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_AIRPLAY)
+bool MediaPlayer::isCurrentPlaybackTargetWireless() const
+{
+    return m_private-&gt;isCurrentPlaybackTargetWireless();
+}
+
+void MediaPlayer::showPlaybackTargetPicker()
+{
+    m_private-&gt;showPlaybackTargetPicker();
+}
+
+bool MediaPlayer::hasWirelessPlaybackTargets() const
+{
+    return m_private-&gt;hasWirelessPlaybackTargets();
+}
+
+bool MediaPlayer::wirelessVideoPlaybackDisabled() const
+{
+    return m_private-&gt;wirelessVideoPlaybackDisabled();
+}
+
+void MediaPlayer::setWirelessVideoPlaybackDisabled(bool disabled)
+{
+    m_private-&gt;setWirelessVideoPlaybackDisabled(disabled);
+}
+
+void MediaPlayer::setHasPlaybackTargetAvailabilityListeners(bool hasListeners)
+{
+    m_private-&gt;setHasPlaybackTargetAvailabilityListeners(hasListeners);
+}
+
+void MediaPlayer::currentPlaybackTargetIsWirelessChanged()
+{
+    if (m_mediaPlayerClient)
+        m_mediaPlayerClient-&gt;mediaPlayerCurrentPlaybackTargetIsWirelessChanged(this);
+}
+
+void MediaPlayer::playbackTargetAvailabilityChanged()
+{
+    if (m_mediaPlayerClient)
+        m_mediaPlayerClient-&gt;mediaPlayerPlaybackTargetAvailabilityChanged(this);
+}
+#endif
+
</ins><span class="cx"> #if USE(NATIVE_FULLSCREEN_VIDEO)
</span><span class="cx"> bool MediaPlayer::canEnterFullscreen() const
</span><span class="cx"> {
</span><span class="lines">@@ -956,6 +1007,18 @@
</span><span class="cx">     m_private-&gt;setPrivateBrowsingMode(m_privateBrowsing);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void MediaPlayer::attributeChanged(const String&amp; name, const String&amp; value) 
+{
+    m_private-&gt;attributeChanged(name, value);
+}
+
+bool MediaPlayer::readyForPlayback() const
+{
+    return m_private-&gt;readyForPlayback();
+}
+#endif
+
</ins><span class="cx"> // Client callbacks.
</span><span class="cx"> void MediaPlayer::networkStateChanged()
</span><span class="cx"> {
</span><span class="lines">@@ -981,7 +1044,12 @@
</span><span class="cx"> 
</span><span class="cx"> void MediaPlayer::volumeChanged(double newVolume)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    UNUSED_PARAM(newVolume);
+    m_volume = m_private-&gt;volume();
+#else
</ins><span class="cx">     m_volume = newVolume;
</span><ins>+#endif
</ins><span class="cx">     if (m_mediaPlayerClient)
</span><span class="cx">         m_mediaPlayerClient-&gt;mediaPlayerVolumeChanged(this);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -224,6 +224,11 @@
</span><span class="cx">     virtual bool mediaPlayerKeyNeeded(MediaPlayer*, Uint8Array*) { return false; }
</span><span class="cx"> #endif
</span><span class="cx">     
</span><ins>+#if ENABLE(IOS_AIRPLAY)
+    virtual void mediaPlayerCurrentPlaybackTargetIsWirelessChanged(MediaPlayer*) { };
+    virtual void mediaPlayerPlaybackTargetAvailabilityChanged(MediaPlayer*) { };
+#endif
+
</ins><span class="cx">     virtual String mediaPlayerReferrer() const { return String(); }
</span><span class="cx">     virtual String mediaPlayerUserAgent() const { return String(); }
</span><span class="cx">     virtual CORSMode mediaPlayerCORSMode() const { return Unspecified; }
</span><span class="lines">@@ -433,6 +438,21 @@
</span><span class="cx">     void exitFullscreen();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_AIRPLAY)
+    bool isCurrentPlaybackTargetWireless() const;
+    void showPlaybackTargetPicker();
+
+    bool hasWirelessPlaybackTargets() const;
+
+    bool wirelessVideoPlaybackDisabled() const;
+    void setWirelessVideoPlaybackDisabled(bool);
+
+    void currentPlaybackTargetIsWirelessChanged();
+    void playbackTargetAvailabilityChanged();
+
+    void setHasPlaybackTargetAvailabilityListeners(bool);
+#endif
+
</ins><span class="cx"> #if USE(NATIVE_FULLSCREEN_VIDEO)
</span><span class="cx">     bool canEnterFullscreen() const;
</span><span class="cx"> #endif
</span><span class="lines">@@ -486,6 +506,11 @@
</span><span class="cx"> 
</span><span class="cx">     String engineDescription() const;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    void attributeChanged(const String&amp; name, const String&amp; value);
+    bool readyForPlayback() const;
+#endif
+
</ins><span class="cx">     CachedResourceLoader* cachedResourceLoader();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -97,6 +97,9 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void setVolume(float) { }
</span><span class="cx">     virtual void setVolumeDouble(double volume) { return setVolume(volume); }
</span><ins>+#if PLATFORM(IOS)
+    virtual float volume() const { return 1; }
+#endif
</ins><span class="cx"> 
</span><span class="cx">     virtual bool supportsMuting() const { return false; }
</span><span class="cx">     virtual void setMuted(bool) { }
</span><span class="lines">@@ -141,6 +144,18 @@
</span><span class="cx">     virtual void exitFullscreen() { }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(IOS_AIRPLAY)
+    virtual bool isCurrentPlaybackTargetWireless() const { return false; }
+    virtual void showPlaybackTargetPicker() { }
+
+    virtual bool hasWirelessPlaybackTargets() const { return false; }
+
+    virtual bool wirelessVideoPlaybackDisabled() const { return false; }
+    virtual void setWirelessVideoPlaybackDisabled(bool) { }
+
+    virtual void setHasPlaybackTargetAvailabilityListeners(bool) { }
+#endif
+
</ins><span class="cx"> #if USE(NATIVE_FULLSCREEN_VIDEO)
</span><span class="cx">     virtual bool canEnterFullscreen() const { return false; }
</span><span class="cx"> #endif
</span><span class="lines">@@ -209,7 +224,12 @@
</span><span class="cx"> #if USE(GSTREAMER)
</span><span class="cx">     virtual void simulateAudioInterruption() { }
</span><span class="cx"> #endif
</span><del>-    
</del><ins>+
+#if PLATFORM(IOS)
+    virtual void attributeChanged(const String&amp;, const String&amp;) { }
+    virtual bool readyForPlayback() const { return true; }
+#endif
+
</ins><span class="cx">     virtual String languageOfPrimaryAudioTrack() const { return emptyString(); }
</span><span class="cx"> 
</span><span class="cx">     virtual size_t extraMemoryCost() const { return 0; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSimpleFontDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -80,6 +80,9 @@
</span><span class="cx">     , m_verticalData(0)
</span><span class="cx"> #endif
</span><span class="cx">     , m_hasVerticalGlyphs(false)
</span><ins>+#if PLATFORM(IOS)
+    , m_shouldNotBeUsedForArabic(false)
+#endif
</ins><span class="cx"> {
</span><span class="cx">     m_fontData-&gt;initializeFontData(this, fontSize);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSimpleFontDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SimpleFontData.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SimpleFontData.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/SimpleFontData.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -180,11 +180,15 @@
</span><span class="cx">     virtual String description() const OVERRIDE;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if USE(APPKIT)
</ins><span class="cx">     const SimpleFontData* getCompositeFontReferenceFontData(NSFont *key) const;
</span><span class="cx">     NSFont* getNSFont() const { return m_platformData.font(); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    CTFontRef getCTFont() const { return m_platformData.font(); }
+    bool shouldNotBeUsedForArabic() const { return m_shouldNotBeUsedForArabic; };
+#endif
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     CFDictionaryRef getCFStringAttributes(TypesettingFeatures, FontOrientation) const;
</span><span class="cx"> #endif
</span><span class="lines">@@ -197,7 +201,7 @@
</span><span class="cx">     {
</span><span class="cx">         if (isSVGFont())
</span><span class="cx">             return false;
</span><del>-#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt; 1080
</del><ins>+#if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt; 1080)
</ins><span class="cx">         wkCTFontTransformOptions options = (typesettingFeatures &amp; Kerning ? wkCTFontTransformApplyPositioning : 0) | (typesettingFeatures &amp; Ligatures ? wkCTFontTransformApplyShaping : 0);
</span><span class="cx">         return wkCTFontTransformGlyphs(m_platformData.ctFont(), glyphs, reinterpret_cast&lt;CGSize*&gt;(advances), glyphCount, options);
</span><span class="cx"> #else
</span><span class="lines">@@ -315,6 +319,9 @@
</span><span class="cx">     mutable SCRIPT_FONTPROPERTIES* m_scriptFontProperties;
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><ins>+#if PLATFORM(IOS)
+    bool m_shouldNotBeUsedForArabic;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE FloatRect SimpleFontData::boundsForGlyph(Glyph glyph) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsStringTruncatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/StringTruncator.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/StringTruncator.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/StringTruncator.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> 
</span><span class="cx"> #define STRING_BUFFER_SIZE 2048
</span><span class="cx"> 
</span><del>-typedef unsigned TruncationFunction(const String&amp;, unsigned length, unsigned keepCount, UChar* buffer);
</del><ins>+typedef unsigned TruncationFunction(const String&amp;, unsigned length, unsigned keepCount, UChar* buffer, bool shouldInsertEllipsis);
</ins><span class="cx"> 
</span><span class="cx"> static inline int textBreakAtOrPreceding(TextBreakIterator* it, int offset)
</span><span class="cx"> {
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">     return result == TextBreakDone ? length : result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static unsigned centerTruncateToBuffer(const String&amp; string, unsigned length, unsigned keepCount, UChar* buffer)
</del><ins>+static unsigned centerTruncateToBuffer(const String&amp; string, unsigned length, unsigned keepCount, UChar* buffer, bool shouldInsertEllipsis)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(keepCount &lt; length);
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(keepCount &lt; STRING_BUFFER_SIZE);
</span><span class="lines">@@ -66,32 +66,125 @@
</span><span class="cx">     NonSharedCharacterBreakIterator it(string.characters(), length);
</span><span class="cx">     unsigned omitEnd = boundedTextBreakFollowing(it, omitStart + (length - keepCount) - 1, length);
</span><span class="cx">     omitStart = textBreakAtOrPreceding(it, omitStart);
</span><del>-    
-    unsigned truncatedLength = omitStart + 1 + (length - omitEnd);
</del><ins>+
+#if PLATFORM(IOS)
+    // FIXME: We should guard this code behind an editing behavior. Then we can remove the PLATFORM(IOS)-guard.
+
+    // Strip single character before ellipsis character, when that character is preceded by a space
+    if (omitStart &gt; 1 &amp;&amp; string[omitStart - 1] != space &amp;&amp; omitStart &gt; 2 &amp;&amp; string[omitStart - 2] == space)
+        --omitStart;
+
+    // Strip whitespace before and after the ellipsis character
+    while (omitStart &gt; 1 &amp;&amp; string[omitStart - 1] == space)
+        --omitStart;
+
+    // Strip single character after ellipsis character, when that character is followed by a space
+    if ((length - omitEnd) &gt; 1 &amp;&amp; string[omitEnd] != space &amp;&amp; (length - omitEnd) &gt; 2 &amp;&amp; string[omitEnd + 1] == space)
+        ++omitEnd;
+
+    while ((length - omitEnd) &gt; 1 &amp;&amp; string[omitEnd] == space)
+        ++omitEnd;
+#endif
+
+    unsigned truncatedLength = shouldInsertEllipsis ? omitStart + 1 + (length - omitEnd) : length - (omitEnd - omitStart);
</ins><span class="cx">     ASSERT(truncatedLength &lt;= length);
</span><span class="cx"> 
</span><span class="cx">     memcpy(buffer, string.characters(), sizeof(UChar) * omitStart);
</span><del>-    buffer[omitStart] = horizontalEllipsis;
-    memcpy(&amp;buffer[omitStart + 1], &amp;string.characters()[omitEnd], sizeof(UChar) * (length - omitEnd));
-    
</del><ins>+    if (shouldInsertEllipsis) {
+        buffer[omitStart] = horizontalEllipsis;
+        memcpy(&amp;buffer[omitStart + 1], &amp;string.characters()[omitEnd], sizeof(UChar) * (length - omitEnd));    
+    } else
+        memcpy(&amp;buffer[omitStart], &amp;string.characters()[omitEnd], sizeof(UChar) * (length - omitEnd));
</ins><span class="cx">     return truncatedLength;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static unsigned rightTruncateToBuffer(const String&amp; string, unsigned length, unsigned keepCount, UChar* buffer)
</del><ins>+static unsigned rightTruncateToBuffer(const String&amp; string, unsigned length, unsigned keepCount, UChar* buffer, bool shouldInsertEllipsis)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(keepCount &lt; length);
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(keepCount &lt; STRING_BUFFER_SIZE);
</span><del>-    
</del><ins>+
+#if PLATFORM(IOS)
+    // FIXME: We should guard this code behind an editing behavior. Then we can remove the PLATFORM(IOS)-guard.
+
+    // Strip single character before ellipsis character, when that character is preceded by a space
+    if (keepCount &gt; 1 &amp;&amp; string[keepCount - 1] != space &amp;&amp; keepCount &gt; 2 &amp;&amp; string[keepCount - 2] == space)
+        --keepCount;
+
+    // Strip whitespace before the ellipsis character
+    while (keepCount &gt; 1 &amp;&amp; string[keepCount - 1] == space)
+        --keepCount;
+#endif
+
</ins><span class="cx">     NonSharedCharacterBreakIterator it(string.characters(), length);
</span><span class="cx">     unsigned keepLength = textBreakAtOrPreceding(it, keepCount);
</span><del>-    unsigned truncatedLength = keepLength + 1;
-    
</del><ins>+    unsigned truncatedLength = shouldInsertEllipsis ? keepLength + 1 : keepLength;
+
</ins><span class="cx">     memcpy(buffer, string.characters(), sizeof(UChar) * keepLength);
</span><del>-    buffer[keepLength] = horizontalEllipsis;
-    
</del><ins>+    if (shouldInsertEllipsis)
+        buffer[keepLength] = horizontalEllipsis;
+
</ins><span class="cx">     return truncatedLength;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static unsigned rightClipToCharacterBuffer(const String&amp; string, unsigned length, unsigned keepCount, UChar* buffer, bool)
+{
+    ASSERT(keepCount &lt; length);
+    ASSERT(keepCount &lt; STRING_BUFFER_SIZE);
+
+    NonSharedCharacterBreakIterator it(string.characters(), length);
+    unsigned keepLength = textBreakAtOrPreceding(it, keepCount);
+    memcpy(buffer, string.characters(), sizeof(UChar) * keepLength);
+
+    return keepLength;
+}
+
+static unsigned rightClipToWordBuffer(const String&amp; string, unsigned length, unsigned keepCount, UChar* buffer, bool)
+{
+    ASSERT(keepCount &lt; length);
+    ASSERT(keepCount &lt; STRING_BUFFER_SIZE);
+
+    TextBreakIterator* it = wordBreakIterator(string.characters(), length);
+    unsigned keepLength = textBreakAtOrPreceding(it, keepCount);
+    memcpy(buffer, string.characters(), sizeof(UChar) * keepLength);
+
+#if PLATFORM(IOS)
+    // FIXME: We should guard this code behind an editing behavior. Then we can remove the PLATFORM(IOS)-guard.
+    // Motivated by &lt;rdar://problem/7439327&gt; truncation should not include a trailing space
+    while ((keepLength &gt; 0) &amp;&amp; (string[keepLength - 1] == space))
+        --keepLength;
+#endif
+    return keepLength;
+}
+
+static unsigned leftTruncateToBuffer(const String&amp; string, unsigned length, unsigned keepCount, UChar* buffer, bool shouldInsertEllipsis)
+{
+    ASSERT(keepCount &lt; length);
+    ASSERT(keepCount &lt; STRING_BUFFER_SIZE);
+
+    unsigned startIndex = length - keepCount;
+
+    NonSharedCharacterBreakIterator it(string.characters(), length);
+    unsigned adjustedStartIndex = startIndex;
+    startIndex = boundedTextBreakFollowing(it, startIndex, length - startIndex);
+
+    // Strip single character after ellipsis character, when that character is preceded by a space
+    if (adjustedStartIndex &lt; length &amp;&amp; string[adjustedStartIndex] != space
+        &amp;&amp; adjustedStartIndex &lt; length - 1 &amp;&amp; string[adjustedStartIndex + 1] == space)
+        ++adjustedStartIndex;
+
+    // Strip whitespace after the ellipsis character
+    while (adjustedStartIndex &lt; length &amp;&amp; string[adjustedStartIndex] == space)
+        ++adjustedStartIndex;
+
+    if (shouldInsertEllipsis) {
+        buffer[0] = horizontalEllipsis;
+        memcpy(&amp;buffer[1], &amp;string.characters()[adjustedStartIndex], sizeof(UChar) * (length - adjustedStartIndex + 1));
+        return length - adjustedStartIndex + 1;
+    }
+    memcpy(&amp;buffer[0], &amp;string.characters()[adjustedStartIndex], sizeof(UChar) * (length - adjustedStartIndex + 1));
+    return length - adjustedStartIndex;
+}
+
</ins><span class="cx"> static float stringWidth(const Font&amp; renderer, const UChar* characters, unsigned length, bool disableRoundingHacks)
</span><span class="cx"> {
</span><span class="cx">     TextRun run(characters, length);
</span><span class="lines">@@ -100,23 +193,29 @@
</span><span class="cx">     return renderer.width(run);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static String truncateString(const String&amp; string, float maxWidth, const Font&amp; font, TruncationFunction truncateToBuffer, bool disableRoundingHacks)
</del><ins>+static String truncateString(const String&amp; string, float maxWidth, const Font&amp; font, TruncationFunction truncateToBuffer, bool disableRoundingHacks, float* resultWidth = nullptr, bool shouldInsertEllipsis = true,  float customTruncationElementWidth = 0, bool alwaysTruncate = false)
</ins><span class="cx"> {
</span><span class="cx">     if (string.isEmpty())
</span><span class="cx">         return string;
</span><del>-    
</del><ins>+
+    if (resultWidth)
+        *resultWidth = 0;
+
</ins><span class="cx">     ASSERT(maxWidth &gt;= 0);
</span><del>-    
-    float currentEllipsisWidth = stringWidth(font, &amp;horizontalEllipsis, 1, disableRoundingHacks);
-    
</del><ins>+
+    float currentEllipsisWidth = shouldInsertEllipsis ? stringWidth(font, &amp;horizontalEllipsis, 1, disableRoundingHacks) : customTruncationElementWidth;
+
</ins><span class="cx">     UChar stringBuffer[STRING_BUFFER_SIZE];
</span><span class="cx">     unsigned truncatedLength;
</span><span class="cx">     unsigned keepCount;
</span><span class="cx">     unsigned length = string.length();
</span><span class="cx"> 
</span><span class="cx">     if (length &gt; STRING_BUFFER_SIZE) {
</span><del>-        keepCount = STRING_BUFFER_SIZE - 1; // need 1 character for the ellipsis
-        truncatedLength = centerTruncateToBuffer(string, length, keepCount, stringBuffer);
</del><ins>+        if (shouldInsertEllipsis)
+            keepCount = STRING_BUFFER_SIZE - 1; // need 1 character for the ellipsis
+        else
+            keepCount = 0;
+        truncatedLength = centerTruncateToBuffer(string, length, keepCount, stringBuffer, shouldInsertEllipsis);
</ins><span class="cx">     } else {
</span><span class="cx">         keepCount = length;
</span><span class="cx">         memcpy(stringBuffer, string.characters(), sizeof(UChar) * length);
</span><span class="lines">@@ -124,8 +223,13 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     float width = stringWidth(font, stringBuffer, truncatedLength, disableRoundingHacks);
</span><del>-    if (width &lt;= maxWidth)
</del><ins>+    if (!shouldInsertEllipsis &amp;&amp; alwaysTruncate)
+        width += customTruncationElementWidth;
+    if ((width - maxWidth) &lt; 0.0001) { // Ignore rounding errors.
+        if (resultWidth)
+            *resultWidth = width;
</ins><span class="cx">         return string;
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     unsigned keepCountForLargestKnownToFit = 0;
</span><span class="cx">     float widthForLargestKnownToFit = currentEllipsisWidth;
</span><span class="lines">@@ -156,13 +260,17 @@
</span><span class="cx">         ASSERT(keepCount &gt; 0);
</span><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION(keepCount &lt; keepCountForSmallestKnownToNotFit);
</span><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION(keepCount &gt; keepCountForLargestKnownToFit);
</span><del>-        
-        truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer);
</del><span class="cx"> 
</span><ins>+        truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer, shouldInsertEllipsis);
+
</ins><span class="cx">         width = stringWidth(font, stringBuffer, truncatedLength, disableRoundingHacks);
</span><ins>+        if (!shouldInsertEllipsis)
+            width += customTruncationElementWidth;
</ins><span class="cx">         if (width &lt;= maxWidth) {
</span><span class="cx">             keepCountForLargestKnownToFit = keepCount;
</span><span class="cx">             widthForLargestKnownToFit = width;
</span><ins>+            if (resultWidth)
+                *resultWidth = width;
</ins><span class="cx">         } else {
</span><span class="cx">             keepCountForSmallestKnownToNotFit = keepCount;
</span><span class="cx">             widthForSmallestKnownToNotFit = width;
</span><span class="lines">@@ -175,7 +283,7 @@
</span><span class="cx">     
</span><span class="cx">     if (keepCount != keepCountForLargestKnownToFit) {
</span><span class="cx">         keepCount = keepCountForLargestKnownToFit;
</span><del>-        truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer);
</del><ins>+        truncatedLength = truncateToBuffer(string, length, keepCount, stringBuffer, shouldInsertEllipsis);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return String(stringBuffer, truncatedLength);
</span><span class="lines">@@ -196,4 +304,29 @@
</span><span class="cx">     return stringWidth(font, string.characters(), string.length(), !enableRoundingHacks);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String StringTruncator::centerTruncate(const String&amp; string, float maxWidth, const Font&amp; font, EnableRoundingHacksOrNot enableRoundingHacks, float&amp; resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
+{
+    return truncateString(string, maxWidth, font, centerTruncateToBuffer, !enableRoundingHacks, &amp;resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
+}
+
+String StringTruncator::rightTruncate(const String&amp; string, float maxWidth, const Font&amp; font, EnableRoundingHacksOrNot enableRoundingHacks, float&amp; resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
+{
+    return truncateString(string, maxWidth, font, rightTruncateToBuffer, !enableRoundingHacks, &amp;resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
+}
+
+String StringTruncator::leftTruncate(const String&amp; string, float maxWidth, const Font&amp; font, EnableRoundingHacksOrNot enableRoundingHacks, float&amp; resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
+{
+    return truncateString(string, maxWidth, font, leftTruncateToBuffer, !enableRoundingHacks, &amp;resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
+}
+
+String StringTruncator::rightClipToCharacter(const String&amp; string, float maxWidth, const Font&amp; font, EnableRoundingHacksOrNot enableRoundingHacks, float&amp; resultWidth, bool shouldInsertEllipsis, float customTruncationElementWidth)
+{
+    return truncateString(string, maxWidth, font, rightClipToCharacterBuffer, !enableRoundingHacks, &amp;resultWidth, shouldInsertEllipsis, customTruncationElementWidth);
+}
+
+String StringTruncator::rightClipToWord(const String&amp; string, float maxWidth, const Font&amp; font, EnableRoundingHacksOrNot enableRoundingHacks, float&amp; resultWidth, bool shouldInsertEllipsis,  float customTruncationElementWidth, bool alwaysTruncate)
+{
+    return truncateString(string, maxWidth, font, rightClipToWordBuffer, !enableRoundingHacks, &amp;resultWidth, shouldInsertEllipsis, customTruncationElementWidth, alwaysTruncate);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsStringTruncatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/StringTruncator.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/StringTruncator.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/StringTruncator.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -41,6 +41,13 @@
</span><span class="cx"> 
</span><span class="cx">         static String centerTruncate(const String&amp;, float maxWidth, const Font&amp;, EnableRoundingHacksOrNot = DisableRoundingHacks);
</span><span class="cx">         static String rightTruncate(const String&amp;, float maxWidth, const Font&amp;, EnableRoundingHacksOrNot = DisableRoundingHacks);
</span><ins>+
+        static String centerTruncate(const String&amp;, float maxWidth, const Font&amp;, EnableRoundingHacksOrNot, float&amp; resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
+        static String rightTruncate(const String&amp;, float maxWidth, const Font&amp;, EnableRoundingHacksOrNot, float&amp; resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
+        static String leftTruncate(const String&amp;, float maxWidth, const Font&amp;, EnableRoundingHacksOrNot, float&amp; resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
+        static String rightClipToCharacter(const String&amp;, float maxWidth, const Font&amp;, EnableRoundingHacksOrNot, float&amp; resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0);
+        static String rightClipToWord(const String&amp;, float maxWidth, const Font&amp;, EnableRoundingHacksOrNot, float&amp; resultWidth, bool shouldInsertEllipsis = true, float customTruncationElementWidth = 0, bool alwaysTruncate = false);
+
</ins><span class="cx">         static float width(const String&amp;, const Font&amp;, EnableRoundingHacksOrNot = DisableRoundingHacks);
</span><span class="cx">     };
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsTextTrackRepresentationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/TextTrackRepresentation.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/TextTrackRepresentation.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/TextTrackRepresentation.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -42,10 +42,12 @@
</span><span class="cx">     virtual IntRect bounds() const { return IntRect(); }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> PassOwnPtr&lt;TextTrackRepresentation&gt; TextTrackRepresentation::create(TextTrackRepresentationClient*)
</span><span class="cx"> {
</span><span class="cx">     return WTF::adoptPtr(new NullTextTrackRepresentation());
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsWidthIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/WidthIterator.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/WidthIterator.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/WidthIterator.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> 
</span><span class="cx">     static bool supportsTypesettingFeatures(const Font&amp; font)
</span><span class="cx">     {
</span><del>-#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt; 1080
</del><ins>+#if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt; 1080)
</ins><span class="cx">         if (!font.isPrinterFont())
</span><span class="cx">             return !font.typesettingFeatures();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationAVTrackPrivateAVFObjCImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx">         return emptyAtom;
</span><span class="cx"> 
</span><span class="cx">     // If possible, return a title in one of the user's preferred languages.
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</del><ins>+#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</ins><span class="cx">     NSArray *titlesForPreferredLanguages = [AVMetadataItem metadataItemsFromArray:titles filteredAndSortedAccordingToPreferredLanguages:[NSLocale preferredLanguages]];
</span><span class="cx"> #else
</span><span class="cx">     NSArray *titlesForPreferredLanguages = [AVMetadataItem metadataItemsFromArray:titles withLocale:[NSLocale currentLocale]];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -62,8 +62,12 @@
</span><span class="cx"> #import &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #import &lt;AVFoundation/AVFoundation.h&gt;
</span><ins>+#if PLATFORM(IOS)
+#import &lt;CoreImage/CoreImage.h&gt;
+#else
+#import &lt;QuartzCore/CoreImage.h&gt;
+#endif
</ins><span class="cx"> #import &lt;CoreMedia/CoreMedia.h&gt;
</span><del>-#import &lt;QuartzCore/CoreImage.h&gt;
</del><span class="cx"> 
</span><span class="cx"> #if USE(VIDEOTOOLBOX)
</span><span class="cx"> #import &lt;CoreVideo/CoreVideo.h&gt;
</span><span class="lines">@@ -779,7 +783,7 @@
</span><span class="cx"> 
</span><span class="cx"> float MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded() const
</span><span class="cx"> {
</span><del>-#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1080
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &lt;= 1080
</ins><span class="cx">     // AVFoundation on Mountain Lion will occasionally not send a KVO notification
</span><span class="cx">     // when loadedTimeRanges changes when there is no video output. In that case
</span><span class="cx">     // update the cached value explicitly.
</span><span class="lines">@@ -1232,6 +1236,14 @@
</span><span class="cx">     setNaturalSize(IntSize(naturalSize));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+// FIXME: Implement for iOS in WebKit System Interface.
+static inline NSURL *wkAVAssetResolvedURL(AVAsset*)
+{
+    return nil;
+}
+#endif
+
</ins><span class="cx"> bool MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin() const 
</span><span class="cx"> {
</span><span class="cx">     if (!m_avAsset)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsblackberryFontBlackBerrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/blackberry/FontBlackBerry.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/blackberry/FontBlackBerry.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/blackberry/FontBlackBerry.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -38,10 +38,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-void Font::drawComplexText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to) const
</del><ins>+float Font::drawComplexText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to) const
</ins><span class="cx"> {
</span><span class="cx">     if (!run.length())
</span><del>-        return;
</del><ins>+        return 0;
</ins><span class="cx"> 
</span><span class="cx">     GlyphBuffer glyphBuffer;
</span><span class="cx">     HarfBuzzShaper shaper(this, run);
</span><span class="lines">@@ -49,8 +49,10 @@
</span><span class="cx">     if (!shaper.shape(&amp;glyphBuffer))
</span><span class="cx">         return;
</span><span class="cx">     FloatPoint adjustedPoint = shaper.adjustStartPoint(point);
</span><ins>+    float startX = adjustedPoint.x();
</ins><span class="cx"> 
</span><span class="cx">     drawGlyphBuffer(context, run, glyphBuffer, adjustedPoint);
</span><ins>+    return adjustedPoint.x() - startX;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> float Font::floatWidthForComplexText(const TextRun&amp; run, HashSet&lt;const SimpleFontData*&gt;* /* fallbackFonts */, GlyphOverflow* /* glyphOverflow */) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -47,6 +47,10 @@
</span><span class="cx"> #include &lt;wtf/TemporaryChange.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> #include &quot;PlatformCALayerMac.h&quot;
</span><span class="cx"> #include &quot;WebCoreSystemInterface.h&quot;
</span><span class="lines">@@ -61,7 +65,11 @@
</span><span class="cx"> // The threshold width or height above which a tiled layer will be used. This should be
</span><span class="cx"> // large enough to avoid tiled layers for most GraphicsLayers, but less than the OpenGL
</span><span class="cx"> // texture size limit on all supported hardware.
</span><ins>+#if PLATFORM(IOS)
+static const int cMaxPixelDimension = 1280;
+#else
</ins><span class="cx"> static const int cMaxPixelDimension = 2000;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> // Derived empirically: &lt;rdar://problem/13401861&gt;
</span><span class="cx"> static const int cMaxLayerTreeDepth = 250;
</span><span class="lines">@@ -282,7 +290,7 @@
</span><span class="cx"> static inline bool supportsAcceleratedFilterAnimations()
</span><span class="cx"> {
</span><span class="cx"> // &lt;rdar://problem/10907251&gt; - WebKit2 doesn't support CA animations of CI filters on Lion and below
</span><del>-#if PLATFORM(MAC) &amp;&amp; (PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080)
</del><ins>+#if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080)
</ins><span class="cx">     return true;
</span><span class="cx"> #else
</span><span class="cx">     return false;
</span><span class="lines">@@ -874,7 +882,7 @@
</span><span class="cx">         m_uncorrectedContentsImage = newImage;
</span><span class="cx">         m_pendingContentsImage = newImage;
</span><span class="cx"> 
</span><del>-#if !PLATFORM(WIN)
</del><ins>+#if !PLATFORM(WIN) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">         CGColorSpaceRef colorSpace = CGImageGetColorSpace(m_pendingContentsImage.get());
</span><span class="cx"> 
</span><span class="cx">         static CGColorSpaceRef deviceRGB = CGColorSpaceCreateDeviceRGB();
</span><span class="lines">@@ -919,6 +927,13 @@
</span><span class="cx">     noteLayerPropertyChanged(ContentsMediaLayerChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+PlatformLayer* GraphicsLayerCA::contentsLayerForMedia() const
+{
+    return m_contentsLayerPurpose == ContentsLayerForMedia ? m_contentsLayer-&gt;platformLayer() : nullptr;
+}
+#endif
+
</ins><span class="cx"> void GraphicsLayerCA::setContentsToCanvas(PlatformLayer* canvasLayer)
</span><span class="cx"> {
</span><span class="cx">     if (m_contentsLayer &amp;&amp; canvasLayer == m_contentsLayer-&gt;platformLayer())
</span><span class="lines">@@ -1104,6 +1119,10 @@
</span><span class="cx">     bool mapWasClamped;
</span><span class="cx">     FloatRect clipRectForChildren = state.mappedQuad(&amp;mapWasClamped).boundingBox();
</span><span class="cx">     FloatPoint boundsOrigin = m_boundsOrigin;
</span><ins>+#if PLATFORM(IOS)
+    // UIKit may be changing layer bounds behind our back in overflow-scroll layers, so use the layer's origin.
+    boundsOrigin = m_layer-&gt;bounds().location();
+#endif
</ins><span class="cx">     clipRectForChildren.move(boundsOrigin.x(), boundsOrigin.y());
</span><span class="cx">     
</span><span class="cx">     FloatRect clipRectForSelf(boundsOrigin, m_size);
</span><span class="lines">@@ -1471,6 +1490,10 @@
</span><span class="cx">     FloatSize pixelAlignmentOffset;
</span><span class="cx">     computePixelAlignment(pageScaleFactor, positionRelativeToBase, scaledPosition, scaledSize, scaledAnchorPoint, pixelAlignmentOffset);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    m_pixelAlignmentOffset = pixelAlignmentOffset;
+#endif
+
</ins><span class="cx">     FloatRect adjustedBounds(m_boundsOrigin - pixelAlignmentOffset, scaledSize);
</span><span class="cx"> 
</span><span class="cx">     // Update position.
</span><span class="lines">@@ -1480,10 +1503,21 @@
</span><span class="cx">     if (m_structuralLayer) {
</span><span class="cx">         FloatPoint layerPosition(m_position.x() + m_anchorPoint.x() * m_size.width(), m_position.y() + m_anchorPoint.y() * m_size.height());
</span><span class="cx">         FloatRect layerBounds(m_boundsOrigin, m_size);
</span><del>-        
</del><ins>+
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+        // FIXME: Consider moving the main thread logic into PlatformCALayer.
+        if (mediaLayerMustBeUpdatedOnMainThread() &amp;&amp; WebThreadIsCurrent()) {
+            m_structuralLayer-&gt;setPositionOnMainThread(layerPosition);
+            m_structuralLayer-&gt;setBoundsOnMainThread(layerBounds);
+            m_structuralLayer-&gt;setAnchorPointOnMainThread(m_anchorPoint);
+        } else {
+#endif
</ins><span class="cx">         m_structuralLayer-&gt;setPosition(layerPosition);
</span><span class="cx">         m_structuralLayer-&gt;setBounds(layerBounds);
</span><span class="cx">         m_structuralLayer-&gt;setAnchorPoint(m_anchorPoint);
</span><ins>+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+        }
+#endif
</ins><span class="cx"> 
</span><span class="cx">         if (LayerMap* layerCloneMap = m_structuralLayerClones.get()) {
</span><span class="cx">             LayerMap::const_iterator end = layerCloneMap-&gt;end();
</span><span class="lines">@@ -1507,10 +1541,21 @@
</span><span class="cx">         scaledAnchorPoint = FloatPoint(0.5f, 0.5f);
</span><span class="cx">         adjustedPosition = FloatPoint(scaledAnchorPoint.x() * scaledSize.width() - pixelAlignmentOffset.width(), scaledAnchorPoint.y() * scaledSize.height() - pixelAlignmentOffset.height());
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    // FIXME: Consider moving the main thread logic into PlatformCALayer.
+    if (mediaLayerMustBeUpdatedOnMainThread() &amp;&amp; WebThreadIsCurrent()) {
+        m_layer-&gt;setPositionOnMainThread(adjustedPosition);
+        m_layer-&gt;setBoundsOnMainThread(adjustedBounds);
+        m_layer-&gt;setAnchorPointOnMainThread(scaledAnchorPoint);
+    } else {
+#endif
</ins><span class="cx">     m_layer-&gt;setPosition(adjustedPosition);
</span><span class="cx">     m_layer-&gt;setBounds(adjustedBounds);
</span><span class="cx">     m_layer-&gt;setAnchorPoint(scaledAnchorPoint);
</span><ins>+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    }
+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (LayerMap* layerCloneMap = m_layerClones.get()) {
</span><span class="cx">         LayerMap::const_iterator end = layerCloneMap-&gt;end();
</span><span class="lines">@@ -1681,7 +1726,11 @@
</span><span class="cx">         }
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+#if PLATFORM(IOS)
+    RefPtr&lt;PlatformCALayer&gt; oldPrimaryLayer = m_structuralLayer ? m_structuralLayer.get() : m_layer.get();
+#endif
+
</ins><span class="cx">     bool structuralLayerChanged = false;
</span><span class="cx">     
</span><span class="cx">     if (purpose == StructuralLayerForPreserves3D) {
</span><span class="lines">@@ -1980,8 +2029,18 @@
</span><span class="cx">     if (gainedOrLostClippingLayer)
</span><span class="cx">         noteSublayersChanged(DontScheduleFlush);
</span><span class="cx"> 
</span><ins>+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    // FIXME: Consider moving the main thread logic into PlatformCALayer.
+    if (mediaLayerMustBeUpdatedOnMainThread() &amp;&amp; WebThreadIsCurrent()) {
+        m_contentsLayer-&gt;setPositionOnMainThread(contentOrigin);
+        m_contentsLayer-&gt;setBoundsOnMainThread(contentBounds);
+    } else {
+#endif
</ins><span class="cx">     m_contentsLayer-&gt;setPosition(contentOrigin);
</span><span class="cx">     m_contentsLayer-&gt;setBounds(contentBounds);
</span><ins>+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO) 
+    }
+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (m_contentsLayerClones) {
</span><span class="cx">         LayerMap::const_iterator end = m_contentsLayerClones-&gt;end();
</span><span class="lines">@@ -2365,8 +2424,11 @@
</span><span class="cx">     bool isMatrixAnimation = listIndex &lt; 0;
</span><span class="cx">     int numAnimations = isMatrixAnimation ? 1 : operations-&gt;size();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    bool reverseAnimationList = false;
+#else
</ins><span class="cx">     bool reverseAnimationList = true;
</span><del>-#if !PLATFORM(IOS) &amp;&amp; !PLATFORM(WIN)
</del><ins>+#if !PLATFORM(WIN)
</ins><span class="cx">         // Old versions of Core Animation apply animations in reverse order (&lt;rdar://problem/7095638&gt;) so we need to flip the list.
</span><span class="cx">         // to be non-additive. For binary compatibility, the current version of Core Animation preserves this behavior for applications linked
</span><span class="cx">         // on or before Snow Leopard.
</span><span class="lines">@@ -2376,6 +2438,7 @@
</span><span class="cx">         if (!executableWasLinkedOnOrBeforeSnowLeopard)
</span><span class="cx">             reverseAnimationList = false;
</span><span class="cx"> #endif
</span><ins>+#endif // PLATFORM(IOS)
</ins><span class="cx">     if (reverseAnimationList) {
</span><span class="cx">         for (int animationIndex = numAnimations - 1; animationIndex &gt;= 0; --animationIndex) {
</span><span class="cx">             if (!appendToUncommittedAnimations(valueList, operations, animation, animationName, boxSize, animationIndex, timeOffset, isMatrixAnimation)) {
</span><span class="lines">@@ -3035,7 +3098,9 @@
</span><span class="cx"> void GraphicsLayerCA::setupContentsLayer(PlatformCALayer* contentsLayer)
</span><span class="cx"> {
</span><span class="cx">     // Turn off implicit animations on the inner layer.
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     contentsLayer-&gt;setMasksToBounds(true);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (defaultContentsOrientation() == CompositingCoordinatesBottomUp) {
</span><span class="cx">         TransformationMatrix flipper(
</span><span class="lines">@@ -3054,6 +3119,13 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+bool GraphicsLayerCA::mediaLayerMustBeUpdatedOnMainThread() const
+{
+    return m_contentsLayerPurpose == ContentsLayerForMedia;
+}
+#endif
+
</ins><span class="cx"> PassRefPtr&lt;PlatformCALayer&gt; GraphicsLayerCA::findOrMakeClone(CloneID cloneID, PlatformCALayer *sourceLayer, LayerMap* clones, CloneLevel cloneLevel)
</span><span class="cx"> {
</span><span class="cx">     if (!sourceLayer)
</span><span class="lines">@@ -3330,12 +3402,14 @@
</span><span class="cx">     
</span><span class="cx">     // Convert back to layer coordinates.
</span><span class="cx">     alignedBounds.scale(1 / pageScaleFactor);
</span><del>-    
</del><ins>+
+#if !PLATFORM(IOS)
</ins><span class="cx">     // Epsilon is necessary to ensure that backing store size computation in CA, which involves integer truncation,
</span><span class="cx">     // will match our aligned bounds.
</span><span class="cx">     const float epsilon = 1e-5f;
</span><span class="cx">     alignedBounds.expand(epsilon, epsilon);
</span><del>-    
</del><ins>+#endif
+
</ins><span class="cx">     alignmentOffset = baseRelativeBounds.location() - alignedBounds.location();
</span><span class="cx">     position = m_position - alignmentOffset;
</span><span class="cx">     size = alignedBounds.size();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -121,6 +121,9 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void setContentsToImage(Image*);
</span><span class="cx">     virtual void setContentsToMedia(PlatformLayer*);
</span><ins>+#if PLATFORM(IOS)
+    virtual PlatformLayer* contentsLayerForMedia() const OVERRIDE;
+#endif
</ins><span class="cx">     virtual void setContentsToCanvas(PlatformLayer*);
</span><span class="cx">     virtual void setContentsToSolidColor(const Color&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -137,6 +140,9 @@
</span><span class="cx">     virtual void layerDidDisplay(PlatformLayer*);
</span><span class="cx"> 
</span><span class="cx">     virtual void setMaintainsPixelAlignment(bool);
</span><ins>+#if PLATFORM(IOS)
+    virtual FloatSize pixelAlignmentOffset() const OVERRIDE { return m_pixelAlignmentOffset; }
+#endif
</ins><span class="cx">     virtual void deviceOrPageScaleFactorChanged();
</span><span class="cx"> 
</span><span class="cx">     struct CommitState {
</span><span class="lines">@@ -256,6 +262,10 @@
</span><span class="cx">     void setupContentsLayer(PlatformCALayer*);
</span><span class="cx">     PlatformCALayer* contentsLayer() const { return m_contentsLayer.get(); }
</span><span class="cx"> 
</span><ins>+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    bool mediaLayerMustBeUpdatedOnMainThread() const;
+#endif
+
</ins><span class="cx">     virtual void setReplicatedByLayer(GraphicsLayer*);
</span><span class="cx"> 
</span><span class="cx">     virtual void getDebugBorderInfo(Color&amp;, float&amp; width) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCAFiltersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCAFilters.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> #include &quot;PlatformLayer.h&quot;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</del><ins>+#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</ins><span class="cx"> #define USE_CA_FILTERS 1
</span><span class="cx"> #else
</span><span class="cx"> #define USE_CA_FILTERS 0
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCALayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -206,6 +206,14 @@
</span><span class="cx"> #endif // NDEBUG
</span><span class="cx"> #endif // PLATFORM(WIN)
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    bool isWebLayer();
+    void setBoundsOnMainThread(CGRect);
+    void setPositionOnMainThread(CGPoint);
+    void setAnchorPointOnMainThread(FloatPoint3D);
+    void setTileSize(const IntSize&amp;);
+#endif
+
</ins><span class="cx">     virtual PassRefPtr&lt;PlatformCALayer&gt; createCompatibleLayer(LayerType, PlatformCALayerClient*) const = 0;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacLayerFlushSchedulerMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -31,11 +31,31 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/AutodrainedPool.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;RuntimeApplicationChecksIOS.h&quot;
+#include &lt;CoreFoundation/CFBundle.h&gt;
+#include &lt;WebCore/WebCoreThread.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static const CFIndex CoreAnimationRunLoopOrder = 2000000;
</span><span class="cx"> static const CFIndex LayerFlushRunLoopOrder = CoreAnimationRunLoopOrder - 1;
</span><span class="cx"> 
</span><ins>+static CFRunLoopRef currentRunLoop()
+{
+#if PLATFORM(IOS)
+    // A race condition during WebView deallocation can lead to a crash if the layer sync run loop
+    // observer is added to the main run loop &lt;rdar://problem/9798550&gt;. However, for responsiveness,
+    // we still allow this, see &lt;rdar://problem/7403328&gt;. Since the race condition and subsequent
+    // crash are especially troublesome for iBooks, we never allow the observer to be added to the
+    // main run loop in iBooks.
+    if (applicationIsIBooksOnIOS())
+        return WebThreadRunLoop();
+#endif
+    return CFRunLoopGetCurrent();
+}
+
</ins><span class="cx"> LayerFlushScheduler::LayerFlushScheduler(LayerFlushSchedulerClient* client)
</span><span class="cx">     : m_isSuspended(false)
</span><span class="cx">     , m_client(client)
</span><span class="lines">@@ -68,10 +88,10 @@
</span><span class="cx">     if (m_isSuspended)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent();
</del><ins>+    CFRunLoopRef runLoop = currentRunLoop();
</ins><span class="cx"> 
</span><span class="cx">     // Make sure we wake up the loop or the observer could be delayed until some other source fires.
</span><del>-    CFRunLoopWakeUp(currentRunLoop);
</del><ins>+    CFRunLoopWakeUp(runLoop);
</ins><span class="cx"> 
</span><span class="cx">     if (m_runLoopObserver)
</span><span class="cx">         return;
</span><span class="lines">@@ -79,7 +99,7 @@
</span><span class="cx">     CFRunLoopObserverContext context = { 0, this, 0, 0, 0 };
</span><span class="cx">     m_runLoopObserver = adoptCF(CFRunLoopObserverCreate(0, kCFRunLoopBeforeWaiting | kCFRunLoopExit, true, LayerFlushRunLoopOrder, runLoopObserverCallback, &amp;context));
</span><span class="cx"> 
</span><del>-    CFRunLoopAddObserver(currentRunLoop, m_runLoopObserver.get(), kCFRunLoopCommonModes);
</del><ins>+    CFRunLoopAddObserver(runLoop, m_runLoopObserver.get(), kCFRunLoopCommonModes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void LayerFlushScheduler::invalidate()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -48,6 +48,13 @@
</span><span class="cx"> #import &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &quot;WebCoreThread.h&quot;
+#import &quot;WebTiledLayer.h&quot;
+#import &lt;Foundation/NSGeometry.h&gt;
+#import &lt;QuartzCore/CATiledLayerPrivate.h&gt;
+#endif
+
</ins><span class="cx"> SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
</span><span class="cx"> SOFT_LINK_CLASS(AVFoundation, AVPlayerLayer)
</span><span class="cx"> 
</span><span class="lines">@@ -99,6 +106,9 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)animationDidStart:(CAAnimation *)animation
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    WebThreadLock();
+#endif
</ins><span class="cx">     // hasNonZeroBeginTime is stored in a key in the animation
</span><span class="cx">     bool hasNonZeroBeginTime = [[animation valueForKey:WKNonZeroBeginTimeFlag] boolValue];
</span><span class="cx">     CFTimeInterval startTime;
</span><span class="lines">@@ -726,6 +736,16 @@
</span><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx">     [m_layer.get() setContentsScale:value];
</span><ins>+#if PLATFORM(IOS)
+    [m_layer.get() setRasterizationScale:value];
+
+    if (m_layerType == LayerTypeWebTiledLayer) {
+        // This will invalidate all the tiles so we won't end up with stale tiles with the wrong scale in the wrong place,
+        // see &lt;rdar://problem/9434765&gt; for more information.
+        static NSDictionary *optionsDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], kCATiledLayerRemoveImmediately, nil];
+        [(CATiledLayer *)m_layer.get() setNeedsDisplayInRect:[m_layer.get() bounds] levelOfDetail:0 options:optionsDictionary];
+    }
+#endif
</ins><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -770,6 +790,58 @@
</span><span class="cx">     return [tiledBackingLayer tiledBacking];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool PlatformCALayer::isWebLayer()
+{
+    BOOL result = NO;
+    BEGIN_BLOCK_OBJC_EXCEPTIONS
+    result = [m_layer.get() isKindOfClass:[WebLayer self]];
+    END_BLOCK_OBJC_EXCEPTIONS
+    return result;
+}
+
+void PlatformCALayer::setBoundsOnMainThread(CGRect bounds)
+{
+    CALayer *layer = m_layer.get();
+    dispatch_async(dispatch_get_main_queue(), ^{
+        BEGIN_BLOCK_OBJC_EXCEPTIONS
+        [layer setBounds:bounds];
+        END_BLOCK_OBJC_EXCEPTIONS
+    });
+}
+
+void PlatformCALayer::setPositionOnMainThread(CGPoint position)
+{
+    CALayer *layer = m_layer.get();
+    dispatch_async(dispatch_get_main_queue(), ^{
+        BEGIN_BLOCK_OBJC_EXCEPTIONS
+        [layer setPosition:position];
+        END_BLOCK_OBJC_EXCEPTIONS
+    });
+}
+
+void PlatformCALayer::setAnchorPointOnMainThread(FloatPoint3D value)
+{
+    CALayer *layer = m_layer.get();
+    dispatch_async(dispatch_get_main_queue(), ^{
+        BEGIN_BLOCK_OBJC_EXCEPTIONS
+        [layer setAnchorPoint:CGPointMake(value.x(), value.y())];
+        [layer setAnchorPointZ:value.z()];
+        END_BLOCK_OBJC_EXCEPTIONS
+    });
+}
+
+void PlatformCALayer::setTileSize(const IntSize&amp; tileSize)
+{
+    if (m_layerType != LayerTypeWebTiledLayer)
+        return;
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS
+    [static_cast&lt;WebTiledLayer*&gt;(m_layer.get()) setTileSize:tileSize];
+    END_BLOCK_OBJC_EXCEPTIONS
+}
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> PassRefPtr&lt;PlatformCALayer&gt; PlatformCALayerMac::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
</span><span class="cx"> {
</span><span class="cx">     return PlatformCALayerMac::create(layerType, client);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacTileControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,7 +29,9 @@
</span><span class="cx"> #import &quot;IntRect.h&quot;
</span><span class="cx"> #import &quot;PlatformCALayer.h&quot;
</span><span class="cx"> #import &quot;Region.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #import &quot;LayerPool.h&quot;
</span><ins>+#endif
</ins><span class="cx"> #import &quot;WebLayer.h&quot;
</span><span class="cx"> #import &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #import &lt;utility&gt;
</span><span class="lines">@@ -166,6 +168,11 @@
</span><span class="cx"> 
</span><span class="cx"> void TileController::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext&amp; context, const IntRect&amp;)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (pthread_main_np())
+        WebThreadLock();
+#endif
+
</ins><span class="cx">     if (platformCALayer == m_tiledScrollingIndicatorLayer.get()) {
</span><span class="cx">         drawTileMapContents(context.platformContext(), m_tiledScrollingIndicatorLayer-&gt;bounds());
</span><span class="cx">         return;
</span><span class="lines">@@ -621,7 +628,9 @@
</span><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; tilesToRemove.size(); ++i) {
</span><span class="cx">         TileInfo tileInfo = m_tiles.take(tilesToRemove[i]);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         LayerPool::sharedPool()-&gt;addLayer(tileInfo.layer);
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -639,7 +648,9 @@
</span><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; tilesToRemove.size(); ++i) {
</span><span class="cx">         TileInfo tileInfo = m_tiles.take(tilesToRemove[i]);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         LayerPool::sharedPool()-&gt;addLayer(tileInfo.layer);
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -658,7 +669,9 @@
</span><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; tilesToRemove.size(); ++i) {
</span><span class="cx">         TileInfo tileInfo = m_tiles.take(tilesToRemove[i]);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         LayerPool::sharedPool()-&gt;addLayer(tileInfo.layer);
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -787,7 +800,9 @@
</span><span class="cx"> 
</span><span class="cx">         for (size_t i = 0, size = tilesToRemove.size(); i &lt; size; ++i) {
</span><span class="cx">             TileInfo tileInfo = m_tiles.take(tilesToRemove[i]);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">             LayerPool::sharedPool()-&gt;addLayer(tileInfo.layer);
</span><ins>+#endif
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1061,7 +1076,11 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;PlatformCALayer&gt; TileController::createTileLayer(const IntRect&amp; tileRect)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    RefPtr&lt;PlatformCALayer&gt; layer;
+#else
</ins><span class="cx">     RefPtr&lt;PlatformCALayer&gt; layer = LayerPool::sharedPool()-&gt;takeLayerWithSize(tileRect.size());
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (layer) {
</span><span class="cx">         m_tileRepaintCounts.remove(layer.get());
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoFontCairoHarfbuzzNGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -37,14 +37,18 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-void Font::drawComplexText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int, int) const
</del><ins>+float Font::drawComplexText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int, int) const
</ins><span class="cx"> {
</span><span class="cx">     GlyphBuffer glyphBuffer;
</span><span class="cx">     HarfBuzzShaper shaper(this, run);
</span><del>-    if (shaper.shape(&amp;glyphBuffer))
-        drawGlyphBuffer(context, run, glyphBuffer, point);
-    else
-        LOG_ERROR(&quot;Shaper couldn't shape glyphBuffer.&quot;);
</del><ins>+    if (shaper.shape(&amp;glyphBuffer)) {
+        FloatPoint startPoint = point;
+        float startX = startPoint.x();
+        drawGlyphBuffer(context, run, glyphBuffer, startPoint);
+        return startPoint.x() - startX;
+    }
+    LOG_ERROR(&quot;Shaper couldn't shape glyphBuffer.&quot;);
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun&amp; /* run */, const AtomicString&amp; /* mark */, const FloatPoint&amp; /* point */, int /* from */, int /* to */) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgBitmapImageCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -32,7 +32,11 @@
</span><span class="cx"> #include &quot;GraphicsContextCG.h&quot;
</span><span class="cx"> #include &quot;ImageObserver.h&quot;
</span><span class="cx"> #include &quot;SubimageCacheWithTimer.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CGContextPrivate.h&gt;
+#endif
</ins><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -52,6 +56,12 @@
</span><span class="cx"> 
</span><span class="cx">     m_orientation = DefaultImageOrientation;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    m_frameBytes = 0;
+    m_scale = 1;
+    m_haveInfo = false;
+#endif
+
</ins><span class="cx">     if (m_frame) {
</span><span class="cx"> #if CACHE_SUBIMAGES
</span><span class="cx">         subimageCache().clearImage(m_frame);
</span><span class="lines">@@ -90,11 +100,20 @@
</span><span class="cx">     // Set m_sizeRespectingOrientation to be the same as m_size so it's not 0x0.
</span><span class="cx">     m_sizeRespectingOrientation = IntSize(width, height);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    m_originalSize = IntSize(width, height);
+    m_originalSizeRespectingOrientation = IntSize(width, height);
+#endif
+
</ins><span class="cx">     m_frames.grow(1);
</span><span class="cx">     m_frames[0].m_frame = CGImageRetain(cgImage);
</span><span class="cx">     m_frames[0].m_hasAlpha = true;
</span><span class="cx">     m_frames[0].m_haveMetadata = true;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    m_frames[0].m_scale = 1;
+#endif
+
</ins><span class="cx">     checkForSolidColor();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -108,10 +127,24 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     CGImageRef image = frameAtIndex(0);
</span><del>-    
</del><ins>+#else
+    // Note, checkForSolidColor() may be called from frameAtIndex(). On iOS frameAtIndex() gets passed a scaleHint
+    // argument which it uses to tell CG to create a scaled down image. Since we don't know the scaleHint here, if
+    // we call frameAtIndex() again, we would pass it the default scale of 1 and would end up recreating the image.
+    // So we do a quick check and call frameAtIndex(0) only if we haven't yet created an image.
+    CGImageRef image = nullptr;
+    if (m_frames.size())
+        image = m_frames[0].m_frame;
+
+    if (!image)
+        image = frameAtIndex(0);
+#endif
+
</ins><span class="cx">     // Currently we only check for solid color in the important special case of a 1x1 image.
</span><span class="cx">     if (image &amp;&amp; CGImageGetWidth(image) == 1 &amp;&amp; CGImageGetHeight(image) == 1) {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         unsigned char pixel[4]; // RGBA
</span><span class="cx">         RetainPtr&lt;CGContextRef&gt; bmap = adoptCF(CGBitmapContextCreate(pixel, 1, 1, 8, sizeof(pixel), deviceRGBColorSpaceRef(),
</span><span class="cx">             kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big));
</span><span class="lines">@@ -124,6 +157,23 @@
</span><span class="cx">             m_solidColor = Color(0, 0, 0, 0);
</span><span class="cx">         else
</span><span class="cx">             m_solidColor = Color(pixel[0] * 255 / pixel[3], pixel[1] * 255 / pixel[3], pixel[2] * 255 / pixel[3], pixel[3]);
</span><ins>+#else
+        // FIXME: Can we share more code with the Mac port? Formerly the Mac port created a floating point bitmap context,
+        // but such a context wasn't support on iOS (rdar://problem/5106514). So, on iOS we created an integral bitmap
+        // context. Since &lt;https://trac.webkit.org/changeset/23939&gt; the Mac port creates an integral bitmap context.
+        unsigned char pixel[4] = {0, 0, 0, 0}; // RGBA
+        RetainPtr&lt;CGContextRef&gt; bitmap = adoptCF(CGBitmapContextCreate(pixel, 1, 1, 8, sizeof(pixel), deviceRGBColorSpaceRef(),
+            kCGImageAlphaPremultipliedLast));
+        if (!bitmap)
+            return;
+        GraphicsContext(bitmap.get()).setCompositeOperation(CompositeCopy);
+        CGRect destinationRect = { {0, 0}, {1, 1} };
+        CGContextDrawImage(bitmap.get(), destinationRect, image);
+        if (!pixel[3])
+            m_solidColor = Color(0, 0, 0, 0);
+        else
+            m_solidColor = Color(static_cast&lt;int&gt;(pixel[0]), static_cast&lt;int&gt;(pixel[1]), static_cast&lt;int&gt;(pixel[2]), static_cast&lt;int&gt;(pixel[3]));
+#endif
</ins><span class="cx">         m_isSolidColor = true;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -162,9 +212,21 @@
</span><span class="cx"> 
</span><span class="cx"> void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect&amp; destRect, const FloatRect&amp; srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription description)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     startAnimation();
</span><span class="cx"> 
</span><span class="cx">     CGImageRef image = frameAtIndex(m_currentFrame);
</span><ins>+#else
+    startAnimation(false);
+
+    CGRect transformedDestinationRect = CGRectApplyAffineTransform(destRect, CGContextGetCTM(ctxt-&gt;platformContext()));
+    RetainPtr&lt;CGImageRef&gt; image;
+    // Never use subsampled images for drawing into PDF contexts.
+    if (CGContextGetType(ctxt-&gt;platformContext()) == kCGContextTypePDF)
+        image = adoptCF(copyUnscaledFrameAtIndex(m_currentFrame));
+    else
+        image = frameAtIndex(m_currentFrame, std::min&lt;float&gt;(1.0f, std::max(transformedDestinationRect.size.width  / srcRect.width(), transformedDestinationRect.size.height / srcRect.height())));
+#endif
</ins><span class="cx">     if (!image) // If it's too early we won't have an image yet.
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="lines">@@ -173,18 +235,41 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    float scale = m_frames[m_currentFrame].m_scale;
+#endif
</ins><span class="cx">     FloatSize selfSize = currentFrameSize();
</span><span class="cx">     ImageOrientation orientation;
</span><span class="cx"> 
</span><span class="cx">     if (description.respectImageOrientation() == RespectImageOrientation)
</span><span class="cx">         orientation = frameOrientationAtIndex(m_currentFrame);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    ctxt-&gt;drawNativeImage(image.get(), selfSize, styleColorSpace, destRect, srcRect, scale, compositeOp, blendMode, orientation);
+#else
</ins><span class="cx">     ctxt-&gt;drawNativeImage(image, selfSize, styleColorSpace, destRect, srcRect, compositeOp, blendMode, orientation);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (imageObserver())
</span><span class="cx">         imageObserver()-&gt;didDraw(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+PassNativeImagePtr BitmapImage::copyUnscaledFrameAtIndex(size_t index)
+{
+    if (index &gt;= frameCount())
+        return nullptr;
+
+    if (index &gt;= m_frames.size() || !m_frames[index].m_frame)
+        cacheFrame(index, 1);
+
+    if (m_frames[index].m_scale == 1 &amp;&amp; !m_source.isSubsampled())
+        return CGImageRetain(m_frames[index].m_frame);
+
+    return m_source.createFrameAtIndex(index);
</ins><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif // USE(CG)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgColorCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/ColorCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -31,10 +31,38 @@
</span><span class="cx"> #include &quot;GraphicsContextCG.h&quot;
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CGColorTransform.h&gt;
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#include &lt;wtf/StdLibExtras.h&gt;
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+CGColorRef createCGColorWithDeviceWhite(CGFloat white, CGFloat alpha)
+{
+    static CGColorSpaceRef graySpace = CGColorSpaceCreateDeviceGray();
+    const CGFloat components[] = { white, alpha };
+    return CGColorCreate(graySpace, components);
+}
+
+static CGColorRef createCGColorWithDeviceRGBA(CGColorRef sourceColor)
+{
+    if (!sourceColor || CFEqual(CGColorGetColorSpace(sourceColor), deviceRGBColorSpaceRef()))
+        return CGColorRetain(sourceColor);
+
+    RetainPtr&lt;CGColorTransformRef&gt; colorTransform = adoptCF(CGColorTransformCreate(deviceRGBColorSpaceRef(), nullptr));
+    if (!colorTransform)
+        return CGColorRetain(sourceColor);
+
+    // CGColorTransformConvertColor() returns a +1 retained object.
+    return CGColorTransformConvertColor(colorTransform.get(), sourceColor, kCGRenderingIntentDefault);
+}
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> Color::Color(CGColorRef color)
</span><span class="cx"> {
</span><span class="cx">     if (!color) {
</span><span class="lines">@@ -43,9 +71,18 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     size_t numComponents = CGColorGetNumberOfComponents(color);
</span><span class="cx">     const CGFloat* components = CGColorGetComponents(color);
</span><ins>+#else
+    RetainPtr&lt;CGColorRef&gt; correctedColor = adoptCF(createCGColorWithDeviceRGBA(color));
+    if (!correctedColor)
+        correctedColor = color;
</ins><span class="cx"> 
</span><ins>+    size_t numComponents = CGColorGetNumberOfComponents(correctedColor.get());
+    const CGFloat* components = CGColorGetComponents(correctedColor.get());
+#endif // !PLATFORM(IOS)
+
</ins><span class="cx">     float r = 0;
</span><span class="cx">     float g = 0;
</span><span class="cx">     float b = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgFloatPointCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/FloatPointCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/FloatPointCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/FloatPointCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,7 +29,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgFloatRectCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/FloatRectCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/FloatRectCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/FloatRectCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,7 +29,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgFloatSizeCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/FloatSizeCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/FloatSizeCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/FloatSizeCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,7 +29,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgGradientCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/GradientCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/GradientCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/GradientCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,7 +28,11 @@
</span><span class="cx"> #include &quot;Gradient.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;GraphicsContextCG.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -51,10 +51,17 @@
</span><span class="cx"> #include &lt;WebKitSystemInterface/WebKitSystemInterface.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;CoreGraphics/CGContextGState.h&gt;
+#include &lt;wtf/HashMap.h&gt;
+#endif
+
+#if !PLATFORM(IOS)
</ins><span class="cx"> extern &quot;C&quot; {
</span><span class="cx">     CG_EXTERN void CGContextSetCTM(CGContextRef, CGAffineTransform);
</span><span class="cx">     CG_EXTERN CGAffineTransform CGContextGetBaseCTM(CGContextRef);
</span><span class="cx"> };
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> // FIXME: The following using declaration should be in &lt;wtf/HashFunctions.h&gt;.
</span><span class="cx"> using WTF::pairIntHash;
</span><span class="lines">@@ -82,6 +89,9 @@
</span><span class="cx"> 
</span><span class="cx"> CGColorSpaceRef sRGBColorSpaceRef()
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    return deviceRGBColorSpaceRef();
+#endif // PLATFORM(IOS)
</ins><span class="cx">     static CGColorSpaceRef sRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     // Out-of-date CG installations will not honor kCGColorSpaceSRGB. This logic avoids
</span><span class="lines">@@ -93,7 +103,15 @@
</span><span class="cx">     return sRGBSpace;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(WIN)
</del><ins>+#if PLATFORM(IOS)
+void setStrokeAndFillColor(CGContextRef context, CGColorRef color)
+{
+    CGContextSetStrokeColorWithColor(context, color);
+    CGContextSetFillColorWithColor(context, color);
+}
+#endif // PLATFORM(IOS)
+
+#if PLATFORM(WIN) || PLATFORM(IOS)
</ins><span class="cx"> CGColorSpaceRef linearRGBColorSpaceRef()
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Windows should be able to use linear sRGB, this is tracked by http://webkit.org/b/80000.
</span><span class="lines">@@ -101,11 +119,20 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> void GraphicsContext::platformInit(CGContextRef cgContext)
</span><ins>+#else
+void GraphicsContext::platformInit(CGContextRef cgContext, bool shouldUseContextColors)
+#endif
</ins><span class="cx"> {
</span><span class="cx">     m_data = new GraphicsContextPlatformPrivate(cgContext);
</span><span class="cx">     setPaintingDisabled(!cgContext);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (cgContext) {
</span><ins>+#else
+    m_state.shouldUseContextColors = shouldUseContextColors;
+    if (cgContext &amp;&amp; shouldUseContextColors) {
+#endif
</ins><span class="cx">         // Make sure the context starts in sync with our state.
</span><span class="cx">         setPlatformFillColor(fillColor(), fillColorSpace());
</span><span class="cx">         setPlatformStrokeColor(strokeColor(), strokeColorSpace());
</span><span class="lines">@@ -141,11 +168,19 @@
</span><span class="cx">     m_data-&gt;m_userToDeviceTransformKnownToBeIdentity = false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void GraphicsContext::drawNativeImage(PassNativeImagePtr imagePtr, const FloatSize&amp; imageSize, ColorSpace styleColorSpace, const FloatRect&amp; destRect, const FloatRect&amp; srcRect, float scale, CompositeOperator op, BlendMode blendMode, ImageOrientation orientation)
+#else
</ins><span class="cx"> void GraphicsContext::drawNativeImage(PassNativeImagePtr imagePtr, const FloatSize&amp; imageSize, ColorSpace styleColorSpace, const FloatRect&amp; destRect, const FloatRect&amp; srcRect, CompositeOperator op, BlendMode blendMode, ImageOrientation orientation)
</span><ins>+#endif
</ins><span class="cx"> {
</span><span class="cx">     RetainPtr&lt;CGImageRef&gt; image(imagePtr);
</span><span class="cx"> 
</span><span class="cx">     float currHeight = orientation.usesWidthAsHeight() ? CGImageGetWidth(image.get()) : CGImageGetHeight(image.get());
</span><ins>+#if PLATFORM(IOS)
+    // Unapply the scaling since we are getting this from a scaled bitmap.
+    currHeight /= scale;
+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (currHeight &lt;= srcRect.y())
</span><span class="cx">         return;
</span><span class="lines">@@ -153,6 +188,11 @@
</span><span class="cx">     CGContextRef context = platformContext();
</span><span class="cx">     CGContextSaveGState(context);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // Anti-aliasing is on by default on the iPhone. Need to turn it off when drawing images.
+    CGContextSetShouldAntialias(context, false);
+#endif
+
</ins><span class="cx">     bool shouldUseSubimage = false;
</span><span class="cx"> 
</span><span class="cx">     // If the source rect is a subportion of the image, then we compute an inflated destination rect that will hold the entire image
</span><span class="lines">@@ -182,6 +222,9 @@
</span><span class="cx">             subimageRect.setHeight(ceilf(subimageRect.height() + topPadding));
</span><span class="cx">             adjustedDestRect.setHeight(subimageRect.height() / yScale);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+            subimageRect.scale(scale, scale);
+#endif
</ins><span class="cx"> #if CACHE_SUBIMAGES
</span><span class="cx">             image = subimageCache().getSubimage(image.get(), subimageRect);
</span><span class="cx"> #else
</span><span class="lines">@@ -204,6 +247,11 @@
</span><span class="cx">     if (!shouldUseSubimage &amp;&amp; currHeight &lt; imageSize.height())
</span><span class="cx">         adjustedDestRect.setHeight(adjustedDestRect.height() * currHeight / imageSize.height());
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // Align to pixel boundaries
+    adjustedDestRect = roundToDevicePixels(adjustedDestRect);
+#endif
+
</ins><span class="cx">     setPlatformCompositeOperation(op, blendMode);
</span><span class="cx"> 
</span><span class="cx">     // ImageOrientation expects the origin to be at (0, 0)
</span><span class="lines">@@ -323,8 +371,14 @@
</span><span class="cx"> 
</span><span class="cx">     CGContextRef context = platformContext();
</span><span class="cx"> 
</span><del>-    if (shouldAntialias())
-        CGContextSetShouldAntialias(context, false);
</del><ins>+    if (shouldAntialias()) {
+        bool willAntialias = false;
+#if PLATFORM(IOS)
+        // Force antialiasing on for line patterns as they don't look good with it turned off (&lt;rdar://problem/5459772&gt;).
+        willAntialias = patWidth;
+#endif
+        CGContextSetShouldAntialias(context, willAntialias);
+    }
</ins><span class="cx"> 
</span><span class="cx">     if (patWidth) {
</span><span class="cx">         CGContextSaveGState(context);
</span><span class="lines">@@ -385,6 +439,36 @@
</span><span class="cx">         CGContextSetShouldAntialias(context, true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void GraphicsContext::drawJoinedLines(CGPoint points[], unsigned count, bool antialias, CGLineCap lineCap)
+{
+    if (paintingDisabled() || !count)
+        return;
+
+    CGContextRef context = platformContext();
+    float width = CGContextGetLineWidth(context);
+
+    CGContextSaveGState(context);
+    
+    CGContextSetShouldAntialias(context, antialias);
+
+    CGContextSetLineWidth(context, width &lt; 1 ? 1 : width);
+
+    CGContextBeginPath(context);
+    
+    CGContextSetLineCap(context, lineCap);
+    
+    CGContextMoveToPoint(context, points[0].x, points[0].y);
+    
+    for (unsigned i = 1; i &lt; count; ++i)
+        CGContextAddLineToPoint(context, points[i].x, points[i].y);
+
+    CGContextStrokePath(context);
+
+    CGContextRestoreGState(context);
+}
+#endif
+
</ins><span class="cx"> // This method is only used to draw the little circles used in lists.
</span><span class="cx"> void GraphicsContext::drawEllipse(const IntRect&amp; rect)
</span><span class="cx"> {
</span><span class="lines">@@ -396,6 +480,31 @@
</span><span class="cx">     drawPath(path);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void GraphicsContext::drawEllipse(const FloatRect&amp; rect)
+{
+    if (paintingDisabled())
+        return;
+
+    CGContextRef context(platformContext());
+
+    CGContextSaveGState(context);
+
+    setCGFillColor(context, fillColor(), fillColorSpace());
+    setCGStrokeColor(context, strokeColor(), strokeColorSpace());
+
+    CGContextSetLineWidth(context, strokeThickness());
+    
+    CGContextBeginPath(context);
+    CGContextAddEllipseInRect(context, rect);
+
+    CGContextFillPath(context);
+    CGContextStrokePath(context);
+    
+    CGContextRestoreGState(context);
+}
+#endif
+
</ins><span class="cx"> static void addConvexPolygonToPath(Path&amp; path, size_t numberOfPoints, const FloatPoint* points)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(numberOfPoints &gt; 0);
</span><span class="lines">@@ -903,7 +1012,11 @@
</span><span class="cx"> 
</span><span class="cx"> static void applyShadowOffsetWorkaroundIfNeeded(const GraphicsContext&amp; context, CGFloat&amp; xOffset, CGFloat&amp; yOffset)
</span><span class="cx"> {
</span><del>-#if !PLATFORM(IOS)
</del><ins>+#if PLATFORM(IOS)
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(xOffset);
+    UNUSED_PARAM(yOffset);
+#else
</ins><span class="cx">     if (context.isAcceleratedContext())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1235,6 +1348,59 @@
</span><span class="cx">     return FloatRect(roundedOrigin, roundedLowerRight - roundedOrigin);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: We should look to consolidate the iOS and non-iOS implementations of
+// computeLineBoundsAndAntialiasingModeForText() and computeLineBoundsForText().
+#if PLATFORM(IOS)
+static FloatRect computeLineBoundsAndAntialiasingModeForText(GraphicsContext&amp; initialContext, const FloatPoint&amp; point, float width, bool printing, bool&amp; shouldAntialias, Color&amp; color)
+{
+    CGContextRef context = initialContext.platformContext();
+    CGPoint origin;
+    CGFloat thickness = std::max(initialContext.strokeThickness(), 0.5f);
+
+    shouldAntialias = true;
+    if (printing)
+        origin = CGPointMake(point.x(), point.y());
+    else {
+        CGAffineTransform t = CGContextGetUserSpaceToDeviceSpaceTransform(context);
+        if (AffineTransform(t).preservesAxisAlignment())
+            shouldAntialias = false;
+
+        // This code always draws a line that is at least one-pixel line high,
+        // which tends to visually overwhelm text at small scales. To counter this
+        // effect, an alpha is applied to the underline color when text is at small scales.
+
+        // Just compute scale in x dimension, assuming x and y scales are equal.
+        CGFloat scale = t.b ? sqrtf(t.a * t.a + t.b * t.b) : t.a;
+        if (scale &lt; 1.0) {
+            static const float MinUnderlineAlpha = 0.4f;
+            float shade = scale &gt; MinUnderlineAlpha ? scale : MinUnderlineAlpha;
+            int alpha = color.alpha() * shade;
+            color = Color(color.red(), color.green(), color.blue(), alpha);
+        }
+
+        // Don't offset line from bottom of text if scale is less than OffsetUnderlineScale.
+        static const CGFloat OffsetUnderlineScale = 0.4f;
+        CGFloat dy = scale &lt; OffsetUnderlineScale ? 0 : 1;
+
+        // If we've increased the thickness of the line, make sure to move the location too.
+        if (thickness &gt; 1)
+            dy += roundf(thickness) - 1;
+
+        CGPoint devicePoint = CGPointApplyAffineTransform(point, t);
+        CGPoint deviceOrigin = CGPointMake(roundf(devicePoint.x), ceilf(devicePoint.y) + dy);
+        origin = CGPointApplyAffineTransform(deviceOrigin, CGAffineTransformInvert(t));
+        thickness /= scale;
+    }
+    return FloatRect(origin.x, origin.y, width, thickness);
+}
+
+FloatRect GraphicsContext::computeLineBoundsForText(const FloatPoint&amp; point, float width, bool printing)
+{
+    bool dummyBool;
+    Color dummyColor;
+    return computeLineBoundsAndAntialiasingModeForText(*this, point, width, printing, dummyBool, dummyColor);
+}
+#else
</ins><span class="cx"> static FloatRect computeLineBoundsAndAntialiasingModeForText(GraphicsContext&amp; context, const FloatPoint&amp; point, float width, bool printing, bool&amp; shouldAntialias)
</span><span class="cx"> {
</span><span class="cx">     shouldAntialias = true;
</span><span class="lines">@@ -1270,6 +1436,7 @@
</span><span class="cx">     bool dummy;
</span><span class="cx">     return computeLineBoundsAndAntialiasingModeForText(*this, point, width, printing, dummy);
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> void GraphicsContext::drawLineForText(const FloatPoint&amp; point, float width, bool printing)
</span><span class="cx"> {
</span><span class="lines">@@ -1279,6 +1446,7 @@
</span><span class="cx">     if (width &lt;= 0)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     bool shouldAntialiasLine;
</span><span class="cx">     FloatRect bounds = computeLineBoundsAndAntialiasingModeForText(*this, point, width, printing, shouldAntialiasLine);
</span><span class="cx"> 
</span><span class="lines">@@ -1297,10 +1465,26 @@
</span><span class="cx"> 
</span><span class="cx">     if (restoreAntialiasMode)
</span><span class="cx">         CGContextSetShouldAntialias(platformContext(), true);
</span><ins>+#else
+    CGContextRef context = platformContext();
+    CGContextSaveGState(context);
+
+    Color color(strokeColor());
+    
+    bool shouldAntialiasLine;
+    FloatRect rect = computeLineBoundsAndAntialiasingModeForText(*this, point, width, printing, shouldAntialiasLine, color);
+
+    if (m_state.shouldUseContextColors)
+        setCGFillColor(context, color, strokeColorSpace());
+    CGContextFillRect(context, rect);
+
+    CGContextRestoreGState(context);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsContext::setURLForRect(const URL&amp; link, const IntRect&amp; destRect)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (paintingDisabled())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1319,6 +1503,10 @@
</span><span class="cx"> 
</span><span class="cx">     CGPDFContextSetURLForRect(context, urlRef.get(),
</span><span class="cx">         CGRectApplyAffineTransform(rect, CGContextGetCTM(context)));
</span><ins>+#else
+    UNUSED_PARAM(link);
+    UNUSED_PARAM(destRect);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsContext::setImageInterpolationQuality(InterpolationQuality mode)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -33,8 +33,13 @@
</span><span class="cx"> #include &quot;GraphicsContextCG.h&quot;
</span><span class="cx"> #include &quot;ImageData.h&quot;
</span><span class="cx"> #include &quot;MIMETypeRegistry.h&quot;
</span><ins>+#include &lt;math.h&gt;
+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><del>-#include &lt;math.h&gt;
</del><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#include &lt;ImageIO/ImageIO.h&gt;
+#endif
</ins><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/CheckedArithmetic.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="lines">@@ -50,10 +55,17 @@
</span><span class="cx"> #include &lt;IOSurface/IOSurface.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+// CA uses ARGB32 for textures and ARGB32 -&gt; ARGB32 resampling is optimized.
+#define USE_ARGB32 PLATFORM(IOS)
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> #if USE(IOSURFACE_CANVAS_BACKING_STORE)
</span><ins>+#if PLATFORM(IOS)
+static const int maxIOSurfaceDimension = 2048;
+#else
</ins><span class="cx"> static const int maxIOSurfaceDimension = 4096;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> static RetainPtr&lt;IOSurfaceRef&gt; createIOSurface(const IntSize&amp; size)
</span><span class="cx"> {
</span><span class="lines">@@ -70,8 +82,13 @@
</span><span class="cx">     if (!allocSize)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    const void *keys[6];
-    const void *values[6];
</del><ins>+#if !PLATFORM(IOS)
+    const void* keys[6];
+    const void* values[6];
+#else
+    const void* keys[7];
+    const void* values[7];
+#endif
</ins><span class="cx">     keys[0] = kIOSurfaceWidth;
</span><span class="cx">     values[0] = CFNumberCreate(0, kCFNumberIntType, &amp;width);
</span><span class="cx">     keys[1] = kIOSurfaceHeight;
</span><span class="lines">@@ -84,9 +101,14 @@
</span><span class="cx">     values[4] = CFNumberCreate(0, kCFNumberLongType, &amp;bytesPerRow);
</span><span class="cx">     keys[5] = kIOSurfaceAllocSize;
</span><span class="cx">     values[5] = CFNumberCreate(0, kCFNumberLongType, &amp;allocSize);
</span><ins>+#if PLATFORM(IOS)
+    keys[6] = kIOSurfaceCacheMode;
+    int cacheMode = kIOMapWriteCombineCache;
+    values[6] = CFNumberCreate(0, kCFNumberIntType, &amp;cacheMode);
+#endif
</ins><span class="cx"> 
</span><del>-    RetainPtr&lt;CFDictionaryRef&gt; dict = adoptCF(CFDictionaryCreate(0, keys, values, 6, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
-    for (unsigned i = 0; i &lt; 6; i++)
</del><ins>+    RetainPtr&lt;CFDictionaryRef&gt; dict = adoptCF(CFDictionaryCreate(0, keys, values, WTF_ARRAY_LENGTH(values), &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
+    for (unsigned i = 0; i &lt; WTF_ARRAY_LENGTH(values); ++i)
</ins><span class="cx">         CFRelease(values[i]);
</span><span class="cx"> 
</span><span class="cx">     return adoptCF(IOSurfaceCreate(dict.get()));
</span><span class="lines">@@ -169,7 +191,11 @@
</span><span class="cx">             return;
</span><span class="cx">         ASSERT(!(reinterpret_cast&lt;intptr_t&gt;(m_data.m_data) &amp; 3));
</span><span class="cx"> 
</span><ins>+#if USE_ARGB32
+        m_data.m_bitmapInfo = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host;
+#else
</ins><span class="cx">         m_data.m_bitmapInfo = kCGImageAlphaPremultipliedLast;
</span><ins>+#endif
</ins><span class="cx">         cgContext = adoptCF(CGBitmapContextCreate(m_data.m_data, m_data.m_backingStoreSize.width(), m_data.m_backingStoreSize.height(), 8, m_data.m_bytesPerRow.unsafeGet(), m_data.m_colorSpace, m_data.m_bitmapInfo));
</span><span class="cx">         // Create a live image that wraps the data.
</span><span class="cx">         m_data.m_dataProvider = adoptCF(CGDataProviderCreateWithData(0, m_data.m_data, numBytes.unsafeGet(), releaseImageData));
</span><span class="lines">@@ -276,7 +302,13 @@
</span><span class="cx"> 
</span><span class="cx">     FloatRect adjustedSrcRect = srcRect;
</span><span class="cx">     adjustedSrcRect.scale(m_resolutionScale, m_resolutionScale);
</span><del>-    destContext-&gt;drawNativeImage(image.get(), m_data.m_backingStoreSize, colorSpace, destRect, adjustedSrcRect, op, blendMode);
</del><ins>+    destContext-&gt;drawNativeImage(image.get(), m_data.m_backingStoreSize, colorSpace, destRect, adjustedSrcRect,
+#if PLATFORM(IOS)
+        1.0f, // Default scale of 1.0
+#endif
+        op,
+        blendMode
+    );
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect&amp; srcRect, const AffineTransform&amp; patternTransform, const FloatPoint&amp; phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect&amp; destRect)
</span><span class="lines">@@ -373,7 +405,7 @@
</span><span class="cx"> 
</span><span class="cx"> static inline CFStringRef jpegUTI()
</span><span class="cx"> {
</span><del>-#if PLATFORM(WIN)
</del><ins>+#if PLATFORM(IOS) || PLATFORM(WIN)
</ins><span class="cx">     static const CFStringRef kUTTypeJPEG = CFSTR(&quot;public.jpeg&quot;);
</span><span class="cx"> #endif
</span><span class="cx">     return kUTTypeJPEG;
</span><span class="lines">@@ -381,7 +413,7 @@
</span><span class="cx">     
</span><span class="cx"> static RetainPtr&lt;CFStringRef&gt; utiFromMIMEType(const String&amp; mimeType)
</span><span class="cx"> {
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     return adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType.createCFString().get(), 0));
</span><span class="cx"> #else
</span><span class="cx">     ASSERT(isMainThread()); // It is unclear if CFSTR is threadsafe.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferDataCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -48,6 +48,9 @@
</span><span class="cx"> };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+// CA uses ARGB32 for textures and ARGB32 -&gt; ARGB32 resampling is optimized.
+#define USE_ARGB32 PLATFORM(IOS)
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> ImageBufferData::ImageBufferData(const IntSize&amp;)
</span><span class="lines">@@ -60,7 +63,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(ACCELERATE)
</span><span class="cx"> 
</span><del>-#if USE(IOSURFACE_CANVAS_BACKING_STORE)
</del><ins>+#if USE_ARGB32 || USE(IOSURFACE_CANVAS_BACKING_STORE)
</ins><span class="cx"> static void convertScanline(void* data, size_t tileNumber, bool premultiply)
</span><span class="cx"> {
</span><span class="cx">     ScanlineData* scanlineData = static_cast&lt;ScanlineData*&gt;(data);
</span><span class="lines">@@ -122,13 +125,13 @@
</span><span class="cx">     
</span><span class="cx">     int originx = rect.x();
</span><span class="cx">     int destx = 0;
</span><del>-    int destw = rect.width();
</del><ins>+    Checked&lt;int&gt; destw = rect.width();
</ins><span class="cx">     if (originx &lt; 0) {
</span><span class="cx">         destw += originx;
</span><span class="cx">         destx = -originx;
</span><span class="cx">         originx = 0;
</span><span class="cx">     }
</span><del>-    destw = std::min&lt;int&gt;(destw, ceilf(size.width() / resolutionScale) - originx);
</del><ins>+    destw = std::min&lt;int&gt;(destw.unsafeGet(), ceilf(size.width() / resolutionScale) - originx);
</ins><span class="cx">     originx *= resolutionScale;
</span><span class="cx">     if (endx.unsafeGet() &gt; size.width())
</span><span class="cx">         endx = size.width();
</span><span class="lines">@@ -136,13 +139,13 @@
</span><span class="cx">     
</span><span class="cx">     int originy = rect.y();
</span><span class="cx">     int desty = 0;
</span><del>-    int desth = rect.height();
</del><ins>+    Checked&lt;int&gt; desth = rect.height();
</ins><span class="cx">     if (originy &lt; 0) {
</span><span class="cx">         desth += originy;
</span><span class="cx">         desty = -originy;
</span><span class="cx">         originy = 0;
</span><span class="cx">     }
</span><del>-    desth = std::min&lt;int&gt;(desth, ceilf(size.height() / resolutionScale) - originy);
</del><ins>+    desth = std::min&lt;int&gt;(desth.unsafeGet(), ceilf(size.height() / resolutionScale) - originy);
</ins><span class="cx">     originy *= resolutionScale;
</span><span class="cx">     if (endy.unsafeGet() &gt; size.height())
</span><span class="cx">         endy = size.height();
</span><span class="lines">@@ -163,6 +166,16 @@
</span><span class="cx">         
</span><span class="cx"> #if USE(ACCELERATE)
</span><span class="cx">         if (unmultiplied) {
</span><ins>+#if USE_ARGB32
+            ScanlineData scanlineData;
+            scanlineData.scanlineWidth = destw.unsafeGet();
+            scanlineData.srcData = srcRows;
+            scanlineData.srcRowBytes = srcBytesPerRow;
+            scanlineData.destData = destRows;
+            scanlineData.destRowBytes = destBytesPerRow;
+
+            dispatch_apply_f(desth.unsafeGet(), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), &amp;scanlineData, unpremultitplyScanline);
+#else
</ins><span class="cx">             vImage_Buffer src;
</span><span class="cx">             src.height = height.unsafeGet();
</span><span class="cx">             src.width = width.unsafeGet();
</span><span class="lines">@@ -170,8 +183,8 @@
</span><span class="cx">             src.data = srcRows;
</span><span class="cx">             
</span><span class="cx">             vImage_Buffer dst;
</span><del>-            dst.height = desth;
-            dst.width = destw;
</del><ins>+            dst.height = desth.unsafeGet();
+            dst.width = destw.unsafeGet();
</ins><span class="cx">             dst.rowBytes = destBytesPerRow;
</span><span class="cx">             dst.data = destRows;
</span><span class="cx"> 
</span><span class="lines">@@ -184,13 +197,14 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             vImageUnpremultiplyData_RGBA8888(&amp;src, &amp;dst, kvImageNoFlags);
</span><ins>+#endif
</ins><span class="cx">             return result.release();
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx">         if (resolutionScale != 1) {
</span><span class="cx">             RetainPtr&lt;CGContextRef&gt; sourceContext = adoptCF(CGBitmapContextCreate(srcRows, width.unsafeGet(), height.unsafeGet(), 8, srcBytesPerRow, m_colorSpace, kCGImageAlphaPremultipliedLast));
</span><span class="cx">             RetainPtr&lt;CGImageRef&gt; sourceImage = adoptCF(CGBitmapContextCreateImage(sourceContext.get()));
</span><del>-            RetainPtr&lt;CGContextRef&gt; destinationContext = adoptCF(CGBitmapContextCreate(destRows, destw, desth, 8, destBytesPerRow, m_colorSpace, kCGImageAlphaPremultipliedLast));
</del><ins>+            RetainPtr&lt;CGContextRef&gt; destinationContext = adoptCF(CGBitmapContextCreate(destRows, destw.unsafeGet(), desth.unsafeGet(), 8, destBytesPerRow, m_colorSpace, kCGImageAlphaPremultipliedLast));
</ins><span class="cx">             CGContextSetBlendMode(destinationContext.get(), kCGBlendModeCopy);
</span><span class="cx">             CGContextDrawImage(destinationContext.get(), CGRectMake(0, 0, width.unsafeGet() / resolutionScale, height.unsafeGet() / resolutionScale), sourceImage.get()); // FIXME: Add subpixel translation.
</span><span class="cx">             if (!unmultiplied)
</span><span class="lines">@@ -208,21 +222,46 @@
</span><span class="cx">                 for (int x = 0; x &lt; width.unsafeGet(); x++) {
</span><span class="cx">                     int basex = x * 4;
</span><span class="cx">                     unsigned char alpha = srcRows[basex + 3];
</span><ins>+#if USE_ARGB32
+                    // Byte order is different as we use image buffers of ARGB32
</ins><span class="cx">                     if (alpha) {
</span><ins>+                        destRows[basex] = (srcRows[basex + 2] * 255) / alpha;
+                        destRows[basex + 1] = (srcRows[basex + 1] * 255) / alpha;
+                        destRows[basex + 2] = (srcRows[basex] * 255) / alpha;
+                        destRows[basex + 3] = alpha;
+                    } else {
+                        destRows[basex] = srcRows[basex + 2];
+                        destRows[basex + 1] = srcRows[basex + 1];
+                        destRows[basex + 2] = srcRows[basex];
+                        destRows[basex + 3] = alpha;
+                    }
+#else
+                    if (alpha) {
</ins><span class="cx">                         destRows[basex] = (srcRows[basex] * 255) / alpha;
</span><span class="cx">                         destRows[basex + 1] = (srcRows[basex + 1] * 255) / alpha;
</span><span class="cx">                         destRows[basex + 2] = (srcRows[basex + 2] * 255) / alpha;
</span><span class="cx">                         destRows[basex + 3] = alpha;
</span><span class="cx">                     } else
</span><span class="cx">                         reinterpret_cast&lt;uint32_t*&gt;(destRows + basex)[0] = reinterpret_cast&lt;uint32_t*&gt;(srcRows + basex)[0];
</span><ins>+#endif
</ins><span class="cx">                 }
</span><span class="cx">                 srcRows += srcBytesPerRow;
</span><span class="cx">                 destRows += destBytesPerRow;
</span><span class="cx">             }
</span><span class="cx">         } else {
</span><span class="cx">             for (int y = 0; y &lt; height.unsafeGet(); ++y) {
</span><ins>+#if USE_ARGB32
+                for (int x = 0; x &lt; width.unsafeGet(); x++) {
+                    int basex = x * 4;
+                    destRows[basex] = srcRows[basex + 2];
+                    destRows[basex + 1] = srcRows[basex + 1];
+                    destRows[basex + 2] = srcRows[basex];
+                    destRows[basex + 3] = srcRows[basex + 3];
+                }
+#else
</ins><span class="cx">                 for (int x = 0; x &lt; (width * 4).unsafeGet(); x += 4)
</span><span class="cx">                     reinterpret_cast&lt;uint32_t*&gt;(destRows + x)[0] = reinterpret_cast&lt;uint32_t*&gt;(srcRows + x)[0];
</span><ins>+#endif
</ins><span class="cx">                 srcRows += srcBytesPerRow;
</span><span class="cx">                 destRows += destBytesPerRow;
</span><span class="cx">             }
</span><span class="lines">@@ -242,8 +281,8 @@
</span><span class="cx">         src.data = srcRows;
</span><span class="cx"> 
</span><span class="cx">         vImage_Buffer dest;
</span><del>-        dest.height = desth;
-        dest.width = destw;
</del><ins>+        dest.height = desth.unsafeGet();
+        dest.width = destw.unsafeGet();
</ins><span class="cx">         dest.rowBytes = destBytesPerRow;
</span><span class="cx">         dest.data = destRows;
</span><span class="cx"> 
</span><span class="lines">@@ -263,13 +302,13 @@
</span><span class="cx"> 
</span><span class="cx">         if (unmultiplied) {
</span><span class="cx">             ScanlineData scanlineData;
</span><del>-            scanlineData.scanlineWidth = width.unsafeGet();
</del><ins>+            scanlineData.scanlineWidth = destw.unsafeGet();
</ins><span class="cx">             scanlineData.srcData = srcRows;
</span><span class="cx">             scanlineData.srcRowBytes = srcBytesPerRow;
</span><span class="cx">             scanlineData.destData = destRows;
</span><span class="cx">             scanlineData.destRowBytes = destBytesPerRow;
</span><span class="cx"> 
</span><del>-            dispatch_apply_f(height.unsafeGet(), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), &amp;scanlineData, unpremultitplyScanline);
</del><ins>+            dispatch_apply_f(desth.unsafeGet(), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), &amp;scanlineData, unpremultitplyScanline);
</ins><span class="cx">         } else {
</span><span class="cx">             // Swap pixel channels from BGRA to RGBA.
</span><span class="cx">             const uint8_t map[4] = { 2, 1, 0, 3 };
</span><span class="lines">@@ -279,7 +318,7 @@
</span><span class="cx">         if (resolutionScale != 1) {
</span><span class="cx">             RetainPtr&lt;CGContextRef&gt; sourceContext = adoptCF(CGBitmapContextCreate(srcRows, width.unsafeGet(), height.unsafeGet(), 8, srcBytesPerRow, m_colorSpace, kCGImageAlphaPremultipliedLast));
</span><span class="cx">             RetainPtr&lt;CGImageRef&gt; sourceImage = adoptCF(CGBitmapContextCreateImage(sourceContext.get()));
</span><del>-            RetainPtr&lt;CGContextRef&gt; destinationContext = adoptCF(CGBitmapContextCreate(destRows, destw, desth, 8, destBytesPerRow, m_colorSpace, kCGImageAlphaPremultipliedLast));
</del><ins>+            RetainPtr&lt;CGContextRef&gt; destinationContext = adoptCF(CGBitmapContextCreate(destRows, destw.unsafeGet(), desth.unsafeGet(), 8, destBytesPerRow, m_colorSpace, kCGImageAlphaPremultipliedLast));
</ins><span class="cx">             CGContextSetBlendMode(destinationContext.get(), kCGBlendModeCopy);
</span><span class="cx">             CGContextDrawImage(destinationContext.get(), CGRectMake(0, 0, width.unsafeGet() / resolutionScale, height.unsafeGet() / resolutionScale), sourceImage.get()); // FIXME: Add subpixel translation.
</span><span class="cx"> 
</span><span class="lines">@@ -390,6 +429,17 @@
</span><span class="cx">         
</span><span class="cx"> #if  USE(ACCELERATE)
</span><span class="cx">         if (unmultiplied) {
</span><ins>+#if USE_ARGB32
+            // FIXME: Are scanlineData.scanlineWidth and the number of iterations specified to dispatch_apply_f() correct?
+            ScanlineData scanlineData;
+            scanlineData.scanlineWidth = width.unsafeGet();
+            scanlineData.srcData = srcRows;
+            scanlineData.srcRowBytes = srcBytesPerRow;
+            scanlineData.destData = destRows;
+            scanlineData.destRowBytes = destBytesPerRow;
+
+            dispatch_apply_f(height.unsafeGet(), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), &amp;scanlineData, premultitplyScanline);
+#else
</ins><span class="cx">             vImage_Buffer src;
</span><span class="cx">             src.height = height.unsafeGet();
</span><span class="cx">             src.width = width.unsafeGet();
</span><span class="lines">@@ -411,6 +461,7 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             vImagePremultiplyData_RGBA8888(&amp;src, &amp;dst, kvImageNoFlags);
</span><ins>+#endif
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="lines">@@ -433,13 +484,28 @@
</span><span class="cx">             for (int x = 0; x &lt; width.unsafeGet(); x++) {
</span><span class="cx">                 int basex = x * 4;
</span><span class="cx">                 unsigned char alpha = srcRows[basex + 3];
</span><ins>+#if USE_ARGB32
+                // Byte order is different as we use image buffers of ARGB32
</ins><span class="cx">                 if (unmultiplied &amp;&amp; alpha != 255) {
</span><ins>+                    destRows[basex] = (srcRows[basex + 2] * alpha + 254) / 255;
+                    destRows[basex + 1] = (srcRows[basex + 1] * alpha + 254) / 255;
+                    destRows[basex + 2] = (srcRows[basex + 0] * alpha + 254) / 255;
+                    destRows[basex + 3] = alpha;
+                } else {
+                    destRows[basex] = srcRows[basex + 2];
+                    destRows[basex + 1] = srcRows[basex + 1];
+                    destRows[basex + 2] = srcRows[basex];
+                    destRows[basex + 3] = alpha;
+                }
+#else
+                if (unmultiplied &amp;&amp; alpha != 255) {
</ins><span class="cx">                     destRows[basex] = (srcRows[basex] * alpha + 254) / 255;
</span><span class="cx">                     destRows[basex + 1] = (srcRows[basex + 1] * alpha + 254) / 255;
</span><span class="cx">                     destRows[basex + 2] = (srcRows[basex + 2] * alpha + 254) / 255;
</span><span class="cx">                     destRows[basex + 3] = alpha;
</span><span class="cx">                 } else
</span><span class="cx">                     reinterpret_cast&lt;uint32_t*&gt;(destRows + basex)[0] = reinterpret_cast&lt;uint32_t*&gt;(srcRows + basex)[0];
</span><ins>+#endif
</ins><span class="cx">             }
</span><span class="cx">             destRows += destBytesPerRow;
</span><span class="cx">             srcRows += srcBytesPerRow;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageBufferDataCGh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -31,7 +31,9 @@
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; USE(CA)
</span><ins>+#if !PLATFORM(IOS_SIMULATOR)
</ins><span class="cx"> #define WTF_USE_IOSURFACE_CANVAS_BACKING_STORE 1
</span><ins>+#endif // !PLATFORM(IOS_SIMULATOR)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> typedef struct __IOSurface *IOSurfaceRef;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -32,7 +32,11 @@
</span><span class="cx"> #include &quot;FloatRect.h&quot;
</span><span class="cx"> #include &quot;GraphicsContextCG.h&quot;
</span><span class="cx"> #include &quot;ImageObserver.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -70,7 +74,12 @@
</span><span class="cx"> static void drawPatternCallback(void* info, CGContextRef context)
</span><span class="cx"> {
</span><span class="cx">     CGImageRef image = (CGImageRef)info;
</span><del>-    CGContextDrawImage(context, GraphicsContext(context).roundToDevicePixels(FloatRect(0, 0, CGImageGetWidth(image), CGImageGetHeight(image))), image);
</del><ins>+    CGFloat height = CGImageGetHeight(image);
+#if PLATFORM(IOS)
+    CGContextScaleCTM(context, 1, -1);
+    CGContextTranslateCTM(context, 0, -height);
+#endif
+    CGContextDrawImage(context, GraphicsContext(context).roundToDevicePixels(FloatRect(0, 0, CGImageGetWidth(image), height)), image);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void patternReleaseOnMainThreadCallback(void* info)
</span><span class="lines">@@ -138,6 +147,10 @@
</span><span class="cx">         matrix = CGAffineTransformConcat(matrix, CGContextGetCTM(context));
</span><span class="cx">         // The top of a partially-decoded image is drawn at the bottom of the tile. Map it to the top.
</span><span class="cx">         matrix = CGAffineTransformTranslate(matrix, 0, size().height() - h);
</span><ins>+#if PLATFORM(IOS)
+        matrix = CGAffineTransformScale(matrix, 1, -1);
+        matrix = CGAffineTransformTranslate(matrix, 0, -h);
+#endif
</ins><span class="cx">         CGImageRef platformImage = CGImageRetain(subImage.get());
</span><span class="cx">         RetainPtr&lt;CGPatternRef&gt; pattern = adoptCF(CGPatternCreate(platformImage, CGRectMake(0, 0, tileRect.width(), tileRect.height()), matrix,
</span><span class="cx">             tileRect.width() + spaceSize().width() * (1 / narrowPrecisionToFloat(patternTransform.a())),
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageSourceCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -34,7 +34,15 @@
</span><span class="cx"> #include &quot;IntSize.h&quot;
</span><span class="cx"> #include &quot;MIMETypeRegistry.h&quot;
</span><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CGImagePrivate.h&gt;
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#include &lt;ImageIO/CGImageSourcePrivate.h&gt;
+#include &lt;ImageIO/ImageIO.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -46,6 +54,10 @@
</span><span class="cx"> // that won't conflict with ImageIO's version when it is available.
</span><span class="cx"> const CFStringRef WebCoreCGImagePropertyGIFUnclampedDelayTime = CFSTR(&quot;UnclampedDelayTime&quot;);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool ImageSource::s_acceleratedImageDecoding;
+#endif
+
</ins><span class="cx"> #if !PLATFORM(MAC)
</span><span class="cx"> size_t sharedBufferGetBytesAtPosition(void* info, void* buffer, off_t position, size_t count)
</span><span class="cx"> {
</span><span class="lines">@@ -69,6 +81,10 @@
</span><span class="cx"> 
</span><span class="cx"> ImageSource::ImageSource(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption)
</span><span class="cx">     : m_decoder(0)
</span><ins>+#if PLATFORM(IOS)
+    , m_baseSubsampling(0)
+    , m_isProgressive(false)
+#endif
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: AlphaOption and GammaAndColorProfileOption are ignored.
</span><span class="cx"> }
</span><span class="lines">@@ -94,13 +110,14 @@
</span><span class="cx">         setData(data, allDataReceived);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static CFDictionaryRef imageSourceOptions(ImageSource::ShouldSkipMetadata skipMetadata)
</del><ins>+#if !PLATFORM(IOS)
+static CFDictionaryRef imageSourceOptions(ImageSource::ShouldSkipMetadata skipMetaData)
</ins><span class="cx"> {
</span><span class="cx">     static CFDictionaryRef options;
</span><span class="cx"> 
</span><span class="cx">     if (!options) {
</span><span class="cx">         const unsigned numOptions = 3;
</span><del>-        const CFBooleanRef imageSourceSkipMetadata = (skipMetadata == ImageSource::SkipMetadata) ? kCFBooleanTrue : kCFBooleanFalse;
</del><ins>+        const CFBooleanRef imageSourceSkipMetadata = (skipMetaData == ImageSource::SkipMetadata) ? kCFBooleanTrue : kCFBooleanFalse;
</ins><span class="cx">         const void* keys[numOptions] = { kCGImageSourceShouldCache, kCGImageSourceShouldPreferRGB32, kCGImageSourceSkipMetadata };
</span><span class="cx">         const void* values[numOptions] = { kCFBooleanTrue, kCFBooleanTrue, imageSourceSkipMetadata };
</span><span class="cx">         options = CFDictionaryCreate(NULL, keys, values, numOptions, 
</span><span class="lines">@@ -108,7 +125,26 @@
</span><span class="cx">     }
</span><span class="cx">     return options;
</span><span class="cx"> }
</span><ins>+#else
+CFDictionaryRef ImageSource::imageSourceOptions(ShouldSkipMetadata skipMetaData, int requestedSubsampling) const
+{
+    static CFDictionaryRef options[4] = {nullptr, nullptr, nullptr, nullptr};
+    int subsampling = std::min(3, m_isProgressive || requestedSubsampling &lt; 0 ? 0 : (requestedSubsampling + m_baseSubsampling));
</ins><span class="cx"> 
</span><ins>+    if (!options[subsampling]) {
+        int subsampleInt = 1 &lt;&lt; subsampling; // [0..3] =&gt; [1, 2, 4, 8]
+        RetainPtr&lt;CFNumberRef&gt; subsampleNumber = adoptCF(CFNumberCreate(nullptr,  kCFNumberIntType,  &amp;subsampleInt));
+        const CFIndex numOptions = 5;
+        const CFBooleanRef imageSourceSkipMetaData = (skipMetaData == ImageSource::SkipMetadata) ? kCFBooleanTrue : kCFBooleanFalse;
+        const CFBooleanRef acceleratedImageDecoding = ImageSource::s_acceleratedImageDecoding ? kCFBooleanTrue : kCFBooleanFalse;
+        const void* keys[numOptions] = { kCGImageSourceShouldCache, kCGImageSourceShouldPreferRGB32, kCGImageSourceSubsampleFactor, kCGImageSourceSkipMetadata, kCGImageSourceUseHardwareAcceleration };
+        const void* values[numOptions] = { kCFBooleanTrue, kCFBooleanTrue, subsampleNumber.get(), imageSourceSkipMetaData, acceleratedImageDecoding };
+        options[subsampling] = CFDictionaryCreate(nullptr, keys, values, numOptions, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks);
+    }
+    return options[subsampling];
+}
+#endif
+
</ins><span class="cx"> bool ImageSource::initialized() const
</span><span class="cx"> {
</span><span class="cx">     return m_decoder;
</span><span class="lines">@@ -197,6 +233,38 @@
</span><span class="cx">     if (num)
</span><span class="cx">         CFNumberGetValue(num, kCFNumberIntType, &amp;h);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if (!m_isProgressive) {
+        CFDictionaryRef jfifProperties = static_cast&lt;CFDictionaryRef&gt;(CFDictionaryGetValue(properties.get(), kCGImagePropertyJFIFDictionary));
+        if (jfifProperties) {
+            CFBooleanRef isProgCFBool = static_cast&lt;CFBooleanRef&gt;(CFDictionaryGetValue(jfifProperties, kCGImagePropertyJFIFIsProgressive));
+            if (isProgCFBool)
+                m_isProgressive = CFBooleanGetValue(isProgCFBool);
+            // Workaround for &lt;rdar://problem/5184655&gt; - Hang rendering very large progressive JPEG. Decoding progressive
+            // images hangs for a very long time right now. Until this is fixed, don't sub-sample progressive images. This
+            // will cause them to fail our large image check and they won't be decoded.
+            // FIXME: Remove once underlying issue is fixed (&lt;rdar://problem/5191418&gt;)
+        }
+    }
+
+    if ((m_baseSubsampling == 0) &amp;&amp; !m_isProgressive) {
+        IntSize subsampledSize(w, h);
+        const int cMaximumImageSizeBeforeSubsampling = 5 * 1024 * 1024;
+        while ((m_baseSubsampling &lt; 3) &amp;&amp; subsampledSize.width() * subsampledSize.height() &gt; cMaximumImageSizeBeforeSubsampling) {
+            // We know the size, but the actual image is very large and should be sub-sampled.
+            // Increase the base subsampling and ask for the size again. If the image can be subsampled, the size will be
+            // greatly reduced. 4x sub-sampling will make us support up to 320MP (5MP * 4^3) images, which should be plenty.
+            // There's no callback from ImageIO when the size is available, so we do the check when we happen
+            // to check the size and its non - zero.
+            // Note: Some clients of this class don't call isSizeAvailable() so we can't rely on that.
+            ++m_baseSubsampling;
+            subsampledSize = frameSizeAtIndex(index, description.respectImageOrientation());
+        }
+        w = subsampledSize.width();
+        h = subsampledSize.height();
+    }
+#endif
+
</ins><span class="cx">     if ((description.respectImageOrientation() == RespectImageOrientation) &amp;&amp; orientationFromProperties(properties.get()).usesWidthAsHeight())
</span><span class="cx">         return IntSize(h, w);
</span><span class="cx"> 
</span><span class="lines">@@ -212,6 +280,31 @@
</span><span class="cx">     return orientationFromProperties(properties.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+IntSize ImageSource::originalSize(RespectImageOrientationEnum shouldRespectOrientation) const
+{
+    frameSizeAtIndex(0, shouldRespectOrientation);
+    RetainPtr&lt;CFDictionaryRef&gt; properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_decoder, 0, imageSourceOptions(SkipMetadata, -1)));
+
+    if (!properties)
+        return IntSize();
+
+    int width = 0;
+    int height = 0;
+    CFNumberRef number = (CFNumberRef)CFDictionaryGetValue(properties.get(), kCGImagePropertyPixelWidth);
+    if (number)
+        CFNumberGetValue(number, kCFNumberIntType, &amp;width);
+    number = static_cast&lt;CFNumberRef&gt;(CFDictionaryGetValue(properties.get(), kCGImagePropertyPixelHeight));
+    if (number)
+        CFNumberGetValue(number, kCFNumberIntType, &amp;height);
+
+    if ((shouldRespectOrientation == RespectImageOrientation) &amp;&amp; orientationFromProperties(properties.get()).usesWidthAsHeight())
+        return IntSize(height, width);
+
+    return IntSize(width, height);
+}
+#endif
+
</ins><span class="cx"> IntSize ImageSource::size(ImageOrientationDescription description) const
</span><span class="cx"> {
</span><span class="cx">     return frameSizeAtIndex(0, description);
</span><span class="lines">@@ -286,7 +379,36 @@
</span><span class="cx">     if (!initialized())
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+    UNUSED_PARAM(scale);
</ins><span class="cx">     RetainPtr&lt;CGImageRef&gt; image = adoptCF(CGImageSourceCreateImageAtIndex(m_decoder, index, imageSourceOptions(SkipMetadata)));
</span><ins>+#else
+    // Subsampling can be 1, 2 or 3, which means quarter-, sixteenth- and sixty-fourth-size, respectively.
+    // A zero or negative value means no subsampling.
+    int subsampling = scale ? static_cast&lt;int&gt;(log2f(1.0f / std::max(0.1f, std::min(1.0f, *scale)))) : -1;
+    RetainPtr&lt;CGImageRef&gt; image = adoptCF(CGImageSourceCreateImageAtIndex(m_decoder, index, imageSourceOptions(SkipMetadata, subsampling)));
+
+    // &lt;rdar://problem/7371198&gt; - CoreGraphics changed the default caching behaviour in iOS 4.0 to kCGImageCachingTransient
+    // which caused a performance regression for us since the images had to be resampled/recreated every time we called
+    // CGContextDrawImage. We now tell CG to cache the drawn images. See also &lt;rdar://problem/14366755&gt; -
+    // CoreGraphics needs to un-deprecate kCGImageCachingTemporary since it's still not the default.
+#if COMPILER(CLANG)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+#endif
+    CGImageSetCachingFlags(image.get(), kCGImageCachingTemporary);
+#if COMPILER(CLANG)
+#pragma clang diagnostic pop
+#endif
+    if (scale) {
+        if (subsampling &gt; 0)
+            *scale = static_cast&lt;float&gt;(CGImageGetWidth(image.get())) / size(DoNotRespectImageOrientation).width();
+        else {
+            ASSERT(static_cast&lt;int&gt;(CGImageGetWidth(image.get())) == size(DoNotRespectImageOrientation).width());
+            *scale = 1;
+        }
+    }
+#endif // !PLATFORM(IOS)
</ins><span class="cx">     CFStringRef imageUTI = CGImageSourceGetType(m_decoder);
</span><span class="cx">     static const CFStringRef xbmUTI = CFSTR(&quot;public.xbitmap-image&quot;);
</span><span class="cx">     if (!imageUTI || !CFEqual(imageUTI, xbmUTI))
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgImageSourceCGMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/ImageSourceCGMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/ImageSourceCGMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageSourceCGMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,6 +29,21 @@
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;SoftLinking.h&quot;
+#include &lt;MobileCoreServices/MobileCoreServices.h&gt;
+
+SOFT_LINK_FRAMEWORK(MobileCoreServices)
+
+SOFT_LINK(MobileCoreServices, UTTypeCopyPreferredTagWithClass, CFStringRef, (CFStringRef inUTI, CFStringRef inTagClass), (inUTI, inTagClass))
+
+SOFT_LINK_CONSTANT(MobileCoreServices, kUTTagClassFilenameExtension, CFStringRef)
+SOFT_LINK_CONSTANT(MobileCoreServices, kUTTagClassMIMEType, CFStringRef)
+
+#define kUTTagClassFilenameExtension getkUTTagClassFilenameExtension()
+#define kUTTagClassMIMEType getkUTTagClassMIMEType()
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> String MIMETypeForImageSourceType(const String&amp; uti)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgIntPointCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/IntPointCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/IntPointCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/IntPointCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,7 +28,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgIntRectCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/IntRectCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/IntRectCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/IntRectCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,7 +28,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgIntSizeCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/IntSizeCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/IntSizeCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/IntSizeCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,7 +28,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgPDFDocumentImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,6 +29,13 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &lt;CoreGraphics/CGContextPrivate.h&gt;
+#import &lt;CoreGraphics/CGContextGState.h&gt;
+#import &lt;CoreGraphics/CoreGraphics.h&gt;
+#import &lt;ImageIO/ImageIO.h&gt;
+#endif
+
</ins><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;ImageBuffer.h&quot;
</span><span class="cx"> #include &quot;ImageObserver.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgPathCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/PathCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -34,7 +34,12 @@
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="cx"> #include &quot;StrokeStyleApplier.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CGPathPrivate.h&gt;
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> #include &lt;wtf/MathExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgPatternCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cg/PatternCG.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,7 +29,12 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AffineTransform.h&quot;
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><ins>+
+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontPlatformDataCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -25,7 +25,13 @@
</span><span class="cx"> #import &quot;FontPlatformData.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #import &quot;WebCoreSystemInterface.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #import &lt;AppKit/NSFont.h&gt;
</span><ins>+#else
+#import &lt;CoreText/CoreText.h&gt;
+#import &lt;CoreGraphics/CGFontInfo.h&gt;
+#endif
+
</ins><span class="cx"> #import &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -33,14 +39,15 @@
</span><span class="cx"> // These CoreText Text Spacing feature selectors are not defined in CoreText.
</span><span class="cx"> enum TextSpacingCTFeatureSelector { TextSpacingProportional, TextSpacingFullWidth, TextSpacingHalfWidth, TextSpacingThirdWidth, TextSpacingQuarterWidth };
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> void FontPlatformData::loadFont(NSFont* nsFont, float, NSFont*&amp; outNSFont, CGFontRef&amp; cgFont)
</span><span class="cx"> {
</span><span class="cx">     outNSFont = nsFont;
</span><span class="cx">     cgFont = CTFontCopyGraphicsFont(toCTFontRef(nsFont), 0);
</span><span class="cx"> }
</span><del>-#endif  // PLATFORM(MAC)
</del><ins>+#endif  // PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool isPrinterFont, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
</span><span class="cx">     : m_syntheticBold(syntheticBold)
</span><span class="cx">     , m_syntheticOblique(syntheticOblique)
</span><span class="lines">@@ -49,9 +56,22 @@
</span><span class="cx">     , m_widthVariant(widthVariant)
</span><span class="cx">     , m_font(nsFont)
</span><span class="cx">     , m_isColorBitmapFont(false)
</span><ins>+#else
+FontPlatformData::FontPlatformData(CTFontRef ctFont, float size, bool isPrinterFont, bool syntheticBold, bool syntheticOblique, FontOrientation orientation, FontWidthVariant widthVariant)
+    : m_syntheticBold(syntheticBold)
+    , m_syntheticOblique(syntheticOblique)
+    , m_orientation(orientation)
+    , m_isEmoji(false)
+    , m_size(size)
+    , m_widthVariant(widthVariant)
+    , m_font(ctFont)
+    , m_cgFont(adoptCF(CTFontCopyGraphicsFont(ctFont, NULL)))
+    , m_isColorBitmapFont(CTFontGetSymbolicTraits(ctFont) &amp; kCTFontTraitColorGlyphs)
+#endif // !PLATFORM(IOS)
</ins><span class="cx">     , m_isCompositeFontReference(false)
</span><span class="cx">     , m_isPrinterFont(isPrinterFont)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     ASSERT_ARG(nsFont, nsFont);
</span><span class="cx"> 
</span><span class="cx">     CGFontRef cgFont = 0;
</span><span class="lines">@@ -68,18 +88,35 @@
</span><span class="cx">         CFRetain(m_font);
</span><span class="cx"> 
</span><span class="cx">     m_cgFont = adoptCF(cgFont);
</span><ins>+#else
+    ASSERT_ARG(ctFont, ctFont);
+
+    CFRetain(ctFont);
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-FontPlatformData:: ~FontPlatformData()
</del><ins>+FontPlatformData::~FontPlatformData()
</ins><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (m_font &amp;&amp; m_font != reinterpret_cast&lt;NSFont *&gt;(-1))
</span><span class="cx">         CFRelease(m_font);
</span><ins>+#else
+    if (m_font &amp;&amp; m_font != reinterpret_cast&lt;CTFontRef&gt;(-1))
+        CFRelease(m_font);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FontPlatformData::platformDataInit(const FontPlatformData&amp; f)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     m_font = f.m_font &amp;&amp; f.m_font != reinterpret_cast&lt;NSFont *&gt;(-1) ? const_cast&lt;NSFont *&gt;(static_cast&lt;const NSFont *&gt;(CFRetain(f.m_font))) : f.m_font;
</span><ins>+#else
+    m_font = f.m_font &amp;&amp; f.m_font != reinterpret_cast&lt;CTFontRef&gt;(-1) ? static_cast&lt;CTFontRef&gt;(const_cast&lt;void *&gt;(CFRetain(f.m_font))) : f.m_font;
+#endif
</ins><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    m_isEmoji = f.m_isEmoji;
+#endif
</ins><span class="cx">     m_cgFont = f.m_cgFont;
</span><span class="cx">     m_CTFont = f.m_CTFont;
</span><span class="cx"> }
</span><span class="lines">@@ -87,12 +124,24 @@
</span><span class="cx"> const FontPlatformData&amp; FontPlatformData::platformDataAssign(const FontPlatformData&amp; f)
</span><span class="cx"> {
</span><span class="cx">     m_cgFont = f.m_cgFont;
</span><ins>+#if PLATFORM(IOS)
+    m_isEmoji = f.m_isEmoji;
+#endif
+#if !PLATFORM(IOS)
</ins><span class="cx">     if (m_font == f.m_font)
</span><span class="cx">         return *this;
</span><span class="cx">     if (f.m_font &amp;&amp; f.m_font != reinterpret_cast&lt;NSFont *&gt;(-1))
</span><span class="cx">         CFRetain(f.m_font);
</span><span class="cx">     if (m_font &amp;&amp; m_font != reinterpret_cast&lt;NSFont *&gt;(-1))
</span><span class="cx">         CFRelease(m_font);
</span><ins>+#else
+    if (m_font &amp;&amp; m_font != reinterpret_cast&lt;CTFontRef&gt;(-1) &amp;&amp; f.m_font &amp;&amp; f.m_font != reinterpret_cast&lt;CTFontRef&gt;(-1) &amp;&amp; CFEqual(m_font, f.m_font))
+        return *this;
+    if (f.m_font &amp;&amp; f.m_font != reinterpret_cast&lt;CTFontRef&gt;(-1))
+        CFRetain(f.m_font);
+    if (m_font &amp;&amp; m_font != reinterpret_cast&lt;CTFontRef&gt;(-1))
+        CFRelease(m_font);
+#endif
</ins><span class="cx">     m_font = f.m_font;
</span><span class="cx">     m_CTFont = f.m_CTFont;
</span><span class="cx">     return *this;
</span><span class="lines">@@ -100,11 +149,29 @@
</span><span class="cx"> 
</span><span class="cx"> bool FontPlatformData::platformIsEqual(const FontPlatformData&amp; other) const
</span><span class="cx"> {
</span><del>-    if (m_font || other.m_font)
-        return m_font == other.m_font;
</del><ins>+    bool result = false;
+    if (m_font || other.m_font) {
+#if PLATFORM(IOS)
+        result = m_font &amp;&amp; m_font != reinterpret_cast&lt;CTFontRef&gt;(-1) &amp;&amp; other.m_font &amp;&amp; other.m_font != reinterpret_cast&lt;CTFontRef&gt;(-1) &amp;&amp; CFEqual(m_font, other.m_font);
+#if !ASSERT_DISABLED
+        if (result)
+            ASSERT(m_isEmoji == other.m_isEmoji);
+#endif
+#else
+        result = m_font == other.m_font;
+#endif // PLATFORM(IOS)
+        return result;
+    }
+#if PLATFORM(IOS)
+#if !ASSERT_DISABLED
+    if (m_cgFont == other.m_cgFont)
+        ASSERT(m_isEmoji == other.m_isEmoji);
+#endif
+#endif // PLATFORM(IOS)
</ins><span class="cx">     return m_cgFont == other.m_cgFont;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> void FontPlatformData::setFont(NSFont *font)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_ARG(font, font);
</span><span class="lines">@@ -133,15 +200,43 @@
</span><span class="cx">     }
</span><span class="cx">     m_CTFont = 0;
</span><span class="cx"> }
</span><ins>+#else
+void FontPlatformData::setFont(CTFontRef font)
+{
+    ASSERT_ARG(font, font);
+    ASSERT(m_font != reinterpret_cast&lt;CTFontRef&gt;(-1));
</ins><span class="cx"> 
</span><ins>+    if (m_font == font)
+        return;
+
+    CFRetain(font);
+    if (m_font)
+        CFRelease(m_font);
+    m_font = font;
+    m_size = CTFontGetSize(font);
+    m_cgFont = adoptCF(CTFontCopyGraphicsFont(font, nullptr));
+    m_isColorBitmapFont = CTFontGetSymbolicTraits(font) &amp; kCTFontTraitColorGlyphs;
+}
+#endif
+
+#if !PLATFORM(IOS)
</ins><span class="cx"> bool FontPlatformData::roundsGlyphAdvances() const
</span><span class="cx"> {
</span><span class="cx">     return [m_font renderingMode] == NSFontAntialiasedIntegerAdvancementsRenderingMode;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> bool FontPlatformData::allowsLigatures() const
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     return ![[m_font coveredCharacterSet] characterIsMember:'a'];
</span><ins>+#else
+    if (!m_font)
+        return false;
+
+    RetainPtr&lt;CFCharacterSetRef&gt; characterSet = adoptCF(CTFontCopyCharacterSet(ctFont()));
+    return !(characterSet.get() &amp;&amp; CFCharacterSetIsCharacterMember(characterSet.get(), 'a'));
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline int mapFontWidthVariantToCTFeatureSelector(FontWidthVariant variant)
</span><span class="lines">@@ -217,6 +312,7 @@
</span><span class="cx">     if (m_CTFont)
</span><span class="cx">         return m_CTFont.get();
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     m_CTFont = toCTFontRef(m_font);
</span><span class="cx">     if (m_CTFont) {
</span><span class="cx">         CTFontDescriptorRef fontDescriptor;
</span><span class="lines">@@ -229,6 +325,17 @@
</span><span class="cx">         m_CTFont = adoptCF(CTFontCreateCopyWithAttributes(m_CTFont.get(), m_size, 0, fontDescriptor));
</span><span class="cx">     } else
</span><span class="cx">         m_CTFont = adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), m_size, 0, cascadeToLastResortFontDescriptor()));
</span><ins>+#else
+    // Apple Color Emoji size is adjusted (and then re-adjusted by Core Text) and capped.
+    CGFloat size = !m_isEmoji ? m_size : m_size &lt;= 15 ? 4 * (m_size + 2) / static_cast&lt;CGFloat&gt;(5) : 16;
+    CTFontDescriptorRef fontDescriptor;
+    const char* postScriptName = CGFontGetPostScriptName(m_cgFont.get());
+    if (postScriptName &amp;&amp; (!strcmp(postScriptName, &quot;HoeflerText-Italic&quot;) || !strcmp(postScriptName, &quot;HoeflerText-BlackItalic&quot;)))
+        fontDescriptor = cascadeToLastResortAndDisableSwashesFontDescriptor();
+    else
+        fontDescriptor = cascadeToLastResortFontDescriptor();
+    m_CTFont = adoptCF(CTFontCreateWithGraphicsFont(m_cgFont.get(), size, 0, fontDescriptor));
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx">     if (m_widthVariant != RegularWidth) {
</span><span class="cx">         int featureTypeValue = kTextSpacingType;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosDisplayRefreshMonitorIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,123 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
+
+#include &quot;DisplayRefreshMonitor.h&quot;
+
+#include &lt;QuartzCore/QuartzCore.h&gt;
+#include &lt;wtf/CurrentTime.h&gt;
+#include &lt;wtf/MainThread.h&gt;
+
+#import &quot;WebCoreThread.h&quot;
+
+@interface WebDisplayLinkHandler : NSObject
+{
+    WebCore::DisplayRefreshMonitor* m_monitor;
+    CADisplayLink* m_displayLink;
+}
+
+- (id)initWithMonitor:(WebCore::DisplayRefreshMonitor*)monitor;
+- (void)handleDisplayLink:(CADisplayLink *)sender;
+- (void)invalidate;
+
+@end
+
+static double mediaTimeToCurrentTime(CFTimeInterval t)
+{
+    return monotonicallyIncreasingTime() + t - CACurrentMediaTime();
+}
+
+@implementation WebDisplayLinkHandler
+
+- (id)initWithMonitor:(WebCore::DisplayRefreshMonitor*)monitor
+{
+    if (self = [super init]) {
+        m_monitor = monitor;
+        // Note that CADisplayLink retains its target (self), so a call to -invalidate is needed on teardown.
+        m_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(handleDisplayLink:)];
+        [m_displayLink addToRunLoop:WebThreadNSRunLoop() forMode:NSDefaultRunLoopMode];
+    }
+    return self;
+}
+
+- (void)dealloc
+{
+    ASSERT(!m_displayLink); // -invalidate should have been called already.
+    [super dealloc];
+}
+
+- (void)handleDisplayLink:(CADisplayLink *)sender
+{
+    ASSERT(WebThreadIsCurrent());
+    m_monitor-&gt;displayLinkFired(sender.timestamp);
+}
+
+- (void)invalidate
+{
+    [m_displayLink invalidate];
+    m_displayLink = nullptr;
+}
+
+@end
+
+namespace WebCore {

+DisplayRefreshMonitor::~DisplayRefreshMonitor()
+{
+    [(WebDisplayLinkHandler*) m_displayLink invalidate];
+    [(WebDisplayLinkHandler*) m_displayLink release];
+}
+
+bool DisplayRefreshMonitor::requestRefreshCallback()
+{
+    if (!m_active)
+        return false;
+        
+    if (!m_displayLink) {
+        m_displayLink = [[WebDisplayLinkHandler alloc] initWithMonitor:this];
+        m_active = true;
+    }
+
+    m_scheduled = true;
+    return true;
+}
+
+void DisplayRefreshMonitor::displayLinkFired(double nowSeconds)
+{
+    if (!m_previousFrameDone)
+        return;
+
+    m_previousFrameDone = false;
+    m_monotonicAnimationStartTime = mediaTimeToCurrentTime(nowSeconds);
+
+    handleDisplayRefreshedNotificationOnMainThread(this);
+}
+
+}
+
+#endif // USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosFontCacheIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,662 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;FontCache.h&quot;
+
+#import &quot;Font.h&quot;
+#import &quot;RenderThemeIOS.h&quot;
+#import &lt;CoreGraphics/CGFontUnicodeSupport.h&gt;
+#import &lt;CoreText/CTFontDescriptorPriv.h&gt;
+#import &lt;CoreText/CTFontPriv.h&gt;
+#import &lt;wtf/NeverDestroyed.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+#import &lt;wtf/text/CString.h&gt;
+
+namespace WebCore {
+
+void FontCache::platformInit()
+{
+    wkSetUpFontCache();
+}
+
+static inline bool isFontWeightBold(NSInteger fontWeight)
+{
+    return fontWeight &gt;= FontWeight600;
+}
+
+static inline bool requiresCustomFallbackFont(const UInt32 character)
+{
+    return character == AppleLogo || character == blackCircle;
+}
+
+static CFCharacterSetRef copyFontCharacterSet(CFStringRef fontName)
+{
+    // The size, 10, is arbitrary.
+    RetainPtr&lt;CTFontDescriptorRef&gt; fontDescriptor = adoptCF(CTFontDescriptorCreateWithNameAndSize(fontName, 10));
+    RetainPtr&lt;CTFontRef&gt; font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), 10, nullptr));
+    return (CFCharacterSetRef)CTFontDescriptorCopyAttribute(fontDescriptor.get(), kCTFontCharacterSetAttribute);
+}
+
+static CFCharacterSetRef appleColorEmojiCharacterSet()
+{
+    static CFCharacterSetRef characterSet = copyFontCharacterSet(CFSTR(&quot;AppleColorEmoji&quot;));
+    return characterSet;
+}
+
+static CFCharacterSetRef phoneFallbackCharacterSet()
+{
+    static CFCharacterSetRef characterSet = copyFontCharacterSet(CFSTR(&quot;.PhoneFallback&quot;));
+    return characterSet;
+}
+
+PassRefPtr&lt;SimpleFontData&gt; FontCache::getSystemFontFallbackForCharacters(const FontDescription&amp; description, const SimpleFontData* originalFontData, const UChar* characters, int length)
+{
+    const FontPlatformData&amp; platformData = originalFontData-&gt;platformData();
+    CTFontRef ctFont = platformData.font();
+
+    CFIndex coveredLength = 0;
+    RetainPtr&lt;CTFontRef&gt; substituteFont = adoptCF(CTFontCreatePhysicalFontForCharactersWithLanguage(ctFont, (const UTF16Char*)characters, (CFIndex)length, 0, &amp;coveredLength));
+    if (!substituteFont)
+        return 0;
+
+    CTFontSymbolicTraits originalTraits = CTFontGetSymbolicTraits(ctFont);
+    CTFontSymbolicTraits actualTraits = 0;
+    if (isFontWeightBold(description.weight()) || description.italic())
+        actualTraits = CTFontGetSymbolicTraits(substituteFont.get());
+
+    bool syntheticBold = (originalTraits &amp; kCTFontTraitBold) &amp;&amp; !(actualTraits &amp; kCTFontTraitBold);
+    bool syntheticOblique = (originalTraits &amp; kCTFontTraitItalic) &amp;&amp; !(actualTraits &amp; kCTFontTraitItalic);
+
+    FontPlatformData alternateFont(substituteFont.get(), platformData.size(), platformData.isPrinterFont(), syntheticBold, syntheticOblique, platformData.m_orientation);
+    alternateFont.m_isEmoji = CTFontIsAppleColorEmoji(substituteFont.get());
+
+    return getCachedFontData(&amp;alternateFont, DoNotRetain);
+}
+
+PassRefPtr&lt;SimpleFontData&gt; FontCache::systemFallbackForCharacters(const FontDescription&amp; description, const SimpleFontData* originalFontData, bool, const UChar* characters, int length)
+{
+    static bool isGB18030ComplianceRequired = wkIsGB18030ComplianceRequired();
+
+    // Unlike OS X, our fallback font on iPhone is Arial Unicode, which doesn't have some apple-specific glyphs like F8FF.
+    // Fall back to the Apple Fallback font in this case.
+    if (length &gt; 0 &amp;&amp; requiresCustomFallbackFont(*characters))
+        return getCachedFontData(getCustomFallbackFont(*characters, description), DoNotRetain);
+
+    UChar32 c = *characters;
+    if (length &gt; 1 &amp;&amp; U16_IS_LEAD(c) &amp;&amp; U16_IS_TRAIL(characters[1]))
+        c = U16_GET_SUPPLEMENTARY(c, characters[1]);
+
+    // For system fonts we use CoreText fallback mechanism.
+    if (length) {
+        RetainPtr&lt;CTFontDescriptorRef&gt; fontDescriptor = adoptCF(CTFontCopyFontDescriptor(originalFontData-&gt;getCTFont()));
+        if (CTFontDescriptorIsSystemUIFont(fontDescriptor.get()))
+            return getSystemFontFallbackForCharacters(description, originalFontData, characters, length);
+    }
+
+    bool useCJFont = false;
+    bool useKoreanFont = false;
+    bool useCyrillicFont = false;
+    bool useArabicFont = false;
+    bool useHebrewFont = false;
+    bool useIndicFont = false;
+    bool useThaiFont = false;
+    bool useTibetanFont = false;
+    bool useCanadianAboriginalSyllabicsFont = false;
+    bool useEmojiFont = false;
+    if (length &gt; 0) {
+        do {
+            // This isn't a loop but a way to efficiently check for ranges of characters.
+
+            // The following ranges are Korean Hangul and should be rendered by AppleSDGothicNeo
+            // U+1100 - U+11FF
+            // U+3130 - U+318F
+            // U+AC00 - U+D7A3
+
+            // These are Cyrillic and should be rendered by Helvetica Neue
+            // U+0400 - U+052F
+
+            if (c &lt; 0x400)
+                break;
+            if (c &lt;= 0x52F) {
+                useCyrillicFont = true;
+                break;
+            }
+            if (c &lt; 0x590)
+                break;
+            if (c &lt; 0x600) {
+                useHebrewFont = true;
+                break;
+            }
+            if (c &lt;= 0x6FF) {
+                useArabicFont = true;
+                break;
+            }
+            if (c &lt; 0x900)
+                break;
+            if (c &lt; 0xE00) {
+                useIndicFont = true;
+                break;
+            }
+            if (c &lt;= 0xE7F) {
+                useThaiFont = true;
+                break;
+            }
+            if (c &lt; 0x0F00)
+                break;
+            if (c &lt;= 0x0FFF) {
+                useTibetanFont = true;
+                break;
+            }
+            if (c &lt; 0x1100)
+                break;
+            if (c &lt;= 0x11FF) {
+                useKoreanFont = true;
+                break;
+            }
+            if (c &gt; 0x1400 &amp;&amp; c &lt; 0x1780) {
+                useCanadianAboriginalSyllabicsFont = true;
+                break;
+            }
+            if (c &lt; 0x2E80)
+                break;
+            if (c &lt; 0x3130) {
+                useCJFont = true;
+                break;
+            }
+            if (c &lt;= 0x318F) {
+                useKoreanFont = true;
+                break;
+            }
+            if (c &lt; 0xAC00) {
+                useCJFont = true;
+                break;
+            }
+            if (c &lt;= 0xD7A3) {
+                useKoreanFont = true;
+                break;
+            }
+            if ( c &lt;= 0xDFFF) {
+                useCJFont = true;
+                break;
+            }
+            if ( c &lt; 0xE000)
+                break;
+            if ( c &lt; 0xE600) {
+                if (isGB18030ComplianceRequired)
+                    useCJFont = true;
+                else
+                    useEmojiFont = true;
+                break;
+            }
+            if ( c &lt;= 0xE864 &amp;&amp; isGB18030ComplianceRequired) {
+                useCJFont = true;
+                break;
+            }
+            if (c &lt;= 0xF8FF)
+                break;
+            if (c &lt; 0xFB00) {
+                useCJFont = true;
+                break;
+            }
+            if (c &lt; 0xFB50)
+                break;
+            if (c &lt;= 0xFDFF) {
+                useArabicFont = true;
+                break;
+            }
+            if (c &lt; 0xFE20)
+                break;
+            if (c &lt; 0xFE70) {
+                useCJFont = true;
+                break;
+            }
+            if (c &lt; 0xFF00) {
+                useArabicFont = true;
+                break;
+            }
+            if (c &lt; 0xFFF0) {
+                useCJFont = true;
+                break;
+            }
+            if (c &gt;=0x20000 &amp;&amp; c &lt;= 0x2FFFF)
+                useCJFont = true;
+        } while (0);
+    }
+
+    RefPtr&lt;SimpleFontData&gt; simpleFontData;
+
+    if (useCJFont) {
+        // By default, Chinese font is preferred, fall back on Japanese.
+
+        enum CJKFontVariant {
+            kCJKFontUseHiragino = 0,
+            kCJKFontUseSTHeitiSC,
+            kCJKFontUseSTHeitiTC,
+            kCJKFontUseSTHeitiJ,
+            kCJKFontUseSTHeitiK,
+            kCJKFontsUseHKGPW3UI
+        };
+
+        static NeverDestroyed&lt;AtomicString&gt; plainHiragino(&quot;HiraKakuProN-W3&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; plainSTHeitiSC(&quot;STHeitiSC-Light&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; plainSTHeitiTC(&quot;STHeitiTC-Light&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; plainSTHeitiJ(&quot;STHeitiJ-Light&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; plainSTHeitiK(&quot;STHeitiK-Light&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; plainHKGPW3UI(&quot;HKGPW3UI&quot;, AtomicString::ConstructFromLiteral);
+        static AtomicString* cjkPlain[] = {     
+            &amp;plainHiragino.get(),
+            &amp;plainSTHeitiSC.get(),
+            &amp;plainSTHeitiTC.get(),
+            &amp;plainSTHeitiJ.get(),
+            &amp;plainSTHeitiK.get(),
+            &amp;plainHKGPW3UI.get(),
+        };
+
+        static NeverDestroyed&lt;AtomicString&gt; boldHiragino(&quot;HiraKakuProN-W6&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; boldSTHeitiSC(&quot;STHeitiSC-Medium&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; boldSTHeitiTC(&quot;STHeitiTC-Medium&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; boldSTHeitiJ(&quot;STHeitiJ-Medium&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; boldSTHeitiK(&quot;STHeitiK-Medium&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; boldHKGPW3UI(&quot;HKGPW3UI&quot;, AtomicString::ConstructFromLiteral);
+        static AtomicString* cjkBold[] = {  
+            &amp;boldHiragino.get(),
+            &amp;boldSTHeitiSC.get(),
+            &amp;boldSTHeitiTC.get(),
+            &amp;boldSTHeitiJ.get(),
+            &amp;boldSTHeitiK.get(),
+            &amp;boldHKGPW3UI.get(),
+        };
+
+        // Default below is for Simplified Chinese user: zh-Hans - note that Hiragino is the
+        // the secondary font as we want its for Hiragana and Katakana. The other CJK fonts
+        // do not, and should not, contain Hiragana or Katakana glyphs.
+        static CJKFontVariant preferredCJKFont = kCJKFontUseSTHeitiSC;
+        static CJKFontVariant secondaryCJKFont = kCJKFontsUseHKGPW3UI;
+
+        static bool CJKFontInitialized;
+        if (!CJKFontInitialized) {
+            CJKFontInitialized = true;
+            // Testing: languageName = (CFStringRef)@&quot;ja&quot;;
+            NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+            NSArray *languages = [defaults stringArrayForKey:@&quot;AppleLanguages&quot;];
+
+            if (languages) {
+                for (NSString *language in languages) {
+                    RetainPtr&lt;CFStringRef&gt; languageName = adoptCF(CFLocaleCreateCanonicalLanguageIdentifierFromString(nullptr, (CFStringRef)language));
+                    if (CFEqual(languageName.get(), CFSTR(&quot;zh-Hans&quot;)))
+                        break; // Simplified Chinese - default settings
+                    else if (CFEqual(languageName.get(), CFSTR(&quot;ja&quot;))) {
+                        preferredCJKFont = kCJKFontUseHiragino; // Japanese - prefer Hiragino and STHeiti Japanse Variant
+                        secondaryCJKFont = kCJKFontUseSTHeitiJ;
+                        break;
+                    } else if (CFEqual(languageName.get(), CFSTR(&quot;ko&quot;))) {
+                        preferredCJKFont = kCJKFontUseSTHeitiK; // Korean - prefer STHeiti Korean Variant 
+                        break;
+                    } else if (CFEqual(languageName.get(), CFSTR(&quot;zh-Hant&quot;))) {
+                        preferredCJKFont = kCJKFontUseSTHeitiTC; // Traditional Chinese - prefer STHeiti Traditional Variant
+                        break;
+                    }
+                }
+            }
+        }
+
+        simpleFontData = getCachedFontData(description, isFontWeightBold(description.weight()) ? *cjkBold[preferredCJKFont] : *cjkPlain[preferredCJKFont], false, DoNotRetain);
+        bool useSecondaryFont = true;
+        if (simpleFontData) {
+            CGGlyph glyphs[2];
+            // CGFontGetGlyphsForUnichars takes UTF-16 buffer. Should only be 1 codepoint but since we may pass in two UTF-16 characters,
+            // make room for 2 glyphs just to be safe.
+            CGFontGetGlyphsForUnichars(simpleFontData-&gt;platformData().cgFont(), characters, glyphs, length);
+
+            useSecondaryFont = (glyphs[0] == 0);
+        }
+
+        if (useSecondaryFont)
+            simpleFontData = getCachedFontData(description, isFontWeightBold(description.weight()) ? *cjkBold[secondaryCJKFont] : *cjkPlain[secondaryCJKFont], false, DoNotRetain);
+    } else if (useKoreanFont) {
+        static NeverDestroyed&lt;AtomicString&gt; koreanPlain(&quot;AppleSDGothicNeo-Medium&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; koreanBold(&quot;AppleSDGothicNeo-Bold&quot;, AtomicString::ConstructFromLiteral);
+        simpleFontData = getCachedFontData(description, isFontWeightBold(description.weight()) ? koreanBold : koreanPlain, false, DoNotRetain);
+    } else if (useCyrillicFont) {
+        static NeverDestroyed&lt;AtomicString&gt; cyrillicPlain(&quot;HelveticaNeue&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; cyrillicBold(&quot;HelveticaNeue-Bold&quot;, AtomicString::ConstructFromLiteral);
+        simpleFontData = getCachedFontData(description, isFontWeightBold(description.weight()) ? cyrillicBold : cyrillicPlain, false, DoNotRetain);
+    } else if (useArabicFont) {
+        static NeverDestroyed&lt;AtomicString&gt; arabicPlain(&quot;GeezaPro&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; arabicBold(&quot;GeezaPro-Bold&quot;, AtomicString::ConstructFromLiteral);
+        simpleFontData = getCachedFontData(description, isFontWeightBold(description.weight()) ? arabicBold : arabicPlain, false, DoNotRetain);
+    } else if (useHebrewFont) {
+        static NeverDestroyed&lt;AtomicString&gt; hebrewPlain(&quot;ArialHebrew&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; hebrewBold(&quot;ArialHebrew-Bold&quot;, AtomicString::ConstructFromLiteral);
+        simpleFontData = getCachedFontData(description, isFontWeightBold(description.weight()) ? hebrewBold : hebrewPlain, false, DoNotRetain);
+    } else if (useIndicFont) {
+        static NeverDestroyed&lt;AtomicString&gt; devanagariFont(&quot;DevanagariSangamMN&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; bengaliFont(&quot;BanglaSangamMN&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; gurmukhiFont(&quot;GurmukhiMN&quot;, AtomicString::ConstructFromLiteral); // Might be replaced in a future release with a Sangam version.
+        static NeverDestroyed&lt;AtomicString&gt; gujaratiFont(&quot;GujaratiSangamMN&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; oriyaFont(&quot;OriyaSangamMN&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; tamilFont(&quot;TamilSangamMN&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; teluguFont(&quot;TeluguSangamMN&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; kannadaFont(&quot;KannadaSangamMN&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; malayalamFont(&quot;MalayalamSangamMN&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; sinhalaFont(&quot;SinhalaSangamMN&quot;, AtomicString::ConstructFromLiteral);
+
+        static NeverDestroyed&lt;AtomicString&gt; devanagariFontBold(&quot;DevanagariSangamMN-Bold&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; bengaliFontBold(&quot;BanglaSangamMN-Bold&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; gurmukhiFontBold(&quot;GurmukhiMN-Bold&quot;, AtomicString::ConstructFromLiteral); // Might be replaced in a future release with a Sangam version.
+        static NeverDestroyed&lt;AtomicString&gt; gujaratiFontBold(&quot;GujaratiSangamMN-Bold&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; oriyaFontBold(&quot;OriyaSangamMN-Bold&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; tamilFontBold(&quot;TamilSangamMN-Bold&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; teluguFontBold(&quot;TeluguSangamMN-Bold&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; kannadaFontBold(&quot;KannadaSangamMN-Bold&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; malayalamFontBold(&quot;MalayalamSangamMN-Bold&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; sinhalaFontBold(&quot;SinhalaSangamMN-Bold&quot;, AtomicString::ConstructFromLiteral);
+
+        static AtomicString* indicUnicodePageFonts[] = {
+            &amp;devanagariFont.get(),
+            &amp;bengaliFont.get(),
+            &amp;gurmukhiFont.get(),
+            &amp;gujaratiFont.get(),
+            &amp;oriyaFont.get(),
+            &amp;tamilFont.get(),
+            &amp;teluguFont.get(),
+            &amp;kannadaFont.get(),
+            &amp;malayalamFont.get(),
+            &amp;sinhalaFont.get()
+        };
+
+        static AtomicString* indicUnicodePageFontsBold[] = {
+            &amp;devanagariFontBold.get(),
+            &amp;bengaliFontBold.get(),
+            &amp;gurmukhiFontBold.get(),
+            &amp;gujaratiFontBold.get(),
+            &amp;oriyaFontBold.get(),
+            &amp;tamilFontBold.get(),
+            &amp;teluguFontBold.get(),
+            &amp;kannadaFontBold.get(),
+            &amp;malayalamFontBold.get(),
+            &amp;sinhalaFontBold.get()
+        };
+
+        uint32_t indicPageOrderIndex = (c - 0x0900) / 0x0080; // Indic scripts start at 0x0900 in Unicode. Each script is allocalted a block of 0x80 characters.
+        if (indicPageOrderIndex &lt; (sizeof(indicUnicodePageFonts) / sizeof(AtomicString*))) {
+            AtomicString* indicFontString = isFontWeightBold(description.weight()) ? indicUnicodePageFontsBold[indicPageOrderIndex] : indicUnicodePageFonts[indicPageOrderIndex];
+            if (indicFontString)
+                simpleFontData = getCachedFontData(description, *indicFontString, false, DoNotRetain);
+        }
+    } else if (useThaiFont) {
+        static NeverDestroyed&lt;AtomicString&gt; thaiPlain(&quot;Thonburi&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; thaiBold(&quot;Thonburi-Bold&quot;, AtomicString::ConstructFromLiteral);
+        simpleFontData = getCachedFontData(description, isFontWeightBold(description.weight()) ? thaiBold : thaiPlain, false, DoNotRetain);
+    } else if (useTibetanFont) {
+        static NeverDestroyed&lt;AtomicString&gt; tibetanPlain(&quot;Kailasa&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; tibetanBold(&quot;Kailasa-Bold&quot;, AtomicString::ConstructFromLiteral);
+        simpleFontData = getCachedFontData(description, isFontWeightBold(description.weight()) ? tibetanBold : tibetanPlain, false, DoNotRetain);
+    } else if (useCanadianAboriginalSyllabicsFont) {
+        static NeverDestroyed&lt;AtomicString&gt; casPlain(&quot;EuphemiaUCAS&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; casBold(&quot;EuphemiaUCAS-Bold&quot;, AtomicString::ConstructFromLiteral);
+        simpleFontData = getCachedFontData(description, isFontWeightBold(description.weight()) ? casBold : casPlain, false, DoNotRetain);
+    } else {
+        static NeverDestroyed&lt;AtomicString&gt; appleColorEmoji(&quot;AppleColorEmoji&quot;, AtomicString::ConstructFromLiteral);
+        if (!useEmojiFont) {
+            if (!CFCharacterSetIsLongCharacterMember(phoneFallbackCharacterSet(), c))
+                useEmojiFont = CFCharacterSetIsLongCharacterMember(appleColorEmojiCharacterSet(), c);
+        }
+        if (useEmojiFont)
+            simpleFontData = getCachedFontData(description, appleColorEmoji, false, DoNotRetain);
+    }
+
+    if (simpleFontData)
+        return simpleFontData.release();
+
+    return getNonRetainedLastResortFallbackFont(description);
+}
+
+PassRefPtr&lt;SimpleFontData&gt; FontCache::similarFontPlatformData(const FontDescription&amp; description)
+{
+    // Attempt to find an appropriate font using a match based on the presence of keywords in
+    // the requested names. For example, we'll match any name that contains &quot;Arabic&quot; to Geeza Pro.
+    RefPtr&lt;SimpleFontData&gt; simpleFontData;
+    for (unsigned i = 0; i &lt; description.familyCount(); ++i) {
+        const AtomicString&amp; family = description.familyAt(i);
+        if (family.isEmpty())
+            continue;
+
+        // Substitute the default monospace font for well-known monospace fonts.
+        static NeverDestroyed&lt;AtomicString&gt; monaco(&quot;monaco&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; menlo(&quot;menlo&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; courier(&quot;courier&quot;, AtomicString::ConstructFromLiteral);
+        if (equalIgnoringCase(family, monaco) || equalIgnoringCase(family, menlo)) {
+            simpleFontData = getCachedFontData(description, courier);
+            continue;
+        }
+
+        // Substitute Verdana for Lucida Grande.
+        static NeverDestroyed&lt;AtomicString&gt; lucidaGrande(&quot;lucida grande&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; verdana(&quot;verdana&quot;, AtomicString::ConstructFromLiteral);
+        if (equalIgnoringCase(family, lucidaGrande)) {
+            simpleFontData = getCachedFontData(description, verdana);
+            continue;
+        }
+
+        static NeverDestroyed&lt;String&gt; arabic(ASCIILiteral(&quot;Arabic&quot;));
+        static NeverDestroyed&lt;String&gt; pashto(ASCIILiteral(&quot;Pashto&quot;));
+        static NeverDestroyed&lt;String&gt; urdu(ASCIILiteral(&quot;Urdu&quot;));
+        static String* matchWords[3] = { &amp;arabic.get(), &amp;pashto.get(), &amp;urdu.get() };
+        static NeverDestroyed&lt;AtomicString&gt; geezaPlain(&quot;GeezaPro&quot;, AtomicString::ConstructFromLiteral);
+        static NeverDestroyed&lt;AtomicString&gt; geezaBold(&quot;GeezaPro-Bold&quot;, AtomicString::ConstructFromLiteral);
+        for (int j = 0; j &lt; 3 &amp;&amp; !simpleFontData; ++j)
+            if (family.contains(*matchWords[j], false))
+                simpleFontData = getCachedFontData(description, isFontWeightBold(description.weight()) ? geezaBold : geezaPlain);
+    }
+
+    return simpleFontData.release();
+}
+
+PassRefPtr&lt;SimpleFontData&gt; FontCache::getLastResortFallbackFont(const FontDescription&amp; fontDescription, ShouldRetain shouldRetain)
+{
+    static NeverDestroyed&lt;AtomicString&gt; fallbackFontFamily(&quot;.PhoneFallback&quot;, AtomicString::ConstructFromLiteral);
+    return getCachedFontData(fontDescription, fallbackFontFamily, false, shouldRetain);
+}
+
+FontPlatformData* FontCache::getCustomFallbackFont(const UInt32 c, const FontDescription&amp; description)
+{
+    ASSERT(requiresCustomFallbackFont(c));
+    if (c == AppleLogo) {
+        static NeverDestroyed&lt;AtomicString&gt; helveticaFamily(&quot;Helvetica Neue&quot;, AtomicString::ConstructFromLiteral);
+        return getCachedFontPlatformData(description, helveticaFamily);
+    }
+    if (c == blackCircle) {
+        static NeverDestroyed&lt;AtomicString&gt; lockClockFamily(&quot;LockClock-Light&quot;, AtomicString::ConstructFromLiteral);
+        return getCachedFontPlatformData(description, lockClockFamily);
+    }
+    return nullptr;
+}
+
+static inline FontTraitsMask toTraitsMask(CTFontSymbolicTraits ctFontTraits)
+{
+    return static_cast&lt;FontTraitsMask&gt;(((ctFontTraits &amp; kCTFontTraitItalic) ? FontStyleItalicMask : FontStyleNormalMask)
+        | FontVariantNormalMask
+        // FontWeight600 or higher is bold for CTFonts, so choose middle values for
+        // bold (600-900) and non-bold (100-500)
+        | ((ctFontTraits &amp; kCTFontTraitBold) ? FontWeight700Mask : FontWeight300Mask));
+}
+
+void FontCache::getTraitsInFamily(const AtomicString&amp; familyName, Vector&lt;unsigned&gt;&amp; traitsMasks)
+{
+    RetainPtr&lt;CFStringRef&gt; familyNameStr = familyName.string().createCFString();
+    NSDictionary *attributes = @{ (id)kCTFontFamilyNameAttribute: (NSString*)familyNameStr.get() };
+    RetainPtr&lt;CTFontDescriptorRef&gt; fontDescriptor = adoptCF(CTFontDescriptorCreateWithAttributes((CFDictionaryRef)attributes));
+    RetainPtr&lt;NSArray&gt; matchedDescriptors = adoptNS((NSArray *)CTFontDescriptorCreateMatchingFontDescriptors(fontDescriptor.get(), nullptr));
+
+    NSInteger numMatches = [matchedDescriptors.get() count];
+    if (!matchedDescriptors || !numMatches)
+        return;
+
+    for (NSInteger i = 0; i &lt; numMatches; ++i) {
+        RetainPtr&lt;CFDictionaryRef&gt; traits = adoptCF((CFDictionaryRef)CTFontDescriptorCopyAttribute((CTFontDescriptorRef)[matchedDescriptors.get() objectAtIndex:i], kCTFontTraitsAttribute));
+        CFNumberRef resultRef = (CFNumberRef)CFDictionaryGetValue(traits.get(), kCTFontSymbolicTrait);
+        if (resultRef) {
+            CTFontSymbolicTraits symbolicTraits;
+            CFNumberGetValue(resultRef, kCFNumberIntType, &amp;symbolicTraits);
+            traitsMasks.append(toTraitsMask(symbolicTraits));
+        }
+    }
+}
+
+float FontCache::weightOfCTFont(CTFontRef font)
+{
+    float result = 0;
+    RetainPtr&lt;CFDictionaryRef&gt; traits = adoptCF(CTFontCopyTraits(font));
+    if (!traits)
+        return result;
+
+    CFNumberRef resultRef = (CFNumberRef)CFDictionaryGetValue(traits.get(), kCTFontWeightTrait);
+    if (resultRef)
+        CFNumberGetValue(resultRef, kCFNumberFloatType, &amp;result);
+
+    return result;
+}
+
+static CTFontRef createCTFontWithTextStyle(const String&amp; familyName, CTFontSymbolicTraits traits, CGFloat size)
+{
+    if (familyName.isNull())
+        return nullptr;
+
+    CTFontSymbolicTraits symbolicTraits = 0;
+    if (traits &amp; kCTFontBoldTrait)
+        symbolicTraits |= kCTFontBoldTrait;
+    if (traits &amp; kCTFontTraitItalic)
+        symbolicTraits |= kCTFontTraitItalic;
+    RetainPtr&lt;CFStringRef&gt; familyNameStr = familyName.createCFString();
+    RetainPtr&lt;CTFontDescriptorRef&gt; fontDescriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(familyNameStr.get(), RenderThemeIOS::contentSizeCategory(), nullptr));
+    if (symbolicTraits)
+        fontDescriptor = adoptCF(CTFontDescriptorCreateCopyWithSymbolicTraits(fontDescriptor.get(), symbolicTraits, symbolicTraits));
+
+    return CTFontCreateWithFontDescriptor(fontDescriptor.get(), size, nullptr);
+}
+
+static CTFontRef createCTFontWithFamilyNameAndWeight(const String&amp; familyName, CTFontSymbolicTraits traits, float size, uint16_t weight)
+{
+    if (familyName.isNull())
+        return nullptr;
+
+    static NeverDestroyed&lt;AtomicString&gt; systemUIFontWithWebKitPrefix(&quot;-webkit-system-font&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; systemUIFontWithApplePrefix(&quot;-apple-system-font&quot;, AtomicString::ConstructFromLiteral);
+    if (equalIgnoringCase(familyName, systemUIFontWithWebKitPrefix) || equalIgnoringCase(familyName, systemUIFontWithApplePrefix)) {
+        CTFontUIFontType fontType = kCTFontUIFontSystem;
+        if (weight &gt; 300) {
+            // The comment below has been copied from CoreText/UIFoundation. However, in WebKit we synthesize the oblique,
+            // so we should investigate the result &lt;rdar://problem/14449340&gt;:
+            // We don't do bold-italic for system fonts. If you ask for it, we'll assume that you're just kidding and that you really want bold. This is a feature.
+            if (traits &amp; kCTFontTraitBold)
+                fontType = kCTFontUIFontEmphasizedSystem;
+            else if (traits &amp; kCTFontTraitItalic)
+                fontType = static_cast&lt;CTFontUIFontType&gt;(kCTFontUIFontSystemItalic);
+        } else if (weight &gt; 250)
+            fontType = static_cast&lt;CTFontUIFontType&gt;(kCTFontUIFontSystemLight);
+        else if (weight &gt; 150)
+            fontType = static_cast&lt;CTFontUIFontType&gt;(kCTFontUIFontSystemThin);
+        else
+            fontType = static_cast&lt;CTFontUIFontType&gt;(kCTFontUIFontSystemUltraLight);
+        RetainPtr&lt;CTFontDescriptorRef&gt; fontDescriptor = adoptCF(CTFontDescriptorCreateForUIType(fontType, size, nullptr));
+        return CTFontCreateWithFontDescriptor(fontDescriptor.get(), size, nullptr);
+    }
+
+    RetainPtr&lt;CFStringRef&gt; familyNameStr = familyName.createCFString();
+    CTFontSymbolicTraits requestedTraits = (CTFontSymbolicTraits)(traits &amp; (kCTFontBoldTrait | kCTFontItalicTrait));
+    return CTFontCreateForCSS(familyNameStr.get(), weight, requestedTraits, size);
+}
+
+static uint16_t toCTFontWeight(FontWeight fontWeight)
+{
+    switch (fontWeight) {
+    case FontWeight100:
+        return 100;
+    case FontWeight200:
+        return 200;
+    case FontWeight300:
+        return 300;
+    case FontWeight400:
+        return 400;
+    case FontWeight500:
+        return 500;
+    case FontWeight600:
+        return 600;
+    case FontWeight700:
+        return 700;
+    case FontWeight800:
+        return 800;
+    case FontWeight900:
+        return 900;
+    default:
+        return 400;
+    }
+}
+
+PassOwnPtr&lt;FontPlatformData&gt; FontCache::createFontPlatformData(const FontDescription&amp; fontDescription, const AtomicString&amp; family)
+{
+    // Special case for &quot;Courier&quot; font. We used to have only an oblique variant on iOS, so prior to
+    // iOS 6.0, we disallowed its use here. We'll fall back on &quot;Courier New&quot;. &lt;rdar://problem/5116477&amp;10850227&gt;
+    static NeverDestroyed&lt;AtomicString&gt; courier(&quot;Courier&quot;, AtomicString::ConstructFromLiteral);
+    static bool shouldDisallowCourier = !iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_6_0);
+    if (shouldDisallowCourier &amp;&amp; equalIgnoringCase(family, courier))
+        return nullptr;
+
+    CTFontSymbolicTraits traits = 0;
+    if (fontDescription.italic())
+        traits |= kCTFontTraitItalic;
+    if (isFontWeightBold(fontDescription.weight()))
+        traits |= kCTFontTraitBold;
+    float size = fontDescription.computedPixelSize();
+
+    RetainPtr&lt;CTFontRef&gt; ctFont;
+    if (family.startsWith(&quot;UICTFontTextStyle&quot;))
+        ctFont = adoptCF(createCTFontWithTextStyle(family, traits, size));
+    else
+        ctFont = adoptCF(createCTFontWithFamilyNameAndWeight(family, traits, size, toCTFontWeight(fontDescription.weight())));
+    if (!ctFont)
+        return nullptr;
+
+    CTFontSymbolicTraits actualTraits = 0;
+    if (isFontWeightBold(fontDescription.weight()) || fontDescription.italic())
+        actualTraits = CTFontGetSymbolicTraits(ctFont.get());
+
+    bool isAppleColorEmoji = CTFontIsAppleColorEmoji(ctFont.get());
+
+    bool syntheticBold = (traits &amp; kCTFontTraitBold) &amp;&amp; !(actualTraits &amp; kCTFontTraitBold) &amp;&amp; !isAppleColorEmoji;
+    bool syntheticOblique = (traits &amp; kCTFontTraitItalic) &amp;&amp; !(actualTraits &amp; kCTFontTraitItalic) &amp;&amp; !isAppleColorEmoji;
+
+    FontPlatformData* result = new FontPlatformData(ctFont.get(), size, fontDescription.usePrinterFont(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant());
+    if (isAppleColorEmoji)
+        result-&gt;m_isEmoji = true;
+    return adoptPtr(result);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosFontServicesIOSh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ios/FontServicesIOS.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/FontServicesIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/FontServicesIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef FontServicesIOS_h
+#define FontServicesIOS_h
+
+#import &lt;CoreText/CoreText.h&gt;
+
+namespace WebCore {
+
+class FontServicesIOS {
+public:
+    FontServicesIOS(CTFontRef);
+    CGFloat ascent() { return m_ascent; }
+    CGFloat descent() { return m_descent; }
+    CGFloat lineGap() { return m_lineGap; }
+    CGFloat lineSpacing() { return m_lineSpacing; }
+    CGFloat xHeight() { return m_xHeight; }
+    unsigned unitsPerEm() { return m_unitsPerEm; }
+
+private:
+    CGFloat m_ascent;
+    CGFloat m_descent;
+    CGFloat m_lineGap;
+    CGFloat m_lineSpacing;
+    CGFloat m_xHeight;
+    unsigned m_unitsPerEm;
+};
+
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosFontServicesIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ios/FontServicesIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/FontServicesIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/FontServicesIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;FontServicesIOS.h&quot;
+
+#import &quot;FontMetrics.h&quot;
+#import &lt;CoreGraphics/CoreGraphics.h&gt;
+#import &lt;CoreGraphics/CoreGraphicsPrivate.h&gt;
+#import &lt;mach-o/dyld_priv.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+namespace WebCore {
+
+static const float kLineHeightAdjustment = 0.15f;
+
+static bool shouldUseAdjustment(CTFontRef font, bool isiOS7OrLater)
+{
+    RetainPtr&lt;NSString&gt; familyName = adoptNS((NSString *)CTFontCopyFamilyName(font));
+    if (![familyName length])
+        return false;
+
+    if ([familyName.get() compare:@&quot;Times&quot; options:NSCaseInsensitiveSearch] == NSOrderedSame
+        || [familyName.get() compare:@&quot;Helvetica&quot; options:NSCaseInsensitiveSearch] == NSOrderedSame
+        || [familyName.get() compare:@&quot;.Helvetica NeueUI&quot; options:NSCaseInsensitiveSearch] == NSOrderedSame)
+        return true;
+    if (!isiOS7OrLater &amp;&amp; [familyName.get() compare:@&quot;.Helvetica NeueUILegacy&quot; options:NSCaseInsensitiveSearch] == NSOrderedSame)
+        return true;
+
+    return false;
+}
+
+static bool isCourier(CTFontRef font)
+{
+    RetainPtr&lt;NSString&gt; familyName = adoptNS((NSString *)CTFontCopyFamilyName(font));
+    if (![familyName length])
+        return false;
+    return [familyName.get() compare:@&quot;Courier&quot; options:NSCaseInsensitiveSearch] == NSOrderedSame;
+}
+
+FontServicesIOS::FontServicesIOS(CTFontRef font)
+{
+    CGFontDescriptor descriptor;
+    RetainPtr&lt;CGFontRef&gt; cgFont = adoptCF(CTFontCopyGraphicsFont(font, NULL));
+    m_xHeight = CGFontGetDescriptor(cgFont.get(), &amp;descriptor) ? (descriptor.xHeight / 1000) * CTFontGetSize(font) : 0;
+    m_unitsPerEm = CTFontGetUnitsPerEm(font);
+    CGFloat lineGap;
+    CGFloat ascent;
+    CGFloat descent;
+    static bool isiOS7OrLater = dyld_get_program_sdk_version() &gt;= DYLD_IOS_VERSION_7_0;
+    if (isiOS7OrLater) {
+        // Use CoreText API in iOS 7.
+        ascent = CTFontGetAscent(font);
+        descent = CTFontGetDescent(font);
+        lineGap = CTFontGetLeading(font);
+    } else {
+        float pointSize = CTFontGetSize(font);
+        const CGFontHMetrics *metrics = CGFontGetHMetrics(cgFont.get());
+        unsigned unitsPerEm = CGFontGetUnitsPerEm(cgFont.get());
+
+        lineGap = (dyld_get_program_sdk_version() &gt;= DYLD_IOS_VERSION_3_0) ? scaleEmToUnits(metrics-&gt;lineGap, unitsPerEm) * pointSize : 0.0;
+
+        bool isiOS6OrLater = dyld_get_program_sdk_version() &gt;= DYLD_IOS_VERSION_6_0;
+        if (!isiOS6OrLater || !isCourier(font)) {
+            ascent = (scaleEmToUnits(metrics-&gt;ascent, unitsPerEm) * pointSize);
+            descent = (-scaleEmToUnits(metrics-&gt;descent, unitsPerEm) * pointSize);
+        } else {
+            // For Courier, we use Courier New's exact values, because in iOS 5.1 and earlier,
+            // Courier New was substituted for Courier by WebKit.
+            ascent = (scaleEmToUnits(1705, 2048) * pointSize);
+            descent = (scaleEmToUnits(615, 2048) * pointSize);
+        }
+    }
+    CGFloat adjustment = (shouldUseAdjustment(font, isiOS7OrLater)) ? ceil((ascent + descent) * kLineHeightAdjustment) : 0;
+
+    m_ascent = ascent + adjustment;
+    m_descent = descent;
+    m_lineGap = ceilf(lineGap);
+    m_lineSpacing = ceil(ascent) + adjustment + ceil(descent) + m_lineGap;
+}
+
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosGraphicsContext3DIOSh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ios/GraphicsContext3DIOS.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/GraphicsContext3DIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/GraphicsContext3DIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef GraphicsContext3DIOS_h
+#define GraphicsContext3DIOS_h
+
+#define glBindFramebufferEXT glBindFramebuffer
+#define glBindRenderbufferEXT glBindRenderbuffer
+#define glCheckFramebufferStatusEXT glCheckFramebufferStatus
+#define glDeleteFramebuffersEXT glDeleteFramebuffers
+#define glDeleteRenderbuffersEXT glDeleteRenderbuffers
+#define glFramebufferRenderbufferEXT glFramebufferRenderbuffer
+#define glFramebufferTexture2DEXT glFramebufferTexture2D
+#define glGenerateMipmapEXT glGenerateMipmap
+#define glGenFramebuffersEXT glGenFramebuffers
+#define glGenRenderbuffersEXT glGenRenderbuffers
+#define glGetFramebufferAttachmentParameterivEXT glGetFramebufferAttachmentParameteriv
+#define glGetRenderbufferParameterivEXT glGetRenderbufferParameteriv
+#define glIsFramebufferEXT glIsFramebuffer
+#define glIsRenderbufferEXT glIsRenderbuffer
+#define glRenderbufferStorageEXT glRenderbufferStorage
+#define glRenderbufferStorageMultisampleEXT glRenderbufferStorageMultisampleAPPLE
+
+#define GL_COLOR_ATTACHMENT0_EXT GL_COLOR_ATTACHMENT0
+#define GL_DEPTH24_STENCIL8_EXT GL_DEPTH24_STENCIL8_OES
+#define GL_DEPTH_ATTACHMENT_EXT  GL_DEPTH_ATTACHMENT
+#define GL_DRAW_FRAMEBUFFER_EXT GL_DRAW_FRAMEBUFFER_APPLE
+#define GL_FRAMEBUFFER_COMPLETE_EXT GL_FRAMEBUFFER_COMPLETE
+#define GL_FRAMEBUFFER_EXT GL_FRAMEBUFFER
+#define GL_MAX_SAMPLES_EXT GL_MAX_SAMPLES_APPLE
+#define GL_READ_FRAMEBUFFER_EXT GL_READ_FRAMEBUFFER_APPLE
+#define GL_RENDERBUFFER_EXT GL_RENDERBUFFER
+#ifndef GL_RGB8
+#define GL_RGB8 GL_RGB
+#endif
+#ifndef GL_RGBA8
+#define GL_RGBA8 GL_RGBA
+#endif
+#define GL_STENCIL_ATTACHMENT_EXT GL_STENCIL_ATTACHMENT
+#define GL_UNSIGNED_INT_8_8_8_8_REV GL_RGBA
+
+#endif // GraphicsContext3DIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosIconIOSmmfromrev161588trunkSourceWebCoreplatformmacDisplaySleepDisablercpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ios/IconIOS.mm (from rev 161588, trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/IconIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/IconIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if PLATFORM(IOS)
+
+#import &quot;config.h&quot;
+#import &quot;Icon.h&quot;
+
+#import &quot;BitmapImage.h&quot;
+#import &quot;GraphicsContext.h&quot;
+
+namespace WebCore {
+    
+Icon::Icon(CGImageRef image)
+    : m_cgImage(image)
+{
+}
+
+Icon::~Icon()
+{
+}
+
+PassRefPtr&lt;Icon&gt; Icon::createIconForFiles(const Vector&lt;String&gt;&amp; /*filenames*/)
+{
+    return nullptr;
+}
+
+PassRefPtr&lt;Icon&gt; Icon::createIconForImage(NativeImagePtr imageRef)
+{
+    if (!imageRef)
+        return nullptr;
+
+    return adoptRef(new Icon(imageRef));
+}
+
+void Icon::paint(GraphicsContext* context, const IntRect&amp; destRect)
+{
+    if (context-&gt;paintingDisabled())
+        return;
+
+    GraphicsContextStateSaver stateSaver(*context);
+
+    float width = CGImageGetWidth(m_cgImage.get());
+    float height = CGImageGetHeight(m_cgImage.get());
+    FloatSize size(width, height);
+    FloatRect srcRect(0, 0, width, height);
+    ColorSpace colorSpace = ColorSpaceDeviceRGB;
+
+    context-&gt;setImageInterpolationQuality(InterpolationHigh);
+    context-&gt;drawNativeImage(m_cgImage.get(), size, colorSpace, destRect, srcRect, 1.0f, CompositeSourceOver, BlendModeNormal, DefaultImageOrientation);
+}
+
+}
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosInbandTextTrackPrivateAVFIOShfromrev161588trunkSourceWebCoreplatformgraphicscgImageBufferDataCGh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ios/InbandTextTrackPrivateAVFIOS.h (from rev 161588, trunk/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/InbandTextTrackPrivateAVFIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/InbandTextTrackPrivateAVFIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef InbandTextTrackPrivateAVFIOS_h
+#define InbandTextTrackPrivateAVFIOS_h
+
+#if ENABLE(VIDEO) &amp;&amp; PLATFORM(IOS)
+
+#include &quot;InbandTextTrackPrivateAVF.h&quot;
+#include &lt;wtf/RetainPtr.h&gt;
+
+namespace WebCore {
+
+class InbandTextTrackPrivateAVFIOS : public InbandTextTrackPrivateAVF {
+public:
+    static PassRefPtr&lt;InbandTextTrackPrivateAVFIOS&gt; create(AVFInbandTrackParent* parent, int internalID, const String&amp; name, const String&amp; language, const String&amp; type)
+    {
+        return adoptRef(new InbandTextTrackPrivateAVFIOS(parent, internalID, name, language, type));
+    }
+
+    ~InbandTextTrackPrivateAVFIOS();
+
+    virtual InbandTextTrackPrivate::Kind kind() const OVERRIDE;
+    virtual AtomicString label() const OVERRIDE { return m_name; }
+    virtual AtomicString language() const OVERRIDE { return m_language; }
+    virtual bool isLegacyClosedCaptionsTrack() const OVERRIDE { return false; }
+    int internalID() const { return m_internalID; }
+
+protected:
+    InbandTextTrackPrivateAVFIOS(AVFInbandTrackParent*, int, const String&amp; name, const String&amp; language, const String&amp; type);
+
+    String m_name;
+    String m_language;
+    String m_type;
+    int m_internalID;
+};
+}
+
+#endif // ENABLE(VIDEO) &amp;&amp; PLATFORM(IOS)
+#endif // InbandTextTrackPrivateAVFIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosInbandTextTrackPrivateAVFIOSmmfromrev161588trunkSourceWebCoreplatformgraphicsmacFloatPointMacmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ios/InbandTextTrackPrivateAVFIOS.mm (from rev 161588, trunk/Source/WebCore/platform/graphics/mac/FloatPointMac.mm) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/InbandTextTrackPrivateAVFIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/InbandTextTrackPrivateAVFIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+
+#if ENABLE(VIDEO) &amp;&amp; PLATFORM(IOS)
+
+#import &quot;InbandTextTrackPrivateAVFIOS.h&quot;
+
+#import &quot;BlockExceptions.h&quot;
+#import &quot;FloatConversion.h&quot;
+#import &quot;InbandTextTrackPrivate.h&quot;
+#import &quot;InbandTextTrackPrivateAVF.h&quot;
+#import &quot;Logging.h&quot;
+
+using namespace WebCore;
+
+namespace WebCore {
+
+InbandTextTrackPrivateAVFIOS::InbandTextTrackPrivateAVFIOS(AVFInbandTrackParent* parent, int internalID, const String&amp; name, const String&amp; language, const String&amp; type)
+    : InbandTextTrackPrivateAVF(parent)
+    , m_name(name)
+    , m_language(language)
+    , m_type(type)
+    , m_internalID(internalID)
+{
+}
+
+InbandTextTrackPrivateAVFIOS::~InbandTextTrackPrivateAVFIOS()
+{
+}
+
+InbandTextTrackPrivate::Kind InbandTextTrackPrivateAVFIOS::kind() const
+{
+    if ([m_type isEqualToString:@&quot;captions&quot;])
+        return Captions;
+    if ([m_type isEqualToString:@&quot;subtitles&quot;])
+        return Subtitles;
+
+    return Captions;
+}
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosMediaPlayerPrivateIOSh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,245 @@
</span><ins>+/*
+ * Copyright (C) 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef MediaPlayerPrivateIOS_h
+#define MediaPlayerPrivateIOS_h
+
+#if ENABLE(VIDEO) &amp;&amp; PLATFORM(IOS)
+
+#include &quot;InbandTextTrackPrivateAVF.h&quot;
+#include &quot;MediaPlayer.h&quot;
+#include &quot;MediaPlayerPrivate.h&quot;
+#include &quot;MediaPlayerProxy.h&quot;
+#include &lt;objc/runtime.h&gt;
+#include &lt;wtf/PassOwnPtr.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+
+OBJC_CLASS NSDictionary;
+OBJC_CLASS NSMutableDictionary;
+OBJC_CLASS NSNumber;
+OBJC_CLASS NSObject;
+OBJC_CLASS WebCoreMediaPlayerNotificationHelper;
+
+namespace WebCore {
+
+class InbandTextTrackPrivateAVFIOS;
+
+class MediaPlayerPrivateIOS : public MediaPlayerPrivateInterface, public AVFInbandTrackParent {
+public:
+
+    static void registerMediaEngine(MediaEngineRegistrar);
+    virtual ~MediaPlayerPrivateIOS();
+
+    virtual void deliverNotification(MediaPlayerProxyNotificationType) OVERRIDE;
+    bool callbacksDelayed() { return m_delayCallbacks &gt; 0; }
+    virtual void prepareToPlay() OVERRIDE;
+    void processDeferredRequests();
+
+#if ENABLE(VIDEO_TRACK)
+    void inbandTextTracksChanged(NSArray *);
+    void processInbandTextTrackCue(NSArray *, double);
+    void textTrackWasSelectedByPlugin(NSDictionary *);
+#endif
+
+private:
+    MediaPlayerPrivateIOS(MediaPlayer*);
+
+    // Engine support
+    static PassOwnPtr&lt;MediaPlayerPrivateInterface&gt; create(MediaPlayer*);
+    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
+    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
+    static bool isAvailable();
+
+    virtual IntSize naturalSize() const OVERRIDE;
+    virtual bool hasVideo() const OVERRIDE;
+    virtual bool hasAudio() const OVERRIDE;
+    virtual bool supportsFullscreen() const OVERRIDE { return true; }
+
+    virtual bool canLoadPoster() const OVERRIDE { return true; }
+    virtual void setPoster(const String&amp; url) OVERRIDE;
+
+    virtual void setControls(bool) OVERRIDE;
+
+    virtual void enterFullscreen() OVERRIDE;
+    virtual void exitFullscreen() OVERRIDE;
+
+    virtual bool hasClosedCaptions() const OVERRIDE;
+    virtual void setClosedCaptionsVisible(bool) OVERRIDE;
+
+    virtual void load(const String&amp; url) OVERRIDE;
+#if ENABLE(MEDIA_SOURCE)
+    virtual void load(const String&amp;, PassRefPtr&lt;HTMLMediaSource&gt;) OVERRIDE { }
+#endif
+    virtual void cancelLoad() OVERRIDE;
+
+    virtual void play() OVERRIDE;
+    virtual void pause() OVERRIDE;
+
+    virtual bool paused() const OVERRIDE;
+    virtual bool seeking() const OVERRIDE;
+
+    virtual float duration() const OVERRIDE;
+    virtual float currentTime() const OVERRIDE;
+
+    virtual void seek(float time) OVERRIDE;
+    void setEndTime(float);
+
+    float rate() const;
+    virtual void setRate(float inRate) OVERRIDE;
+    virtual float volume() const OVERRIDE;
+    virtual void setVolume(float inVolume) OVERRIDE;
+    virtual void setMuted(bool inMute) OVERRIDE;
+
+    int dataRate() const;
+
+    virtual MediaPlayer::NetworkState networkState() const OVERRIDE;
+    virtual MediaPlayer::ReadyState readyState() const OVERRIDE;
+    
+    float maxTimeBuffered() const;
+    virtual float maxTimeSeekable() const OVERRIDE;
+    virtual PassRefPtr&lt;TimeRanges&gt; buffered() const OVERRIDE;
+
+    virtual bool didLoadingProgress() const OVERRIDE;
+    bool totalBytesKnown() const;
+    unsigned totalBytes() const;
+
+    virtual void setVisible(bool) OVERRIDE;
+    virtual void setSize(const IntSize&amp;) OVERRIDE;
+    
+    virtual void paint(GraphicsContext*, const IntRect&amp;) OVERRIDE;
+
+#if ENABLE(IOS_AIRPLAY)
+    virtual bool isCurrentPlaybackTargetWireless() const OVERRIDE;
+    virtual void showPlaybackTargetPicker() OVERRIDE;
+
+    virtual bool hasWirelessPlaybackTargets() const OVERRIDE;
+
+    virtual bool wirelessVideoPlaybackDisabled() const OVERRIDE;
+    virtual void setWirelessVideoPlaybackDisabled(bool) OVERRIDE;
+
+    virtual void setHasPlaybackTargetAvailabilityListeners(bool) OVERRIDE;
+#endif
+
+#if USE(ACCELERATED_COMPOSITING)
+    virtual bool supportsAcceleratedRendering() const OVERRIDE;
+#endif
+
+    virtual void setMediaPlayerProxy(WebMediaPlayerProxy*) OVERRIDE;
+    void processPendingRequests();
+
+    void setDelayCallbacks(bool doDelay) { m_delayCallbacks += (doDelay ? 1 : -1); }
+
+    bool usingNetwork() const { return m_usingNetwork; }
+    bool inFullscreen() const { return m_inFullScreen; }
+
+    void addDeferredRequest(NSString *name, id value);
+
+    virtual String engineDescription() const { String(ASCIILiteral(&quot;iOS&quot;)); }
+
+    virtual void attributeChanged(const String&amp; name, const String&amp; value) OVERRIDE;
+    virtual bool readyForPlayback() const OVERRIDE;
+
+#if ENABLE(VIDEO_TRACK)
+    virtual bool requiresTextTrackRepresentation() const;
+    virtual void setTextTrackRepresentation(TextTrackRepresentation*);
+
+    void clearTextTracks();
+    void setSelectedTextTrack(NSNumber *);
+    virtual void trackModeChanged() OVERRIDE;
+    void setOutOfBandTextTracks(NSArray *);
+
+    virtual bool implementsTextTrackControls() const { return true; }
+    virtual PassRefPtr&lt;PlatformTextTrackMenuInterface&gt; textTrackMenu();
+
+    void outOfBandTextTracksChanged();
+    void textTrackWasSelectedByMediaElement(PassRefPtr&lt;PlatformTextTrack&gt;);
+#endif
+
+private:
+
+    class PlatformTextTrackMenuInterfaceIOS : public PlatformTextTrackMenuInterface {
+    public:
+        static PassRefPtr&lt;PlatformTextTrackMenuInterfaceIOS&gt; create(MediaPlayerPrivateIOS* owner)
+        {
+            return adoptRef(new PlatformTextTrackMenuInterfaceIOS(owner));
+        }
+
+        virtual ~PlatformTextTrackMenuInterfaceIOS();
+
+        virtual void tracksDidChange() OVERRIDE
+        {
+            if (m_owner)
+                m_owner-&gt;outOfBandTextTracksChanged();
+        }
+
+        virtual void trackWasSelected(PassRefPtr&lt;PlatformTextTrack&gt; track) OVERRIDE
+        {
+            if (m_owner)
+                m_owner-&gt;textTrackWasSelectedByMediaElement(track);
+        }
+
+        virtual void setClient(PlatformTextTrackMenuClient* client) OVERRIDE { m_client = client; }
+        PlatformTextTrackMenuClient* client() { return m_client; }
+
+    private:
+        PlatformTextTrackMenuInterfaceIOS(MediaPlayerPrivateIOS*);
+
+        PlatformTextTrackMenuClient* m_client;
+        MediaPlayerPrivateIOS* m_owner;
+    };
+
+    MediaPlayer* m_mediaPlayer;
+    RetainPtr&lt;NSObject&gt; m_mediaPlayerHelper; // This is the MediaPlayerProxy.
+    RetainPtr&lt;WebCoreMediaPlayerNotificationHelper&gt; m_objcHelper;
+    RetainPtr&lt;NSMutableDictionary&gt; m_deferredProperties;
+
+    MediaPlayer::NetworkState m_networkState;
+    MediaPlayer::ReadyState m_readyState;
+
+    enum BufferingState { Empty, UnlikeleyToKeepUp, LikeleyToKeepUp, Full };
+
+#if ENABLE(VIDEO_TRACK)
+    InbandTextTrackPrivateAVFIOS* m_currentTrack;
+    Vector&lt;RefPtr&lt;InbandTextTrackPrivateAVFIOS&gt; &gt; m_textTracks;
+    RefPtr&lt;PlatformTextTrackMenuInterfaceIOS&gt; m_menuInterface;
+#endif
+
+    int m_delayCallbacks;
+    int m_changingVolume;
+    mutable unsigned m_bytesLoadedAtLastDidLoadingProgress;
+    float m_requestedRate;
+    BufferingState m_bufferingState;
+    bool m_visible : 1;
+    bool m_usingNetwork : 1;
+    bool m_inFullScreen : 1;
+    bool m_shouldPrepareToPlay : 1;
+    bool m_preparingToPlay : 1;
+    bool m_pauseRequested : 1;
+};
+
+} // namespace WebCore
+
+#endif
+#endif // MediaPlayerPrivateIOS
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosMediaPlayerPrivateIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/MediaPlayerPrivateIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,1263 @@
</span><ins>+
+/*
+ * Copyright (C) 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+
+#if ENABLE(VIDEO) &amp;&amp; PLATFORM(IOS)
+
+#import &quot;MediaPlayerPrivateIOS.h&quot;
+
+#import &quot;GraphicsLayerCA.h&quot;
+#import &quot;InbandTextTrackPrivateAVFIOS.h&quot;
+#import &quot;Logging.h&quot;
+#import &quot;PlatformTextTrack.h&quot;
+#import &quot;TextTrackRepresentation.h&quot;
+#import &quot;TimeRanges.h&quot;
+#import &quot;URL.h&quot;
+#import &quot;WAKAppKitStubs.h&quot;
+#import &quot;WebCoreThreadRun.h&quot;
+#import &lt;CoreGraphics/CoreGraphics.h&gt;
+#import &lt;wtf/NeverDestroyed.h&gt;
+#import &lt;wtf/StdLibExtras.h&gt;
+
+using namespace WebCore;
+using namespace std;
+
+@interface WebCoreMediaPlayerNotificationHelper : NSObject
+{
+    MediaPlayerPrivateIOS* _client;
+    BOOL _deferredPropertiesScheduled;
+}
+- (id)initWithClient:(MediaPlayerPrivateIOS *)client;
+- (void)disconnect;
+- (void)cancelPendingRequests;
+- (void)delayNotification:(int)notification;
+- (void)deliverNotification:(NSNumber *)notification;
+- (void)schedulePrepareToPlayWithOptionalDelay:(NSNumber *)shouldDelay;
+- (void)scheduleDeferredPropertiesWithOptionalDelay:(NSNumber *)shouldDelay;
+
+- (void)pluginElementInBandAlternateTextTracksDidChange:(NSArray *)tracks;
+- (void)pluginElementDidSelectTextTrack:(NSString *)trackId;
+- (void)pluginElementDidOutputAttributedStrings:(NSArray *)strings nativeSampleBuffers:(NSArray *)buffers forTime:(NSTimeInterval)time;
+@end
+
+// Private selectors implemented by the media player proxy object returned by the plug-in.
+@interface NSObject (WebMediaPlayerProxy_Extras)
+- (void)_attributeChanged:(NSString *)name value:(NSString *)value;
+- (BOOL)_readyForPlayback;
+@end
+
+namespace WebCore {
+
+const int kRequiredHelperInterfaceVersion = 1;
+
+static NSString * const DeferredPropertyControlsKey = @&quot;controls&quot;;
+static NSString * const DeferredPropertyPosterKey = @&quot;poster&quot;;
+static NSString * const DeferredPropertySrcKey = @&quot;src&quot;;
+static NSString * const DeferredPlayKey = @&quot;play&quot;;
+static NSString * const DeferredPropertySelectedTrackKey = @&quot;selectedtrack&quot;;
+static NSString * const DeferredPropertyOutOfBandTracksKey = @&quot;outofbandtracks&quot;;
+#if ENABLE(IOS_AIRPLAY)
+static NSString * const DeferredWirelessVideoPlaybackDisabled = @&quot;wirelessVideoPlaybackDisabled&quot;;
+#endif
+
+static NSString * const TextTrackDisplayNameKey = @&quot;displayname&quot;;
+static NSString * const TextTrackLocaleIdentifierKey = @&quot;localeidentifier&quot;;
+static NSString * const TextTrackSubtitlesKey = @&quot;subtitles&quot;;
+static NSString * const TextTrackCaptionsKey = @&quot;captions&quot;;
+static NSString * const TextTrackTypeKey = @&quot;type&quot;;
+static NSString * const TextTrackIDKey = @&quot;id&quot;;
+
+const int TextTrackOffMenuItemID = -1;
+const int TextTrackAutoMenuItemID = -2;
+
+MediaPlayerPrivateIOS::PlatformTextTrackMenuInterfaceIOS::PlatformTextTrackMenuInterfaceIOS(MediaPlayerPrivateIOS* owner)
+    : m_client(nullptr)
+    , m_owner(owner)
+{
+}
+        
+MediaPlayerPrivateIOS::PlatformTextTrackMenuInterfaceIOS::~PlatformTextTrackMenuInterfaceIOS()
+{
+    m_owner = nullptr;
+    m_client = nullptr;
+}
+
+PassOwnPtr&lt;MediaPlayerPrivateInterface&gt; MediaPlayerPrivateIOS::create(MediaPlayer* player)
+{ 
+    return adoptPtr(new MediaPlayerPrivateIOS(player));
+}
+
+void MediaPlayerPrivateIOS::registerMediaEngine(MediaEngineRegistrar registrar)
+{
+    if (isAvailable())
+        registrar(create, getSupportedTypes, supportsType, 0, 0, 0);
+}
+
+MediaPlayerPrivateIOS::MediaPlayerPrivateIOS(MediaPlayer* player)
+    : m_mediaPlayer(player)
+    , m_objcHelper(adoptNS([[WebCoreMediaPlayerNotificationHelper alloc] initWithClient:this]))
+    , m_networkState(MediaPlayer::Empty)
+    , m_readyState(MediaPlayer::HaveNothing)
+#if ENABLE(VIDEO_TRACK)
+    , m_currentTrack(nullptr)
+#endif
+    , m_delayCallbacks(0)
+    , m_changingVolume(0)
+    , m_bytesLoadedAtLastDidLoadingProgress(0)
+    , m_requestedRate(0)
+    , m_bufferingState(Empty)
+    , m_visible(false)
+    , m_usingNetwork(false)
+    , m_inFullScreen(false)
+    , m_shouldPrepareToPlay(false)
+    , m_preparingToPlay(false)
+    , m_pauseRequested(false)
+{
+}
+
+MediaPlayerPrivateIOS::~MediaPlayerPrivateIOS()
+{
+    clearTextTracks();
+    [m_objcHelper.get() disconnect];
+    if ([m_mediaPlayerHelper.get() respondsToSelector:@selector(_setDelegate:)])
+        [m_mediaPlayerHelper.get() _setDelegate:nil];
+    [m_mediaPlayerHelper.get() _disconnect];
+}
+
+void MediaPlayerPrivateIOS::setMediaPlayerProxy(WebMediaPlayerProxy *proxy)
+{
+    if (m_mediaPlayerHelper)
+        [m_mediaPlayerHelper.get() _disconnect];
+
+    m_mediaPlayerHelper = nullptr;
+
+    if (proxy) {
+        // don't try to use a helper if the interface version is too low
+        if ([proxy _interfaceVersion] &lt;  kRequiredHelperInterfaceVersion) {
+            NSLog(@&quot;Media player helper interface version too low, exiting.&quot;);
+            return;
+        }
+        m_mediaPlayerHelper = adoptNS(static_cast&lt;NSObject *&gt;([proxy retain]));
+        if ([m_mediaPlayerHelper.get() respondsToSelector:@selector(_setDelegate:)])
+            [m_mediaPlayerHelper.get() _setDelegate:m_objcHelper.get()];
+
+        acceleratedRenderingStateChanged();
+    }
+
+    processPendingRequests();
+}
+
+void MediaPlayerPrivateIOS::load(const String&amp; url)
+{
+    NSURL *nsURL = URL(ParsedURLString, url);
+
+    if (!m_mediaPlayerHelper) {
+        addDeferredRequest(DeferredPropertySrcKey, [nsURL absoluteString]);
+        return;
+    }
+
+    [m_deferredProperties.get() removeObjectForKey:DeferredPropertySrcKey];
+    setDelayCallbacks(true);
+    {
+        if (m_networkState != MediaPlayer::Loading) {
+            m_networkState = MediaPlayer::Loading;
+            m_mediaPlayer-&gt;networkStateChanged();
+        }
+        if (m_readyState != MediaPlayer::HaveNothing) {
+            m_readyState = MediaPlayer::HaveNothing;
+            m_mediaPlayer-&gt;readyStateChanged();
+        }
+
+        m_pauseRequested = false;
+        m_preparingToPlay = false;
+
+        [m_mediaPlayerHelper.get() _cancelLoad];
+        [m_mediaPlayerHelper.get() _load:nsURL];
+    }
+    setDelayCallbacks(false);
+}
+
+void MediaPlayerPrivateIOS::cancelLoad()
+{
+    [m_objcHelper.get() cancelPendingRequests];
+    [m_deferredProperties.get() removeAllObjects];
+
+    if (!m_mediaPlayerHelper)
+        return;
+    [m_mediaPlayerHelper.get() _cancelLoad];
+}
+
+void MediaPlayerPrivateIOS::addDeferredRequest(NSString *name, id value)
+{
+    if (!m_deferredProperties)
+        m_deferredProperties = adoptNS([[NSMutableDictionary alloc] init]);
+    [m_deferredProperties.get() setObject:value ? value : @&quot;&quot; forKey:name];
+}
+
+void MediaPlayerPrivateIOS::processDeferredRequests()
+{
+    if (![m_deferredProperties.get() count])
+        return;
+
+    setDelayCallbacks(true);
+    {
+        RetainPtr&lt;NSDictionary&gt; localProperties = adoptNS([[NSDictionary alloc] initWithDictionary:m_deferredProperties.get()]);
+        [m_deferredProperties.get() removeAllObjects];
+
+        // Always set the src first.
+        id value = [localProperties.get() objectForKey:DeferredPropertySrcKey];
+        if (value)
+            load(value);
+
+        for (NSString *name in localProperties.get()) {
+            value = [localProperties.get() objectForKey:name];
+
+            LOG(Media, &quot;MediaPlayerPrivateIOS::processDeferredRequests(%p) - processing %s&quot;, this, [name UTF8String]);
+
+            if ([name isEqualToString:DeferredPropertyPosterKey])
+                setPoster(value);
+            else if ([name isEqualToString:DeferredPropertyControlsKey])
+                setControls([value boolValue]);
+            else if ([name isEqualToString:DeferredPlayKey])
+                play();
+            else if ([name isEqualToString:DeferredPropertyOutOfBandTracksKey])
+                setOutOfBandTextTracks(value);
+            else if ([name isEqualToString:DeferredPropertySelectedTrackKey])
+                setSelectedTextTrack(value);
+#if ENABLE(IOS_AIRPLAY)
+            else if ([name isEqualToString:DeferredWirelessVideoPlaybackDisabled])
+                setWirelessVideoPlaybackDisabled([value boolValue]);
+#endif
+            else if (![name isEqualToString:DeferredPropertySrcKey])
+                attributeChanged(name, value);
+        }
+    }
+    setDelayCallbacks(false);
+}
+
+void MediaPlayerPrivateIOS::setPoster(const String&amp; url)
+{
+    setDelayCallbacks(true);
+    {
+        NSURL *nsURL = URL(ParsedURLString, url);
+        if (m_mediaPlayerHelper) {
+            [m_deferredProperties.get() removeObjectForKey:DeferredPropertyPosterKey];
+            [m_mediaPlayerHelper.get() _setPoster:nsURL];
+        }
+        else
+            addDeferredRequest(DeferredPropertyPosterKey, url);
+    }
+    setDelayCallbacks(false);
+}
+
+void MediaPlayerPrivateIOS::setControls(bool controls)
+{
+    setDelayCallbacks(true);
+    {
+        if (m_mediaPlayerHelper) {
+            [m_deferredProperties.get() removeObjectForKey:DeferredPropertyControlsKey];
+            [m_mediaPlayerHelper.get() _setControls:controls];
+        }
+        else
+            addDeferredRequest(DeferredPropertyControlsKey, [NSNumber numberWithBool:controls]);
+    }
+    setDelayCallbacks(false);
+}
+
+void MediaPlayerPrivateIOS::processPendingRequests()
+{
+    if (m_shouldPrepareToPlay &amp;&amp; !m_preparingToPlay)
+        [m_objcHelper.get() schedulePrepareToPlayWithOptionalDelay:[NSNumber numberWithBool:YES]];
+    if ([m_deferredProperties.get() count])
+        [m_objcHelper.get() scheduleDeferredPropertiesWithOptionalDelay:[NSNumber numberWithBool:YES]];
+    m_shouldPrepareToPlay = false;
+}
+
+void MediaPlayerPrivateIOS::prepareToPlay()
+{
+    if (!m_mediaPlayerHelper) {
+        // Not hooked up to the plug-in yet, remember this request.
+        m_shouldPrepareToPlay = true;
+        return;
+    }
+
+    if (m_preparingToPlay || m_readyState &gt;= MediaPlayer::HaveFutureData)
+        return;
+
+    m_shouldPrepareToPlay = false;
+    m_preparingToPlay = true;
+
+    setDelayCallbacks(true);
+        [m_mediaPlayerHelper.get() _prepareForPlayback];
+    setDelayCallbacks(false);
+}
+
+
+void MediaPlayerPrivateIOS::play()
+{
+    if (!m_mediaPlayerHelper) {
+        addDeferredRequest(DeferredPlayKey, nil);
+        return;
+    }
+
+    m_pauseRequested = false;
+    setDelayCallbacks(true);
+        [m_mediaPlayerHelper.get() _play];
+    setDelayCallbacks(false);
+}
+
+void MediaPlayerPrivateIOS::pause()
+{
+    if (!m_mediaPlayerHelper)
+        return;
+
+    m_pauseRequested = true;
+    setDelayCallbacks(true);
+        [m_mediaPlayerHelper.get() _pause];
+    setDelayCallbacks(false);
+}
+
+float MediaPlayerPrivateIOS::duration() const
+{
+    if (!m_mediaPlayerHelper)
+        return 0;
+    float duration = static_cast&lt;float&gt;([m_mediaPlayerHelper.get() _duration]);
+    return duration == -1 ? numeric_limits&lt;float&gt;::infinity() : duration;
+}
+
+float MediaPlayerPrivateIOS::currentTime() const
+{
+    if (!m_mediaPlayerHelper)
+        return 0;
+    return static_cast&lt;float&gt;([m_mediaPlayerHelper.get() _currentTime]);
+}
+
+void MediaPlayerPrivateIOS::seek(float time)
+{
+    if (!m_mediaPlayerHelper)
+        return;
+    float duration = this-&gt;duration();
+    [m_mediaPlayerHelper.get() _setCurrentTime:(time &gt; duration ? duration : time)];
+}
+
+void MediaPlayerPrivateIOS::setEndTime(float time)
+{
+    if (!m_mediaPlayerHelper)
+        return;
+    [m_mediaPlayerHelper.get() _setEndTime:time];
+}
+
+bool MediaPlayerPrivateIOS::paused() const
+{
+    if (!m_mediaPlayerHelper)
+        return true;
+    return !rate();
+}
+
+bool MediaPlayerPrivateIOS::seeking() const
+{
+    if (!m_mediaPlayerHelper)
+        return false;
+    return [m_mediaPlayerHelper.get() _seeking];
+}
+
+IntSize MediaPlayerPrivateIOS::naturalSize() const
+{
+    if (!m_mediaPlayerHelper)
+        return IntSize();
+
+    NSSize size = [m_mediaPlayerHelper.get() _naturalSize];
+    return IntSize(size);
+}
+
+bool MediaPlayerPrivateIOS::hasVideo() const
+{
+    if (!m_mediaPlayerHelper)
+        return false;
+    return [m_mediaPlayerHelper.get() _hasVideo];
+}
+
+bool MediaPlayerPrivateIOS::hasAudio() const
+{
+    if (!m_mediaPlayerHelper)
+        return false;
+    return [m_mediaPlayerHelper.get() _hasAudio];
+}
+
+float MediaPlayerPrivateIOS::volume() const
+{
+    if (!m_mediaPlayerHelper)
+        return false;
+    return [m_mediaPlayerHelper.get() _volume];
+}
+
+void MediaPlayerPrivateIOS::setVolume(float inVolume)
+{
+    if (!m_mediaPlayerHelper || m_changingVolume)
+        return;
+    [m_mediaPlayerHelper.get() _setVolume:inVolume];
+}
+
+float MediaPlayerPrivateIOS::rate() const
+{
+    if (!m_mediaPlayerHelper)
+        return false;
+    return [m_mediaPlayerHelper.get() _rate];
+}
+
+void MediaPlayerPrivateIOS::setRate(float inRate)
+{
+    if (!m_mediaPlayerHelper)
+        return;
+    m_requestedRate = inRate;
+    [m_mediaPlayerHelper.get() _setRate:inRate];
+}
+
+void MediaPlayerPrivateIOS::setMuted(bool inMute)
+{
+    if (!m_mediaPlayerHelper)
+        return;
+    [m_mediaPlayerHelper.get() _setMuted:inMute];
+}
+
+int MediaPlayerPrivateIOS::dataRate() const
+{
+    if (!m_mediaPlayerHelper)
+        return 0;
+    return [m_mediaPlayerHelper.get() _dataRate];
+}
+
+MediaPlayer::NetworkState MediaPlayerPrivateIOS::networkState() const 
+{ 
+    return m_networkState;
+}
+
+MediaPlayer::ReadyState MediaPlayerPrivateIOS::readyState() const 
+{
+    return m_readyState;
+}
+
+float MediaPlayerPrivateIOS::maxTimeBuffered() const
+{
+    if (!m_mediaPlayerHelper)
+        return 0;
+    return [m_mediaPlayerHelper.get() _maxTimeBuffered];
+}
+
+bool MediaPlayerPrivateIOS::didLoadingProgress() const
+{
+    if (!m_mediaPlayerHelper)
+        return false;
+    unsigned currentBytesLoaded = [m_mediaPlayerHelper.get() _bytesLoaded];
+    bool didLoadingProgress = currentBytesLoaded != m_bytesLoadedAtLastDidLoadingProgress;
+    m_bytesLoadedAtLastDidLoadingProgress = currentBytesLoaded;
+    return didLoadingProgress;
+}
+
+bool MediaPlayerPrivateIOS::totalBytesKnown() const
+{
+    return totalBytes() &gt; 0;
+}
+
+unsigned MediaPlayerPrivateIOS::totalBytes() const
+{
+    if (!m_mediaPlayerHelper)
+        return 0;
+    return [m_mediaPlayerHelper.get() _totalBytes];
+}
+
+float MediaPlayerPrivateIOS::maxTimeSeekable() const
+{
+    if (!m_mediaPlayerHelper)
+        return 0.0f;
+    return [m_mediaPlayerHelper.get() _maxTimeSeekable];
+}
+
+PassRefPtr&lt;TimeRanges&gt; MediaPlayerPrivateIOS::buffered() const
+{
+    RefPtr&lt;TimeRanges&gt; timeRanges = TimeRanges::create();
+
+    if (!m_mediaPlayerHelper)
+        return timeRanges.release();
+
+    NSArray *ranges = [m_mediaPlayerHelper.get() _bufferedTimeRanges];
+    if (!ranges)
+        return timeRanges.release();
+
+    float timeRange[2];
+    int count = [ranges count];
+    for (int i = 0; i &lt; count; ++i) {
+        NSData *range = [ranges objectAtIndex:i];
+        [range getBytes:timeRange length:(NSUInteger)sizeof(timeRange)];
+
+        timeRanges-&gt;add(timeRange[0], timeRange[1]);
+    }
+
+    return timeRanges.release();
+}
+
+void MediaPlayerPrivateIOS::setSize(const IntSize&amp;)
+{
+    // FIXME: Do we need to do anything here?
+}
+
+void MediaPlayerPrivateIOS::setVisible(bool visible)
+{
+    // FIXME: Do we need to do anything more here?
+    if (m_visible != visible)
+        m_visible = visible;
+}
+
+void MediaPlayerPrivateIOS::paint(GraphicsContext*, const IntRect&amp;)
+{
+    // Nothing to do here.
+}
+
+static HashSet&lt;String&gt; mimeTypeCache()
+{
+    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; typeCache;
+    static bool typeListInitialized = false;
+
+    if (typeListInitialized)
+        return typeCache;
+
+    typeListInitialized = true;
+
+    // FIXME: Should get these from the helper, but we don't have an instance when this is called.
+    static const char* typeList[] = {
+        &quot;application/x-mpegurl&quot;,
+        &quot;application/vnd.apple.mpegurl&quot;,
+        &quot;audio/3gpp&quot;,
+        &quot;audio/3gpp2&quot;,
+        &quot;audio/aac&quot;,
+        &quot;audio/aiff&quot;,
+        &quot;audio/amr&quot;,
+        &quot;audio/basic&quot;,
+        &quot;audio/mp3&quot;,
+        &quot;audio/mp4&quot;,
+        &quot;audio/mpeg&quot;,
+        &quot;audio/mpegurl&quot;,
+        &quot;audio/mpeg3&quot;,
+        &quot;audio/scpls&quot;,
+        &quot;audio/wav&quot;,
+        &quot;audio/x-aac&quot;,
+        &quot;audio/x-aiff&quot;,
+        &quot;audio/x-caf&quot;,
+        &quot;audio/x-m4a&quot;,
+        &quot;audio/x-m4b&quot;,
+        &quot;audio/x-m4p&quot;,
+        &quot;audio/x-m4r&quot;,
+        &quot;audio/x-mp3&quot;,
+        &quot;audio/x-mpeg&quot;,
+        &quot;audio/x-mpeg3&quot;,
+        &quot;audio/x-mpegurl&quot;,
+        &quot;audio/x-scpls&quot;,
+        &quot;audio/x-wav&quot;,
+        &quot;video/3gpp&quot;,
+        &quot;video/3gpp2&quot;,
+        &quot;video/mp4&quot;,
+        &quot;video/quicktime&quot;,
+        &quot;video/x-m4v&quot;,
+
+        // FIXME: This is added to restore old behavior for:
+        // &lt;rdar://problem/9792964&gt; Embedded videos don't play on spiegel.de (.html file redirects)
+        // However, a better fix is tracked by:
+        // &lt;http://webkit.org/b/64811&gt; &lt;video&gt; &quot;.html&quot; src with a 301 redirect fails to load
+        &quot;text/html&quot;,
+    };
+    for (unsigned i = 0; i &lt; WTF_ARRAY_LENGTH(typeList); ++i)
+        typeCache.get().add(typeList[i]);
+
+    return typeCache;
+}
+
+MediaPlayer::SupportsType MediaPlayerPrivateIOS::supportsType(const MediaEngineSupportParameters&amp; parameters)
+{
+    // Only return &quot;IsSupported&quot; if there is no codecs parameter for now as there is no way to ask CoreMedia
+    // if it supports an extended MIME type.
+    if (!parameters.type.isEmpty() &amp;&amp; mimeTypeCache().contains(parameters.type))
+        return parameters.codecs.isEmpty() ? MediaPlayer::MayBeSupported : MediaPlayer::IsSupported;
+
+    return MediaPlayer::IsNotSupported;
+}
+
+void MediaPlayerPrivateIOS::getSupportedTypes(HashSet&lt;String&gt;&amp; types)
+{
+    types = mimeTypeCache();
+}
+
+bool MediaPlayerPrivateIOS::isAvailable()
+{
+    return true;
+}
+
+#if ENABLE(IOS_AIRPLAY)
+bool MediaPlayerPrivateIOS::isCurrentPlaybackTargetWireless() const
+{
+    if (!m_mediaPlayerHelper)
+        return false;
+    return [m_mediaPlayerHelper.get() _isCurrentPlaybackTargetWireless];
+}
+
+void MediaPlayerPrivateIOS::showPlaybackTargetPicker()
+{
+    setDelayCallbacks(true);
+        [m_mediaPlayerHelper.get() _showPlaybackTargetPicker];
+    setDelayCallbacks(false);
+}
+
+bool MediaPlayerPrivateIOS::hasWirelessPlaybackTargets() const
+{
+    if (!m_mediaPlayerHelper)
+        return false;
+    return [m_mediaPlayerHelper.get() _hasWirelessPlaybackTargets];
+}
+
+bool MediaPlayerPrivateIOS::wirelessVideoPlaybackDisabled() const
+{
+    if (!m_mediaPlayerHelper)
+        return false;
+    return [m_mediaPlayerHelper.get() _wirelessVideoPlaybackDisabled];
+}
+
+void MediaPlayerPrivateIOS::setWirelessVideoPlaybackDisabled(bool disabled)
+{
+    setDelayCallbacks(true);
+    {
+        if (m_mediaPlayerHelper) {
+            [m_deferredProperties.get() removeObjectForKey:DeferredWirelessVideoPlaybackDisabled];
+            [m_mediaPlayerHelper.get() _setWirelessVideoPlaybackDisabled:disabled];
+        } else
+            addDeferredRequest(DeferredWirelessVideoPlaybackDisabled, [NSNumber numberWithBool:disabled]);
+    }
+    setDelayCallbacks(false);
+}
+
+void MediaPlayerPrivateIOS::setHasPlaybackTargetAvailabilityListeners(bool hasListeners)
+{
+    [m_mediaPlayerHelper.get() _setHasPlaybackTargetAvailabilityListeners:hasListeners];
+}
+#endif
+
+#if USE(ACCELERATED_COMPOSITING)
+bool MediaPlayerPrivateIOS::supportsAcceleratedRendering() const
+{
+    return true;
+}
+#endif
+
+void MediaPlayerPrivateIOS::enterFullscreen()
+{
+    // The const cast is a workaround due to OpenSource changing the signature to const.
+    MediaPlayerPrivateIOS* mutableThis = const_cast&lt;MediaPlayerPrivateIOS*&gt;(this);
+    mutableThis-&gt;setDelayCallbacks(true);
+    [m_mediaPlayerHelper.get() _enterFullScreen];
+    mutableThis-&gt;setDelayCallbacks(false);
+}
+
+void MediaPlayerPrivateIOS::exitFullscreen()
+{
+    setDelayCallbacks(true);
+    [m_mediaPlayerHelper.get() _exitFullScreen];
+    setDelayCallbacks(false);
+}
+
+void MediaPlayerPrivateIOS::attributeChanged(const String&amp; name, const String&amp; value)
+{
+    if (!m_mediaPlayerHelper) {
+        addDeferredRequest(name, value);
+        return;
+    }
+
+    if (![m_mediaPlayerHelper.get() respondsToSelector:@selector(_attributeChanged:value:)])
+        return;
+
+    setDelayCallbacks(true);
+    [m_mediaPlayerHelper.get() _attributeChanged:name value:value];
+    setDelayCallbacks(false);
+}
+
+bool MediaPlayerPrivateIOS::readyForPlayback() const
+{
+    if ([m_mediaPlayerHelper.get() respondsToSelector:@selector(_readyForPlayback)])
+        return [m_mediaPlayerHelper.get() _readyForPlayback];
+    return MediaPlayerPrivateInterface::readyForPlayback();
+}
+
+bool MediaPlayerPrivateIOS::hasClosedCaptions() const
+{
+    return [m_mediaPlayerHelper.get() _hasClosedCaptions];
+}    
+
+void MediaPlayerPrivateIOS::setClosedCaptionsVisible(bool flag)
+{
+    [m_mediaPlayerHelper.get() _setClosedCaptionsVisible:flag];
+}
+
+void MediaPlayerPrivateIOS::deliverNotification(MediaPlayerProxyNotificationType notification) 
+{
+    LOG(Media, &quot;MediaPlayerPrivateIOS::deliverNotification(%p) - notification = %i, entering with networkState = %i, readyState = %i&quot;, 
+        this, static_cast&lt;int&gt;(notification), static_cast&lt;int&gt;(m_networkState), static_cast&lt;int&gt;(m_readyState));
+
+    if (!m_mediaPlayer)
+        return;
+
+    if (callbacksDelayed()) {
+        [m_objcHelper.get() delayNotification:notification];
+        return;
+    }
+
+    MediaPlayer::NetworkState oldNetworkState = m_networkState;
+    MediaPlayer::ReadyState oldReadyState = m_readyState;
+
+    switch (notification) {
+    case MediaPlayerNotificationStartUsingNetwork:
+        m_usingNetwork = true;
+        if (m_networkState &lt; MediaPlayer::Loading)
+            m_networkState = MediaPlayer::Loading;
+        break;
+    case MediaPlayerNotificationStopUsingNetwork:
+        m_usingNetwork = false;
+        if (m_readyState &lt; MediaPlayer::HaveCurrentData &amp;&amp; m_networkState &lt; MediaPlayer::FormatError)
+            m_networkState = MediaPlayer::Idle;
+        break;
+
+    case MediaPlayerNotificationGainFocus:
+        if (m_networkState &lt; MediaPlayer::Loading)
+            m_networkState = MediaPlayer::Loading;
+        break;
+
+    case MediaPlayerNotificationLoseFocus:
+        if (m_networkState &lt; MediaPlayer::FormatError)
+            m_networkState = MediaPlayer::Idle;
+        if (m_readyState &gt; MediaPlayer::HaveMetadata)
+            m_readyState = MediaPlayer::HaveMetadata;
+        break;
+
+    case MediaPlayerNotificationEnteredFullscreen:
+        m_inFullScreen = true;
+        break;
+
+    case MediaPlayerNotificationExitedFullscreen: {
+        m_inFullScreen = false;
+#if ENABLE(VIDEO_TRACK)
+        setTextTrackRepresentation(0);
+#endif
+        break;
+    }
+
+    case MediaPlayerNotificationReadyForInspection:
+        // The buffering state sometimes reaches &quot;likely to keep up&quot; or &quot;full&quot; before the player item is
+        // ready for inspection. In that case advance directly to HaveEnoughData.
+        if (m_bufferingState &gt; UnlikeleyToKeepUp)
+            m_readyState = MediaPlayer::HaveEnoughData;
+        else
+            m_readyState = MediaPlayer::HaveCurrentData;
+        break;
+
+    case MediaPlayerNotificationMediaValidated:
+        if (m_networkState &lt; MediaPlayer::Idle &amp;&amp; !m_preparingToPlay)
+            m_networkState = MediaPlayer::Idle;
+        processPendingRequests();
+        break;
+
+    case MediaPlayerNotificationMediaFailedToValidate:
+        m_networkState = MediaPlayer::FormatError;
+        m_readyState = MediaPlayer::HaveNothing; 
+        m_usingNetwork = false;
+        m_preparingToPlay = false;
+        break;
+
+    case MediaPlayerNotificationPlaybackFailed: {
+        // FIXME: We can't currently tell the difference between NetworkError and DecodeError.
+        m_networkState = MediaPlayer::DecodeError;
+
+        // Don't reset readyState, what we have loaded already may be playable.
+        m_usingNetwork = false;
+        break;
+    }
+
+    case MediaPlayerNotificationReadyForPlayback:
+        if (m_networkState &lt; MediaPlayer::Loading)
+            m_networkState = MediaPlayer::Loading;
+        m_readyState = MediaPlayer::HaveFutureData;
+        break;
+
+    case MediaPlayerNotificationDidPlayToTheEnd:
+        m_mediaPlayer-&gt;timeChanged();
+        break;
+
+    case MediaPlayerNotificationStreamLikelyToKeepUp:
+        if (m_networkState &lt; MediaPlayer::Loading)
+            m_networkState = MediaPlayer::Loading;
+        if (m_readyState &gt; MediaPlayer::HaveMetadata &amp;&amp; m_readyState &lt; MediaPlayer::HaveEnoughData)
+            m_readyState = MediaPlayer::HaveEnoughData;
+        m_bufferingState = LikeleyToKeepUp;
+        break;
+
+    case MediaPlayerNotificationStreamBufferFull:
+        // The media buffers are full so no more data can be loaded. This isn't really the the same thing as 
+        // &quot;HaveFutureData&quot;, but nothing more will be loaded until playback consumes some of the buffered data
+        // so bump the readyState to allow playback.
+        if (m_readyState &gt; MediaPlayer::HaveMetadata &amp;&amp; m_readyState &lt; MediaPlayer::HaveEnoughData)
+            m_readyState = MediaPlayer::HaveFutureData;
+        m_networkState = MediaPlayer::Idle;
+        m_bufferingState = Full;
+        break;
+
+    case MediaPlayerNotificationStreamRanDry:
+        m_networkState = MediaPlayer::Loading;
+        if (m_readyState &gt; MediaPlayer::HaveMetadata)
+            m_readyState = MediaPlayer::HaveCurrentData;
+        m_bufferingState = Empty;
+        break;
+
+    case MediaPlayerNotificationStreamUnlikelyToKeepUp:
+        m_networkState = MediaPlayer::Loading;
+        if (m_readyState &gt; MediaPlayer::HaveMetadata &amp;&amp; m_readyState &lt; MediaPlayer::HaveEnoughData)
+            m_readyState = MediaPlayer::HaveFutureData;
+        m_bufferingState = UnlikeleyToKeepUp;
+        break;
+
+    case MediaPlayerNotificationFileLoaded:
+        m_networkState = MediaPlayer::Loaded;
+        m_readyState = MediaPlayer::HaveEnoughData;
+        break;
+
+    case MediaPlayerNotificationTimeJumped:
+        // Sometimes get a spurious &quot;time jumped&quot; when the movie is being set up or immediately after pausing, 
+        // don't fall for it.
+        if (m_readyState &gt;= MediaPlayer::HaveCurrentData)
+            m_mediaPlayer-&gt;timeChanged();
+        break;
+
+    case MediaPlayerNotificationMutedDidChange:
+    case MediaPlayerNotificationVolumeDidChange:
+        ++m_changingVolume;
+        m_mediaPlayer-&gt;volumeChanged(volume());
+        --m_changingVolume;
+        break;
+
+    case MediaPlayerNotificationSizeDidChange:
+        break;
+
+    case MediaPlayerNotificationPlayPauseButtonPressed:
+    case MediaPlayerRequestBeginPlayback:
+    case MediaPlayerRequestPausePlayback:
+        break;
+
+    case MediaPlayerNotificationRateDidChange:
+        m_preparingToPlay = false;
+        if (m_pauseRequested &amp;&amp; rate())
+            m_pauseRequested = false;
+        break;
+
+#if ENABLE(IOS_AIRPLAY)
+    case MediaPlayerNotificationCurrentPlaybackTargetIsWirelessChanged:
+        m_mediaPlayer-&gt;currentPlaybackTargetIsWirelessChanged();
+        break;
+
+    case MediaPlayerNotificationPlaybackTargetAvailabilityChanged:
+        m_mediaPlayer-&gt;playbackTargetAvailabilityChanged();
+        break;
+#endif
+    }
+
+    if (m_networkState != oldNetworkState)
+        m_mediaPlayer-&gt;networkStateChanged();
+    if (m_readyState != oldReadyState)
+        m_mediaPlayer-&gt;readyStateChanged();
+
+    LOG(Media, &quot;MediaPlayerPrivateIOS::deliverNotification(%p) - exiting with networkState = %i, readyState = %i&quot;, 
+        this, static_cast&lt;int&gt;(m_networkState), static_cast&lt;int&gt;(m_readyState));
+}
+
+#if ENABLE(VIDEO_TRACK)
+bool MediaPlayerPrivateIOS::requiresTextTrackRepresentation() const
+{
+    return m_inFullScreen;
+}
+
+void MediaPlayerPrivateIOS::setTextTrackRepresentation(TextTrackRepresentation* representation)
+{
+    [m_mediaPlayerHelper.get() _setTextTrackRepresentation:representation ? representation-&gt;platformLayer() : nullptr];
+}
+
+void MediaPlayerPrivateIOS::inbandTextTracksChanged(NSArray *tracks)
+{
+    Vector&lt;RefPtr&lt;InbandTextTrackPrivateAVFIOS&gt; &gt; removedTextTracks = m_textTracks;
+
+    for (NSDictionary *trackInfo in tracks) {
+        bool newTrack = true;
+        NSNumber *trackIDValue  = [trackInfo objectForKey:TextTrackIDKey];
+
+        if (![trackIDValue isKindOfClass:[NSNumber class]]) {
+            NSLog(@&quot;Unexpected track ID, ignoring.&quot;);
+            continue;
+        }
+
+        int trackID = [trackIDValue intValue];
+        for (unsigned i = removedTextTracks.size(); i &gt; 0; --i) {
+            RefPtr&lt;InbandTextTrackPrivateAVFIOS&gt; track = static_cast&lt;InbandTextTrackPrivateAVFIOS*&gt;(removedTextTracks[i - 1].get());
+
+            if (track-&gt;internalID() == trackID) {
+                removedTextTracks.remove(i - 1);
+                newTrack = false;
+                break;
+            }
+        }
+        if (!newTrack)
+            continue;
+
+        NSString *name = [trackInfo objectForKey:TextTrackDisplayNameKey];
+        NSString *language = [trackInfo objectForKey:TextTrackLocaleIdentifierKey];
+        NSString *type = [trackInfo objectForKey:TextTrackTypeKey];
+
+        LOG(Media, &quot;MediaPlayerPrivateIOS::inbandTextTracksChanged(%p) - adding track id %i, name = %s, language = %s, type = %s&quot;, this, trackID, [name UTF8String], [language UTF8String], [type UTF8String]);
+
+        m_textTracks.append(InbandTextTrackPrivateAVFIOS::create(this, trackID, name, language, type));
+    }
+
+    if (removedTextTracks.size()) {
+        for (unsigned i = m_textTracks.size(); i &gt; 0; --i) {
+            RefPtr&lt;InbandTextTrackPrivateAVFIOS&gt; track = static_cast&lt;InbandTextTrackPrivateAVFIOS*&gt;(m_textTracks[i - 1].get());
+
+            if (!removedTextTracks.contains(track))
+                continue;
+
+            if (m_currentTrack == track.get())
+                m_currentTrack = nullptr;
+            m_mediaPlayer-&gt;removeTextTrack(track);
+            m_textTracks.remove(i - 1);
+        }
+    }
+
+    for (unsigned i = 0; i &lt; m_textTracks.size(); ++i) {
+        RefPtr&lt;InbandTextTrackPrivateAVFIOS&gt; track = static_cast&lt;InbandTextTrackPrivateAVFIOS*&gt;(m_textTracks[i].get());
+
+        track-&gt;setTextTrackIndex(i);
+        if (track-&gt;hasBeenReported())
+            continue;
+
+        track-&gt;setHasBeenReported(true);
+        m_mediaPlayer-&gt;addTextTrack(track.get());
+    }
+    LOG(Media, &quot;MediaPlayerPrivateIOS::inbandTextTracksChanged(%p) - found %i in-band tracks&quot;, this, m_textTracks.size());
+}
+
+void MediaPlayerPrivateIOS::setSelectedTextTrack(NSNumber *trackID)
+{
+    if (![trackID isKindOfClass:[NSNumber class]]) {
+        NSLog(@&quot;Unexpected track ID, ignoring.&quot;);
+        return;
+    }
+
+    if (!m_mediaPlayerHelper) {
+        addDeferredRequest(DeferredPropertySelectedTrackKey, trackID);
+        return;
+    }
+
+    if (![m_mediaPlayerHelper.get() respondsToSelector:@selector(_setSelectedTextTrack:)])
+        return;
+
+    setDelayCallbacks(true);
+    {
+        LOG(Media, &quot;MediaPlayerPrivateIOS::setCurrentTrack(%p) - selecting track id %i&quot;, this, [trackID intValue]);
+        [m_deferredProperties.get() removeObjectForKey:DeferredPropertySelectedTrackKey];
+        [m_mediaPlayerHelper.get() _setSelectedTextTrack:trackID];
+    }
+    setDelayCallbacks(false);
+}
+
+void MediaPlayerPrivateIOS::trackModeChanged()
+{
+    RefPtr&lt;InbandTextTrackPrivateAVF&gt; trackToEnable;
+
+    // AVFoundation can only emit cues for one track at a time, so enable the first track that is showing, or the first that
+    // is hidden if none are showing. Otherwise disable all tracks.
+    for (unsigned i = 0; i &lt; m_textTracks.size(); ++i) {
+        RefPtr&lt;InbandTextTrackPrivateAVFIOS&gt; track = m_textTracks[i];
+        if (track-&gt;mode() == InbandTextTrackPrivate::Showing) {
+            trackToEnable = track;
+            break;
+        }
+        if (!trackToEnable &amp;&amp; track-&gt;mode() == InbandTextTrackPrivate::Hidden)
+            trackToEnable = track;
+    }
+
+    InbandTextTrackPrivateAVFIOS* trackPrivate = static_cast&lt;InbandTextTrackPrivateAVFIOS*&gt;(trackToEnable.get());
+    if (m_currentTrack == trackPrivate)
+        return;
+
+    m_currentTrack = trackPrivate;
+    setSelectedTextTrack(trackPrivate ? [NSNumber numberWithInt:trackPrivate-&gt;internalID()] : nil);
+}
+
+void MediaPlayerPrivateIOS::clearTextTracks()
+{
+    m_currentTrack = nullptr;
+    for (unsigned i = 0; i &lt; m_textTracks.size(); ++i) {
+        RefPtr&lt;InbandTextTrackPrivateAVFIOS&gt; track = m_textTracks[i];
+        m_mediaPlayer-&gt;removeTextTrack(track);
+        track-&gt;disconnect();
+    }
+    m_textTracks.clear();
+}
+
+void MediaPlayerPrivateIOS::processInbandTextTrackCue(NSArray *attributedStrings, double time)
+{
+    if (!m_currentTrack)
+        return;
+
+    m_currentTrack-&gt;processCue(reinterpret_cast&lt;CFArrayRef&gt;(attributedStrings), time);
+}
+
+void MediaPlayerPrivateIOS::setOutOfBandTextTracks(NSArray *tracksArray)
+{
+    if (!m_mediaPlayerHelper) {
+        addDeferredRequest(DeferredPropertyOutOfBandTracksKey, tracksArray);
+        return;
+    }
+
+    if (![m_mediaPlayerHelper.get() respondsToSelector:@selector(_setOutOfBandTextTracks:)])
+        return;
+
+    setDelayCallbacks(true);
+    {
+        [m_deferredProperties.get() removeObjectForKey:DeferredPropertyOutOfBandTracksKey];
+        [m_mediaPlayerHelper.get() _setOutOfBandTextTracks:tracksArray];
+    }
+    setDelayCallbacks(false);
+}
+
+static int platformTrackID(PlatformTextTrack* platformTrack)
+{
+    if (platformTrack-&gt;type() == PlatformTextTrack::InBand) {
+        InbandTextTrackPrivateAVFIOS* trackPrivate = static_cast&lt;InbandTextTrackPrivateAVFIOS*&gt;(platformTrack-&gt;client()-&gt;privateTrack());
+        return trackPrivate ? trackPrivate-&gt;internalID() : 0;
+    }
+
+    return platformTrack-&gt;uniqueId();
+}
+
+void MediaPlayerPrivateIOS::outOfBandTextTracksChanged()
+{
+    if (!m_menuInterface-&gt;client())
+        return;
+
+    RetainPtr&lt;NSMutableArray&gt; tracksArray = adoptNS([[NSMutableArray alloc] init]);
+    Vector&lt;RefPtr&lt;PlatformTextTrack&gt; &gt; textTracks = m_menuInterface-&gt;client()-&gt;platformTextTracks();
+
+    for (unsigned i = 0; i &lt; textTracks.size(); ++i) {
+        RefPtr&lt;PlatformTextTrack&gt; platformTrack = textTracks[i];
+
+        if (platformTrack-&gt;type() == PlatformTextTrack::InBand)
+            continue;
+        if (platformTrack-&gt;kind() != PlatformTextTrack::Subtitle &amp;&amp; platformTrack-&gt;kind() != PlatformTextTrack::Caption)
+            continue;
+
+        RetainPtr&lt;NSMutableDictionary&gt; track = adoptNS([[NSMutableDictionary alloc] init]);
+
+        [track.get() setObject:platformTrack-&gt;label() forKey:TextTrackDisplayNameKey];
+
+        if (!platformTrack-&gt;language().isEmpty())
+            [track.get() setObject:platformTrack-&gt;language() forKey:TextTrackLocaleIdentifierKey];
+
+        NSString *type = platformTrack-&gt;kind() == PlatformTextTrack::Subtitle ? TextTrackSubtitlesKey : TextTrackCaptionsKey;
+        [track.get() setObject:type forKey:TextTrackTypeKey];
+
+        [track.get() setObject:[NSNumber numberWithInt:platformTrackID(platformTrack.get())] forKey:TextTrackIDKey];
+
+        [tracksArray addObject:track.get()];
+    }
+
+    if (![tracksArray.get() count])
+        return;
+
+    setOutOfBandTextTracks(tracksArray.get());
+}
+
+void MediaPlayerPrivateIOS::textTrackWasSelectedByMediaElement(PassRefPtr&lt;PlatformTextTrack&gt; platformTrack)
+{
+    setSelectedTextTrack([NSNumber numberWithInt:platformTrackID(platformTrack.get())]);
+}
+
+void MediaPlayerPrivateIOS::textTrackWasSelectedByPlugin(NSDictionary *trackInfo)
+{
+    if (!m_menuInterface || !m_menuInterface-&gt;client())
+        return;
+
+    if (!trackInfo) {
+        m_menuInterface-&gt;client()-&gt;setSelectedTextTrack(0);
+        return;
+    }
+
+    RefPtr&lt;PlatformTextTrack&gt; trackToSelect;
+    NSNumber *trackIDToSelect  = [trackInfo objectForKey:TextTrackIDKey];
+    if (![trackIDToSelect isKindOfClass:[NSNumber class]]) {
+        NSLog(@&quot;Unexpected track ID, ignoring.&quot;);
+        return;
+    }
+
+    int trackID = [trackIDToSelect intValue];
+    if (trackID == TextTrackOffMenuItemID)
+        trackToSelect = PlatformTextTrack::captionMenuOffItem();
+    else if (trackID == TextTrackAutoMenuItemID)
+        trackToSelect = PlatformTextTrack::captionMenuAutomaticItem();
+    else {
+        Vector&lt;RefPtr&lt;PlatformTextTrack&gt; &gt; textTracks = m_menuInterface-&gt;client()-&gt;platformTextTracks();
+        for (unsigned i = 0; i &lt; textTracks.size(); ++i) {
+            RefPtr&lt;PlatformTextTrack&gt; platformTrack = textTracks[i];
+
+            if (trackID == platformTrackID(platformTrack.get())) {
+                trackToSelect = platformTrack;
+                break;
+            }
+        }
+    }
+
+    if (!trackToSelect) {
+        NSLog(@&quot;Text track ID %i is unknown, ignoring.&quot;, trackID);
+        return;
+    }
+
+    m_menuInterface-&gt;client()-&gt;setSelectedTextTrack(trackToSelect);
+}
+
+PassRefPtr&lt;PlatformTextTrackMenuInterface&gt; MediaPlayerPrivateIOS::textTrackMenu()
+{
+    if (!m_menuInterface)
+        m_menuInterface = PlatformTextTrackMenuInterfaceIOS::create(this);
+    return m_menuInterface;
+}
+#endif // ENABLE(VIDEO_TRACK)
+
+} // namespace WebCore
+
+@implementation WebCoreMediaPlayerNotificationHelper
+
+- (id)initWithClient:(MediaPlayerPrivateIOS *)client
+{
+    _client = client;
+    return [super init];
+}
+
+- (void)disconnect
+{
+    [NSObject cancelPreviousPerformRequestsWithTarget:self];
+    _client = 0;
+}
+
+- (void)cancelPendingRequests
+{
+    [NSObject cancelPreviousPerformRequestsWithTarget:self];
+}
+
+- (void)delayNotification:(int)notification
+{
+    if (_client)
+        [self performSelector:@selector(deliverNotification:) withObject:[NSNumber numberWithInt:notification] afterDelay:0];
+}
+
+- (void)deliverNotification:(NSNumber *)notification
+{
+    if (!_client)
+        return;
+    if (_client-&gt;callbacksDelayed())
+        [self delayNotification:[notification intValue]];
+    else
+        _client-&gt;deliverNotification((MediaPlayerProxyNotificationType)[notification intValue]);
+}
+
+- (void)schedulePrepareToPlayWithOptionalDelay:(NSNumber *)shouldDelay
+{
+    if (!_client)
+        return;
+    if ([shouldDelay boolValue])
+        [self performSelector:@selector(schedulePrepareToPlayWithOptionalDelay:) withObject:[NSNumber numberWithBool:NO] afterDelay:0];
+    else
+        _client-&gt;prepareToPlay();
+}
+
+- (void)scheduleDeferredPropertiesWithOptionalDelay:(NSNumber *)shouldDelay
+{
+    if (!_client)
+        return;
+
+    if ([shouldDelay boolValue]) {
+        if (!_deferredPropertiesScheduled) {
+            [self performSelector:@selector(scheduleDeferredPropertiesWithOptionalDelay:) withObject:[NSNumber numberWithBool:NO] afterDelay:0];
+            _deferredPropertiesScheduled = YES;
+        }
+        return;
+    }
+
+    _deferredPropertiesScheduled = NO;
+    _client-&gt;processDeferredRequests();
+}
+
+- (void)pluginElementInBandAlternateTextTracksDidChange:(NSArray *)tracks
+{
+    if (!_client)
+        return;
+
+    WebThreadRun(^{
+        if (!_client)
+            return;
+        _client-&gt;inbandTextTracksChanged(tracks);
+    });
+}
+
+- (void)pluginElementDidSelectTextTrack:(NSDictionary *)trackInfo
+{
+    if (!_client)
+        return;
+
+    WebThreadRun(^{
+        if (!_client)
+            return;
+        _client-&gt;textTrackWasSelectedByPlugin(trackInfo);
+    });
+}
+
+- (void)pluginElementDidOutputAttributedStrings:(NSArray *)strings nativeSampleBuffers:(NSArray *)buffers forTime:(NSTimeInterval)time
+{
+    UNUSED_PARAM(buffers);
+
+    if (!_client)
+        return;
+
+    WebThreadRun(^{
+        if (!_client)
+            return;
+        _client-&gt;processInbandTextTrackCue(strings, time);
+    });
+}
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosSimpleFontDataIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/SimpleFontDataIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,212 @@
</span><ins>+/*
+ * Copyright (C) 2005, 2006, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Alexey Proskuryakov
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;SimpleFontData.h&quot;
+
+#import &quot;BlockExceptions.h&quot;
+#import &quot;Font.h&quot;
+#import &quot;FontCache.h&quot;
+#import &quot;FontDescription.h&quot;
+#import &quot;FontServicesIOS.h&quot;
+#import &lt;CoreGraphics/CGFontGlyphSupport.h&gt;
+#import &lt;CoreGraphics/CGFontInfo.h&gt;
+#import &lt;CoreGraphics/CGFontRendering.h&gt;
+#import &lt;CoreText/CoreText.h&gt;
+#import &lt;float.h&gt;
+#import &lt;unicode/uchar.h&gt;
+#import &lt;wtf/Assertions.h&gt;
+#import &lt;wtf/StdLibExtras.h&gt;
+
+namespace WebCore {
+
+static bool fontFamilyShouldNotBeUsedForArabic(CFStringRef fontFamilyName)
+{
+    if (!fontFamilyName)
+        return false;
+
+    // Times New Roman contains Arabic glyphs, but Core Text doesn't know how to shape them. &lt;rdar://problem/9823975&gt;
+    // FIXME &lt;rdar://problem/12096835&gt; remove this function once the above bug is fixed.
+    // Arial and Tahoma are have performance issues so don't use them as well.
+    return (CFStringCompare(CFSTR(&quot;Times New Roman&quot;), fontFamilyName, 0) == kCFCompareEqualTo)
+           || (CFStringCompare(CFSTR(&quot;Arial&quot;), fontFamilyName, 0) == kCFCompareEqualTo)
+           || (CFStringCompare(CFSTR(&quot;Tahoma&quot;), fontFamilyName, 0) == kCFCompareEqualTo);
+}
+
+static bool fontHasVerticalGlyphs(CTFontRef ctFont)
+{
+    // The check doesn't look neat but this is what AppKit does for vertical writing...
+    RetainPtr&lt;CFArrayRef&gt; tableTags = adoptCF(CTFontCopyAvailableTables(ctFont, kCTFontTableOptionNoOptions));
+    CFIndex numTables = CFArrayGetCount(tableTags.get());
+    for (CFIndex index = 0; index &lt; numTables; ++index) {
+        CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tableTags.get(), index);
+        if (tag == kCTFontTableVhea || tag == kCTFontTableVORG)
+            return true;
+    }
+    return false;
+}
+
+void SimpleFontData::platformInit()
+{
+    m_syntheticBoldOffset = m_platformData.m_syntheticBold ? ceilf(m_platformData.size()  / 24.0f) : 0.f;
+    m_spaceGlyph = 0;
+    m_spaceWidth = 0;
+    unsigned unitsPerEm;
+    float ascent;
+    float descent;
+    float lineGap;
+    float lineSpacing;
+    float xHeight;
+    RetainPtr&lt;CFStringRef&gt; familyName;
+    if (CTFontRef ctFont = m_platformData.font()) {
+        FontServicesIOS fontService(ctFont);
+        ascent = ceilf(fontService.ascent());
+        descent = ceilf(fontService.descent());
+        lineSpacing = fontService.lineSpacing();
+        lineGap = fontService.lineGap();
+        xHeight = fontService.xHeight();
+        unitsPerEm = fontService.unitsPerEm();
+        familyName = adoptCF(CTFontCopyFamilyName(ctFont));
+    } else {
+        CGFontRef cgFont = m_platformData.cgFont();
+
+        unitsPerEm = CGFontGetUnitsPerEm(cgFont);
+
+        float pointSize = m_platformData.size();
+        ascent = lroundf(scaleEmToUnits(CGFontGetAscent(cgFont), unitsPerEm) * pointSize);
+        descent = lroundf(-scaleEmToUnits(-abs(CGFontGetDescent(cgFont)), unitsPerEm) * pointSize);
+        lineGap = lroundf(scaleEmToUnits(CGFontGetLeading(cgFont), unitsPerEm) * pointSize);
+        xHeight = scaleEmToUnits(CGFontGetXHeight(cgFont), unitsPerEm) * pointSize;
+
+        lineSpacing = ascent + descent + lineGap;
+        familyName = adoptCF(CGFontCopyFamilyName(cgFont));
+    }
+
+    m_fontMetrics.setUnitsPerEm(unitsPerEm);
+    m_fontMetrics.setAscent(ascent);
+    m_fontMetrics.setDescent(descent);
+    m_fontMetrics.setLineGap(lineGap);
+    m_fontMetrics.setLineSpacing(lineSpacing);
+    m_fontMetrics.setXHeight(xHeight);
+    m_shouldNotBeUsedForArabic = fontFamilyShouldNotBeUsedForArabic(familyName.get());
+
+    if (platformData().orientation() == Vertical &amp;&amp; !isTextOrientationFallback())
+        m_hasVerticalGlyphs = fontHasVerticalGlyphs(m_platformData.ctFont());
+
+    if (!m_platformData.m_isEmoji)
+        return;
+
+    int thirdOfSize = m_platformData.size() / 3;
+    m_fontMetrics.setAscent(thirdOfSize);
+    m_fontMetrics.setDescent(thirdOfSize);
+    m_fontMetrics.setLineGap(thirdOfSize);
+    m_fontMetrics.setLineSpacing(0);
+}
+
+void SimpleFontData::platformCharWidthInit()
+{
+    m_avgCharWidth = 0;
+    m_maxCharWidth = 0;
+
+    // Fallback to a cross-platform estimate, which will populate these values if they are non-positive.
+    initCharWidths();
+}
+
+PassRefPtr&lt;SimpleFontData&gt; SimpleFontData::platformCreateScaledFontData(const FontDescription&amp;, float scaleFactor) const
+{
+    if (isCustomFont()) {
+        FontPlatformData scaledFontData(m_platformData);
+        scaledFontData.m_size = scaledFontData.m_size * scaleFactor;
+        return SimpleFontData::create(scaledFontData, true, false);
+    }
+
+    float size = m_platformData.size() * scaleFactor;
+    CTFontSymbolicTraits fontTraits = CTFontGetSymbolicTraits(m_platformData.font());
+    RetainPtr&lt;CTFontDescriptorRef&gt; fontDescriptor = adoptCF(CTFontCopyFontDescriptor(m_platformData.font()));
+    RetainPtr&lt;CTFontRef&gt; scaledFont = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), size, nullptr));
+    FontPlatformData scaledFontData(scaledFont.get(), size, m_platformData.isPrinterFont(), false, false, m_platformData.orientation());
+
+    if (scaledFontData.font()) {
+        if (m_platformData.m_syntheticBold)
+            fontTraits |= kCTFontBoldTrait;
+        if (m_platformData.m_syntheticOblique)
+            fontTraits |= kCTFontItalicTrait;
+
+        CTFontSymbolicTraits scaledFontTraits = CTFontGetSymbolicTraits(scaledFontData.font());
+        scaledFontData.m_syntheticBold = (fontTraits &amp; kCTFontBoldTrait) &amp;&amp; !(scaledFontTraits &amp; kCTFontTraitBold);
+        scaledFontData.m_syntheticOblique = (fontTraits &amp; kCTFontItalicTrait) &amp;&amp; !(scaledFontTraits &amp; kCTFontTraitItalic);
+
+        return fontCache()-&gt;getCachedFontData(&amp;scaledFontData);
+    }
+
+    return nullptr;
+}
+
+bool SimpleFontData::containsCharacters(const UChar*, int) const
+{
+    return false;
+}
+
+void SimpleFontData::determinePitch()
+{
+    CTFontRef ctFont = m_platformData.font();
+    m_treatAsFixedPitch = false;
+    if (!ctFont)
+        return; // CTFont is null in the case of SVG fonts for example.
+
+    RetainPtr&lt;CFStringRef&gt; fullName = adoptCF(CTFontCopyFullName(ctFont));
+    RetainPtr&lt;CFStringRef&gt; familyName = adoptCF(CTFontCopyFamilyName(ctFont));
+
+    m_treatAsFixedPitch = CGFontIsFixedPitch(m_platformData.cgFont()) || (fullName &amp;&amp; (CFStringCompare(fullName.get(), CFSTR(&quot;Osaka-Mono&quot;), kCFCompareCaseInsensitive) == kCFCompareEqualTo || CFStringCompare(fullName.get(), CFSTR(&quot;MS-PGothic&quot;), kCFCompareCaseInsensitive) == kCFCompareEqualTo));
+    if (familyName &amp;&amp; CFStringCompare(familyName.get(), CFSTR(&quot;Courier New&quot;), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
+        // Special case Courier New to not be treated as fixed pitch, as this will make use of a hacked space width which is undesireable for iPhone (see rdar://6269783).
+        m_treatAsFixedPitch = false;
+    }
+}
+
+float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
+{
+    CGSize advance = CGSizeZero;
+    if (platformData().orientation() == Horizontal || m_isBrokenIdeographFallback) {
+        if (platformData().m_isEmoji)
+            CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), kCTFontHorizontalOrientation, &amp;glyph, &amp;advance, 1);
+        else {
+            float pointSize = platformData().m_size;
+            CGAffineTransform transform = CGAffineTransformMakeScale(pointSize, pointSize);
+            static const CGFontRenderingStyle renderingStyle = kCGFontRenderingStyleAntialiasing | kCGFontRenderingStyleSubpixelPositioning | kCGFontRenderingStyleSubpixelQuantization | kCGFontAntialiasingStyleUnfiltered;
+            if (!CGFontGetGlyphAdvancesForStyle(platformData().cgFont(), &amp;transform, renderingStyle, &amp;glyph, 1, &amp;advance)) {
+                RetainPtr&lt;CFStringRef&gt; fullName = adoptCF(CGFontCopyFullName(platformData().cgFont()));
+                LOG_ERROR(&quot;Unable to cache glyph widths for %@ %f&quot;, fullName.get(), pointSize);
+                advance.width = 0;
+            }
+        }
+    } else
+        CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), kCTFontVerticalOrientation, &amp;glyph, &amp;advance, 1);
+
+    return advance.width + m_syntheticBoldOffset;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosTextTrackRepresentationIOShfromrev161588trunkSourceWebCoreplatformgraphicsTextTrackRepresentationcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.h (from rev 161588, trunk/Source/WebCore/platform/graphics/TextTrackRepresentation.cpp) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TextTrackRepresentationIOS_h
+#define TextTrackRepresentationIOS_h
+
+#if PLATFORM(IOS) &amp;&amp; ENABLE(VIDEO_TRACK)
+
+#import &quot;TextTrackRepresentation.h&quot;
+#import &lt;QuartzCore/CALayer.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+@class WebCoreTextTrackRepresentationIOSHelper;
+
+namespace WebCore {
+
+class TextTrackRepresentationIOS : public TextTrackRepresentation {
+public:
+    TextTrackRepresentationIOS(TextTrackRepresentationClient*);
+    virtual ~TextTrackRepresentationIOS();
+
+    virtual void update() OVERRIDE;
+    virtual PlatformLayer* platformLayer() OVERRIDE { return m_layer.get(); }
+    virtual void setContentScale(float) OVERRIDE;
+    virtual IntRect bounds() const OVERRIDE;
+
+    TextTrackRepresentationClient* client() const { return m_client; }
+
+private:
+    TextTrackRepresentationClient* m_client;
+    RetainPtr&lt;CALayer&gt; m_layer;
+    RetainPtr&lt;WebCoreTextTrackRepresentationIOSHelper&gt; m_delegate;
+};
+
+}
+
+#endif // PLATFORM(IOS) &amp;&amp; ENABLE(VIDEO_TRACK)
+
+#endif // TextTrackRepresentationIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosTextTrackRepresentationIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,136 @@
</span><ins>+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#if PLATFORM(IOS) &amp;&amp; ENABLE(VIDEO_TRACK)
+
+#include &quot;TextTrackRepresentationIOS.h&quot;
+
+#include &quot;FloatRect.h&quot;
+#include &quot;GraphicsContextCG.h&quot;
+#include &quot;WebCoreThread.h&quot;
+#include &quot;WebCoreThreadRun.h&quot;
+#include &lt;wtf/OwnPtr.h&gt;
+
+using namespace WebCore;
+
+@interface WebCoreTextTrackRepresentationIOSHelper : NSObject {
+    TextTrackRepresentationIOS* _parent;
+}
+- (id)initWithParent:(TextTrackRepresentationIOS*)parent;
+@property (assign) TextTrackRepresentationIOS* parent;
+@end
+
+@implementation WebCoreTextTrackRepresentationIOSHelper
+- (id)initWithParent:(TextTrackRepresentationIOS*)parent
+{
+    if (!(self = [super init]))
+        return nil;
+
+    self.parent = parent;
+
+    return self;
+}
+
+- (void)dealloc
+{
+    self.parent = nil;
+    [super dealloc];
+}
+
+- (void)setParent:(TextTrackRepresentationIOS*)parent
+{
+    if (_parent)
+        [_parent-&gt;platformLayer() removeObserver:self forKeyPath:@&quot;bounds&quot;];
+
+    _parent = parent;
+
+    if (_parent)
+        [_parent-&gt;platformLayer() addObserver:self forKeyPath:@&quot;bounds&quot; options:nil context:0];
+}
+
+- (TextTrackRepresentationIOS*)parent
+{
+    return _parent;
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+    UNUSED_PARAM(change);
+    UNUSED_PARAM(context);
+    WebThreadRun(^{
+        if (_parent &amp;&amp; [keyPath isEqual:@&quot;bounds&quot;] &amp;&amp; object == _parent-&gt;platformLayer())
+            _parent-&gt;client()-&gt;textTrackRepresentationBoundsChanged(_parent-&gt;bounds());
+    });
+}
+
+- (id)actionForLayer:(CALayer *)layer forKey:(NSString *)event
+{
+    UNUSED_PARAM(layer);
+    UNUSED_PARAM(event);
+    // Returning a NSNull from this delegate method disables all implicit CALayer actions.
+    return [NSNull null];
+}
+
+@end
+
+PassOwnPtr&lt;TextTrackRepresentation&gt; TextTrackRepresentation::create(TextTrackRepresentationClient* client)
+{
+    return adoptPtr(new TextTrackRepresentationIOS(client));
+}
+
+TextTrackRepresentationIOS::TextTrackRepresentationIOS(TextTrackRepresentationClient* client)
+    : m_client(client)
+    , m_layer(adoptNS([[CALayer alloc] init]))
+    , m_delegate(adoptNS([[WebCoreTextTrackRepresentationIOSHelper alloc] initWithParent:this]))
+{
+    [m_layer.get() setDelegate:m_delegate.get()];
+    [m_layer.get() setContentsGravity:kCAGravityBottom];
+}
+
+TextTrackRepresentationIOS::~TextTrackRepresentationIOS()
+{
+    [m_layer.get() setDelegate:nil];
+    [m_delegate.get() setParent:0];
+}
+
+void TextTrackRepresentationIOS::update()
+{
+    if (RefPtr&lt;Image&gt; representation = m_client-&gt;createTextTrackRepresentationImage())
+        [m_layer.get() setContents:(id)representation-&gt;getCGImageRef()];
+}
+
+void TextTrackRepresentationIOS::setContentScale(float scale)
+{
+    [m_layer.get() setContentsScale:scale];
+}
+
+IntRect TextTrackRepresentationIOS::bounds() const
+{
+    return enclosingIntRect(FloatRect([m_layer.get() bounds]));
+}
+
+#endif // PLATFORM(IOS) &amp;&amp; ENABLE(VIDEO_TRACK)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacColorMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ColorMac.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ColorMac.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/ColorMac.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -31,13 +31,17 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Color.h&quot;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> OBJC_CLASS NSColor;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     // These functions assume NSColors are in DeviceRGB colorspace
</span><span class="cx">     Color colorFromNSColor(NSColor *);
</span><span class="cx">     NSColor *nsColor(const Color&amp;);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     bool usesTestModeFocusRingColor();
</span><span class="cx">     void setUsesTestModeFocusRingColor(bool);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -31,7 +31,11 @@
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #include &quot;TextBreakIterator.h&quot;
</span><span class="cx"> #include &quot;TextRun.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreText/CoreText.h&gt;
+#endif
</ins><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/unicode/CharacterNames.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -572,6 +576,9 @@
</span><span class="cx">         ComplexTextRun&amp; complexTextRun = *m_complexTextRuns[r];
</span><span class="cx">         unsigned glyphCount = complexTextRun.glyphCount();
</span><span class="cx">         const SimpleFontData* fontData = complexTextRun.fontData();
</span><ins>+#if PLATFORM(IOS)
+        bool isEmoji = fontData-&gt;platformData().m_isEmoji;
+#endif
</ins><span class="cx"> 
</span><span class="cx">         // Represent the initial advance for a text run by adjusting the advance
</span><span class="cx">         // of the last glyph of the previous text run in the glyph buffer.
</span><span class="lines">@@ -620,6 +627,10 @@
</span><span class="cx">             bool treatAsSpace = Font::treatAsSpace(ch);
</span><span class="cx">             CGGlyph glyph = treatAsSpace ? fontData-&gt;spaceGlyph() : glyphs[i];
</span><span class="cx">             CGSize advance = treatAsSpace ? CGSizeMake(spaceWidth, advances[i].height) : advances[i];
</span><ins>+#if PLATFORM(IOS)
+            if (isEmoji &amp;&amp; advance.width)
+                advance.width = fontData-&gt;widthForGlyph(glyph);
+#endif
</ins><span class="cx"> 
</span><span class="cx">             if (ch == '\t' &amp;&amp; m_run.allowTabs())
</span><span class="cx">                 advance.width = m_font.tabWidth(*fontData, m_run.tabSize(), m_run.xPos() + m_totalWidth + widthSinceLastCommit);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllerCoreTextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -31,7 +31,11 @@
</span><span class="cx"> #include &quot;TextRun.h&quot;
</span><span class="cx"> #include &quot;WebCoreSystemInterface.h&quot;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;CoreText/CoreText.h&gt;
+#else
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> @interface WebCascadeList : NSArray {
</span><span class="cx">     @private
</span><span class="lines">@@ -266,12 +270,17 @@
</span><span class="cx">                         continue;
</span><span class="cx">                     }
</span><span class="cx">                     runFontData = fontCache()-&gt;getCachedFontData(m_font.fontDescription(), fontName.get(), false, FontCache::DoNotRetain).get();
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">                     // Core Text may have used a font that is not known to NSFontManager. In that case, fall back on
</span><span class="cx">                     // using the font as returned, even though it may not have the best NSFontRenderingMode.
</span><span class="cx">                     if (!runFontData) {
</span><span class="cx">                         FontPlatformData runFontPlatformData((NSFont *)runFont, CTFontGetSize(runFont), m_font.fontDescription().usePrinterFont());
</span><span class="cx">                         runFontData = fontCache()-&gt;getCachedFontData(&amp;runFontPlatformData, FontCache::DoNotRetain).get();
</span><span class="cx">                     }
</span><ins>+#else
+                    // FIXME: Just assert for now, until we can devise a better fix that works with iOS.
+                    ASSERT(runFontData);
+#endif
</ins><span class="cx">                 }
</span><span class="cx">                 if (m_fallbackFonts &amp;&amp; runFontData != m_font.primaryFont())
</span><span class="cx">                     m_fallbackFonts-&gt;add(runFontData);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFloatPointMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FloatPointMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FloatPointMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/FloatPointMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -27,6 +27,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;FloatPoint.h&quot;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> #ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="lines">@@ -43,3 +45,5 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> }
</span><ins>+
+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFloatRectMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FloatRectMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FloatRectMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/FloatRectMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> 
</span><span class="cx"> FloatRect::FloatRect(const NSRect&amp; r) : m_location(r.origin), m_size(r.size)
</span><span class="lines">@@ -41,5 +42,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFloatSizeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FloatSizeMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FloatSizeMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/FloatSizeMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> 
</span><span class="cx"> FloatSize::FloatSize(const NSSize&amp; s) : m_width(s.width), m_height(s.height)
</span><span class="lines">@@ -41,5 +42,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFontCacheMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -30,6 +30,8 @@
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;FontCache.h&quot;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> #import &quot;Font.h&quot;
</span><span class="cx"> #import &quot;SimpleFontData.h&quot;
</span><span class="cx"> #import &quot;FontPlatformData.h&quot;
</span><span class="lines">@@ -220,3 +222,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><ins>+
+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFontComplexTextMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">     return initialAdvance;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Font::drawComplexText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to) const
</del><ins>+float Font::drawComplexText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to) const
</ins><span class="cx"> {
</span><span class="cx">     // This glyph buffer holds our glyphs + advances + font data for each glyph.
</span><span class="cx">     GlyphBuffer glyphBuffer;
</span><span class="lines">@@ -86,11 +86,13 @@
</span><span class="cx"> 
</span><span class="cx">     // We couldn't generate any glyphs for the run.  Give up.
</span><span class="cx">     if (glyphBuffer.isEmpty())
</span><del>-        return;
</del><ins>+        return 0;
</ins><span class="cx"> 
</span><span class="cx">     // Draw the glyph buffer now at the starting point returned in startX.
</span><span class="cx">     FloatPoint startPoint(startX, point.y());
</span><span class="cx">     drawGlyphBuffer(context, run, glyphBuffer, startPoint);
</span><ins>+
+    return startPoint.x() - startX;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun&amp; run, const AtomicString&amp; mark, const FloatPoint&amp; point, int from, int to) const
</span><span class="lines">@@ -141,6 +143,10 @@
</span><span class="cx">     unsigned i = 0;
</span><span class="cx">     for (const FontData* fontData = fontDataAt(0); fontData; fontData = fontDataAt(++i)) {
</span><span class="cx">         const SimpleFontData* simpleFontData = fontData-&gt;fontDataForCharacter(baseCharacter);
</span><ins>+#if PLATFORM(IOS)
+        if (baseCharacter &gt;= 0x0600 &amp;&amp; baseCharacter &lt;= 0x06ff &amp;&amp; simpleFontData-&gt;shouldNotBeUsedForArabic())
+            continue;
+#endif
</ins><span class="cx">         if (variant == NormalVariant) {
</span><span class="cx">             if (simpleFontData-&gt;platformData().orientation() == Vertical) {
</span><span class="cx">                 if (isCJKIdeographOrSymbol(baseCharacter) &amp;&amp; !simpleFontData-&gt;hasVerticalGlyphs()) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFontCustomPlatformDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -23,7 +23,11 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;FontPlatformData.h&quot;
</span><span class="cx"> #include &quot;SharedBuffer.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFontMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FontMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FontMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/FontMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -124,12 +124,12 @@
</span><span class="cx"> 
</span><span class="cx">     [catalog drawGlyphs:glyphs atPositions:positions.data() inContext:context withFont:ctFont count:count stylePresetName:@&quot;_UIKitNewLetterpressStyle&quot; styleConfiguration:styleConfiguration foregroundColor:CGContextGetFillColorAsColor(context)];
</span><span class="cx"> #else
</span><del>-UNUSED_PARAM(point);
-UNUSED_PARAM(font);
-UNUSED_PARAM(context);
-UNUSED_PARAM(glyphs);
-UNUSED_PARAM(advances);
-UNUSED_PARAM(count);
</del><ins>+    UNUSED_PARAM(point);
+    UNUSED_PARAM(font);
+    UNUSED_PARAM(context);
+    UNUSED_PARAM(glyphs);
+    UNUSED_PARAM(advances);
+    UNUSED_PARAM(count);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer&amp; glyphBuffer, int from, int numGlyphs, const FloatPoint&amp; point) const
</del><ins>+void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, const GlyphBuffer&amp; glyphBuffer, int from, int numGlyphs, const FloatPoint&amp; anchorPoint) const
</ins><span class="cx"> {
</span><span class="cx">     const FontPlatformData&amp; platformData = font-&gt;platformData();
</span><span class="cx">     if (!platformData.size())
</span><span class="lines">@@ -221,11 +221,13 @@
</span><span class="cx">         changeFontSmoothing = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     bool originalShouldUseFontSmoothing = false;
</span><span class="cx">     if (changeFontSmoothing) {
</span><span class="cx">         originalShouldUseFontSmoothing = wkCGContextGetShouldSmoothFonts(cgContext);
</span><span class="cx">         CGContextSetShouldSmoothFonts(cgContext, shouldSmoothFonts);
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     NSFont* drawFont;
</span><span class="lines">@@ -246,9 +248,38 @@
</span><span class="cx">     CGContextSetFont(cgContext, platformData.cgFont());
</span><span class="cx"> 
</span><span class="cx">     bool useLetterpressEffect = shouldUseLetterpressEffect(*context);
</span><ins>+    FloatPoint point = anchorPoint;
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     float fontSize = platformData.size();
</span><span class="cx">     CGAffineTransform matrix = useLetterpressEffect || platformData.isColorBitmapFont() ? CGAffineTransformIdentity : CGAffineTransformMakeScale(fontSize, fontSize);
</span><ins>+    if (platformData.m_isEmoji) {
+        if (!context-&gt;emojiDrawingEnabled())
+            return;
+
+        // Mimic the positioining of non-bitmap glyphs, which are not subpixel-positioned.
+        point.setY(ceilf(point.y()));
+
+        // Emoji glyphs snap to the CSS pixel grid.
+        point.setX(floorf(point.x()));
+
+        // Emoji glyphs are offset one CSS pixel to the right.
+        point.move(1, 0);
+
+        // Emoji glyphs are offset vertically based on font size.
+        float y = point.y();
+        if (fontSize &lt;= 15) {
+            // Undo Core Text's y adjustment.
+            static float yAdjustmentFactor = iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_6_0) ? .19 : .1;
+            point.setY(floorf(y - yAdjustmentFactor * (fontSize + 2) + 2));
+        } else {
+            if (fontSize &lt; 26)
+                y -= .35f * fontSize - 10;
+
+            // Undo Core Text's y adjustment.
+            static float yAdjustment = iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_6_0) ? 3.8 : 2;
+            point.setY(floorf(y - yAdjustment));
+        }
+    }
</ins><span class="cx"> #else
</span><span class="cx">     CGAffineTransform matrix = CGAffineTransformIdentity;
</span><span class="cx">     if (drawFont &amp;&amp; !platformData.isColorBitmapFont())
</span><span class="lines">@@ -303,7 +334,11 @@
</span><span class="cx">         // If shadows are ignoring transforms, then we haven't applied the Y coordinate flip yet, so down is negative.
</span><span class="cx">         float shadowTextY = point.y() + shadowOffset.height() * (context-&gt;shadowsIgnoreTransforms() ? -1 : 1);
</span><span class="cx">         showGlyphsWithAdvances(FloatPoint(shadowTextX, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast&lt;const CGSize*&gt;(glyphBuffer.advances(from)), numGlyphs);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         if (syntheticBoldOffset)
</span><ins>+#else
+        if (syntheticBoldOffset &amp;&amp; !platformData.m_isEmoji)
+#endif
</ins><span class="cx">             showGlyphsWithAdvances(FloatPoint(shadowTextX + syntheticBoldOffset, shadowTextY), font, cgContext, glyphBuffer.glyphs(from), static_cast&lt;const CGSize*&gt;(glyphBuffer.advances(from)), numGlyphs);
</span><span class="cx">         context-&gt;setFillColor(fillColor, fillColorSpace);
</span><span class="cx">     }
</span><span class="lines">@@ -312,7 +347,11 @@
</span><span class="cx">         showLetterpressedGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), static_cast&lt;const CGSize*&gt;(glyphBuffer.advances(from)), numGlyphs);
</span><span class="cx">     else
</span><span class="cx">         showGlyphsWithAdvances(point, font, cgContext, glyphBuffer.glyphs(from), static_cast&lt;const CGSize*&gt;(glyphBuffer.advances(from)), numGlyphs);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (syntheticBoldOffset)
</span><ins>+#else
+    if (syntheticBoldOffset &amp;&amp; !platformData.m_isEmoji)
+#endif
</ins><span class="cx">         showGlyphsWithAdvances(FloatPoint(point.x() + syntheticBoldOffset, point.y()), font, cgContext, glyphBuffer.glyphs(from), static_cast&lt;const CGSize*&gt;(glyphBuffer.advances(from)), numGlyphs);
</span><span class="cx"> 
</span><span class="cx">     if (hasSimpleShadow)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacGlyphPageTreeNodeMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -32,7 +32,13 @@
</span><span class="cx"> #include &quot;Font.h&quot;
</span><span class="cx"> #include &quot;SimpleFontData.h&quot;
</span><span class="cx"> #include &quot;WebCoreSystemInterface.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreGraphics/CGFontUnicodeSupport.h&gt;
+#include &lt;CoreText/CTFontPriv.h&gt;
+#include &lt;CoreText/CoreText.h&gt;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -63,7 +69,16 @@
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;CGGlyph, 512&gt; glyphs(bufferLength);
</span><span class="cx">     if (!shouldUseCoreText(buffer, bufferLength, fontData)) {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         wkGetGlyphsForCharacters(fontData-&gt;platformData().cgFont(), buffer, glyphs.data(), bufferLength);
</span><ins>+#else
+        // We pass in either 256 or 512 UTF-16 characters: 256 for U+FFFF and less, 512 (double character surrogates)
+        // for U+10000 and above. It is indeed possible to get back 512 glyphs back from the API, so the glyph buffer
+        // we pass in must be 512. If we get back more than 256 glyphs though we'll ignore all the ones after 256,
+        // this should not happen as the only time we pass in 512 characters is when they are surrogates.
+        // FIXME: Use wkGetGlyphsForCharacters() instead of CGFontGetGlyphsForUnichars() once we update WebKit System Interface on iOS.
+        CGFontGetGlyphsForUnichars(fontData-&gt;platformData().cgFont(), buffer, glyphs.data(), bufferLength);
+#endif
</ins><span class="cx">         for (unsigned i = 0; i &lt; length; ++i) {
</span><span class="cx">             if (!glyphs[i])
</span><span class="cx">                 setGlyphDataForIndex(offset + i, 0, 0);
</span><span class="lines">@@ -144,6 +159,7 @@
</span><span class="cx">                             haveGlyphs = true;
</span><span class="cx">                         }
</span><span class="cx">                     }
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">                 } else {
</span><span class="cx">                     const SimpleFontData* runSimple = fontData-&gt;getCompositeFontReferenceFontData((NSFont *)runFont);
</span><span class="cx">                     if (runSimple) {
</span><span class="lines">@@ -158,6 +174,7 @@
</span><span class="cx">                             }
</span><span class="cx">                         }
</span><span class="cx">                     }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacGraphicsContext3DMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,6 +28,9 @@
</span><span class="cx"> #if USE(3D_GRAPHICS)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;GraphicsContext3D.h&quot;
</span><ins>+#if PLATFORM(IOS)
+#include &quot;GraphicsContext3DIOS.h&quot;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #import &quot;BlockExceptions.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -39,8 +42,15 @@
</span><span class="cx"> #include &quot;HTMLCanvasElement.h&quot;
</span><span class="cx"> #include &quot;ImageBuffer.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><ins>+#if PLATFORM(IOS)
+#import &lt;OpenGLES/ES2/glext.h&gt;
+#import &lt;OpenGLES/EAGL.h&gt;
+#import &lt;OpenGLES/EAGLDrawable.h&gt;
+#import &lt;QuartzCore/QuartzCore.h&gt;
+#else
</ins><span class="cx"> #include &lt;OpenGL/CGLRenderers.h&gt;
</span><span class="cx"> #include &lt;OpenGL/gl.h&gt;
</span><ins>+#endif
</ins><span class="cx"> #include &quot;WebGLLayer.h&quot;
</span><span class="cx"> #include &quot;WebGLObject.h&quot;
</span><span class="cx"> #include &lt;runtime/ArrayBuffer.h&gt;
</span><span class="lines">@@ -61,6 +71,7 @@
</span><span class="cx">     ~GraphicsContext3DPrivate() { }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> static void setPixelFormat(Vector&lt;CGLPixelFormatAttribute&gt;&amp; attribs, int colorBits, int depthBits, bool accelerated, bool supersample, bool closest, bool antialias)
</span><span class="cx"> {
</span><span class="cx">     attribs.clear();
</span><span class="lines">@@ -93,6 +104,7 @@
</span><span class="cx">         
</span><span class="cx">     attribs.append(static_cast&lt;CGLPixelFormatAttribute&gt;(0));
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;GraphicsContext3D&gt; GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle)
</span><span class="cx"> {
</span><span class="lines">@@ -107,6 +119,9 @@
</span><span class="cx">     : m_currentWidth(0)
</span><span class="cx">     , m_currentHeight(0)
</span><span class="cx">     , m_contextObj(0)
</span><ins>+#if PLATFORM(IOS)
+    , m_compiler(SH_ESSL_OUTPUT)
+#endif
</ins><span class="cx">     , m_attrs(attrs)
</span><span class="cx">     , m_texture(0)
</span><span class="cx">     , m_compositorTexture(0)
</span><span class="lines">@@ -122,6 +137,10 @@
</span><span class="cx">     UNUSED_PARAM(hostWindow);
</span><span class="cx">     UNUSED_PARAM(renderStyle);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    m_contextObj = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
+    makeContextCurrent();
+#else
</ins><span class="cx">     Vector&lt;CGLPixelFormatAttribute&gt; attribs;
</span><span class="cx">     CGLPixelFormatObj pixelFormatObj = 0;
</span><span class="cx">     GLint numPixelFormats = 0;
</span><span class="lines">@@ -184,12 +203,16 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx">     
</span><span class="cx">     validateAttributes();
</span><span class="cx"> 
</span><span class="cx">     // Create the WebGLLayer
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx">         m_webGLLayer = adoptNS([[WebGLLayer alloc] initWithGraphicsContext3D:this]);
</span><ins>+#if PLATFORM(IOS)
+        [m_webGLLayer.get() setOpaque:0];
+#endif
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx">         [m_webGLLayer.get() setName:@&quot;WebGL Layer&quot;];
</span><span class="cx"> #endif    
</span><span class="lines">@@ -198,6 +221,9 @@
</span><span class="cx">     if (useMultisampling)
</span><span class="cx">         ::glEnable(GL_MULTISAMPLE);
</span><span class="cx">     
</span><ins>+#if PLATFORM(IOS)
+    ::glGenRenderbuffers(1, &amp;m_texture);
+#else
</ins><span class="cx">     // create a texture to render into
</span><span class="cx">     ::glGenTextures(1, &amp;m_texture);
</span><span class="cx">     ::glBindTexture(GL_TEXTURE_2D, m_texture);
</span><span class="lines">@@ -212,6 +238,7 @@
</span><span class="cx">     ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
</span><span class="cx">     ::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
</span><span class="cx">     ::glBindTexture(GL_TEXTURE_2D, 0);
</span><ins>+#endif
</ins><span class="cx">     
</span><span class="cx">     // create an FBO
</span><span class="cx">     ::glGenFramebuffersEXT(1, &amp;m_fbo);
</span><span class="lines">@@ -253,8 +280,10 @@
</span><span class="cx"> 
</span><span class="cx">     m_compiler.setResources(ANGLEResources);
</span><span class="cx">     
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     ::glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
</span><span class="cx">     ::glEnable(GL_POINT_SPRITE);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     ::glClearColor(0, 0, 0, 0);
</span><span class="cx"> }
</span><span class="lines">@@ -262,9 +291,15 @@
</span><span class="cx"> GraphicsContext3D::~GraphicsContext3D()
</span><span class="cx"> {
</span><span class="cx">     if (m_contextObj) {
</span><ins>+#if PLATFORM(IOS)
+        makeContextCurrent();
+        ::glDeleteRenderbuffers(1, &amp;m_texture);
+        ::glDeleteRenderbuffers(1, &amp;m_compositorTexture);
+#else
</ins><span class="cx">         CGLSetCurrentContext(m_contextObj);
</span><span class="cx">         ::glDeleteTextures(1, &amp;m_texture);
</span><span class="cx">         ::glDeleteTextures(1, &amp;m_compositorTexture);
</span><ins>+#endif
</ins><span class="cx">         if (m_attrs.antialias) {
</span><span class="cx">             ::glDeleteRenderbuffersEXT(1, &amp;m_multisampleColorBuffer);
</span><span class="cx">             if (m_attrs.stencil || m_attrs.depth)
</span><span class="lines">@@ -275,22 +310,51 @@
</span><span class="cx">                 ::glDeleteRenderbuffersEXT(1, &amp;m_depthStencilBuffer);
</span><span class="cx">         }
</span><span class="cx">         ::glDeleteFramebuffersEXT(1, &amp;m_fbo);
</span><ins>+#if PLATFORM(IOS)
+        [EAGLContext setCurrentContext:0];
+        [static_cast&lt;EAGLContext*&gt;(m_contextObj) release];
+#else
</ins><span class="cx">         CGLSetCurrentContext(0);
</span><span class="cx">         CGLDestroyContext(m_contextObj);
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool GraphicsContext3D::setRenderbufferStorageFromDrawable(GC3Dsizei width, GC3Dsizei height)
+{
+    [m_webGLLayer.get() setBounds:CGRectMake(0, 0, width, height)];
+    return [m_contextObj renderbufferStorage:GL_RENDERBUFFER fromDrawable:static_cast&lt;NSObject&lt;EAGLDrawable&gt;*&gt;(m_webGLLayer.get())];
+}
+#endif
+
</ins><span class="cx"> bool GraphicsContext3D::makeContextCurrent()
</span><span class="cx"> {
</span><span class="cx">     if (!m_contextObj)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if ([EAGLContext currentContext] != m_contextObj)
+        return [EAGLContext setCurrentContext:static_cast&lt;EAGLContext*&gt;(m_contextObj)];
+#else
</ins><span class="cx">     CGLContextObj currentContext = CGLGetCurrentContext();
</span><span class="cx">     if (currentContext != m_contextObj)
</span><span class="cx">         return CGLSetCurrentContext(m_contextObj) == kCGLNoError;
</span><ins>+#endif
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void GraphicsContext3D::endPaint()
+{
+    makeContextCurrent();
+    ::glFlush();
+    ::glBindRenderbuffer(GL_RENDERBUFFER, m_texture);
+    [static_cast&lt;EAGLContext*&gt;(m_contextObj) presentRenderbuffer:GL_RENDERBUFFER];
+    [EAGLContext setCurrentContext:nil];
+}
+#endif
+
</ins><span class="cx"> bool GraphicsContext3D::isGLES2Compliant() const
</span><span class="cx"> {
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacGraphicsContextMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,10 +28,19 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;GraphicsContextCG.h&quot;
</span><span class="cx"> #import &quot;GraphicsContextPlatformPrivateCG.h&quot;
</span><ins>+#if USE(APPKIT)
</ins><span class="cx"> #import &lt;AppKit/AppKit.h&gt;
</span><ins>+#endif
</ins><span class="cx"> #import &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &quot;Color.h&quot;
+#import &quot;WKGraphics.h&quot;
+#endif
+
+#if !PLATFORM(IOS)
</ins><span class="cx"> #import &quot;LocalCurrentGraphicsContext.h&quot;
</span><ins>+#endif
</ins><span class="cx"> #import &quot;WebCoreSystemInterface.h&quot;
</span><span class="cx"> 
</span><span class="cx"> @class NSColor;
</span><span class="lines">@@ -45,6 +54,7 @@
</span><span class="cx"> // calls in this file are all exception-safe, so we don't block
</span><span class="cx"> // exceptions for those.
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> static void drawFocusRingToContext(CGContextRef context, CGPathRef focusRingPath, CGColorRef color, int radius)
</span><span class="cx"> {
</span><span class="cx">     CGContextBeginPath(context);
</span><span class="lines">@@ -64,9 +74,11 @@
</span><span class="cx"> 
</span><span class="cx">     drawFocusRingToContext(platformContext(), path.platformPath(), colorRef, radius);
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> void GraphicsContext::drawFocusRing(const Vector&lt;IntRect&gt;&amp; rects, int width, int offset, const Color&amp; color)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (paintingDisabled())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -80,9 +92,16 @@
</span><span class="cx">         CGPathAddRect(focusRingPath.get(), 0, CGRectInset(rects[i], -offset, -offset));
</span><span class="cx"> 
</span><span class="cx">     drawFocusRingToContext(platformContext(), focusRingPath.get(), colorRef, radius);
</span><ins>+#else
+    UNUSED_PARAM(rects);
+    UNUSED_PARAM(width);
+    UNUSED_PARAM(offset);
+    UNUSED_PARAM(color);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> static NSColor* makePatternColor(NSString* firstChoiceName, NSString* secondChoiceName, NSColor* defaultColor, bool&amp; usingDot)
</span><span class="cx"> {
</span><span class="cx">     // Eventually we should be able to get rid of the secondChoiceName. For the time being we need both to keep
</span><span class="lines">@@ -98,6 +117,15 @@
</span><span class="cx">         color = defaultColor;
</span><span class="cx">     return color;
</span><span class="cx"> }
</span><ins>+#else
+static RetainPtr&lt;CGPatternRef&gt; createDotPattern(bool&amp; usingDot, const char* resourceName)
+{
+    RetainPtr&lt;CGImageRef&gt; image = adoptCF(WKGraphicsCreateImageFromBundleWithName(resourceName));
+    ASSERT(image); // if image is not available, we want to know
+    usingDot = true;
+    return adoptCF(WKCreatePatternFromCGImage(image.get()));
+}
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> static NSColor *spellingPatternColor = nullptr;
</span><span class="cx"> static NSColor *grammarPatternColor = nullptr;
</span><span class="lines">@@ -121,20 +149,31 @@
</span><span class="cx">     float patternWidth = cMisspellingLinePatternWidth;
</span><span class="cx"> 
</span><span class="cx">     bool usingDot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     NSColor *patternColor;
</span><ins>+#else
+    CGPatternRef dotPattern;
+#endif
</ins><span class="cx">     switch (style) {
</span><span class="cx">         case DocumentMarkerSpellingLineStyle:
</span><span class="cx">         {
</span><span class="cx">             // Constants for spelling pattern color.
</span><span class="cx">             static bool usingDotForSpelling = false;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">             if (!spellingPatternColor)
</span><span class="cx">                 spellingPatternColor = [makePatternColor(@&quot;NSSpellingDot&quot;, @&quot;SpellingDot&quot;, [NSColor redColor], usingDotForSpelling) retain];
</span><span class="cx">             usingDot = usingDotForSpelling;
</span><span class="cx">             patternColor = spellingPatternColor;
</span><ins>+#else
+            static CGPatternRef spellingPattern = createDotPattern(usingDotForSpelling, &quot;SpellingDot&quot;).leakRef();
+            dotPattern = spellingPattern;
+#endif
+            usingDot = usingDotForSpelling;
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case DocumentMarkerGrammarLineStyle:
</span><span class="cx">         {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">             // Constants for grammar pattern color.
</span><span class="cx">             static bool usingDotForGrammar = false;
</span><span class="cx">             if (!grammarPatternColor)
</span><span class="lines">@@ -142,8 +181,12 @@
</span><span class="cx">             usingDot = usingDotForGrammar;
</span><span class="cx">             patternColor = grammarPatternColor;
</span><span class="cx">             break;
</span><ins>+#else
+            ASSERT_NOT_REACHED();
+            return;
+#endif
</ins><span class="cx">         }
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; PLATFORM(MAC)
</ins><span class="cx">         // To support correction panel.
</span><span class="cx">         case DocumentMarkerAutocorrectionReplacementLineStyle:
</span><span class="cx">         case DocumentMarkerDictationAlternativesLineStyle:
</span><span class="lines">@@ -157,7 +200,21 @@
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><ins>+#if PLATFORM(IOS)
+        case TextCheckingDictationPhraseWithAlternativesLineStyle:
+        {
+            static bool usingDotForDictationPhraseWithAlternatives = false;
+            static CGPatternRef dictationPhraseWithAlternativesPattern = createDotPattern(usingDotForDictationPhraseWithAlternatives, &quot;DictationPhraseWithAlternativesDot&quot;).leakRef();
+            dotPattern = dictationPhraseWithAlternativesPattern;
+            usingDot = usingDotForDictationPhraseWithAlternatives;
+            break;
+        }
+#endif // PLATFORM(IOS)
</ins><span class="cx">         default:
</span><ins>+#if PLATFORM(IOS)
+            // FIXME: Should remove default case so we get compile-time errors.
+            ASSERT_NOT_REACHED();
+#endif // PLATFORM(IOS)
</ins><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -182,20 +239,33 @@
</span><span class="cx">     // for transforms.
</span><span class="cx"> 
</span><span class="cx">     // Draw underline.
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     LocalCurrentGraphicsContext localContext(this);
</span><span class="cx">     NSGraphicsContext *currentContext = [NSGraphicsContext currentContext];
</span><span class="cx">     CGContextRef context = (CGContextRef)[currentContext graphicsPort];
</span><ins>+#else
+    CGContextRef context = platformContext();
+#endif
</ins><span class="cx">     CGContextSaveGState(context);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     [patternColor set];
</span><ins>+#else
+    WKSetPattern(context, dotPattern, YES, YES);
+#endif
</ins><span class="cx"> 
</span><span class="cx">     wkSetPatternPhaseInUserSpace(context, offsetPoint);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     NSRectFillUsingOperation(NSMakeRect(offsetPoint.x(), offsetPoint.y(), width, patternHeight), NSCompositeSourceOver);
</span><ins>+#else
+    WKRectFillUsingOperation(context, CGRectMake(offsetPoint.x(), offsetPoint.y(), width, patternHeight), kCGCompositeSover);
+#endif
</ins><span class="cx">     
</span><span class="cx">     CGContextRestoreGState(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> CGColorSpaceRef linearRGBColorSpaceRef()
</span><span class="cx"> {
</span><span class="cx">     static CGColorSpaceRef linearSRGBSpace = 0;
</span><span class="lines">@@ -215,5 +285,6 @@
</span><span class="cx"> 
</span><span class="cx">     return linearSRGBSpace;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacIconMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/IconMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/IconMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/IconMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -18,6 +18,8 @@
</span><span class="cx">  *
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;Icon.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -82,3 +84,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span><ins>+
+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacImageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/ImageMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -37,6 +37,18 @@
</span><span class="cx"> @implementation WebCoreBundleFinder
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &quot;SoftLinking.h&quot;
+
+#import &lt;CoreGraphics/CoreGraphics.h&gt;
+#import &lt;ImageIO/ImageIO.h&gt;
+#import &lt;MobileCoreServices/MobileCoreServices.h&gt;
+
+SOFT_LINK_FRAMEWORK(MobileCoreServices)
+SOFT_LINK_CONSTANT(MobileCoreServices, kUTTypeTIFF, CFStringRef)
+#define kUTTypeTIFF getkUTTypeTIFF()
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> void BitmapImage::invalidatePlatformData()
</span><span class="lines">@@ -44,7 +56,9 @@
</span><span class="cx">     if (m_frames.size() != 1)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     m_nsImage = 0;
</span><ins>+#endif
</ins><span class="cx">     m_tiffRep = 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -103,6 +117,7 @@
</span><span class="cx">     return m_tiffRep.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> NSImage* BitmapImage::getNSImage()
</span><span class="cx"> {
</span><span class="cx">     if (m_nsImage)
</span><span class="lines">@@ -115,5 +130,6 @@
</span><span class="cx">     m_nsImage = adoptNS([[NSImage alloc] initWithData:(NSData*)data]);
</span><span class="cx">     return m_nsImage.get();
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacIntPointMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/IntPointMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/IntPointMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/IntPointMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> 
</span><span class="cx"> IntPoint::IntPoint(const NSPoint&amp; p) : m_x(static_cast&lt;int&gt;(p.x)), m_y(static_cast&lt;int&gt;(p.y))
</span><span class="lines">@@ -40,5 +41,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacIntRectMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/IntRectMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/IntRectMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/IntRectMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> 
</span><span class="cx"> IntRect::operator NSRect() const
</span><span class="lines">@@ -45,5 +46,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacIntSizeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/IntSizeMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/IntSizeMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/IntSizeMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> 
</span><span class="cx"> IntSize::IntSize(const NSSize&amp; s) : m_width(static_cast&lt;int&gt;(s.width)), m_height(static_cast&lt;int&gt;(s.height))
</span><span class="lines">@@ -40,5 +41,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaPlayerProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerProxy.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerProxy.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerProxy.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,6 +26,21 @@
</span><span class="cx"> #ifndef MediaPlayerProxy_h
</span><span class="cx"> #define MediaPlayerProxy_h
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#if defined(__OBJC__)
+#import &lt;Foundation/NSGeometry.h&gt;
+#endif
+
+// Needed since this is a WebKit private header on iOS.
+#ifndef OBJC_CLASS
+#ifdef __OBJC__
+#define OBJC_CLASS @class
+#else
+#define OBJC_CLASS class
+#endif
+#endif // !defined(OBJC_CLASS)
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> OBJC_CLASS WebMediaPlayerProxy;
</span><span class="cx"> 
</span><span class="cx"> enum MediaPlayerProxyNotificationType {
</span><span class="lines">@@ -57,6 +72,16 @@
</span><span class="cx">     MediaPlayerNotificationTimeJumped,
</span><span class="cx">     
</span><span class="cx">     MediaPlayerNotificationPlayPauseButtonPressed,
</span><ins>+    MediaPlayerNotificationRateDidChange,
+    MediaPlayerNotificationGainFocus,
+    MediaPlayerNotificationLoseFocus,
+    MediaPlayerRequestBeginPlayback,
+    MediaPlayerRequestPausePlayback,
+
+#if ENABLE(IOS_AIRPLAY)
+    MediaPlayerNotificationCurrentPlaybackTargetIsWirelessChanged,
+    MediaPlayerNotificationPlaybackTargetAvailabilityChanged,
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #ifdef __OBJC__
</span><span class="lines">@@ -71,6 +96,25 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_setPoster:(NSURL *)url;
</span><span class="cx"> 
</span><ins>+- (void)_setControls:(BOOL)controls;
+- (void)_setAutobuffer:(BOOL)autobuffer;
+
+- (void)_enterFullScreen;
+- (void)_exitFullScreen;
+
+#if ENABLE(IOS_AIRPLAY)
+- (BOOL)_isCurrentPlaybackTargetWireless;
+- (void)_showPlaybackTargetPicker;
+
+- (BOOL)_hasWirelessPlaybackTargets;
+
+- (BOOL)_wirelessVideoPlaybackDisabled;
+- (void)_setWirelessVideoPlaybackDisabled:(BOOL)disabled;
+
+- (void)_setHasPlaybackTargetAvailabilityListeners:(BOOL)hasListeners;
+#endif
+
+- (void)_prepareForPlayback;
</ins><span class="cx"> - (void)_play;
</span><span class="cx"> - (void)_pause;
</span><span class="cx"> 
</span><span class="lines">@@ -79,6 +123,9 @@
</span><span class="cx"> - (BOOL)_hasVideo;
</span><span class="cx"> - (BOOL)_hasAudio;
</span><span class="cx"> 
</span><ins>+- (BOOL)_hasClosedCaptions;
+- (void)_setClosedCaptionsVisible:(BOOL)visible;
+
</ins><span class="cx"> - (NSTimeInterval)_duration;
</span><span class="cx"> 
</span><span class="cx"> - (double)_currentTime;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacSimpleFontDataCoreTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -27,7 +27,11 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;SimpleFontData.h&quot;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#include &lt;CoreText/CoreText.h&gt;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacSimpleFontDataMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -35,20 +35,27 @@
</span><span class="cx"> #import &quot;FontDescription.h&quot;
</span><span class="cx"> #import &quot;SharedBuffer.h&quot;
</span><span class="cx"> #import &quot;WebCoreSystemInterface.h&quot;
</span><ins>+#if USE(APPKIT)
</ins><span class="cx"> #import &lt;AppKit/AppKit.h&gt;
</span><span class="cx"> #import &lt;ApplicationServices/ApplicationServices.h&gt;
</span><ins>+#else
+#import &lt;CoreText/CoreText.h&gt;
+#endif
</ins><span class="cx"> #import &lt;float.h&gt;
</span><span class="cx"> #import &lt;unicode/uchar.h&gt;
</span><span class="cx"> #import &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #import &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> @interface NSFont (WebAppKitSecretAPI)
</span><span class="cx"> - (BOOL)_isFakeFixedPitch;
</span><span class="cx"> @end
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><del>-  
</del><ins>+
+#if USE(APPKIT)
</ins><span class="cx"> static bool fontHasVerticalGlyphs(CTFontRef ctFont)
</span><span class="cx"> {
</span><span class="cx">     // The check doesn't look neat but this is what AppKit does for vertical writing...
</span><span class="lines">@@ -255,6 +262,7 @@
</span><span class="cx">     // Fallback to a cross-platform estimate, which will populate these values if they are non-positive.
</span><span class="cx">     initCharWidths();
</span><span class="cx"> }
</span><ins>+#endif // USE(APPKIT)
</ins><span class="cx"> 
</span><span class="cx"> void SimpleFontData::platformDestroy()
</span><span class="cx"> {
</span><span class="lines">@@ -268,6 +276,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> PassRefPtr&lt;SimpleFontData&gt; SimpleFontData::platformCreateScaledFontData(const FontDescription&amp; fontDescription, float scaleFactor) const
</span><span class="cx"> {
</span><span class="cx">     if (isCustomFont()) {
</span><span class="lines">@@ -304,7 +313,9 @@
</span><span class="cx"> 
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> bool SimpleFontData::containsCharacters(const UChar* characters, int length) const
</span><span class="cx"> {
</span><span class="cx">     NSString *string = [[NSString alloc] initWithCharactersNoCopy:const_cast&lt;unichar*&gt;(characters) length:length freeWhenDone:NO];
</span><span class="lines">@@ -335,6 +346,7 @@
</span><span class="cx">            [name caseInsensitiveCompare:@&quot;MS-PGothic&quot;] != NSOrderedSame &amp;&amp;
</span><span class="cx">            [name caseInsensitiveCompare:@&quot;MonotypeCorsiva&quot;] != NSOrderedSame;
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
</span><span class="cx"> {
</span><span class="lines">@@ -347,6 +359,7 @@
</span><span class="cx">     return boundingBox;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
</span><span class="cx"> {
</span><span class="cx">     CGSize advance = CGSizeZero;
</span><span class="lines">@@ -367,6 +380,7 @@
</span><span class="cx"> 
</span><span class="cx">     return advance.width + m_syntheticBoldOffset;
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> struct ProviderInfo {
</span><span class="cx">     const UChar* characters;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacWebGLLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/WebGLLayer.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/WebGLLayer.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/WebGLLayer.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -35,7 +35,11 @@
</span><span class="cx">     class GraphicsContext3D;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-@interface WebGLLayer : CAOpenGLLayer 
</del><ins>+#if PLATFORM(IOS)
+@interface WebGLLayer : CAEAGLLayer
+#else
+@interface WebGLLayer : CAOpenGLLayer
+#endif
</ins><span class="cx"> {
</span><span class="cx">     WebCore::GraphicsLayer* m_layerOwner;
</span><span class="cx">     WebCore::GraphicsContext3D* m_context;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacWebGLLayermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/WebGLLayer.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/WebGLLayer.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/WebGLLayer.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -32,8 +32,10 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;GraphicsContext3D.h&quot;
</span><span class="cx"> #import &quot;GraphicsLayer.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #import &lt;OpenGL/OpenGL.h&gt;
</span><span class="cx"> #import &lt;OpenGL/gl.h&gt;
</span><ins>+#endif
</ins><span class="cx"> #import &lt;wtf/FastMalloc.h&gt;
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -48,6 +50,7 @@
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> -(CGLPixelFormatObj)copyCGLPixelFormatForDisplayMask:(uint32_t)mask
</span><span class="cx"> {
</span><span class="cx">     // FIXME: The mask param tells you which display (on a multi-display system)
</span><span class="lines">@@ -108,9 +111,14 @@
</span><span class="cx"> {
</span><span class="cx">     fastFree(const_cast&lt;void *&gt;(data));
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> -(CGImageRef)copyImageSnapshotWithColorSpace:(CGColorSpaceRef)colorSpace
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    UNUSED_PARAM(colorSpace);
+    return 0;
+#else
</ins><span class="cx">     CGLSetCurrentContext(m_context-&gt;platformGraphicsContext3D());
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;CGColorSpaceRef&gt; imageColorSpace = colorSpace;
</span><span class="lines">@@ -138,11 +146,16 @@
</span><span class="cx">                                                  kCGRenderingIntentDefault);
</span><span class="cx">     CGDataProviderRelease(provider);
</span><span class="cx">     return image;
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)display
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    m_context-&gt;endPaint();
+#else
</ins><span class="cx">     [super display];
</span><ins>+#endif
</ins><span class="cx">     if (m_layerOwner)
</span><span class="cx">         m_layerOwner-&gt;layerDidDisplay(self);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacWebLayermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -32,15 +32,29 @@
</span><span class="cx"> #import &quot;GraphicsContext.h&quot;
</span><span class="cx"> #import &quot;GraphicsLayerCA.h&quot;
</span><span class="cx"> #import &quot;PlatformCALayer.h&quot;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #import &quot;ThemeMac.h&quot;
</span><ins>+#endif
</ins><span class="cx"> #import &lt;QuartzCore/QuartzCore.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &quot;WKGraphics.h&quot;
+#import &quot;WAKWindow.h&quot;
+#import &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> @interface CALayer(WebCoreCALayerPrivate)
</span><span class="cx"> - (void)reloadValueForKeyPath:(NSString *)keyPath;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+@interface WebLayer(Private)
+- (void)drawScaledContentsInContext:(CGContextRef)context;
+@end
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> RepaintRectList collectRectsToPaint(CGContextRef context, PlatformCALayer* platformCALayer)
</span><span class="lines">@@ -74,17 +88,26 @@
</span><span class="cx">     if (!layerContents)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    WKSetCurrentGraphicsContext(context);
+#endif
+
</ins><span class="cx">     CGContextSaveGState(context);
</span><span class="cx"> 
</span><span class="cx">     // We never use CompositingCoordinatesBottomUp on Mac.
</span><span class="cx">     ASSERT(layerContents-&gt;platformCALayerContentsOrientation() == GraphicsLayer::CompositingCoordinatesTopDown);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    WKFontAntialiasingStateSaver fontAntialiasingState(context, [platformCALayer-&gt;platformLayer() isOpaque]);
+    fontAntialiasingState.setup([WAKWindow hasLandscapeOrientation]);
+#else
</ins><span class="cx">     [NSGraphicsContext saveGraphicsState];
</span><span class="cx"> 
</span><span class="cx">     // Set up an NSGraphicsContext for the context, so that parts of AppKit that rely on
</span><span class="cx">     // the current NSGraphicsContext (e.g. NSCell drawing) get the right one.
</span><span class="cx">     NSGraphicsContext* layerContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:YES];
</span><span class="cx">     [NSGraphicsContext setCurrentContext:layerContext];
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     GraphicsContext graphicsContext(context);
</span><span class="cx">     graphicsContext.setIsCALayerContext(true);
</span><span class="lines">@@ -94,7 +117,8 @@
</span><span class="cx">         // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
</span><span class="cx">         graphicsContext.setShouldSmoothFonts(false);
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+#if !PLATFORM(IOS)
</ins><span class="cx">     // It's important to get the clip from the context, because it may be significantly
</span><span class="cx">     // smaller than the layer bounds (e.g. tiled layers)
</span><span class="cx">     FloatRect clipBounds = CGContextGetClipBoundingBox(context);
</span><span class="lines">@@ -106,6 +130,7 @@
</span><span class="cx">     focusRingClipRect = transform.mapRect(clipBounds);
</span><span class="cx"> #endif
</span><span class="cx">     ThemeMac::setFocusRingClipRect(focusRingClipRect);
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx">     for (auto rect : dirtyRects) {
</span><span class="cx">         GraphicsContextStateSaver stateSaver(graphicsContext);
</span><span class="lines">@@ -114,9 +139,13 @@
</span><span class="cx">         layerContents-&gt;platformCALayerPaintContents(platformCALayer, graphicsContext, enclosingIntRect(rect));
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    fontAntialiasingState.restore();
+#else
</ins><span class="cx">     ThemeMac::setFocusRingClipRect(FloatRect());
</span><span class="cx"> 
</span><span class="cx">     [NSGraphicsContext restoreGraphicsState];
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     // Re-fetch the layer owner, since &lt;rdar://problem/9125151&gt; indicates that it might have been destroyed during painting.
</span><span class="cx">     layerContents = platformCALayer-&gt;owner();
</span><span class="lines">@@ -224,6 +253,10 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)display
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (pthread_main_np())
+        WebThreadLock();
+#endif
</ins><span class="cx">     [super display];
</span><span class="cx">     PlatformCALayer* layer = PlatformCALayer::platformCALayer(self);
</span><span class="cx">     if (layer &amp;&amp; layer-&gt;owner())
</span><span class="lines">@@ -232,6 +265,10 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)drawInContext:(CGContextRef)context
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    if (pthread_main_np())
+        WebThreadLock();
+#endif
</ins><span class="cx">     PlatformCALayer* layer = PlatformCALayer::platformCALayer(self);
</span><span class="cx">     if (layer &amp;&amp; layer-&gt;owner()) {
</span><span class="cx">         GraphicsContext graphicsContext(context);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacWebTiledLayermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/WebTiledLayer.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/WebTiledLayer.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/mac/WebTiledLayer.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -33,6 +33,11 @@
</span><span class="cx"> #import &quot;GraphicsLayerCA.h&quot;
</span><span class="cx"> #import &quot;PlatformCALayer.h&quot;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &quot;WebCoreThread.h&quot;
+#import &quot;WebCoreThreadRun.h&quot;
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @implementation WebTiledLayer
</span><span class="lines">@@ -46,7 +51,14 @@
</span><span class="cx"> // Make sure that tiles are drawn on the main thread
</span><span class="cx"> + (BOOL)shouldDrawOnMainThread
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: WebKit2 always wants to draw on the main thread, but there is
+    // probably a better way to check for WebKit2 than using the existance of
+    // the web thread as a proxy.
+    return !WebThreadIsEnabled();
+#else
</ins><span class="cx">     return YES;
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> + (unsigned int)prefetchedTiles
</span><span class="lines">@@ -98,6 +110,13 @@
</span><span class="cx"> - (void)display
</span><span class="cx"> {
</span><span class="cx">     [super display];
</span><ins>+#if PLATFORM(IOS)
+    // CATiledLayer never calls display on a background thread, so it's safe
+    // to assume we're either on the main thread or on the web thread.
+    if (pthread_main_np())
+        WebThreadLock();
+    ASSERT(WebThreadIsLockedOrDisabled());
+#endif
</ins><span class="cx">     PlatformCALayer* layer = PlatformCALayer::platformCALayer(self);
</span><span class="cx">     if (layer &amp;&amp; layer-&gt;owner())
</span><span class="cx">         layer-&gt;owner()-&gt;platformCALayerLayerDidDisplay(self);
</span><span class="lines">@@ -105,9 +124,20 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)drawInContext:(CGContextRef)context
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    void (^draw)() = ^{
+#endif
</ins><span class="cx">     PlatformCALayer* layer = PlatformCALayer::platformCALayer(self);
</span><span class="cx">     if (layer)
</span><span class="cx">         drawLayerContents(context, layer);
</span><ins>+#if PLATFORM(IOS)
+    };
+    if (pthread_main_np()) {
+        WebThreadLock();
+        draw();
+    } else
+        WebThreadRunSync(draw);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end // implementation WebTiledLayer
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglExtensions3DOpenGLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -32,13 +32,20 @@
</span><span class="cx"> #include &quot;GraphicsContext3D.h&quot;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(IOS)
</ins><span class="cx"> #include &quot;ANGLE/ShaderLang.h&quot;
</span><ins>+#include &lt;OpenGLES/ES2/glext.h&gt;
+#elif PLATFORM(MAC)
+#include &quot;ANGLE/ShaderLang.h&quot;
</ins><span class="cx"> #include &lt;OpenGL/gl.h&gt;
</span><span class="cx"> #elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
</span><span class="cx"> #include &quot;OpenGLShims.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;GraphicsContext3DIOS.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> Extensions3DOpenGL::Extensions3DOpenGL(GraphicsContext3D* context)
</span><span class="lines">@@ -53,7 +60,21 @@
</span><span class="cx"> 
</span><span class="cx"> void Extensions3DOpenGL::blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    UNUSED_PARAM(srcX0);
+    UNUSED_PARAM(srcY0);
+    UNUSED_PARAM(srcX1);
+    UNUSED_PARAM(srcY1);
+    UNUSED_PARAM(dstX0);
+    UNUSED_PARAM(dstY0);
+    UNUSED_PARAM(dstX1);
+    UNUSED_PARAM(dstY1);
+    UNUSED_PARAM(mask);
+    UNUSED_PARAM(filter);
+    ::glResolveMultisampleFramebufferAPPLE();
+#else
</ins><span class="cx">     ::glBlitFramebufferEXT(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Extensions3DOpenGL::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height)
</span><span class="lines">@@ -105,6 +126,10 @@
</span><span class="cx"> 
</span><span class="cx"> void Extensions3DOpenGL::bindVertexArrayOES(Platform3DObject array)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    UNUSED_PARAM(array);
+#endif
+
</ins><span class="cx">     m_context-&gt;makeContextCurrent();
</span><span class="cx"> #if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX))
</span><span class="cx">     if (isVertexArrayObjectSupported())
</span><span class="lines">@@ -186,13 +211,19 @@
</span><span class="cx">         return false;
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><ins>+
+#if PLATFORM(IOS)
+    if (name == &quot;GL_EXT_packed_depth_stencil&quot;)
+        return m_availableExtensions.contains(&quot;GL_OES_packed_depth_stencil&quot;);
+#endif
+
</ins><span class="cx">     return m_availableExtensions.contains(name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Extensions3DOpenGL::drawBuffersEXT(GC3Dsizei n, const GC3Denum* bufs)
</span><span class="cx"> {
</span><span class="cx">     //  FIXME: implement support for other platforms.
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     ::glDrawBuffersARB(n, bufs);
</span><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(n);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglExtensions3DOpenGLCommoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -36,6 +36,9 @@
</span><span class="cx"> #include &lt;BlackBerryPlatformLog.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;OpenGLES/ES2/glext.h&gt;
+#else
</ins><span class="cx"> #if USE(OPENGL_ES_2)
</span><span class="cx"> #include &quot;OpenGLESShims.h&quot;
</span><span class="cx"> #include &lt;GLES2/gl2.h&gt;
</span><span class="lines">@@ -45,6 +48,7 @@
</span><span class="cx"> #elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
</span><span class="cx"> #include &quot;OpenGLShims.h&quot;
</span><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="lines">@@ -71,7 +75,7 @@
</span><span class="cx">     if (vendorComponents.contains(&quot;intel&quot;))
</span><span class="cx">         m_isIntel = true;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     if (m_isAMD || m_isIntel)
</span><span class="cx">         m_requiresBuiltInFunctionEmulation = true;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,6 +29,9 @@
</span><span class="cx"> #if USE(3D_GRAPHICS)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;GraphicsContext3D.h&quot;
</span><ins>+#if PLATFORM(IOS)
+#include &quot;GraphicsContext3DIOS.h&quot;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;Extensions3DOpenGL.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="lines">@@ -41,7 +44,12 @@
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(IOS)
+#import &lt;OpenGLES/ES2/glext.h&gt;
+// From &lt;OpenGLES/glext.h&gt;
+#define GL_RGBA32F_ARB                      0x8814
+#define GL_RGB32F_ARB                       0x8815
+#elif PLATFORM(MAC)
</ins><span class="cx"> #include &lt;OpenGL/gl.h&gt;
</span><span class="cx"> #elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
</span><span class="cx"> #include &quot;OpenGLShims.h&quot;
</span><span class="lines">@@ -86,7 +94,11 @@
</span><span class="cx">         if (extensions-&gt;supports(&quot;GL_EXT_packed_depth_stencil&quot;))
</span><span class="cx">             internalDepthStencilFormat = GL_DEPTH24_STENCIL8_EXT;
</span><span class="cx">         else
</span><ins>+#if PLATFORM(IOS)
+            internalDepthStencilFormat = GL_DEPTH_COMPONENT16;
+#else
</ins><span class="cx">             internalDepthStencilFormat = GL_DEPTH_COMPONENT;
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool mustRestoreFBO = false;
</span><span class="lines">@@ -127,6 +139,11 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_texture);
</span><ins>+#if PLATFORM(IOS)
+    ::glBindRenderbuffer(GL_RENDERBUFFER, m_texture);
+    ::glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_texture);
+    setRenderbufferStorageFromDrawable(m_currentWidth, m_currentHeight);
+#else
</ins><span class="cx">     ::glBindTexture(GL_TEXTURE_2D, m_texture);
</span><span class="cx">     ::glTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
</span><span class="cx">     ::glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, m_texture, 0);
</span><span class="lines">@@ -136,6 +153,7 @@
</span><span class="cx">         ::glTexImage2D(GL_TEXTURE_2D, 0, m_internalColorFormat, width, height, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
</span><span class="cx">         ::glBindTexture(GL_TEXTURE_2D, 0);
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (!m_attrs.antialias &amp;&amp; (m_attrs.stencil || m_attrs.depth)) {
</span><span class="cx">         ::glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, m_depthStencilBuffer);
</span><span class="lines">@@ -167,17 +185,22 @@
</span><span class="cx"> 
</span><span class="cx">     ::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
</span><span class="cx">     ::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
</span><del>-
</del><ins>+#if PLATFORM(IOS)
+    UNUSED_PARAM(rect);
+    ::glResolveMultisampleFramebufferAPPLE();
+#else
</ins><span class="cx">     IntRect resolveRect = rect;
</span><span class="cx">     if (rect.isEmpty())
</span><span class="cx">         resolveRect = IntRect(0, 0, m_currentWidth, m_currentHeight);
</span><span class="cx"> 
</span><span class="cx">     ::glBlitFramebufferEXT(resolveRect.x(), resolveRect.y(), resolveRect.maxX(), resolveRect.maxY(), resolveRect.x(), resolveRect.y(), resolveRect.maxX(), resolveRect.maxY(), GL_COLOR_BUFFER_BIT, GL_LINEAR);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsContext3D::renderbufferStorage(GC3Denum target, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height)
</span><span class="cx"> {
</span><span class="cx">     makeContextCurrent();
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     switch (internalformat) {
</span><span class="cx">     case DEPTH_STENCIL:
</span><span class="cx">         internalformat = GL_DEPTH24_STENCIL8_EXT;
</span><span class="lines">@@ -193,6 +216,7 @@
</span><span class="cx">         internalformat = GL_RGB;
</span><span class="cx">         break;
</span><span class="cx">     }
</span><ins>+#endif
</ins><span class="cx">     ::glRenderbufferStorageEXT(target, internalformat, width, height);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -204,6 +228,7 @@
</span><span class="cx">     // Therefore, the value returned by desktop GL needs to be divided by 4.
</span><span class="cx">     makeContextCurrent();
</span><span class="cx">     switch (pname) {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     case MAX_FRAGMENT_UNIFORM_VECTORS:
</span><span class="cx">         ::glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, value);
</span><span class="cx">         *value /= 4;
</span><span class="lines">@@ -216,6 +241,7 @@
</span><span class="cx">         ::glGetIntegerv(GL_MAX_VARYING_FLOATS, value);
</span><span class="cx">         *value /= 4;
</span><span class="cx">         break;
</span><ins>+#endif
</ins><span class="cx">     default:
</span><span class="cx">         ::glGetIntegerv(pname, value);
</span><span class="cx">     }
</span><span class="lines">@@ -266,6 +292,7 @@
</span><span class="cx">         else if (format == GL_RGB)
</span><span class="cx">             openGLInternalFormat = GL_RGB32F_ARB;
</span><span class="cx">     } else if (type == HALF_FLOAT_OES) {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         if (format == GL_RGBA)
</span><span class="cx">             openGLInternalFormat = GL_RGBA16F_ARB;
</span><span class="cx">         else if (format == GL_RGB)
</span><span class="lines">@@ -277,6 +304,7 @@
</span><span class="cx">         else if (format == GL_LUMINANCE_ALPHA)
</span><span class="cx">             openGLInternalFormat = GL_LUMINANCE_ALPHA16F_ARB;
</span><span class="cx">         type = GL_HALF_FLOAT_ARB;
</span><ins>+#endif
</ins><span class="cx">     }
</span><span class="cx">     texImage2DDirect(target, level, openGLInternalFormat, width, height, border, format, type, pixels);
</span><span class="cx">     return true;
</span><span class="lines">@@ -285,13 +313,21 @@
</span><span class="cx"> void GraphicsContext3D::depthRange(GC3Dclampf zNear, GC3Dclampf zFar)
</span><span class="cx"> {
</span><span class="cx">     makeContextCurrent();
</span><ins>+#if PLATFORM(IOS)
+    ::glDepthRangef(static_cast&lt;float&gt;(zNear), static_cast&lt;float&gt;(zFar));
+#else
</ins><span class="cx">     ::glDepthRange(zNear, zFar);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsContext3D::clearDepth(GC3Dclampf depth)
</span><span class="cx"> {
</span><span class="cx">     makeContextCurrent();
</span><ins>+#if PLATFORM(IOS)
+    ::glClearDepthf(static_cast&lt;float&gt;(depth));
+#else
</ins><span class="cx">     ::glClearDepth(depth);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Extensions3D* GraphicsContext3D::getExtensions()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopenglGraphicsContext3DOpenGLCommoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -31,6 +31,9 @@
</span><span class="cx"> #if USE(3D_GRAPHICS)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;GraphicsContext3D.h&quot;
</span><ins>+#if PLATFORM(IOS)
+#include &quot;GraphicsContext3DIOS.h&quot;
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if USE(OPENGL_ES_2)
</span><span class="cx"> #include &quot;Extensions3DOpenGLES.h&quot;
</span><span class="lines">@@ -54,6 +57,12 @@
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &lt;OpenGLES/ES2/glext.h&gt;
+// From &lt;OpenGLES/glext.h&gt;
+#define GL_RGBA32F_ARB                      0x8814
+#define GL_RGB32F_ARB                       0x8815
+#else
</ins><span class="cx"> #if USE(OPENGL_ES_2)
</span><span class="cx"> #include &quot;OpenGLESShims.h&quot;
</span><span class="cx"> #elif PLATFORM(MAC)
</span><span class="lines">@@ -61,6 +70,7 @@
</span><span class="cx"> #elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)
</span><span class="cx"> #include &quot;OpenGLShims.h&quot;
</span><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(BLACKBERRY)
</span><span class="cx"> #include &lt;BlackBerryPlatformLog.h&gt;
</span><span class="lines">@@ -161,6 +171,10 @@
</span><span class="cx">     paintToCanvas(pixels.get(), m_currentWidth, m_currentHeight,
</span><span class="cx">                   imageBuffer-&gt;internalSize().width(), imageBuffer-&gt;internalSize().height(), imageBuffer-&gt;context()-&gt;platformContext());
</span><span class="cx"> #endif
</span><ins>+
+#if PLATFORM(IOS)
+    endPaint();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool GraphicsContext3D::paintCompositedResultsToCanvas(ImageBuffer*)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstransformsTransformationMatrixcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -1035,9 +1035,73 @@
</span><span class="cx"> // this = mat * this.
</span><span class="cx"> TransformationMatrix&amp; TransformationMatrix::multiply(const TransformationMatrix&amp; mat)
</span><span class="cx"> {
</span><del>-#if CPU(APPLE_ARMV7S)
</del><ins>+#if CPU(ARM64)
</ins><span class="cx">     double* leftMatrix = &amp;(m_matrix[0][0]);
</span><span class="cx">     const double* rightMatrix = &amp;(mat.m_matrix[0][0]);
</span><ins>+    asm volatile (
+        // First, load the leftMatrix completely in memory. The leftMatrix is in v16-v23.
+        &quot;mov      x4, %[leftMatrix]\n\t&quot;
+        &quot;ld1.2d   {v16, v17, v18, v19}, [%[leftMatrix]], #64\n\t&quot;
+        &quot;ld1.2d   {v20, v21, v22, v23}, [%[leftMatrix]]\n\t&quot;
+
+        // First row.
+        &quot;ld4r.2d  {v24, v25, v26, v27}, [%[rightMatrix]], #32\n\t&quot;
+        &quot;fmul.2d  v28, v24, v16\n\t&quot;
+        &quot;fmul.2d  v29, v24, v17\n\t&quot;
+        &quot;fmla.2d  v28, v25, v18\n\t&quot;
+        &quot;fmla.2d  v29, v25, v19\n\t&quot;
+        &quot;fmla.2d  v28, v26, v20\n\t&quot;
+        &quot;fmla.2d  v29, v26, v21\n\t&quot;
+        &quot;fmla.2d  v28, v27, v22\n\t&quot;
+        &quot;fmla.2d  v29, v27, v23\n\t&quot;
+
+        &quot;ld4r.2d  {v0, v1, v2, v3}, [%[rightMatrix]], #32\n\t&quot;
+        &quot;st1.2d  {v28, v29}, [x4], #32\n\t&quot;
+
+        // Second row.
+        &quot;fmul.2d  v30, v0, v16\n\t&quot;
+        &quot;fmul.2d  v31, v0, v17\n\t&quot;
+        &quot;fmla.2d  v30, v1, v18\n\t&quot;
+        &quot;fmla.2d  v31, v1, v19\n\t&quot;
+        &quot;fmla.2d  v30, v2, v20\n\t&quot;
+        &quot;fmla.2d  v31, v2, v21\n\t&quot;
+        &quot;fmla.2d  v30, v3, v22\n\t&quot;
+        &quot;fmla.2d  v31, v3, v23\n\t&quot;
+
+        &quot;ld4r.2d  {v24, v25, v26, v27}, [%[rightMatrix]], #32\n\t&quot;
+        &quot;st1.2d   {v30, v31}, [x4], #32\n\t&quot;
+
+        // Third row.
+        &quot;fmul.2d  v28, v24, v16\n\t&quot;
+        &quot;fmul.2d  v29, v24, v17\n\t&quot;
+        &quot;fmla.2d  v28, v25, v18\n\t&quot;
+        &quot;fmla.2d  v29, v25, v19\n\t&quot;
+        &quot;fmla.2d  v28, v26, v20\n\t&quot;
+        &quot;fmla.2d  v29, v26, v21\n\t&quot;
+        &quot;fmla.2d  v28, v27, v22\n\t&quot;
+        &quot;fmla.2d  v29, v27, v23\n\t&quot;
+
+        &quot;ld4r.2d  {v0, v1, v2, v3}, [%[rightMatrix]], #32\n\t&quot;
+        &quot;st1.2d   {v28, v29}, [x4], #32\n\t&quot;
+
+        // Fourth row.
+        &quot;fmul.2d  v30, v0, v16\n\t&quot;
+        &quot;fmul.2d  v31, v0, v17\n\t&quot;
+        &quot;fmla.2d  v30, v1, v18\n\t&quot;
+        &quot;fmla.2d  v31, v1, v19\n\t&quot;
+        &quot;fmla.2d  v30, v2, v20\n\t&quot;
+        &quot;fmla.2d  v31, v2, v21\n\t&quot;
+        &quot;fmla.2d  v30, v3, v22\n\t&quot;
+        &quot;fmla.2d  v31, v3, v23\n\t&quot;
+
+        &quot;st1.2d  {v30, v31}, [x4]\n\t&quot;
+
+        : [leftMatrix]&quot;+r&quot;(leftMatrix), [rightMatrix]&quot;+r&quot;(rightMatrix)
+        :
+        : &quot;memory&quot;, &quot;x4&quot;, &quot;v0&quot;, &quot;v1&quot;, &quot;v2&quot;, &quot;v3&quot;, &quot;v16&quot;, &quot;v17&quot;, &quot;v18&quot;, &quot;v19&quot;, &quot;v20&quot;, &quot;v21&quot;, &quot;v22&quot;, &quot;v23&quot;, &quot;v24&quot;, &quot;v25&quot;, &quot;v26&quot;, &quot;v27&quot;, &quot;v28&quot;, &quot;v29&quot;, &quot;v30&quot;, &quot;v31&quot;);
+#elif CPU(APPLE_ARMV7S)
+    double* leftMatrix = &amp;(m_matrix[0][0]);
+    const double* rightMatrix = &amp;(mat.m_matrix[0][0]);
</ins><span class="cx">     asm volatile (// First row of leftMatrix.
</span><span class="cx">         &quot;mov        r3, %[leftMatrix]\n\t&quot;
</span><span class="cx">         &quot;vld1.64    { d16-d19 }, [%[leftMatrix], :128]!\n\t&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinFontWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/FontWin.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/FontWin.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/win/FontWin.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -94,8 +94,7 @@
</span><span class="cx">     return beforeWidth;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Font::drawComplexText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point,
-                           int from, int to) const
</del><ins>+float Font::drawComplexText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to) const
</ins><span class="cx"> {
</span><span class="cx">     // This glyph buffer holds our glyphs + advances + font data for each glyph.
</span><span class="cx">     GlyphBuffer glyphBuffer;
</span><span class="lines">@@ -104,11 +103,12 @@
</span><span class="cx"> 
</span><span class="cx">     // We couldn't generate any glyphs for the run.  Give up.
</span><span class="cx">     if (glyphBuffer.isEmpty())
</span><del>-        return;
</del><ins>+        return 0;
</ins><span class="cx"> 
</span><span class="cx">     // Draw the glyph buffer now at the starting point returned in startX.
</span><span class="cx">     FloatPoint startPoint(startX, point.y());
</span><span class="cx">     drawGlyphBuffer(context, run, glyphBuffer, startPoint);
</span><ins>+    return startPoint.x() - startX;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Font::drawEmphasisMarksForComplexText(GraphicsContext* context, const TextRun&amp; run, const AtomicString&amp; mark, const FloatPoint&amp; point, int from, int to) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinceFontWinCEcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/wince/FontWinCE.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/wince/FontWinCE.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/graphics/wince/FontWinCE.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -207,8 +207,7 @@
</span><span class="cx">     return offset;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Font::drawComplexText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point,
-                           int from, int to) const
</del><ins>+float Font::drawComplexText(GraphicsContext* context, const TextRun&amp; run, const FloatPoint&amp; point, int from, int to) const
</ins><span class="cx"> {
</span><span class="cx">     if (to &lt; 0)
</span><span class="cx">         to = run.length();
</span><span class="lines">@@ -218,6 +217,7 @@
</span><span class="cx">     TextRunComponents components;
</span><span class="cx">     int w = generateComponents(&amp;components, *this, run);
</span><span class="cx"> 
</span><ins>+    float widthOfDrawnText = 0;
</ins><span class="cx">     int curPos = 0;
</span><span class="cx">     for (int i = 0; i &lt; (int)components.size(); ++i) {
</span><span class="cx">         const TextRunComponent&amp; comp = components.at(i);
</span><span class="lines">@@ -229,12 +229,13 @@
</span><span class="cx">                 pt.setX(point.x() + w - comp.m_offset - comp.m_width);
</span><span class="cx">             else
</span><span class="cx">                 pt.setX(point.x() + comp.m_offset);
</span><del>-            drawSimpleText(context, comp.m_textRun, pt, from - curPos, std::min(to, curEnd) - curPos);
</del><ins>+            widthOfDrawnText += drawSimpleText(context, comp.m_textRun, pt, from - curPos, std::min(to, curEnd) - curPos);
</ins><span class="cx">         }
</span><span class="cx">         curPos += len;
</span><span class="cx">         if (from &lt; curPos)
</span><span class="cx">             from = curPos;
</span><span class="cx">     }
</span><ins>+    return widthOfDrawnText;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Font::drawEmphasisMarksForComplexText(GraphicsContext* /* context */, const TextRun&amp; /* run */, const AtomicString&amp; /* mark */, const FloatPoint&amp; /* point */, int /* from */, int /* to */) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosContentFilterIOSmmfromrev161588trunkSourceWebCoreplatformContentFilterh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/ContentFilterIOS.mm (from rev 161588, trunk/Source/WebCore/platform/ContentFilter.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ContentFilterIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/ContentFilterIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;ContentFilter.h&quot;
+
+#if PLATFORM(IOS) &amp;&amp; USE(CONTENT_FILTERING)
+
+#import &quot;WebCoreThreadRun.h&quot;
+
+#if defined(__has_include) &amp;&amp; __has_include(&lt;WebContentAnalysis/WebFilterEvaluator.h&gt;)
+#import &lt;WebContentAnalysis/WebFilterEvaluator.h&gt;
+#else
+@interface NSObject (WebFilterEvaluatorDetails)
+- (void)unblockWithCompletion:(void (^)(BOOL unblocked, NSError *error))completion;
+@end
+#endif
+
+namespace WebCore {
+
+const char* ContentFilter::scheme()
+{
+    static const char contentFilterScheme[] = &quot;x-apple-content-filter&quot;;
+    return contentFilterScheme;
+}
+    
+void ContentFilter::requestUnblockAndDispatchIfSuccessful(Function&lt;void()&gt; function)
+{
+    [m_platformContentFilter unblockWithCompletion:^(BOOL unblocked, NSError *) {
+        if (unblocked) {
+            WebThreadRun(^{
+                function();
+            });
+        }
+    }];
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS) &amp;&amp; USE(CONTENT_FILTERING)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosDeviceMotionClientIOSh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DeviceMotionClientIOS_h
+#define DeviceMotionClientIOS_h
+
+#include &quot;DeviceMotionClient.h&quot;
+#include &quot;DeviceMotionController.h&quot;
+#include &quot;DeviceMotionData.h&quot;
+#include &lt;wtf/PassOwnPtr.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+
+#ifdef __OBJC__
+@class WebCoreMotionManager;
+#else
+class WebCoreMotionManager;
+#endif
+
+namespace WebCore {
+
+class DeviceMotionClientIOS : public DeviceMotionClient {
+public:
+    static PassOwnPtr&lt;DeviceMotionClientIOS&gt; create()
+    {
+        return adoptPtr(new DeviceMotionClientIOS());
+    }
+    DeviceMotionClientIOS();
+    virtual ~DeviceMotionClientIOS() OVERRIDE;
+    virtual void setController(DeviceMotionController*) OVERRIDE;
+    virtual void startUpdating() OVERRIDE;
+    virtual void stopUpdating() OVERRIDE;
+    virtual DeviceMotionData* lastMotion() const OVERRIDE;
+    virtual void deviceMotionControllerDestroyed() OVERRIDE;
+
+    void motionChanged(double, double, double, double, double, double, double, double, double);
+
+private:
+    WebCoreMotionManager* m_motionManager;
+    DeviceMotionController* m_controller;
+    RefPtr&lt;DeviceMotionData&gt; m_currentDeviceMotionData;
+    bool m_updating;
+};
+
+} // namespace WebCore
+
+#endif // DeviceMotionClientIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosDeviceMotionClientIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,129 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+
+#import &quot;DeviceMotionClientIOS.h&quot;
+
+#import &quot;WebCoreMotionManager.h&quot;
+
+#if PLATFORM(IOS)
+
+namespace WebCore {
+
+DeviceMotionClientIOS::DeviceMotionClientIOS()
+    : DeviceMotionClient()
+    , m_motionManager(nullptr)
+    , m_updating(0)
+{
+}
+
+DeviceMotionClientIOS::~DeviceMotionClientIOS()
+{
+}
+
+void DeviceMotionClientIOS::setController(DeviceMotionController* controller)
+{
+    m_controller = controller;
+}
+
+void DeviceMotionClientIOS::startUpdating()
+{
+    m_updating = true;
+
+    if (!m_motionManager)
+        m_motionManager = [WebCoreMotionManager sharedManager];
+
+    [m_motionManager addMotionClient:this];
+}
+
+void DeviceMotionClientIOS::stopUpdating()
+{
+    m_updating = false;
+
+    // Remove ourselves as the motion client so we won't get updates.
+    [m_motionManager removeMotionClient:this];
+}
+
+DeviceMotionData* DeviceMotionClientIOS::lastMotion() const
+{
+    return m_currentDeviceMotionData.get();
+}
+
+void DeviceMotionClientIOS::deviceMotionControllerDestroyed()
+{
+    [m_motionManager removeMotionClient:this];
+}
+
+void DeviceMotionClientIOS::motionChanged(double xAcceleration, double yAcceleration, double zAcceleration,
+                                             double xAccelerationIncludingGravity, double yAccelerationIncludingGravity, double zAccelerationIncludingGravity,
+                                             double xRotationRate, double yRotationRate, double zRotationRate)
+{
+    if (!m_updating)
+        return;
+
+#if PLATFORM(IOS_SIMULATOR)
+    UNUSED_PARAM(xAcceleration);
+    UNUSED_PARAM(yAcceleration);
+    UNUSED_PARAM(zAcceleration);
+    UNUSED_PARAM(xAccelerationIncludingGravity);
+    UNUSED_PARAM(yAccelerationIncludingGravity);
+    UNUSED_PARAM(zAccelerationIncludingGravity);
+    UNUSED_PARAM(xRotationRate);
+    UNUSED_PARAM(yRotationRate);
+    UNUSED_PARAM(zRotationRate);
+
+    RefPtr&lt;DeviceMotionData::Acceleration&gt; accelerationIncludingGravity = DeviceMotionData::Acceleration::create(false, 0,
+                                                                                                                 false, 0,
+                                                                                                                 false, 0);
+    RefPtr&lt;DeviceMotionData::Acceleration&gt; acceleration = DeviceMotionData::Acceleration::create(false, 0,
+                                                                                                 false, 0,
+                                                                                                 false, 0);
+    RefPtr&lt;DeviceMotionData::RotationRate&gt; rotationRate = DeviceMotionData::RotationRate::create(false, 0,
+                                                                                                 false, 0,
+                                                                                                 false, 0);
+#else
+    RefPtr&lt;DeviceMotionData::Acceleration&gt; accelerationIncludingGravity = DeviceMotionData::Acceleration::create(true, xAccelerationIncludingGravity,
+                                                                                                                 true, yAccelerationIncludingGravity,
+                                                                                                                 true, zAccelerationIncludingGravity);
+    RefPtr&lt;DeviceMotionData::Acceleration&gt; acceleration = 0;
+    RefPtr&lt;DeviceMotionData::RotationRate&gt; rotationRate = 0;
+    if ([m_motionManager gyroAvailable]) {
+        acceleration = DeviceMotionData::Acceleration::create(true, xAcceleration,
+                                                              true, yAcceleration,
+                                                              true, zAcceleration);
+        rotationRate = DeviceMotionData::RotationRate::create(true, xRotationRate,
+                                                              true, yRotationRate,
+                                                              true, zRotationRate);
+    }
+#endif // PLATFORM(IOS_SIMULATOR)
+
+    m_currentDeviceMotionData = DeviceMotionData::create(acceleration, accelerationIncludingGravity, rotationRate, true, kMotionUpdateInterval);
+    m_controller-&gt;didChangeDeviceMotion(m_currentDeviceMotionData.get());
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosDeviceOrientationClientIOSh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/DeviceOrientationClientIOS.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/DeviceOrientationClientIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/DeviceOrientationClientIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DeviceOrientationClientIOS_h
+#define DeviceOrientationClientIOS_h
+
+#include &quot;DeviceOrientationClient.h&quot;
+#include &quot;DeviceOrientationController.h&quot;
+#include &quot;DeviceOrientationData.h&quot;
+#include &lt;wtf/PassOwnPtr.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+
+#ifdef __OBJC__
+@class WebCoreMotionManager;
+#else
+class WebCoreMotionManager;
+#endif
+
+namespace WebCore {
+
+class DeviceOrientationClientIOS : public DeviceOrientationClient {
+public:
+    static PassOwnPtr&lt;DeviceOrientationClientIOS&gt; create()
+    {
+        return adoptPtr(new DeviceOrientationClientIOS());
+    }
+    DeviceOrientationClientIOS();
+    virtual ~DeviceOrientationClientIOS() OVERRIDE;
+    virtual void setController(DeviceOrientationController*) OVERRIDE;
+    virtual void startUpdating() OVERRIDE;
+    virtual void stopUpdating() OVERRIDE;
+    virtual DeviceOrientationData* lastOrientation() const OVERRIDE;
+    virtual void deviceOrientationControllerDestroyed() OVERRIDE;
+
+    void orientationChanged(double, double, double, double, double);
+
+private:
+    WebCoreMotionManager* m_motionManager;
+    DeviceOrientationController* m_controller;
+    RefPtr&lt;DeviceOrientationData&gt; m_currentDeviceOrientation;
+    bool m_updating;
+};
+
+} // namespace WebCore
+
+#endif // DeviceOrientationClientIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosDeviceOrientationClientIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/DeviceOrientationClientIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/DeviceOrientationClientIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/DeviceOrientationClientIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,108 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+
+#import &quot;DeviceOrientationClientIOS.h&quot;
+
+#import &quot;WebCoreMotionManager.h&quot;
+
+#if PLATFORM(IOS)
+
+namespace WebCore {
+
+DeviceOrientationClientIOS::DeviceOrientationClientIOS()
+    : DeviceOrientationClient()
+    , m_motionManager(nullptr)
+    , m_updating(0)
+{
+}
+
+DeviceOrientationClientIOS::~DeviceOrientationClientIOS()
+{
+}
+
+void DeviceOrientationClientIOS::setController(DeviceOrientationController* controller)
+{
+    m_controller = controller;
+}
+
+void DeviceOrientationClientIOS::startUpdating()
+{
+    m_updating = true;
+
+    if (!m_motionManager)
+        m_motionManager = [WebCoreMotionManager sharedManager];
+
+    [m_motionManager addOrientationClient:this];
+}
+
+void DeviceOrientationClientIOS::stopUpdating()
+{
+    m_updating = false;
+
+    // Remove ourselves as the orientation client so we won't get updates.
+    [m_motionManager removeOrientationClient:this];
+}
+
+DeviceOrientationData* DeviceOrientationClientIOS::lastOrientation() const
+{
+    return m_currentDeviceOrientation.get();
+}
+
+void DeviceOrientationClientIOS::deviceOrientationControllerDestroyed()
+{
+    [m_motionManager removeOrientationClient:this];
+}
+    
+void DeviceOrientationClientIOS::orientationChanged(double alpha, double beta, double gamma, double compassHeading, double compassAccuracy)
+{
+    if (!m_updating)
+        return;
+
+#if PLATFORM(IOS_SIMULATOR)
+    UNUSED_PARAM(alpha);
+    UNUSED_PARAM(beta);
+    UNUSED_PARAM(gamma);
+    UNUSED_PARAM(compassHeading);
+    UNUSED_PARAM(compassAccuracy);
+    m_currentDeviceOrientation = DeviceOrientationData::create(false, 0,
+                                                           false, 0,
+                                                           false, 0,
+                                                           false, 0,
+                                                           false, 0);
+#else
+    m_currentDeviceOrientation = DeviceOrientationData::create(true, alpha,
+                                                           true, beta,
+                                                           true, gamma,
+                                                           true, compassHeading,
+                                                           true, compassAccuracy);
+#endif
+    m_controller-&gt;didChangeDeviceOrientation(m_currentDeviceOrientation.get());
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosKeyEventIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/KeyEventIOS.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/KeyEventIOS.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ios/KeyEventIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,59 +28,12 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><del>-#import &quot;KeyEventCocoa.h&quot;
-#import &quot;Logging.h&quot;
</del><span class="cx"> #import &quot;NotImplemented.h&quot;
</span><del>-#import &quot;WebEvent.h&quot;
</del><span class="cx"> 
</span><span class="cx"> using namespace WTF;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static String keyIdentifierForKeyEvent(WebEvent *event)
-{
-    NSString *s = event.charactersIgnoringModifiers;
-    if ([s length] != 1) {
-        LOG(Events, &quot;received an unexpected number of characters in key event: %u&quot;, [s length]);
-        return &quot;Unidentified&quot;;
-    }
-
-    unichar c = CFStringGetCharacterAtIndex((CFStringRef)s, 0);
-    return keyIdentifierForCharCode(c);
-}
-
-PlatformKeyboardEvent::PlatformKeyboardEvent(WebEvent *event)
-    : PlatformEvent(event.type == WebEventKeyUp ? PlatformEvent::KeyUp : PlatformEvent::KeyDown, event.modifierFlags &amp; WebEventFlagMaskShift, event.modifierFlags &amp; WebEventFlagMaskControl, event.modifierFlags &amp; WebEventFlagMaskAlternate, event.modifierFlags &amp; WebEventFlagMaskCommand)
-    , m_text(event.characters)
-    , m_unmodifiedText(event.charactersIgnoringModifiers)
-    , m_keyIdentifier(keyIdentifierForKeyEvent(event))
-    , m_autoRepeat(event.isKeyRepeating)
-    , m_windowsVirtualKeyCode(event.keyCode)
-    , m_isKeypad(false) // iPhone does not distinguish the numpad &lt;rdar://problem/7190835&gt;
-    , m_Event(event)
-{
-    ASSERT(event.type == WebEventKeyDown || event.type == WebEventKeyUp);
-
-    // Always use 13 for Enter/Return -- we don't want to use AppKit's different character for Enter.
-    if (m_windowsVirtualKeyCode == '\r') {
-        m_text = &quot;\r&quot;;
-        m_unmodifiedText = &quot;\r&quot;;
-    }
-
-    // The adjustments below are only needed in backward compatibility mode, but we cannot tell what mode we are in from here.
-
-    // Turn 0x7F into 8, because backspace needs to always be 8.
-    if (m_text == &quot;\x7F&quot;)
-        m_text = &quot;\x8&quot;;
-    if (m_unmodifiedText == &quot;\x7F&quot;)
-        m_unmodifiedText = &quot;\x8&quot;;
-    // Always use 9 for tab -- we don't want to use AppKit's different character for shift-tab.
-    if (m_windowsVirtualKeyCode == 9) {
-        m_text = &quot;\x9&quot;;
-        m_unmodifiedText = &quot;\x9&quot;;
-    }
-}
-
</del><span class="cx"> void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode)
</span><span class="cx"> {
</span><span class="cx">     // Can only change type from KeyDown to RawKeyDown or Char, as we lack information for other conversions.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosMIMETypeRegistryIOSmmfromrev161588trunkSourceWebCoreplatformnetworkmacCredentialStorageMacmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/MIMETypeRegistryIOS.mm (from rev 161588, trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/MIMETypeRegistryIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/MIMETypeRegistryIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;MIMETypeRegistry.h&quot;
+
+#include &quot;WebCoreSystemInterface.h&quot;
+
+namespace WebCore 
+{
+String MIMETypeRegistry::getMIMETypeForExtension(const String &amp;ext)
+{
+    return wkGetMIMETypeForExtension(ext);
+}
+
+Vector&lt;String&gt; MIMETypeRegistry::getExtensionsForMIMEType(const String&amp; /*type*/)
+{
+    return Vector&lt;String&gt;();
+}
+
+String MIMETypeRegistry::getPreferredExtensionForMIMEType(const String&amp; /*type*/)
+{
+    return String();
+}
+
+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&amp;)
+{
+    return false;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosMemoryPressureHandlerIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/MemoryPressureHandlerIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/MemoryPressureHandlerIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/MemoryPressureHandlerIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,107 @@
</span><ins>+/*
+ * Copyright (C) 2012 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;MemoryPressureHandler.h&quot;
+
+#import &quot;Logging.h&quot;
+#import &quot;SystemMemory.h&quot;
+#import &quot;WebCoreThread.h&quot;
+#import &lt;libkern/OSAtomic.h&gt;
+
+namespace WebCore {
+
+static void respondToMemoryPressureCallback(CFRunLoopObserverRef observer, CFRunLoopActivity /*activity*/, void* /*info*/)
+{
+    memoryPressureHandler().respondToMemoryPressureIfNeeded();
+    CFRunLoopObserverInvalidate(observer);
+    CFRelease(observer);
+}
+
+void MemoryPressureHandler::installMemoryReleaseBlock(void (^releaseMemoryBlock)(), bool clearPressureOnMemoryRelease)
+{
+    if (m_installed)
+        return;
+    m_releaseMemoryBlock = Block_copy(releaseMemoryBlock);
+    m_clearPressureOnMemoryRelease = clearPressureOnMemoryRelease;
+    m_installed = true;
+}
+
+void MemoryPressureHandler::setReceivedMemoryPressure(MemoryPressureReason reason)
+{
+    OSAtomicTestAndSet(0, &amp;m_receivedMemoryPressure);
+
+    {
+        MutexLocker locker(m_observerMutex);
+        if (!m_observer) {
+            m_observer = CFRunLoopObserverCreate(NULL, kCFRunLoopBeforeWaiting | kCFRunLoopExit, NO /* don't repeat */,
+                0, WebCore::respondToMemoryPressureCallback, NULL);
+            CFRunLoopAddObserver(WebThreadRunLoop(), m_observer, kCFRunLoopCommonModes);
+            CFRunLoopWakeUp(WebThreadRunLoop());
+        }
+        m_memoryPressureReason |= reason;
+    }
+}
+
+bool MemoryPressureHandler::hasReceivedMemoryPressure()
+{
+    return OSAtomicOr32(0, &amp;m_receivedMemoryPressure);
+}
+
+void MemoryPressureHandler::clearMemoryPressure()
+{
+    OSAtomicTestAndClear(0, &amp;m_receivedMemoryPressure);
+
+    {
+        MutexLocker locker(m_observerMutex);
+        m_memoryPressureReason = MemoryPressureReasonNone;
+    }
+}
+
+bool MemoryPressureHandler::shouldWaitForMemoryClearMessage()
+{
+    MutexLocker locker(m_observerMutex);
+    return m_memoryPressureReason &amp; MemoryPressureReasonVMStatus;
+}
+
+void MemoryPressureHandler::respondToMemoryPressureIfNeeded()
+{
+    ASSERT(WebThreadIsLockedOrDisabled());
+
+    {
+        MutexLocker locker(m_observerMutex);
+        m_observer = 0;
+    }
+
+    if (hasReceivedMemoryPressure()) {
+        ASSERT(m_releaseMemoryBlock);
+        LOG(MemoryPressure, &quot;Handle memory pressure at %s&quot;, __PRETTY_FUNCTION__);
+        m_releaseMemoryBlock();
+        if (m_clearPressureOnMemoryRelease)
+            clearMemoryPressure();
+    }
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPasteboardIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/PasteboardIOS.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PasteboardIOS.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ios/PasteboardIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -35,20 +35,24 @@
</span><span class="cx"> #import &quot;Frame.h&quot;
</span><span class="cx"> #import &quot;FrameLoader.h&quot;
</span><span class="cx"> #import &quot;FrameLoaderClient.h&quot;
</span><ins>+#import &quot;HTMLConverter.h&quot;
</ins><span class="cx"> #import &quot;HTMLElement.h&quot;
</span><span class="cx"> #import &quot;HTMLNames.h&quot;
</span><span class="cx"> #import &quot;HTMLParserIdioms.h&quot;
</span><del>-#import &quot;URL.h&quot;
</del><ins>+#import &quot;Image.h&quot;
</ins><span class="cx"> #import &quot;LegacyWebArchive.h&quot;
</span><span class="cx"> #import &quot;Page.h&quot;
</span><span class="cx"> #import &quot;PasteboardStrategy.h&quot;
</span><span class="cx"> #import &quot;PlatformStrategies.h&quot;
</span><span class="cx"> #import &quot;RenderImage.h&quot;
</span><ins>+#import &quot;RuntimeApplicationChecksIOS.h&quot;
+#import &quot;SharedBuffer.h&quot;
</ins><span class="cx"> #import &quot;SoftLinking.h&quot;
</span><span class="cx"> #import &quot;Text.h&quot;
</span><ins>+#import &quot;URL.h&quot;
+#import &quot;WebNSAttributedStringExtras.h&quot;
</ins><span class="cx"> #import &quot;htmlediting.h&quot;
</span><span class="cx"> #import &quot;markup.h&quot;
</span><del>-#import &quot;WebNSAttributedStringExtras.h&quot;
</del><span class="cx"> #import &lt;MobileCoreServices/MobileCoreServices.h&gt;
</span><span class="cx"> 
</span><span class="cx"> @interface NSAttributedString (NSAttributedStringKitAdditions)
</span><span class="lines">@@ -126,99 +130,26 @@
</span><span class="cx">     return adoptPtr(new Pasteboard);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Pasteboard::setFrame(Frame* frame)
</del><ins>+void Pasteboard::write(const PasteboardWebContent&amp; content)
</ins><span class="cx"> {
</span><del>-    m_frame = frame;
-    m_changeCount = m_frame-&gt;editor().client()-&gt;pasteboardChangeCount();
</del><ins>+    platformStrategies()-&gt;pasteboardStrategy()-&gt;writeToPasteboard(content);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Pasteboard::writeSelection(Range* selectedRange, bool /*canSmartCopyOrDelete*/, Frame *frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard)
</del><ins>+String Pasteboard::resourceMIMEType(const NSString *mimeType)
</ins><span class="cx"> {
</span><del>-    ASSERT(selectedRange);
-    ASSERT(frame);
-
-    // If the selection is at the beginning of content inside an anchor tag
-    // we move the selection start to include the anchor.
-    ExceptionCode ec;
-    Node* commonAncestor = selectedRange-&gt;commonAncestorContainer(ec);
-    ASSERT(commonAncestor);
-    Node* enclosingAnchor = enclosingNodeWithTag(firstPositionInNode(commonAncestor), HTMLNames::aTag);
-    if (enclosingAnchor &amp;&amp; comparePositions(firstPositionInOrBeforeNode(selectedRange-&gt;startPosition().anchorNode()), selectedRange-&gt;startPosition()) &gt;= 0)
-        selectedRange-&gt;setStart(enclosingAnchor, 0, ec);
-
-    RetainPtr&lt;NSDictionary&gt; representations = adoptNS([[NSMutableDictionary alloc] init]);
-
-    // Put WebArchive on the pasteboard.
-    RefPtr&lt;LegacyWebArchive&gt; archive = LegacyWebArchive::createFromSelection(frame);
-    RetainPtr&lt;CFDataRef&gt; data = archive ? archive-&gt;rawDataRepresentation() : 0;
-    if (data)
-        [representations.get() setValue:(NSData *)data.get() forKey:WebArchivePboardType];
-
-    RetainPtr&lt;NSHTMLReader&gt; converter = adoptNS([[getNSHTMLReaderClass() alloc] initWithDOMRange:kit(selectedRange)]);
-    if (converter) {
-        NSAttributedString *attributedString = [converter.get() attributedString];
-        NSData* RTFDData = [attributedString RTFDFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil];
-        if (RTFDData)
-            [representations.get() setValue:RTFDData forKey:(NSString *)kUTTypeRTFD];
-        if ([attributedString containsAttachments])
-            attributedString = attributedStringByStrippingAttachmentCharacters(attributedString);
-        NSData* RTFData = [attributedString RTFFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil];
-        if (RTFData)
-            [representations.get() setValue:RTFData forKey:(NSString *)kUTTypeRTF];
-    }
-
-    // Put plain string on the pasteboard.
-    String text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard
-        ? frame-&gt;editor().selectedTextForClipboard() : frame-&gt;editor().selectedText();
-    text.replace(noBreakSpace, ' ');
-    [representations.get() setValue:text forKey:(NSString *)kUTTypeText];
-
-    frame-&gt;editor().client()-&gt;writeDataToPasteboard(representations.get());
</del><ins>+    return String(adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (CFStringRef)mimeType, NULL)).get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Pasteboard::writePlainText(const String&amp; text, Frame *frame)
</del><ins>+void Pasteboard::write(const PasteboardImage&amp; pasteboardImage)
</ins><span class="cx"> {
</span><del>-    ASSERT(frame);
-
-    RetainPtr&lt;NSDictionary&gt; representations = adoptNS([[NSMutableDictionary alloc] init]);
-    [representations.get() setValue:text forKey:(NSString *)kUTTypeText];
-    frame-&gt;editor().client()-&gt;writeDataToPasteboard(representations.get());
</del><ins>+    platformStrategies()-&gt;pasteboardStrategy()-&gt;writeToPasteboard(pasteboardImage);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Pasteboard::writeImage(Node* node, Frame* frame)
</del><ins>+void Pasteboard::writePlainText(const String&amp; text, SmartReplaceOption)
</ins><span class="cx"> {
</span><del>-    ASSERT(node);
-
-    if (!(node-&gt;renderer() &amp;&amp; node-&gt;renderer()-&gt;isImage()))
-        return;
-
-    RenderImage* renderer = toRenderImage(node-&gt;renderer());
-    CachedImage* cachedImage = renderer-&gt;cachedImage();
-    if (!cachedImage || cachedImage-&gt;errorOccurred())
-        return;
-
-    Image* image = cachedImage-&gt;imageForRenderer(renderer);
-    ASSERT(image);
-
-    RetainPtr&lt;NSData&gt; imageData = image-&gt;data()-&gt;createNSData();
-
-    if (!imageData)
-        return;
-
-    RetainPtr&lt;NSMutableDictionary&gt; dictionary = adoptNS([[NSMutableDictionary alloc] init]);
-    NSString *mimeType = cachedImage-&gt;response().mimeType();
-    RetainPtr&lt;CFStringRef&gt; uti = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (CFStringRef)mimeType, NULL));
-    if (uti) {
-        [dictionary.get() setObject:imageData.get() forKey:(NSString *)uti.get()];
-        [dictionary.get() setObject:(NSString *)node-&gt;document().completeURL(stripLeadingAndTrailingHTMLSpaces(static_cast&lt;HTMLElement*&gt;(node)-&gt;getAttribute(&quot;src&quot;))) forKey:(NSString *)kUTTypeURL];
-    }
-    frame-&gt;editor().client()-&gt;writeDataToPasteboard(dictionary.get());
</del><ins>+    platformStrategies()-&gt;pasteboardStrategy()-&gt;writeToPasteboard(kUTTypeText, text);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Pasteboard::writePlainText(const String&amp;, SmartReplaceOption)
-{
-}
-
</del><span class="cx"> void Pasteboard::writePasteboard(const Pasteboard&amp;)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -230,241 +161,83 @@
</span><span class="cx"> 
</span><span class="cx"> void Pasteboard::read(PasteboardPlainText&amp; text)
</span><span class="cx"> {
</span><del>-    RetainPtr&lt;NSArray&gt; pasteboardItem = m_frame-&gt;editor().client()-&gt;readDataFromPasteboard((NSString *)kUTTypeText, 0);
-
-    if ([pasteboardItem.get() count] == 0)
-        return;
-
-    id value = [pasteboardItem.get() objectAtIndex:0];
-    ASSERT([value isKindOfClass:[NSString class]]);
-    if ([value isKindOfClass:[NSString class]])
-        text.text = (NSString *)value;
</del><ins>+    PasteboardStrategy&amp; strategy = *platformStrategies()-&gt;pasteboardStrategy();
+    text.text = strategy.readStringFromPasteboard(0, kUTTypeText);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static NSArray* supportedImageTypes()
</span><span class="cx"> {
</span><del>-    return [NSArray arrayWithObjects:(id)kUTTypePNG, (id)kUTTypeTIFF, (id)kUTTypeJPEG, (id)kUTTypeGIF, nil];
</del><ins>+    return @[(id)kUTTypePNG, (id)kUTTypeTIFF, (id)kUTTypeJPEG, (id)kUTTypeGIF];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-NSArray* Pasteboard::supportedPasteboardTypes()
</del><ins>+void Pasteboard::read(PasteboardWebContentReader&amp; reader)
</ins><span class="cx"> {
</span><del>-    return [NSArray arrayWithObjects:(id)WebArchivePboardType, (id)kUTTypePNG, (id)kUTTypeTIFF, (id)kUTTypeJPEG, (id)kUTTypeGIF, (id)kUTTypeURL, (id)kUTTypeText, (id)kUTTypeRTFD, (id)kUTTypeRTF, nil];
-}
</del><ins>+    PasteboardStrategy&amp; strategy = *platformStrategies()-&gt;pasteboardStrategy();
</ins><span class="cx"> 
</span><del>-#define WebDataProtocolScheme @&quot;webkit-fake-url&quot;
</del><ins>+    int numberOfItems = strategy.getPasteboardItemsCount();
</ins><span class="cx"> 
</span><del>-static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
-{
-    CFUUIDRef UUIDRef = CFUUIDCreate(kCFAllocatorDefault);
-    NSString *UUIDString = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, UUIDRef);
-    CFRelease(UUIDRef);
-    NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@&quot;%@://%@/%@&quot;, WebDataProtocolScheme, UUIDString, relativePart]];
-    CFRelease(UUIDString);
</del><ins>+    if (!numberOfItems)
+        return;
</ins><span class="cx"> 
</span><del>-    return URL;
-}
</del><ins>+    NSArray *types = supportedPasteboardTypes();
+    int numberOfTypes = [types count];
</ins><span class="cx"> 
</span><del>-static PassRefPtr&lt;DocumentFragment&gt; documentFragmentWithImageResource(Frame* frame, PassRefPtr&lt;ArchiveResource&gt; resource)
-{
-    RefPtr&lt;Element&gt; imageElement = frame-&gt;document()-&gt;createElement(HTMLNames::imgTag, false);
</del><ins>+    for (int i = 0; i &lt; numberOfItems; i++) {
+        for (int typeIndex = 0; typeIndex &lt; numberOfTypes; typeIndex++) {
+            NSString *type = [types objectAtIndex:typeIndex];
</ins><span class="cx"> 
</span><del>-    if (DocumentLoader* loader = frame-&gt;loader().documentLoader())
-        loader-&gt;addArchiveResource(resource.get());
-
-    NSURL *URL = resource-&gt;url();
-    imageElement-&gt;setAttribute(HTMLNames::srcAttr, [URL isFileURL] ? [URL absoluteString] : resource-&gt;url());
-    RefPtr&lt;DocumentFragment&gt; fragment = frame-&gt;document()-&gt;createDocumentFragment();
-    fragment-&gt;appendChild(imageElement.release());
-    return fragment.release();
-}
-
-static PassRefPtr&lt;DocumentFragment&gt; documentFragmentWithLink(Document* document, const String&amp; urlString)
-{
-    RefPtr&lt;Element&gt; anchorElement = document-&gt;createElement(HTMLNames::aTag, false);
-
-    anchorElement-&gt;setAttribute(HTMLNames::hrefAttr, urlString);
-    anchorElement-&gt;appendChild(document-&gt;createTextNode(urlString));
-
-    RefPtr&lt;DocumentFragment&gt; fragment = document-&gt;createDocumentFragment();
-    fragment-&gt;appendChild(anchorElement.release());
-    return fragment.release();
-}
-
-static PassRefPtr&lt;DocumentFragment&gt; documentFragmentWithRTF(Frame* frame, NSString *pasteboardType, NSData* pasteboardData)
-{
-    if (!frame || !frame-&gt;document() || !frame-&gt;document()-&gt;isHTMLDocument())
-        return 0;
-
-    RetainPtr&lt;NSAttributedString&gt; string;
-    if ([pasteboardType isEqualToString:(NSString *)kUTTypeRTFD])
-        string = [[NSAttributedString alloc] initWithRTFD:pasteboardData documentAttributes:NULL];
-
-    if (!string)
-        string = [[NSAttributedString alloc] initWithRTF:pasteboardData documentAttributes:NULL];
-
-    if (!string)
-        return 0;
-
-    bool wasDeferringCallbacks = frame-&gt;page()-&gt;defersLoading();
-    if (!wasDeferringCallbacks)
-        frame-&gt;page()-&gt;setDefersLoading(true);
-
-    Vector&lt;RefPtr&lt;ArchiveResource&gt;&gt; resources;
-    RefPtr&lt;DocumentFragment&gt; fragment = frame-&gt;editor().client()-&gt;documentFragmentFromAttributedString(string.get(), resources);
-
-    size_t size = resources.size();
-    if (size) {
-        DocumentLoader* loader = frame-&gt;loader().documentLoader();
-        for (size_t i = 0; i &lt; size; ++i)
-            loader-&gt;addArchiveResource(resources[i]);
-    }
-
-    if (!wasDeferringCallbacks)
-        frame-&gt;page()-&gt;setDefersLoading(false);
-
-    return fragment.release();
-}
-
-PassRefPtr&lt;DocumentFragment&gt; Pasteboard::documentFragmentForPasteboardItemAtIndex(Frame* frame, int index, bool allowPlainText, bool&amp; chosePlainText)
-{
-    RefPtr&lt;DocumentFragment&gt; fragment = frame-&gt;editor().client()-&gt;documentFragmentFromDelegate(index);
-    if (fragment)
-        return fragment.release();
-
-    // First try to ask the client about the supported types. It will return null if the client
-    // has no selection.
-    NSArray *supportedTypes = frame-&gt;editor().client()-&gt;supportedPasteboardTypesForCurrentSelection();
-    if (!supportedTypes)
-        supportedTypes = supportedPasteboardTypes();
-    int numberOfTypes = [supportedTypes count];
-
-    for (int i = 0; i &lt; numberOfTypes; i++) {
-        NSString *type = [supportedTypes objectAtIndex:i];
-        RetainPtr&lt;NSArray&gt; pasteboardItem = frame-&gt;editor().client()-&gt;readDataFromPasteboard(type, index);
-
-        if ([pasteboardItem.get() count] == 0)
-            continue;
-
-        if ([type isEqualToString:WebArchivePboardType]) {
-            if (!frame-&gt;document())
-                return 0;
-
-            // We put [WebArchive data] on the pasteboard in -copy: instead of the archive itself until there is API to provide the WebArchive.
-            NSData *data = [pasteboardItem.get() objectAtIndex:0];
-            RefPtr&lt;LegacyWebArchive&gt; coreArchive = LegacyWebArchive::create(SharedBuffer::wrapNSData(data).get());
-            if (coreArchive) {
-                RefPtr&lt;ArchiveResource&gt; mainResource = coreArchive-&gt;mainResource();
-                if (mainResource) {
-                    NSString *MIMEType = mainResource-&gt;mimeType();
-                    if (frame-&gt;loader().client().canShowMIMETypeAsHTML(MIMEType)) {
-                        RetainPtr&lt;NSString&gt; markupString = adoptNS([[NSString alloc] initWithData:[mainResource-&gt;data()-&gt;createNSData() autorelease] encoding:NSUTF8StringEncoding]);
-                        if (DocumentLoader* loader = frame-&gt;loader().documentLoader())
-                            loader-&gt;addAllArchiveResources(coreArchive.get());
-
-                        fragment = createFragmentFromMarkup(*frame-&gt;document(), markupString.get(), mainResource-&gt;url(), DisallowScriptingContent);
-                    }
</del><ins>+            if ([type isEqualToString:WebArchivePboardType]) {
+                if (RefPtr&lt;SharedBuffer&gt; buffer = strategy.readBufferFromPasteboard(i, WebArchivePboardType)) {
+                    if (reader.readWebArchive(buffer.release()))
+                        break;
</ins><span class="cx">                 }
</span><del>-                if (fragment)
-                    return fragment.release();
</del><span class="cx">             }
</span><del>-        }
</del><span class="cx"> 
</span><del>-        if ([type isEqualToString:(NSString *)kUTTypeRTFD])
-            return documentFragmentWithRTF(frame, (NSString *)kUTTypeRTFD, [pasteboardItem.get() objectAtIndex:0]);
-
-        if ([type isEqualToString:(NSString *)kUTTypeRTF])
-            return documentFragmentWithRTF(frame, (NSString *)kUTTypeRTF, [pasteboardItem.get() objectAtIndex:0]);
-
-        if ([supportedImageTypes() containsObject:type]) {
-            RetainPtr&lt;NSString&gt; filenameExtension = adoptNS((NSString *)UTTypeCopyPreferredTagWithClass((CFStringRef)type, kUTTagClassFilenameExtension));
-            NSString *relativeURLPart = [@&quot;image&quot; stringByAppendingString:filenameExtension.get()];
-            RetainPtr&lt;NSString&gt; mimeType = adoptNS((NSString *)UTTypeCopyPreferredTagWithClass((CFStringRef)type, kUTTagClassMIMEType));
-            NSData *data = [pasteboardItem.get() objectAtIndex:0];
-            return documentFragmentWithImageResource(frame, ArchiveResource::create(SharedBuffer::wrapNSData([[data copy] autorelease]), uniqueURLWithRelativePart(relativeURLPart), mimeType.get(), &quot;&quot;, &quot;&quot;));
-        }
-        if ([type isEqualToString:(NSString *)kUTTypeURL]) {
-            id value = [pasteboardItem.get() objectAtIndex:0];
-            if (![value isKindOfClass:[NSURL class]]) {
-                ASSERT([value isKindOfClass:[NSURL class]]);
-                return 0;
</del><ins>+             if ([type isEqualToString:(NSString *)kUTTypeRTFD]) {
+                if (RefPtr&lt;SharedBuffer&gt; buffer = strategy.readBufferFromPasteboard(i, kUTTypeRTFD)) {
+                    if (reader.readRTFD(buffer.release()))
+                        break;
+                }
</ins><span class="cx">             }
</span><del>-            NSURL *url = (NSURL *)value;
</del><span class="cx"> 
</span><del>-            if (!frame-&gt;editor().client()-&gt;hasRichlyEditableSelection()) {
-                fragment = createFragmentFromText(frame-&gt;selection().toNormalizedRange().get(), [url absoluteString]);
-                if (fragment)
-                    return fragment.release();
</del><ins>+            if ([type isEqualToString:(NSString *)kUTTypeRTF]) {
+                if (RefPtr&lt;SharedBuffer&gt; buffer = strategy.readBufferFromPasteboard(i, kUTTypeRTF)) {
+                    if (reader.readRTF(buffer.release()))
+                        break;
+                }
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if ([url isFileURL]) {
-                NSString *localPath = [url relativePath];
-                // Only allow url attachments from ~/Media for now.
-                if (![localPath hasPrefix:[(NSString *)CPSharedResourcesDirectory() stringByAppendingString:@&quot;/Media/DCIM/&quot;]])
-                    continue;
</del><ins>+            if ([supportedImageTypes() containsObject:type]) {
+                if (RefPtr&lt;SharedBuffer&gt; buffer = strategy.readBufferFromPasteboard(i, type)) {
+                    if (reader.readImage(buffer.release(), type))
+                        break;
+                }
+        }
</ins><span class="cx"> 
</span><del>-                RetainPtr&lt;NSString&gt; fileType = adoptNS((NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)[localPath pathExtension], NULL));
-                NSData *data = [NSData dataWithContentsOfFile:localPath];
-                if (UTTypeConformsTo((CFStringRef)fileType.get(), kUTTypePNG))
-                    return documentFragmentWithImageResource(frame, ArchiveResource::create(SharedBuffer::wrapNSData([[data copy] autorelease]), uniqueURLWithRelativePart(@&quot;image.png&quot;), @&quot;image/png&quot;, &quot;&quot;, &quot;&quot;));
-                else if (UTTypeConformsTo((CFStringRef)fileType.get(), kUTTypeJPEG))
-                    return documentFragmentWithImageResource(frame, ArchiveResource::create(SharedBuffer::wrapNSData([[data copy] autorelease]), uniqueURLWithRelativePart(@&quot;image.jpg&quot;), @&quot;image/jpg&quot;, &quot;&quot;, &quot;&quot;));
-            } else {
-                // Create a link with URL text.
-                return documentFragmentWithLink(frame-&gt;document(), [url absoluteString]);
</del><ins>+            if ([type isEqualToString:(NSString *)kUTTypeURL]) {
+                URL url = strategy.readURLFromPasteboard(i, kUTTypeURL);
+                if (!url.isNull() &amp;&amp; reader.readURL(url, String()))
+                    break;
</ins><span class="cx">             }
</span><del>-        }
-        if (allowPlainText &amp;&amp; [type isEqualToString:(NSString *)kUTTypeText]) {
-            id value = [pasteboardItem.get() objectAtIndex:0];
-            if (![value isKindOfClass:[NSString class]]) {
-                ASSERT([value isKindOfClass:[NSString class]]);
-                return 0;
</del><ins>+            
+            if ([type isEqualToString:(NSString *)kUTTypeText]) {
+                String string = strategy.readStringFromPasteboard(i, kUTTypeText);
+                if (!string.isNull() &amp;&amp; reader.readPlainText(string))
+                    break;
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            chosePlainText = true;
-            fragment = createFragmentFromText(frame-&gt;selection().toNormalizedRange().get(), (NSString *)value);
-            if (fragment)
-                return fragment.release();
</del><span class="cx">         }
</span><span class="cx">     }
</span><del>-
-    return 0;
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;DocumentFragment&gt; Pasteboard::documentFragment(Frame* frame, PassRefPtr&lt;Range&gt; /*context*/, bool allowPlainText, bool&amp; chosePlainText)
</del><ins>+NSArray* Pasteboard::supportedPasteboardTypes()
</ins><span class="cx"> {
</span><del>-    chosePlainText = false;
-
-    if (!frame)
-        return 0;
-
-    int numberOfItems = frame-&gt;editor().client()-&gt;getPasteboardItemsCount();
-
-    if (!numberOfItems)
-        return 0;
-
-    // In the common case there is just one item on the pasteboard, avoid the expense of transferring the content of
-    // fragmentForCurrentItem to the main fragment.
-    RefPtr&lt;DocumentFragment&gt; fragment = documentFragmentForPasteboardItemAtIndex(frame, 0, allowPlainText, chosePlainText);
-
-    for (int i = 1; i &lt; numberOfItems; i++) {
-        RefPtr&lt;DocumentFragment&gt; fragmentForCurrentItem = documentFragmentForPasteboardItemAtIndex(frame, i, allowPlainText, chosePlainText);
-        if (!fragment)
-            fragment = fragmentForCurrentItem;
-        else if (fragmentForCurrentItem &amp;&amp; fragmentForCurrentItem-&gt;firstChild()) {
-            ExceptionCode ec;
-            fragment-&gt;appendChild(fragmentForCurrentItem-&gt;firstChild(), ec);
-        }
-    }
-
-    if (fragment)
-        return fragment.release();
-
-    return 0;
</del><ins>+    return @[(id)WebArchivePboardType, (id)kUTTypePNG, (id)kUTTypeTIFF, (id)kUTTypeJPEG, (id)kUTTypeGIF, (id)kUTTypeURL, (id)kUTTypeText, (id)kUTTypeRTFD, (id)kUTTypeRTF];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Pasteboard::hasData()
</span><span class="cx"> {
</span><del>-    return m_frame-&gt;editor().client()-&gt;getPasteboardItemsCount() != 0;
</del><ins>+    return platformStrategies()-&gt;pasteboardStrategy()-&gt;getPasteboardItemsCount() != 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static String utiTypeFromCocoaType(NSString *type)
</span><span class="lines">@@ -540,7 +313,7 @@
</span><span class="cx">             cocoaValue = [(NSString *)value precomposedStringWithCanonicalMapping];;
</span><span class="cx">     } else if (cocoaType) {
</span><span class="cx">         if (RefPtr&lt;SharedBuffer&gt; buffer = strategy.readBufferFromPasteboard(0, cocoaType.get()))
</span><del>-            cocoaValue = [[[NSString alloc] initWithData:buffer-&gt;createNSData() encoding:NSUTF8StringEncoding] autorelease];
</del><ins>+            cocoaValue = [[[NSString alloc] initWithData:buffer-&gt;createNSData().get() encoding:NSUTF8StringEncoding] autorelease];
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Enforce changeCount ourselves for security. We check after reading instead of before to be
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformEventFactoryIOShfromrev161588trunkSourceWebCoreplatformmacDisplaySleepDisablerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h (from rev 161588, trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PlatformEventFactoryIOS_h
+#define PlatformEventFactoryIOS_h
+
+#include &quot;PlatformKeyboardEvent.h&quot;
+#include &quot;PlatformMouseEvent.h&quot;
+#include &quot;PlatformWheelEvent.h&quot;
+#include &lt;WebKitAdditions/PlatformTouchEventIOS.h&gt;
+
+@class WebEvent;
+
+namespace WebCore {
+
+class PlatformEventFactory {
+public:
+    static PlatformMouseEvent createPlatformMouseEvent(WebEvent *);
+    static PlatformWheelEvent createPlatformWheelEvent(WebEvent *);
+    static PlatformKeyboardEvent createPlatformKeyboardEvent(WebEvent *);
+#if ENABLE(TOUCH_EVENTS)
+    static PlatformTouchEvent createPlatformTouchEvent(WebEvent *);
+#endif
+};
+
+String keyIdentifierForKeyEvent(WebEvent *);
+
+} // namespace WebCore
+
+#endif // PlatformEventFactoryIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformEventFactoryIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,256 @@
</span><ins>+/*
+ * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;PlatformEventFactoryIOS.h&quot;
+
+#import &lt;Foundation/NSGeometry.h&gt;
+#import &lt;IntPoint.h&gt;
+#import &lt;KeyEventCocoa.h&gt;
+#import &lt;Logging.h&gt;
+#import &lt;WebEvent.h&gt;
+
+namespace WebCore {
+
+static unsigned modifiersForEvent(WebEvent *event)
+{
+    unsigned modifiers = 0;
+
+    if (event.modifierFlags &amp; WebEventFlagMaskShift)
+        modifiers |= PlatformEvent::ShiftKey;
+    if (event.modifierFlags &amp; WebEventFlagMaskControl)
+        modifiers |= PlatformEvent::CtrlKey;
+    if (event.modifierFlags &amp; WebEventFlagMaskAlternate)
+        modifiers |= PlatformEvent::AltKey;
+    if (event.modifierFlags &amp; WebEventFlagMaskCommand)
+        modifiers |= PlatformEvent::MetaKey;
+
+    return modifiers;
+}
+
+static inline IntPoint pointForEvent(WebEvent *event)
+{
+    return IntPoint(event.locationInWindow);
+}
+
+static inline IntPoint globalPointForEvent(WebEvent *event)
+{
+    // iOS WebKit works as if it is full screen. Therefore Web coords are Global coords.
+    return pointForEvent(event);
+}
+
+static PlatformEvent::Type mouseEventType(WebEvent *event)
+{
+    switch (event.type) {
+    case WebEventMouseDown:
+        return PlatformEvent::MousePressed;
+    case WebEventMouseUp:
+        return PlatformEvent::MouseReleased;
+    case WebEventMouseMoved:
+        return PlatformEvent::MouseMoved;
+    default:
+        ASSERT_NOT_REACHED();
+        return PlatformEvent::MousePressed;
+    }
+}
+
+class PlatformMouseEventBuilder : public PlatformMouseEvent {
+public:
+    PlatformMouseEventBuilder(WebEvent *event)
+    {
+        m_type = mouseEventType(event);
+        m_modifiers = 0;
+        m_timestamp = currentTime();
+
+        m_position = pointForEvent(event);
+        m_globalPosition = globalPointForEvent(event);
+        m_button = LeftButton; // This has always been the LeftButton on iOS.
+        m_clickCount = 1; // This has always been 1 on iOS.
+    }
+};
+
+PlatformMouseEvent PlatformEventFactory::createPlatformMouseEvent(WebEvent *event)
+{
+    return PlatformMouseEventBuilder(event);
+}
+
+class PlatformWheelEventBuilder : public PlatformWheelEvent {
+public:
+    PlatformWheelEventBuilder(WebEvent *event)
+    {
+        ASSERT(event.type == WebEventScrollWheel);
+
+        m_type = PlatformEvent::Wheel;
+        m_modifiers = 0;
+        m_timestamp = currentTime();
+
+        m_position = pointForEvent(event);
+        m_globalPosition = globalPointForEvent(event);
+        m_deltaX = event.deltaX;
+        m_deltaY = event.deltaY;
+        m_granularity = ScrollByPixelWheelEvent; // iOS only supports continuous (pixel-mode) scrolling.
+    }
+};
+
+PlatformWheelEvent PlatformEventFactory::createPlatformWheelEvent(WebEvent *event)
+{
+    return PlatformWheelEventBuilder(event);
+}
+
+String keyIdentifierForKeyEvent(WebEvent *event)
+{
+    NSString *s = event.charactersIgnoringModifiers;
+    if ([s length] != 1) {
+        LOG(Events, &quot;received an unexpected number of characters in key event: %u&quot;, [s length]);
+        return &quot;Unidentified&quot;;
+    }
+
+    return keyIdentifierForCharCode(CFStringGetCharacterAtIndex((CFStringRef)s, 0));
+}
+
+class PlatformKeyboardEventBuilder : public PlatformKeyboardEvent {
+public:
+    PlatformKeyboardEventBuilder(WebEvent *event)
+    {
+        ASSERT(event.type == WebEventKeyDown || event.type == WebEventKeyUp);
+
+        m_type = (event.type == WebEventKeyUp ? PlatformEvent::KeyUp : PlatformEvent::KeyDown);
+        m_modifiers = modifiersForEvent(event);
+        m_timestamp = currentTime();
+
+        m_text = event.characters;
+        m_unmodifiedText = event.charactersIgnoringModifiers;
+        m_keyIdentifier = keyIdentifierForKeyEvent(event);
+        m_windowsVirtualKeyCode = event.keyCode;
+        m_macCharCode = 0;
+        m_autoRepeat = event.isKeyRepeating;
+        m_isKeypad = false; // iOS does not distinguish the numpad. See &lt;rdar://problem/7190835&gt;.
+        m_isSystemKey = false;
+        m_Event = event;
+
+        // Always use 13 for Enter/Return -- we don't want to use AppKit's different character for Enter.
+        if (m_windowsVirtualKeyCode == '\r') {
+            m_text = &quot;\r&quot;;
+            m_unmodifiedText = &quot;\r&quot;;
+        }
+
+        // The adjustments below are only needed in backward compatibility mode, but we cannot tell what mode we are in from here.
+
+        // Turn 0x7F into 8, because backspace needs to always be 8.
+        if (m_text == &quot;\x7F&quot;)
+            m_text = &quot;\x8&quot;;
+        if (m_unmodifiedText == &quot;\x7F&quot;)
+            m_unmodifiedText = &quot;\x8&quot;;
+        // Always use 9 for tab -- we don't want to use AppKit's different character for shift-tab.
+        if (m_windowsVirtualKeyCode == 9) {
+            m_text = &quot;\x9&quot;;
+            m_unmodifiedText = &quot;\x9&quot;;
+        }
+    }
+};
+
+PlatformKeyboardEvent PlatformEventFactory::createPlatformKeyboardEvent(WebEvent *event)
+{
+    return PlatformKeyboardEventBuilder(event);
+}
+
+#if ENABLE(TOUCH_EVENTS)
+static PlatformTouchPoint::TouchPhaseType convertTouchPhase(NSNumber *touchPhaseNumber)
+{
+    WebEventTouchPhaseType touchPhase = static_cast&lt;WebEventTouchPhaseType&gt;([touchPhaseNumber unsignedIntValue]);
+    switch (touchPhase) {
+    case WebEventTouchPhaseBegan:
+        return PlatformTouchPoint::TouchPhaseBegan;
+    case WebEventTouchPhaseMoved:
+        return PlatformTouchPoint::TouchPhaseMoved;
+    case WebEventTouchPhaseStationary:
+        return PlatformTouchPoint::TouchPhaseStationary;
+    case WebEventTouchPhaseEnded:
+        return PlatformTouchPoint::TouchPhaseEnded;
+    case WebEventTouchPhaseCancelled:
+        return PlatformTouchPoint::TouchPhaseCancelled;
+    default:
+        ASSERT_NOT_REACHED();
+    }
+    return PlatformTouchPoint::TouchPhaseBegan;
+}
+
+static PlatformEvent::Type touchEventType(WebEvent *event)
+{
+    switch (event.type) {
+    case WebEventTouchBegin:
+        return PlatformEvent::TouchStart;
+    case WebEventTouchEnd:
+        return PlatformEvent::TouchEnd;
+    case WebEventTouchCancel:
+        return PlatformEvent::TouchCancel;
+    case WebEventTouchChange:
+        return PlatformEvent::TouchMove;
+    default:
+        ASSERT_NOT_REACHED();
+        return PlatformEvent::TouchCancel;
+    }
+}
+
+class PlatformTouchPointBuilder : public PlatformTouchPoint {
+public:
+    PlatformTouchPointBuilder(unsigned identifier, const IntPoint&amp; location, TouchPhaseType phase)
+        : PlatformTouchPoint(identifier, location, phase)
+    {
+    }
+};
+
+class PlatformTouchEventBuilder : public PlatformTouchEvent {
+public:
+    PlatformTouchEventBuilder(WebEvent *event)
+    {
+        m_type = touchEventType(event);
+        m_modifiers = modifiersForEvent(event);
+        m_timestamp = currentTime();
+
+        m_gestureScale = event.gestureScale;
+        m_gestureRotation = event.gestureRotation;
+        m_isGesture = event.isGesture;
+        m_position = pointForEvent(event);
+        m_globalPosition = globalPointForEvent(event);
+
+        unsigned touchCount = event.touchCount;
+        m_touchPoints.reserveInitialCapacity(touchCount);
+        for (unsigned i = 0; i &lt; touchCount; ++i) {
+            unsigned identifier = [(NSNumber *)[event.touchIdentifiers objectAtIndex:i] unsignedIntValue];
+            IntPoint location = IntPoint([(NSValue *)[event.touchLocations objectAtIndex:i] pointValue]);
+            PlatformTouchPoint::TouchPhaseType touchPhase = convertTouchPhase([event.touchPhases objectAtIndex:i]);
+            m_touchPoints.uncheckedAppend(PlatformTouchPointBuilder(identifier, location, touchPhase));
+        }
+    }
+};
+
+PlatformTouchEvent PlatformEventFactory::createPlatformTouchEvent(WebEvent *event)
+{
+    return PlatformTouchEventBuilder(event);
+}
+#endif // ENABLE(TOUCH_EVENTS)
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformPasteboardIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -24,10 +24,13 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #import &quot;config.h&quot;
</span><ins>+#import &quot;PlatformPasteboard.h&quot;
+
</ins><span class="cx"> #import &quot;Color.h&quot;
</span><span class="cx"> #import &quot;URL.h&quot;
</span><span class="cx"> #import &quot;Image.h&quot;
</span><del>-#import &quot;PlatformPasteboard.h&quot;
</del><ins>+#import &quot;Pasteboard.h&quot;
+#import &quot;SharedBuffer.h&quot;
</ins><span class="cx"> #import &quot;SoftLinking.h&quot;
</span><span class="cx"> 
</span><span class="cx"> SOFT_LINK_FRAMEWORK(UIKit)
</span><span class="lines">@@ -152,12 +155,12 @@
</span><span class="cx">     RetainPtr&lt;NSDictionary&gt; representations = adoptNS([[NSMutableDictionary alloc] init]);
</span><span class="cx"> 
</span><span class="cx">     if (content.dataInWebArchiveFormat)
</span><del>-        [representations setValue:(NSData *)content.dataInWebArchiveFormat-&gt;createNSData() forKey:WebArchivePboardType];
</del><ins>+        [representations setValue:(NSData *)content.dataInWebArchiveFormat-&gt;createNSData().get() forKey:WebArchivePboardType];
</ins><span class="cx"> 
</span><span class="cx">     if (content.dataInRTFDFormat)
</span><del>-        [representations setValue:content.dataInRTFDFormat-&gt;createNSData() forKey:(NSString *)kUTTypeRTFD];
</del><ins>+        [representations setValue:content.dataInRTFDFormat-&gt;createNSData().get() forKey:(NSString *)kUTTypeRTFD];
</ins><span class="cx">     if (content.dataInRTFFormat)
</span><del>-        [representations setValue:content.dataInRTFFormat-&gt;createNSData() forKey:(NSString *)kUTTypeRTF];
</del><ins>+        [representations setValue:content.dataInRTFFormat-&gt;createNSData().get() forKey:(NSString *)kUTTypeRTF];
</ins><span class="cx">     [representations setValue:content.dataInStringFormat forKey:(NSString *)kUTTypeText];
</span><span class="cx">     [m_pasteboard setItems:@[representations.get()]];
</span><span class="cx"> }
</span><span class="lines">@@ -166,7 +169,7 @@
</span><span class="cx"> {
</span><span class="cx">     RetainPtr&lt;NSMutableDictionary&gt; representations = adoptNS([[NSMutableDictionary alloc] init]);
</span><span class="cx">     if (!pasteboardImage.resourceMIMEType.isNull()) {
</span><del>-        [representations setObject:pasteboardImage.image-&gt;data()-&gt;createNSData() forKey:pasteboardImage.resourceMIMEType];
</del><ins>+        [representations setObject:pasteboardImage.image-&gt;data()-&gt;createNSData().get() forKey:pasteboardImage.resourceMIMEType];
</ins><span class="cx">         [representations setObject:(NSString *)pasteboardImage.url.url forKey:(NSString *)kUTTypeURL];
</span><span class="cx">     }
</span><span class="cx">     [m_pasteboard setItems:@[representations.get()]];
</span><span class="lines">@@ -177,7 +180,7 @@
</span><span class="cx">     RetainPtr&lt;NSDictionary&gt; representations = adoptNS([[NSMutableDictionary alloc] init]);
</span><span class="cx"> 
</span><span class="cx">     if (pasteboardType == String(kUTTypeURL))
</span><del>-        [representations setValue:[adoptNS([NSURL alloc] initWithString:text]).get() forKey:pasteboardType];
</del><ins>+        [representations setValue:adoptNS([[NSURL alloc] initWithString:text]).get() forKey:pasteboardType];
</ins><span class="cx">     else if (!pasteboardType.isNull())
</span><span class="cx">         [representations setValue:text forKey:pasteboardType];
</span><span class="cx">     [m_pasteboard setItems:@[representations.get()]];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformScreenIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/PlatformScreenIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;PlatformScreen.h&quot;
+
+#import &quot;FloatRect.h&quot;
+#import &quot;FrameView.h&quot;
+#import &quot;IntRect.h&quot;
+#import &quot;NotImplemented.h&quot;
+#import &quot;WAKWindow.h&quot;
+#import &quot;WebCoreSystemInterface.h&quot;
+#import &quot;Widget.h&quot;
+
+namespace WebCore {
+
+int screenHorizontalDPI(Widget*)
+{
+    notImplemented();
+    return 0;
+}
+
+int screenVerticalDPI(Widget*)
+{
+    notImplemented();
+    return 0;
+}
+
+int screenDepth(Widget*)
+{
+    // Assume 32 bits per pixel. See &lt;rdar://problem/9378829&gt;.
+    return 32;
+}
+
+int screenDepthPerComponent(Widget*)
+{
+    // Assume the screen depth is evenly divided into four color components. See &lt;rdar://problem/9378829&gt;.
+    return screenDepth(0) / 4;
+}
+
+bool screenIsMonochrome(Widget*)
+{
+    return false;
+}
+
+// These functions scale between screen and page coordinates because JavaScript/DOM operations 
+// assume that the screen and the page share the same coordinate system.
+FloatRect screenRect(Widget* widget)
+{
+    if (!widget)
+        return CGRectZero;
+    WAKWindow *window = [widget-&gt;platformWidget() window];
+    if (!window)
+        return [widget-&gt;platformWidget() frame];
+    CGRect screenRect = { CGPointZero, [window screenSize] };
+    return enclosingIntRect(screenRect);
+}
+
+FloatRect screenAvailableRect(Widget* widget)
+{
+    if (!widget)
+        return CGRectZero;
+    WAKWindow *window = [widget-&gt;platformWidget() window];
+    if (!window)
+        return CGRectZero;
+    CGRect screenRect = { CGPointZero, [window availableScreenSize] };
+    return enclosingIntRect(screenRect);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPlatformSpeechSynthesizerIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/PlatformSpeechSynthesizerIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,278 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PlatformSpeechSynthesizer.h&quot;
+
+#if PLATFORM(IOS)
+
+#if ENABLE(SPEECH_SYNTHESIS)
+
+#include &quot;PlatformSpeechSynthesisUtterance.h&quot;
+#include &quot;PlatformSpeechSynthesisVoice.h&quot;
+#include &quot;SoftLinking.h&quot;
+#include &lt;AVFoundation/AVSpeechSynthesis.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+
+SOFT_LINK_FRAMEWORK(AVFoundation)
+SOFT_LINK_CLASS(AVFoundation, AVSpeechSynthesizer)
+SOFT_LINK_CLASS(AVFoundation, AVSpeechUtterance)
+SOFT_LINK_CLASS(AVFoundation, AVSpeechSynthesisVoice)
+
+SOFT_LINK_CONSTANT(AVFoundation, AVSpeechUtteranceDefaultSpeechRate, float)
+SOFT_LINK_CONSTANT(AVFoundation, AVSpeechUtteranceMaximumSpeechRate, float)
+
+#define AVSpeechUtteranceDefaultSpeechRate getAVSpeechUtteranceDefaultSpeechRate()
+#define AVSpeechUtteranceMaximumSpeechRate getAVSpeechUtteranceMaximumSpeechRate()
+
+#define AVSpeechSynthesizerClass getAVSpeechSynthesizerClass()
+#define AVSpeechUtteranceClass getAVSpeechUtteranceClass()
+#define AVSpeechSynthesisVoiceClass getAVSpeechSynthesisVoiceClass()
+
+@interface WebSpeechSynthesisWrapper : NSObject&lt;AVSpeechSynthesizerDelegate&gt;
+{
+    WebCore::PlatformSpeechSynthesizer* m_synthesizerObject;
+    // Hold a Ref to the utterance so that it won't disappear until the synth is done with it.
+    RefPtr&lt;WebCore::PlatformSpeechSynthesisUtterance&gt; m_utterance;
+    
+    RetainPtr&lt;AVSpeechSynthesizer&gt; m_synthesizer;
+}
+
+- (WebSpeechSynthesisWrapper *)initWithSpeechSynthesizer:(WebCore::PlatformSpeechSynthesizer*)synthesizer;
+- (void)speakUtterance:(PassRefPtr&lt;WebCore::PlatformSpeechSynthesisUtterance&gt;)utterance;
+
+@end
+
+@implementation WebSpeechSynthesisWrapper
+
+- (WebSpeechSynthesisWrapper *)initWithSpeechSynthesizer:(WebCore::PlatformSpeechSynthesizer*)synthesizer
+{
+    if (!(self = [super init]))
+        return nil;
+    
+    m_synthesizerObject = synthesizer;
+    return self;
+}
+
+- (float)mapSpeechRateToPlatformRate:(float)rate
+{
+    // WebSpeech says to go from .1 -&gt; 10 (default 1)
+    // AVSpeechSynthesizer asks for 0 -&gt; 1 (default. 5)
+    if (rate &lt; 1)
+        rate *= AVSpeechUtteranceDefaultSpeechRate;
+    else
+        rate = AVSpeechUtteranceDefaultSpeechRate + ((rate - 1) * (AVSpeechUtteranceMaximumSpeechRate - AVSpeechUtteranceDefaultSpeechRate));
+    
+    return rate;
+}
+
+- (void)speakUtterance:(PassRefPtr&lt;WebCore::PlatformSpeechSynthesisUtterance&gt;)utterance
+{
+    // When speak is called we should not have an existing speech utterance outstanding.
+    ASSERT(!m_utterance);
+    ASSERT(utterance);
+    
+    if (!utterance)
+        return;
+    
+    if (!m_synthesizer) {
+        m_synthesizer = adoptNS([[AVSpeechSynthesizerClass alloc] init]);
+        [m_synthesizer setDelegate:self];
+    }
+
+    // Choose the best voice, by first looking at the utterance voice, then the utterance language,
+    // then choose the default language.
+    WebCore::PlatformSpeechSynthesisVoice* utteranceVoice = utterance-&gt;voice();
+    NSString *voiceLanguage = nil;
+    if (!utteranceVoice) {
+        if (utterance-&gt;lang().isEmpty())
+            voiceLanguage = [AVSpeechSynthesisVoiceClass currentLanguageCode];
+        else
+            voiceLanguage = utterance-&gt;lang();
+    } else
+        voiceLanguage = utterance-&gt;voice()-&gt;lang();
+    
+    AVSpeechSynthesisVoice *avVoice = nil;
+    if (voiceLanguage)
+        avVoice = [AVSpeechSynthesisVoiceClass voiceWithLanguage:voiceLanguage];
+
+    AVSpeechUtterance *avUtterance = [AVSpeechUtteranceClass speechUtteranceWithString:utterance-&gt;text()];
+
+    [avUtterance setRate:[self mapSpeechRateToPlatformRate:utterance-&gt;rate()]];
+    [avUtterance setVolume:utterance-&gt;volume()];
+    [avUtterance setPitchMultiplier:utterance-&gt;pitch()];
+    [avUtterance setVoice:avVoice];
+    m_utterance = utterance;
+    
+    [m_synthesizer speakUtterance:avUtterance];
+}
+
+- (void)pause
+{
+    if (!m_utterance)
+        return;
+    
+    [m_synthesizer pauseSpeakingAtBoundary:AVSpeechBoundaryImmediate];
+}
+
+- (void)resume
+{
+    if (!m_utterance)
+        return;
+    
+    [m_synthesizer continueSpeaking];
+}
+
+- (void)cancel
+{
+    if (!m_utterance)
+        return;
+    
+    [m_synthesizer stopSpeakingAtBoundary:AVSpeechBoundaryImmediate];
+}
+
+- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didStartSpeechUtterance:(AVSpeechUtterance *)utterance
+{
+    UNUSED_PARAM(synthesizer);
+    UNUSED_PARAM(utterance);
+    if (!m_utterance)
+        return;
+    
+    m_synthesizerObject-&gt;client()-&gt;didStartSpeaking(m_utterance);
+}
+
+- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didFinishSpeechUtterance:(AVSpeechUtterance *)utterance
+{
+    UNUSED_PARAM(synthesizer);
+    UNUSED_PARAM(utterance);
+    if (!m_utterance)
+        return;
+    
+    // Clear the m_utterance variable in case finish speaking kicks off a new speaking job immediately.
+    RefPtr&lt;WebCore::PlatformSpeechSynthesisUtterance&gt; platformUtterance = m_utterance;
+    m_utterance = 0;
+    
+    m_synthesizerObject-&gt;client()-&gt;didFinishSpeaking(platformUtterance);
+}
+
+- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didPauseSpeechUtterance:(AVSpeechUtterance *)utterance
+{
+    UNUSED_PARAM(synthesizer);
+    UNUSED_PARAM(utterance);
+    if (!m_utterance)
+        return;
+    
+    m_synthesizerObject-&gt;client()-&gt;didPauseSpeaking(m_utterance);
+}
+
+- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didContinueSpeechUtterance:(AVSpeechUtterance *)utterance
+{
+    UNUSED_PARAM(synthesizer);
+    UNUSED_PARAM(utterance);
+    if (!m_utterance)
+        return;
+    
+    m_synthesizerObject-&gt;client()-&gt;didResumeSpeaking(m_utterance);
+}
+
+- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didCancelSpeechUtterance:(AVSpeechUtterance *)utterance
+{
+    UNUSED_PARAM(synthesizer);
+    UNUSED_PARAM(utterance);
+    if (!m_utterance)
+        return;
+    
+    // Clear the m_utterance variable in case finish speaking kicks off a new speaking job immediately.
+    RefPtr&lt;WebCore::PlatformSpeechSynthesisUtterance&gt; platformUtterance = m_utterance;
+    m_utterance = 0;
+    
+    m_synthesizerObject-&gt;client()-&gt;didFinishSpeaking(platformUtterance);
+}
+
+- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer willSpeakRangeOfSpeechString:(NSRange)characterRange utterance:(AVSpeechUtterance *)utterance
+{
+    UNUSED_PARAM(synthesizer);
+    UNUSED_PARAM(utterance);
+    
+    if (!m_utterance)
+        return;
+    
+    // iOS only supports word boundaries.
+    m_synthesizerObject-&gt;client()-&gt;boundaryEventOccurred(m_utterance, WebCore::SpeechWordBoundary, characterRange.location);
+}
+
+@end
+
+namespace WebCore {
+
+PlatformSpeechSynthesizer::PlatformSpeechSynthesizer(PlatformSpeechSynthesizerClient* client)
+    : m_speechSynthesizerClient(client)
+{
+}
+
+PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer()
+{
+}
+
+void PlatformSpeechSynthesizer::initializeVoiceList()
+{
+    for (AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoiceClass speechVoices]) {
+        // iOS Speech voices only expose their language as an identifying aspect.
+        NSString *language = [voice language];
+        NSString *voiceURI = language;
+        NSString *name = language;
+        bool isDefault = true;
+        
+        m_voiceList.append(PlatformSpeechSynthesisVoice::create(voiceURI, name, language, true, isDefault));
+    }
+}
+
+void PlatformSpeechSynthesizer::pause()
+{
+    [m_platformSpeechWrapper.get() pause];
+}
+
+void PlatformSpeechSynthesizer::resume()
+{
+    [m_platformSpeechWrapper.get() resume];
+}
+
+void PlatformSpeechSynthesizer::speak(PassRefPtr&lt;PlatformSpeechSynthesisUtterance&gt; utterance)
+{
+    if (!m_platformSpeechWrapper)
+        m_platformSpeechWrapper = adoptNS([[WebSpeechSynthesisWrapper alloc] initWithSpeechSynthesizer:this]);
+    
+    [m_platformSpeechWrapper.get() speakUtterance:utterance.get()];
+}
+
+void PlatformSpeechSynthesizer::cancel()
+{
+    [m_platformSpeechWrapper.get() cancel];
+}
+    
+} // namespace WebCore
+
+#endif // ENABLE(SPEECH_SYNTHESIS)
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosSSLKeyGeneratorIOScpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/SSLKeyGeneratorIOS.cpp (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/SSLKeyGeneratorIOS.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/SSLKeyGeneratorIOS.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;SSLKeyGenerator.h&quot;
+
+namespace WebCore {
+
+void getSupportedKeySizes(Vector&lt;String&gt;&amp;)
+{
+}
+
+String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String&amp; challengeString, const URL&amp;)
+{
+    UNUSED_PARAM(keySizeIndex);
+    UNUSED_PARAM(challengeString);
+    return String();
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosScrollAnimatorIOShfromrev161588trunkSourceWebCoreplatformmacDisplaySleepDisablerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.h (from rev 161588, trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScrollAnimatorIOS_h
+#define ScrollAnimatorIOS_h
+
+#include &quot;ScrollAnimator.h&quot;
+
+#include &quot;IntPoint.h&quot;
+
+namespace WebCore {
+
+class PlatformTouchEvent;
+
+class ScrollAnimatorIOS : public ScrollAnimator {
+public:
+    ScrollAnimatorIOS(ScrollableArea*);
+    virtual ~ScrollAnimatorIOS();
+
+#if ENABLE(TOUCH_EVENTS)
+    virtual bool handleTouchEvent(const PlatformTouchEvent&amp;) OVERRIDE;
+#endif
+
+private:
+    void determineScrollableAreaForTouchSequence(const IntSize&amp; touchDelta);
+
+    // State for handling sequences of touches in defaultTouchEventHandler.
+    enum AxisLatch {
+        AxisLatchNotComputed,
+        AxisLatchNone,
+        AxisLatchHorizontal,
+        AxisLatchVertical
+    };
+    AxisLatch m_touchScrollAxisLatch;
+    bool m_inTouchSequence;
+    bool m_committedToScrollAxis;
+    bool m_startedScroll;
+    IntPoint m_firstTouchPoint;
+    IntPoint m_lastTouchPoint;
+
+    // When we're in a touch sequence, this will point to the scrollable area that
+    // should actually be scrolled during the sequence.
+    ScrollableArea* m_scrollableAreaForTouchSequence;
+};
+
+} // namespace WebCore
+
+#endif // ScrollAnimatorIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosScrollAnimatorIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/ScrollAnimatorIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,184 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ScrollAnimatorIOS.h&quot;
+
+#include &quot;Frame.h&quot;
+#include &quot;Page.h&quot;
+#include &quot;PlatformTouchEventIOS.h&quot;
+#include &quot;RenderLayer.h&quot;
+#include &quot;ScrollableArea.h&quot;
+#include &lt;wtf/PassOwnPtr.h&gt;
+
+using namespace WebCore;
+
+namespace WebCore {
+
+PassOwnPtr&lt;ScrollAnimator&gt; ScrollAnimator::create(ScrollableArea* scrollableArea)
+{
+    return adoptPtr(new ScrollAnimatorIOS(scrollableArea));
+}
+
+ScrollAnimatorIOS::ScrollAnimatorIOS(ScrollableArea* scrollableArea)
+    : ScrollAnimator(scrollableArea)
+    , m_touchScrollAxisLatch(AxisLatchNotComputed)
+    , m_inTouchSequence(false)
+    , m_committedToScrollAxis(false)
+    , m_startedScroll(false)
+    , m_scrollableAreaForTouchSequence(0)
+{
+}
+
+ScrollAnimatorIOS::~ScrollAnimatorIOS()
+{
+}
+
+bool ScrollAnimatorIOS::handleTouchEvent(const PlatformTouchEvent&amp; touchEvent)
+{
+    if (touchEvent.type() == PlatformEvent::TouchStart &amp;&amp; touchEvent.touchCount() == 1) {
+        m_firstTouchPoint = touchEvent.touchLocationAtIndex(0);
+        m_lastTouchPoint = m_firstTouchPoint;
+        m_inTouchSequence = true;
+        m_committedToScrollAxis = false;
+        m_startedScroll = false;
+        m_touchScrollAxisLatch = AxisLatchNotComputed;
+        // Never claim to have handled the TouchStart, because that will kill default scrolling behavior.
+        return false;
+    }
+
+    if (!m_inTouchSequence)
+        return false;
+
+    if (touchEvent.type() == PlatformEvent::TouchEnd || touchEvent.type() == PlatformEvent::TouchCancel) {
+        m_inTouchSequence = false;
+        m_scrollableAreaForTouchSequence = 0;
+        if (m_startedScroll)
+            scrollableArea()-&gt;didEndScroll();
+        return false;
+    }
+
+    // If a second touch appears, assume that the user is trying to zoom, and bail on the scrolling sequence.
+    // FIXME: if that second touch is inside the scrollable area, should we keep scrolling?
+    if (touchEvent.touchCount() != 1) {
+        m_inTouchSequence = false;
+        m_scrollableAreaForTouchSequence = 0;
+        if (m_startedScroll)
+            scrollableArea()-&gt;didEndScroll();
+        return false;
+    }
+    
+    IntPoint currentPoint = touchEvent.touchLocationAtIndex(0);
+
+    IntSize touchDelta = m_lastTouchPoint - currentPoint;
+    m_lastTouchPoint = currentPoint;
+
+    if (!m_scrollableAreaForTouchSequence)
+        determineScrollableAreaForTouchSequence(touchDelta);
+
+    if (!m_committedToScrollAxis) {
+        bool horizontallyScrollable = m_scrollableArea-&gt;scrollSize(HorizontalScrollbar);
+        bool verticallyScrollable = m_scrollableArea-&gt;scrollSize(VerticalScrollbar);
+
+        if (!horizontallyScrollable &amp;&amp; !verticallyScrollable)
+            return false;
+
+        IntSize deltaFromStart = m_firstTouchPoint - currentPoint;
+    
+        const int latchAxisMovementThreshold = 10;
+        if (!horizontallyScrollable &amp;&amp; verticallyScrollable) {
+            m_touchScrollAxisLatch = AxisLatchVertical;
+            if (abs(deltaFromStart.height()) &gt;= latchAxisMovementThreshold)
+                m_committedToScrollAxis = true;
+        } else if (horizontallyScrollable &amp;&amp; !verticallyScrollable) {
+            m_touchScrollAxisLatch = AxisLatchHorizontal;
+            if (abs(deltaFromStart.width()) &gt;= latchAxisMovementThreshold)
+                m_committedToScrollAxis = true;
+        } else {
+            m_committedToScrollAxis = true;
+
+            if (m_touchScrollAxisLatch == AxisLatchNotComputed) {
+                const float lockAngleDegrees = 20;
+                if (deltaFromStart.width() &amp;&amp; deltaFromStart.height()) {
+                    float dragAngle = atanf(fabsf(deltaFromStart.height()) / fabsf(deltaFromStart.width()));
+                    if (dragAngle &lt;= deg2rad(lockAngleDegrees))
+                        m_touchScrollAxisLatch = AxisLatchHorizontal;
+                    else if (dragAngle &gt;= deg2rad(90 - lockAngleDegrees))
+                        m_touchScrollAxisLatch = AxisLatchVertical;
+                }
+            }
+        }
+        
+        if (!m_committedToScrollAxis)
+            return false;
+    }
+
+    bool handled = false;
+    
+    // Horizontal
+    if (m_touchScrollAxisLatch != AxisLatchVertical) {
+        int delta = touchDelta.width();
+        handled |= m_scrollableAreaForTouchSequence-&gt;scroll(delta &lt; 0 ? ScrollLeft : ScrollRight, ScrollByPixel, fabsf(delta));
+    }
+    
+    // Vertical
+    if (m_touchScrollAxisLatch != AxisLatchHorizontal) {
+        int delta = touchDelta.height();
+        handled |= m_scrollableAreaForTouchSequence-&gt;scroll(delta &lt; 0 ? ScrollUp : ScrollDown, ScrollByPixel, fabsf(delta));
+    }
+    
+    // Return false until we manage to scroll at all, and then keep returning true until the gesture ends.
+    if (!m_startedScroll) {
+        if (!handled)
+            return false;
+        m_startedScroll = true;
+        scrollableArea()-&gt;didStartScroll();
+    } else if (handled)
+        scrollableArea()-&gt;didUpdateScroll();
+    
+    return true;
+}
+
+void ScrollAnimatorIOS::determineScrollableAreaForTouchSequence(const IntSize&amp; scrollDelta)
+{
+    ASSERT(!m_scrollableAreaForTouchSequence);
+
+    ScrollableArea* scrollableArea = m_scrollableArea;
+    while (true) {
+        if (!scrollableArea-&gt;isPinnedInBothDirections(scrollDelta))
+            break;
+
+        ScrollableArea* enclosingArea = scrollableArea-&gt;enclosingScrollableArea();
+        if (!enclosingArea)
+            break;
+
+        scrollableArea = enclosingArea;
+    }
+
+    ASSERT(scrollableArea);
+    m_scrollableAreaForTouchSequence = scrollableArea;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosScrollViewIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/ScrollViewIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,271 @@
</span><ins>+/*
+ * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+#import &quot;ScrollView.h&quot;
+
+#import &quot;BlockExceptions.h&quot;
+#import &quot;FloatRect.h&quot;
+#import &quot;IntRect.h&quot;
+#import &quot;Logging.h&quot;
+#import &quot;NotImplemented.h&quot;
+#import &quot;WAKAppKitStubs.h&quot;
+#import &quot;WAKClipView.h&quot;
+#import &quot;WAKScrollView.h&quot;
+#import &quot;WAKViewPrivate.h&quot;
+#import &quot;WAKWindow.h&quot;
+#import &quot;WKViewPrivate.h&quot;
+#import &quot;WebCoreFrameView.h&quot;
+
+using namespace std;
+
+namespace WebCore {
+
+inline NSScrollView&lt;WebCoreFrameScrollView&gt; *ScrollView::scrollView() const
+{
+    ASSERT(!platformWidget() || [platformWidget() isKindOfClass:[NSScrollView class]]);
+    ASSERT(!platformWidget() || [platformWidget() conformsToProtocol:@protocol(WebCoreFrameScrollView)]);
+    return static_cast&lt;NSScrollView&lt;WebCoreFrameScrollView&gt; *&gt;(platformWidget());
+}
+
+NSView *ScrollView::documentView() const
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    return [scrollView() documentView];
+    END_BLOCK_OBJC_EXCEPTIONS;
+    return nil;
+}
+
+void ScrollView::platformAddChild(Widget* child)
+{
+    ASSERT(child != this);
+
+    child-&gt;addToSuperview(documentView());
+}
+
+void ScrollView::platformRemoveChild(Widget* child)
+{
+    child-&gt;removeFromSuperview();
+}
+
+void ScrollView::platformSetScrollbarModes()
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [scrollView() setScrollingModes:m_horizontalScrollbarMode vertical:m_verticalScrollbarMode andLock:NO];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void ScrollView::platformScrollbarModes(ScrollbarMode&amp; horizontal, ScrollbarMode&amp; vertical) const
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [scrollView() scrollingModes:&amp;horizontal vertical:&amp;vertical];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void ScrollView::platformSetCanBlitOnScroll(bool canBlitOnScroll)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [[scrollView() contentView] setCopiesOnScroll:canBlitOnScroll];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+bool ScrollView::platformCanBlitOnScroll() const
+{
+    return [[scrollView() contentView] copiesOnScroll];
+}
+
+IntRect ScrollView::actualVisibleContentRect() const
+{
+    CGRect r = CGRectZero;
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    WAKScrollView *view = static_cast&lt;WAKScrollView *&gt;(platformWidget());
+    r = [view actualDocumentVisibleRect];
+    END_BLOCK_OBJC_EXCEPTIONS;
+    return enclosingIntRect(r);
+}
+
+IntRect ScrollView::visibleExtentContentRect() const
+{
+    NSScrollView *view = static_cast&lt;NSScrollView *&gt;(platformWidget());
+
+    CGRect r = CGRectZero;
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    if ([view isKindOfClass:[NSScrollView class]])
+        r = [view documentVisibleExtent];
+    else if (view) {
+        r.origin = [view visibleRect].origin;
+        r.size = [view bounds].size;
+    } else {
+        // FIXME: WebKit2 on iOS doesn't inform the WebProcess of the exposed area.
+        return IntRect(IntPoint(), contentsSize());
+    }
+
+    END_BLOCK_OBJC_EXCEPTIONS;
+    return enclosingIntRect(r);
+}
+
+void ScrollView::setActualScrollPosition(const IntPoint&amp; position)
+{
+    NSScrollView *view = static_cast&lt;NSScrollView *&gt;(platformWidget());
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    if ([view isKindOfClass:[NSScrollView class]])
+        [view setActualScrollPosition:position];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+IntRect ScrollView::platformVisibleContentRect(bool includeScrollbars) const
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    if (includeScrollbars) {
+        if (NSView* documentView = this-&gt;documentView())
+            return enclosingIntRect([documentView visibleRect]);
+    }
+    return enclosingIntRect([scrollView() documentVisibleRect]);
+    END_BLOCK_OBJC_EXCEPTIONS;
+    return IntRect();
+}
+
+IntSize ScrollView::platformVisibleContentSize(bool includeScrollbars) const
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    if (includeScrollbars) {
+        if (NSView* documentView = this-&gt;documentView())
+            return IntSize([documentView visibleRect].size);
+    }
+
+    return expandedIntSize(FloatSize([scrollView() documentVisibleRect].size));
+    END_BLOCK_OBJC_EXCEPTIONS;
+    return IntSize();
+}
+
+TileCache* ScrollView::tileCache()
+{
+    // Make tile cache pointer available via the main frame only. Tile cache interaction should be managed by
+    // the main frame and this avoids having to add parent checks to all call sites.
+    if (parent())
+        return 0;
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    WAKScrollView *view = static_cast&lt;WAKScrollView *&gt;(platformWidget());
+    return [[view window] tileCache];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void ScrollView::platformSetContentsSize()
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    int w = m_contentsSize.width();
+    int h = m_contentsSize.height();
+#if !PLATFORM(IOS)
+    LOG(Frames, &quot;%p %@ at w %d h %d\n&quot;, documentView(), [(id)[documentView() class] className], w, h);            
+#else
+    LOG(Frames, &quot;%p %@ at w %d h %d\n&quot;, documentView(), NSStringFromClass([documentView() class]), w, h);
+#endif
+    NSSize tempSize = { static_cast&lt;CGFloat&gt;(max(0, w)), static_cast&lt;CGFloat&gt;(max(0, h)) }; // workaround for 4213314
+    [documentView() setBoundsSize:tempSize];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void ScrollView::platformSetScrollbarsSuppressed(bool repaintOnUnsuppress)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [scrollView() setScrollBarsSuppressed:m_scrollbarsSuppressed
+                      repaintOnUnsuppress:repaintOnUnsuppress];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void ScrollView::platformSetScrollPosition(const IntPoint&amp; scrollPoint)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    NSPoint floatPoint = scrollPoint;
+    NSPoint tempPoint = { max(-[scrollView() scrollOrigin].x, floatPoint.x), max(-[scrollView() scrollOrigin].y, floatPoint.y) };  // Don't use NSMakePoint to work around 4213314.
+    [documentView() scrollPoint:tempPoint];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+bool ScrollView::platformScroll(ScrollDirection, ScrollGranularity)
+{
+    // FIXME: It would be nice to implement this so that all of the code in WebFrameView could go away.
+    notImplemented();
+    return false;
+}
+
+void ScrollView::platformRepaintContentRectangle(const IntRect&amp; rect, bool /*now*/)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+    NSView *view = documentView();
+
+    [view setNeedsDisplayInRect:rect];    
+    // FIXME: Handle &quot;now&quot;.
+
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+// &quot;Containing Window&quot; means the NSWindow's coord system, which is origin lower left
+
+IntRect ScrollView::platformContentsToScreen(const IntRect&amp; rect) const
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    if (NSView* documentView = this-&gt;documentView()) {
+        NSRect tempRect = rect;
+        tempRect = [documentView convertRect:tempRect toView:nil];
+        tempRect.origin = [[documentView window] convertBaseToScreen:tempRect.origin];
+        return enclosingIntRect(tempRect);
+    }
+    END_BLOCK_OBJC_EXCEPTIONS;
+    return IntRect();
+}
+
+IntPoint ScrollView::platformScreenToContents(const IntPoint&amp; point) const
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    if (NSView* documentView = this-&gt;documentView()) {
+        NSPoint windowCoord = [[documentView window] convertScreenToBase: point];
+        return IntPoint([documentView convertPoint:windowCoord fromView:nil]);
+    }
+    END_BLOCK_OBJC_EXCEPTIONS;
+    return IntPoint();
+}
+
+bool ScrollView::platformIsOffscreen() const
+{
+    // FIXME: DDK: ScrollViewMac.mm also checks: ![[platformWidget() window] isVisible]
+    // but -[WAKWindow isVisible] doesn't exist.
+    return ![platformWidget() window];
+}
+
+void ScrollView::platformSetScrollbarOverlayStyle(ScrollbarOverlayStyle)
+{
+}
+
+void ScrollView::platformSetScrollOrigin(const IntPoint&amp; origin, bool updatePositionAll, bool updatePositionSynchronously)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [scrollView() setScrollOrigin:static_cast&lt;CGPoint&gt;(origin) updatePositionAtAll:updatePositionAll immediately:updatePositionSynchronously];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosScrollbarThemeIOSh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/ScrollbarThemeIOS.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ScrollbarThemeIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/ScrollbarThemeIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,70 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef ScrollbarThemeIOS_h
+#define ScrollbarThemeIOS_h
+
+#include &quot;ScrollbarThemeComposite.h&quot;
+
+namespace WebCore {
+
+class ScrollbarThemeIOS : public ScrollbarThemeComposite {
+public:
+    ScrollbarThemeIOS();
+    virtual ~ScrollbarThemeIOS();
+
+    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect&amp; damageRect) OVERRIDE;
+
+    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) OVERRIDE;
+    
+    virtual bool supportsControlTints() const OVERRIDE { return true; }
+
+    virtual double initialAutoscrollTimerDelay() OVERRIDE;
+    virtual double autoscrollTimerDelay() OVERRIDE;
+
+    virtual ScrollbarButtonsPlacement buttonsPlacement() const OVERRIDE;
+
+    virtual void registerScrollbar(ScrollbarThemeClient*) OVERRIDE;
+    virtual void unregisterScrollbar(ScrollbarThemeClient*) OVERRIDE;
+
+protected:
+    virtual bool hasButtons(ScrollbarThemeClient*) OVERRIDE;
+    virtual bool hasThumb(ScrollbarThemeClient*) OVERRIDE;
+
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) OVERRIDE;
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) OVERRIDE;
+
+    virtual int minimumThumbLength(ScrollbarThemeClient*) OVERRIDE;
+    
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&amp;) OVERRIDE;
+    
+public:
+    void preferencesChanged();
+};
+
+}
+
+#endif // ScrollbarThemeIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosScrollbarThemeIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/ScrollbarThemeIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ScrollbarThemeIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/ScrollbarThemeIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ScrollbarThemeIOS.h&quot;
+
+#include &quot;GraphicsContext.h&quot;
+#include &quot;IntRect.h&quot;
+#include &quot;PlatformMouseEvent.h&quot;
+#include &quot;Scrollbar.h&quot;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/StdLibExtras.h&gt;
+
+namespace WebCore {
+
+ScrollbarTheme* ScrollbarTheme::nativeTheme()
+{
+    static NeverDestroyed&lt;ScrollbarThemeIOS&gt; theme;
+    return &amp;theme.get();
+}
+
+void ScrollbarThemeIOS::registerScrollbar(ScrollbarThemeClient*)
+{
+}
+
+void ScrollbarThemeIOS::unregisterScrollbar(ScrollbarThemeClient*)
+{
+}
+
+ScrollbarThemeIOS::ScrollbarThemeIOS()
+{
+}
+
+ScrollbarThemeIOS::~ScrollbarThemeIOS()
+{
+}
+
+void ScrollbarThemeIOS::preferencesChanged()
+{
+}
+
+int ScrollbarThemeIOS::scrollbarThickness(ScrollbarControlSize)
+{
+    return 0;
+}
+
+double ScrollbarThemeIOS::initialAutoscrollTimerDelay()
+{
+    return 0;
+}
+
+double ScrollbarThemeIOS::autoscrollTimerDelay()
+{
+    return 0;
+}
+    
+ScrollbarButtonsPlacement ScrollbarThemeIOS::buttonsPlacement() const
+{
+    return ScrollbarButtonsNone;
+}
+
+bool ScrollbarThemeIOS::hasButtons(ScrollbarThemeClient*)
+{
+    return false;
+}
+
+bool ScrollbarThemeIOS::hasThumb(ScrollbarThemeClient*)
+{
+    return false;
+}
+
+IntRect ScrollbarThemeIOS::backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool /*painting*/)
+{
+    return IntRect();
+}
+
+IntRect ScrollbarThemeIOS::forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool /*painting*/)
+{
+    return IntRect();
+}
+
+IntRect ScrollbarThemeIOS::trackRect(ScrollbarThemeClient*, bool /*painting*/)
+{
+    return IntRect();
+}
+
+int ScrollbarThemeIOS::minimumThumbLength(ScrollbarThemeClient*)
+{
+    return 0;
+}
+
+bool ScrollbarThemeIOS::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&amp;)
+{
+    return false;
+}
+
+bool ScrollbarThemeIOS::paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect&amp; /*damageRect*/)
+{
+    return true;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosSelectionRectcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/SelectionRect.cpp (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/SelectionRect.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/SelectionRect.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;SelectionRect.h&quot;
+
+namespace WebCore {
+
+SelectionRect::SelectionRect(const IntRect&amp; rect, bool isHorizontal, int columnNumber)
+    : m_rect(rect)
+    , m_direction(LTR)
+    , m_minX(0)
+    , m_maxX(0)
+    , m_maxY(0)
+    , m_lineNumber(0)
+    , m_isLineBreak(false)
+    , m_isFirstOnLine(false)
+    , m_isLastOnLine(false)
+    , m_containsStart(false)
+    , m_containsEnd(false)
+    , m_isHorizontal(isHorizontal)
+    , m_isInFixedPosition(false)
+    , m_isRubyText(false)
+    , m_columnNumber(columnNumber)
+{
+}
+
+// FIXME: We should move some of these arguments to an auxillary struct.
+SelectionRect::SelectionRect(const IntRect&amp; rect, TextDirection direction, int minX, int maxX, int maxY,
+    int lineNumber, bool isLineBreak, bool isFirstOnLine, bool isLastOnLine, bool containsStart, bool containsEnd,
+    bool isHorizontal, bool isInFixedPosition, bool isRubyText, int columnNumber)
+    : m_rect(rect)
+    , m_direction(direction)
+    , m_minX(minX)
+    , m_maxX(maxX)
+    , m_maxY(maxY)
+    , m_lineNumber(lineNumber)
+    , m_isLineBreak(isLineBreak)
+    , m_isFirstOnLine(isFirstOnLine)
+    , m_isLastOnLine(isLastOnLine)
+    , m_containsStart(containsStart)
+    , m_containsEnd(containsEnd)
+    , m_isHorizontal(isHorizontal)
+    , m_isInFixedPosition(isInFixedPosition)
+    , m_isRubyText(isRubyText)
+    , m_columnNumber(columnNumber)
+{
+}
+
+SelectionRect::SelectionRect()
+    : m_direction(LTR)
+    , m_minX(0)
+    , m_maxX(0)
+    , m_maxY(0)
+    , m_lineNumber(0)
+    , m_isLineBreak(false)
+    , m_isFirstOnLine(false)
+    , m_isLastOnLine(false)
+    , m_containsStart(false)
+    , m_containsEnd(false)
+    , m_isHorizontal(true)
+    , m_isInFixedPosition(false)
+    , m_isRubyText(false)
+    , m_columnNumber(0)
+{
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosSelectionRecth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/SelectionRect.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/SelectionRect.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/SelectionRect.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,133 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SelectionRect_h
+#define SelectionRect_h
+
+#include &quot;IntRect.h&quot;
+#include &quot;TextDirection.h&quot;
+#include &lt;wtf/FastMalloc.h&gt;
+
+namespace WebCore {
+
+class SelectionRect {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    explicit SelectionRect(const IntRect&amp;, bool isHorizontal, int columnNumber);
+
+    // FIXME: We should move some of these arguments to an auxillary struct.
+    SelectionRect(const IntRect&amp;, TextDirection, int, int, int, int, bool, bool, bool, bool, bool, bool, bool, bool, int);
+    SelectionRect();
+    ~SelectionRect() { }
+
+    IntRect rect() const { return m_rect; }
+
+    int logicalLeft() const { return m_isHorizontal ? m_rect.x() : m_rect.y(); }
+    int logicalWidth() const { return m_isHorizontal ? m_rect.width() : m_rect.height(); }
+    int logicalTop() const { return m_isHorizontal ? m_rect.y() : m_rect.x(); }
+    int logicalHeight() const { return m_isHorizontal ? m_rect.height() : m_rect.width(); }
+
+    TextDirection direction() const { return m_direction; }
+    int minX() const { return m_minX; }
+    int maxX() const { return m_maxX; }
+    int maxY() const { return m_maxY; }
+    int lineNumber() const { return m_lineNumber; }
+    bool isLineBreak() const { return m_isLineBreak; }
+    bool isFirstOnLine() const { return m_isFirstOnLine; }
+    bool isLastOnLine() const { return m_isLastOnLine; }
+    bool containsStart() const { return m_containsStart; }
+    bool containsEnd() const { return m_containsEnd; }
+    bool isHorizontal() const { return m_isHorizontal; }
+    bool isInFixedPosition() const { return m_isInFixedPosition; }
+    bool isRubyText() const { return m_isRubyText; }
+    int columnNumber() const { return m_columnNumber; }
+
+    void setRect(const IntRect&amp; rect) { m_rect = rect; }
+
+    void setLogicalLeft(int left)
+    {
+        if (m_isHorizontal)
+            m_rect.setX(left);
+        else
+            m_rect.setY(left);
+    }
+
+    void setLogicalWidth(int width)
+    {
+        if (m_isHorizontal)
+            m_rect.setWidth(width);
+        else
+            m_rect.setHeight(width);
+    }
+
+    void setLogicalTop(int top)
+    {
+        if (m_isHorizontal)
+            m_rect.setY(top);
+        else
+            m_rect.setX(top);
+    }
+
+    void setLogicalHeight(int height)
+    {
+        if (m_isHorizontal)
+            m_rect.setHeight(height);
+        else
+            m_rect.setWidth(height);
+    }
+
+    void setDirection(TextDirection direction) { m_direction = direction; }
+    void setMinX(int minX) { m_minX = minX; }
+    void setMaxX(int maxX) { m_maxX = maxX; }
+    void setMaxY(int maxY) { m_maxY = maxY; }
+    void setLineNumber(int lineNumber) { m_lineNumber = lineNumber; }
+    void setIsLineBreak(bool isLineBreak) { m_isLineBreak = isLineBreak; }
+    void setIsFirstOnLine(bool isFirstOnLine) { m_isFirstOnLine = isFirstOnLine; }
+    void setIsLastOnLine(bool isLastOnLine) { m_isLastOnLine = isLastOnLine; }
+    void setContainsStart(bool containsStart) { m_containsStart = containsStart; }
+    void setContainsEnd(bool containsEnd) { m_containsEnd = containsEnd; }
+    void setIsHorizontal(bool isHorizontal) { m_isHorizontal = isHorizontal; }
+
+private:
+    IntRect m_rect;
+    TextDirection m_direction;
+    int m_minX;
+    int m_maxX;
+    int m_maxY;
+    int m_lineNumber;
+    bool m_isLineBreak;
+    bool m_isFirstOnLine;
+    bool m_isLastOnLine;
+    bool m_containsStart;
+    bool m_containsEnd;
+    bool m_isHorizontal;
+    bool m_isInFixedPosition;
+    bool m_isRubyText;
+    int m_columnNumber;
+};
+
+} // namespace WebCore
+
+#endif // SelectionRect_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosSoundIOSmmfromrev161588trunkSourceWebCoreplatformtextmacCharsetDatah"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/SoundIOS.mm (from rev 161588, trunk/Source/WebCore/platform/text/mac/CharsetData.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/SoundIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/SoundIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;Sound.h&quot;
+
+namespace WebCore {
+
+void systemBeep() { NSLog(@&quot;Webcore NSBeep()!&quot;); }    
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosSystemMemoryIOScpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/SystemMemoryIOS.cpp (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/SystemMemoryIOS.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/SystemMemoryIOS.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;SystemMemory.h&quot;
+
+#include &lt;mach/mach.h&gt;
+#include &lt;sys/sysctl.h&gt;
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/CurrentTime.h&gt;
+
+namespace WebCore {
+
+int systemMemoryLevel()
+{
+#if PLATFORM(IOS_SIMULATOR)
+    return 35;
+#else
+    static int memoryFreeLevel = -1;
+    static double previousCheckTime; 
+    double time = currentTime();
+    if (time - previousCheckTime &lt; 0.1)
+        return memoryFreeLevel;
+    previousCheckTime = time;
+    size_t size = sizeof(memoryFreeLevel);
+    sysctlbyname(&quot;kern.memorystatus_level&quot;, &amp;memoryFreeLevel, &amp;size, nullptr, 0);
+    return memoryFreeLevel;
+#endif
+}
+
+#if !PLATFORM(IOS_SIMULATOR)
+static host_basic_info_data_t gHostBasicInfo;
+
+static void initCapabilities(void)
+{
+    // Discover our CPU type
+    mach_port_t host = mach_host_self();
+    mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT;
+    kern_return_t returnValue = host_info(host, HOST_BASIC_INFO, reinterpret_cast&lt;host_info_t&gt;(&amp;gHostBasicInfo), &amp;count);
+    mach_port_deallocate(mach_task_self(), host);
+    if (returnValue != KERN_SUCCESS)
+        LOG_ERROR(&quot;%s : host_info(%d) : %s.\n&quot;, __FUNCTION__, returnValue, mach_error_string(returnValue));
+}
+#endif
+
+size_t systemTotalMemory()
+{
+#if PLATFORM(IOS_SIMULATOR)
+    return 512 * 1024 * 1024;
+#else
+    // FIXME: Consider using C++11 thread primitives.
+    static pthread_once_t initControl = PTHREAD_ONCE_INIT;
+
+    pthread_once(&amp;initControl, initCapabilities);
+    // The value in gHostBasicInfo.max_mem is often lower than the amount we're
+    // interested in (e.g., does this device have at least 256MB of RAM?)
+    // Round the value to the nearest power of 2.
+    return static_cast&lt;size_t&gt;(exp2(ceil(log2(gHostBasicInfo.max_mem))));
+#endif
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosThemeIOShfromrev161588trunkSourceWebCoreplatformKillRingNonecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/ThemeIOS.h (from rev 161588, trunk/Source/WebCore/platform/KillRingNone.cpp) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ThemeIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/ThemeIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef ThemeIOS_h
+#define ThemeIOS_h
+
+#include &quot;Theme.h&quot;
+
+namespace WebCore {
+
+class ThemeIOS : public Theme {
+public:
+    ThemeIOS() { }
+    virtual ~ThemeIOS() { }
+};
+
+} // namespace WebCore
+
+#endif // ThemeIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosThemeIOSmmfromrev161588trunkSourceWebCoreplatformKillRingNonecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/ThemeIOS.mm (from rev 161588, trunk/Source/WebCore/platform/KillRingNone.cpp) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ThemeIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/ThemeIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+#import &quot;ThemeIOS.h&quot;
+
+#import &quot;GraphicsContext.h&quot;
+#import &quot;ScrollView.h&quot;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/StdLibExtras.h&gt;
+
+using namespace std;
+
+namespace WebCore {
+
+// FIXME: Implement before enabling USE(NEW_THEME).
+
+Theme* platformTheme()
+{
+    static NeverDestroyed&lt;ThemeIOS&gt; themeIOS;
+    return &amp;themeIOS.get();
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosTileCacheh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/TileCache.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/TileCache.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/TileCache.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,218 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TileCache_h
+#define TileCache_h
+
+#if PLATFORM(IOS)
+
+#include &quot;Color.h&quot;
+#include &quot;FloatRect.h&quot;
+#include &quot;IntRect.h&quot;
+#include &quot;IntSize.h&quot;
+#include &quot;Timer.h&quot;
+#include &lt;wtf/Noncopyable.h&gt;
+#include &lt;wtf/OwnPtr.h&gt;
+#include &lt;wtf/PassOwnPtr.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/Threading.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+#ifdef __OBJC__
+@class CALayer;
+@class TileCacheTombstone;
+@class TileLayer;
+@class WAKWindow;
+#else
+class CALayer;
+class TileCacheTombstone;
+class TileLayer;
+class WAKWindow;
+#endif
+
+namespace WebCore {
+
+class TileGrid;
+
+class TileCache {
+    WTF_MAKE_NONCOPYABLE(TileCache);
+public:
+    TileCache(WAKWindow*);
+    ~TileCache();
+
+    CGFloat screenScale() const;
+
+    void setNeedsDisplay();
+    void setNeedsDisplayInRect(const IntRect&amp;);
+    
+    void layoutTiles();
+    void layoutTilesNow();
+    void layoutTilesNowForRect(const IntRect&amp;);
+    void removeAllNonVisibleTiles();
+    void removeAllTiles();
+    void removeForegroundTiles();
+
+    // If 'contentReplacementImage' is not NULL, drawLayer() draws
+    // contentReplacementImage instead of the page content. We assume the
+    // image is to be drawn at the origin and scaled to match device pixels.
+    void setContentReplacementImage(RetainPtr&lt;CGImageRef&gt;);
+    RetainPtr&lt;CGImageRef&gt; contentReplacementImage() const;
+
+    void setTileBordersVisible(bool);
+    bool tileBordersVisible() const { return m_tileBordersVisible; }
+
+    void setTilePaintCountersVisible(bool);
+    bool tilePaintCountersVisible() const { return m_tilePaintCountersVisible; }
+
+    void setAcceleratedDrawingEnabled(bool enabled) { m_acceleratedDrawingEnabled = enabled; }
+    bool acceleratedDrawingEnabled() const { return m_acceleratedDrawingEnabled; }
+
+    void setKeepsZoomedOutTiles(bool);
+    bool keepsZoomedOutTiles() const { return m_keepsZoomedOutTiles; }
+
+    void setZoomedOutScale(float);
+    float zoomedOutScale() const;
+    
+    void setCurrentScale(float);
+    float currentScale() const;
+    
+    bool tilesOpaque() const;
+    void setTilesOpaque(bool);
+    
+    enum TilingMode {
+        Normal,
+        Minimal,
+        Panning,
+        Zooming,
+        Disabled,
+        ScrollToTop
+    };
+    TilingMode tilingMode() const { return m_tilingMode; }
+    void setTilingMode(TilingMode);
+
+    typedef enum {
+        TilingDirectionUp,
+        TilingDirectionDown,
+        TilingDirectionLeft,
+        TilingDirectionRight,
+    } TilingDirection;
+    void setTilingDirection(TilingDirection);
+    TilingDirection tilingDirection() const;
+
+    bool hasPendingDraw() const;
+
+    void hostLayerSizeChanged();
+
+    static void setLayerPoolCapacity(unsigned);
+    static void drainLayerPool();
+
+    // Logging
+    void dumpTiles();
+
+    // Internal
+    void doLayoutTiles();
+    void drawLayer(TileLayer*, CGContextRef);
+    void prepareToDraw();
+    void finishedCreatingTiles(bool didCreateTiles, bool createMore);
+    FloatRect visibleRectInLayer(CALayer *) const;
+    CALayer* hostLayer() const;
+    unsigned tileCapacityForGrid(TileGrid*);
+    Color colorForGridTileBorder(TileGrid*) const;
+
+    void doPendingRepaints();
+
+    bool isSpeculativeTileCreationEnabled() const { return m_isSpeculativeTileCreationEnabled; }
+    void setSpeculativeTileCreationEnabled(bool);
+    
+    enum SynchronousTileCreationMode { CoverVisibleOnly, CoverSpeculative };
+
+private:
+    TileGrid* activeTileGrid() const;
+    TileGrid* inactiveTileGrid() const;
+
+    void updateTilingMode();
+    bool isTileInvalidationSuspended() const;
+    bool isTileCreationSuspended() const;
+    void flushSavedDisplayRects();
+    void invalidateTiles(const IntRect&amp; dirtyRect);
+    void setZoomedOutScaleInternal(float);
+    void commitScaleChange();
+    void bringActiveTileGridToFront();
+    void adjustTileGridTransforms();
+    void removeAllNonVisibleTilesInternal();
+    void createTilesInActiveGrid(SynchronousTileCreationMode);
+    void scheduleLayerFlushForPendingRepaint();
+
+    void tileCreationTimerFired(Timer&lt;TileCache&gt;*);
+
+    void drawReplacementImage(TileLayer*, CGContextRef, CGImageRef);
+    void drawWindowContent(TileLayer*, CGContextRef, CGRect dirtyRect);
+
+    WAKWindow* m_window;
+
+    RetainPtr&lt;CGImageRef&gt; m_contentReplacementImage;
+
+    bool m_keepsZoomedOutTiles;
+
+    bool m_hasPendingLayoutTiles;
+    bool m_hasPendingUpdateTilingMode;
+    // Ensure there are no async calls on a dead tile cache.
+    RetainPtr&lt;TileCacheTombstone&gt; m_tombstone;
+
+    TilingMode m_tilingMode;
+    TilingDirection m_tilingDirection;
+
+    IntSize m_tileSize;
+    bool m_tilesOpaque;
+
+    bool m_tileBordersVisible;
+    bool m_tilePaintCountersVisible;
+    bool m_acceleratedDrawingEnabled;
+    bool m_isSpeculativeTileCreationEnabled;
+
+    bool m_didCallWillStartScrollingOrZooming;
+    OwnPtr&lt;TileGrid&gt; m_zoomedOutTileGrid;
+    OwnPtr&lt;TileGrid&gt; m_zoomedInTileGrid;
+
+    Timer&lt;TileCache&gt; m_tileCreationTimer;
+
+    Vector&lt;IntRect&gt; m_savedDisplayRects;
+
+    float m_currentScale;
+
+    float m_pendingScale;
+    float m_pendingZoomedOutScale;
+
+    mutable Mutex m_tileMutex;
+    mutable Mutex m_savedDisplayRectMutex;
+    mutable Mutex m_contentReplacementImageMutex;
+};
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
+
+#endif // TileCache_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosTileCachemm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/TileCache.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/TileCache.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/TileCache.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,822 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;TileCache.h&quot;
+
+#if PLATFORM(IOS)
+
+#include &quot;Logging.h&quot;
+#include &quot;MemoryPressureHandler.h&quot;
+#include &quot;SystemMemory.h&quot;
+#include &quot;TileGrid.h&quot;
+#include &quot;TileGridTile.h&quot;
+#include &quot;TileLayer.h&quot;
+#include &quot;TileLayerPool.h&quot;
+#include &quot;WAKWindow.h&quot;
+#include &quot;WKGraphics.h&quot;
+#include &quot;WebCoreSystemInterface.h&quot;
+#include &quot;WebCoreThreadRun.h&quot;
+#include &lt;QuartzCore/QuartzCore.h&gt;
+#include &lt;QuartzCore/QuartzCorePrivate.h&gt;
+#include &lt;wtf/CurrentTime.h&gt;
+
+@interface WAKView (WebViewExtras)
+- (void)_dispatchTileDidDraw:(CALayer*)tile;
+- (void)_willStartScrollingOrZooming;
+- (void)_didFinishScrollingOrZooming;
+- (void)_dispatchTileDidDraw;
+- (void)_scheduleLayerFlushForPendingTileCacheRepaint;
+@end
+
+@interface TileCacheTombstone : NSObject {
+    BOOL dead;
+}
+@property(getter=isDead) BOOL dead;
+
+@end
+
+@implementation TileCacheTombstone
+
+@synthesize dead;
+
+@end
+
+namespace WebCore {
+
+TileCache::TileCache(WAKWindow* window)
+    : m_window(window)
+    , m_keepsZoomedOutTiles(false)
+    , m_hasPendingLayoutTiles(false)
+    , m_hasPendingUpdateTilingMode(false)
+    , m_tombstone(adoptNS([[TileCacheTombstone alloc] init]))
+    , m_tilingMode(Normal)
+    , m_tilingDirection(TilingDirectionDown)
+    , m_tileSize(512, 512)
+    , m_tilesOpaque(true)
+    , m_tileBordersVisible(false)
+    , m_tilePaintCountersVisible(false)
+    , m_acceleratedDrawingEnabled(false)
+    , m_isSpeculativeTileCreationEnabled(true)
+    , m_didCallWillStartScrollingOrZooming(false)
+    , m_zoomedOutTileGrid(PassOwnPtr&lt;TileGrid&gt;())
+    , m_zoomedInTileGrid(PassOwnPtr&lt;TileGrid&gt;())
+    , m_tileCreationTimer(this, &amp;TileCache::tileCreationTimerFired)
+    , m_currentScale(1.f)
+    , m_pendingScale(0)
+    , m_pendingZoomedOutScale(0)
+{
+    m_zoomedOutTileGrid = TileGrid::create(this, m_tileSize);
+    [hostLayer() insertSublayer:m_zoomedOutTileGrid-&gt;tileHostLayer() atIndex:0];
+    hostLayerSizeChanged();
+}
+
+TileCache::~TileCache()
+{
+    [m_tombstone.get() setDead:true];
+}
+
+CGFloat TileCache::screenScale() const
+{
+    return [m_window screenScale];
+}
+
+CALayer* TileCache::hostLayer() const
+{
+    return [m_window hostLayer];
+}
+
+FloatRect TileCache::visibleRectInLayer(CALayer *layer) const
+{
+    return [layer convertRect:[m_window extendedVisibleRect] fromLayer:hostLayer()];
+}
+
+bool TileCache::tilesOpaque() const
+{
+    return m_tilesOpaque;
+}
+    
+TileGrid* TileCache::activeTileGrid() const
+{
+    if (!m_keepsZoomedOutTiles)
+        return m_zoomedOutTileGrid.get();
+    if (m_tilingMode == Zooming)
+        return m_zoomedOutTileGrid.get();
+    if (m_zoomedInTileGrid &amp;&amp; m_currentScale == m_zoomedInTileGrid-&gt;scale())
+        return m_zoomedInTileGrid.get();
+    return m_zoomedOutTileGrid.get();
+}
+
+TileGrid* TileCache::inactiveTileGrid() const
+{
+    return activeTileGrid() == m_zoomedOutTileGrid ? m_zoomedInTileGrid.get() : m_zoomedOutTileGrid.get();
+}
+
+void TileCache::setTilesOpaque(bool opaque)
+{
+    if (m_tilesOpaque == opaque)
+        return;
+
+    MutexLocker locker(m_tileMutex);
+
+    m_tilesOpaque = opaque;
+    m_zoomedOutTileGrid-&gt;updateTileOpacity();
+    if (m_zoomedInTileGrid)
+        m_zoomedInTileGrid-&gt;updateTileOpacity();
+}
+
+void TileCache::doLayoutTiles()
+{
+    if (isTileCreationSuspended())
+        return;
+
+    MutexLocker locker(m_tileMutex);
+    TileGrid* activeGrid = activeTileGrid();
+    // Even though we aren't actually creating tiles in the inactive grid, we
+    // still need to drop invalid tiles in response to a layout.
+    // See &lt;rdar://problem/9839867&gt;.
+    if (TileGrid* inactiveGrid = inactiveTileGrid())
+        inactiveGrid-&gt;dropInvalidTiles();
+    if (activeGrid-&gt;checkDoSingleTileLayout())
+        return;
+    createTilesInActiveGrid(CoverVisibleOnly);
+}
+
+void TileCache::hostLayerSizeChanged()
+{
+    m_zoomedOutTileGrid-&gt;updateHostLayerSize();
+    if (m_zoomedInTileGrid)
+        m_zoomedInTileGrid-&gt;updateHostLayerSize();
+}
+
+void TileCache::setKeepsZoomedOutTiles(bool keep)
+{
+    m_keepsZoomedOutTiles = keep;
+}
+
+void TileCache::setCurrentScale(float scale)
+{
+    ASSERT(scale &gt; 0);
+
+    if (currentScale() == scale) {
+        m_pendingScale = 0;
+        return;
+    }
+    m_pendingScale = scale;
+    if (m_tilingMode == Disabled)
+        return;
+    commitScaleChange();
+
+    if (!keepsZoomedOutTiles() &amp;&amp; !isTileInvalidationSuspended()) {
+        // Tile invalidation is normally suspended during zooming by UIKit but some applications
+        // using custom scrollviews may zoom without triggering the callbacks. Invalidate the tiles explicitly.
+        MutexLocker locker(m_tileMutex);
+        activeTileGrid()-&gt;dropAllTiles();
+        activeTileGrid()-&gt;createTiles(CoverVisibleOnly);
+    }
+}
+
+void TileCache::setZoomedOutScale(float scale)
+{
+    ASSERT(scale &gt; 0);
+
+    if (zoomedOutScale() == scale) {
+        m_pendingZoomedOutScale = 0;
+        return;
+    }
+    m_pendingZoomedOutScale = scale;
+    if (m_tilingMode == Disabled)
+        return;
+    commitScaleChange();
+}
+    
+void TileCache::commitScaleChange()
+{
+    ASSERT(m_pendingZoomedOutScale || m_pendingScale);
+    ASSERT(m_tilingMode != Disabled);
+    
+    MutexLocker locker(m_tileMutex);
+
+    if (m_pendingZoomedOutScale) {
+        m_zoomedOutTileGrid-&gt;setScale(m_pendingZoomedOutScale);
+        m_pendingZoomedOutScale = 0;
+    }
+    
+    if (!m_keepsZoomedOutTiles) {
+        ASSERT(activeTileGrid() == m_zoomedOutTileGrid);
+        if (m_pendingScale) {
+            m_currentScale = m_pendingScale;
+            m_zoomedOutTileGrid-&gt;setScale(m_currentScale);
+        }
+        m_pendingScale = 0;
+        return;
+    }
+
+    if (m_pendingScale) {
+        m_currentScale = m_pendingScale;
+        m_pendingScale = 0;
+    }
+
+    if (m_currentScale != m_zoomedOutTileGrid-&gt;scale()) {
+        if (!m_zoomedInTileGrid) {
+            m_zoomedInTileGrid = TileGrid::create(this, m_tileSize);
+            [hostLayer() addSublayer:m_zoomedInTileGrid-&gt;tileHostLayer()];
+            hostLayerSizeChanged();
+        }
+        m_zoomedInTileGrid-&gt;setScale(m_currentScale);
+    }
+
+    // Keep the current ordering during zooming.
+    if (m_tilingMode != Zooming)
+        bringActiveTileGridToFront();
+
+    adjustTileGridTransforms();
+    layoutTiles();
+}
+
+void TileCache::bringActiveTileGridToFront()
+{
+    TileGrid* activeGrid = activeTileGrid();
+    TileGrid* otherGrid = inactiveTileGrid();
+    if (!otherGrid)
+        return;
+    CALayer* frontLayer = activeGrid-&gt;tileHostLayer();
+    CALayer* otherLayer = otherGrid-&gt;tileHostLayer();
+    [hostLayer() insertSublayer:frontLayer above:otherLayer];
+}
+    
+void TileCache::adjustTileGridTransforms()
+{
+    CALayer* zoomedOutHostLayer = m_zoomedOutTileGrid-&gt;tileHostLayer();
+    float transformScale = currentScale() / zoomedOutScale();
+    [zoomedOutHostLayer setTransform:CATransform3DMakeScale(transformScale, transformScale, 1.0f)];
+    m_zoomedOutTileGrid-&gt;updateHostLayerSize();
+}
+
+void TileCache::layoutTiles()
+{
+    if (m_hasPendingLayoutTiles)
+        return;
+    m_hasPendingLayoutTiles = true;
+
+    TileCacheTombstone *tombstone = m_tombstone.get();
+    WebThreadRun(^{
+        if ([tombstone isDead])
+            return;
+        m_hasPendingLayoutTiles = false;
+        doLayoutTiles();
+    });
+}
+
+void TileCache::layoutTilesNow()
+{
+    ASSERT(WebThreadIsLockedOrDisabled());
+
+    // layoutTilesNow() is called after a zoom, while the tile mode is still set to Zooming.
+    // If we checked for isTileCreationSuspended here, that would cause &lt;rdar://problem/8434112&gt; (Page flashes after zooming in/out).
+    if (m_tilingMode == Disabled)
+        return;
+    
+    // FIXME: layoutTilesNow should be called after state has been set to non-zooming and the active grid is the final one. 
+    // Fix this in UIKit side (perhaps also getting rid of this call) and remove this code afterwards.
+    // &lt;rdar://problem/9672993&gt;
+    TilingMode savedTilingMode = m_tilingMode;
+    if (m_tilingMode == Zooming)
+        m_tilingMode = Minimal;
+
+    MutexLocker locker(m_tileMutex);
+    TileGrid* activeGrid = activeTileGrid();
+    if (activeGrid-&gt;checkDoSingleTileLayout()) {
+        m_tilingMode = savedTilingMode;
+        return;
+    }
+    createTilesInActiveGrid(CoverVisibleOnly);
+    m_tilingMode = savedTilingMode;
+}
+
+void TileCache::layoutTilesNowForRect(const IntRect&amp; rect)
+{
+    ASSERT(WebThreadIsLockedOrDisabled());
+    MutexLocker locker(m_tileMutex);
+
+    activeTileGrid()-&gt;addTilesCoveringRect(rect);
+}
+
+void TileCache::removeAllNonVisibleTiles()
+{
+    MutexLocker locker(m_tileMutex);
+    removeAllNonVisibleTilesInternal();
+}
+
+void TileCache::removeAllNonVisibleTilesInternal()
+{
+    TileGrid* activeGrid = activeTileGrid();
+    if (keepsZoomedOutTiles() &amp;&amp; activeGrid == m_zoomedInTileGrid &amp;&amp; activeGrid-&gt;hasTiles())
+        m_zoomedOutTileGrid-&gt;dropAllTiles();
+
+    IntRect activeTileBounds = activeGrid-&gt;bounds();
+    if (activeTileBounds.width() &lt;= m_tileSize.width() &amp;&amp; activeTileBounds.height() &lt;= m_tileSize.height()) {
+        // If the view is smaller than a tile, keep the tile even if it is not visible.
+        activeGrid-&gt;dropTilesOutsideRect(activeTileBounds);
+        return;
+    }
+
+    activeGrid-&gt;dropTilesOutsideRect(activeGrid-&gt;visibleRect());
+}
+
+void TileCache::removeAllTiles()
+{
+    MutexLocker locker(m_tileMutex);
+    m_zoomedOutTileGrid-&gt;dropAllTiles();
+    if (m_zoomedInTileGrid)
+        m_zoomedInTileGrid-&gt;dropAllTiles();
+}
+
+void TileCache::removeForegroundTiles()
+{
+    MutexLocker locker(m_tileMutex);
+    if (!keepsZoomedOutTiles())
+        m_zoomedOutTileGrid-&gt;dropAllTiles();
+    if (m_zoomedInTileGrid)
+        m_zoomedInTileGrid-&gt;dropAllTiles();
+}
+
+void TileCache::setContentReplacementImage(RetainPtr&lt;CGImageRef&gt; contentReplacementImage)
+{
+    MutexLocker locker(m_contentReplacementImageMutex);
+    m_contentReplacementImage = contentReplacementImage;
+}
+
+RetainPtr&lt;CGImageRef&gt; TileCache::contentReplacementImage() const
+{
+    MutexLocker locker(m_contentReplacementImageMutex);
+    return m_contentReplacementImage;
+}
+
+void TileCache::setTileBordersVisible(bool flag)
+{
+    if (flag == m_tileBordersVisible)
+        return;
+
+    m_tileBordersVisible = flag;
+    m_zoomedOutTileGrid-&gt;updateTileBorderVisibility();
+    if (m_zoomedInTileGrid)
+        m_zoomedInTileGrid-&gt;updateTileBorderVisibility();
+}
+
+void TileCache::setTilePaintCountersVisible(bool flag)
+{
+    m_tilePaintCountersVisible = flag;
+    // The numbers will show up the next time the tiles paint.
+}
+
+void TileCache::finishedCreatingTiles(bool didCreateTiles, bool createMore)
+{
+    // We need to ensure that all tiles are showing the same version of the content.
+    if (didCreateTiles &amp;&amp; !m_savedDisplayRects.isEmpty())
+        flushSavedDisplayRects();
+
+    if (keepsZoomedOutTiles()) {
+        if (m_zoomedInTileGrid &amp;&amp; activeTileGrid() == m_zoomedOutTileGrid &amp;&amp; m_tilingMode != Zooming &amp;&amp; m_zoomedInTileGrid-&gt;hasTiles()) {
+            // This CA transaction will cover the screen with top level tiles.
+            // We can remove zoomed-in tiles without flashing.
+            m_zoomedInTileGrid-&gt;dropAllTiles();
+        } else if (activeTileGrid() == m_zoomedInTileGrid) {
+            // Pass the minimum possible distance to consider all tiles, even visible ones.
+            m_zoomedOutTileGrid-&gt;dropDistantTiles(0, std::numeric_limits&lt;double&gt;::min());
+        }
+    }
+
+    // Keep creating tiles until the whole coverRect is covered.
+    if (createMore)
+        m_tileCreationTimer.startOneShot(0);
+}
+
+void TileCache::tileCreationTimerFired(Timer&lt;TileCache&gt;*)
+{
+    if (isTileCreationSuspended())
+        return;
+    MutexLocker locker(m_tileMutex);
+    createTilesInActiveGrid(CoverSpeculative);
+}
+
+void TileCache::createTilesInActiveGrid(SynchronousTileCreationMode mode)
+{
+    if (memoryPressureHandler().hasReceivedMemoryPressure()) {
+        LOG(MemoryPressure, &quot;Under memory pressure at: %s&quot;, __PRETTY_FUNCTION__);
+        removeAllNonVisibleTilesInternal();
+    }
+    activeTileGrid()-&gt;createTiles(mode);
+}
+
+unsigned TileCache::tileCapacityForGrid(TileGrid* grid)
+{
+    static unsigned capacity;
+    if (!capacity) {
+        size_t totalMemory = systemTotalMemory();
+        totalMemory /= 1024 * 1024;
+        if (totalMemory &gt;= 1024)
+            capacity = 128 * 1024 * 1024;
+        else if (totalMemory &gt;= 512)
+            capacity = 64 * 1024 * 1024;
+        else
+            capacity = 32 * 1024 * 1024;
+    }
+
+    int gridCapacity;
+
+    int memoryLevel = systemMemoryLevel();
+    if (memoryLevel &lt; 15)
+        gridCapacity = capacity / 4;
+    else if (memoryLevel &lt; 20)
+        gridCapacity = capacity / 2;
+    else if (memoryLevel &lt; 30) 
+        gridCapacity = capacity * 3 / 4;
+    else
+        gridCapacity = capacity;
+
+    if (keepsZoomedOutTiles() &amp;&amp; grid == m_zoomedOutTileGrid) {
+        if (activeTileGrid() == m_zoomedOutTileGrid)
+            return gridCapacity;
+        return gridCapacity / 4;
+    }
+    return gridCapacity * 3 / 4;
+}
+
+Color TileCache::colorForGridTileBorder(TileGrid* grid) const
+{
+    if (grid == m_zoomedOutTileGrid)
+        return Color(.3f, .0f, 0.4f, 0.5f);
+
+    return Color(.0f, .0f, 0.4f, 0.5f);
+}
+
+static bool shouldRepaintInPieces(const CGRect&amp; dirtyRect, CGSRegionObj dirtyRegion, CGFloat contentsScale)
+{
+    // Estimate whether or not we should use the unioned rect or the individual rects.
+    // We do this by computing the percentage of &quot;wasted space&quot; in the union. If that wasted space
+    // is too large, then we will do individual rect painting instead.
+    float singlePixels = 0;
+    unsigned rectCount = 0;
+
+    CGSRegionEnumeratorObj enumerator = CGSRegionEnumerator(dirtyRegion);
+    CGRect *subRect;
+    while ((subRect = CGSNextRect(enumerator))) {
+        ++rectCount;
+        singlePixels += subRect-&gt;size.width * subRect-&gt;size.height;
+    }
+    singlePixels /= (contentsScale * contentsScale);
+    CGSReleaseRegionEnumerator(enumerator);
+
+    const unsigned cRectThreshold = 10;
+    if (rectCount &lt; 2 || rectCount &gt; cRectThreshold)
+        return false;
+
+    const float cWastedSpaceThreshold = 0.50f;
+    float unionPixels = dirtyRect.size.width * dirtyRect.size.height;
+    float wastedSpace = 1.f - (singlePixels / unionPixels);
+    return wastedSpace &gt; cWastedSpaceThreshold;
+}
+
+void TileCache::drawReplacementImage(TileLayer* layer, CGContextRef context, CGImageRef image)
+{
+    CGContextSetRGBFillColor(context, 1, 1, 1, 1);
+    CGContextFillRect(context, CGContextGetClipBoundingBox(context));
+
+    CGFloat contentsScale = [layer contentsScale];
+    CGContextScaleCTM(context, 1 / contentsScale, -1 / contentsScale);
+    CGRect imageRect = CGRectMake(0, 0, CGImageGetWidth(image), CGImageGetHeight(image));
+    CGContextTranslateCTM(context, 0, -imageRect.size.height);
+    CGContextDrawImage(context, imageRect, image);
+}
+
+void TileCache::drawWindowContent(TileLayer* layer, CGContextRef context, CGRect dirtyRect)
+{
+    CGRect frame = [layer frame];
+    WKFontAntialiasingStateSaver fontAntialiasingState(context, [m_window useOrientationDependentFontAntialiasing] &amp;&amp; [layer isOpaque]);
+    fontAntialiasingState.setup([WAKWindow hasLandscapeOrientation]);
+
+    CGSRegionObj drawRegion = (CGSRegionObj)[layer regionBeingDrawn];
+    CGFloat contentsScale = [layer contentsScale];
+    if (drawRegion &amp;&amp; shouldRepaintInPieces(dirtyRect, drawRegion, contentsScale)) {
+        // Use fine grained repaint rectangles to minimize the amount of painted pixels.
+        CGSRegionEnumeratorObj enumerator = CGSRegionEnumerator(drawRegion);
+        CGRect *subRect;
+        while ((subRect = CGSNextRect(enumerator))) {
+            CGRect adjustedSubRect = *subRect;
+            adjustedSubRect.origin.x /= contentsScale;
+            adjustedSubRect.origin.y = frame.size.height - (adjustedSubRect.origin.y + adjustedSubRect.size.height) / contentsScale;
+            adjustedSubRect.size.width /= contentsScale;
+            adjustedSubRect.size.height /= contentsScale;
+
+            CGRect subRectInSuper = [hostLayer() convertRect:adjustedSubRect fromLayer:layer];
+            [m_window displayRect:subRectInSuper];
+        }
+        CGSReleaseRegionEnumerator(enumerator);
+    } else {
+        // Simple repaint
+        CGRect dirtyRectInSuper = [hostLayer() convertRect:dirtyRect fromLayer:layer];
+        [m_window displayRect:dirtyRectInSuper];
+    }
+
+    fontAntialiasingState.restore();
+}
+
+void TileCache::drawLayer(TileLayer* layer, CGContextRef context)
+{
+    // The web lock unlock observer runs after CA commit observer.
+    if (!WebThreadIsLockedOrDisabled()) {
+        LOG_ERROR(&quot;Drawing without holding the web thread lock&quot;);
+        ASSERT_NOT_REACHED();
+    }
+
+    WKSetCurrentGraphicsContext(context);
+
+    CGRect dirtyRect = CGContextGetClipBoundingBox(context);
+    CGRect frame = [layer frame];
+    CGContextTranslateCTM(context, -frame.origin.x, -frame.origin.y);
+    CGRect scaledFrame = [hostLayer() convertRect:[layer bounds] fromLayer:layer];
+    CGContextScaleCTM(context, frame.size.width / scaledFrame.size.width, frame.size.height / scaledFrame.size.height);
+
+    if (RetainPtr&lt;CGImage&gt; contentReplacementImage = this-&gt;contentReplacementImage())
+        drawReplacementImage(layer, context, contentReplacementImage.get());
+    else
+        drawWindowContent(layer, context, dirtyRect);
+
+    ++layer.paintCount;
+    if (m_tilePaintCountersVisible) {
+        char text[16];
+        snprintf(text, sizeof(text), &quot;%d&quot;, layer.paintCount);
+
+        CGContextSaveGState(context);
+
+        CGContextTranslateCTM(context, frame.origin.x, frame.origin.y);
+        CGContextSetFillColorWithColor(context, cachedCGColor(colorForGridTileBorder([layer tileGrid]), ColorSpaceDeviceRGB));
+        
+        CGRect labelBounds = [layer bounds];
+        labelBounds.size.width = 10 + 12 * strlen(text);
+        labelBounds.size.height = 25;
+        CGContextFillRect(context, labelBounds);
+
+        if (acceleratedDrawingEnabled())
+            CGContextSetRGBFillColor(context, 1, 0, 0, 0.4f);
+        else
+            CGContextSetRGBFillColor(context, 1, 1, 1, 0.6f);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+        CGContextSetTextMatrix(context, CGAffineTransformMakeScale(1, -1));
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+        CGContextSelectFont(context, &quot;Helvetica&quot;, 25, kCGEncodingMacRoman);
+        CGContextShowTextAtPoint(context, labelBounds.origin.x + 3, labelBounds.origin.y + 20, text, strlen(text));
+#pragma clang diagnostic pop
+    
+        CGContextRestoreGState(context);        
+    }
+
+    WAKView* view = [m_window contentView];
+    [view performSelector:@selector(_dispatchTileDidDraw:) withObject:layer afterDelay:0.0];
+}
+
+void TileCache::setNeedsDisplay()
+{
+    setNeedsDisplayInRect(IntRect(0, 0, std::numeric_limits&lt;int&gt;::max(), std::numeric_limits&lt;int&gt;::max()));
+}
+
+void TileCache::scheduleLayerFlushForPendingRepaint()
+{
+    WAKView* view = [m_window contentView];
+    [view _scheduleLayerFlushForPendingTileCacheRepaint];
+}
+
+void TileCache::setNeedsDisplayInRect(const IntRect&amp; dirtyRect)
+{
+    MutexLocker locker(m_savedDisplayRectMutex);
+    bool addedFirstRect = m_savedDisplayRects.isEmpty();
+    m_savedDisplayRects.append(dirtyRect);
+    if (!addedFirstRect)
+        return;
+    // Compositing layer flush will call back to doPendingRepaints(). The flush may be throttled and not happen immediately.
+    scheduleLayerFlushForPendingRepaint();
+}
+
+void TileCache::invalidateTiles(const IntRect&amp; dirtyRect)
+{
+    ASSERT(!m_tileMutex.tryLock());
+
+    TileGrid* activeGrid = activeTileGrid();
+    if (!keepsZoomedOutTiles()) {
+        activeGrid-&gt;invalidateTiles(dirtyRect);
+        return;
+    }
+    FloatRect scaledRect = dirtyRect;
+    scaledRect.scale(zoomedOutScale() / currentScale());
+    IntRect zoomedOutDirtyRect = enclosingIntRect(scaledRect);
+    if (activeGrid == m_zoomedOutTileGrid) {
+        bool dummy;
+        IntRect coverRect = m_zoomedOutTileGrid-&gt;calculateCoverRect(m_zoomedOutTileGrid-&gt;visibleRect(), dummy);
+        // Instead of repainting a tile outside the cover rect, just remove it.
+        m_zoomedOutTileGrid-&gt;dropTilesBetweenRects(zoomedOutDirtyRect, coverRect);
+        m_zoomedOutTileGrid-&gt;invalidateTiles(zoomedOutDirtyRect);
+        // We need to invalidate zoomed in tiles as well while zooming, since
+        // we could switch back to the zoomed in grid without dropping its
+        // tiles.  See &lt;rdar://problem/9946759&gt;.
+        if (m_tilingMode == Zooming &amp;&amp; m_zoomedInTileGrid)
+            m_zoomedInTileGrid-&gt;invalidateTiles(dirtyRect);
+        return;
+    }
+    if (!m_zoomedInTileGrid-&gt;hasTiles()) {
+        // If no tiles have been created yet for the zoomed in grid, we can't drop the zoomed out tiles.
+        m_zoomedOutTileGrid-&gt;invalidateTiles(zoomedOutDirtyRect);
+        return;
+    }
+    m_zoomedOutTileGrid-&gt;dropTilesIntersectingRect(zoomedOutDirtyRect);
+    m_zoomedInTileGrid-&gt;invalidateTiles(dirtyRect);
+}
+    
+bool TileCache::isTileCreationSuspended() const 
+{
+    return (!keepsZoomedOutTiles() &amp;&amp; m_tilingMode == Zooming) || m_tilingMode == Disabled;
+}
+
+bool TileCache::isTileInvalidationSuspended() const 
+{ 
+    return m_tilingMode == Zooming || m_tilingMode == Panning || m_tilingMode == ScrollToTop || m_tilingMode == Disabled; 
+}
+
+void TileCache::updateTilingMode()
+{
+    ASSERT(WebThreadIsCurrent() || !WebThreadIsEnabled());
+
+    WAKView* view = [m_window contentView];
+
+    if (m_tilingMode == Zooming || m_tilingMode == Panning || m_tilingMode == ScrollToTop) {
+        if (!m_didCallWillStartScrollingOrZooming) {
+            [view _willStartScrollingOrZooming];
+            m_didCallWillStartScrollingOrZooming = true;
+        }
+    } else {
+        if (m_didCallWillStartScrollingOrZooming) {
+            [view _didFinishScrollingOrZooming];
+            m_didCallWillStartScrollingOrZooming = false;
+        }
+        if (m_tilingMode == Disabled)
+            return;
+
+        MutexLocker locker(m_tileMutex);
+        createTilesInActiveGrid(CoverVisibleOnly);
+
+        if (!m_savedDisplayRects.isEmpty())
+            scheduleLayerFlushForPendingRepaint();
+    }
+}
+
+void TileCache::setTilingMode(TilingMode tilingMode)
+{
+    if (tilingMode == m_tilingMode)
+        return;
+    bool wasZooming = (m_tilingMode == Zooming);
+    m_tilingMode = tilingMode;
+
+    if ((m_pendingZoomedOutScale || m_pendingScale) &amp;&amp; m_tilingMode != Disabled)
+        commitScaleChange();
+    else if (wasZooming) {
+        MutexLocker locker(m_tileMutex);
+        bringActiveTileGridToFront();
+    }
+
+    if (m_hasPendingUpdateTilingMode)
+        return;
+    m_hasPendingUpdateTilingMode = true;
+
+    TileCacheTombstone *tombstone = m_tombstone.get();
+    WebThreadRun(^{
+        if ([tombstone isDead])
+            return;
+        m_hasPendingUpdateTilingMode = false;
+        updateTilingMode();
+    });
+}
+
+void TileCache::setTilingDirection(TilingDirection tilingDirection)
+{
+    m_tilingDirection = tilingDirection;
+}
+
+TileCache::TilingDirection TileCache::tilingDirection() const
+{
+    return m_tilingDirection;
+}
+    
+float TileCache::zoomedOutScale() const
+{
+    return m_zoomedOutTileGrid-&gt;scale();
+}
+
+float TileCache::currentScale() const
+{
+    return m_currentScale;
+}
+
+void TileCache::doPendingRepaints()
+{
+    if (m_savedDisplayRects.isEmpty())
+        return;
+    if (isTileInvalidationSuspended())
+        return;
+    MutexLocker locker(m_tileMutex);
+    flushSavedDisplayRects();
+}
+
+void TileCache::flushSavedDisplayRects()
+{
+    ASSERT(!m_tileMutex.tryLock());
+    ASSERT(!m_savedDisplayRects.isEmpty());
+
+    Vector&lt;IntRect&gt; rects;
+    {
+        MutexLocker locker(m_savedDisplayRectMutex);
+        m_savedDisplayRects.swap(rects);
+    }
+    size_t size = rects.size();
+    for (size_t n = 0; n &lt; size; ++n)
+        invalidateTiles(rects[n]);
+}
+
+void TileCache::setSpeculativeTileCreationEnabled(bool enabled)
+{
+    if (m_isSpeculativeTileCreationEnabled == enabled)
+        return;
+    m_isSpeculativeTileCreationEnabled = enabled;
+    if (m_isSpeculativeTileCreationEnabled)
+        m_tileCreationTimer.startOneShot(0);
+}
+
+bool TileCache::hasPendingDraw() const
+{
+    return !m_savedDisplayRects.isEmpty();
+}
+
+void TileCache::prepareToDraw()
+{
+    // This will trigger document relayout if needed.
+    [[m_window contentView] viewWillDraw];
+
+    if (!m_savedDisplayRects.isEmpty()) {
+        MutexLocker locker(m_tileMutex);
+        flushSavedDisplayRects();
+    }
+}
+
+void TileCache::setLayerPoolCapacity(unsigned capacity)
+{
+    TileLayerPool::sharedPool()-&gt;setCapacity(capacity);
+}
+
+void TileCache::drainLayerPool()
+{
+    TileLayerPool::sharedPool()-&gt;drain();
+}
+
+void TileCache::dumpTiles()
+{
+    NSLog(@&quot;=================&quot;);
+    NSLog(@&quot;ZOOMED OUT&quot;);
+    if (m_zoomedOutTileGrid == activeTileGrid())
+        NSLog(@&quot;&lt;ACTIVE&gt;&quot;);
+    m_zoomedOutTileGrid-&gt;dumpTiles();
+    NSLog(@&quot;=================&quot;);
+    if (m_zoomedInTileGrid) {
+        NSLog(@&quot;ZOOMED IN&quot;);
+        if (m_zoomedInTileGrid == activeTileGrid())
+            NSLog(@&quot;&lt;ACTIVE&gt;&quot;);
+        m_zoomedInTileGrid-&gt;dumpTiles();
+        NSLog(@&quot;=================&quot;);
+    }
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosTileGridh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/TileGrid.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/TileGrid.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/TileGrid.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,143 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TileGrid_h
+#define TileGrid_h
+
+#if PLATFORM(IOS)
+
+#include &quot;IntPoint.h&quot;
+#include &quot;IntPointHash.h&quot;
+#include &quot;IntRect.h&quot;
+#include &quot;IntSize.h&quot;
+#include &quot;TileCache.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/Noncopyable.h&gt;
+#include &lt;wtf/OwnPtr.h&gt;
+#include &lt;wtf/PassOwnPtr.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+
+#define LOG_TILING 0
+
+@class CALayer;
+
+namespace WebCore {
+
+class TileGridTile;
+
+class TileGrid {
+    WTF_MAKE_NONCOPYABLE(TileGrid);
+public:
+    typedef IntPoint TileIndex;
+
+    static PassOwnPtr&lt;TileGrid&gt; create(TileCache* cache, const IntSize&amp; tileSize) { return adoptPtr(new TileGrid(cache, tileSize)); }
+
+    ~TileGrid();
+
+    TileCache* tileCache() const { return m_tileCache; }
+
+    CALayer *tileHostLayer() const;
+    IntRect bounds() const;
+    unsigned tileCount() const;
+
+    float scale() const { return m_scale; }
+    void setScale(float scale) { m_scale = scale; }
+
+    IntRect visibleRect() const;
+
+    void createTiles(TileCache::SynchronousTileCreationMode);
+
+    void dropAllTiles();
+    void dropInvalidTiles();
+    void dropTilesOutsideRect(const IntRect&amp;);
+    void dropTilesIntersectingRect(const IntRect&amp;);
+    // Drops tiles that intersect dropRect but do not intersect keepRect.
+    void dropTilesBetweenRects(const IntRect&amp; dropRect, const IntRect&amp; keepRect);
+    bool dropDistantTiles(unsigned tilesNeeded, double shortestDistance);
+
+    void addTilesCoveringRect(const IntRect&amp;);
+
+    bool tilesCover(const IntRect&amp;) const;
+    void centerTileGridOrigin(const IntRect&amp; visibleRect);
+    void invalidateTiles(const IntRect&amp; dirtyRect);
+
+    void updateTileOpacity();
+    void updateTileBorderVisibility();
+    void updateHostLayerSize();
+    bool checkDoSingleTileLayout();
+
+    bool hasTiles() const { return !m_tiles.isEmpty(); }
+
+    IntRect calculateCoverRect(const IntRect&amp; visibleRect, bool&amp; centerGrid);
+
+    // Logging
+    void dumpTiles();
+
+private:
+    double tileDistance2(const IntRect&amp; visibleRect, const IntRect&amp; tileRect) const;
+    unsigned tileByteSize() const;
+
+    void addTileForIndex(const TileIndex&amp;);
+
+    PassRefPtr&lt;TileGridTile&gt; tileForIndex(const TileIndex&amp;) const;
+    IntRect tileRectForIndex(const TileIndex&amp;) const;
+    PassRefPtr&lt;TileGridTile&gt; tileForPoint(const IntPoint&amp;) const;
+    TileIndex tileIndexForPoint(const IntPoint&amp;) const;
+
+    IntRect adjustCoverRectForPageBounds(const IntRect&amp;) const;
+    bool shouldUseMinimalTileCoverage() const;
+
+private:        
+    TileGrid(TileCache*, const IntSize&amp;);
+
+    TileCache* m_tileCache;
+    RetainPtr&lt;CALayer&gt; m_tileHostLayer;
+
+    IntPoint m_origin;
+    IntSize m_tileSize;
+
+    float m_scale;
+
+    typedef HashMap&lt;TileIndex, RefPtr&lt;TileGridTile&gt;&gt; TileMap;
+    TileMap m_tiles;
+
+    IntRect m_validBounds;
+};
+
+static inline IntPoint topLeft(const IntRect&amp; rect)
+{
+    return rect.location();
+}
+
+static inline IntPoint bottomRight(const IntRect&amp; rect)
+{
+    return IntPoint(rect.maxX() - 1, rect.maxY() - 1);
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
+#endif // TileGrid_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosTileGridmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/TileGrid.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/TileGrid.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/TileGrid.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,568 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;TileGrid.h&quot;
+
+#if PLATFORM(IOS)
+
+#include &quot;MemoryPressureHandler.h&quot;
+#include &quot;SystemMemory.h&quot;
+#include &quot;TileGridTile.h&quot;
+#include &quot;TileLayer.h&quot;
+#include &quot;TileLayerPool.h&quot;
+#include &quot;WAKWindow.h&quot;
+#include &lt;CoreGraphics/CoreGraphicsPrivate.h&gt;
+#include &lt;QuartzCore/QuartzCore.h&gt;
+#include &lt;QuartzCore/QuartzCorePrivate.h&gt;
+#include &lt;algorithm&gt;
+#include &lt;functional&gt;
+
+namespace WebCore {
+
+TileGrid::TileGrid(TileCache* tileCache, const IntSize&amp; tileSize)
+    : m_tileCache(tileCache)
+    , m_tileHostLayer(adoptNS([[TileHostLayer alloc] initWithTileGrid:this]))
+    , m_tileSize(tileSize)
+    , m_scale(1)
+    , m_validBounds(0, 0, std::numeric_limits&lt;int&gt;::max(), std::numeric_limits&lt;int&gt;::max()) 
+{
+}
+    
+TileGrid::~TileGrid()
+{
+    [m_tileHostLayer removeFromSuperlayer];
+}
+
+IntRect TileGrid::visibleRect() const
+{
+    IntRect visibleRect = enclosingIntRect(m_tileCache-&gt;visibleRectInLayer(m_tileHostLayer.get()));
+
+    // When fast scrolling to the top, move the visible rect there immediately so we have tiles when the scrolling completes.
+    if (m_tileCache-&gt;tilingMode() == TileCache::ScrollToTop)
+        visibleRect.setY(0);
+
+    return visibleRect;
+}
+
+void TileGrid::dropAllTiles()
+{
+    m_tiles.clear();
+}
+
+void TileGrid::dropTilesIntersectingRect(const IntRect&amp; dropRect)
+{
+    dropTilesBetweenRects(dropRect, IntRect());
+}
+
+void TileGrid::dropTilesOutsideRect(const IntRect&amp; keepRect)
+{
+    dropTilesBetweenRects(IntRect(0, 0, std::numeric_limits&lt;int&gt;::max(), std::numeric_limits&lt;int&gt;::max()), keepRect);
+}
+
+void TileGrid::dropTilesBetweenRects(const IntRect&amp; dropRect, const IntRect&amp; keepRect)
+{
+    Vector&lt;TileIndex&gt; toRemove;
+    TileMap::iterator end = m_tiles.end();
+    for (auto tile : m_tiles) {
+        TileIndex&amp; index = tile.key;
+        IntRect tileRect = tile.value-&gt;rect();
+        if (tileRect.intersects(dropRect) &amp;&amp; !tileRect.intersects(keepRect))
+            toRemove.append(index);
+    }
+    unsigned removeCount = toRemove.size();
+    for (unsigned n = 0; n &lt; removeCount; ++n)
+        m_tiles.remove(toRemove[n]);
+}
+
+unsigned TileGrid::tileByteSize() const
+{
+    IntSize tilePixelSize = m_tileSize;
+    tilePixelSize.scale(m_tileCache-&gt;screenScale());
+    return TileLayerPool::bytesBackingLayerWithPixelSize(tilePixelSize);
+}
+
+template &lt;typename T&gt;
+static bool isFartherAway(const pair&lt;double, T&gt;&amp; a, const pair&lt;double, T&gt;&amp; b)
+{
+    return a.first &gt; b.first;
+}
+
+bool TileGrid::dropDistantTiles(unsigned tilesNeeded, double shortestDistance)
+{
+    unsigned bytesPerTile = tileByteSize();
+    unsigned bytesNeeded = tilesNeeded * bytesPerTile;
+    unsigned bytesUsed = tileCount() * bytesPerTile;
+    unsigned maximumBytes = m_tileCache-&gt;tileCapacityForGrid(this);
+
+    int bytesToReclaim = int(bytesUsed) - (int(maximumBytes) - bytesNeeded);
+    if (bytesToReclaim &lt;= 0)
+        return true;
+
+    unsigned tilesToRemoveCount = bytesToReclaim / bytesPerTile;
+
+    IntRect visibleRect = this-&gt;visibleRect();
+    Vector&lt;pair&lt;double, TileIndex&gt;&gt; toRemove;
+    for (auto tile : m_tiles) {
+        TileIndex&amp; index = tile.key;
+        IntRect tileRect = tile.value-&gt;rect();
+        double distance = tileDistance2(visibleRect, tileRect);
+        if (distance &lt;= shortestDistance)
+            continue;
+        toRemove.append(std::make_pair(distance, index));
+        std::push_heap(toRemove.begin(), toRemove.end(), std::ptr_fun(isFartherAway&lt;TileIndex&gt;));
+        if (toRemove.size() &gt; tilesToRemoveCount) {
+            std::pop_heap(toRemove.begin(), toRemove.end(), std::ptr_fun(isFartherAway&lt;TileIndex&gt;));
+            toRemove.removeLast();
+        }
+    }
+    size_t removeCount = toRemove.size();
+    for (size_t n = 0; n &lt; removeCount; ++n)
+        m_tiles.remove(toRemove[n].second);
+
+    if (!shortestDistance)
+        return true;
+
+    return tileCount() * bytesPerTile + bytesNeeded &lt;= maximumBytes;
+}
+
+void TileGrid::addTilesCoveringRect(const IntRect&amp; rectToCover)
+{
+    // We never draw anything outside of our bounds.
+    IntRect rect(rectToCover);
+    rect.intersect(bounds());
+    if (rect.isEmpty())
+        return;
+
+    TileIndex topLeftIndex = tileIndexForPoint(topLeft(rect));
+    TileIndex bottomRightIndex = tileIndexForPoint(bottomRight(rect));
+    for (int yIndex = topLeftIndex.y(); yIndex &lt;= bottomRightIndex.y(); ++yIndex) {
+        for (int xIndex = topLeftIndex.x(); xIndex &lt;= bottomRightIndex.x(); ++xIndex) {
+            TileIndex index(xIndex, yIndex);
+            if (!tileForIndex(index))
+                addTileForIndex(index);
+        }
+    }
+}
+
+void TileGrid::addTileForIndex(const TileIndex&amp; index)
+{
+    m_tiles.set(index, TileGridTile::create(this, tileRectForIndex(index)));
+}
+
+CALayer* TileGrid::tileHostLayer() const
+{
+    return m_tileHostLayer.get();
+}
+
+IntRect TileGrid::bounds() const
+{
+    return IntRect(IntPoint(), IntSize([tileHostLayer() size]));
+}
+
+PassRefPtr&lt;TileGridTile&gt; TileGrid::tileForIndex(const TileIndex&amp; index) const
+{
+    return m_tiles.get(index);
+}
+
+IntRect TileGrid::tileRectForIndex(const TileIndex&amp; index) const
+{
+    IntRect rect(index.x() * m_tileSize.width() - (m_origin.x() ? m_tileSize.width() - m_origin.x() : 0),
+                 index.y() * m_tileSize.height() - (m_origin.y() ? m_tileSize.height() - m_origin.y() : 0),
+                 m_tileSize.width(),
+                 m_tileSize.height());
+    rect.intersect(bounds());
+    return rect;
+}
+
+TileGrid::TileIndex TileGrid::tileIndexForPoint(const IntPoint&amp; point) const
+{
+    ASSERT(m_origin.x() &lt; m_tileSize.width());
+    ASSERT(m_origin.y() &lt; m_tileSize.height());
+    int x = (point.x() + (m_origin.x() ? m_tileSize.width() - m_origin.x() : 0)) / m_tileSize.width();
+    int y = (point.y() + (m_origin.y() ? m_tileSize.height() - m_origin.y() : 0)) / m_tileSize.height();
+    return TileIndex(std::max(x, 0), std::max(y, 0));
+}
+
+void TileGrid::centerTileGridOrigin(const IntRect&amp; visibleRect)
+{
+    if (visibleRect.isEmpty())
+        return;
+
+    unsigned minimumHorizontalTiles = 1 + (visibleRect.width() - 1) / m_tileSize.width();
+    unsigned minimumVerticalTiles = 1 + (visibleRect.height() - 1) / m_tileSize.height();
+    TileIndex currentTopLeftIndex = tileIndexForPoint(topLeft(visibleRect));
+    TileIndex currentBottomRightIndex = tileIndexForPoint(bottomRight(visibleRect));
+    unsigned currentHorizontalTiles = currentBottomRightIndex.x() - currentTopLeftIndex.x() + 1;
+    unsigned currentVerticalTiles = currentBottomRightIndex.y() - currentTopLeftIndex.y() + 1;
+
+    // If we have tiles already, only center if we would get benefits from both directions (as we need to throw out existing tiles).
+    if (tileCount() &amp;&amp; (currentHorizontalTiles == minimumHorizontalTiles || currentVerticalTiles == minimumVerticalTiles))
+        return;
+
+    IntPoint newOrigin(0, 0);
+    IntSize size = bounds().size();
+    if (size.width() &gt; m_tileSize.width()) {
+        newOrigin.setX((visibleRect.x() - (minimumHorizontalTiles * m_tileSize.width() - visibleRect.width()) / 2) % m_tileSize.width());
+        if (newOrigin.x() &lt; 0)
+            newOrigin.setX(0);
+    }
+    if (size.height() &gt; m_tileSize.height()) {
+        newOrigin.setY((visibleRect.y() - (minimumVerticalTiles * m_tileSize.height() - visibleRect.height()) / 2) % m_tileSize.height());
+        if (newOrigin.y() &lt; 0)
+            newOrigin.setY(0);
+    }
+
+    // Drop all existing tiles if the origin moved.
+    if (newOrigin == m_origin)
+        return;
+    m_tiles.clear();
+    m_origin = newOrigin;
+}
+
+PassRefPtr&lt;TileGridTile&gt; TileGrid::tileForPoint(const IntPoint&amp; point) const
+{
+    return tileForIndex(tileIndexForPoint(point));
+}
+
+bool TileGrid::tilesCover(const IntRect&amp; rect) const
+{
+    return tileForPoint(rect.location()) &amp;&amp; tileForPoint(IntPoint(rect.maxX() - 1, rect.y())) &amp;&amp;
+    tileForPoint(IntPoint(rect.x(), rect.maxY() - 1)) &amp;&amp; tileForPoint(IntPoint(rect.maxX() - 1, rect.maxY() - 1));
+}
+
+void TileGrid::updateTileOpacity()
+{
+    TileMap::iterator end = m_tiles.end();
+    for (TileMap::iterator it = m_tiles.begin(); it != end; ++it)
+        [it-&gt;value-&gt;tileLayer() setOpaque:m_tileCache-&gt;tilesOpaque()];
+}
+
+void TileGrid::updateTileBorderVisibility()
+{
+    TileMap::iterator end = m_tiles.end();
+    for (TileMap::iterator it = m_tiles.begin(); it != end; ++it)
+        it-&gt;value-&gt;showBorder(m_tileCache-&gt;tileBordersVisible());
+}
+
+unsigned TileGrid::tileCount() const
+{
+    return m_tiles.size();
+}
+
+bool TileGrid::checkDoSingleTileLayout()
+{
+    IntSize size = bounds().size();
+    if (size.width() &gt; m_tileSize.width() || size.height() &gt; m_tileSize.height())
+        return false;
+
+    if (m_origin != IntPoint(0, 0)) {
+        m_tiles.clear();
+        m_origin = IntPoint(0, 0);
+    }
+
+    dropInvalidTiles();
+
+    if (size.isEmpty()) {
+        ASSERT(!m_tiles.get(TileIndex(0, 0)));
+        return true;
+    }
+
+    TileIndex originIndex(0, 0);
+    if (!m_tiles.get(originIndex))
+        m_tiles.set(originIndex, TileGridTile::create(this, tileRectForIndex(originIndex)));
+
+    return true;
+}
+
+void TileGrid::updateHostLayerSize()
+{
+    CALayer* hostLayer = m_tileCache-&gt;hostLayer();
+    CGRect tileHostBounds = [hostLayer convertRect:[hostLayer bounds] toLayer:tileHostLayer()];
+    CGSize transformedSize;
+    transformedSize.width = CGRound(tileHostBounds.size.width);
+    transformedSize.height = CGRound(tileHostBounds.size.height);
+
+    CGRect bounds = [tileHostLayer() bounds];
+    if (CGSizeEqualToSize(bounds.size, transformedSize))
+        return;
+    bounds.size = transformedSize;
+    [tileHostLayer() setBounds:bounds];
+}
+
+void TileGrid::dropInvalidTiles()
+{
+    IntRect bounds = this-&gt;bounds();
+    IntRect dropBounds = intersection(m_validBounds, bounds);
+    Vector&lt;TileIndex&gt; toRemove;
+    for (auto tile : m_tiles) {
+        TileIndex&amp; index = tile.key;
+        IntRect tileRect = tile.value-&gt;rect();
+        IntRect expectedTileRect = tileRectForIndex(index);
+        if (expectedTileRect != tileRect || !dropBounds.contains(tileRect))
+            toRemove.append(index);
+    }
+    unsigned removeCount = toRemove.size();
+    for (unsigned n = 0; n &lt; removeCount; ++n)
+        m_tiles.remove(toRemove[n]);
+
+    m_validBounds = bounds;
+}
+
+void TileGrid::invalidateTiles(const IntRect&amp; dirtyRect)
+{
+    if (!hasTiles())
+        return;
+
+    IntRect bounds = this-&gt;bounds();
+    if (intersection(bounds, m_validBounds) != m_validBounds) {
+        // The bounds have got smaller. Everything outside will also be considered invalid and will be dropped by dropInvalidTiles().
+        // Due to dirtyRect being limited to current bounds the tiles that are temporarily outside might miss invalidation 
+        // completely othwerwise.
+        m_validBounds = bounds;
+    }
+
+    Vector&lt;TileIndex&gt; invalidatedTiles;
+
+    if (dirtyRect.width() &gt; m_tileSize.width() * 4 || dirtyRect.height() &gt; m_tileSize.height() * 4) {
+        // For large invalidates, iterate over live tiles.
+        TileMap::iterator end = m_tiles.end();
+        for (TileMap::iterator it = m_tiles.begin(); it != end; ++it) {
+            TileGridTile* tile = it-&gt;value.get();
+            if (!tile-&gt;rect().intersects(dirtyRect))
+               continue;
+            tile-&gt;invalidateRect(dirtyRect);
+            invalidatedTiles.append(it-&gt;key);
+        }
+    } else {
+        TileIndex topLeftIndex = tileIndexForPoint(topLeft(dirtyRect));
+        TileIndex bottomRightIndex = tileIndexForPoint(bottomRight(dirtyRect));
+        for (int yIndex = topLeftIndex.y(); yIndex &lt;= bottomRightIndex.y(); ++yIndex) {
+            for (int xIndex = topLeftIndex.x(); xIndex &lt;= bottomRightIndex.x(); ++xIndex) {
+                TileIndex index(xIndex, yIndex);
+                RefPtr&lt;TileGridTile&gt; tile = tileForIndex(index);
+                if (!tile)
+                    continue;
+                if (!tile-&gt;rect().intersects(dirtyRect))
+                    continue;
+                tile-&gt;invalidateRect(dirtyRect);
+                invalidatedTiles.append(index);
+            }
+        }
+    }
+    if (invalidatedTiles.isEmpty())
+        return;
+    // When using minimal coverage, drop speculative tiles instead of updating them.
+    if (!shouldUseMinimalTileCoverage())
+        return;
+    if (m_tileCache-&gt;tilingMode() != TileCache::Minimal &amp;&amp; m_tileCache-&gt;tilingMode() != TileCache::Normal)
+        return;
+    IntRect visibleRect = this-&gt;visibleRect();
+    unsigned count = invalidatedTiles.size();
+    for (unsigned i = 0; i &lt; count; ++i) {
+        RefPtr&lt;TileGridTile&gt; tile = tileForIndex(invalidatedTiles[i]);
+        if (!tile-&gt;rect().intersects(visibleRect))
+            m_tiles.remove(invalidatedTiles[i]);
+    }
+}
+
+bool TileGrid::shouldUseMinimalTileCoverage() const
+{
+    return m_tileCache-&gt;tilingMode() == TileCache::Minimal
+        || !m_tileCache-&gt;isSpeculativeTileCreationEnabled()
+        || memoryPressureHandler().hasReceivedMemoryPressure();
+}
+
+IntRect TileGrid::adjustCoverRectForPageBounds(const IntRect&amp; rect) const
+{
+    // Adjust the rect so that it stays within the bounds and keeps the pixel size.
+    IntRect bounds = this-&gt;bounds();
+    IntRect adjustedRect = rect;
+    adjustedRect.move(rect.x() &lt; bounds.x() ? bounds.x() - rect.x() : 0,
+              rect.y() &lt; bounds.y() ? bounds.y() - rect.y() : 0);
+    adjustedRect.move(rect.maxX() &gt; bounds.maxX() ? bounds.maxX() - rect.maxX() : 0,
+              rect.maxY() &gt; bounds.maxY() ? bounds.maxY() - rect.maxY() : 0);
+    adjustedRect = intersection(bounds, adjustedRect);
+    if (adjustedRect == rect || adjustedRect.isEmpty() || shouldUseMinimalTileCoverage())
+        return adjustedRect;
+    int pixels = adjustedRect.width() * adjustedRect.height();
+    if (adjustedRect.width() != rect.width())
+        adjustedRect.inflateY((pixels / adjustedRect.width() - adjustedRect.height()) / 2);
+    else if (adjustedRect.height() != rect.height())
+        adjustedRect.inflateX((pixels / adjustedRect.height() - adjustedRect.width()) / 2);
+    return intersection(adjustedRect, bounds);
+}
+
+IntRect TileGrid::calculateCoverRect(const IntRect&amp; visibleRect, bool&amp; centerGrid)
+{
+    // Use minimum coverRect if we are under memory pressure.
+    if (shouldUseMinimalTileCoverage()) {
+        centerGrid = true;
+        return visibleRect;
+    }
+    IntRect coverRect = visibleRect;
+    centerGrid = false;
+    coverRect.inflateX(visibleRect.width() / 2);
+    coverRect.inflateY(visibleRect.height());
+    return adjustCoverRectForPageBounds(coverRect);
+}
+
+double TileGrid::tileDistance2(const IntRect&amp; visibleRect, const IntRect&amp; tileRect) const
+{
+    // The &quot;distance&quot; calculated here is used to pick which tile to cache next. The idea is to create those
+    // closest to the current viewport first so the user is more likely to see already rendered content we she
+    // scrolls. The calculation is weighted to prefer vertical and downward direction.
+    if (visibleRect.intersects(tileRect))
+        return 0;
+    IntPoint visibleCenter = visibleRect.location() + IntSize(visibleRect.width() / 2, visibleRect.height() / 2);
+    IntPoint tileCenter = tileRect.location() + IntSize(tileRect.width() / 2, tileRect.height() / 2);
+    
+    double horizontalBias = 1.0;
+    double leftwardBias = 1.0;
+    double rightwardBias = 1.0;
+
+    double verticalBias = 1.0;
+    double upwardBias = 1.0;
+    double downwardBias = 1.0;
+
+    const double tilingBiasVeryLikely = 0.8;
+    const double tilingBiasLikely = 0.9;
+
+    switch (m_tileCache-&gt;tilingDirection()) {
+    case TileCache::TilingDirectionUp:
+        verticalBias = tilingBiasVeryLikely;
+        upwardBias = tilingBiasLikely;
+        break;
+    case TileCache::TilingDirectionDown:
+        verticalBias = tilingBiasVeryLikely;
+        downwardBias = tilingBiasLikely;
+        break;
+    case TileCache::TilingDirectionLeft:
+        horizontalBias = tilingBiasVeryLikely;
+        leftwardBias = tilingBiasLikely;
+        break;
+    case TileCache::TilingDirectionRight:
+        horizontalBias = tilingBiasVeryLikely;
+        rightwardBias = tilingBiasLikely;
+        break;
+    }
+
+    double xScale = horizontalBias * visibleRect.height() / visibleRect.width() * (tileCenter.x() &gt;= visibleCenter.x() ? rightwardBias : leftwardBias);
+    double yScale = verticalBias * visibleRect.width() / visibleRect.height() * (tileCenter.y() &gt;= visibleCenter.y() ? downwardBias : upwardBias);
+
+    double xDistance = xScale * (tileCenter.x() - visibleCenter.x());
+    double yDistance = yScale * (tileCenter.y() - visibleCenter.y());
+
+    double distance2 = xDistance * xDistance + yDistance * yDistance;
+    return distance2;
+}
+
+void TileGrid::createTiles(TileCache::SynchronousTileCreationMode creationMode)
+{
+    IntRect visibleRect = this-&gt;visibleRect();
+    if (visibleRect.isEmpty())
+        return;
+
+    // Drop tiles that are wrong size or outside the frame (because the frame has been resized).
+    dropInvalidTiles();
+
+    bool centerGrid;
+    IntRect coverRect = calculateCoverRect(visibleRect, centerGrid);
+
+    // If tile size is bigger than the view, centering minimizes the painting needed to cover the screen.
+    // This is especially useful after zooming 
+    centerGrid = centerGrid || !tileCount();
+    if (centerGrid)
+        centerTileGridOrigin(visibleRect);
+
+    double shortestDistance = std::numeric_limits&lt;double&gt;::infinity();
+    double coveredDistance = 0;
+    Vector&lt;TileGrid::TileIndex&gt; tilesToCreate;
+    unsigned pendingTileCount = 0;
+
+    TileGrid::TileIndex topLeftIndex = tileIndexForPoint(topLeft(coverRect));
+    TileGrid::TileIndex bottomRightIndex = tileIndexForPoint(bottomRight(coverRect));
+    for (int yIndex = topLeftIndex.y(); yIndex &lt;= bottomRightIndex.y(); ++yIndex) {
+        for (int xIndex = topLeftIndex.x(); xIndex &lt;= bottomRightIndex.x(); ++xIndex) {
+            TileGrid::TileIndex index(xIndex, yIndex);
+            // Currently visible tiles have distance of 0 and get all created in the same transaction.
+            double distance = tileDistance2(visibleRect, tileRectForIndex(index));
+            if (distance &gt; coveredDistance)
+                coveredDistance = distance;
+            if (tileForIndex(index))
+                continue;
+            ++pendingTileCount;
+            if (distance &gt; shortestDistance)
+                continue;
+            if (distance &lt; shortestDistance) {
+                tilesToCreate.clear();
+                shortestDistance = distance;
+            }
+            tilesToCreate.append(index);
+        }
+    }
+
+    size_t tilesToCreateCount = tilesToCreate.size();
+
+    // Tile creation timer will invoke this function again in CoverSpeculative mode.
+    bool candidateTilesAreSpeculative = shortestDistance &gt; 0;
+    if (creationMode == TileCache::CoverVisibleOnly &amp;&amp; candidateTilesAreSpeculative)
+        tilesToCreateCount = 0;
+
+    // Even if we don't create any tiles, we should still drop distant tiles
+    // in case coverRect got smaller.
+    double keepDistance = std::min(shortestDistance, coveredDistance);
+    if (!dropDistantTiles(tilesToCreateCount, keepDistance))
+        return;
+
+    ASSERT(pendingTileCount &gt;= tilesToCreateCount);
+    if (!pendingTileCount)
+        return;
+
+    for (size_t n = 0; n &lt; tilesToCreateCount; ++n)
+        addTileForIndex(tilesToCreate[n]);
+
+    bool didCreateTiles = !!tilesToCreateCount;
+    bool createMoreTiles = pendingTileCount &gt; tilesToCreateCount;
+    m_tileCache-&gt;finishedCreatingTiles(didCreateTiles, createMoreTiles);
+}
+
+void TileGrid::dumpTiles()
+{
+    IntRect visibleRect = this-&gt;visibleRect();
+    NSLog(@&quot;transformed visibleRect = [%6d %6d %6d %6d]&quot;, visibleRect.x(), visibleRect.y(), visibleRect.width(), visibleRect.height());
+    unsigned i = 0;
+    TileMap::iterator end = m_tiles.end();
+    for (TileMap::iterator it = m_tiles.begin(); it != end; ++it) {
+        TileIndex&amp; index = it-&gt;key;
+        IntRect tileRect = it-&gt;value-&gt;rect();
+        NSLog(@&quot;#%-3d (%3d %3d) - [%6d %6d %6d %6d]%@&quot;, ++i, index.x(), index.y(), tileRect.x(), tileRect.y(), tileRect.width(), tileRect.height(), tileRect.intersects(visibleRect) ? @&quot; *&quot; : @&quot;&quot;);
+        NSLog(@&quot;     %@&quot;, [it-&gt;value-&gt;tileLayer() contents]);
+    }
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosTileGridTilehfromrev161588trunkSourceWebCoreplatformContentFilterh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/TileGridTile.h (from rev 161588, trunk/Source/WebCore/platform/ContentFilter.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/TileGridTile.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/TileGridTile.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TileGridTile_h
+#define TileGridTile_h
+
+#if PLATFORM(IOS)
+
+#include &quot;IntRect.h&quot;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+
+@class TileLayer;
+
+namespace WebCore {
+
+class TileGrid;
+
+// Refcount the tiles so they work nicely in vector and we know when to remove the tile layer from the parent.
+class TileGridTile : public RefCounted&lt;TileGridTile&gt; {
+public:
+    static PassRefPtr&lt;TileGridTile&gt; create(TileGrid* grid, const IntRect&amp; rect) { return adoptRef&lt;TileGridTile&gt;(new TileGridTile(grid, rect)); }
+    ~TileGridTile();
+
+    TileLayer* tileLayer() const { return m_tileLayer.get(); }
+    void invalidateRect(const IntRect&amp; rectInSurface);
+    IntRect rect() const { return m_rect; }
+    void setRect(const IntRect&amp; tileRect);
+    void showBorder(bool);
+
+private:
+    TileGridTile(TileGrid*, const IntRect&amp;);
+
+    TileGrid* m_tileGrid;
+    RetainPtr&lt;TileLayer&gt; m_tileLayer;
+    IntRect m_rect;
+};
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
+#endif // TileGridTile_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosTileGridTilemm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/TileGridTile.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/TileGridTile.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/TileGridTile.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,131 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;TileGrid.h&quot;
+
+#if PLATFORM(IOS)
+
+#include &quot;Color.h&quot;
+#include &quot;TileCache.h&quot;
+#include &quot;TileGridTile.h&quot;
+#include &quot;TileLayer.h&quot;
+#include &quot;TileLayerPool.h&quot;
+#include &quot;WAKWindow.h&quot;
+#include &lt;QuartzCore/QuartzCore.h&gt;
+#include &lt;QuartzCore/QuartzCorePrivate.h&gt;
+#include &lt;algorithm&gt;
+#include &lt;functional&gt;
+
+namespace WebCore {
+
+#if LOG_TILING
+static int totalTileCount;
+#endif
+
+TileGridTile::TileGridTile(TileGrid* tileGrid, const IntRect&amp; tileRect)
+    : m_tileGrid(tileGrid)
+    , m_rect(tileRect)
+{
+    ASSERT(!tileRect.isEmpty());
+    IntSize pixelSize(m_rect.size());
+    const CGFloat screenScale = m_tileGrid-&gt;tileCache()-&gt;screenScale();
+    pixelSize.scale(screenScale);
+    m_tileLayer = TileLayerPool::sharedPool()-&gt;takeLayerWithSize(pixelSize);
+    if (!m_tileLayer) {
+#if LOG_TILING
+        NSLog(@&quot;unable to reuse layer with size %d x %d, creating one&quot;, pixelSize.width(), pixelSize.height());
+#endif
+        m_tileLayer = adoptNS([[TileLayer alloc] init]);
+    }
+    TileLayer* layer = m_tileLayer.get();
+    [layer setTileGrid:tileGrid];
+    [layer setOpaque:m_tileGrid-&gt;tileCache()-&gt;tilesOpaque()];
+    [layer setEdgeAntialiasingMask:0];
+    [layer setNeedsLayoutOnGeometryChange:NO];
+    [layer setContentsScale:screenScale];
+    [layer setAcceleratesDrawing:m_tileGrid-&gt;tileCache()-&gt;acceleratedDrawingEnabled()];
+
+    // Host layer may have other sublayers. Keep the tile layers at the beginning of the array
+    // so they are painted behind everything else.
+    [tileGrid-&gt;tileHostLayer() insertSublayer:layer atIndex:tileGrid-&gt;tileCount()];
+    [layer setFrame:m_rect];
+    invalidateRect(m_rect);
+    showBorder(m_tileGrid-&gt;tileCache()-&gt;tileBordersVisible());
+
+#if LOG_TILING
+    ++totalTileCount;
+    NSLog(@&quot;new Tile (%d,%d) %d %d, count %d&quot;, tileRect.x(), tileRect.y(), tileRect.width(), tileRect.height(), totalTileCount);
+#endif
+}
+
+TileGridTile::~TileGridTile() 
+{
+    [tileLayer() setTileGrid:0];
+    [tileLayer() removeFromSuperlayer];
+    TileLayerPool::sharedPool()-&gt;addLayer(tileLayer());
+#if LOG_TILING
+    --totalTileCount;
+    NSLog(@&quot;delete Tile (%d,%d) %d %d, count %d&quot;, m_rect.x(), m_rect.y(), m_rect.width(), m_rect.height(), totalTileCount);
+#endif
+}
+
+void TileGridTile::invalidateRect(const IntRect&amp; windowDirtyRect)
+{
+    IntRect dirtyRect = intersection(windowDirtyRect, m_rect);
+    if (dirtyRect.isEmpty())
+        return;
+    dirtyRect.move(IntPoint() - m_rect.location());
+    [tileLayer() setNeedsDisplayInRect:dirtyRect];
+
+    if (m_tileGrid-&gt;tileCache()-&gt;tilePaintCountersVisible())
+        [tileLayer() setNeedsDisplayInRect:CGRectMake(0, 0, 46, 25)];
+}
+
+void TileGridTile::setRect(const IntRect&amp; tileRect)
+{
+    if (m_rect == tileRect)
+        return;
+    m_rect = tileRect;
+    TileLayer* layer = m_tileLayer.get();
+    [layer setFrame:m_rect];
+    [layer setNeedsDisplay];
+}
+
+void TileGridTile::showBorder(bool flag)
+{
+    TileLayer* layer = m_tileLayer.get();
+    if (flag) {
+        [layer setBorderColor:cachedCGColor(m_tileGrid-&gt;tileCache()-&gt;colorForGridTileBorder(m_tileGrid), ColorSpaceDeviceRGB)];
+        [layer setBorderWidth:0.5f];
+    } else {
+        [layer setBorderColor:nil];
+        [layer setBorderWidth:0];
+    }
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosTileLayerhfromrev161588trunkSourceWebCoreplatformmacDisplaySleepDisablerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/TileLayer.h (from rev 161588, trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/TileLayer.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/TileLayer.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TileLayer_h
+#define TileLayer_h
+
+#if PLATFORM(IOS)
+
+#include &lt;QuartzCore/CALayer.h&gt;
+
+namespace WebCore {
+class TileGrid;
+};
+
+@interface TileLayer : CALayer {
+    WebCore::TileGrid* _tileGrid;
+    unsigned _paintCount;
+}
+@property (nonatomic) unsigned paintCount;
+@property (nonatomic) WebCore::TileGrid* tileGrid;
++ (TileLayer *)layerBeingPainted;
+@end
+
+@interface TileHostLayer : CALayer {
+    WebCore::TileGrid* _tileGrid;
+}
+- (id)initWithTileGrid:(WebCore::TileGrid*)tileGrid;
+@end
+
+#endif // PLATFORM(IOS)
+#endif // TileLayer_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosTileLayermm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/TileLayer.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/TileLayer.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/TileLayer.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;TileLayer.h&quot;
+
+#if PLATFORM(IOS)
+
+#include &quot;TileCache.h&quot;
+#include &quot;TileGrid.h&quot;
+#include &quot;WebCoreThread.h&quot;
+
+@implementation TileHostLayer
+- (id)initWithTileGrid:(WebCore::TileGrid*)tileGrid
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    _tileGrid = tileGrid;
+    [self setAnchorPoint:CGPointZero];
+    return self;
+}
+
+- (id&lt;CAAction&gt;)actionForKey:(NSString *)key
+{
+    UNUSED_PARAM(key);
+    // Disable all default actions
+    return nil;
+}
+
+- (void)renderInContext:(CGContextRef)context
+{
+    if (pthread_main_np())
+        WebThreadLock();
+    _tileGrid-&gt;tileCache()-&gt;doLayoutTiles();
+    [super renderInContext:context];
+}
+@end
+
+@implementation TileLayer
+@synthesize paintCount = _paintCount;
+@synthesize tileGrid = _tileGrid;
+
+static TileLayer *layerBeingPainted;
+
+- (void)setNeedsDisplayInRect:(CGRect)rect
+{
+    [self setNeedsLayout];
+    [super setNeedsDisplayInRect:rect];
+}
+
+- (void)layoutSublayers
+{
+    if (pthread_main_np())
+        WebThreadLock();
+    // This may trigger WebKit layout and generate more repaint rects.
+    if (_tileGrid)
+        _tileGrid-&gt;tileCache()-&gt;prepareToDraw();
+}
+
+- (void)drawInContext:(CGContextRef)context
+{
+    if (_tileGrid)
+        _tileGrid-&gt;tileCache()-&gt;drawLayer(self, context);
+}
+
+- (id&lt;CAAction&gt;)actionForKey:(NSString *)key
+{
+    UNUSED_PARAM(key);
+    // Disable all default actions
+    return nil;
+}
+
++ (TileLayer *)layerBeingPainted
+{
+    return layerBeingPainted;
+}
+
+@end
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosTileLayerPoolh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/TileLayerPool.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/TileLayerPool.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/TileLayerPool.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TileLayerPool_h
+#define TileLayerPool_h
+
+#if PLATFORM(IOS)
+
+#include &quot;IntSize.h&quot;
+#include &quot;IntSizeHash.h&quot;
+#include &quot;Timer.h&quot;
+#include &lt;wtf/Deque.h&gt;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/OwnPtr.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/Threading.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+@class TileLayer;
+
+namespace WebCore {
+
+class TileLayerPool {
+    WTF_MAKE_NONCOPYABLE(TileLayerPool);
+public:
+    static TileLayerPool* sharedPool();
+
+    void addLayer(const RetainPtr&lt;TileLayer&gt;&amp;);
+    RetainPtr&lt;TileLayer&gt; takeLayerWithSize(const IntSize&amp;);
+
+    // The maximum size of all queued layers in bytes.
+    unsigned capacity() const { return m_capacity; }
+    void setCapacity(unsigned);
+    void drain();
+
+    unsigned decayedCapacity() const;
+
+    static unsigned bytesBackingLayerWithPixelSize(const IntSize&amp;);
+
+private:
+    TileLayerPool();
+
+    typedef Deque&lt;RetainPtr&lt;TileLayer&gt; &gt; LayerList;
+
+    bool canReuseLayerWithSize(const IntSize&amp; size) const { return m_capacity &amp;&amp; !size.isEmpty(); }
+    void schedulePrune();
+    void prune();
+    typedef enum { LeaveUnchanged, MarkAsUsed } AccessType;
+    LayerList&amp; listOfLayersWithSize(const IntSize&amp;, AccessType = LeaveUnchanged);
+
+    HashMap&lt;IntSize, LayerList&gt; m_reuseLists;
+    // Ordered by recent use. The last size is the most recently used.
+    Vector&lt;IntSize&gt; m_sizesInPruneOrder;
+    unsigned m_totalBytes;
+    unsigned m_capacity;
+    Mutex m_layerPoolMutex;
+
+    double m_lastAddTime;
+    bool m_needsPrune;
+
+    friend NeverDestroyed&lt;TileLayerPool&gt;;
+};
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
+#endif // TileLayerPool_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosTileLayerPoolmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/TileLayerPool.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/TileLayerPool.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/TileLayerPool.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,174 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;TileLayerPool.h&quot;
+
+#if PLATFORM(IOS)
+
+#include &quot;Logging.h&quot;
+#include &quot;MemoryPressureHandler.h&quot;
+#include &quot;TileLayer.h&quot;
+#include &quot;TileGrid.h&quot;
+#include &lt;wtf/CurrentTime.h&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
+
+namespace WebCore {
+
+static const double capacityDecayTime = 5;
+
+TileLayerPool::TileLayerPool()
+    : m_totalBytes(0)
+    , m_capacity(0)
+    , m_lastAddTime(0)
+    , m_needsPrune(false)
+{
+}
+
+TileLayerPool* TileLayerPool::sharedPool()
+{
+    static NeverDestroyed&lt;TileLayerPool&gt; sharedPool;
+    return &amp;sharedPool.get();
+}
+
+unsigned TileLayerPool::bytesBackingLayerWithPixelSize(const IntSize&amp; size)
+{
+    return size.width() * size.height() * 4;
+}
+
+TileLayerPool::LayerList&amp; TileLayerPool::listOfLayersWithSize(const IntSize&amp; size, AccessType accessType)
+{
+    ASSERT(!m_layerPoolMutex.tryLock());
+    HashMap&lt;IntSize, LayerList&gt;::iterator it = m_reuseLists.find(size);
+    if (it == m_reuseLists.end()) {
+        it = m_reuseLists.add(size, LayerList()).iterator;
+        m_sizesInPruneOrder.append(size);
+    } else if (accessType == MarkAsUsed) {
+        m_sizesInPruneOrder.remove(m_sizesInPruneOrder.reverseFind(size));
+        m_sizesInPruneOrder.append(size);
+    }
+    return it-&gt;value;
+}
+
+void TileLayerPool::addLayer(const RetainPtr&lt;TileLayer&gt;&amp; layer)
+{
+    IntSize layerSize([layer.get() frame].size);
+    layerSize.scale([layer.get() contentsScale]);
+    if (!canReuseLayerWithSize(layerSize))
+        return;
+
+    if (memoryPressureHandler().hasReceivedMemoryPressure()) {
+        LOG(MemoryPressure, &quot;Under memory pressure: %s, totalBytes: %d&quot;, __PRETTY_FUNCTION__, m_totalBytes);
+        return;
+    }
+
+    MutexLocker locker(m_layerPoolMutex);
+    listOfLayersWithSize(layerSize).prepend(layer);
+    m_totalBytes += bytesBackingLayerWithPixelSize(layerSize);
+
+    m_lastAddTime = currentTime();
+    schedulePrune();
+}
+
+RetainPtr&lt;TileLayer&gt; TileLayerPool::takeLayerWithSize(const IntSize&amp; size)
+{
+    if (!canReuseLayerWithSize(size))
+        return nil;
+    MutexLocker locker(m_layerPoolMutex);
+    LayerList&amp; reuseList = listOfLayersWithSize(size, MarkAsUsed);
+    if (reuseList.isEmpty())
+        return nil;
+    m_totalBytes -= bytesBackingLayerWithPixelSize(size);
+    return reuseList.takeFirst();
+}
+
+void TileLayerPool::setCapacity(unsigned capacity)
+{
+    MutexLocker reuseLocker(m_layerPoolMutex);
+    if (capacity &lt; m_capacity)
+        schedulePrune();
+    m_capacity = capacity;
+}
+    
+unsigned TileLayerPool::decayedCapacity() const
+{
+    // Decay to one quarter over capacityDecayTime
+    double timeSinceLastAdd = currentTime() - m_lastAddTime;
+    if (timeSinceLastAdd &gt; capacityDecayTime)
+        return m_capacity / 4;
+    float decayProgess = float(timeSinceLastAdd / capacityDecayTime);
+    return m_capacity / 4 + m_capacity * 3 / 4 * (1.f - decayProgess);
+}
+
+void TileLayerPool::schedulePrune()
+{
+    ASSERT(!m_layerPoolMutex.tryLock());
+    if (m_needsPrune)
+        return;
+    m_needsPrune = true;
+    dispatch_time_t nextPruneTime = dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC);
+    dispatch_after(nextPruneTime, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        prune();
+    });
+}
+
+void TileLayerPool::prune()
+{
+    MutexLocker locker(m_layerPoolMutex);
+    ASSERT(m_needsPrune);
+    m_needsPrune = false;
+    unsigned shrinkTo = decayedCapacity();
+    while (m_totalBytes &gt; shrinkTo) {
+        ASSERT(!m_sizesInPruneOrder.isEmpty());
+        IntSize sizeToDrop = m_sizesInPruneOrder.first();
+        LayerList&amp; oldestReuseList = m_reuseLists.find(sizeToDrop)-&gt;value;
+        if (oldestReuseList.isEmpty()) {
+            m_reuseLists.remove(sizeToDrop);
+            m_sizesInPruneOrder.remove(0);
+            continue;
+        }
+#if LOG_TILING
+        NSLog(@&quot;dropping layer of size %d x %d&quot;, sizeToDrop.width(), sizeToDrop.height());
+#endif
+        m_totalBytes -= bytesBackingLayerWithPixelSize(sizeToDrop);
+        // The last element in the list is the oldest, hence most likely not to
+        // still have a backing store.
+        oldestReuseList.removeLast();
+    }
+    if (currentTime() - m_lastAddTime &lt;= capacityDecayTime)
+        schedulePrune();
+}
+
+void TileLayerPool::drain()
+{
+    MutexLocker reuseLocker(m_layerPoolMutex);
+    m_reuseLists.clear();
+    m_sizesInPruneOrder.clear();
+    m_totalBytes = 0;
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebCoreMotionManagerhfromrev161588trunkSourceWebCoreplatformKillRingNonecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/ios/WebCoreMotionManager.h (from rev 161588, trunk/Source/WebCore/platform/KillRingNone.cpp) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebCoreMotionManager.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/WebCoreMotionManager.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef WebCoreMotionManager_h
+#define WebCoreMotionManager_h
+
+#import &quot;DeviceMotionClientIOS.h&quot;
+#import &quot;DeviceOrientationClientIOS.h&quot;
+#import &lt;CoreLocation/CoreLocation.h&gt;
+#import &lt;wtf/HashCountedSet.h&gt;
+
+#if PLATFORM(IOS)
+
+#import &lt;CoreMotion/CoreMotion.h&gt;
+
+const float kMotionUpdateInterval = 0.05f;
+
+@interface WebCoreMotionManager : NSObject {
+    CMMotionManager* m_motionManager;
+    CLLocationManager* m_locationManager;
+    HashSet&lt;WebCore::DeviceMotionClientIOS*&gt; m_deviceMotionClients;
+    HashSet&lt;WebCore::DeviceOrientationClientIOS*&gt; m_deviceOrientationClients;
+    NSTimer* m_updateTimer;
+    BOOL m_gyroAvailable;
+    BOOL m_headingAvailable;
+}
+
++ (WebCoreMotionManager *)sharedManager;
+- (void)addMotionClient:(WebCore::DeviceMotionClientIOS *)client;
+- (void)removeMotionClient:(WebCore::DeviceMotionClientIOS *)client;
+- (void)addOrientationClient:(WebCore::DeviceOrientationClientIOS *)client;
+- (void)removeOrientationClient:(WebCore::DeviceOrientationClientIOS *)client;
+- (BOOL)gyroAvailable;
+- (BOOL)headingAvailable;
+@end
+
+#endif
+
+#endif // WebCoreMotionManager_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebCoreMotionManagermm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/WebCoreMotionManager.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebCoreMotionManager.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/WebCoreMotionManager.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,286 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+#import &quot;WebCoreMotionManager.h&quot;
+
+#import &quot;SoftLinking.h&quot;
+#import &quot;WebCoreObjCExtras.h&quot;
+#import &lt;CoreLocation/CoreLocation.h&gt;
+#import &lt;objc/objc-runtime.h&gt;
+#import &lt;wtf/MathExtras.h&gt;
+#import &lt;wtf/PassRefPtr.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+
+#if PLATFORM(IOS)
+
+#import &quot;WebCoreThreadRun.h&quot;
+#import &lt;CoreMotion/CoreMotion.h&gt;
+
+// Get CoreLocation classes
+SOFT_LINK_FRAMEWORK(CoreLocation)
+
+SOFT_LINK_CLASS(CoreLocation, CLLocationManager)
+SOFT_LINK_CLASS(CoreLocation, CLHeading)
+
+// Get CoreMotion classes
+SOFT_LINK_FRAMEWORK(CoreMotion)
+
+SOFT_LINK_CLASS(CoreMotion, CMMotionManager)
+SOFT_LINK_CLASS(CoreMotion, CMAccelerometerData)
+SOFT_LINK_CLASS(CoreMotion, CMDeviceMotion)
+
+static const double kGravity = 9.80665;
+
+@interface WebCoreMotionManager(Private)
+
+- (void)initializeOnMainThread;
+- (void)checkClientStatus;
+- (void)update;
+- (void)sendAccelerometerData:(CMAccelerometerData *)newAcceleration;
+- (void)sendMotionData:(CMDeviceMotion *)newMotion withHeading:(CLHeading *)newHeading;
+
+@end
+
+@implementation WebCoreMotionManager
+
++ (WebCoreMotionManager *)sharedManager
+{
+    DEFINE_STATIC_LOCAL(RetainPtr&lt;WebCoreMotionManager&gt;, sharedMotionManager, ([[WebCoreMotionManager alloc] init]));
+    return sharedMotionManager.get();
+}
+
+- (id)init
+{
+    self = [super init];
+    if (self)
+        [self performSelectorOnMainThread:@selector(initializeOnMainThread) withObject:nil waitUntilDone:NO];
+    return self;
+}
+
+- (void)dealloc
+{
+    if (WebCoreObjCScheduleDeallocateOnMainThread([WebCoreMotionManager class], self))
+        return;
+
+    ASSERT(!m_updateTimer);
+
+    if (m_headingAvailable)
+        [m_locationManager stopUpdatingHeading];
+    [m_locationManager release];
+
+    if (m_gyroAvailable)
+        [m_motionManager stopDeviceMotionUpdates];
+    else
+        [m_motionManager stopAccelerometerUpdates];
+    [m_motionManager release];
+
+    [super dealloc];
+}
+
+- (void)addMotionClient:(WebCore::DeviceMotionClientIOS *)client
+{
+    m_deviceMotionClients.add(client);
+    [self checkClientStatus];
+}
+
+- (void)removeMotionClient:(WebCore::DeviceMotionClientIOS *)client
+{
+    m_deviceMotionClients.remove(client);
+    [self checkClientStatus];
+}
+
+- (void)addOrientationClient:(WebCore::DeviceOrientationClientIOS *)client
+{
+    m_deviceOrientationClients.add(client);
+    [self checkClientStatus];
+}
+
+- (void)removeOrientationClient:(WebCore::DeviceOrientationClientIOS *)client
+{
+    m_deviceOrientationClients.remove(client);
+    [self checkClientStatus];
+}
+
+- (BOOL)gyroAvailable
+{
+    return m_gyroAvailable;
+}
+
+- (BOOL)headingAvailable
+{
+    return m_headingAvailable;
+}
+
+- (void)initializeOnMainThread
+{
+    ASSERT(!WebThreadIsCurrent());
+
+#define CMMotionManager getCMMotionManagerClass()
+    m_motionManager = [[CMMotionManager alloc] init];
+#undef CMMotionManager
+
+    m_gyroAvailable = m_motionManager.deviceMotionAvailable;
+
+    if (m_gyroAvailable)
+        m_motionManager.deviceMotionUpdateInterval = kMotionUpdateInterval;
+    else
+        m_motionManager.accelerometerUpdateInterval = kMotionUpdateInterval;
+
+#define CLLocationManager getCLLocationManagerClass()
+    m_locationManager = [[CLLocationManager alloc] init];
+    m_headingAvailable = [CLLocationManager headingAvailable];
+#undef CLLocationManager
+
+    [self checkClientStatus];
+}
+
+- (void)checkClientStatus
+{
+    if (!pthread_main_np()) {
+        [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO];
+        return;
+    }
+
+    // Since this method executes on the main thread, it should always be called
+    // after the initializeOnMainThread method has run, and hence there should
+    // be no chance that m_motionManager has not been created.
+    ASSERT(m_motionManager);
+
+    if (m_deviceMotionClients.size() || m_deviceOrientationClients.size()) {
+        if (m_gyroAvailable)
+            [m_motionManager startDeviceMotionUpdates];
+        else
+            [m_motionManager startAccelerometerUpdates];
+
+        if (m_headingAvailable)
+            [m_locationManager startUpdatingHeading];
+
+        if (!m_updateTimer) {
+            m_updateTimer = [[NSTimer scheduledTimerWithTimeInterval:kMotionUpdateInterval
+                                                              target:self
+                                                            selector:@selector(update)
+                                                            userInfo:nil
+                                                             repeats:YES] retain];
+        }
+    } else {
+        NSTimer *timer = m_updateTimer;
+        m_updateTimer = nil;
+        [timer invalidate];
+        [timer release];
+
+        if (m_gyroAvailable)
+            [m_motionManager stopDeviceMotionUpdates];
+        else
+            [m_motionManager stopAccelerometerUpdates];
+
+        if (m_headingAvailable)
+            [m_locationManager stopUpdatingHeading];
+    }
+}
+
+- (void)update
+{
+    // It's extremely unlikely that an update happens without an active
+    // motion or location manager, but we should guard for this case just in case.
+    if (!m_motionManager || !m_locationManager)
+        return;
+    
+    // We should, however, guard for the case where the managers return nil data.
+    CMDeviceMotion *deviceMotion = m_motionManager.deviceMotion;
+    if (m_gyroAvailable &amp;&amp; deviceMotion)
+        [self sendMotionData:deviceMotion withHeading:m_locationManager.heading];
+    else {
+        if (CMAccelerometerData *accelerometerData = m_motionManager.accelerometerData)
+            [self sendAccelerometerData:accelerometerData];
+    }
+}
+
+- (void)sendAccelerometerData:(CMAccelerometerData *)newAcceleration
+{
+    WebThreadRun(^{
+        CMAcceleration accel = newAcceleration.acceleration;
+
+        Vector&lt;WebCore::DeviceMotionClientIOS*&gt; clients;
+        copyToVector(m_deviceMotionClients, clients);
+        for (size_t i = 0; i &lt; clients.size(); ++i)
+            clients[i]-&gt;motionChanged(0, 0, 0, accel.x * kGravity, accel.y * kGravity, accel.z * kGravity, 0, 0, 0);
+    });
+}
+
+- (void)sendMotionData:(CMDeviceMotion *)newMotion withHeading:(CLHeading *)newHeading
+{
+    WebThreadRun(^{
+        // Acceleration is user + gravity
+        CMAcceleration userAccel = newMotion.userAcceleration;
+        CMAcceleration gravity = newMotion.gravity;
+        CMAcceleration totalAccel;
+        totalAccel.x = userAccel.x + gravity.x;
+        totalAccel.y = userAccel.y + gravity.y;
+        totalAccel.z = userAccel.z + gravity.z;
+
+        CMRotationRate rotationRate = newMotion.rotationRate;
+
+        Vector&lt;WebCore::DeviceMotionClientIOS*&gt; motionClients;
+        copyToVector(m_deviceMotionClients, motionClients);
+        for (size_t i = 0; i &lt; motionClients.size(); ++i) {
+            motionClients[i]-&gt;motionChanged(userAccel.x * kGravity, userAccel.y * kGravity, userAccel.z * kGravity,
+                                            totalAccel.x * kGravity, totalAccel.y * kGravity, totalAccel.z * kGravity,
+                                            rad2deg(rotationRate.x), rad2deg(rotationRate.y), rad2deg(rotationRate.z));
+        }
+
+        CMAttitude* attitude = newMotion.attitude;
+
+        Vector&lt;WebCore::DeviceOrientationClientIOS*&gt; orientationClients;
+        copyToVector(m_deviceOrientationClients, orientationClients);
+
+        // Note that the W3C DeviceOrientation specification labels the X axis
+        // as passing between the sides of the device, and the Y axis as passing
+        // from top to bottom of the device. Conventional Tait-Bryan Euler angles
+        // have the X axis pointing forward (the heading of the aircraft, for
+        // example), which is what you would &quot;roll&quot; around, and what the W3C says
+        // is the Y axis. Unfortunately CoreMotion doesn't normalize in the
+        // same order as the W3C requests, so our beta is [-90, 90] and gamma is
+        // [-180, 180]. For most practical uses this is acceptable.
+        // See &lt;rdar://problem/9414459&gt; Normalize our DeviceOrientation beta/gamma per spec
+
+        // Rotation around the Z axis (pointing up, normalized to [0, 360] deg).
+        double alpha = rad2deg(attitude.yaw &gt; 0 ? attitude.yaw : (M_PI * 2 + attitude.yaw));
+        // Rotation around the X axis (side to side).
+        double beta = rad2deg(attitude.pitch);
+        // Rotation around the Y axis (top to bottom).
+        double gamma = rad2deg(attitude.roll);
+
+        double heading = (m_headingAvailable &amp;&amp; newHeading) ? newHeading.magneticHeading : 0;
+        double headingAccuracy = (m_headingAvailable &amp;&amp; newHeading) ? newHeading.headingAccuracy : -1;
+
+        for (size_t i = 0; i &lt; orientationClients.size(); ++i)
+            orientationClients[i]-&gt;orientationChanged(alpha, beta, gamma, heading, headingAccuracy);
+    });
+}
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebCoreSystemInterfaceIOSh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+/*
+ * Copyright 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef WebCoreSystemInterfaceIOS_h
+#define WebCoreSystemInterfaceIOS_h
+
+#include &lt;Availability.h&gt;
+
+typedef enum {
+    wkIOSSystemVersion_3_0 = __IPHONE_3_0,
+    wkIOSSystemVersion_4_2 = __IPHONE_4_2,
+    wkIOSSystemVersion_5_0 = __IPHONE_5_0,
+    wkIOSSystemVersion_6_0 = __IPHONE_6_0,
+} wkIOSSystemVersion;
+
+bool iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion);
+
+extern bool (*wkExecutableWasLinkedOnOrAfterIOSVersion)(int);
+
+extern bool (*wkIsGB18030ComplianceRequired)(void);
+
+inline bool iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion version)
+{
+    return wkExecutableWasLinkedOnOrAfterIOSVersion(version);
+}
+
+typedef enum {
+    wkDeviceClassInvalid = -1,
+    wkDeviceClassiPad,
+    wkDeviceClassiPhone,
+    wkDeviceClassiPod,
+} wkDeviceClass;
+extern int (*wkGetDeviceClass)(void);
+inline wkDeviceClass iosDeviceClass(void)
+{
+    int deviceClass = wkGetDeviceClass();
+    switch (deviceClass) {
+    case wkDeviceClassInvalid:
+    case wkDeviceClassiPad:
+    case wkDeviceClassiPhone:
+    case wkDeviceClassiPod:
+        return (wkDeviceClass)deviceClass;
+    }
+    assert(false);
+    return wkDeviceClassInvalid;
+}
+
+extern CFStringRef (*wkGetUserAgent)(void);
+extern CFStringRef (*wkGetPlatformNameForNavigator)(void);
+extern CFStringRef (*wkGetVendorNameForNavigator)(void);
+
+#endif // WebCoreSystemInterfaceIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebCoreSystemInterfaceIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,142 @@
</span><ins>+/*
+ * Copyright 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+#import &quot;WebCoreSystemInterface.h&quot;
+
+void (*wkCALayerEnumerateRectsBeingDrawnWithBlock)(CALayer *, CGContextRef context, void (^block)(CGRect rect));
+BOOL (*wkCGContextGetShouldSmoothFonts)(CGContextRef);
+CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int);
+void (*wkCGContextResetClip)(CGContextRef); 
+CFStringRef (*wkCopyCFLocalizationPreferredName)(CFStringRef);
+void (*wkClearGlyphVector)(void* glyphs);
+OSStatus (*wkConvertCharToGlyphs)(void* styleGroup, const UniChar*, unsigned numCharacters, void* glyphs);
+NSString* (*wkGetMIMETypeForExtension)(NSString*);
+NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
+void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform);
+void (*wkSetPatternPhaseInUserSpace)(CGContextRef, CGPoint point);
+CGAffineTransform (*wkGetUserToBaseCTM)(CGContextRef);
+bool (*wkCGContextIsPDFContext)(CGContextRef);
+void (*wkSetUpFontCache)();
+void (*wkSignalCFReadStreamEnd)(CFReadStreamRef stream);
+void (*wkSignalCFReadStreamHasBytes)(CFReadStreamRef stream);
+void (*wkSignalCFReadStreamError)(CFReadStreamRef stream, CFStreamError *error);
+CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *), 
+    void (*formFinalize)(CFReadStreamRef, void *), 
+    Boolean (*formOpen)(CFReadStreamRef, CFStreamError *, Boolean *, void *), 
+    CFIndex (*formRead)(CFReadStreamRef, UInt8 *, CFIndex, CFStreamError *, Boolean *, void *), 
+    Boolean (*formCanRead)(CFReadStreamRef, void *), 
+    void (*formClose)(CFReadStreamRef, void *), 
+    void (*formSchedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *), 
+    void (*formUnschedule)(CFReadStreamRef, CFRunLoopRef, CFStringRef, void *),
+    void *context);
+NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
+void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
+void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
+id (*wkCreateNSURLConnectionDelegateProxy)(void);
+unsigned (*wkInitializeMaximumHTTPConnectionCountPerHost)(unsigned preferredConnectionCount);
+int (*wkGetHTTPPipeliningPriority)(CFURLRequestRef);
+void (*wkSetHTTPPipeliningMaximumPriority)(int priority);
+void (*wkSetHTTPPipeliningPriority)(CFURLRequestRef, int priority);
+void (*wkSetHTTPPipeliningMinimumFastLanePriority)(int priority);
+void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef proxyHost, CFNumberRef proxyPort);
+void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
+void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
+CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
+bool (*wkExecutableWasLinkedOnOrAfterIOSVersion)(int);
+int (*wkGetDeviceClass)(void);
+CGSize (*wkGetViewportScreenSize)(void);
+void (*wkSetLayerContentsScale)(CALayer *);
+float (*wkGetScreenScaleFactor)(void);
+bool (*wkIsGB18030ComplianceRequired)(void);
+void (*wkCGPathAddRoundedRect)(CGMutablePathRef path, const CGAffineTransform* matrix, CGRect rect, CGFloat cornerWidth, CGFloat cornerHeight); 
+void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef);
+CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*);
+
+#if USE(CFNETWORK)
+CFHTTPCookieStorageRef (*wkGetDefaultHTTPCookieStorage)();
+WKCFURLCredentialRef (*wkCopyCredentialFromCFPersistentStorage)(CFURLProtectionSpaceRef protectionSpace);
+void (*wkSetCFURLRequestShouldContentSniff)(CFMutableURLRequestRef, bool);
+CFArrayRef (*wkCFURLRequestCopyHTTPRequestBodyParts)(CFURLRequestRef);
+void (*wkCFURLRequestSetHTTPRequestBodyParts)(CFMutableURLRequestRef, CFArrayRef bodyParts);
+void (*wkSetRequestStorageSession)(CFURLStorageSessionRef, CFMutableURLRequestRef);
+#endif
+
+bool (*wkGetVerticalGlyphsForCharacters)(CTFontRef, const UniChar[], CGGlyph[], size_t);
+CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
+bool (*wkCTFontTransformGlyphs)(CTFontRef font, CGGlyph glyphs[], CGSize advances[], CFIndex count, wkCTFontTransformOptions options);
+
+CGSize (*wkCTRunGetInitialAdvance)(CTRunRef);
+
+CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
+
+#if !PLATFORM(IOS_SIMULATOR)
+CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
+CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
+#endif // !PLATFORM(IOS_SIMULATOR)
+
+CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
+NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
+CFHTTPCookieStorageRef (*wkCopyHTTPCookieStorage)(CFURLStorageSessionRef);
+unsigned (*wkGetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef);
+void (*wkSetHTTPCookieAcceptPolicy)(CFHTTPCookieStorageRef, unsigned);
+NSArray *(*wkHTTPCookies)(CFHTTPCookieStorageRef);
+NSArray *(*wkHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSURL *);
+void (*wkSetHTTPCookiesForURL)(CFHTTPCookieStorageRef, NSArray *, NSURL *, NSURL *);
+void (*wkDeleteAllHTTPCookies)(CFHTTPCookieStorageRef);
+void (*wkDeleteHTTPCookie)(CFHTTPCookieStorageRef, NSHTTPCookie *);
+
+CFStringRef (*wkGetCFURLResponseMIMEType)(CFURLResponseRef);
+CFURLRef (*wkGetCFURLResponseURL)(CFURLResponseRef);
+CFHTTPMessageRef (*wkGetCFURLResponseHTTPResponse)(CFURLResponseRef);
+CFStringRef (*wkCopyCFURLResponseSuggestedFilename)(CFURLResponseRef);
+void (*wkSetCFURLResponseMIMEType)(CFURLResponseRef, CFStringRef mimeType);
+
+void(*wkDestroyRenderingResources)(void);
+
+bool (*wkCaptionAppearanceHasUserPreferences)(void);
+bool (*wkCaptionAppearanceShowCaptionsWhenAvailable)(void);
+CGColorRef(*wkCaptionAppearanceCopyForegroundColor)(void);
+CGColorRef(*wkCaptionAppearanceCopyBackgroundColor)(void);
+CGColorRef(*wkCaptionAppearanceCopyWindowColor)(void);
+bool(*wkCaptionAppearanceGetForegroundOpacity)(CGFloat*);
+bool(*wkCaptionAppearanceGetBackgroundOpacity)(CGFloat*);
+bool(*wkCaptionAppearanceGetWindowOpacity)(CGFloat*);
+CGFontRef(*wkCaptionAppearanceCopyFontForStyle)(int);
+bool(*wkCaptionAppearanceGetRelativeCharacterSize)(CGFloat*);
+int(*wkCaptionAppearanceGetTextEdgeStyle)(void);
+CFStringRef(*wkCaptionAppearanceGetSettingsChangedNotification)(void);
+
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+bool (*wkIsPublicSuffix)(NSString *host);
+#endif
+
+#if ENABLE(CACHE_PARTITIONING)
+CFStringRef (*wkCachePartitionKey)(void);
+#endif
+
+CFStringRef (*wkGetUserAgent)(void);
+CFStringRef (*wkGetPlatformNameForNavigator)(void);
+CFStringRef (*wkGetVendorNameForNavigator)(void);
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebEventh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/WebEvent.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebEvent.h                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/WebEvent.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,192 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// FIXME: Rename this file to WebEventIOS.h after we upstream the iOS port.
+#ifndef WebEventIOS_h
+#define WebEventIOS_h
+
+#import &lt;CoreGraphics/CoreGraphics.h&gt;
+#import &lt;Foundation/Foundation.h&gt;
+
+typedef enum {
+    WebEventMouseDown,
+    WebEventMouseUp,
+    WebEventMouseMoved,
+    
+    WebEventScrollWheel,
+    
+    WebEventKeyDown,
+    WebEventKeyUp,
+    
+    WebEventTouchBegin,
+    WebEventTouchChange,
+    WebEventTouchEnd,
+    WebEventTouchCancel
+} WebEventType;
+
+typedef enum {
+    WebEventTouchPhaseBegan,
+    WebEventTouchPhaseMoved,
+    WebEventTouchPhaseStationary,
+    WebEventTouchPhaseEnded,
+    WebEventTouchPhaseCancelled
+} WebEventTouchPhaseType;
+
+// These enum values are copied directly from GSEvent for compatibility.
+typedef enum {
+    WebEventFlagMaskAlphaShift = 0x00010000,
+    WebEventFlagMaskShift      = 0x00020000,
+    WebEventFlagMaskControl    = 0x00040000,
+    WebEventFlagMaskAlternate  = 0x00080000,
+    WebEventFlagMaskCommand    = 0x00100000,
+} WebEventFlagValues;
+typedef unsigned WebEventFlags;
+
+// These enum values are copied directly from GSEvent for compatibility.
+typedef enum {
+    WebEventCharacterSetASCII           = 0,
+    WebEventCharacterSetSymbol          = 1,
+    WebEventCharacterSetDingbats        = 2,
+    WebEventCharacterSetUnicode         = 253,
+    WebEventCharacterSetFunctionKeys    = 254,
+} WebEventCharacterSet;
+
+@interface WebEvent : NSObject {
+@private
+    WebEventType _type;
+    CFTimeInterval _timestamp;
+    
+    CGPoint _locationInWindow;
+    
+    NSString *_characters;
+    NSString *_charactersIgnoringModifiers;
+    WebEventFlags _modifierFlags;
+    BOOL _keyRepeating;
+    BOOL _popupVariant; // FIXME: to be removed
+    NSUInteger _keyboardFlags;
+    uint16_t _keyCode;
+    BOOL _tabKey;
+    WebEventCharacterSet _characterSet;
+    
+    float _deltaX;
+    float _deltaY;
+    
+    unsigned _touchCount;
+    NSArray *_touchLocations;
+    NSArray *_touchIdentifiers;
+    NSArray *_touchPhases;
+    
+    BOOL _isGesture;
+    float _gestureScale;
+    float _gestureRotation;
+
+    BOOL _wasHandled;
+}
+
+- (WebEvent *)initWithMouseEventType:(WebEventType)type
+                           timeStamp:(CFTimeInterval)timeStamp
+                            location:(CGPoint)point;
+
+- (WebEvent *)initWithScrollWheelEventWithTimeStamp:(CFTimeInterval)timeStamp
+                                           location:(CGPoint)point
+                                              deltaX:(float)deltaX
+                                              deltaY:(float)deltaY;
+
+- (WebEvent *)initWithTouchEventType:(WebEventType)type
+                           timeStamp:(CFTimeInterval)timeStamp
+                            location:(CGPoint)point
+                           modifiers:(WebEventFlags)modifiers
+                          touchCount:(unsigned)touchCount
+                      touchLocations:(NSArray *)touchLocations
+                    touchIdentifiers:(NSArray *)touchIdentifiers
+                         touchPhases:(NSArray *)touchPhases isGesture:(BOOL)isGesture
+                        gestureScale:(float)gestureScale
+                     gestureRotation:(float)gestureRotation;
+
+// FIXME: this is deprecated. It will be removed when UIKit adopts the new one below.
+- (WebEvent *)initWithKeyEventType:(WebEventType)type
+                         timeStamp:(CFTimeInterval)timeStamp
+                        characters:(NSString *)characters
+       charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers
+                         modifiers:(WebEventFlags)modifiers
+                       isRepeating:(BOOL)repeating
+                    isPopupVariant:(BOOL)popupVariant
+                           keyCode:(uint16_t)keyCode
+                          isTabKey:(BOOL)tabKey
+                      characterSet:(WebEventCharacterSet)characterSet;
+
+- (WebEvent *)initWithKeyEventType:(WebEventType)type
+                         timeStamp:(CFTimeInterval)timeStamp
+                        characters:(NSString *)characters
+       charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers
+                         modifiers:(WebEventFlags)modifiers
+                       isRepeating:(BOOL)repeating
+                         withFlags:(NSUInteger)flags
+                           keyCode:(uint16_t)keyCode
+                          isTabKey:(BOOL)tabKey
+                      characterSet:(WebEventCharacterSet)characterSet;
+
+@property(nonatomic, readonly) WebEventType type;
+@property(nonatomic, readonly) CFTimeInterval timestamp;
+
+// Mouse
+@property(nonatomic, readonly) CGPoint locationInWindow;
+
+// Keyboard
+@property(nonatomic, readonly, retain) NSString *characters;
+@property(nonatomic, readonly, retain) NSString *charactersIgnoringModifiers;
+@property(nonatomic, readonly) WebEventFlags modifierFlags;
+@property(nonatomic, readonly, getter = isKeyRepeating) BOOL keyRepeating;
+
+// FIXME: this is deprecated. It will be removed when UIKit adopts the new initWithKeyEventType.
+@property(nonatomic, readonly, getter = isPopupVariant) BOOL popupVariant;
+@property(nonatomic, readonly) NSUInteger keyboardFlags;
+@property(nonatomic, readonly) uint16_t keyCode;
+@property(nonatomic, readonly, getter = isTabKey) BOOL tabKey;
+@property(nonatomic, readonly) WebEventCharacterSet characterSet;
+
+// Scroll Wheel
+@property(nonatomic, readonly) float deltaX;
+@property(nonatomic, readonly) float deltaY;
+
+// Touch
+@property(nonatomic, readonly) unsigned touchCount;
+@property(nonatomic, readonly, retain) NSArray *touchLocations;
+@property(nonatomic, readonly, retain) NSArray *touchIdentifiers;
+@property(nonatomic, readonly, retain) NSArray *touchPhases;
+
+// Gesture
+@property(nonatomic, readonly) BOOL isGesture;
+@property(nonatomic, readonly) float gestureScale;
+@property(nonatomic, readonly) float gestureRotation;
+
+@property(nonatomic) BOOL wasHandled;
+
+@end
+
+@interface WebIOSEvent : WebEvent
+@end
+
+#endif // WebEventIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWebEventmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/WebEvent.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WebEvent.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/WebEvent.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,495 @@
</span><ins>+/*
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// FIXME: Rename this file to WebEventIOS.mm after we upstream the iOS port.
+
+#import &quot;config.h&quot;
+#import &quot;WebEvent.h&quot;
+
+#import &quot;KeyEventCocoa.h&quot;
+#import &lt;Foundation/NSGeometry.h&gt;
+#import &lt;wtf/Assertions.h&gt;
+
+using namespace WebCore;
+
+@implementation WebEvent
+
+@synthesize type = _type;
+@synthesize timestamp = _timestamp;
+@synthesize wasHandled = _wasHandled;
+
+- (WebEvent *)initWithMouseEventType:(WebEventType)type
+                           timeStamp:(CFTimeInterval)timeStamp
+                            location:(CGPoint)point
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    
+    _type = type;
+    _timestamp = timeStamp;
+
+    _locationInWindow = point;
+    
+    return self;
+}
+
+- (WebEvent *)initWithScrollWheelEventWithTimeStamp:(CFTimeInterval)timeStamp
+                                           location:(CGPoint)point
+                                              deltaX:(float)deltaX
+                                              deltaY:(float)deltaY
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    
+    _type = WebEventScrollWheel;
+    _timestamp = timeStamp;
+
+    _locationInWindow = point;
+    _deltaX = deltaX;
+    _deltaY = deltaY;
+    
+    return self;
+}
+
+- (WebEvent *)initWithTouchEventType:(WebEventType)type
+                           timeStamp:(CFTimeInterval)timeStamp
+                            location:(CGPoint)point
+                           modifiers:(WebEventFlags)modifiers
+                          touchCount:(unsigned)touchCount
+                      touchLocations:(NSArray *)touchLocations
+                    touchIdentifiers:(NSArray *)touchIdentifiers
+                         touchPhases:(NSArray *)touchPhases isGesture:(BOOL)isGesture
+                        gestureScale:(float)gestureScale
+                     gestureRotation:(float)gestureRotation
+{
+    self = [super init];
+    if (!self)
+        return nil;
+
+    _type = type;
+    _timestamp = timeStamp;
+    _modifierFlags = modifiers;
+
+    // FIXME: &lt;rdar://problem/7185284&gt; TouchEvents may be in more than one window some day.
+    _locationInWindow = point;
+    _touchCount = touchCount;
+    _touchLocations = [touchLocations copy];
+    _touchIdentifiers = [touchIdentifiers copy];
+    _touchPhases = [touchPhases copy];
+    _isGesture = isGesture;
+    _gestureScale = gestureScale;
+    _gestureRotation = gestureRotation;
+
+    return self;
+}
+
+static int windowsKeyCodeForCharCodeIOS(unichar charCode)
+{
+    // iPhone Specific Cases
+    // &lt;rdar://7709408&gt;: We get 10 ('\n') from UIKit when using the software keyboard
+    if (charCode == 10)
+        return 0x0D;
+
+    // General Case
+    return windowsKeyCodeForCharCode(charCode);
+}
+
+- (WebEvent *)initWithKeyEventType:(WebEventType)type
+                         timeStamp:(CFTimeInterval)timeStamp
+                        characters:(NSString *)characters
+       charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers
+                         modifiers:(WebEventFlags)modifiers
+                       isRepeating:(BOOL)repeating
+                    isPopupVariant:(BOOL)popupVariant
+                           keyCode:(uint16_t)keyCode
+                          isTabKey:(BOOL)tabKey
+                      characterSet:(WebEventCharacterSet)characterSet
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    
+    _type = type;
+    _timestamp = timeStamp;
+
+    _characters = [characters retain];
+    _charactersIgnoringModifiers = [charactersIgnoringModifiers retain];
+    _modifierFlags = modifiers;
+    _keyRepeating = repeating;
+    _popupVariant = popupVariant;
+    _tabKey = tabKey;
+    _characterSet = characterSet;
+
+    if (keyCode)
+        _keyCode = windowsKeyCodeForKeyCode(keyCode);
+
+    // NOTE: this preserves the original semantics which used the
+    // characters string for the keyCode. This should be changed in iOS 4.0 to
+    // allow the client to explicitly specify a keyCode, otherwise default to
+    // mapping the characters string to a keyCode.
+    // e.g. add an 'else' before this 'if'.
+    if ([charactersIgnoringModifiers length] == 1) {
+        unichar ch = [charactersIgnoringModifiers characterAtIndex:0];
+        _keyCode = windowsKeyCodeForCharCodeIOS(ch);
+    }
+
+    return self;
+}
+
+
+- (WebEvent *)initWithKeyEventType:(WebEventType)type
+                         timeStamp:(CFTimeInterval)timeStamp
+                        characters:(NSString *)characters
+       charactersIgnoringModifiers:(NSString *)charactersIgnoringModifiers
+                         modifiers:(WebEventFlags)modifiers
+                       isRepeating:(BOOL)repeating
+                         withFlags:(NSUInteger)flags
+                           keyCode:(uint16_t)keyCode
+                          isTabKey:(BOOL)tabKey
+                      characterSet:(WebEventCharacterSet)characterSet
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    
+    _type = type;
+    _timestamp = timeStamp;
+
+    _characters = [characters retain];
+    _charactersIgnoringModifiers = [charactersIgnoringModifiers retain];
+    _modifierFlags = modifiers;
+    _keyRepeating = repeating;
+    _keyboardFlags = flags;
+    _tabKey = tabKey;
+    _characterSet = characterSet;
+    
+    if (keyCode)
+        _keyCode = windowsKeyCodeForKeyCode(keyCode);
+
+    // NOTE: this preserves the original semantics which used the 
+    // characters string for the keyCode. This should be changed in iOS 4.0 to
+    // allow the client to explicitly specify a keyCode, otherwise default to 
+    // mapping the characters string to a keyCode.
+    // e.g. add an 'else' before this 'if'.
+    if ([charactersIgnoringModifiers length] == 1) {
+        unichar ch = [charactersIgnoringModifiers characterAtIndex:0];
+        _keyCode = windowsKeyCodeForCharCodeIOS(ch);
+    }
+
+    return self;
+}
+
+- (void)dealloc
+{
+    [_characters release];
+    [_charactersIgnoringModifiers release];
+
+    [_touchLocations release];
+    [_touchIdentifiers release];
+    [_touchPhases release];
+    
+    [super dealloc];
+}
+
+- (NSString *)_typeDescription
+{
+    switch (_type) {
+        case WebEventMouseDown:
+            return @&quot;WebEventMouseDown&quot;;
+        case WebEventMouseUp:
+            return @&quot;WebEventMouseUp&quot;;
+        case WebEventMouseMoved:
+            return @&quot;WebEventMouseMoved&quot;;
+        case WebEventScrollWheel:
+            return @&quot;WebEventScrollWheel&quot;;
+        case WebEventKeyDown:
+            return @&quot;WebEventKeyDown&quot;;
+        case WebEventKeyUp:
+            return @&quot;WebEventKeyUp&quot;;
+        case WebEventTouchBegin:
+            return @&quot;WebEventTouchBegin&quot;;
+        case WebEventTouchChange:
+            return @&quot;WebEventTouchChange&quot;;
+        case WebEventTouchEnd:
+            return @&quot;WebEventTouchEnd&quot;;
+        case WebEventTouchCancel:
+            return @&quot;WebEventTouchCancel&quot;;
+        default:
+            ASSERT_NOT_REACHED();
+    }
+    return @&quot;Unknown&quot;;
+}
+
+- (NSString *)_modiferFlagsDescription
+{
+    switch (_modifierFlags) {
+        case WebEventMouseDown:
+            return @&quot;WebEventMouseDown&quot;;
+        case WebEventMouseUp:
+            return @&quot;WebEventMouseUp&quot;;
+        case WebEventMouseMoved:
+            return @&quot;WebEventMouseMoved&quot;;
+        case WebEventScrollWheel:
+            return @&quot;WebEventScrollWheel&quot;;
+        case WebEventKeyDown:
+            return @&quot;WebEventKeyDown&quot;;
+        case WebEventKeyUp:
+            return @&quot;WebEventKeyUp&quot;;
+        case WebEventTouchBegin:
+            return @&quot;WebEventTouchBegin&quot;;
+        case WebEventTouchChange:
+            return @&quot;WebEventTouchChange&quot;;
+        case WebEventTouchEnd:
+            return @&quot;WebEventTouchEnd&quot;;
+        case WebEventTouchCancel:
+            return @&quot;WebEventTouchCancel&quot;;
+        default:
+            ASSERT_NOT_REACHED();
+    }
+    return @&quot;Unknown&quot;;
+}
+
+- (NSString *)_characterSetDescription
+{
+    switch (_characterSet) {
+        case WebEventCharacterSetASCII:
+            return @&quot;WebEventCharacterSetASCII&quot;;
+        case WebEventCharacterSetSymbol:
+            return @&quot;WebEventCharacterSetSymbol&quot;;
+        case WebEventCharacterSetDingbats:
+            return @&quot;WebEventCharacterSetDingbats&quot;;
+        case WebEventCharacterSetUnicode:
+            return @&quot;WebEventCharacterSetUnicode&quot;;
+        case WebEventCharacterSetFunctionKeys:
+            return @&quot;WebEventCharacterSetFunctionKeys&quot;;
+        default:
+            ASSERT_NOT_REACHED();
+    }
+    return @&quot;Unknown&quot;;
+}
+
+- (NSString *)_touchLocationsDescription:(NSArray *)locations
+{
+    BOOL shouldAddComma = NO;
+    NSMutableString *description = [NSMutableString string];
+    for (NSValue *value in locations) {
+        CGPoint point = [value pointValue];
+        [description appendFormat:@&quot;%@(%f, %f)&quot;, (shouldAddComma ? @&quot;, &quot; : @&quot;&quot;), point.x, point.y];
+        shouldAddComma = YES;
+    }
+    return description;
+}
+
+- (NSString *)_touchIdentifiersDescription
+{
+    BOOL shouldAddComma = NO;
+    NSMutableString *description = [NSMutableString string];
+    for (NSNumber *identifier in _touchIdentifiers) {
+        [description appendFormat:@&quot;%@%u&quot;, (shouldAddComma ? @&quot;, &quot; : @&quot;&quot;), [identifier unsignedIntValue]];
+        shouldAddComma = YES;
+    }
+    return description;
+}
+
+- (NSString *)_touchPhaseDescription:(WebEventTouchPhaseType)phase
+{
+    switch (phase) {
+        case WebEventTouchPhaseBegan:
+            return @&quot;WebEventTouchPhaseBegan&quot;;
+        case WebEventTouchPhaseMoved:
+            return @&quot;WebEventTouchPhaseMoved&quot;;
+        case WebEventTouchPhaseStationary:
+            return @&quot;WebEventTouchPhaseStationary&quot;;
+        case WebEventTouchPhaseEnded:
+            return @&quot;WebEventTouchPhaseEnded&quot;;
+        case WebEventTouchPhaseCancelled:
+            return @&quot;WebEventTouchPhaseCancelled&quot;;
+        default:
+            ASSERT_NOT_REACHED();
+    }
+    return @&quot;Unknown&quot;;
+}
+
+- (NSString *)_touchPhasesDescription
+{
+    BOOL shouldAddComma = NO;
+    NSMutableString *description = [NSMutableString string];
+    for (NSNumber *phase in _touchPhases) {
+        [description appendFormat:@&quot;%@%@&quot;, (shouldAddComma ? @&quot;, &quot; : @&quot;&quot;), [self _touchPhaseDescription:static_cast&lt;WebEventTouchPhaseType&gt;([phase unsignedIntValue])]];
+        shouldAddComma = YES;
+    }
+    return description;
+}
+
+- (NSString *)_eventDescription
+{
+    switch (_type) {
+        case WebEventMouseDown:
+        case WebEventMouseUp:
+        case WebEventMouseMoved:
+            return [NSString stringWithFormat:@&quot;location: (%f, %f)&quot;, _locationInWindow.x, _locationInWindow.y];
+        case WebEventScrollWheel:
+            return [NSString stringWithFormat:@&quot;location: (%f, %f) deltaX: %f deltaY: %f&quot;, _locationInWindow.x, _locationInWindow.y, _deltaX, _deltaY];
+        case WebEventKeyDown:
+        case WebEventKeyUp:
+            return [NSString stringWithFormat:@&quot;chars: %@ charsNoModifiers: %@ flags: %d repeating: %d keyboardFlags: %lu keyCode %d, isTab: %d charSet: %@&quot;, _characters, _charactersIgnoringModifiers, _modifierFlags, _keyRepeating, static_cast&lt;unsigned long&gt;(_keyboardFlags), _keyCode, _tabKey, [self _characterSetDescription]];
+        case WebEventTouchBegin:
+        case WebEventTouchChange:
+        case WebEventTouchEnd:
+        case WebEventTouchCancel:
+            return [NSString stringWithFormat:@&quot;location: (%f, %f) count: %d locations: %@ identifiers: %@ phases: %@ isGesture: %d scale: %f rotation: %f&quot;, _locationInWindow.x, _locationInWindow.y, _touchCount, [self _touchLocationsDescription:_touchLocations], [self _touchIdentifiersDescription], [self _touchPhasesDescription], (_isGesture ? 1 : 0), _gestureScale, _gestureRotation];
+        default:
+            ASSERT_NOT_REACHED();
+    }
+    return @&quot;Unknown&quot;;
+}
+
+- (NSString *)description
+{
+    return [NSString stringWithFormat:@&quot;%@ type: %@ - %@&quot;, [super description], [self _typeDescription], [self _eventDescription]];
+}
+
+- (CGPoint)locationInWindow
+{
+    ASSERT_WITH_MESSAGE(_type == WebEventMouseDown || _type == WebEventMouseUp || _type == WebEventMouseMoved || _type == WebEventScrollWheel
+                        // FIXME: &lt;rdar://problem/7185284&gt; TouchEvents may be in more than one window some day.
+                        || _type == WebEventTouchBegin || _type == WebEventTouchChange || _type == WebEventTouchEnd || _type == WebEventTouchCancel
+                        , &quot;WebEventType: %d&quot;, _type);
+    return _locationInWindow;
+}
+
+- (NSString *)characters
+{
+    ASSERT(_type == WebEventKeyDown || _type == WebEventKeyUp);
+    return [[_characters retain] autorelease];
+}
+
+- (NSString *)charactersIgnoringModifiers
+{
+    ASSERT(_type == WebEventKeyDown || _type == WebEventKeyUp);
+    return [[_charactersIgnoringModifiers retain] autorelease];
+}
+
+- (WebEventFlags)modifierFlags
+{
+    return _modifierFlags;
+}
+
+- (BOOL)isKeyRepeating
+{
+    ASSERT(_type == WebEventKeyDown || _type == WebEventKeyUp);
+    return _keyRepeating;
+}
+
+// FIXME: to be removed
+- (BOOL)isPopupVariant
+{
+    ASSERT(_type == WebEventKeyDown || _type == WebEventKeyUp);
+    return _popupVariant;
+}
+
+- (NSUInteger)keyboardFlags
+{
+    ASSERT(_type == WebEventKeyDown || _type == WebEventKeyUp);
+    return _keyboardFlags;
+}
+
+- (uint16_t)keyCode
+{
+    ASSERT(_type == WebEventKeyDown || _type == WebEventKeyUp);
+    return _keyCode;
+}
+
+- (BOOL)isTabKey
+{
+    ASSERT(_type == WebEventKeyDown || _type == WebEventKeyUp);
+    return _tabKey;
+}
+
+- (WebEventCharacterSet)characterSet
+{
+    ASSERT(_type == WebEventKeyDown || _type == WebEventKeyUp);
+    return _characterSet;
+}
+
+- (float)deltaX
+{
+    ASSERT(_type == WebEventScrollWheel);
+    return _deltaX;
+}
+
+- (float)deltaY
+{
+    ASSERT(_type == WebEventScrollWheel);
+    return _deltaY;
+}
+
+// Touch
+- (unsigned)touchCount
+{
+    ASSERT(_type == WebEventTouchBegin || _type == WebEventTouchChange || _type == WebEventTouchEnd || _type == WebEventTouchCancel);
+    return _touchCount;
+}
+
+- (NSArray *)touchLocations
+{
+    ASSERT(_type == WebEventTouchBegin || _type == WebEventTouchChange || _type == WebEventTouchEnd || _type == WebEventTouchCancel);
+    return _touchLocations;
+}
+
+- (NSArray *)touchIdentifiers
+{
+    ASSERT(_type == WebEventTouchBegin || _type == WebEventTouchChange || _type == WebEventTouchEnd || _type == WebEventTouchCancel);
+    return _touchIdentifiers;
+}
+
+- (NSArray *)touchPhases
+{
+    ASSERT(_type == WebEventTouchBegin || _type == WebEventTouchChange || _type == WebEventTouchEnd || _type == WebEventTouchCancel);
+    return _touchPhases;
+}
+
+// Gesture
+- (BOOL)isGesture
+{
+    ASSERT(_type == WebEventTouchBegin || _type == WebEventTouchChange || _type == WebEventTouchEnd || _type == WebEventTouchCancel);
+    return _isGesture;
+}
+
+- (float)gestureScale
+{
+    ASSERT(_type == WebEventTouchBegin || _type == WebEventTouchChange || _type == WebEventTouchEnd || _type == WebEventTouchCancel);
+    return _gestureScale;
+}
+
+- (float)gestureRotation
+{
+    ASSERT(_type == WebEventTouchBegin || _type == WebEventTouchChange || _type == WebEventTouchEnd || _type == WebEventTouchCancel);
+    return _gestureRotation;
+}
+
+@end
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformiosWidgetIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/ios/WidgetIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/WidgetIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/ios/WidgetIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,277 @@
</span><ins>+/*
+ * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;config.h&quot;
+#import &quot;Widget.h&quot;
+
+#import &quot;BlockExceptions.h&quot;
+#import &quot;Cursor.h&quot;
+#import &quot;Document.h&quot;
+#import &quot;Font.h&quot;
+#import &quot;Frame.h&quot;
+#import &quot;GraphicsContext.h&quot;
+#import &quot;Page.h&quot;
+#import &quot;PlatformMouseEvent.h&quot;
+#import &quot;ScrollView.h&quot;
+#import &quot;WAKScrollView.h&quot;
+#import &quot;WAKView.h&quot;
+#import &quot;WAKWindow.h&quot;
+#import &quot;WebCoreFrameView.h&quot;
+#import &quot;WebCoreView.h&quot;
+#import &lt;wtf/RetainPtr.h&gt;
+
+@interface NSView (WebSetSelectedMethods)
+- (void)setIsSelected:(BOOL)isSelected;
+- (void)webPlugInSetIsSelected:(BOOL)isSelected;
+@end
+
+namespace WebCore {
+
+static void safeRemoveFromSuperview(NSView *view)
+{
+    // FIXME: we should probably change the first responder of the window if
+    // it is a descendant of the view we remove.
+    // See: &lt;rdar://problem/10360186&gt;
+    [view removeFromSuperview];
+}
+
+Widget::Widget(NSView* view)
+{
+    init(view);
+}
+
+Widget::~Widget() 
+{
+    releasePlatformWidget();
+}
+
+// FIXME: Should move this to Chrome; bad layering that this knows about Frame.
+void Widget::setFocus(bool focused)
+{
+    UNUSED_PARAM(focused);
+}
+
+void Widget::setCursor(const Cursor&amp;)
+{
+}
+
+void Widget::show()
+{
+    if (isSelfVisible())
+        return;
+
+    setSelfVisible(true);
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [getOuterView() setHidden:NO];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void Widget::hide()
+{
+    if (!isSelfVisible())
+        return;
+
+    setSelfVisible(false);
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [getOuterView() setHidden:YES];
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+IntRect Widget::frameRect() const
+{
+    if (!platformWidget())
+        return m_frame;
+    
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    return enclosingIntRect([getOuterView() frame]);
+    END_BLOCK_OBJC_EXCEPTIONS;
+    
+    return m_frame;
+}
+
+void Widget::setFrameRect(const IntRect &amp;rect)
+{
+    m_frame = rect;
+    
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    NSView *v = getOuterView();
+    NSRect f = rect;
+    if (!NSEqualRects(f, [v frame])) {
+        [v setFrame:f];
+        [v setNeedsDisplay: NO];
+    }
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+NSView* Widget::getOuterView() const
+{
+    NSView* view = platformWidget();
+
+    // If this widget's view is a WebCoreFrameScrollView then we
+    // resize its containing view, a WebFrameView.
+    if ([view conformsToProtocol:@protocol(WebCoreFrameScrollView)]) {
+        view = [view superview];
+        ASSERT(view);
+    }
+
+    return view;
+}
+
+void Widget::paint(GraphicsContext* p, const IntRect&amp; r)
+{
+    if (p-&gt;paintingDisabled())
+        return;
+    
+    NSView *view = getOuterView();
+
+    CGContextRef cgContext = p-&gt;platformContext();
+    CGContextSaveGState(cgContext);
+
+    NSRect viewFrame = [view frame];
+    NSRect viewBounds = [view bounds];
+    CGContextTranslateCTM(cgContext, viewFrame.origin.x - viewBounds.origin.x, viewFrame.origin.y - viewBounds.origin.y);
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    [view displayRectIgnoringOpacity:[view convertRect:r fromView:[view superview]] inContext:cgContext];
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    CGContextRestoreGState(cgContext);
+}
+
+void Widget::setIsSelected(bool /*isSelected*/)
+{
+}
+
+void Widget::addToSuperview(NSView *view)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+    ASSERT(view);
+    NSView *subview = getOuterView();
+
+    if (!subview)
+        return;
+
+    ASSERT(![view isDescendantOf:subview]);
+    
+    if ([subview superview] != view)
+        [view addSubview:subview];
+
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+void Widget::removeFromSuperview()
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    safeRemoveFromSuperview(getOuterView());
+    END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+IntRect Widget::convertFromRootToContainingWindow(const Widget* rootWidget, const IntRect&amp; rect)
+{
+    if (!rootWidget-&gt;platformWidget())
+        return rect;
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    ASSERT([rootWidget-&gt;platformWidget() isKindOfClass:[NSScrollView class]]);
+    WAKScrollView *view = static_cast&lt;WAKScrollView *&gt;(rootWidget-&gt;platformWidget());
+    if (WAKView *documentView = [view documentView])
+        return enclosingIntRect([documentView convertRect:rect toView:nil]);
+    return enclosingIntRect([view convertRect:rect toView:nil]);
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return rect;
+}
+
+IntRect Widget::convertFromContainingWindowToRoot(const Widget* rootWidget, const IntRect&amp; rect)
+{
+    if (!rootWidget-&gt;platformWidget())
+        return rect;
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    ASSERT([rootWidget-&gt;platformWidget() isKindOfClass:[NSScrollView class]]);
+    WAKScrollView *view = static_cast&lt;WAKScrollView *&gt;(rootWidget-&gt;platformWidget());
+    if (WAKView *documentView = [view documentView])
+        return enclosingIntRect([documentView convertRect:rect fromView:nil]);
+    return enclosingIntRect([view convertRect:rect fromView:nil]);
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return rect;
+}
+
+IntPoint Widget::convertFromRootToContainingWindow(const Widget* rootWidget, const IntPoint&amp; point)
+{
+    if (!rootWidget-&gt;platformWidget())
+        return point;
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    ASSERT([rootWidget-&gt;platformWidget() isKindOfClass:[NSScrollView class]]);
+    WAKScrollView *view = static_cast&lt;WAKScrollView *&gt;(rootWidget-&gt;platformWidget());
+    NSPoint convertedPoint;
+    if (WAKView *documentView = [view documentView])
+        convertedPoint = [documentView convertPoint:point toView:nil];
+    else
+        convertedPoint = [view convertPoint:point toView:nil];
+    return IntPoint(roundf(convertedPoint.x), roundf(convertedPoint.y));
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return point;
+}
+
+IntPoint Widget::convertFromContainingWindowToRoot(const Widget* rootWidget, const IntPoint&amp; point)
+{
+    if (!rootWidget-&gt;platformWidget())
+        return point;
+
+    BEGIN_BLOCK_OBJC_EXCEPTIONS;
+    ASSERT([rootWidget-&gt;platformWidget() isKindOfClass:[NSScrollView class]]);
+    WAKScrollView *view = static_cast&lt;WAKScrollView *&gt;(rootWidget-&gt;platformWidget());
+    NSPoint convertedPoint;
+    if (WAKView *documentView = [view documentView])
+        convertedPoint = IntPoint([documentView convertPoint:point fromView:nil]);
+    else
+        convertedPoint = IntPoint([view convertPoint:point fromView:nil]);
+    return IntPoint(roundf(convertedPoint.x), roundf(convertedPoint.y));
+    END_BLOCK_OBJC_EXCEPTIONS;
+
+    return point;
+}
+
+NSView *Widget::platformWidget() const
+{
+    return m_widget.get();
+}
+
+void Widget::setPlatformWidget(NSView *widget)
+{
+    if (widget == m_widget)
+        return;
+
+    m_widget = widget;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacDisplaySleepDisablercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;DisplaySleepDisabler.h&quot;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> #include &lt;IOKit/pwr_mgt/IOPMLib.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -54,3 +56,12 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span><ins>+
+#else
+
+namespace WebCore {
+DisplaySleepDisabler::DisplaySleepDisabler(const char *) { }
+DisplaySleepDisabler::~DisplaySleepDisabler() { }
+}
+
+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacDisplaySleepDisablerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/DisplaySleepDisabler.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -40,7 +40,9 @@
</span><span class="cx"> private:
</span><span class="cx">     DisplaySleepDisabler(const char* reason);
</span><span class="cx">     
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     uint32_t m_disableDisplaySleepAssertion;
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacFileSystemMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/FileSystemMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/FileSystemMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/FileSystemMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -67,6 +67,8 @@
</span><span class="cx">     return String::fromUTF8(temporaryFilePath.data());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> void setMetadataURL(String&amp; URLString, const String&amp; referrer, const String&amp; path)
</span><span class="cx"> {
</span><span class="cx">     NSURL *URL = URLWithUserTypedString(URLString, nil);
</span><span class="lines">@@ -82,7 +84,6 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
</del><span class="cx"> bool canExcludeFromBackup()
</span><span class="cx"> {
</span><span class="cx">     return true;
</span><span class="lines">@@ -94,6 +95,7 @@
</span><span class="cx">     CSBackupSetItemExcluded(pathAsURL(path).get(), TRUE, FALSE); 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacKillRingMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/KillRingMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/KillRingMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/KillRingMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -81,3 +81,4 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><ins>+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacMemoryPressureHandlerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), ^{
</span><del>-#if MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</ins><span class="cx">         _cache_event_source = wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue();
</span><span class="cx"> #else
</span><span class="cx">         _cache_event_source = wkCreateVMPressureDispatchOnMainQueue();
</span><span class="lines">@@ -158,7 +158,9 @@
</span><span class="cx"> 
</span><span class="cx">     memoryCache()-&gt;pruneToPercentage(0);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     LayerPool::sharedPool()-&gt;drain();
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     cssValuePool().drain();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPlatformClockCMmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PlatformClockCM.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformClockCM.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/PlatformClockCM.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -31,11 +31,19 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;MediaTimeMac.h&quot;
</span><span class="cx"> #import &quot;SoftLinking.h&quot;
</span><ins>+#if PLATFORM(IOS)
+#import &lt;CoreMedia/CMAudioClock.h&gt;
+#else
</ins><span class="cx"> #import &lt;CoreMedia/CMAudioDeviceClock.h&gt;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> SOFT_LINK_FRAMEWORK_OPTIONAL(CoreMedia)
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+SOFT_LINK(CoreMedia, CMAudioClockCreate, OSStatus, (CFAllocatorRef allocator, CMClockRef *clockOut), (allocator, clockOut))
+#else
</ins><span class="cx"> SOFT_LINK(CoreMedia, CMAudioDeviceClockCreate, OSStatus, (CFAllocatorRef allocator, CFStringRef deviceUID, CMClockRef *clockOut), (allocator, deviceUID, clockOut))
</span><ins>+#endif
</ins><span class="cx"> SOFT_LINK(CoreMedia, CMTimebaseCreateWithMasterClock, OSStatus, (CFAllocatorRef allocator, CMClockRef masterClock, CMTimebaseRef *timebaseOut), (allocator, masterClock, timebaseOut))
</span><span class="cx"> SOFT_LINK(CoreMedia, CMTimebaseSetTime, OSStatus, (CMTimebaseRef timebase, CMTime time), (timebase, time))
</span><span class="cx"> SOFT_LINK(CoreMedia, CMTimebaseGetTime, CMTime, (CMTimebaseRef timebase), (timebase))
</span><span class="lines">@@ -54,7 +62,11 @@
</span><span class="cx">     , m_running(false)
</span><span class="cx"> {
</span><span class="cx">     CMClockRef rawClockPtr = 0;
</span><ins>+#if PLATFORM(IOS)
+    CMAudioClockCreate(kCFAllocatorDefault, &amp;rawClockPtr);
+#else
</ins><span class="cx">     CMAudioDeviceClockCreate(kCFAllocatorDefault, NULL, &amp;rawClockPtr);
</span><ins>+#endif
</ins><span class="cx">     RetainPtr&lt;CMClockRef&gt; clock = adoptCF(rawClockPtr);
</span><span class="cx">     initializeWithTimingSource(clock.get());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacSoftLinkingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/SoftLinking.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/SoftLinking.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/SoftLinking.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -29,6 +29,10 @@
</span><span class="cx"> #import &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #import &lt;dlfcn.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &lt;objc/runtime.h&gt;
+#endif
+
</ins><span class="cx"> #define SOFT_LINK_LIBRARY(lib) \
</span><span class="cx">     static void* lib##Library() \
</span><span class="cx">     { \
</span><span class="lines">@@ -62,6 +66,15 @@
</span><span class="cx">         return frameworkLibrary; \
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#define SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(framework) \
+    static void* framework##Library() \
+    { \
+        static void* frameworkLibrary = dlopen(&quot;/System/Library/PrivateFrameworks/&quot; #framework &quot;.framework/&quot; #framework, RTLD_NOW); \
+        return frameworkLibrary; \
+    }
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> #define SOFT_LINK_STAGED_FRAMEWORK(framework, unstagedLocation, version) \
</span><span class="cx">     static void* framework##Library() \
</span><span class="cx">     { \
</span><span class="lines">@@ -99,6 +112,30 @@
</span><span class="cx">         return softLink##functionName parameterNames; \
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#define SOFT_LINK_MAY_FAIL(framework, functionName, resultType, parameterDeclarations, parameterNames) \
+    static resultType (*softLink##functionName) parameterDeclarations = 0; \
+    \
+    static bool init##functionName() \
+    { \
+        ASSERT(!softLink##functionName); \
+        softLink##functionName = (resultType (*) parameterDeclarations) dlsym(framework##Library(), #functionName); \
+        return !!softLink##functionName; \
+    } \
+    \
+    static bool canLoad##functionName() \
+    { \
+        static bool loaded = init##functionName(); \
+        return loaded; \
+    } \
+    \
+    resultType functionName parameterDeclarations \
+    { \
+        ASSERT(softLink##functionName); \
+        return softLink##functionName parameterNames; \
+    }
+#endif
+
</ins><span class="cx"> /* callingConvention is unused on Mac but is here to keep the macro prototype the same between Mac and Windows. */
</span><span class="cx"> #define SOFT_LINK_OPTIONAL(framework, functionName, resultType, callingConvention, parameterDeclarations) \
</span><span class="cx">     typedef resultType (*functionName##PtrType) parameterDeclarations; \
</span><span class="lines">@@ -202,3 +239,32 @@
</span><span class="cx">         get##name = name##Function; \
</span><span class="cx">         return constant##name; \
</span><span class="cx">     }
</span><ins>+
+#if PLATFORM(IOS)
+#define SOFT_LINK_CONSTANT_MAY_FAIL(framework, name, type) \
+    static bool init##name(); \
+    static type (*get##name)() = 0; \
+    static type constant##name; \
+    \
+    static type name##Function() \
+    { \
+        return constant##name; \
+    }\
+    \
+    static bool canLoad##name() \
+    { \
+        static bool loaded = init##name(); \
+        return loaded; \
+    } \
+    \
+    static bool init##name() \
+    { \
+        ASSERT(!get##name); \
+        void* constant = dlsym(framework##Library(), #name); \
+        if (!constant) \
+            return false; \
+        constant##name = *static_cast&lt;type*&gt;(constant); \
+        get##name = name##Function; \
+        return true; \
+    }
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacSystemVersionMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/SystemVersionMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/SystemVersionMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/SystemVersionMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</span><span class="cx"> 
</span><span class="cx"> static NSString *createSystemMarketingVersion()
</span><span class="lines">@@ -64,11 +65,15 @@
</span><span class="cx"> 
</span><span class="cx"> #endif // __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> NSString *systemMarketingVersion()
</span><span class="cx"> {
</span><span class="cx">     static NSString *version = createSystemMarketingVersion();
</span><span class="cx">     return version;
</span><span class="cx"> }
</span><ins>+#else
</ins><span class="cx"> 
</span><span class="cx"> }
</span><ins>+
+#endif // !PLATFORM(IOS)
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreFullScreenPlaceholderViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreFullScreenPlaceholderView.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreFullScreenPlaceholderView.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/WebCoreFullScreenPlaceholderView.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -23,6 +23,8 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> #ifndef WebCoreFullScreenPlaceholderView_h
</span><span class="cx"> #define WebCoreFullScreenPlaceholderView_h
</span><span class="cx"> 
</span><span class="lines">@@ -40,3 +42,5 @@
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif // WebCoreFullScreenPlaceholderView_h
</span><ins>+
+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreFullScreenPlaceholderViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreFullScreenPlaceholderView.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreFullScreenPlaceholderView.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/WebCoreFullScreenPlaceholderView.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -24,6 +24,8 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> #include &quot;WebCoreFullScreenPlaceholderView.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;LocalizedStrings.h&quot;
</span><span class="lines">@@ -93,3 +95,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span><ins>+
+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreFullScreenWarningViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -23,6 +23,8 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> #ifndef WebCoreFullScreenWarningView_h
</span><span class="cx"> #define WebCoreFullScreenWarningView_h
</span><span class="cx"> 
</span><span class="lines">@@ -39,3 +41,5 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #endif // WebCoreFullScreenWarningView_h
</span><ins>+
+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreFullScreenWarningViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/WebCoreFullScreenWarningView.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -24,6 +24,8 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> #include &quot;WebCoreFullScreenWarningView.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;LocalizedStrings.h&quot;
</span><span class="lines">@@ -103,3 +105,5 @@
</span><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> @end
</span><ins>+
+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreFullScreenWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreFullScreenWindow.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreFullScreenWindow.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/WebCoreFullScreenWindow.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #ifndef WebCoreFullScreenWindow_h
</span><span class="cx"> #define WebCoreFullScreenWindow_h
</span><span class="cx"> 
</span><del>-#if ENABLE(FULLSCREEN_API)
</del><ins>+#if ENABLE(FULLSCREEN_API) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> @interface WebCoreFullScreenWindow : NSWindow
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreFullScreenWindowmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreFullScreenWindow.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreFullScreenWindow.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/WebCoreFullScreenWindow.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> 
</span><del>-#if ENABLE(FULLSCREEN_API)
</del><ins>+#if ENABLE(FULLSCREEN_API) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #import &quot;WebCoreFullScreenWindow.h&quot;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreNSCellExtrash"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreNSCellExtras.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreNSCellExtras.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/WebCoreNSCellExtras.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -23,8 +23,12 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #import &lt;AppKit/AppKit.h&gt;
</span><span class="cx"> 
</span><span class="cx"> @interface NSCell (WebCoreFocusRingDrawing)
</span><span class="cx"> - (void)_web_drawFocusRingWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
</span><span class="cx"> @end
</span><ins>+
+#endif // !PLATFORM(IOS)
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreNSCellExtrasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreNSCellExtras.m (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreNSCellExtras.m        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/WebCoreNSCellExtras.m        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;WebCoreNSCellExtras.h&quot;
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> @implementation NSCell (WebCoreFocusRingDrawing)
</span><span class="cx"> 
</span><span class="cx"> - (void)_web_drawFocusRingWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
</span><span class="lines">@@ -40,3 +42,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span><ins>+
+#endif // !PLATFORM(IOS)
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreSystemInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,6 +28,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;objc/objc.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreSystemInterfaceIOS.h&quot;
+#endif
+
</ins><span class="cx"> typedef const struct __CFString * CFStringRef;
</span><span class="cx"> typedef const struct __CFNumber * CFNumberRef;
</span><span class="cx"> typedef const struct __CFDictionary * CFDictionaryRef;
</span><span class="lines">@@ -53,16 +57,21 @@
</span><span class="cx"> typedef const struct __CTRun * CTRunRef;
</span><span class="cx"> typedef const struct __CTTypesetter * CTTypesetterRef;
</span><span class="cx"> typedef const struct __AXUIElement *AXUIElementRef;
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> typedef struct _NSRange NSRange;
</span><span class="cx"> 
</span><span class="cx"> typedef UInt32 FMFont;
</span><span class="cx"> typedef FMFont ATSUFontID;
</span><span class="cx"> typedef UInt16 ATSGlyphRef;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; USE(CA)
</span><ins>+#if !PLATFORM(IOS_SIMULATOR)
</ins><span class="cx"> typedef struct __IOSurface *IOSurfaceRef;
</span><ins>+#endif // !PLATFORM(IOS_SIMULATOR)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
</span><span class="cx"> typedef struct CGPoint NSPoint;
</span><span class="cx"> typedef struct CGRect NSRect;
</span><span class="lines">@@ -70,7 +79,12 @@
</span><span class="cx"> typedef struct _NSPoint NSPoint;
</span><span class="cx"> typedef struct _NSRect NSRect;
</span><span class="cx"> #endif
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;CoreGraphics/CoreGraphics.h&gt;
+#endif
+
</ins><span class="cx"> #if USE(CFNETWORK)
</span><span class="cx"> typedef struct OpaqueCFHTTPCookieStorage*  CFHTTPCookieStorageRef;
</span><span class="cx"> typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
</span><span class="lines">@@ -119,7 +133,7 @@
</span><span class="cx">     wkPatternTilingConstantSpacing
</span><span class="cx"> } wkPatternTiling;
</span><span class="cx"> extern void (*wkCGContextResetClip)(CGContextRef);
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</ins><span class="cx"> extern bool (*wkCGContextDrawsWithCorrectShadowOffsets)(CGContextRef);
</span><span class="cx"> #endif
</span><span class="cx"> extern CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int);
</span><span class="lines">@@ -135,6 +149,7 @@
</span><span class="cx"> extern CFStringRef (*wkCopyCFLocalizationPreferredName)(CFStringRef);
</span><span class="cx"> extern NSString* (*wkCopyNSURLResponseStatusLine)(NSURLResponse*);
</span><span class="cx"> extern CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> extern void (*wkDrawBezeledTextFieldCell)(NSRect, BOOL enabled);
</span><span class="cx"> extern void (*wkDrawTextFieldCellFocusRing)(NSTextFieldCell*, NSRect);
</span><span class="cx"> extern void (*wkDrawCapsLockIndicator)(CGContextRef, CGRect);
</span><span class="lines">@@ -143,16 +158,22 @@
</span><span class="cx"> extern NSFont* (*wkGetFontInLanguageForRange)(NSFont*, NSString*, NSRange);
</span><span class="cx"> extern NSFont* (*wkGetFontInLanguageForCharacter)(NSFont*, UniChar);
</span><span class="cx"> extern BOOL (*wkGetGlyphTransformedAdvances)(CGFontRef, NSFont*, CGAffineTransform*, ATSGlyphRef*, CGSize* advance);
</span><ins>+#endif
+#if !PLATFORM(IOS)
</ins><span class="cx"> extern void (*wkDrawMediaSliderTrack)(CGContextRef context, CGRect rect, float timeLoaded, float currentTime,
</span><span class="cx">     float duration, unsigned state);
</span><span class="cx"> extern void (*wkDrawMediaUIPart)(int part, CGContextRef context, CGRect rect, unsigned state);
</span><span class="cx"> extern CFStringRef (*wkSignedPublicKeyAndChallengeString)(unsigned keySize, CFStringRef challenge, CFStringRef keyDescription);
</span><span class="cx"> extern NSString* (*wkGetPreferredExtensionForMIMEType)(NSString*);
</span><span class="cx"> extern NSArray* (*wkGetExtensionsForMIMEType)(NSString*);
</span><ins>+#endif
</ins><span class="cx"> extern NSString* (*wkGetMIMETypeForExtension)(NSString*);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> extern ATSUFontID (*wkGetNSFontATSUFontId)(NSFont*);
</span><span class="cx"> extern double (*wkGetNSURLResponseCalculatedExpiration)(NSURLResponse *response);
</span><ins>+#endif
</ins><span class="cx"> extern NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> extern BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
</span><span class="cx"> extern void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
</span><span class="cx"> extern UInt8 (*wkGetNSEventKeyChar)(NSEvent *);
</span><span class="lines">@@ -191,7 +212,9 @@
</span><span class="cx"> extern void (*wkQTClearMediaDownloadCacheForSite)(NSString *site);
</span><span class="cx"> extern void (*wkQTClearMediaDownloadCache)();
</span><span class="cx"> extern void (*wkSetCGFontRenderingMode)(CGContextRef, NSFont*, BOOL);
</span><ins>+extern void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
</ins><span class="cx"> extern void (*wkSetDragImage)(NSImage*, NSPoint offset);
</span><ins>+#endif
</ins><span class="cx"> extern void (*wkSetNSURLConnectionDefersCallbacks)(NSURLConnection *, BOOL);
</span><span class="cx"> extern void (*wkSetNSURLRequestShouldContentSniff)(NSMutableURLRequest *, BOOL);
</span><span class="cx"> extern void (*wkSetBaseCTM)(CGContextRef, CGAffineTransform);
</span><span class="lines">@@ -216,11 +239,13 @@
</span><span class="cx"> 
</span><span class="cx"> extern BOOL (*wkUseSharedMediaUI)();
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> extern void* wkGetHyphenationLocationBeforeIndex;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> extern CTLineRef (*wkCreateCTLineWithUniCharProvider)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*);
</span><span class="cx"> 
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</del><ins>+#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</ins><span class="cx"> enum {
</span><span class="cx">     wkCTFontTransformApplyShaping = (1 &lt;&lt; 0),
</span><span class="cx">     wkCTFontTransformApplyPositioning = (1 &lt;&lt; 1)
</span><span class="lines">@@ -235,11 +260,12 @@
</span><span class="cx"> 
</span><span class="cx"> extern CGSize (*wkCTRunGetInitialAdvance)(CTRunRef);
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC) &amp;&amp; USE(CA)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; USE(CA) &amp;&amp; !PLATFORM(IOS_SIMULATOR)
</ins><span class="cx"> extern CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
</span><span class="cx"> extern CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> extern int (*wkRecommendedScrollerStyle)(void);
</span><span class="cx"> 
</span><span class="cx"> extern bool (*wkExecutableWasLinkedOnOrBeforeSnowLeopard)(void);
</span><span class="lines">@@ -250,7 +276,9 @@
</span><span class="cx"> extern NSURL *(*wkAVAssetResolvedURL)(AVAsset*);
</span><span class="cx"> 
</span><span class="cx"> extern NSCursor *(*wkCursor)(const char*);
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx">     
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> extern NSArray *(*wkSpeechSynthesisGetVoiceIdentifiers)(void);
</span><span class="cx"> extern NSString *(*wkSpeechSynthesisGetDefaultVoiceIdentifierForLocale)(NSLocale *);
</span><span class="lines">@@ -266,7 +294,14 @@
</span><span class="cx"> extern CFTypeRef (*wkCreateAXTextMarker)(const void *bytes, size_t len);
</span><span class="cx"> extern BOOL (*wkGetBytesFromAXTextMarker)(CFTypeRef textMarker, void *bytes, size_t length);
</span><span class="cx"> extern AXUIElementRef (*wkCreateAXUIElementRef)(id element);
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+extern CGSize (*wkGetViewportScreenSize)(void);
+extern void (*wkSetLayerContentsScale)(CALayer *);
+extern float (*wkGetScreenScaleFactor)(void);
+#endif
+
</ins><span class="cx"> typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
</span><span class="cx"> extern CFURLStorageSessionRef (*wkCreatePrivateStorageSession)(CFStringRef);
</span><span class="cx"> extern NSURLRequest* (*wkCopyRequestWithStorageSession)(CFURLStorageSessionRef, NSURLRequest*);
</span><span class="lines">@@ -297,17 +332,21 @@
</span><span class="cx"> extern void (*wkCFURLRequestSetHTTPRequestBodyParts)(CFMutableURLRequestRef, CFArrayRef bodyParts);
</span><span class="cx"> extern void (*wkSetRequestStorageSession)(CFURLStorageSessionRef, CFMutableURLRequestRef);
</span><span class="cx"> #endif
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> extern void (*wkSetMetadataURL)(NSString *urlString, NSString *referrer, NSString *path);
</span><ins>+#endif
</ins><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> #import &lt;dispatch/dispatch.h&gt;
</span><span class="cx"> 
</span><span class="cx"> extern dispatch_source_t (*wkCreateVMPressureDispatchOnMainQueue)(void);
</span><ins>+#endif
</ins><span class="cx"> 
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</ins><span class="cx"> extern dispatch_source_t (*wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue)(void);
</span><span class="cx"> #endif
</span><span class="cx">     
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</del><ins>+#if !PLATFORM(IOS) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1080
</ins><span class="cx"> extern bool (*wkExecutableWasLinkedOnOrBeforeLion)(void);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebFontCachemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebFontCache.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebFontCache.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/mac/WebFontCache.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -287,12 +287,10 @@
</span><span class="cx">     return [self internalFontWithFamily:desiredFamily traits:desiredTraits weight:desiredWeight size:size];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
</del><span class="cx"> + (NSFont *)fontWithFamily:(NSString *)desiredFamily traits:(NSFontTraitMask)desiredTraits size:(float)size
</span><span class="cx"> {
</span><span class="cx">     int desiredWeight = (desiredTraits &amp; NSBoldFontMask) ? 9 : 5;
</span><span class="cx">     return [self fontWithFamily:desiredFamily traits:desiredTraits weight:desiredWeight size:size];
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistry.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistry.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -33,6 +33,10 @@
</span><span class="cx"> #include &quot;PlatformStrategies.h&quot;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> BlobRegistry&amp; blobRegistry()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -43,6 +43,10 @@
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> BlobRegistryImpl::~BlobRegistryImpl()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkCredentialh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/Credential.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/Credential.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/Credential.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><del>-#define CERTIFICATE_CREDENTIALS_SUPPORTED PLATFORM(MAC)
</del><ins>+#define CERTIFICATE_CREDENTIALS_SUPPORTED (PLATFORM(IOS) || PLATFORM(MAC))
</ins><span class="cx"> 
</span><span class="cx"> #if CERTIFICATE_CREDENTIALS_SUPPORTED
</span><span class="cx"> #include &lt;Security/SecBase.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkCredentialStoragecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/CredentialStorage.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/CredentialStorage.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/CredentialStorage.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -36,6 +36,10 @@
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;WebCoreThread.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> typedef HashMap&lt;ProtectionSpace, Credential&gt; ProtectionSpaceToCredentialMap;
</span><span class="lines">@@ -93,6 +97,11 @@
</span><span class="cx">     ASSERT(protectionSpace.isProxy() || url.isValid());
</span><span class="cx"> 
</span><span class="cx">     protectionSpaceToCredentialMap().set(protectionSpace, credential);
</span><ins>+
+#if PLATFORM(IOS)
+    saveToPersistentStorage(protectionSpace, credential);
+#endif
+
</ins><span class="cx">     if (!protectionSpace.isProxy()) {
</span><span class="cx">         originsWithCredentials().add(originStringFromURL(url));
</span><span class="cx"> 
</span><span class="lines">@@ -163,6 +172,15 @@
</span><span class="cx">     return protectionSpaceToCredentialMap().get(iter-&gt;value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void CredentialStorage::clearCredentials()
+{
+    pathToDefaultProtectionSpaceMap().clear();
+    originsWithCredentials().clear();
+    protectionSpaceToCredentialMap().clear();
+}
+#endif
+
</ins><span class="cx"> void CredentialStorage::setPrivateMode(bool mode)
</span><span class="cx"> {
</span><span class="cx">     if (!mode)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkCredentialStorageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/CredentialStorage.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/CredentialStorage.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/CredentialStorage.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -42,6 +42,11 @@
</span><span class="cx">     // OS persistent storage.
</span><span class="cx">     static Credential getFromPersistentStorage(const ProtectionSpace&amp;);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    static void saveToPersistentStorage(const ProtectionSpace&amp;, const Credential&amp;);
+    static void clearCredentials();
+#endif
+
</ins><span class="cx">     // These methods work for authentication schemes that support sending credentials without waiting for a request. E.g., for HTTP Basic authentication scheme
</span><span class="cx">     // a client should assume that all paths at or deeper than the depth of a known protected resource share are within the same protection space.
</span><span class="cx">     static bool set(const Credential&amp;, const URL&amp;); // Returns true if the URL corresponds to a known protection space, so credentials could be updated.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkNetworkStateNotifierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/NetworkStateNotifier.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/NetworkStateNotifier.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/NetworkStateNotifier.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="lines">@@ -62,6 +62,10 @@
</span><span class="cx">     void addNetworkStateChangeListener(NetworkStateChangeListener);
</span><span class="cx"> 
</span><span class="cx">     bool onLine() const { return m_isOnLine; }
</span><ins>+    
+#if PLATFORM(IOS)
+    void setIsOnLine(bool);
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(BLACKBERRY)
</span><span class="cx">     void networkStateChange(bool online);
</span><span class="lines">@@ -74,7 +78,7 @@
</span><span class="cx">     void notifyNetworkStateChange();
</span><span class="cx">     void updateState();
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     void networkStateChangeTimerFired(Timer&lt;NetworkStateNotifier&gt;*);
</span><span class="cx"> 
</span><span class="cx">     static void dynamicStoreCallback(SCDynamicStoreRef, CFArrayRef changedKeys, void *info); 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -35,6 +35,10 @@
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;NotImplemented.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static bool shouldForceContentSniffing;
</span><span class="lines">@@ -42,7 +46,11 @@
</span><span class="cx"> typedef HashMap&lt;AtomicString, ResourceHandle::BuiltinConstructor&gt; BuiltinResourceHandleConstructorMap;
</span><span class="cx"> static BuiltinResourceHandleConstructorMap&amp; builtinResourceHandleConstructorMap()
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    ASSERT(WebThreadIsLockedOrDisabled());
+#else
</ins><span class="cx">     ASSERT(isMainThread());
</span><ins>+#endif
</ins><span class="cx">     DEFINE_STATIC_LOCAL(BuiltinResourceHandleConstructorMap, map, ());
</span><span class="cx">     return map;
</span><span class="cx"> }
</span><span class="lines">@@ -151,23 +159,23 @@
</span><span class="cx"> // ResourceHandle never uses async client calls on these platforms yet.
</span><span class="cx"> void ResourceHandle::continueWillSendRequest(const ResourceRequest&amp;)
</span><span class="cx"> {
</span><del>-    ASSERT_NOT_REACHED();
</del><ins>+    notImplemented();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceHandle::continueDidReceiveResponse()
</span><span class="cx"> {
</span><del>-    ASSERT_NOT_REACHED();
</del><ins>+    notImplemented();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceHandle::continueShouldUseCredentialStorage(bool)
</span><span class="cx"> {
</span><del>-    ASSERT_NOT_REACHED();
</del><ins>+    notImplemented();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
</span><span class="cx"> void ResourceHandle::continueCanAuthenticateAgainstProtectionSpace(bool)
</span><span class="cx"> {
</span><del>-    ASSERT_NOT_REACHED();
</del><ins>+    notImplemented();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceRequestBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -38,6 +38,10 @@
</span><span class="cx"> double ResourceRequestBase::s_defaultTimeoutInterval = 0;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool ResourceRequestBase::s_defaultAllowCookies = true;
+#endif
+
</ins><span class="cx"> inline const ResourceRequest&amp; ResourceRequestBase::asResourceRequest() const
</span><span class="cx"> {
</span><span class="cx">     return *static_cast&lt;const ResourceRequest*&gt;(this);
</span><span class="lines">@@ -528,4 +532,16 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void ResourceRequestBase::setDefaultAllowCookies(bool allowCookies)
+{
+    s_defaultAllowCookies = allowCookies;
</ins><span class="cx"> }
</span><ins>+
+bool ResourceRequestBase::defaultAllowCookies()
+{
+    return s_defaultAllowCookies;
+}
+#endif
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceRequestBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceRequestBase.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceRequestBase.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/ResourceRequestBase.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -142,6 +142,11 @@
</span><span class="cx">         static double defaultTimeoutInterval(); // May return 0 when using platform default.
</span><span class="cx">         static void setDefaultTimeoutInterval(double);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        static bool defaultAllowCookies();
+        static void setDefaultAllowCookies(bool);
+#endif
+
</ins><span class="cx">         static bool compare(const ResourceRequest&amp;, const ResourceRequest&amp;);
</span><span class="cx"> 
</span><span class="cx">     protected:
</span><span class="lines">@@ -163,7 +168,11 @@
</span><span class="cx">             , m_cachePolicy(policy)
</span><span class="cx">             , m_timeoutInterval(s_defaultTimeoutInterval)
</span><span class="cx">             , m_httpMethod(ASCIILiteral(&quot;GET&quot;))
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">             , m_allowCookies(true)
</span><ins>+#else
+            , m_allowCookies(ResourceRequestBase::defaultAllowCookies())
+#endif
</ins><span class="cx">             , m_resourceRequestUpdated(true)
</span><span class="cx">             , m_platformRequestUpdated(false)
</span><span class="cx">             , m_resourceRequestBodyUpdated(true)
</span><span class="lines">@@ -204,6 +213,9 @@
</span><span class="cx">         const ResourceRequest&amp; asResourceRequest() const;
</span><span class="cx"> 
</span><span class="cx">         static double s_defaultTimeoutInterval;
</span><ins>+#if PLATFORM(IOS)
+        static bool s_defaultAllowCookies;
+#endif
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     bool equalIgnoringHeaderFields(const ResourceRequestBase&amp;, const ResourceRequestBase&amp;);
</span><span class="lines">@@ -230,7 +242,9 @@
</span><span class="cx">     };
</span><span class="cx">     
</span><span class="cx">     unsigned initializeMaximumHTTPConnectionCountPerHost();
</span><del>-
</del><ins>+#if PLATFORM(IOS)
+    void initializeHTTPConnectionSettingsOnStartup();
+#endif
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ResourceRequestBase_h
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfCredentialStorageCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/CredentialStorageCFNet.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/CredentialStorageCFNet.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/cf/CredentialStorageCFNet.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -39,6 +39,10 @@
</span><span class="cx"> #include &lt;WebKitSystemInterface/WebKitSystemInterface.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;CFNetwork/CFURLCredentialStorage.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> Credential CredentialStorage::getFromPersistentStorage(const ProtectionSpace&amp; protectionSpace)
</span><span class="lines">@@ -48,6 +52,23 @@
</span><span class="cx">     return core(credentialCF.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void CredentialStorage::saveToPersistentStorage(const ProtectionSpace&amp; protectionSpace, const Credential&amp; credential)
+{
+    RetainPtr&lt;CFURLCredentialStorageRef&gt; storageCF = adoptCF(CFURLCredentialStorageCreate(0));
+    RetainPtr&lt;CFURLProtectionSpaceRef&gt; protectionSpaceCF = adoptCF(createCF(protectionSpace));
+
+    if (credential.persistence() == CredentialPersistenceNone) {
+        Credential sessionCredential(credential, CredentialPersistenceForSession);
+        RetainPtr&lt;CFURLCredentialRef&gt; sessionCredentialCF = adoptCF(createCF(sessionCredential));
+        CFURLCredentialStorageSetDefaultCredentialForProtectionSpace(storageCF.get(), sessionCredentialCF.get(), protectionSpaceCF.get());
+    } else {
+        RetainPtr&lt;CFURLCredentialRef&gt; credentialCF = adoptCF(createCF(credential));
+        CFURLCredentialStorageSetDefaultCredentialForProtectionSpace(storageCF.get(), credentialCF.get(), protectionSpaceCF.get());
+    }
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // USE(CFNETWORK)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfDNSCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/DNSCFNet.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/DNSCFNet.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/cf/DNSCFNet.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -37,6 +37,10 @@
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;CFNetwork/CFNetwork.h&gt;
+#endif
+
</ins><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> #include &quot;LoaderRunLoopCF.h&quot;
</span><span class="cx"> #include &lt;CFNetwork/CFNetwork.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfProxyServerCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/ProxyServerCFNet.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ProxyServerCFNet.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/cf/ProxyServerCFNet.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(WIN)
</del><ins>+#if PLATFORM(IOS) || PLATFORM(WIN)
</ins><span class="cx"> #include &lt;CFNetwork/CFNetwork.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfResourceRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/ResourceRequest.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ResourceRequest.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequest.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -43,22 +43,34 @@
</span><span class="cx">     public:
</span><span class="cx">         ResourceRequest(const String&amp; url) 
</span><span class="cx">             : ResourceRequestBase(URL(ParsedURLString, url), UseProtocolCachePolicy)
</span><ins>+#if PLATFORM(IOS)
+            , m_mainResourceRequest(false)
+#endif
</ins><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         ResourceRequest(const URL&amp; url) 
</span><span class="cx">             : ResourceRequestBase(url, UseProtocolCachePolicy)
</span><ins>+#if PLATFORM(IOS)
+            , m_mainResourceRequest(false)
+#endif
</ins><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         ResourceRequest(const URL&amp; url, const String&amp; referrer, ResourceRequestCachePolicy policy = UseProtocolCachePolicy) 
</span><span class="cx">             : ResourceRequestBase(url, policy)
</span><ins>+#if PLATFORM(IOS)
+            , m_mainResourceRequest(false)
+#endif
</ins><span class="cx">         {
</span><span class="cx">             setHTTPReferrer(referrer);
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         ResourceRequest()
</span><span class="cx">             : ResourceRequestBase(URL(), UseProtocolCachePolicy)
</span><ins>+#if PLATFORM(IOS)
+            , m_mainResourceRequest(false)
+#endif
</ins><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="lines">@@ -70,6 +82,9 @@
</span><span class="cx"> 
</span><span class="cx">         ResourceRequest(CFURLRequestRef cfRequest)
</span><span class="cx">             : ResourceRequestBase()
</span><ins>+#if PLATFORM(IOS)
+            , m_mainResourceRequest(false)
+#endif
</ins><span class="cx">             , m_cfRequest(cfRequest)
</span><span class="cx">         {
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -79,6 +94,9 @@
</span><span class="cx"> #else
</span><span class="cx">         ResourceRequest(NSURLRequest *nsRequest)
</span><span class="cx">             : ResourceRequestBase()
</span><ins>+#if PLATFORM(IOS)
+            , m_mainResourceRequest(false)
+#endif
</ins><span class="cx">             , m_nsRequest(nsRequest)
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="lines">@@ -109,7 +127,15 @@
</span><span class="cx">         static bool useQuickLookResourceCachingQuirks();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+        void setMainResourceRequest(bool isMainResourceRequest) const { m_mainResourceRequest = isMainResourceRequest; }
+        bool isMainResourceRequest() const { return m_mainResourceRequest; }
+
</ins><span class="cx">     private:
</span><ins>+        mutable bool m_mainResourceRequest;
+#endif
+
+    private:
</ins><span class="cx">         friend class ResourceRequestBase;
</span><span class="cx"> 
</span><span class="cx">         void doUpdatePlatformRequest();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfResourceRequestCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -36,7 +36,10 @@
</span><span class="cx"> #include &quot;FormDataStreamCFNet.h&quot;
</span><span class="cx"> #include &lt;CFNetwork/CFURLRequestPriv.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><ins>+#if PLATFORM(IOS)
+#include &lt;CFNetwork/CFNetworkConnectionCachePriv.h&gt;
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> #include &quot;ResourceLoadPriority.h&quot;
</span><span class="lines">@@ -50,7 +53,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool ResourceRequest::s_httpPipeliningEnabled = true;
+#else
</ins><span class="cx"> bool ResourceRequest::s_httpPipeliningEnabled = false;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CFNETWORK)
</span><span class="cx"> 
</span><span class="lines">@@ -222,10 +229,33 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ResourceRequest::updateFromDelegatePreservingOldHTTPBody(const ResourceRequest&amp; delegateProvidedRequest)
+{
+    RefPtr&lt;FormData&gt; oldHTTPBody = httpBody();
+
+    *this = delegateProvidedRequest;
+    setHTTPBody(oldHTTPBody.release());
+}
+
</ins><span class="cx"> void ResourceRequest::doUpdateResourceRequest()
</span><span class="cx"> {
</span><span class="cx">     if (!m_cfRequest) {
</span><ins>+#if PLATFORM(IOS)
+        // &lt;rdar://problem/9913526&gt;
+        // This is a hack to mimic the subtle behaviour of the Foundation based ResourceRequest
+        // code. That code does not reset m_httpMethod if the NSURLRequest is nil. I filed
+        // &lt;https://bugs.webkit.org/show_bug.cgi?id=66336&gt; to track that.
+        // Another related bug is &lt;https://bugs.webkit.org/show_bug.cgi?id=66350&gt;. Fixing that
+        // would, ideally, allow us to not have this hack. But unfortunately that caused layout test
+        // failures.
+        // Removal of this hack is tracked by &lt;rdar://problem/9970499&gt;.
+
+        String httpMethod = m_httpMethod;
</ins><span class="cx">         *this = ResourceRequest();
</span><ins>+        m_httpMethod = httpMethod;
+#else
+        *this = ResourceRequest();
+#endif
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -307,8 +337,10 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> void ResourceRequest::applyWebArchiveHackForMail()
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     // Hack because Mail checks for this property to detect data / archive loads
</span><span class="cx">     _CFURLRequestSetProtocolProperty(cfURLRequest(DoNotUpdateHTTPBody), CFSTR(&quot;WebDataRequest&quot;), CFSTR(&quot;&quot;));
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -383,5 +415,21 @@
</span><span class="cx"> 
</span><span class="cx">     return maximumHTTPConnectionCountPerHost;
</span><span class="cx"> }
</span><ins>+    
+#if PLATFORM(IOS)
+void initializeHTTPConnectionSettingsOnStartup()
+{
+    // This need to be called from WebKitInitialize so the calls happen early enough, before any requests are made. &lt;rdar://problem/9691871&gt;
+    // Desktop doesn't have early initialization so it is not clear how this should be done there. The CFNetwork SPI probably
+    // needs to become more forgiving.
+    // We can't read settings here as this is called too early for that. All values need to be constants.
+    static const unsigned preferredConnectionCount = 6;
+    static const unsigned fastLaneConnectionCount = 1;
+    wkInitializeMaximumHTTPConnectionCountPerHost(preferredConnectionCount);
+    wkSetHTTPPipeliningMaximumPriority(ResourceLoadPriorityHighest);
+    wkSetHTTPPipeliningMinimumFastLanePriority(ResourceLoadPriorityMedium);
+    _CFNetworkHTTPConnectionCacheSetLimit(kHTTPNumFastLanes, fastLaneConnectionCount);
+}
+#endif
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfSocketStreamHandleCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -41,6 +41,10 @@
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;CFNetwork/CFNetwork.h&gt;
+#endif
+
</ins><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx"> #include &quot;LoaderRunLoopCF.h&quot;
</span><span class="cx"> #include &lt;CFNetwork/CFNetwork.h&gt;
</span><span class="lines">@@ -571,7 +575,7 @@
</span><span class="cx">     CFIndex errorCode = CFErrorGetCode(error);
</span><span class="cx">     String description;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> #if COMPILER(CLANG)
</span><span class="cx"> #pragma clang diagnostic push
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkiosNetworkStateNotifierIOScppfromrev161588trunkSourceWebCoreplatformKillRingNonecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.cpp (from rev 161588, trunk/Source/WebCore/platform/KillRingNone.cpp) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/network/ios/NetworkStateNotifierIOS.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;NetworkStateNotifier.h&quot;
+
+namespace WebCore {
+
+NetworkStateNotifier::NetworkStateNotifier()
+    : m_isOnLine(false)
+{
+}
+
+void NetworkStateNotifier::setIsOnLine(bool isOnLine)
+{
+    if (m_isOnLine == isOnLine)
+        return;
+    m_isOnLine = isOnLine;
+    notifyNetworkStateChange();
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkiosQuickLookh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/ios/QuickLook.h (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ios/QuickLook.h                                (rev 0)
+++ trunk/Source/WebCore/platform/network/ios/QuickLook.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef QuickLook_h
+#define QuickLook_h
+
+#if USE(QUICK_LOOK)
+
+#import &quot;ResourceRequest.h&quot;
+#import &lt;objc/objc-runtime.h&gt;
+#import &lt;wtf/PassOwnPtr.h&gt;
+
+#ifdef __OBJC__
+@class NSData;
+@class NSDictionary;
+@class NSFileHandle;
+@class NSSet;
+@class NSString;
+@class NSURL;
+@class NSURLConnection;
+@class NSURLResponse;
+#else
+class NSData;
+class NSDictionary;
+class NSFileHandle;
+class NSSet;
+class NSString;
+class NSURL;
+class NSURLConnection;
+class NSURLResponse;
+#endif
+
+#if USE(CFNETWORK)
+typedef struct _CFURLResponse* CFURLResponseRef;
+typedef struct _CFURLConnection* CFURLConnectionRef;
+#endif
+
+namespace WebCore {
+
+class ResourceHandle;
+class SynchronousResourceHandleCFURLConnectionDelegate;
+
+Class QLPreviewConverterClass();
+NSString *QLTypeCopyBestMimeTypeForFileNameAndMimeType(NSString *fileName, NSString *mimeType);
+NSString *QLTypeCopyBestMimeTypeForURLAndMimeType(NSURL *, NSString *mimeType);
+
+NSSet *QLPreviewGetSupportedMIMETypesSet();
+
+// Used for setting the permissions on the saved QL content
+NSDictionary *QLFileAttributes();
+NSDictionary *QLDirectoryAttributes();
+
+void addQLPreviewConverterWithFileForURL(NSURL *, id converter, NSString *fileName);
+NSString *qlPreviewConverterFileNameForURL(NSURL *);
+NSString *qlPreviewConverterUTIForURL(NSURL *);
+void removeQLPreviewConverterForURL(NSURL *);
+
+PassOwnPtr&lt;ResourceRequest&gt; registerQLPreviewConverterIfNeeded(NSURL *, NSString *mimeType, NSData *);
+
+const URL safeQLURLForDocumentURLAndResourceURL(const URL&amp; documentURL, const String&amp; resourceURL);
+
+const char* QLPreviewProtocol();
+
+
+class QuickLookHandle {
+    WTF_MAKE_NONCOPYABLE(QuickLookHandle);
+public:
+    static PassOwnPtr&lt;QuickLookHandle&gt; create(ResourceHandle*, NSURLConnection *, NSURLResponse *, id delegate);
+#if USE(CFNETWORK)
+    static PassOwnPtr&lt;QuickLookHandle&gt; create(ResourceHandle*, SynchronousResourceHandleCFURLConnectionDelegate*, CFURLResponseRef);
+#endif
+    ~QuickLookHandle();
+
+    bool didReceiveDataArray(CFArrayRef);
+    bool didReceiveData(CFDataRef);
+    bool didFinishLoading();
+    void didFail();
+
+    NSURLResponse *nsResponse();
+#if USE(CFNETWORK)
+    CFURLResponseRef cfResponse();
+#endif
+
+private:
+    QuickLookHandle(ResourceHandle*, NSURLConnection *, NSURLResponse *, id delegate);
+#if USE(CFNETWORK)
+    QuickLookHandle(ResourceHandle*, CFURLResponseRef);
+#endif
+
+    ResourceHandle* m_handle;
+    RetainPtr&lt;id&gt; m_converter;
+    RetainPtr&lt;id&gt; m_delegate;
+    bool m_finishedLoadingDataIntoConverter;
+    RetainPtr&lt;NSFileHandle *&gt; m_quicklookFileHandle;
+    NSURLResponse *m_nsResponse;
+};
+
+} // namespace WebCore
+
+#endif // USE(QUICK_LOOK)
+
+#endif // QuickLook_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkiosQuickLookmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/ios/QuickLook.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ios/QuickLook.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/network/ios/QuickLook.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,467 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;QuickLook.h&quot;
+
+#if USE(QUICK_LOOK)
+
+#import &quot;FileSystemIOS.h&quot;
+#import &quot;Logging.h&quot;
+#import &quot;ResourceHandle.h&quot;
+#import &quot;RuntimeApplicationChecksIOS.h&quot;
+#import &quot;SoftLinking.h&quot;
+#import &quot;SynchronousResourceHandleCFURLConnectionDelegate.h&quot;
+#import &quot;WebCoreURLResponseIOS.h&quot;
+#import &lt;Foundation/Foundation.h&gt;
+#import &lt;Foundation/NSFileManager_NSURLExtras.h&gt;
+#import &lt;QuickLook/QLPreviewConverter.h&gt;
+#import &lt;QuickLook/QuickLookPrivate.h&gt;
+#import &lt;wtf/NeverDestroyed.h&gt;
+#import &lt;wtf/StdLibExtras.h&gt;
+#import &lt;wtf/Threading.h&gt;
+#import &lt;wtf/Vector.h&gt;
+#import &lt;wtf/text/WTFString.h&gt;
+
+#if USE(CFNETWORK)
+#import &lt;CFNetwork/CFURLConnection.h&gt;
+
+@interface NSURLResponse (QuickLookDetails)
++(NSURLResponse *)_responseWithCFURLResponse:(CFURLResponseRef)response;
+-(CFURLResponseRef)_CFURLResponse;
+@end
+#endif
+
+SOFT_LINK_FRAMEWORK_OPTIONAL(QuickLook)
+SOFT_LINK_CLASS(QuickLook, QLPreviewConverter)
+SOFT_LINK_MAY_FAIL(QuickLook, QLPreviewGetSupportedMIMETypes, NSSet *, (), ())
+SOFT_LINK_MAY_FAIL(QuickLook, QLTypeCopyBestMimeTypeForFileNameAndMimeType, NSString *, (NSString *fileName, NSString *mimeType), (fileName, mimeType))
+SOFT_LINK_MAY_FAIL(QuickLook, QLTypeCopyBestMimeTypeForURLAndMimeType, NSString *, (NSURL *url, NSString *mimeType), (url, mimeType))
+SOFT_LINK_MAY_FAIL(QuickLook, QLTypeCopyUTIForURLAndMimeType, NSString *, (NSURL *url, NSString *mimeType), (url, mimeType))
+SOFT_LINK_CONSTANT_MAY_FAIL(QuickLook, QLPreviewScheme, NSString *)
+
+namespace WebCore {
+    NSString *QLTypeCopyUTIForURLAndMimeType(NSURL *url, NSString *mimeType);
+}
+
+using namespace WebCore;
+
+Class WebCore::QLPreviewConverterClass()
+{
+#define QLPreviewConverter getQLPreviewConverterClass()
+    return QLPreviewConverter;
+#undef QLPreviewConverter
+}
+
+NSString *WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType(NSString *fileName, NSString *mimeType)
+{
+    if (!canLoadQLTypeCopyBestMimeTypeForFileNameAndMimeType())
+        return nil;
+
+    return ::QLTypeCopyBestMimeTypeForFileNameAndMimeType(fileName, mimeType);
+}
+
+NSString *WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType(NSURL *url, NSString *mimeType)
+{
+    if (!canLoadQLTypeCopyBestMimeTypeForURLAndMimeType())
+        return nil;
+
+    return ::QLTypeCopyBestMimeTypeForURLAndMimeType(url, mimeType);
+}
+
+NSSet *WebCore::QLPreviewGetSupportedMIMETypesSet()
+{
+    if (!canLoadQLPreviewGetSupportedMIMETypes())
+        return nil;
+
+    static NSSet *set = adoptNS(::QLPreviewGetSupportedMIMETypes()).leakRef();
+    return set;
+}
+
+NSString *WebCore::QLTypeCopyUTIForURLAndMimeType(NSURL *url, NSString *mimeType)
+{
+    if (!canLoadQLTypeCopyUTIForURLAndMimeType())
+        return nil;
+
+    return ::QLTypeCopyUTIForURLAndMimeType(url, mimeType);
+}
+
+NSDictionary *WebCore::QLFileAttributes()
+{
+    // Set file perms to owner read/write only
+    NSNumber *filePOSIXPermissions = [NSNumber numberWithInteger:(WEB_UREAD | WEB_UWRITE)];
+    static NSDictionary *dictionary = adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:
+                                        NSUserName(), NSFileOwnerAccountName,
+                                        filePOSIXPermissions, NSFilePosixPermissions,
+                                        nullptr]).leakRef();
+    return dictionary;
+}
+
+NSDictionary *WebCore::QLDirectoryAttributes()
+{
+    // Set file perms to owner read/write/execute only
+    NSNumber *directoryPOSIXPermissions = [NSNumber numberWithInteger:(WEB_UREAD | WEB_UWRITE | WEB_UEXEC)];
+    static NSDictionary *dictionary = adoptNS([[NSDictionary alloc] initWithObjectsAndKeys:
+                                                NSUserName(), NSFileOwnerAccountName,
+                                                directoryPOSIXPermissions, NSFilePosixPermissions,
+                                                nullptr]).leakRef();
+    return dictionary;
+}
+
+static Mutex&amp; qlPreviewConverterDictionaryMutex()
+{
+    static NeverDestroyed&lt;Mutex&gt; mutex;
+    return mutex;
+}
+
+static NSMutableDictionary *QLPreviewConverterDictionary()
+{
+    static NSMutableDictionary *dictionary = adoptNS([NSMutableDictionary dictionary]).leakRef();
+    return dictionary;
+}
+
+static NSMutableDictionary *QLContentDictionary()
+{
+    static NSMutableDictionary *contentDictionary = adoptNS([NSMutableDictionary dictionary]).leakRef();
+    return contentDictionary;
+}
+
+void WebCore::addQLPreviewConverterWithFileForURL(NSURL *url, id converter, NSString *fileName)
+{
+    ASSERT(url);
+    ASSERT(converter);
+    MutexLocker lock(qlPreviewConverterDictionaryMutex());
+    [QLPreviewConverterDictionary() setObject:converter forKey:url];
+    [QLContentDictionary() setObject:(fileName ? fileName : @&quot;&quot;) forKey:url];
+}
+
+NSString *WebCore::qlPreviewConverterFileNameForURL(NSURL *url)
+{
+    return [QLContentDictionary() objectForKey:url];
+}
+
+NSString *WebCore::qlPreviewConverterUTIForURL(NSURL *url)
+{
+    id converter = nil;
+    {
+        MutexLocker lock(qlPreviewConverterDictionaryMutex());
+        converter = [QLPreviewConverterDictionary() objectForKey:url];
+    }
+    if (!converter)
+        return nil;
+    return [converter previewUTI];
+}
+
+void WebCore::removeQLPreviewConverterForURL(NSURL *url)
+{
+    MutexLocker lock(qlPreviewConverterDictionaryMutex());
+    [QLPreviewConverterDictionary() removeObjectForKey:url];
+
+    // Delete the file when we remove the preview converter
+    NSString *filename = qlPreviewConverterFileNameForURL(url);
+    if ([filename length])
+        [[NSFileManager defaultManager] _web_removeFileOnlyAtPath:filename];
+    [QLContentDictionary() removeObjectForKey:url];
+}
+
+PassOwnPtr&lt;ResourceRequest&gt; WebCore::registerQLPreviewConverterIfNeeded(NSURL *url, NSString *mimeType, NSData *data)
+{
+    RetainPtr&lt;NSString&gt; updatedMIMEType = adoptNS(WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType(url, mimeType));
+
+    if ([WebCore::QLPreviewGetSupportedMIMETypesSet() containsObject:updatedMIMEType.get()]) {
+        RetainPtr&lt;NSString&gt; uti = adoptNS(WebCore::QLTypeCopyUTIForURLAndMimeType(url, updatedMIMEType.get()));
+
+        RetainPtr&lt;id&gt; converter = adoptNS([[QLPreviewConverterClass() alloc] initWithData:data name:nil uti:uti.get() options:nil]);
+        NSURLRequest *request = [converter.get() previewRequest];
+
+        // We use [request URL] here instead of url since it will be
+        // the URL that the WebDataSource will see during -dealloc.
+        addQLPreviewConverterWithFileForURL([request URL], converter.get(), nil);
+
+        return adoptPtr(new ResourceRequest(request));
+    }
+
+    return nullptr;
+}
+
+const URL WebCore::safeQLURLForDocumentURLAndResourceURL(const URL&amp; documentURL, const String&amp; resourceURL)
+{
+    id converter = nil;
+    NSURL *nsDocumentURL = documentURL;
+    {
+        MutexLocker lock(qlPreviewConverterDictionaryMutex());
+        converter = [QLPreviewConverterDictionary() objectForKey:nsDocumentURL];
+    }
+
+    if (!converter)
+        return URL(ParsedURLString, resourceURL);
+
+    RetainPtr&lt;NSURLRequest&gt; request = adoptNS([[NSURLRequest alloc] initWithURL:[NSURL URLWithString:resourceURL]]);
+    NSURLRequest *safeRequest = [converter safeRequestForRequest:request.get()];
+    return [safeRequest URL];
+}
+
+static Vector&lt;char&gt; createQLPreviewProtocol()
+{
+    Vector&lt;char&gt; previewProtocol;
+#define QLPreviewScheme getQLPreviewScheme()
+    const char* qlPreviewScheme = [QLPreviewScheme UTF8String];
+#undef QLPreviewScheme
+    previewProtocol.append(qlPreviewScheme, strlen(qlPreviewScheme) + 1);
+    return previewProtocol;
+}
+
+const char* WebCore::QLPreviewProtocol()
+{
+    if (!canLoadQLPreviewScheme())
+        return &quot;&quot;;
+
+    static NeverDestroyed&lt;Vector&lt;char&gt;&gt; previewProtocol(createQLPreviewProtocol());
+    return previewProtocol.get().data();
+}
+
+#if USE(CFNETWORK)
+// The way QuickLook works is we pass it an NSURLConnectionDelegate callback object at creation
+// time. Then we pass it all the data as we receive it. Once we've downloaded the full URL,
+// QuickLook turns around and send us, through this delegate, the HTML version of the file which we
+// pass on to WebCore. The flag m_finishedLoadingDataIntoConverter in QuickLookHandle decides
+// whether to pass the data to QuickLook or WebCore.
+//
+// This works fine when using NS APIs, but when using CFNetwork, we don't have a NSURLConnectionDelegate.
+// So we create WebQuickLookHandleAsDelegate as an intermediate delegate object and pass it to
+// QLPreviewConverter. The proxy delegate then forwards the messages on to the CFNetwork code.
+@interface WebQuickLookHandleAsDelegate : NSObject &lt;NSURLConnectionDelegate&gt; {
+    RefPtr&lt;SynchronousResourceHandleCFURLConnectionDelegate&gt; m_connectionDelegate;
+}
+
+- (id)initWithConnectionDelegate:(SynchronousResourceHandleCFURLConnectionDelegate*)connectionDelegate;
+- (void)clearHandle;
+@end
+
+@implementation WebQuickLookHandleAsDelegate
+- (id)initWithConnectionDelegate:(SynchronousResourceHandleCFURLConnectionDelegate*)connectionDelegate
+{
+    self = [super init];
+    if (!self)
+        return nil;
+    m_connectionDelegate = connectionDelegate;
+    return self;
+}
+
+- (void)connection:(NSURLConnection *)connection didReceiveDataArray:(NSArray *)dataArray
+{
+    UNUSED_PARAM(connection);
+    if (!m_connectionDelegate)
+        return;
+    LOG(Network, &quot;WebQuickLookHandleAsDelegate::didReceiveDataArray()&quot;);
+    m_connectionDelegate-&gt;didReceiveDataArray(reinterpret_cast&lt;CFArrayRef&gt;(dataArray));
+}
+
+- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data lengthReceived:(long long)lengthReceived
+{
+    UNUSED_PARAM(connection);
+    if (!m_connectionDelegate)
+        return;
+    LOG(Network, &quot;WebQuickLookHandleAsDelegate::didReceiveData() - data length = %ld&quot;, (long)[data length]);
+
+    // QuickLook code sends us a nil data at times. The check below is the same as the one in
+    // ResourceHandleMac.cpp added for a different bug.
+    if (![data length])
+        return;
+    m_connectionDelegate-&gt;didReceiveData(reinterpret_cast&lt;CFDataRef&gt;(data), static_cast&lt;int&gt;(lengthReceived));
+}
+
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection
+{
+    UNUSED_PARAM(connection);
+    if (!m_connectionDelegate)
+        return;
+    LOG(Network, &quot;WebQuickLookHandleAsDelegate::didFinishLoading()&quot;);
+    m_connectionDelegate-&gt;didFinishLoading();
+}
+
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
+{
+    UNUSED_PARAM(connection);
+    if (!m_connectionDelegate)
+        return;
+    LOG(Network, &quot;WebQuickLookHandleAsDelegate::didFail()&quot;);
+    m_connectionDelegate-&gt;didFail(reinterpret_cast&lt;CFErrorRef&gt;(error));
+}
+
+- (void)clearHandle
+{
+    m_connectionDelegate = nullptr;
+}
+@end
+#endif
+
+namespace WebCore {
+
+static NSString *createTemporaryFileForQuickLook(NSString *fileName)
+{
+    NSString *downloadDirectory = createTemporaryDirectory(@&quot;QuickLookContent&quot;);
+    if (!downloadDirectory)
+        return nil;
+
+    NSString *contentPath = [downloadDirectory stringByAppendingPathComponent:fileName];
+    NSFileManager *fileManager = [NSFileManager defaultManager];
+    NSString *uniqueContentPath = [fileManager _web_pathWithUniqueFilenameForPath:contentPath];
+
+    BOOL success = [fileManager _web_createFileAtPathWithIntermediateDirectories:uniqueContentPath
+                                                                        contents:nil
+                                                                      attributes:QLFileAttributes()
+                                                             directoryAttributes:QLDirectoryAttributes()];
+
+    return success ? uniqueContentPath : nil;
+}
+
+
+QuickLookHandle::QuickLookHandle(ResourceHandle* handle, NSURLConnection *connection, NSURLResponse *nsResponse, id delegate)
+    : m_handle(handle)
+    , m_converter(adoptNS([[QLPreviewConverterClass() alloc] initWithConnection:connection delegate:delegate response:nsResponse options:nil]))
+    , m_delegate(adoptNS([delegate retain]))
+    , m_finishedLoadingDataIntoConverter(false)
+    , m_nsResponse([m_converter.get() previewResponse])
+{
+    NSURL *previewRequestURL = [[m_converter.get() previewRequest] URL];
+    if (!applicationIsMobileSafari()) {
+        // This keeps the QLPreviewConverter alive to serve any subresource requests.
+        // It is removed by -[WebDataSource dealloc].
+        addQLPreviewConverterWithFileForURL(previewRequestURL, m_converter.get(), nil);
+        return;
+    }
+
+    // QuickLook consumes the incoming data, we need to store it so that it can be opened in the handling application.
+    NSString *quicklookContentPath = createTemporaryFileForQuickLook([m_converter.get() previewFileName]);
+    LOG(Network, &quot;QuickLookHandle::QuickLookHandle() - quicklookContentPath: %s&quot;, [quicklookContentPath UTF8String]);
+
+    if (quicklookContentPath) {
+        m_quicklookFileHandle = adoptNS([[NSFileHandle fileHandleForWritingAtPath:quicklookContentPath] retain]);
+        // We must use the generated URL from m_converter's NSURLRequest object
+        // so that it matches the URL removed from -[WebDataSource dealloc].
+        addQLPreviewConverterWithFileForURL(previewRequestURL, m_converter.get(), quicklookContentPath);
+    }
+}
+
+PassOwnPtr&lt;QuickLookHandle&gt; QuickLookHandle::create(ResourceHandle* handle, NSURLConnection *connection, NSURLResponse *nsResponse, id delegate)
+{
+    if (handle-&gt;firstRequest().isMainResourceRequest() &amp;&amp; [WebCore::QLPreviewGetSupportedMIMETypesSet() containsObject:[nsResponse MIMEType]])
+        return adoptPtr(new QuickLookHandle(handle, connection, nsResponse, delegate));
+
+    return nullptr;
+}
+
+#if USE(CFNETWORK)
+PassOwnPtr&lt;QuickLookHandle&gt; QuickLookHandle::create(ResourceHandle* handle, SynchronousResourceHandleCFURLConnectionDelegate* connectionDelegate, CFURLResponseRef cfResponse)
+{
+    if (handle-&gt;firstRequest().isMainResourceRequest() &amp;&amp; [WebCore::QLPreviewGetSupportedMIMETypesSet() containsObject:(NSString *)CFURLResponseGetMIMEType(cfResponse)]) {
+        NSURLResponse *nsResponse = [NSURLResponse _responseWithCFURLResponse:cfResponse];
+        WebQuickLookHandleAsDelegate *delegate = [[[WebQuickLookHandleAsDelegate alloc] initWithConnectionDelegate:connectionDelegate] autorelease];
+        return adoptPtr(new QuickLookHandle(handle, nil, nsResponse, delegate));
+    }
+
+    return nullptr;
+}
+
+CFURLResponseRef QuickLookHandle::cfResponse()
+{
+    return [m_nsResponse _CFURLResponse];
+}
+#endif
+
+NSURLResponse *QuickLookHandle::nsResponse()
+{
+    return m_nsResponse;
+}
+
+bool QuickLookHandle::didReceiveDataArray(CFArrayRef cfDataArray)
+{
+    NSArray * const dataArray = (NSArray *)cfDataArray;
+
+    if (m_finishedLoadingDataIntoConverter)
+        return false;
+
+    LOG(Network, &quot;QuickLookHandle::didReceiveDataArray()&quot;);
+    [m_converter.get() appendDataArray:dataArray];
+    if (m_quicklookFileHandle) {
+        for (NSData *data in dataArray)
+            [m_quicklookFileHandle.get() writeData:data];
+    }
+    return true;
+}
+
+bool QuickLookHandle::didReceiveData(CFDataRef cfData)
+{
+    NSData * const data = (NSData *)cfData;
+
+    if (m_finishedLoadingDataIntoConverter)
+        return false;
+
+    LOG(Network, &quot;QuickLookHandle::didReceiveData()&quot;);
+    [m_converter.get() appendData:data];
+    if (m_quicklookFileHandle)
+        [m_quicklookFileHandle.get() writeData:data];
+    return true;
+}
+
+bool QuickLookHandle::didFinishLoading()
+{
+    if (m_finishedLoadingDataIntoConverter)
+        return false;
+
+    LOG(Network, &quot;QuickLookHandle::didFinishLoading()&quot;);
+    m_finishedLoadingDataIntoConverter = YES;
+    [m_converter.get() finishedAppendingData];
+    if (m_quicklookFileHandle)
+        [m_quicklookFileHandle.get() closeFile];
+    return true;
+}
+
+void QuickLookHandle::didFail()
+{
+    LOG(Network, &quot;QuickLookHandle::didFail()&quot;);
+    m_quicklookFileHandle = nullptr;
+    // removeQLPreviewConverterForURL deletes the temporary file created.
+    removeQLPreviewConverterForURL([m_handle-&gt;firstRequest().nsURLRequest(DoNotUpdateHTTPBody) URL]);
+    [m_converter.get() finishConverting];
+    m_converter = nullptr;
+}
+
+QuickLookHandle::~QuickLookHandle()
+{
+    LOG(Network, &quot;QuickLookHandle::~QuickLookHandle()&quot;);
+    if (m_quicklookFileHandle) {
+        m_quicklookFileHandle = nullptr;
+        removeQLPreviewConverterForURL([m_handle-&gt;firstRequest().nsURLRequest(DoNotUpdateHTTPBody) URL]);
+    }
+    m_converter = nullptr;
+
+    [m_delegate.get() clearHandle];
+}
+
+}
+
+#endif // USE(QUICK_LOOK)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkiosResourceHandleIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/ios/ResourceHandleIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ios/ResourceHandleIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/network/ios/ResourceHandleIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+//
+//  ResourceHandleIPhone.mm
+//  WebCore
+//
+//  Copyright 2011 Apple Inc. All rights reserved.
+//
+
+#import &quot;config.h&quot;
+#import &quot;ResourceHandleInternal.h&quot;
+
+#if USE(CFNETWORK)
+
+#import &lt;CFNetwork/CFSocketStreamPriv.h&gt;
+#import &lt;Foundation/NSURLRequestPrivate.h&gt;
+
+using namespace WebCore;
+
+namespace WebCore {
+
+CFMutableDictionaryRef ResourceHandle::createSSLPropertiesFromNSURLRequest(const ResourceRequest&amp; request)
+{
+    NSString *host = request.url().host();
+    NSArray *certArray = [NSURLRequest allowsSpecificHTTPSCertificateForHost:host];
+    BOOL allowsAnyCertificate = [NSURLRequest allowsAnyHTTPSCertificateForHost:host];
+    if (!certArray &amp;&amp; !allowsAnyCertificate)
+        return 0;
+
+    CFMutableDictionaryRef sslProps = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks);
+    if (certArray)
+        CFDictionarySetValue(sslProps, _kCFStreamSSLTrustedLeafCertificates, (CFTypeRef) certArray);
+
+    if (allowsAnyCertificate)
+        CFDictionarySetValue(sslProps, kCFStreamSSLValidatesCertificateChain, kCFBooleanFalse);
+    return sslProps;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkiosWebCoreURLResponseIOShfromrev161588trunkSourceWebCoreplatformgraphicsStringTruncatorh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.h (from rev 161588, trunk/Source/WebCore/platform/graphics/StringTruncator.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.h                                (rev 0)
+++ trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebCoreURLResponseIOS_h
+#define WebCoreURLResponseIOS_h
+
+#ifdef __OBJC__
+#include &quot;WebCoreURLResponse.h&quot;
+#endif
+
+#include &quot;MIMETypeRegistry.h&quot;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+#if USE(QUICK_LOOK)
+    
+inline bool shouldUseQuickLookForMIMEType(const WTF::String&amp; mimeType)
+{
+    if ((!MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)       // ignore supported non-image MIME types
+         &amp;&amp; !MIMETypeRegistry::isSupportedImageMIMEType(mimeType)       // ignore supported image MIME types
+         &amp;&amp; mimeType != &quot;text/css&quot;                                      // ignore css
+         &amp;&amp; mimeType != &quot;application/pdf&quot;                               // ignore pdf
+         )
+        || mimeType == &quot;text/plain&quot;                                     // but keep text/plain which is too generic and can hide something
+        || (mimeType == &quot;text/xml&quot; || mimeType == &quot;application/xml&quot;))   // and keep XML types for .mobileconfig files
+    {
+        return true;
+    }
+
+    return false;
+}
+
+#endif // USE(QUICK_LOOK)
+
+} // namespace WebCore
+
+#endif // WebCoreURLResponseIOS_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkiosWebCoreURLResponseIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/network/ios/WebCoreURLResponseIOS.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Computer, Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;WebCoreURLResponseIOS.h&quot;
+#import &quot;UTIUtilities.h&quot;
+#import &quot;WebCoreSystemInterface.h&quot;
+
+#import &quot;QuickLook.h&quot;
+#import &quot;SoftLinking.h&quot;
+#import &lt;MobileCoreServices/MobileCoreServices.h&gt;
+
+SOFT_LINK_FRAMEWORK(MobileCoreServices)
+
+SOFT_LINK(MobileCoreServices, UTTypeCreatePreferredIdentifierForTag, CFStringRef, (CFStringRef inTagClass, CFStringRef inTag, CFStringRef inConformingToUTI), (inTagClass, inTag, inConformingToUTI))
+
+SOFT_LINK_CONSTANT(MobileCoreServices, kUTTagClassFilenameExtension, CFStringRef)
+
+#define kUTTagClassFilenameExtension getkUTTagClassFilenameExtension()
+
+namespace WebCore {
+
+void adjustMIMETypeIfNecessary(CFURLResponseRef cfResponse)
+{
+    RetainPtr&lt;CFStringRef&gt; mimeType = wkGetCFURLResponseMIMEType(cfResponse);
+    RetainPtr&lt;CFStringRef&gt; updatedMIMEType = mimeType;
+    if (!updatedMIMEType)
+        updatedMIMEType = defaultMIMEType().createCFString();
+
+#if USE(QUICK_LOOK)
+    // We must ensure that the MIME type is correct, so that QuickLook's web plugin is called when needed.
+    // We filter the basic MIME types so that we don't do unnecessary work in standard browsing situations.
+    if (shouldUseQuickLookForMIMEType((NSString *)updatedMIMEType.get())) {
+        RetainPtr&lt;CFStringRef&gt; suggestedFilename = adoptCF(wkCopyCFURLResponseSuggestedFilename(cfResponse));
+        RetainPtr&lt;CFStringRef&gt; quickLookMIMEType = adoptCF((CFStringRef)QLTypeCopyBestMimeTypeForFileNameAndMimeType((NSString *)suggestedFilename.get(), (NSString *)mimeType.get()));
+        if (!quickLookMIMEType) {
+            CFURLRef url = wkGetCFURLResponseURL(cfResponse);
+            NSURL *nsURL = (NSURL *)url;
+            if ([nsURL isFileURL]) {
+                RetainPtr&lt;CFStringRef&gt; extension = adoptCF(CFURLCopyPathExtension(url));
+                if (extension) {
+                    RetainPtr&lt;CFStringRef&gt; uti = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, extension.get(), nullptr));
+                    quickLookMIMEType = mimeTypeFromUTITree(uti.get());
+                }
+            }
+        }
+
+        if (quickLookMIMEType)
+            updatedMIMEType = quickLookMIMEType;
+    }
+#endif // USE(QUICK_LOOK)
+    if (!mimeType || CFStringCompare(mimeType.get(), updatedMIMEType.get(), kCFCompareCaseInsensitive) != kCFCompareEqualTo)
+        wkSetCFURLResponseMIMEType(cfResponse, updatedMIMEType.get());
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacAuthenticationMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -43,7 +43,11 @@
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface NSURLAuthenticationChallenge (Details)
</span><ins>+#if PLATFORM(IOS)
++(NSURLAuthenticationChallenge *)_createAuthenticationChallengeForCFAuthChallenge:(CFURLAuthChallengeRef)cfChallenge sender:(id &lt;NSURLAuthenticationChallengeSender&gt;)sender;
+#else
</ins><span class="cx"> +(NSURLAuthenticationChallenge *)_authenticationChallengeForCFAuthChallenge:(CFURLAuthChallengeRef)cfChallenge sender:(id &lt;NSURLAuthenticationChallengeSender&gt;)sender;
</span><ins>+#endif
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface NSURLCredential (Details)
</span><span class="lines">@@ -154,7 +158,11 @@
</span><span class="cx">     if (!authChallenge)
</span><span class="cx">         authChallenge = adoptCF(createCF(coreChallenge));
</span><span class="cx">     [challengeSender.get() setCFChallenge:authChallenge.get()];
</span><ins>+#if PLATFORM(IOS)
+    return [[NSURLAuthenticationChallenge _createAuthenticationChallengeForCFAuthChallenge:authChallenge.get() sender:challengeSender.get()] autorelease];
+#else
</ins><span class="cx">     return [[NSURLAuthenticationChallenge _authenticationChallengeForCFAuthChallenge:authChallenge.get() sender:challengeSender.get()] autorelease];
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NSURLCredential *mac(const Credential&amp; coreCredential)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacCredentialStorageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -39,6 +39,17 @@
</span><span class="cx">     return credential ? core(credential) : Credential();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+void CredentialStorage::saveToPersistentStorage(const ProtectionSpace&amp; protectionSpace, const Credential&amp; credential)
+{
+    if (credential.persistence() == CredentialPersistenceNone) {
+        Credential sessionCredential(credential, CredentialPersistenceForSession);
+        [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:mac(sessionCredential) forProtectionSpace:mac(protectionSpace)];
+    } else
+        [[NSURLCredentialStorage sharedCredentialStorage] setDefaultCredential:mac(credential) forProtectionSpace:mac(protectionSpace)];
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // !USE(CFNETWORK)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacResourceErrorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/ResourceErrorMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/ResourceErrorMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/mac/ResourceErrorMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -31,10 +31,148 @@
</span><span class="cx"> #import &lt;CoreFoundation/CFError.h&gt;
</span><span class="cx"> #import &lt;Foundation/Foundation.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &lt;CFNetwork/CFSocketStreamPriv.h&gt;
+#import &lt;Foundation/NSURLError.h&gt;
+#endif
+
</ins><span class="cx"> @interface NSError (WebExtras)
</span><span class="cx"> - (NSString *)_web_localizedDescription;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+
+// This workaround code exists here because we can't call translateToCFError in Foundation. Once we
+// have that, we can remove this code. &lt;rdar://problem/9837415&gt; Need SPI for translateCFError
+// The code is mostly identical to Foundation - I changed the class name and fixed minor compile errors.
+// We need this because client code (Safari) wants an NSError with NSURLErrorDomain as its domain.
+// The Foundation code below does that and sets up appropriate certificate keys in the NSError.
+
+@interface WebCustomNSURLError : NSError
+
+@end
+
+@implementation WebCustomNSURLError
+
+static NSDictionary* dictionaryThatCanCode(NSDictionary* src)
+{
+    // This function makes a copy of input dictionary, modifies it such that it &quot;should&quot; (as much as we can help it)
+    // not contain any objects that do not conform to NSCoding protocol, and returns it autoreleased.
+
+    NSMutableDictionary* dst = [src mutableCopy];
+
+    // Kill the known problem entries.
+    [dst removeObjectForKey:@&quot;NSErrorPeerCertificateChainKey&quot;]; // NSArray with SecCertificateRef objects
+    [dst removeObjectForKey:@&quot;NSErrorClientCertificateChainKey&quot;]; // NSArray with SecCertificateRef objects
+    [dst removeObjectForKey:NSURLErrorFailingURLPeerTrustErrorKey]; // SecTrustRef object
+    [dst removeObjectForKey:NSUnderlyingErrorKey]; // (Immutable) CFError containing kCF equivalent of the above
+    // We could reconstitute this but it's more trouble than it's worth
+
+    // Non-comprehensive safety check:  Kill top-level dictionary entries that don't conform to NSCoding.
+    // We may hit ones we just removed, but that's fine.
+    // We don't handle arbitrary objects that clients have stuffed into the dictionary, since we may not know how to
+    // get at its conents (e.g., a CFError object -- you'd have to know it had a userInfo dictionary and kill things
+    // inside it).
+    [src enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL*) {
+        if (! [obj conformsToProtocol:@protocol(NSCoding)]) {
+            [dst removeObjectForKey:key];
+        }
+        // FIXME: We could drill down into subdictionaries, but it seems more trouble than it's worth
+    }];
+
+    return [dst autorelease];
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+    NSDictionary* newUserInfo = dictionaryThatCanCode([self userInfo]);
+
+    [[NSError errorWithDomain:[self domain] code:[self code] userInfo:newUserInfo] encodeWithCoder:coder];
+}
+
+@end
+
+
+#if USE(CFNETWORK)
+static NSError *NSErrorFromCFError(CFErrorRef cfError, NSURL *url)
+{
+    CFIndex errCode = CFErrorGetCode(cfError);
+    if (CFEqual(CFErrorGetDomain(cfError), kCFErrorDomainCFNetwork) &amp;&amp; errCode &lt;= kCFURLErrorUnknown &amp;&amp; errCode &gt; -4000) {
+        // This is an URL error and needs to be translated to the NSURLErrorDomain
+        id keys[10], values[10];
+        CFDictionaryRef userInfo = CFErrorCopyUserInfo(cfError);
+        NSError *result;
+        NSInteger count = 0;
+
+        if (url) {
+            keys[count] = NSURLErrorFailingURLErrorKey;
+            values[count] = url;
+            count ++;
+
+            keys[count] = NSURLErrorFailingURLStringErrorKey;
+            values[count] = [url absoluteString];
+            count ++;
+        }
+
+        values[count] = (id)CFDictionaryGetValue(userInfo, kCFErrorLocalizedDescriptionKey);
+        if (values[count]) {
+            keys[count] = NSLocalizedDescriptionKey;
+            count ++;
+        }
+
+        values[count] = (id)CFDictionaryGetValue(userInfo, kCFErrorLocalizedFailureReasonKey);
+        if (values[count]) {
+            keys[count] = NSLocalizedFailureReasonErrorKey;
+            count ++;
+        }
+
+        values[count] = (id)CFDictionaryGetValue(userInfo, kCFErrorLocalizedRecoverySuggestionKey);
+        if (values[count]) {
+            keys[count] = NSLocalizedRecoverySuggestionErrorKey;
+            count ++;
+        }
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
+        if (userInfo &amp;&amp; (values[count] = (id)CFDictionaryGetValue(userInfo, kCFStreamPropertySSLPeerCertificates)) != nil) {
+            // Need to translate the cert
+            keys[count] = @&quot;NSErrorPeerCertificateChainKey&quot;;
+            count ++;
+
+            values[count] = (id)CFDictionaryGetValue(userInfo, _kCFStreamPropertySSLClientCertificates);
+            if (values[count]) {
+                keys[count] = @&quot;NSErrorClientCertificateChainKey&quot;;
+                count ++;
+            }
+
+            values[count] = (id)CFDictionaryGetValue(userInfo, _kCFStreamPropertySSLClientCertificateState);
+            if (values[count]) {
+                keys[count] = @&quot;NSErrorClientCertificateStateKey&quot;;
+                count ++;
+            }
+        }
+#pragma clang diagnostic pop
+
+        if (userInfo &amp;&amp; (values[count] = (id)CFDictionaryGetValue(userInfo, kCFStreamPropertySSLPeerTrust)) != nil) {
+            keys[count] = NSURLErrorFailingURLPeerTrustErrorKey;
+            count++;
+        }
+
+        keys[count] = NSUnderlyingErrorKey;
+        values[count] = (id)cfError;
+        count ++;
+
+        result = [WebCustomNSURLError errorWithDomain:NSURLErrorDomain code:(errCode == kCFURLErrorUnknown ? (CFIndex)NSURLErrorUnknown : errCode) userInfo:[NSDictionary dictionaryWithObjects:values forKeys:keys count:count]];
+        if (userInfo)
+            CFRelease(userInfo);
+        return result;
+    }
+    return (NSError *)cfError;
+}
+#endif // USE(CFNETWORK)
+
+#endif // PLATFORM(IOS)
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static RetainPtr&lt;NSError&gt; createNSErrorFromResourceErrorBase(const ResourceErrorBase&amp; resourceError)
</span><span class="lines">@@ -77,6 +215,14 @@
</span><span class="cx">     if (m_platformError) {
</span><span class="cx">         CFErrorRef error = m_platformError.get();
</span><span class="cx">         RetainPtr&lt;CFDictionaryRef&gt; userInfo = adoptCF(CFErrorCopyUserInfo(error));
</span><ins>+#if PLATFORM(IOS)
+        m_platformNSError = NSErrorFromCFError(error, (NSURL *)[(NSDictionary *)userInfo.get() objectForKey:(id) kCFURLErrorFailingURLErrorKey]);
+        // If NSErrorFromCFError created a new NSError for us, return that.
+        if (m_platformNSError.get() != (NSError *)error)
+            return m_platformNSError.get();
+
+        // Otherwise fall through to create a new NSError from the CFError.
+#endif
</ins><span class="cx">         m_platformNSError = adoptNS([[NSError alloc] initWithDomain:(NSString *)CFErrorGetDomain(error) code:CFErrorGetCode(error) userInfo:(NSDictionary *)userInfo.get()]);
</span><span class="cx">         return m_platformNSError.get();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacResourceHandleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -56,6 +56,21 @@
</span><span class="cx"> #import &lt;wtf/text/Base64.h&gt;
</span><span class="cx"> #import &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &lt;CFNetwork/CFURLRequest.h&gt;
+
+#import &quot;RuntimeApplicationChecksIOS.h&quot;
+#import &quot;WebCoreThreadRun.h&quot;
+
+@interface NSURLRequest (iOSDetails)
+- (CFURLRequestRef) _CFURLRequest;
+@end
+#endif
+
+#if USE(QUICK_LOOK)
+#import &quot;QuickLook.h&quot;
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @interface NSURLConnection (Details)
</span><span class="lines">@@ -94,7 +109,19 @@
</span><span class="cx">     LOG(Network, &quot;Handle %p destroyed&quot;, this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+static bool synchronousWillSendRequestEnabled()
+{
+    static bool disabled = [[NSUserDefaults standardUserDefaults] boolForKey:@&quot;WebKitDisableSynchronousWillSendRequestPreferenceKey&quot;];
+    return !disabled;
+}
+#endif
+
+#if !PLATFORM(IOS)
</ins><span class="cx"> void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff)
</span><ins>+#else
+void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, NSDictionary *connectionProperties)
+#endif
</ins><span class="cx"> {
</span><span class="cx">     // Credentials for ftp can only be passed in URL, the connection:didReceiveAuthenticationChallenge: delegate call won't be made.
</span><span class="cx">     if ((!d-&gt;m_user.isEmpty() || !d-&gt;m_pass.isEmpty()) &amp;&amp; !firstRequest().url().protocolIsInHTTPFamily()) {
</span><span class="lines">@@ -134,19 +161,33 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT([NSURLConnection instancesRespondToSelector:@selector(_initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:)]);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    NSDictionary *streamPropertiesFromClient = [connectionProperties objectForKey:@&quot;kCFURLConnectionSocketStreamProperties&quot;];
+    NSMutableDictionary *streamProperties = streamPropertiesFromClient ? [[streamPropertiesFromClient mutableCopy] autorelease] : [NSMutableDictionary dictionary];
+#else
</ins><span class="cx">     NSMutableDictionary *streamProperties = [NSMutableDictionary dictionary];
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     if (!shouldUseCredentialStorage)
</span><span class="cx">         [streamProperties setObject:@&quot;WebKitPrivateSession&quot; forKey:@&quot;_kCFURLConnectionSessionID&quot;];
</span><span class="cx"> 
</span><del>-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</del><ins>+#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</ins><span class="cx">     RetainPtr&lt;CFDataRef&gt; sourceApplicationAuditData = d-&gt;m_context-&gt;sourceApplicationAuditData();
</span><span class="cx">     if (sourceApplicationAuditData)
</span><span class="cx">         [streamProperties setObject:(NSData *)sourceApplicationAuditData.get() forKey:@&quot;kCFStreamPropertySourceApplication&quot;];
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    NSMutableDictionary *propertyDictionary = [NSMutableDictionary dictionaryWithDictionary:connectionProperties];
+    [propertyDictionary setObject:streamProperties forKey:@&quot;kCFURLConnectionSocketStreamProperties&quot;];
+    const bool usesCache = false;
+    if (synchronousWillSendRequestEnabled())
+        CFURLRequestSetShouldStartSynchronously([nsRequest _CFURLRequest], 1);
+#else
</ins><span class="cx">     NSDictionary *propertyDictionary = [NSDictionary dictionaryWithObject:streamProperties forKey:@&quot;kCFURLConnectionSocketStreamProperties&quot;];
</span><del>-    d-&gt;m_connection = adoptNS([[NSURLConnection alloc] _initWithRequest:nsRequest delegate:delegate usesCache:YES maxContentLength:0 startImmediately:NO connectionProperties:propertyDictionary]);
</del><ins>+    const bool usesCache = true;
+#endif
+    d-&gt;m_connection = adoptNS([[NSURLConnection alloc] _initWithRequest:nsRequest delegate:delegate usesCache:usesCache maxContentLength:0 startImmediately:NO connectionProperties:propertyDictionary]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ResourceHandle::start()
</span><span class="lines">@@ -168,11 +209,24 @@
</span><span class="cx"> 
</span><span class="cx">     d-&gt;m_needsSiteSpecificQuirks = d-&gt;m_context-&gt;needsSiteSpecificQuirks();
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     createNSURLConnection(
</span><span class="cx">         ResourceHandle::delegate(),
</span><span class="cx">         shouldUseCredentialStorage,
</span><span class="cx">         d-&gt;m_shouldContentSniff || d-&gt;m_context-&gt;localFileContentSniffingEnabled());
</span><ins>+#else
+    createNSURLConnection(
+        d-&gt;m_proxy.get(),
+        shouldUseCredentialStorage,
+        d-&gt;m_shouldContentSniff || d-&gt;m_context-&gt;localFileContentSniffingEnabled(),
+        (NSDictionary *)client()-&gt;connectionProperties(this));
+#endif
</ins><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    NSURLConnection *urlConnection = connection();
+    [urlConnection scheduleInRunLoop:WebThreadNSRunLoop() forMode:NSDefaultRunLoopMode];
+    [urlConnection start];
+#else
</ins><span class="cx">     bool scheduled = false;
</span><span class="cx">     if (SchedulePairHashSet* scheduledPairs = d-&gt;m_context-&gt;scheduledRunLoopPairs()) {
</span><span class="cx">         SchedulePairHashSet::iterator end = scheduledPairs-&gt;end();
</span><span class="lines">@@ -196,6 +250,7 @@
</span><span class="cx">         [connection() start];
</span><span class="cx">     else
</span><span class="cx">         d-&gt;m_startWhenScheduled = true;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     LOG(Network, &quot;Handle %p starting connection %p for %@&quot;, this, connection(), firstRequest().nsURLRequest(DoNotUpdateHTTPBody));
</span><span class="cx">     
</span><span class="lines">@@ -230,6 +285,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ResourceHandle::schedule(SchedulePair* pair)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     NSRunLoop *runLoop = pair-&gt;nsRunLoop();
</span><span class="cx">     if (!runLoop)
</span><span class="cx">         return;
</span><span class="lines">@@ -238,12 +294,19 @@
</span><span class="cx">         [d-&gt;m_connection.get() start];
</span><span class="cx">         d-&gt;m_startWhenScheduled = false;
</span><span class="cx">     }
</span><ins>+#else
+    UNUSED_PARAM(pair);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceHandle::unschedule(SchedulePair* pair)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (NSRunLoop *runLoop = pair-&gt;nsRunLoop())
</span><span class="cx">         [d-&gt;m_connection.get() unscheduleFromRunLoop:runLoop forMode:(NSString *)pair-&gt;mode()];
</span><ins>+#else
+    UNUSED_PARAM(pair);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> id ResourceHandle::delegate()
</span><span class="lines">@@ -299,10 +362,19 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     handle-&gt;createNSURLConnection(
</span><span class="cx">         handle-&gt;delegate(),
</span><span class="cx">         storedCredentials == AllowStoredCredentials,
</span><span class="cx">         handle-&gt;shouldContentSniff() || context-&gt;localFileContentSniffingEnabled());
</span><ins>+#else
+    handle-&gt;createNSURLConnection(
+        handle-&gt;delegate(), // A synchronous request cannot turn into a download, so there is no need to proxy the delegate.
+        storedCredentials == AllowStoredCredentials,
+        shouldRelaxThirdPartyCookiePolicy(context, request.url()),
+        handle-&gt;shouldContentSniff() || (context &amp;&amp; context-&gt;localFileContentSniffingEnabled()),
+        (NSDictionary *)handle-&gt;client()-&gt;connectionProperties(handle.get()));
+#endif
</ins><span class="cx"> 
</span><span class="cx">     [handle-&gt;connection() scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:(NSString *)synchronousLoadRunLoopMode()];
</span><span class="cx">     [handle-&gt;connection() start];
</span><span class="lines">@@ -492,6 +564,19 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // If the challenge is for a proxy protection space, look for default credentials in
+    // the keychain.  CFNetwork used to handle this until WebCore was changed to always
+    // return NO to -connectionShouldUseCredentialStorage: for &lt;rdar://problem/7704943&gt;.
+    if (!challenge.previousFailureCount() &amp;&amp; challenge.protectionSpace().isProxy()) {
+        NSURLAuthenticationChallenge *macChallenge = mac(challenge);
+        if (NSURLCredential *credential = [[NSURLCredentialStorage sharedCredentialStorage] defaultCredentialForProtectionSpace:[macChallenge protectionSpace]]) {
+            [challenge.sender() useCredential:credential forAuthenticationChallenge:macChallenge];
+            return;
+        }
+    }
+#endif // PLATFORM(IOS)
+
</ins><span class="cx">     d-&gt;m_currentMacChallenge = challenge.nsURLAuthenticationChallenge();
</span><span class="cx">     d-&gt;m_currentWebChallenge = core(d-&gt;m_currentMacChallenge);
</span><span class="cx">     d-&gt;m_currentWebChallenge.setAuthenticationClient(this);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacResourceRequestMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/ResourceRequestMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/ResourceRequestMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/mac/ResourceRequestMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -59,6 +59,9 @@
</span><span class="cx"> 
</span><span class="cx"> ResourceRequest::ResourceRequest(NSURLRequest *nsRequest)
</span><span class="cx">     : ResourceRequestBase()
</span><ins>+#if PLATFORM(IOS)
+    , m_mainResourceRequest(false)
+#endif
</ins><span class="cx">     , m_cfRequest([nsRequest _CFURLRequest])
</span><span class="cx">     , m_nsRequest(nsRequest)
</span><span class="cx"> {
</span><span class="lines">@@ -66,8 +69,25 @@
</span><span class="cx"> 
</span><span class="cx"> void ResourceRequest::updateNSURLRequest()
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    // There is client code that extends NSURLRequest and expects to get back, in the delegate
+    // callbacks, an object of the same type that they passed into WebKit. To keep then running, we
+    // create an object of the same type and return that. See &lt;rdar://9843582&gt;.
+    // Also, developers really really want an NSMutableURLRequest so try to create an
+    // NSMutableURLRequest instead of NSURLRequest.
+    static Class nsURLRequestClass = [NSURLRequest class];
+    static Class nsMutableURLRequestClass = [NSMutableURLRequest class];
+    Class requestClass = [m_nsRequest.get() class];
+
+    if (!requestClass || requestClass == nsURLRequestClass)
+        requestClass = nsMutableURLRequestClass;
+
</ins><span class="cx">     if (m_cfRequest)
</span><ins>+        m_nsRequest = adoptNS([[requestClass alloc] _initWithCFURLRequest:m_cfRequest.get()]);
+#else
+    if (m_cfRequest)
</ins><span class="cx">         m_nsRequest = adoptNS([[NSURLRequest alloc] _initWithCFURLRequest:m_cfRequest.get()]);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #else
</span><span class="lines">@@ -232,8 +252,10 @@
</span><span class="cx"> 
</span><span class="cx"> void ResourceRequest::applyWebArchiveHackForMail()
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     // Hack because Mail checks for this property to detect data / archive loads
</span><span class="cx">     [NSURLProtocol setProperty:@&quot;&quot; forKey:@&quot;WebDataRequest&quot; inRequest:(NSMutableURLRequest *)nsURLRequest(DoNotUpdateHTTPBody)];
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceRequest::setStorageSession(CFURLStorageSessionRef storageSession)
</span><span class="lines">@@ -244,6 +266,7 @@
</span><span class="cx">     
</span><span class="cx"> #endif // USE(CFNETWORK)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> static bool initQuickLookResourceCachingQuirks()
</span><span class="cx"> {
</span><span class="cx">     if (applicationIsSafari())
</span><span class="lines">@@ -262,11 +285,16 @@
</span><span class="cx">     }
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> bool ResourceRequest::useQuickLookResourceCachingQuirks()
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     static bool flag = initQuickLookResourceCachingQuirks();
</span><span class="cx">     return flag;
</span><ins>+#else
+    return false;
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacUTIUtilitiesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/UTIUtilities.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/UTIUtilities.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/mac/UTIUtilities.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> SOFT_LINK(MobileCoreServices, UTTypeCopyDeclaration, CFDictionaryRef, (CFStringRef inUTI), (inUTI))
</span><span class="cx"> SOFT_LINK(MobileCoreServices, UTTypeCopyPreferredTagWithClass, CFStringRef, (CFStringRef inUTI, CFStringRef inTagClass), (inUTI, inTagClass))
</span><ins>+SOFT_LINK(MobileCoreServices, UTTypeCreatePreferredIdentifierForTag, CFStringRef, (CFStringRef inTagClass, CFStringRef inTag, CFStringRef inConformingToUTI), (inTagClass, inTag, inConformingToUTI))
</ins><span class="cx"> 
</span><span class="cx"> SOFT_LINK_CONSTANT(MobileCoreServices, kUTTypeConformsToKey, CFStringRef)
</span><span class="cx"> SOFT_LINK_CONSTANT(MobileCoreServices, kUTTagClassMIMEType, CFStringRef)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacWebCoreResourceHandleAsDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -93,10 +93,14 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(Network, &quot;Handle %p delegate connectionShouldUseCredentialStorage:%p&quot;, m_handle, connection);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    return NO;
+#else
</ins><span class="cx">     if (!m_handle)
</span><span class="cx">         return NO;
</span><span class="cx"> 
</span><span class="cx">     return m_handle-&gt;shouldUseCredentialStorage();
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
</span><span class="lines">@@ -141,7 +145,9 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)r
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     UNUSED_PARAM(connection);
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     LOG(Network, &quot;Handle %p delegate connection:%p didReceiveResponse:%p (HTTP status %d, reported MIMEType '%s')&quot;, m_handle, connection, r, [r respondsToSelector:@selector(statusCode)] ? [(id)r statusCode] : 0, [[r MIMEType] UTF8String]);
</span><span class="cx"> 
</span><span class="lines">@@ -153,9 +159,17 @@
</span><span class="cx">     if (statusCode != 304)
</span><span class="cx">         adjustMIMETypeIfNecessary([r _CFURLResponse]);
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if ([m_handle-&gt;firstRequest().nsURLRequest(DoNotUpdateHTTPBody) _propertyForKey:@&quot;ForceHTMLMIMEType&quot;])
</span><span class="cx">         [r _setMIMEType:@&quot;text/html&quot;];
</span><ins>+#endif
</ins><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+    m_handle-&gt;setQuickLookHandle(QuickLookHandle::create(m_handle, connection, r, self));
+    if (m_handle-&gt;quickLookHandle())
+        r = m_handle-&gt;quickLookHandle()-&gt;nsResponse();
+#endif
+
</ins><span class="cx">     m_handle-&gt;client()-&gt;didReceiveResponse(m_handle, r);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -171,6 +185,11 @@
</span><span class="cx">     if (!m_handle || !m_handle-&gt;client())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+    if (m_handle-&gt;quickLookHandle() &amp;&amp; m_handle-&gt;quickLookHandle()-&gt;didReceiveDataArray(reinterpret_cast&lt;CFArrayRef&gt;(dataArray)))
+        return;
+#endif
+
</ins><span class="cx">     m_handle-&gt;handleDataArray(reinterpret_cast&lt;CFArrayRef&gt;(dataArray));
</span><span class="cx">     // The call to didReceiveData above can cancel a load, and if so, the delegate (self) could have been deallocated by this point.
</span><span class="cx"> }
</span><span class="lines">@@ -183,12 +202,22 @@
</span><span class="cx"> 
</span><span class="cx">     LOG(Network, &quot;Handle %p delegate connection:%p didReceiveData:%p lengthReceived:%lld&quot;, m_handle, connection, data, lengthReceived);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    if ([data length] == 0) // &lt;rdar://problem/5532931&gt;
+        return;
+#endif
+
</ins><span class="cx">     if (!m_handle || !m_handle-&gt;client())
</span><span class="cx">         return;
</span><span class="cx">     // FIXME: If we get more than 2B bytes in a single chunk, this code won't do the right thing.
</span><span class="cx">     // However, with today's computers and networking speeds, this won't happen in practice.
</span><span class="cx">     // Could be an issue with a giant local file.
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+    if (m_handle-&gt;quickLookHandle() &amp;&amp; m_handle-&gt;quickLookHandle()-&gt;didReceiveData(reinterpret_cast&lt;CFDataRef&gt;(data)))
+        return;
+#endif
+
</ins><span class="cx">     // FIXME: https://bugs.webkit.org/show_bug.cgi?id=19793
</span><span class="cx">     // -1 means we do not provide any data about transfer size to inspector so it would use
</span><span class="cx">     // Content-Length headers or content size to show transfer size.
</span><span class="lines">@@ -230,6 +259,11 @@
</span><span class="cx">     if (!m_handle || !m_handle-&gt;client())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+    if (m_handle-&gt;quickLookHandle() &amp;&amp; m_handle-&gt;quickLookHandle()-&gt;didFinishLoading())
+        return;
+#endif
+
</ins><span class="cx">     m_handle-&gt;client()-&gt;didFinishLoading(m_handle, 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -242,6 +276,11 @@
</span><span class="cx">     if (!m_handle || !m_handle-&gt;client())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+#if USE(QUICK_LOOK)
+    if (m_handle-&gt;quickLookHandle())
+        m_handle-&gt;quickLookHandle()-&gt;didFail();
+#endif
+
</ins><span class="cx">     m_handle-&gt;client()-&gt;didFail(m_handle, error);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/sql/SQLiteDatabase.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteDatabase.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/sql/SQLiteDatabase.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -107,7 +107,9 @@
</span><span class="cx">     const char* lastErrorMsg();
</span><span class="cx">     
</span><span class="cx">     sqlite3* sqlite3Handle() const {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">         ASSERT(m_sharable || currentThread() == m_openingThread || !m_db);
</span><ins>+#endif
</ins><span class="cx">         return m_db;
</span><span class="cx">     }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteFileSystemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/sql/SQLiteFileSystem.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteFileSystem.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/sql/SQLiteFileSystem.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -38,6 +38,10 @@
</span><span class="cx"> #include &lt;inttypes.h&gt;
</span><span class="cx"> #include &lt;sqlite3.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;sqlite3_private.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> SQLiteFileSystem::SQLiteFileSystem()
</span><span class="lines">@@ -110,6 +114,13 @@
</span><span class="cx">     return deleteFile(fileName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+bool SQLiteFileSystem::truncateDatabaseFile(sqlite3* database)
+{
+    return sqlite3_file_control(database, 0, SQLITE_TRUNCATE_DATABASE, 0) == SQLITE_OK;
+}
+#endif
+    
</ins><span class="cx"> long long SQLiteFileSystem::getDatabaseFileSize(const String&amp; fileName)
</span><span class="cx"> {        
</span><span class="cx">     long long size;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteFileSystemh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/sql/SQLiteFileSystem.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteFileSystem.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/sql/SQLiteFileSystem.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -99,6 +99,13 @@
</span><span class="cx">     // fileName - The file name.
</span><span class="cx">     static bool deleteDatabaseFile(const String&amp; fileName);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // Truncates a database file. Used when MobileSafariSettings deletes a database file,
+    // since deleting the file nukes the POSIX file locks which would potentially cause Safari
+    // to corrupt the new db if it's running in the background.
+    static bool truncateDatabaseFile(sqlite3* database);
+#endif
+    
</ins><span class="cx">     // Returns the size of the database file.
</span><span class="cx">     //
</span><span class="cx">     // fileName - The file name.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqlSQLiteTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/sql/SQLiteTransaction.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/SQLiteTransaction.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/sql/SQLiteTransaction.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -28,6 +28,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;SQLiteDatabase.h&quot;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;SQLiteDatabaseTracker.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> SQLiteTransaction::SQLiteTransaction(SQLiteDatabase&amp; db, bool readOnly)
</span><span class="lines">@@ -54,11 +58,18 @@
</span><span class="cx">         // any statements. If that happens, this transaction will fail.
</span><span class="cx">         // http://www.sqlite.org/lang_transaction.html
</span><span class="cx">         // http://www.sqlite.org/lockingv3.html#locking
</span><ins>+#if PLATFORM(IOS)
+        SQLiteDatabaseTracker::incrementTransactionInProgressCount();
+#endif
</ins><span class="cx">         if (m_readOnly)
</span><span class="cx">             m_inProgress = m_db.executeCommand(&quot;BEGIN&quot;);
</span><span class="cx">         else
</span><span class="cx">             m_inProgress = m_db.executeCommand(&quot;BEGIN IMMEDIATE&quot;);
</span><span class="cx">         m_db.m_transactionInProgress = m_inProgress;
</span><ins>+#if PLATFORM(IOS)
+        if (!m_inProgress)
+            SQLiteDatabaseTracker::decrementTransactionInProgressCount();
+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -68,6 +79,10 @@
</span><span class="cx">         ASSERT(m_db.m_transactionInProgress);
</span><span class="cx">         m_inProgress = !m_db.executeCommand(&quot;COMMIT&quot;);
</span><span class="cx">         m_db.m_transactionInProgress = m_inProgress;
</span><ins>+#if PLATFORM(IOS)
+        if (!m_inProgress)
+            SQLiteDatabaseTracker::decrementTransactionInProgressCount();
+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -82,6 +97,9 @@
</span><span class="cx">         m_db.executeCommand(&quot;ROLLBACK&quot;);
</span><span class="cx">         m_inProgress = false;
</span><span class="cx">         m_db.m_transactionInProgress = false;
</span><ins>+#if PLATFORM(IOS)
+        SQLiteDatabaseTracker::decrementTransactionInProgressCount();
+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -90,6 +108,9 @@
</span><span class="cx">     if (m_inProgress) {
</span><span class="cx">         m_inProgress = false;
</span><span class="cx">         m_db.m_transactionInProgress = false;
</span><ins>+#if PLATFORM(IOS)
+        SQLiteDatabaseTracker::decrementTransactionInProgressCount();
+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformsqliosSQLiteDatabaseTrackercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.cpp (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,86 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2012 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;SQLiteDatabaseTracker.h&quot;
+
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/StdLibExtras.h&gt;
+#include &lt;wtf/ThreadingPrimitives.h&gt;
+
+namespace WebCore {
+
+namespace SQLiteDatabaseTracker {
+
+static SQLiteDatabaseTrackerClient* s_staticSQLiteDatabaseTrackerClient = 0;
+static unsigned s_transactionInProgressCounter = 0;
+
+static Mutex&amp; transactionInProgressMutex()
+{
+    static NeverDestroyed&lt;Mutex&gt; tipMutex;
+    return tipMutex;
+}
+
+void setClient(SQLiteDatabaseTrackerClient* client)
+{
+    ASSERT(client);
+    ASSERT(!s_staticSQLiteDatabaseTrackerClient || s_staticSQLiteDatabaseTrackerClient == client);
+    s_staticSQLiteDatabaseTrackerClient = client;
+}
+
+void incrementTransactionInProgressCount()
+{
+    if (!s_staticSQLiteDatabaseTrackerClient)
+        return;
+    MutexLocker lock(transactionInProgressMutex());
+
+    s_transactionInProgressCounter++;
+    if (s_transactionInProgressCounter == 1)
+        s_staticSQLiteDatabaseTrackerClient-&gt;willBeginFirstTransaction();
+}
+
+void decrementTransactionInProgressCount()
+{
+    if (!s_staticSQLiteDatabaseTrackerClient)
+        return;
+    MutexLocker lock(transactionInProgressMutex());
+
+    ASSERT(s_transactionInProgressCounter);
+    s_transactionInProgressCounter--;
+
+    if (!s_transactionInProgressCounter)
+        s_staticSQLiteDatabaseTrackerClient-&gt;didFinishLastTransaction();
+}
+
+#if !ASSERT_DISABLED
+bool hasTransactionInProgress()
+{
+    return !s_staticSQLiteDatabaseTrackerClient || s_transactionInProgressCounter &gt; 0;
+}
+#endif // !ASSERT_DISABLED
+
+} // namespace SQLiteDatabaseTracker
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformsqliosSQLiteDatabaseTrackerhfromrev161588trunkSourceWebCoreplatformMemoryPressureHandlercpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.h (from rev 161588, trunk/Source/WebCore/platform/MemoryPressureHandler.cpp) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.h                                (rev 0)
+++ trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTracker.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2012 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SQLiteDatabaseTracker_h
+#define SQLiteDatabaseTracker_h
+
+#include &quot;SQLiteDatabaseTrackerClient.h&quot;
+#include &lt;wtf/Noncopyable.h&gt;
+
+namespace WebCore {
+
+namespace SQLiteDatabaseTracker {
+
+void decrementTransactionInProgressCount();
+void incrementTransactionInProgressCount();
+
+void setClient(SQLiteDatabaseTrackerClient*);
+
+#if !ASSERT_DISABLED
+bool hasTransactionInProgress();
+#endif // !ASSERT_DISABLED
+
+};
+
+class SQLiteTransactionInProgressAutoCounter {
+public:
+    SQLiteTransactionInProgressAutoCounter()
+    {
+        SQLiteDatabaseTracker::incrementTransactionInProgressCount();
+    }
+    ~SQLiteTransactionInProgressAutoCounter()
+    {
+        SQLiteDatabaseTracker::decrementTransactionInProgressCount();
+    }
+};
+
+} // namespace WebCore
+
+#endif // SQLiteDatabaseTracker_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformsqliosSQLiteDatabaseTrackerClienthfromrev161588trunkSourceWebCoreplatformKillRingNonecpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTrackerClient.h (from rev 161588, trunk/Source/WebCore/platform/KillRingNone.cpp) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTrackerClient.h                                (rev 0)
+++ trunk/Source/WebCore/platform/sql/ios/SQLiteDatabaseTrackerClient.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SQLiteDatabaseTrackerClient_h
+#define SQLiteDatabaseTrackerClient_h
+
+namespace WebCore {
+
+class SQLiteDatabaseTrackerClient {
+public:
+    virtual ~SQLiteDatabaseTrackerClient() { }
+
+    virtual void willBeginFirstTransaction() = 0;
+    virtual void didFinishLastTransaction() = 0;
+};
+
+} // namespace WebCore
+
+#endif // SQLiteDatabaseTrackerClient_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformtextPlatformLocalecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/PlatformLocale.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/PlatformLocale.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/PlatformLocale.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -328,6 +328,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> String Locale::formatDateTime(const DateComponents&amp; date, FormatType formatType)
</span><span class="cx"> {
</span><span class="cx">     if (date.type() == DateComponents::Invalid)
</span><span class="lines">@@ -363,6 +364,8 @@
</span><span class="cx">     }
</span><span class="cx">     return builder.toString();
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextPlatformLocaleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/PlatformLocale.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/PlatformLocale.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/PlatformLocale.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -33,6 +33,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+class Font;
+#endif
+
</ins><span class="cx"> class Locale {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(Locale);
</span><span class="cx"> 
</span><span class="lines">@@ -113,9 +117,19 @@
</span><span class="cx">     // display to the user. If an implementation doesn't support
</span><span class="cx">     // localized dates the function should return an empty string.
</span><span class="cx">     // FormatType can be used to specify if you want the short format. 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     String formatDateTime(const DateComponents&amp;, FormatType = FormatTypeUnspecified);
</span><ins>+#else
+    virtual String formatDateTime(const DateComponents&amp;, FormatType = FormatTypeUnspecified) = 0;
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    // FIXME: This code should be merged with Open Source in a way that is future compatible.
+    // Maximum width for a formatted date string with a specified font.
+    virtual float maximumWidthForDateType(DateComponents::Type, const Font&amp;) = 0;
+#endif
+
</ins><span class="cx">     virtual ~Locale();
</span><span class="cx"> 
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextBreakIteratorICUcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextBreakIteratorICU.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextBreakIteratorICU.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/TextBreakIteratorICU.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -571,6 +571,7 @@
</span><span class="cx">     return ruleStatus != UBRK_WORD_NONE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx"> static TextBreakIterator* setUpIteratorWithRules(bool&amp; createdIterator, TextBreakIterator*&amp; iterator,
</span><span class="cx">     const char* breakRules, const UChar* string, int length)
</span><span class="cx"> {
</span><span class="lines">@@ -595,9 +596,11 @@
</span><span class="cx"> 
</span><span class="cx">     return iterator;
</span><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><span class="cx"> TextBreakIterator* cursorMovementIterator(const UChar* string, int length)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     // This rule set is based on character-break iterator rules of ICU 4.0
</span><span class="cx">     // &lt;http://source.icu-project.org/repos/icu/icu/tags/release-4-0/source/data/brkitr/char.txt&gt;.
</span><span class="cx">     // The major differences from the original ones are listed below:
</span><span class="lines">@@ -683,6 +686,30 @@
</span><span class="cx">     static bool createdCursorMovementIterator = false;
</span><span class="cx">     static TextBreakIterator* staticCursorMovementIterator;
</span><span class="cx">     return setUpIteratorWithRules(createdCursorMovementIterator, staticCursorMovementIterator, kRules, string, length);
</span><ins>+#else // PLATFORM(IOS)
+    // Use the special Thai character break iterator for all locales
+    static bool createdCursorBreakIterator;
+    static TextBreakIterator* staticCursorBreakIterator;
+
+    if (!string)
+        return nullptr;
+
+    if (!createdCursorBreakIterator) {
+        UErrorCode openStatus = U_ZERO_ERROR;
+        staticCursorBreakIterator = reinterpret_cast&lt;TextBreakIterator*&gt;(ubrk_open(UBRK_CHARACTER, &quot;th&quot;, 0, 0, &amp;openStatus));
+        createdCursorBreakIterator = true;
+        ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), &quot;ICU could not open a break iterator: %s (%d)&quot;, u_errorName(openStatus), openStatus);
+    }
+    if (!staticCursorBreakIterator)
+        return nullptr;
+
+    UErrorCode setTextStatus = U_ZERO_ERROR;
+    ubrk_setText(reinterpret_cast&lt;UBreakIterator*&gt;(staticCursorBreakIterator), string, length, &amp;setTextStatus);
+    if (U_FAILURE(setTextStatus))
+        return nullptr;
+
+    return staticCursorBreakIterator;
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextCodecICUcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextCodecICU.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextCodecICU.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/TextCodecICU.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -44,6 +44,18 @@
</span><span class="cx"> 
</span><span class="cx"> const size_t ConversionBufferSize = 16384;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+static const char* textCodecMacAliases[] = {
+    &quot;macos-7_3-10.2&quot;, // xmaccyrillic, maccyrillic
+    &quot;macos-6_2-10.4&quot;, // xmacgreek
+    &quot;macos-6-10.2&quot;,   // macgreek
+    &quot;macos-29-10.2&quot;,  // xmaccentraleurroman, maccentraleurroman
+    &quot;macos-35-10.2&quot;,  // xmacturkish, macturkish
+    &quot;softbank-sjis&quot;,  // softbanksjis
+    nullptr
+};
+#endif
+
</ins><span class="cx"> ICUConverterWrapper::~ICUConverterWrapper()
</span><span class="cx"> {
</span><span class="cx">     if (converter)
</span><span class="lines">@@ -180,6 +192,29 @@
</span><span class="cx">     registrar(&quot;ISO8859-15&quot;, &quot;ISO-8859-15&quot;);
</span><span class="cx">     // Not registering ISO8859-16, because Firefox (as of version 3.6.6) doesn't know this particular alias,
</span><span class="cx">     // and because older versions of ICU don't support ISO-8859-16 encoding at all.
</span><ins>+
+#if PLATFORM(IOS)
+    // A.B. adding a few more Mac encodings missing 'cause we don't have TextCodecMac right now
+    // luckily, they are supported in ICU, just need to alias them.
+    // this handles encodings that OS X uses TEC (TextCodecMac)
+    // &lt;http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r0m0/index.jsp?topic=/com.ibm.etools.mft.eb.doc/ac00408_.htm&gt;
+    int32_t i = 0;
+    for (const char* macAlias = textCodecMacAliases[i]; macAlias; macAlias = textCodecMacAliases[++i]) {
+        registrar(macAlias, macAlias);
+
+        UErrorCode error = U_ZERO_ERROR;
+        uint16_t numAliases = ucnv_countAliases(macAlias, &amp;error);
+        ASSERT(U_SUCCESS(error));
+        if (U_SUCCESS(error))
+            for (uint16_t j = 0; j &lt; numAliases; ++j) {
+                error = U_ZERO_ERROR;
+                const char* alias = ucnv_getAlias(macAlias, j, &amp;error);
+                ASSERT(U_SUCCESS(error));
+                if (U_SUCCESS(error) &amp;&amp; strcmp(alias, macAlias))
+                    registrar(alias, macAlias);
+            }
+    }
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TextCodecICU::registerCodecs(TextCodecRegistrar registrar)
</span><span class="lines">@@ -217,6 +252,13 @@
</span><span class="cx">     // FIXME: Is there a good way to determine the most up to date variant programmatically?
</span><span class="cx">     registrar(&quot;windows-874&quot;, create, &quot;windows-874-2000&quot;);
</span><span class="cx">     registrar(&quot;windows-949&quot;, create, &quot;windows-949-2000&quot;);
</span><ins>+
+#if PLATFORM(IOS)
+    // See comment above in registerEncodingNames().
+    int32_t i = 0;
+    for (const char* alias = textCodecMacAliases[i]; alias; alias = textCodecMacAliases[++i])
+        registrar(alias, create, 0);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TextCodecICU::TextCodecICU(const char* encoding, const char* canonicalConverterName)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextEncodingRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> #if USE(ICU_UNICODE)
</span><span class="cx"> #include &quot;TextCodecICU.h&quot;
</span><span class="cx"> #endif
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx"> #include &quot;TextCodecMac.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> #if OS(WINDOWS) &amp;&amp; USE(WCHAR_UNICODE)
</span><span class="lines">@@ -284,7 +284,7 @@
</span><span class="cx">     TextCodecICU::registerCodecs(addToTextCodecMap);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     TextCodecMac::registerEncodingNames(addToTextEncodingNameMap);
</span><span class="cx">     TextCodecMac::registerCodecs(addToTextCodecMap);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextcfHyphenationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/cf/HyphenationCF.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/cf/HyphenationCF.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/cf/HyphenationCF.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -60,7 +60,17 @@
</span><span class="cx"> 
</span><span class="cx"> bool canHyphenate(const AtomicString&amp; localeIdentifier)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     return cfLocaleCache().get(localeIdentifier);
</span><ins>+#else
+#if !(defined(WTF_ARM_ARCH_VERSION) &amp;&amp; WTF_ARM_ARCH_VERSION == 6)
+    return cfLocaleCache().get(localeIdentifier);
+#else
+    // Hyphenation is not available on devices with ARMv6 processors. See &lt;rdar://8352570&gt;.
+    UNUSED_PARAM(localeIdentifier);
+    return false;
+#endif
+#endif // PLATFORM(IOS)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> size_t lastHyphenLocation(const UChar* characters, size_t length, size_t beforeIndex, const AtomicString&amp; localeIdentifier)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextiosLocalizedDateCachehfromrev161588trunkSourceWebCoreplatformMemoryPressureHandlerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h (from rev 161588, trunk/Source/WebCore/platform/MemoryPressureHandler.h) (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h                                (rev 0)
+++ trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LocalizedDateCache_h
+#define LocalizedDateCache_h
+
+#include &quot;DateComponents.h&quot;
+#include &quot;Font.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/RetainPtr.h&gt;
+
+// FIXME: Rename this file to LocalizedDataCacheIOS.mm and remove this guard.
+#if PLATFORM(IOS)
+
+namespace WebCore {
+
+class LocalizedDateCache {
+public:
+    NSDateFormatter *formatterForDateType(DateComponents::Type);
+    float maximumWidthForDateType(DateComponents::Type, const Font&amp;);
+    void localeChanged();
+
+private:
+    LocalizedDateCache();
+    ~LocalizedDateCache();
+
+    NSDateFormatter *createFormatterForType(DateComponents::Type);
+    float calculateMaximumWidth(DateComponents::Type, const Font&amp;);
+
+    // Using int instead of DateComponents::Type for the key because the enum
+    // does not have a default hash and hash traits. Usage of the maps
+    // casts the DateComponents::Type into an int as the key.
+    typedef HashMap&lt;int, RetainPtr&lt;NSDateFormatter&gt;&gt; DateTypeFormatterMap;
+    typedef HashMap&lt;int, float&gt; DateTypeMaxWidthMap;
+    DateTypeFormatterMap m_formatterMap;
+    DateTypeMaxWidthMap m_maxWidthMap;
+    Font m_font;
+
+    friend LocalizedDateCache&amp; localizedDateCache();
+    friend NeverDestroyed&lt;LocalizedDateCache&gt;;
+};
+
+// Singleton.
+LocalizedDateCache&amp; localizedDateCache();
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
+#endif // LocalizedDateCache_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformtextiosLocalizedDateCachemm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.mm (0 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/text/ios/LocalizedDateCache.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -0,0 +1,190 @@
</span><ins>+/*
+ * Copyright (C) 2011 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;LocalizedDateCache.h&quot;
+
+#import &quot;Font.h&quot;
+#import &quot;TextRun.h&quot;
+#import &lt;math.h&gt;
+#import &lt;wtf/Assertions.h&gt;
+#import &lt;wtf/StdLibExtras.h&gt;
+#import &lt;CoreFoundation/CFNotificationCenter.h&gt;
+
+// FIXME: Rename this file to LocalizedDataCacheIOS.mm and remove this guard.
+#if PLATFORM(IOS)
+
+using namespace std;
+
+namespace WebCore {
+
+LocalizedDateCache&amp; localizedDateCache()
+{
+    static NeverDestroyed&lt;LocalizedDateCache&gt; cache;
+    return cache;
+}
+
+static void _localeChanged(CFNotificationCenterRef, void*, CFStringRef, const void*, CFDictionaryRef)
+{
+    localizedDateCache().localeChanged();
+}
+
+LocalizedDateCache::LocalizedDateCache()
+    : m_font(Font())
+{
+    // Listen to CF Notifications for locale change, and clear the cache when it does.
+    CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), (void*)this, _localeChanged,
+                                    kCFLocaleCurrentLocaleDidChangeNotification,
+                                    NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
+}
+
+LocalizedDateCache::~LocalizedDateCache()
+{
+    // NOTE: Singleton does not expect to be deconstructed.
+    CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), (void*)this,
+                                       kCFLocaleCurrentLocaleDidChangeNotification, NULL);
+}
+
+void LocalizedDateCache::localeChanged()
+{
+    m_maxWidthMap.clear();
+    m_formatterMap.clear();
+}
+
+NSDateFormatter *LocalizedDateCache::formatterForDateType(DateComponents::Type type)
+{
+    int key = static_cast&lt;int&gt;(type);
+    if (m_formatterMap.contains(key))
+        return m_formatterMap.get(key).get();
+
+    NSDateFormatter *dateFormatter = [createFormatterForType(type) autorelease];
+    m_formatterMap.set(key, dateFormatter);
+    return dateFormatter;
+}
+
+float LocalizedDateCache::maximumWidthForDateType(DateComponents::Type type, const Font&amp; font)
+{
+    int key = static_cast&lt;int&gt;(type);
+    if (m_font == font) {
+        if (m_maxWidthMap.contains(key))
+            return m_maxWidthMap.get(key);
+    } else {
+        m_font = Font(font);
+        m_maxWidthMap.clear();
+    }
+
+    float calculatedMaximum = calculateMaximumWidth(type, font);
+    m_maxWidthMap.set(key, calculatedMaximum);
+    return calculatedMaximum;
+}
+
+NSDateFormatter *LocalizedDateCache::createFormatterForType(DateComponents::Type type)
+{
+    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
+    NSLocale *currentLocale = [NSLocale currentLocale];
+    [dateFormatter setLocale:currentLocale];
+
+    switch (type) {
+    case DateComponents::Invalid:
+        ASSERT_NOT_REACHED();
+        break;
+    case DateComponents::Date:
+        [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
+        [dateFormatter setTimeStyle:NSDateFormatterNoStyle];
+        [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
+        break;
+    case DateComponents::DateTime:
+        [dateFormatter setTimeZone:[NSTimeZone localTimeZone]];
+        [dateFormatter setTimeStyle:NSDateFormatterShortStyle];
+        [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
+        break;
+    case DateComponents::DateTimeLocal:
+        [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
+        [dateFormatter setTimeStyle:NSDateFormatterShortStyle];
+        [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
+        break;
+    case DateComponents::Month:
+        [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
+        [dateFormatter setDateFormat:[NSDateFormatter dateFormatFromTemplate:@&quot;MMMMyyyy&quot; options:0 locale:currentLocale]];
+        break;
+    case DateComponents::Time:
+        [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
+        [dateFormatter setTimeStyle:NSDateFormatterShortStyle];
+        [dateFormatter setDateStyle:NSDateFormatterNoStyle];
+        break;
+    case DateComponents::Week:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+
+    return dateFormatter;
+}
+
+// NOTE: This does not check for the widest day of the week.
+// We assume no formatter option shows that information.
+float LocalizedDateCache::calculateMaximumWidth(DateComponents::Type type, const Font&amp; font)
+{
+    float maximumWidth = 0;
+
+    // Get the formatter we would use, copy it because we will force its time zone to be UTC.
+    NSDateFormatter *dateFormatter = [[formatterForDateType(type) copy] autorelease];
+    [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
+
+    // Sample date with a 4 digit year and 2 digit day, hour, and minute. Digits are
+    // typically all equally wide. Force UTC timezone for the test date below so the
+    // date doesn't adjust for the current timezone. This is an arbitrary date
+    // (x-27-2007) and time (10:45 PM).
+    RetainPtr&lt;NSCalendar&gt; gregorian = adoptNS([[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]);
+    [gregorian.get() setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
+    RetainPtr&lt;NSDateComponents&gt; components = adoptNS([[NSDateComponents alloc] init]);
+    [components.get() setDay:27];
+    [components.get() setYear:2007];
+    [components.get() setHour:22];
+    [components.get() setMinute:45];
+
+    static NSUInteger numberOfGregorianMonths = [[dateFormatter monthSymbols] count];
+    ASSERT(numberOfGregorianMonths == 12);
+
+    // For each month (in the Gregorian Calendar), format a date and measure its length.
+    NSUInteger totalMonthsToTest = 1;
+    if (type == DateComponents::Date
+        || type == DateComponents::DateTime
+        || type == DateComponents::DateTimeLocal
+        || type == DateComponents::Month)
+        totalMonthsToTest = numberOfGregorianMonths;
+    for (NSUInteger i = 0; i &lt; totalMonthsToTest; ++i) {
+        [components.get() setMonth:(i + 1)];
+        NSDate *date = [gregorian.get() dateFromComponents:components.get()];
+        NSString *formattedDate = [dateFormatter stringFromDate:date];
+        String str = String(formattedDate);
+        maximumWidth = max(maximumWidth, font.width(str));
+    }
+
+    return maximumWidth;
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformtextmacCharsetDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/mac/CharsetData.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/mac/CharsetData.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/mac/CharsetData.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -23,6 +23,10 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+typedef UInt32                          TextEncoding;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx">     #define kTextEncodingISOLatinThai kCFStringEncodingISOLatinThai
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextmacLocaleMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/mac/LocaleMac.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/mac/LocaleMac.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/mac/LocaleMac.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -51,6 +51,11 @@
</span><span class="cx">     static PassOwnPtr&lt;LocaleMac&gt; create(NSLocale*);
</span><span class="cx">     ~LocaleMac();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+    virtual float maximumWidthForDateType(DateComponents::Type, const Font&amp;) OVERRIDE;
+    virtual String formatDateTime(const DateComponents&amp;, FormatType = FormatTypeUnspecified) OVERRIDE;
+#endif
+
</ins><span class="cx"> #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
</span><span class="cx">     virtual String dateFormat() OVERRIDE;
</span><span class="cx">     virtual String monthFormat() OVERRIDE;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextmacLocaleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/mac/LocaleMac.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/mac/LocaleMac.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/mac/LocaleMac.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -40,6 +40,10 @@
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &quot;LocalizedDateCache.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static inline String languageFromLocale(const String&amp; locale)
</span><span class="lines">@@ -116,6 +120,35 @@
</span><span class="cx">     return createDateTimeFormatter(m_locale.get(), m_gregorianCalendar.get(), NSDateFormatterShortStyle, NSDateFormatterNoStyle);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+String LocaleMac::formatDateTime(const DateComponents&amp; dateComponents, FormatType)
+{
+    double msec = dateComponents.millisecondsSinceEpoch();
+    DateComponents::Type type = dateComponents.type();
+
+    // &quot;week&quot; type not supported.
+    ASSERT(type != DateComponents::Invalid);
+    if (type == DateComponents::Week)
+        return String();
+
+    // Incoming msec value is milliseconds since 1970-01-01 00:00:00 UTC. The 1970 epoch.
+    NSTimeInterval secondsSince1970 = (msec / 1000);
+    NSDate *date = [NSDate dateWithTimeIntervalSince1970:secondsSince1970];
+
+    // Return a formatted string.
+    NSDateFormatter *dateFormatter = localizedDateCache().formatterForDateType(type);
+    return [dateFormatter stringFromDate:date];
+}
+
+float LocaleMac::maximumWidthForDateType(DateComponents::Type type, const Font&amp; font)
+{
+    ASSERT(type != DateComponents::Invalid);
+    ASSERT(type != DateComponents::Week);
+
+    return localizedDateCache().maximumWidthForDateType(type, font);
+}
+#endif
+
</ins><span class="cx"> #if ENABLE(DATE_AND_TIME_INPUT_TYPES)
</span><span class="cx"> const Vector&lt;String&gt;&amp; LocaleMac::monthLabels()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextmacTextBoundariesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/mac/TextBoundaries.mm (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/mac/TextBoundaries.mm        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/mac/TextBoundaries.mm        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -26,10 +26,177 @@
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;TextBoundaries.h&quot;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &quot;TextBreakIteratorInternalICU.h&quot;
+#import &lt;CoreFoundation/CFStringTokenizer.h&gt;
+#import &lt;Foundation/Foundation.h&gt;
+#import &lt;unicode/ubrk.h&gt;
+#import &lt;unicode/uchar.h&gt;
+#import &lt;unicode/ustring.h&gt;
+#import &lt;unicode/utypes.h&gt;
+#import &lt;wtf/unicode/CharacterNames.h&gt;
+#import &lt;wtf/RetainPtr.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+
+static bool isSkipCharacter(UChar32 c)
+{
+    return c == 0xA0 || 
+        c == '\n' || 
+        c == '.' || 
+        c == ',' || 
+        c == '!'  || 
+        c == '?' || 
+        c == ';' || 
+        c == ':' || 
+        u_isspace(c);
+}
+
+static bool isWhitespaceCharacter(UChar32 c)
+{
+    return c == 0xA0 || 
+        c == '\n' || 
+        u_isspace(c);
+}
+
+static bool isWordDelimitingCharacter(UChar32 c)
+{
+    CFCharacterSetRef set = CFCharacterSetGetPredefined(kCFCharacterSetAlphaNumeric);
+    // Ampersand is an exception added to treat AT&amp;T as a single word (see &lt;rdar://problem/5022264&gt;).
+    return !CFCharacterSetIsLongCharacterMember(set, c) &amp;&amp; c != '&amp;';
+}
+
+static bool isSymbolCharacter(UChar32 c)
+{
+    CFCharacterSetRef set = CFCharacterSetGetPredefined(kCFCharacterSetSymbol);
+    return CFCharacterSetIsLongCharacterMember(set, c);
+}
+
+static bool isAmbiguousBoundaryCharacter(UChar32 character)
+{
+    // These are characters that can behave as word boundaries, but can appear within words.
+    return character == '\'' || character == rightSingleQuotationMark || character == hebrewPunctuationGershayim;
+}
+
+static CFStringTokenizerRef tokenizerForString(CFStringRef str)
+{
+    static CFStringTokenizerRef tokenizer = nullptr;
+    static CFLocaleRef locale = nullptr;
+
+    if (!locale) {
+        const char* temp = currentTextBreakLocaleID();
+        RetainPtr&lt;CFStringRef&gt; currentLocaleID = adoptCF(CFStringCreateWithBytesNoCopy(nullptr, reinterpret_cast&lt;const UInt8*&gt;(temp), strlen(temp),  kCFStringEncodingASCII, false, kCFAllocatorNull));
+        locale = CFLocaleCreate(nullptr, currentLocaleID.get());
+        if (!locale)
+            return nullptr;
+    }
+
+    CFRange entireRange = CFRangeMake(0, CFStringGetLength(str));    
+
+    if (!tokenizer)
+        tokenizer = CFStringTokenizerCreate(nullptr, str, entireRange, kCFStringTokenizerUnitWordBoundary, locale);
+    else
+        CFStringTokenizerSetString(tokenizer, str, entireRange);
+    return tokenizer;
+}
+
+
+// Simple case: a word is a stream of characters
+// delimited by a special set of word-delimiting characters.
+static void findSimpleWordBoundary(const UChar* chars, int len, int position, int* start, int* end)
+{
+    ASSERT(position &gt;= 0);
+    ASSERT(position &lt; len);
+
+    int startPos = position;
+    while (startPos &gt; 0) {
+        int i = startPos;
+        UChar32 characterBeforeStartPos;
+        U16_PREV(chars, 0, i, characterBeforeStartPos);
+        if (isWordDelimitingCharacter(characterBeforeStartPos)) {
+            ASSERT(i &gt;= 0);
+            if (!i)
+                break;
+
+            if (!isAmbiguousBoundaryCharacter(characterBeforeStartPos))
+                break;
+
+            UChar32 characterBeforeBeforeStartPos;
+            U16_PREV(chars, 0, i, characterBeforeBeforeStartPos);
+            if (isWordDelimitingCharacter(characterBeforeBeforeStartPos))
+                break;
+        }
+        U16_BACK_1(chars, 0, startPos);
+    }
+    
+    int endPos = position;
+    while (endPos &lt; len) {
+        UChar32 character;
+        U16_GET(chars, 0, endPos, len, character);
+        if (isWordDelimitingCharacter(character)) {
+            int i = endPos;
+            U16_FWD_1(chars, i, len);
+            ASSERT(i &lt;= len);
+            if (i == len)
+                break;
+            UChar32 characterAfterEndPos;
+            U16_NEXT(chars, i, len, characterAfterEndPos);
+            if (!isAmbiguousBoundaryCharacter(character))
+                break;
+            if (isWordDelimitingCharacter(characterAfterEndPos))
+                break;
+        }
+        U16_FWD_1(chars, endPos, len);
+    }
+
+    // The text may consist of all delimiter characters (e.g. &quot;++++++++&quot; or a series of emoji), and returning an empty range
+    // makes no sense (and doesn't match findComplexWordBoundary() behavior).
+    if (startPos == endPos &amp;&amp; endPos &lt; len) {
+        UChar32 character;
+        U16_GET(chars, 0, endPos, len, character);
+        if (isSymbolCharacter(character))
+            U16_FWD_1(chars, endPos, len);
+    }
+
+    *start = startPos;
+    *end = endPos;
+}
+
+// Complex case: use CFStringTokenizer to find word boundary.
+static void findComplexWordBoundary(const UChar* chars, int len, int position, int* start, int* end)
+{
+    CFStringRef charString = CFStringCreateWithCharactersNoCopy(NULL, chars, len, kCFAllocatorNull);
+    ASSERT(charString);
+    
+    CFStringTokenizerRef tokenizer = tokenizerForString(charString);
+    if (tokenizer) {        
+        CFStringTokenizerTokenType  token = CFStringTokenizerGoToTokenAtIndex(tokenizer, position);
+        CFRange result;
+        if (token != kCFStringTokenizerTokenNone) {
+            result = CFStringTokenizerGetCurrentTokenRange(tokenizer);
+        } else {
+            // if no token found: select entire block
+            // NB: I never hit this section in all my testing...
+            result.location = 0;
+            result.length = len;
+        }
+        
+        *start = result.location;
+        *end = result.location + result.length;
+    } else {    // error creating tokenizer
+        findSimpleWordBoundary(chars, len, position, start, end);
+    }
+
+    CFRelease(charString);
+}
+#endif
+
</ins><span class="cx"> void findWordBoundary(const UChar* chars, int len, int position, int* start, int* end)
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     NSString* string = [[NSString alloc] initWithCharactersNoCopy:const_cast&lt;unichar*&gt;(chars)
</span><span class="cx">         length:len freeWhenDone:NO];
</span><span class="cx">     NSAttributedString* attr = [[NSAttributedString alloc] initWithString:string];
</span><span class="lines">@@ -38,6 +205,44 @@
</span><span class="cx">     [string release];
</span><span class="cx">     *start = range.location;
</span><span class="cx">     *end = range.location + range.length;
</span><ins>+#else
+    int pos = position;
+    if ( position == len &amp;&amp; position != 0)
+        pos--;
+    
+    // For complex text (Thai, Japanese, Chinese), visible_units will pass the text in as a 
+    // single contiguous run of characters, providing as much context as is possible.
+    // We only need one character to determine if the text is complex.
+    UChar32 ch;
+    int i = pos;
+    U16_NEXT(chars,i,len,ch);
+    bool isComplex = requiresContextForWordBoundary(ch);
+    
+    // FIXME: This check improves our word boundary behavior, but doesn't actually go far enough.
+    // See &lt;rdar://problem/8853951&gt; Take complex word boundary finding path when necessary
+    if (!isComplex) {
+        // Check again for complex text, at the start of the run.
+        i = 0;
+        U16_NEXT(chars, i, len, ch);
+        isComplex = requiresContextForWordBoundary(ch);
+    }
+    
+    if (isComplex) {
+        findComplexWordBoundary(chars,len, position, start, end);
+    } else {
+        findSimpleWordBoundary(chars,len, position, start, end);
+    }
+
+#define LOG_WORD_BREAK 0
+#if LOG_WORD_BREAK
+    CFStringRef uniString = CFStringCreateWithCharacters(NULL, chars, len);
+    CFStringRef foundWord = CFStringCreateWithCharacters(NULL, (const UniChar *) chars + *start, *end - *start);        
+    NSLog(@&quot;%s_BREAK '%@' (%d,%d) in '%@' (%p) at %d, length=%d&quot;, isComplex ? &quot;COMPLEX&quot; : &quot;SIMPLE&quot;, foundWord, *start, *end, uniString, uniString, position, len);
+    CFRelease(foundWord);
+    CFRelease(uniString);
+#endif
+    
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void findEndWordBoundary(const UChar* chars, int len, int position, int* end)
</span><span class="lines">@@ -53,6 +258,7 @@
</span><span class="cx"> 
</span><span class="cx"> int findNextWordFromIndex(const UChar* chars, int len, int position, bool forward)
</span><span class="cx"> {   
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     NSString* string = [[NSString alloc] initWithCharactersNoCopy:const_cast&lt;unichar*&gt;(chars)
</span><span class="cx">         length:len freeWhenDone:NO];
</span><span class="cx">     NSAttributedString* attr = [[NSAttributedString alloc] initWithString:string];
</span><span class="lines">@@ -60,6 +266,35 @@
</span><span class="cx">     [attr release];
</span><span class="cx">     [string release];
</span><span class="cx">     return result;
</span><ins>+#else
+    // This very likely won't behave exactly like the non-iPhone version, but it works
+    // for the contexts in which it is used on iPhone, and in the future will be
+    // tuned to improve the iPhone-specific behavior for the keyboard and text editing.
+    int pos = position;
+    UErrorCode status = U_ZERO_ERROR;
+    UBreakIterator *boundary = ubrk_open(UBRK_WORD, currentTextBreakLocaleID(), const_cast&lt;unichar *&gt;(reinterpret_cast&lt;const unichar *&gt;(chars)), len, &amp;status);
+
+    if (boundary &amp;&amp; U_SUCCESS(status)) {
+        if (forward) {
+            do {
+                pos = ubrk_following(boundary, pos);    
+                if (pos == UBRK_DONE) {
+                    pos = len;
+                }
+            } while (pos &lt; len &amp;&amp; (pos == 0 || !isSkipCharacter(chars[pos-1])) &amp;&amp; isSkipCharacter(chars[pos]));
+        }
+        else {
+            do {
+                pos = ubrk_preceding(boundary, pos);
+                if (pos == UBRK_DONE) {
+                    pos = 0;
+                }
+            } while (pos &gt; 0 &amp;&amp; isSkipCharacter(chars[pos]) &amp;&amp; !isWhitespaceCharacter(chars[pos-1]));
+        }
+        ubrk_close(boundary);
+    }
+    return pos;
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextmacTextCodecMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/mac/TextCodecMac.cpp (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/mac/TextCodecMac.cpp        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/mac/TextCodecMac.cpp        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -24,6 +24,8 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;TextCodecMac.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -325,3 +327,5 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><ins>+
+#endif // !PLATFORM(IOS)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformtextmacTextCodecMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/mac/TextCodecMac.h (161588 => 161589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/mac/TextCodecMac.h        2014-01-09 22:53:22 UTC (rev 161588)
+++ trunk/Source/WebCore/platform/text/mac/TextCodecMac.h        2014-01-09 22:59:07 UTC (rev 161589)
</span><span class="lines">@@ -27,6 +27,8 @@
</span><span class="cx"> #ifndef TextCodecMac_h
</span><span class="cx"> #define TextCodecMac_h
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(IOS)
+
</ins><span class="cx"> #include &quot;TextCodec.h&quot;
</span><span class="cx"> #include &lt;CoreServices/CoreServices.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -70,4 +72,6 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><ins>+#endif // !PLATFORM(IOS)
+
</ins><span class="cx"> #endif // TextCodecMac_h
</span></span></pre>
</div>
</div>

</body>
</html>