WebKit-https.git
5 years agoSource/WebCore:
antti@apple.com [Fri, 24 Apr 2015 11:05:40 +0000 (11:05 +0000)]
Source/WebCore:
CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
https://bugs.webkit.org/show_bug.cgi?id=144050

Reviewed by Chris Dumez.

We are seeing null Element pointer crashes with this stack:

47 com.apple.WebCore:  WebCore::toScriptElementIfPossible + 4 <==
47 com.apple.WebCore:  WebCore::ScriptRunner::timerFired + 452
47 com.apple.WebCore:  WebCore::ThreadTimers::sharedTimerFiredInternal + 175

The most likely cause seems to be that this code

    ASSERT(m_pendingAsyncScripts.contains(scriptElement));
    m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement));

in ScriptRunner::notifyScriptReady fails to find scriptElement and we are left with null entry in
m_scriptsToExecuteSoon. However I haven't managed to repro this or find the exact path how this
could happen. The related code is fragile with lot of state (especially in ScriptElement class)
and involves many opportunities for re-entry via scripts.

No repro, no test case.

* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::timerFired):

    Paper this over by adding a null check. We could check m_pendingAsyncScripts.take() above
    but this also covers possibility this is caused by something else.

LayoutTests:
Memory cache live resources repeatedly purged during painting
https://bugs.webkit.org/show_bug.cgi?id=144104

Reviewed by Chris Dumez.

* http/tests/cache/disk-cache/disk-cache-vary-cookie.html:

    These clearMemoryCache calls are now done by cache-test.js.

* http/tests/cache/disk-cache/resources/cache-test.js:
(loadResources):

    Make sure to clear the memory cache explicitly in the beginning so we always hit the disk cache.

(runTests):

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

5 years agoUnreviewed. Remove incorrect assert after r183189.
carlosgc@webkit.org [Fri, 24 Apr 2015 10:21:13 +0000 (10:21 +0000)]
Unreviewed. Remove incorrect assert after r183189.

In this case the assert was already there, but it's incorrect
because we are handling uninitialized attachments below in the
same function, and also when sending messages. So, if it's ok to
send uninitialized attachments, it's ok to receive them. This
didn't fail before r183189, because we were only invaliding the
attachments by setting the file descriptor to -1, and they were
handled as null attachments. After r183189, the move operator
resets the moved attachment leaving it uninitialized again.

* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::processMessage):

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

5 years agoVersioning.
bshafiei@apple.com [Fri, 24 Apr 2015 07:40:27 +0000 (07:40 +0000)]
Versioning.

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

5 years ago[SOUP] Use a webkit subdirectory for the disk cache
carlosgc@webkit.org [Fri, 24 Apr 2015 07:17:07 +0000 (07:17 +0000)]
[SOUP] Use a webkit subdirectory for the disk cache
https://bugs.webkit.org/show_bug.cgi?id=144048

Reviewed by Martin Robinson.

Source/WebCore:

Add a static method to SoupNetworkSession to clear a soup cache
given its directory.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::strIsNumeric):
(WebCore::SoupNetworkSession::clearCache):
* platform/network/soup/SoupNetworkSession.h:

Source/WebKit2:

Recent versions of libsoup remove any file in cache dir not
referenced by the index when the cache is loaded to workaround
leaked resources when load/dump is unbalanced for whatever reason,
like a crash. We currently use $XDG_CACHE_HOME/app-name as default
disk cache directory, but that directory could be used by apps to
cache other things, and the soup cache might end up deleting other
stuff. The soup cache assumes the given directory is only for the
disk cache, so we should ensure that.

* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess): Append
webkit to the given disk cache and clear the previous soup cache if it exists.
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Ditto.

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

5 years agoUnreviewed. Remove incorrect ASSERT added in r183176.
carlosgc@webkit.org [Fri, 24 Apr 2015 07:05:35 +0000 (07:05 +0000)]
Unreviewed. Remove incorrect ASSERT added in r183176.

We allow to encode null attachments.

* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::Handle::releaseAttachment):

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

5 years agoRemove a useless branch on DFGGraph::addShouldSpeculateMachineInt()
commit-queue@webkit.org [Fri, 24 Apr 2015 06:36:14 +0000 (06:36 +0000)]
Remove a useless branch on DFGGraph::addShouldSpeculateMachineInt()
https://bugs.webkit.org/show_bug.cgi?id=144118

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-04-23
Reviewed by Geoffrey Garen.

* dfg/DFGGraph.h:
(JSC::DFG::Graph::addShouldSpeculateMachineInt):
Both block do the same thing.

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

5 years agoDisable HAVE_AVKIT on AppleTV
jer.noble@apple.com [Fri, 24 Apr 2015 06:30:16 +0000 (06:30 +0000)]
Disable HAVE_AVKIT on AppleTV
https://bugs.webkit.org/show_bug.cgi?id=144142

Reviewed by Dan Bernstein.

* wtf/Platform.h:

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

5 years agoAdded Radar information to Change Log entry
mitz@apple.com [Fri, 24 Apr 2015 05:30:18 +0000 (05:30 +0000)]
Added Radar information to Change Log entry

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

5 years agoFixed a bug where framework header postprocessing wasn’t removing WK_DEPRECATED macro...
mitz@apple.com [Fri, 24 Apr 2015 05:27:31 +0000 (05:27 +0000)]
Fixed a bug where framework header postprocessing wasn’t removing WK_DEPRECATED macros when it should have.

Reviewed by Andy Estes.

* mac/postprocess-framework-headers.sh:

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

5 years agoFix the iOS build after r183234.
aestes@apple.com [Fri, 24 Apr 2015 04:55:43 +0000 (04:55 +0000)]
Fix the iOS build after r183234.

* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::commitScaleChange):

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

5 years agoFix Windows build.
simon.fraser@apple.com [Fri, 24 Apr 2015 04:52:27 +0000 (04:52 +0000)]
Fix Windows build.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::setBackingStoreAttached):
(PlatformCALayerWin::backingStoreAttached):
* platform/graphics/ca/win/PlatformCALayerWin.h:

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

5 years agoMake it possible to detach GraphicsLayerCA backing store
simon.fraser@apple.com [Fri, 24 Apr 2015 04:36:12 +0000 (04:36 +0000)]
Make it possible to detach GraphicsLayerCA backing store
https://bugs.webkit.org/show_bug.cgi?id=144140

Reviewed by Tim Horton.
Source/WebCore:

This changes makes it possible to denote a GraphicsLayerCA's backing store
as "attached" or not. When not attached, the backing store is made volatile
and can be purged. This will be used in a future patch.

* platform/graphics/ca/GraphicsLayerCA.h: Add updateBackingStoreAttachment().
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm: Stubs. In future, we could
remove backing store on Mac and iOS WK1 too.
(PlatformCALayerMac::setBackingStoreAttached):
(PlatformCALayerMac::backingStoreAttached):

Source/WebKit2:

This changes makes it possible to denote a GraphicsLayerCA's backing store
as "attached" or not. When not attached, the backing store is made volatile
and can be purged. This will be used in a future patch.

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore): Whitespace.
(WebKit::RemoteLayerBackingStore::display): If backingStoreWillBeDisplayed()
returns true, this indicates that the backing store was brought out of the
"unreachable" list, so return true even if the backing store doesn't require
painting.
* Shared/mac/RemoteLayerBackingStoreCollection.h: C++11 initializer, and comments.
* Shared/mac/RemoteLayerBackingStoreCollection.mm:
(WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection):
(WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed): Return true
if the caller will need to submit the backing store in the current transaction.
(WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable): This
explicit dirtying is no longer necessary given the backingStoreWillBeDisplayed() change.
* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::applyPropertiesToLayer): Only set the layer's backing if we both have backing
store, and it's attached.
* Shared/mac/RemoteLayerTreeTransaction.h: New bit, and data member.
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::dumpChangedLayers):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction): Only call display()
on the backing store if it's attached.
(WebKit::PlatformCALayerRemote::setBackingStoreAttached):
(WebKit::PlatformCALayerRemote::backingStoreAttached):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed):

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

5 years agoRemove "layer" from GraphicsLayerCA member function names
simon.fraser@apple.com [Fri, 24 Apr 2015 04:05:58 +0000 (04:05 +0000)]
Remove "layer" from GraphicsLayerCA member function names
https://bugs.webkit.org/show_bug.cgi?id=144139

Reviewed by Myles Maxfield.

Rename "updateLayer*" to "update*" in GraphicsLayerCA.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateNames):
(WebCore::GraphicsLayerCA::updateDrawsContent):
(WebCore::GraphicsLayerCA::updateLayerNames): Deleted.
(WebCore::GraphicsLayerCA::updateLayerDrawsContent): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:

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

5 years agoWeb Inspector: Speculative fix for non-main thread auto-attach failures
commit-queue@webkit.org [Fri, 24 Apr 2015 04:01:12 +0000 (04:01 +0000)]
Web Inspector: Speculative fix for non-main thread auto-attach failures
https://bugs.webkit.org/show_bug.cgi?id=144134

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-23
Reviewed by Timothy Hatcher.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::singleton):

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

5 years agoTry to fix the Windows build after r183234.
aestes@apple.com [Fri, 24 Apr 2015 03:49:12 +0000 (03:49 +0000)]
Try to fix the Windows build after r183234.

* FullscreenVideoController.cpp:
(FullscreenVideoController::FullscreenVideoController): FullscreenVideoController inherits privately from
WebCore::MediaPlayerPrivateFullscreenClient, so make_unique isn't allowed to upcast. Add an explicit upcast.

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

5 years agoWeb Inspector: run a customizable bootstrap function after the UI has fully loaded
burg@cs.washington.edu [Fri, 24 Apr 2015 03:08:31 +0000 (03:08 +0000)]
Web Inspector: run a customizable bootstrap function after the UI has fully loaded
https://bugs.webkit.org/show_bug.cgi?id=144124

Reviewed by Joseph Pecoraro.

It can be really annoying to click through the Inspector UI dozens of times to debug one
interaction or iterate on a specific widget.

This patch adds a blank "bootstrap" function that can be used to hard-wire commands to
automate repetitive UI state setup. The function is run immediately after the inspector loads.
Setup commands can be shared as bug report reproduction steps.

* UserInterface/Base/Bootstrap.js: Added.
(WebInspector.runBootstrapOperations): Added.
* UserInterface/Base/Main.js:
(WebInspector.contentLoaded): Bootstrap after setting up everything and restoring view state from cookie.
* UserInterface/Main.html:

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

5 years agoBuild fix after r183232.
rniwa@webkit.org [Fri, 24 Apr 2015 03:06:55 +0000 (03:06 +0000)]
Build fix after r183232.

* public/include/json-header.php:

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

5 years ago<rdar://problem/20663758> Fix the build after AVPlayerViewController API change
mitz@apple.com [Fri, 24 Apr 2015 03:03:48 +0000 (03:03 +0000)]
<rdar://problem/20663758> Fix the build after AVPlayerViewController API change

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Don’t pass a nil completion
handler to -[AVPlayerViewController exitFullScreenAnimated:completionHandler:].

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

5 years agoAllow function allocation sinking
commit-queue@webkit.org [Fri, 24 Apr 2015 02:23:36 +0000 (02:23 +0000)]
Allow function allocation sinking
https://bugs.webkit.org/show_bug.cgi?id=144016

Patch by Basile Clement <basile_clement@apple.com> on 2015-04-23
Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This adds the ability to sink function allocations in the
DFGObjectAllocationSinkingPhase.

In order to enable this, we add a new PhantomNewFunction node that is
used similarily to the PhantomNewObject node, i.e. as a placeholder to replace
a sunk NewFunction and keep track of the allocations that have to be performed
in case of OSR exit after the sunk allocation but before the real one.
The FunctionExecutable and JSLexicalEnvironment (activation) of the function
are stored onto the PhantomNewFunction through PutHints in order for them
to be recovered on OSR exit.

Contrary to sunk object allocations, sunk function allocations do not
support any kind of operations (e.g. storing into a field) ; any such operation
will mark the function allocation as escaping and trigger materialization. As
such, function allocations can only be sunk to places where it would have been
correct to syntactically move them, and we don't need a special
MaterializeNewFunction node to recover possible operations on the function. A
sunk NewFunction node will simply create new NewFunction nodes, then replace
itself with a PhantomNewFunction node.

In itself, this change is not expected to have a significant impact on
performances other than in degenerate cases (see e.g.
JSRegress/sink-function), but it is a step towards being able to sink recursive
closures onces we support CreateActivation sinking as well as allocation cycles
sinking.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToPhantomNewFunction):
(JSC::DFG::Node::isPhantomAllocation):
* dfg/DFGNodeType.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
(JSC::DFG::ObjectAllocationSinkingPhase::lowerNonReadingOperationsOnPhantomAllocations):
(JSC::DFG::ObjectAllocationSinkingPhase::handleNode):
(JSC::DFG::ObjectAllocationSinkingPhase::createMaterialize):
(JSC::DFG::ObjectAllocationSinkingPhase::populateMaterialize):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGPromotedHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGPromotedHeapLocation.h:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGValidate.cpp:
(JSC::DFG::Validate::validateCPS):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
* ftl/FTLOperations.cpp:
(JSC::FTL::operationMaterializeObjectInOSR):
* tests/stress/function-sinking-no-double-allocate.js: Added.
(call):
(.f):
(sink):
* tests/stress/function-sinking-osrexit.js: Added.
(.g):
(sink):
* tests/stress/function-sinking-put.js: Added.
(.g):
(sink):

LayoutTests:

Add a new test in JSRegress to check function sinking is being
performed.

* js/regress/script-tests/sink-function.js: Added.
(foo.f1):
(foo.f2):
(foo.f3):
(foo.f4):
(foo.f5):
(foo.f6):
(foo.f7):
(foo.f8):
(foo.f9):
(foo.f10):
(foo.f11):
(foo.f12):
(foo.f13):
(foo.f14):
(foo.f15):
(foo.f16):
(foo.f17):
(foo.f18):
(foo.f19):
(foo):

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

5 years agoAnother round of removing use of OwnPtr, PassOwnPtr, and deleteOwnedPtr
darin@apple.com [Fri, 24 Apr 2015 02:13:39 +0000 (02:13 +0000)]
Another round of removing use of OwnPtr, PassOwnPtr, and deleteOwnedPtr
https://bugs.webkit.org/show_bug.cgi?id=144090

Reviewed by Anders Carlsson.

Source/WebCore:

* Modules/encryptedmedia/CDMPrivateMediaPlayer.h: Removed unneeded include.

* Modules/navigatorcontentutils/NavigatorContentUtils.h: Removed include of
RefCountedSupplement.h.

* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
Pass data using rvalue references, and use new/delete to pass it across
threads, rather than using PassOwnPtr.
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h: Pass data
in an rvalue reference instead of PassOwnPtr.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveBinaryData): Take an rvalue reference
instead of a PassOwnPtr.
* Modules/websockets/WebSocket.h: Ditto.
* Modules/websockets/WebSocketChannel.cpp: Ditto.
(WebCore::WebSocketChannel::processFrame): Ditto.
* Modules/websockets/WebSocketChannelClient.h:
(WebCore::WebSocketChannelClient::didReceiveBinaryData): Ditto.
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
Ditto.
* Modules/websockets/WorkerThreadableWebSocketChannel.h: Ditto.

* WebCore.xcodeproj/project.pbxproj: Removed RefCountedSupplement.h.

* loader/cocoa/DiskCacheMonitorCocoa.mm:
(WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Fixed comment
to not mention adoptPtr.

* page/make_settings.pl:
(generateInternalSettingsHeaderFile): Removed include of RefCountedSupplement.h.

* platform/ColorChooserClient.h: Removed unneded include.
* platform/ContextMenuItem.h: Ditto.

* platform/RefCountedSupplement.h: Removed.

* platform/ScrollAnimator.cpp: Removed unneeded include.
* platform/ScrollAnimatorNone.h: Ditto.

* platform/ThreadGlobalData.cpp: Added now-needed include of PassOwnPtr.h.

* platform/graphics/GlyphMetricsMap.h: Ditto.
* platform/graphics/MediaPlayer.h: Ditto.
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: Ditto.
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Ditto.
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Ditto.
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: Ditto.
* platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h: Ditto.
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h: Ditto.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: Ditto.

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer): Use make_unique instead of adoptPtr.
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData): Return a RefPtr instead of a PassRefPtr.
* platform/graphics/cg/ImageBufferDataCG.h: Streamlined the header a bit,
use unique_ptr instead of OwnPtr and RefPtr instead of PassRefPtr.

* platform/graphics/cocoa/IOSurface.h: Use unique_ptr instead of OwnPtr.
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::ensureGraphicsContext): Use make_unique instead of adoptPtr.

* platform/graphics/egl/GLContextEGL.cpp: Removed unneeded includes.
* platform/graphics/filters/FilterOperation.h: Ditto.
* platform/graphics/harfbuzz/HarfBuzzShaper.h: Ditto.
* platform/ios/DeviceMotionClientIOS.h: Ditto.
* platform/ios/DeviceOrientationClientIOS.h: Ditto.

* platform/ios/LegacyTileCache.h: Use unique_ptr instead of OwnPtr.
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::LegacyTileCache): Use make_unique instead of
a create function, and also get rid of unneeded initialization to null.
(WebCore::LegacyTileCache::commitScaleChange): Ditto.

* platform/ios/LegacyTileGrid.h: Made constructor public and got rid of create
function. Made constructor take a reference to the tile cache, and make both
tileCache() and m_tileCache be references too.

* platform/ios/LegacyTileGrid.mm:
(WebCore::LegacyTileGrid::LegacyTileGrid): Updated to use reference.
(WebCore::LegacyTileGrid::visibleRect): Ditto.
(WebCore::LegacyTileGrid::tileByteSize) Ditto.:
(WebCore::LegacyTileGrid::dropDistantTiles): Ditto.
(WebCore::LegacyTileGrid::updateTileOpacity): Ditto.
(WebCore::LegacyTileGrid::updateTileBorderVisibility): Ditto.
(WebCore::LegacyTileGrid::updateHostLayerSize): Ditto.
(WebCore::LegacyTileGrid::invalidateTiles): Ditto.
(WebCore::LegacyTileGrid::shouldUseMinimalTileCoverage): Ditto.
(WebCore::LegacyTileGrid::tileDistance2): Ditto.
(WebCore::LegacyTileGrid::createTiles): Ditto.
* platform/ios/LegacyTileGridTile.mm:
(WebCore::LegacyTileGridTile::LegacyTileGridTile): Ditto.
(WebCore::LegacyTileGridTile::invalidateRect): Ditto.
(WebCore::LegacyTileGridTile::showBorder): Ditto.
* platform/ios/LegacyTileLayer.mm:
(-[LegacyTileHostLayer renderInContext:]): Ditto.
(-[LegacyTileLayer layoutSublayers]): Ditto.
(-[LegacyTileLayer drawInContext:]): Ditto.

* platform/ios/LegacyTileLayerPool.h: Removed unneeded include.
* platform/ios/ScrollAnimatorIOS.mm: Ditto.
* platform/mac/ScrollAnimatorMac.mm: Ditto.
* platform/mac/WebVideoFullscreenController.h: Ditto.
* platform/network/BlobData.cpp: Ditto.

* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::ResourceHandle): Use make_unique instead of adoptPtr.
* platform/network/ResourceHandle.h: Use unique_ptr instead of OwnPtr.

* platform/network/ResourceHandleInternal.h: Added now-needed include.

* platform/network/ResourceResponseBase.h: Removed unneeded includes and
tweaked formatting a bit.

* platform/network/SynchronousLoaderClient.h: Removed the create function and
the private constructor. Used data member initialize to make the default
empty constructor automatically get generated (and be public now).

* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::formFinishFinalizationOnMainThread): Use delete instead of adoptPtr
to delete the context argument.

* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::defaultNetworkStorageSession): Return a unique_ptr& instead of an OwnPtr&.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Use make_unique
instead of adoptPtr.
(WebCore::NetworkStorageSession::defaultStorageSession): Ditto.

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Use a
SynchronousLoaderClient on the stack instead of putting one on the heap with adoptPtr.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::platformLoadResourceSynchronously): Ditto.

* platform/text/TextCodec.h: Removed unneeded include.
* platform/win/CursorWin.cpp: Ditto.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects): Use move instead of release since
we are using RefPtr&& instead of PassRefPtr.

* rendering/RenderLayerFilterInfo.cpp:
(WebCore::RenderLayer::FilterInfo::setRenderer): Use RefPtr&& instead of PassRefPtr.
(WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients): Streamlined to use
modern for loops and auto.
(WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients): Ditto.

* rendering/RenderLayerFilterInfo.h: Streamlined code and removed some stuff that
I think is unneeded on iOS; there is no unused private field and I suspect the problem
that led to the warning is gone. Deleted friending of deleteOwnedPtr.

* rendering/RenderLayerMaskImageInfo.cpp: Removed unneeded includes. Moved private
client classes in here from the header and made them members of MaskImageInfo.
Streamlined them a bit in other ways.
(WebCore::RenderLayer::MaskImageInfo::getIfExists): Use nullptr.
(WebCore::RenderLayer::MaskImageInfo::MaskImageInfo): Use member initialization
and also pass the layer in rather than the MaskImageInfo.
(WebCore::RenderLayer::MaskImageInfo::notifyFinished): Deleted. Moved the code
into the SVGDocumentClient.
(WebCore::RenderLayer::MaskImageInfo::imageChanged): Deleted. Moved the code into
the ImageClient.
(WebCore::RenderLayer::MaskImageInfo::updateMaskImageClients): Streamlined a bit
to use a for loop.
(WebCore::RenderLayer::MaskImageInfo::removeMaskImageClients): Ditto.

* rendering/RenderLayerMaskImageInfo.h: Reduced unneeded includes. Got rid of
definitions of private member classes here in the header; they can be in the cpp
file instead. Also cut down from three classes to two, and gave the classes less
redundant names since they are already members of MaskImageInfo. Removed some
unneeded functions and friending of deleteOwnedPtr.

* testing/InternalSettings.cpp: Got rid of comment about RefCountedSupplement
since no code anywhere was using it, so not using it here was not remarkable.

Source/WebKit/win:

* FullscreenVideoController.cpp:
(FullscreenVideoController::FullscreenVideoController):
(FullscreenVideoController::exitFullscreen):
* FullscreenVideoController.h:
* Plugins/PluginView.h:
* Plugins/PluginViewWin.cpp:
(WebCore::PluginView::wndProc):
* WebCoreSupport/AcceleratedCompositingContext.h:
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::WebChromeClient):
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::WebFrameLoaderClient):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorClient::highlight):
* WebCoreSupport/WebInspectorClient.h:
* WebElementPropertyBag.cpp:
(WebElementPropertyBag::WebElementPropertyBag):
* WebElementPropertyBag.h:
* WebFrame.h:
* WebHistoryItem.cpp:
* WebNodeHighlight.cpp:
* WebNotificationCenter.cpp:
(WebNotificationCenter::WebNotificationCenter):
* WebNotificationCenter.h:
Use make_unique and unique_ptr instead of adoptPtr and OwnPtr.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm: Removed unneeded include.

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

5 years agoWeb Inspector: Adopt Object.assign and improve its display in Console
commit-queue@webkit.org [Fri, 24 Apr 2015 02:08:07 +0000 (02:08 +0000)]
Web Inspector: Adopt Object.assign and improve its display in Console
https://bugs.webkit.org/show_bug.cgi?id=144135

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-23
Reviewed by Darin Adler.

* UserInterface/Models/NativeFunctionParameters.js:

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

5 years agoPerf dashboard should automatically detect regressions
rniwa@webkit.org [Fri, 24 Apr 2015 01:16:37 +0000 (01:16 +0000)]
Perf dashboard should automatically detect regressions
https://bugs.webkit.org/show_bug.cgi?id=141443

Reviewed by Anders Carlsson.

Added a node.js script detect-changes.js to detect potential regressions and progressions
on the graphs tracked on v2 dashboards.

* init-database.sql: Added analysis_strategies table and task_segmentation and task_test_range
columns to analysis_tasks to keep the segmentation and test range selection strategies used
to create an analysis task.

* public/api/analysis-tasks.php:
(format_task): Include task_segmentation and analysis_tasks in the results.

* public/include/json-header.php:
(remote_user_name): Returns null when the privileged API is authenticated as a slave instead
of a CSRF prevention token.
(should_authenticate_as_slave): Added.
(ensure_privileged_api_data_and_token_or_slave): Added. Authenticate as a slave if slaveName
and slavePassword are specified. Since detect-changes.js and other slaves are not susceptible
to a CSRF attack, we don't need to check a CSRF token.

* public/privileged-api/create-analysis-task.php:
(main): Use ensure_privileged_api_data_and_token_or_slave to let detect-changes.js create new
analysis task. Also add or find segmentation and test range selection strategies if specified.

* public/privileged-api/create-test-group.php:
(main): Use ensure_privileged_api_data_and_token_or_slave.

* public/privileged-api/generate-csrf-token.php:

* public/v2/app.js:
(App.Pane._computeMovingAverageAndOutliers): _executeStrategy has been moved to Statistics.

* public/v2/data.js: Export Measurement, RunsData, TimeSeries. Used in detect-changes.js.
(Array.prototype.find): Added a polyfill to be used in node.js.
(RunsData.fetchRuns):
(RunsData.pathForFetchingRuns): Extracted from fetchRuns. Used in detect-changes.js.
(RunsData.createRunsDataInResponse): Extracted from App.Manifest._formatFetchedData to use it
in detect-changes.js.
(RunsData.unitFromMetricName): Ditto.
(RunsData.isSmallerBetter): Ditto.
(RunsData.prototype._timeSeriesByTimeInternal): Added secondaryTime to sort points when commit
times are identical.
(TimeSeries): When commit times are identical, order points based on build time. This is needed
for when we trigger two builds at two different OS versions with the same WebKit revision since
OS versions don't change the commit times.
(TimeSeries.prototype.findPointByIndex): Added.
(TimeSeries.prototype.rawValues): Added.

* public/v2/js/statistics.js:
(Statistics.TestRangeSelectionStrategies.[0]): Use the 99% two-sided probability as claimed in the
description of this strategy instead of the default probability. Also fixed a bug that debugging
code was referring to non-existent variables.
(Statistics.executeStrategy): Moved from App.Pane (app.js).

* public/v2/manifest.js:
(App.Manifest._formatFetchedData): Various code has been extracted into RunsData in data.js to be
used in detect-changes.js.

* tools/detect-changes.js: Added. The script fetches the manifest JSON, analyzes each graph in
the v2 dashboards, and creates an analysis task for the latest regression or progression detected.
It also schedules an A/B testing if possible and notifies another server; e.g. to send an email.
(main): Loads the settings JSON specified in the argument.
(fetchManifestAndAnalyzeData): The main loop that periodically wakes up to do the analysis.
(mapInOrder): Executes callback sequentially (i.e. blocking) on each item in the array.
(configurationsForTesting): Finds every (platform, metric) pair to analyze in the v2 dashbaords,
and computes various values for when statistically significant changes are detected later.
(analyzeConfiguration): Finds potential regressions and progression in the last X days where X
is the specified maximum number of days using the specified strategies. Sort the resultant ranges
in chronological order and create a new analysis task for the very last change we detected. We'll
eventually create an analysis task for all detected changes since we're repeating the analysis in
fetchManifestAndAnalyzeData after some time.
(computeRangesForTesting): Fetch measured values and compute ranges to test using the specified
segmentation and test range selection strategies. Once ranges are found, find overlapping analysis
tasks as they need to be filtered out in analyzeConfiguration to avoid creating multiple analysis
tasks for the same range (e.g. humans may create one before the script gets to do it).
(createAnalysisTaskAndNotify): Create a new analysis task for the specified range, trigger an A/B
testing if available, and notify another server with a HTML message as specified.
(findStrategyByLabel):
(changeTypeForRange): A change is a regression if values are getting larger in a smaller-is-better
test or values are getting smaller in a larger-is-better test and vice versa.
(summarizeRange): Create a human readable string that summarizes the change detected. e.g.
"Potential 3.2% regression detected between 2015-04-20 12:00 and 17:00".
(formatTimeRange):
(getJSON):
(postJSON):
(postNotification): Recursively replaces $title and $massage in the specified JSON template.
(instantiateNotificationTemplate):
(fetchJSON):

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

5 years ago[iOS] Add a wrapper around the hosted AVPlayerLayer to intercept -setBounds:
jer.noble@apple.com [Thu, 23 Apr 2015 23:43:04 +0000 (23:43 +0000)]
[iOS] Add a wrapper around the hosted AVPlayerLayer to intercept -setBounds:
https://bugs.webkit.org/show_bug.cgi?id=144129

Reviewed by Simon Fraser.

When passing the hosted AVPlayerLayer to the fullscreen controller, the new superlayer will
resize the hosted layer with a call to -setBounds:. But because this is a hosted layer, the
bonuds change has no effect. Instead, wrap the CALayerHost in another CALayer whose job it is
to intercept -setBounds: in the same way that WebAVVideoLayer did. In fact, we should just use
that wrapper class inside WebAVVideoLayer as well, to avoid duplicating code.

Drive-by Fix: Null-check m_videoElement in setVideoLayerFrame().

* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebCALayerHostWrapper setVideoSublayer:]):
(-[WebCALayerHostWrapper videoSublayer]):
(-[WebCALayerHostWrapper setBounds:]): Moved from WebAVVideoLayer.
(-[WebCALayerHostWrapper resolveBounds]): Ditto.
(-[WebAVVideoLayer setBounds:]): Moved to WebCALayerHostWrapper.
(WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Create the wrapper.
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Clear the wrapper.
(-[WebAVVideoLayer resolveBounds]): Deleted. Moved to WebCALayerHostWrapper.
* platform/ios/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Null-check m_videoElement.

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

5 years agoQuick Look preview popover is not dismissed on scroll in Mail
timothy_horton@apple.com [Thu, 23 Apr 2015 23:18:03 +0000 (23:18 +0000)]
Quick Look preview popover is not dismissed on scroll in Mail
https://bugs.webkit.org/show_bug.cgi?id=144119
<rdar://problem/19752045>

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView renewGState]):
If we have a TextIndicator, dismiss all content relative child windows
on renewGState, not just the TextIndicator itself.

This will fix cases like Mail, where WebKit isn't driving the scrolling,
and we have no way (except renewGState) to know that scrolling is happening.

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

5 years agoYellow highlight has gray background color when invoking Lookup on an address in...
timothy_horton@apple.com [Thu, 23 Apr 2015 23:13:01 +0000 (23:13 +0000)]
Yellow highlight has gray background color when invoking Lookup on an address in a Google Maps drop down
https://bugs.webkit.org/show_bug.cgi?id=138737
<rdar://problem/18904429>

Reviewed by Simon Fraser.

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
Other RenderObjects don't paint box decorations in the selection painting phase,
so RenderReplaced probably shouldn't either. This fixes the case where, when doing
selection-only painting of a bit of text over top of a RenderReplaced, the RenderReplaced
would paint its background, filling the previously transparent bitmap with an unwanted color.

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

5 years agoTest compositing/scrolling/touch-scroll-to-clip.html fails in WK1
ap@apple.com [Thu, 23 Apr 2015 23:04:40 +0000 (23:04 +0000)]
Test compositing/scrolling/touch-scroll-to-clip.html fails in WK1
https://bugs.webkit.org/show_bug.cgi?id=144127

* platform/mac-wk1/TestExpectations: Marked it as such.

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

5 years agoUpdate media timeline controls when video is paused..
roger_fong@apple.com [Thu, 23 Apr 2015 23:01:30 +0000 (23:01 +0000)]
Update media timeline controls when video is paused..
https://bugs.webkit.org/show_bug.cgi?id=144122.
<rdar://problem/20422927>

Reviewed by Dean Jackson.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.drawTimelineBackground): Use timelineWidth because offsetWidth is 0 when display: none.
(Controller.prototype.setPlaying): Show controls when pausing.
(Controller.prototype.showControls): Update time and timeline when unhiding controls.

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

5 years agoChanging TiledBacking velocity should schedule a tile revalidation
simon.fraser@apple.com [Thu, 23 Apr 2015 22:54:02 +0000 (22:54 +0000)]
Changing TiledBacking velocity should schedule a tile revalidation
https://bugs.webkit.org/show_bug.cgi?id=144123

Reviewed by Tim Horton.
Source/WebCore:

Changing the velocity parameters on the TileController affect the computed
coverage rect, so whenever we make a change to velocity data that could
affect the outcome (basically any non-zero old or new velocities),
schedule a layer flush.

* platform/graphics/TiledBacking.h:
(WebCore::VelocityData::velocityOrScaleIsChanging):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setVelocity):

Source/WebKit2:

Drive-by fix: use the FrameView& that we have already.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

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

5 years agolldb macro btjs sometimes can't get a frame description
msaboff@apple.com [Thu, 23 Apr 2015 22:52:37 +0000 (22:52 +0000)]
lldb macro btjs sometimes can't get a frame description
https://bugs.webkit.org/show_bug.cgi?id=144130

Reviewed by Filip Pizlo.

We look to execute ExecState::describeFrame().  It appears that in some contexts the
debugger can't find ExecState.  In those cases, CallFrame works as it is a typedef of
ExecState.  Therefore we can fallback to using CallFrame::describeFrame().

* lldb/lldb_webkit.py:
(btjs):

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

5 years ago[GTK] Add more public options
mcatanzaro@igalia.com [Thu, 23 Apr 2015 22:45:59 +0000 (22:45 +0000)]
[GTK] Add more public options
https://bugs.webkit.org/show_bug.cgi?id=144116

Reviewed by Martin Robinson.

Add ENABLE_ICONDATABASE, ENABLE_JIT, and USE_SYSTEM_MALLOC as public options.

* Source/cmake/OptionsGTK.cmake:

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

5 years ago[Mac] Disable QTKit by default on future OS X.
jer.noble@apple.com [Thu, 23 Apr 2015 22:43:38 +0000 (22:43 +0000)]
[Mac] Disable QTKit by default on future OS X.
https://bugs.webkit.org/show_bug.cgi?id=144082

Reviewed by Darin Adler.

Source/WebCore:

Settings::gQTKitEnabled defaults to false.

* page/Settings.cpp:

Source/WebKit/mac:

Default WebKitQTKitEnabledPreferenceKey to NO.

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

Source/WebKit2:

QTKitEnabled defaults to false.

* Shared/WebPreferencesDefinitions.h:

LayoutTests:

Add a required BANDWIDTH field to the alternate playlist.

* http/tests/media/resources/hls/playlist-with-cookie.m3u8:

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

5 years ago[WK2][Mac] Tweak the timing curve of the WebKit Fullscreen animation
jer.noble@apple.com [Thu, 23 Apr 2015 22:40:19 +0000 (22:40 +0000)]
[WK2][Mac] Tweak the timing curve of the WebKit Fullscreen animation
https://bugs.webkit.org/show_bug.cgi?id=144120

Reviewed by Eric Carlson.

Tweak the curve to ease-in faster when the fullscreen animation duration is short.

* UIProcess/mac/WKFullScreenWindowController.mm:
(timingFunctionForDuration):
(zoomAnimation):
(maskAnimation):
(fadeAnimation):

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

5 years agoClean up: Use references instead of pointers in more SVG files
dbates@webkit.org [Thu, 23 Apr 2015 22:34:10 +0000 (22:34 +0000)]
Clean up: Use references instead of pointers in more SVG files
https://bugs.webkit.org/show_bug.cgi?id=144045

Reviewed by Darin Adler.

* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Pass reference instead of pointer.

* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::recordTextFragment): Changed parameter textBox from pointer to reference.
(WebCore::SVGTextLayoutEngine::layoutInlineTextBox): Ditto.
(WebCore::SVGTextLayoutEngine::currentVisualCharacterMetrics): Changed parameter textBox from pointer to
reference and made it const since this function does not modify textBox.
(WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Changed parameters from pointers to references.
Also, removed comma from comment so that it reads well.
* rendering/svg/SVGTextLayoutEngine.h: Updated declarations for the above functions.

* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift): Changed parameter style from pointer to reference.
Added case BS_LENGTH to switch block and removed default case so that the compiler checks that we handle all cases.
Renamed parameter contextElement to context since the name of its data type conveys that it is an element.
(WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift): Changed parameter textRenderer from
pointer to reference and removed runtime assertion that textRenderer is non-null (since it well-formed reference
cannot point to a non-existent object).
(WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle): Changed parameter style from pointer to reference
removed runtime assertion that style is non-null.
* rendering/svg/SVGTextLayoutEngineBaseline.h: Updated declarations for the above functions.

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

5 years agoMake the linter stop complaining by fixing the order of fields in TestExpectations
timothy_horton@apple.com [Thu, 23 Apr 2015 22:24:28 +0000 (22:24 +0000)]
Make the linter stop complaining by fixing the order of fields in TestExpectations

* platform/mac/TestExpectations:
Bug number comes first.

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

5 years agoiOS build fix after r183208.
enrica@apple.com [Thu, 23 Apr 2015 22:20:45 +0000 (22:20 +0000)]
iOS build fix after r183208.

Unreviewed.

* UIProcess/ios/WKContentViewInteraction.mm:

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

5 years agoWeb Inspector: DebuggerSidebarPanel's _callStackContentTreeOutline should suppress...
timothy@apple.com [Thu, 23 Apr 2015 22:02:45 +0000 (22:02 +0000)]
Web Inspector: DebuggerSidebarPanel's _callStackContentTreeOutline should suppress filtering
https://bugs.webkit.org/show_bug.cgi?id=144114

Reviewed by Joseph Pecoraro.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):

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

5 years agoWeb Inspector: Fix layering issues with ApplicationCacheFrameTreeElement
timothy@apple.com [Thu, 23 Apr 2015 22:00:08 +0000 (22:00 +0000)]
Web Inspector: Fix layering issues with ApplicationCacheFrameTreeElement
https://bugs.webkit.org/show_bug.cgi?id=144113

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ApplicationCacheFrameTreeElement.js:
(WebInspector.ApplicationCacheFrameTreeElement.prototype.updateTitles):
(WebInspector.ApplicationCacheFrameTreeElement):

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

5 years agoUnreviewed, rolling out r183194.
commit-queue@webkit.org [Thu, 23 Apr 2015 21:58:48 +0000 (21:58 +0000)]
Unreviewed, rolling out r183194.
https://bugs.webkit.org/show_bug.cgi?id=144121

Made multiple tests flaky (Requested by ap_ on #webkit).

Reverted changeset:

"Memory cache live resources repeatedly purged during
painting"
https://bugs.webkit.org/show_bug.cgi?id=144104
http://trac.webkit.org/changeset/183194

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

5 years agoMake FunctionRareData allocation thread-safe
commit-queue@webkit.org [Thu, 23 Apr 2015 21:56:23 +0000 (21:56 +0000)]
Make FunctionRareData allocation thread-safe
https://bugs.webkit.org/show_bug.cgi?id=144001

Patch by Basile Clement <basile_clement@apple.com> on 2015-04-23
Reviewed by Mark Lam.

The two things we want to prevent are:

 1. A thread seeing a pointer to a not-yet-fully-created rare data from
    a JSFunction
 2. A thread seeing a pointer to a not-yet-fully-created Structure from
    an ObjectAllocationProfile

For 1., only the JS thread can be creating the rare data (in
runtime/CommonSlowPaths.cpp or in dfg/DFGOperations.cpp), so we don't need to
worry about concurrent writes, and we don't need any fences when *reading* the
rare data from the JS thread. Thus we only need a storeStoreFence between the
rare data creation and assignment to m_rareData in
JSFunction::createAndInitializeRareData() to ensure that when the store to
m_rareData is issued, the rare data has been properly created.

For the DFG compilation threads, the only place they can access the
rare data is through JSFunction::rareData(), and so we only need a
loadLoadFence there to ensure that when we see a non-null pointer in
m_rareData, the pointed object will be seen as a fully created
FunctionRareData.

For 2., the structure is created in
ObjectAllocationProfile::initialize() (which appears to be called only by the
JS thread as well, in bytecode/CodeBlock.cpp and on rare data initialization,
which always happen in the JS thread), and read through
ObjectAllocationProfile::structure() and
ObjectAllocationProfile::inlineCapacity(), so following the same reasoning we
put a storeStoreFence in ObjectAllocationProfile::initialize() and a
loadLoadFence in ObjectAllocationProfile::structure() (and change
ObjectAllocationProfile::inlineCapacity() to go through
ObjectAllocationProfile::structure()).

We don't need a fence in ObjectAllocationProfile::clear() because
clearing the structure is already as atomic as it gets.

Finally, notice that we don't care about the ObjectAllocationProfile's
m_allocator as that is only used by ObjectAllocationProfile::initialize() and
ObjectAllocationProfile::clear() that are always run in the JS thread.
ObjectAllocationProfile::isNull() could cause some trouble, but it is
currently only used in the ObjectAllocationProfile::clear()'s ASSERT in the JS
thread.  Doing isNull()-style pre-checks would be wrong in any other concurrent
thread anyway.

* bytecode/ObjectAllocationProfile.h:
(JSC::ObjectAllocationProfile::initialize):
(JSC::ObjectAllocationProfile::structure):
(JSC::ObjectAllocationProfile::inlineCapacity):
* runtime/JSFunction.cpp:
(JSC::JSFunction::allocateAndInitializeRareData):
* runtime/JSFunction.h:
(JSC::JSFunction::rareData):
(JSC::JSFunction::allocationStructure): Deleted.
This is no longer used, as all the accesses to the ObjectAllocationProfile go through the rare data.

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

5 years agoUnreviewed. Missed a button in r182900.
roger_fong@apple.com [Thu, 23 Apr 2015 21:33:23 +0000 (21:33 +0000)]
Unreviewed. Missed a button in r182900.

* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-wireless-playback-picker-button:active):

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

5 years agoUnreviewed. Just shift some CSS around for code cleanup purposes.
roger_fong@apple.com [Thu, 23 Apr 2015 21:31:01 +0000 (21:31 +0000)]
Unreviewed. Just shift some CSS around for code cleanup purposes.
* Modules/mediacontrols/mediaControlsApple.css:
(video::-webkit-media-controls-panel):
(video::-webkit-media-controls-panel:hover):

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

5 years ago[iOS] WebKit services should inherit environment variables for home
ap@apple.com [Thu, 23 Apr 2015 21:14:56 +0000 (21:14 +0000)]
[iOS] WebKit services should inherit environment variables for home
https://bugs.webkit.org/show_bug.cgi?id=144078
rdar://problem/20571678

Reviewed by Dan Bernstein.

Source/WebCore:

Added an SPI header for a drive-by fix.

* WebCore.xcodeproj/project.pbxproj:
* platform/spi/cf/CFBundleSPI.h: Added.

Source/WebKit2:

Pass current environment variables as XPC bootstrap. Also while at it, made
_CFBundleSetupXPCBootstrap not soft linked.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(main):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::connectToService):

Source/WTF:

* wtf/spi/darwin/XPCSPI.h: Added xpc_copy_bootstrap and xpc_dictionary_apply.

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

5 years agoSupport share button.
enrica@apple.com [Thu, 23 Apr 2015 21:03:46 +0000 (21:03 +0000)]
Support share button.
https://bugs.webkit.org/show_bug.cgi?id=144077
rdar://problem/19772892

Reviewed by Darin Adler.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _share:]):
(-[WKContentView canPerformAction:withSender:]):
(-[WKContentView _define:]):
(-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
(-[WKContentView moveByOffset:]):
(-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
(-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
(-[WKContentView accessoryTab:]):
(-[WKContentView _becomeFirstResponderWithSelectionMovingForward:completionHandler:]):
(-[WKContentView executeEditCommandWithCallback:]):

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

5 years agoDFG should insert Phantoms late using BytecodeKills and block-local OSR availability
fpizlo@apple.com [Thu, 23 Apr 2015 20:47:31 +0000 (20:47 +0000)]
DFG should insert Phantoms late using BytecodeKills and block-local OSR availability
https://bugs.webkit.org/show_bug.cgi?id=143735

Reviewed by Geoffrey Garen.

We've always had bugs arising from the fact that we would MovHint something into a local,
and then fail to keep it alive. We would then try to keep things alive by putting Phantoms
on those Nodes that were MovHinted. But this became increasingly tricky. Given the
sophistication of the transformations we are doing today, this approach is just not sound
anymore.

This comprehensively fixes these bugs by having the DFG backend automatically insert
Phantoms just before codegen based on bytecode liveness. To make this practical, this also
makes it much faster to query bytecode liveness.

It's about as perf-neutral as it gets for a change that increases compiler work without
actually optimizing anything. Later changes will remove the old Phantom-preserving logic,
which should then speed us up. I can't really report concrete slow-down numbers because
they are low enough to basically be in the noise. For example, a 20-iteration run of
SunSpider yields "maybe 0.8% slower", whatever that means.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeLivenessAnalysis.cpp:
(JSC::BytecodeLivenessAnalysis::computeFullLiveness):
* bytecode/FullBytecodeLiveness.h:
(JSC::FullBytecodeLiveness::getLiveness):
* bytecode/VirtualRegister.h:
(JSC::VirtualRegister::operator+):
(JSC::VirtualRegister::operator-):
* dfg/DFGForAllKills.h:
(JSC::DFG::forAllLiveNodesAtTail):
(JSC::DFG::forAllKilledOperands):
(JSC::DFG::forAllKilledNodesAtNodeIndex):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::isLiveInBytecode):
(JSC::DFG::Graph::localsLiveInBytecode):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::forAllLocalsLiveInBytecode):
(JSC::DFG::Graph::forAllLiveInBytecode):
* dfg/DFGMayExit.cpp:
(JSC::DFG::mayExit):
* dfg/DFGMovHintRemovalPhase.cpp:
* dfg/DFGNodeType.h:
* dfg/DFGPhantomInsertionPhase.cpp: Added.
(JSC::DFG::performPhantomInsertion):
* dfg/DFGPhantomInsertionPhase.h: Added.
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* dfg/DFGScoreBoard.h:
(JSC::DFG::ScoreBoard::sortFree):
(JSC::DFG::ScoreBoard::assertClear):
* dfg/DFGVirtualRegisterAllocationPhase.cpp:
(JSC::DFG::VirtualRegisterAllocationPhase::run):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::buildExitArguments):
* tests/stress/phantom-inadequacy.js: Added.
(bar):
(baz):
(foo):

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

5 years ago[CMake] Some internal variables are not marked as advanced
mcatanzaro@igalia.com [Thu, 23 Apr 2015 20:30:24 +0000 (20:30 +0000)]
[CMake] Some internal variables are not marked as advanced
https://bugs.webkit.org/show_bug.cgi?id=143595

Reviewed by Martin Robinson.

* Source/cmake/FindFreetype2.cmake: Mark internal options as advanced.
* Source/cmake/FindHarfBuzz.cmake: Mark HARFBUZZ_ICU_LIBRARIES as advanced.

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

5 years ago[GTK] Mark as advanced the build options we don't want to expose
mcatanzaro@igalia.com [Thu, 23 Apr 2015 19:59:56 +0000 (19:59 +0000)]
[GTK] Mark as advanced the build options we don't want to expose
https://bugs.webkit.org/show_bug.cgi?id=143558

Reviewed by Martin Robinson.

Mark various options as private instead of public.

* Source/cmake/OptionsGTK.cmake:

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

5 years agoUse less memory when compiling content extensions.
commit-queue@webkit.org [Thu, 23 Apr 2015 19:56:57 +0000 (19:56 +0000)]
Use less memory when compiling content extensions.
https://bugs.webkit.org/show_bug.cgi?id=144051

Patch by Alex Christensen <achristensen@webkit.org> on 2015-04-23
Reviewed by Darin Adler and Benjamin Poulain.

Source/WebCore:

No change in functionality, correctness already covered by existing tests.

Before this patch, a DFANode contained a HashSet of transitions.
Large vectors of DFANodes made many small HashSets, which was inefficient use of memory.
We now put all the actions and transitions into one big compact Vector and each node owns ranges in that vector.

* contentextensions/CombinedURLFilters.cpp:
(WebCore::ContentExtensions::recursiveMemoryUsed):
(WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
* contentextensions/CombinedURLFilters.h:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionsDebugging.h:
* contentextensions/DFA.cpp:
(WebCore::ContentExtensions::DFA::memoryUsed):
(WebCore::ContentExtensions::DFANode::actions):
(WebCore::ContentExtensions::DFANode::transitions):
(WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
(WebCore::ContentExtensions::DFANode::changeFallbackTransition):
(WebCore::ContentExtensions::DFANode::addFallbackTransition):
(WebCore::ContentExtensions::DFANode::containsTransition):
(WebCore::ContentExtensions::DFANode::kill):
(WebCore::ContentExtensions::DFA::minimize):
(WebCore::ContentExtensions::DFA::DFA): Deleted.
(WebCore::ContentExtensions::DFA::operator=): Deleted.
* contentextensions/DFA.h:
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
(WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
(WebCore::ContentExtensions::DFABytecodeCompiler::compile):
* contentextensions/DFABytecodeCompiler.h:
* contentextensions/DFAMinimizer.cpp:
(WebCore::ContentExtensions::DFAMinimizer::minimize):
* contentextensions/DFAMinimizer.h:
* contentextensions/DFANode.h:
(WebCore::ContentExtensions::DFANode::isKilled):
(WebCore::ContentExtensions::DFANode::hasFallbackTransition):
(WebCore::ContentExtensions::DFANode::hasActions):
(WebCore::ContentExtensions::DFANode::transitionsLength):
(WebCore::ContentExtensions::DFANode::actionsLength):
(WebCore::ContentExtensions::DFANode::actionsStart):
(WebCore::ContentExtensions::DFANode::setActions):
(WebCore::ContentExtensions::DFANode::setTransitions):
(WebCore::ContentExtensions::DFANode::resetTransitions):
(WebCore::ContentExtensions::DFANode::transitionsStart):
(WebCore::ContentExtensions::DFANode::setHasFallbackTransitionWithoutChangingDFA):
* contentextensions/NFA.cpp:
(WebCore::ContentExtensions::NFA::memoryUsed):
* contentextensions/NFA.h:
* contentextensions/NFAToDFA.cpp:
(WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
(WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
(WebCore::ContentExtensions::getOrCreateDFANode):
(WebCore::ContentExtensions::NFAToDFA::convert):

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebCore/DFAMinimizer.cpp:
(TestWebKitAPI::countLiveNodes):

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

5 years ago[CMake] Should be possible for an option to depend on multiple options
mcatanzaro@igalia.com [Thu, 23 Apr 2015 19:42:34 +0000 (19:42 +0000)]
[CMake] Should be possible for an option to depend on multiple options
https://bugs.webkit.org/show_bug.cgi?id=143839

Reviewed by Martin Robinson.

Use a list instead of a single variable to track the dependencies of each option. Iterate
over the list as many times as necessary to ensure all options are properly disabled.

* Source/cmake/WebKitFeatures.cmake:

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

5 years agoRename HardPhantom to MustGenerate.
fpizlo@apple.com [Thu, 23 Apr 2015 19:25:10 +0000 (19:25 +0000)]
Rename HardPhantom to MustGenerate.

Rubber stamped by Geoffrey Garen.

We are steadily moving towards Phantom just being a backend hack in the DFG. HardPhantom
is more than that; it's a utility for forcing the execution of otherwise killable nodes.
NodeMustGenerate is the flag we use to indicate that something isn't killable. So this
node should just be called MustGenerate.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDCEPhase.cpp:
(JSC::DFG::DCEPhase::run):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::tryToRelaxRepresentation):
* dfg/DFGIntegerCheckCombiningPhase.cpp:
(JSC::DFG::IntegerCheckCombiningPhase::insertMustAdd):
* dfg/DFGMayExit.cpp:
(JSC::DFG::mayExit):
* dfg/DFGNode.h:
(JSC::DFG::Node::willHaveCodeGenOrOSR):
* dfg/DFGNodeType.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
(JSC::DFG::ObjectAllocationSinkingPhase::handleNode):
* dfg/DFGPhantomCanonicalizationPhase.cpp:
(JSC::DFG::PhantomCanonicalizationPhase::run):
* dfg/DFGPhantomRemovalPhase.cpp:
(JSC::DFG::PhantomRemovalPhase::run):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks):
(JSC::DFG::TypeCheckHoistingPhase::identifyRedundantArrayChecks):
* dfg/DFGVarargsForwardingPhase.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):

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

5 years agoediting/selection/extend-by-character-007.html should pass on OS X 10.10.3.
ap@apple.com [Thu, 23 Apr 2015 18:58:04 +0000 (18:58 +0000)]
editing/selection/extend-by-character-007.html should pass on OS X 10.10.3.

Updated the results to match what we get in 10.10.3, and marked as passing.

* editing/selection/extend-by-character-007-expected.txt: Removed.
* platform/mac/TestExpectations:
* platform/mac/editing/selection/extend-by-character-007-expected.png: Added.
* platform/mac/editing/selection/extend-by-character-007-expected.txt: Added.

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

5 years agoImplement `Object.assign`
commit-queue@webkit.org [Thu, 23 Apr 2015 18:44:16 +0000 (18:44 +0000)]
Implement `Object.assign`
https://bugs.webkit.org/show_bug.cgi?id=143980

Patch by Jordan Harband <ljharb@gmail.com> on 2015-04-23
Reviewed by Filip Pizlo.

Source/JavaScriptCore:

per https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign

* builtins/ObjectConstructor.js: Added.
(assign):
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/ObjectConstructor.cpp:
* runtime/ObjectConstructor.h:

LayoutTests:

* js/Object-assign-expected.txt: Added.
* js/Object-assign.html: Added.
* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/Object-assign.js: Added.
* js/script-tests/Object-getOwnPropertyNames.js:

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

5 years agoDon't fire a bunch of mouse moveds during scrolling.
hyatt@apple.com [Thu, 23 Apr 2015 18:41:10 +0000 (18:41 +0000)]
Don't fire a bunch of mouse moveds during scrolling.
https://bugs.webkit.org/show_bug.cgi?id=99940

Reviewed by Simon Fraser.

* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
Even for the short interval timer, make sure to cancel and restart it instead of allowing the original to
complete. This has the effect of preventing fake mouse moves from firing until the scroll stops.

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

5 years agoUnreviewed, fix the release build.
eric.carlson@apple.com [Thu, 23 Apr 2015 18:40:08 +0000 (18:40 +0000)]
Unreviewed, fix the release build.

* html/HTMLMediaSession.cpp:
(WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Add an UNUSED_PARAM.

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

5 years agoRemove m_isPageTiledBackingLayer data member from GraphicsLayerCA, just use the layer...
simon.fraser@apple.com [Thu, 23 Apr 2015 17:59:58 +0000 (17:59 +0000)]
Remove m_isPageTiledBackingLayer data member from GraphicsLayerCA, just use the layer type instead
https://bugs.webkit.org/show_bug.cgi?id=144108

Reviewed by Dean Jackson.

No need for the m_isPageTiledBackingLayer data member. We can just check the layer
type instead.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::initialize):
(WebCore::GraphicsLayerCA::platformCALayerShowRepaintCounter):
(WebCore::GraphicsLayerCA::updateContentsScale):
(WebCore::GraphicsLayerCA::getDebugBorderInfo):
(WebCore::GraphicsLayerCA::requiresTiledLayer):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::isPageTiledBackingLayer):

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

5 years agoContent extension with oft-repeated rules can cause slowdown.
beidson@apple.com [Thu, 23 Apr 2015 17:52:21 +0000 (17:52 +0000)]
Content extension with oft-repeated rules can cause slowdown.
rdar://problem/20618511 and https://bugs.webkit.org/show_bug.cgi?id=144010

Reviewed by Alex Christensen.

No new tests (Behavior covered by existing tests).

* WebCore.xcodeproj/project.pbxproj:

* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):

Add the String identifier for the extension and the rule action ID to Actions:
* contentextensions/ContentExtensionRule.cpp:
(WebCore::ContentExtensions::Action::deserialize):
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Action::Action):
(WebCore::ContentExtensions::Action::operator==):
(WebCore::ContentExtensions::Action::setExtensionIdentifier):
(WebCore::ContentExtensions::Action::extensionIdentifier):
(WebCore::ContentExtensions::Action::actionID):
(WebCore::ContentExtensions::Action::type): Deleted.

Object to manage a CSSStyleSheet and selectors identified by ID:
* contentextensions/ContentExtensionStyleSheet.cpp:
(WebCore::ContentExtensions::ContentExtensionStyleSheet::ContentExtensionStyleSheet):
(WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
* contentextensions/ContentExtensionStyleSheet.h:
(WebCore::ContentExtensions::ContentExtensionStyleSheet::create):
(WebCore::ContentExtensions::ContentExtensionStyleSheet::styleSheet):

Instead of globbing selectors together into a String and making a new stylesheet,
add new unique selectors to an already existing sheet:
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
(WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):

* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::addDisplayNoneSelector):
(WebCore::DocumentStyleSheetCollection::addContentExtensionUserSheet): Deleted.
* dom/DocumentStyleSheetCollection.h:

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
(WebCore::DocumentLoader::addPendingContentExtensionSheet): Deleted.
* loader/DocumentLoader.h:

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

5 years agoMemory cache live resources repeatedly purged during painting
antti@apple.com [Thu, 23 Apr 2015 17:48:37 +0000 (17:48 +0000)]
Memory cache live resources repeatedly purged during painting
https://bugs.webkit.org/show_bug.cgi?id=144104
<rdar://problem/20667695>

Reviewed by Chris Dumez.

On some PLT pages (like nytimes.com) we get into state where painting repeatedly purges live bitmaps.
This slows down page loads significantly.

This might have regressed because improvements in page caching keep more pages and so resources 'live'.

With this path we do all regular cache pruning asynchronously. If memory is really critical
the low memory handling code will still prune synchronously.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::removeClient):
(WebCore::CachedResource::didAccessDecodedData):

    prune() -> pruneSoon()

* loader/cache/MemoryCache.cpp:

    Decrease the pruning size target from 0.95 to 0.8 so we don't need to prune so often.

(WebCore::MemoryCache::needsPruning):

    Factor into a function.

(WebCore::MemoryCache::prune):
(WebCore::MemoryCache::pruneSoon):

    Prune asynchronously.

* loader/cache/MemoryCache.h:

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

5 years ago[CMake] ENABLE_THREADED_COMPOSITOR should not be at the bottom of the options list
mcatanzaro@igalia.com [Thu, 23 Apr 2015 17:31:30 +0000 (17:31 +0000)]
[CMake] ENABLE_THREADED_COMPOSITOR should not be at the bottom of the options list
https://bugs.webkit.org/show_bug.cgi?id=144103

Reviewed by Martin Robinson.

Just move ENABLE_THREADED_COMPOSITOR so it's alphabetized properly.

* Source/cmake/WebKitFeatures.cmake:

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

5 years ago[GTK] Fixups for ENABLE_CREDENTIAL_STORAGE
mcatanzaro@igalia.com [Thu, 23 Apr 2015 17:29:34 +0000 (17:29 +0000)]
[GTK] Fixups for ENABLE_CREDENTIAL_STORAGE
https://bugs.webkit.org/show_bug.cgi?id=144102

Reviewed by Martin Robinson.

Use WEBKIT_OPTION_DEFAULT_PORT_VALUE to set ENABLE_CREDENTIAL_STORAGE instead of doing so
manually. Fail the build if libsecret is not found but ENABLE_CREDENTIAL_STORAGE is set.
Also, do not set ENABLE_CREDENTIAL_STORAGE redundantly.

* Source/cmake/OptionsGTK.cmake:

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

5 years agoUnreviewed, temporarily skip http/tests/websocket/tests/hybi/stop-on-resume-in-error...
cdumez@apple.com [Thu, 23 Apr 2015 17:16:40 +0000 (17:16 +0000)]
Unreviewed, temporarily skip http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html on Windows.

It often crashes on Windows.

* platform/win/TestExpectations:

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

5 years agoUndo the WTF part of the previous build fix, we don't use private headers in WTF.
ap@apple.com [Thu, 23 Apr 2015 16:56:25 +0000 (16:56 +0000)]
Undo the WTF part of the previous build fix, we don't use private headers in WTF.

* WTF.xcodeproj/project.pbxproj:

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

5 years ago[UNIX] Do not allow copies of IPC::Attachment
carlosgc@webkit.org [Thu, 23 Apr 2015 16:53:05 +0000 (16:53 +0000)]
[UNIX] Do not allow copies of IPC::Attachment
https://bugs.webkit.org/show_bug.cgi?id=144096

Reviewed by Darin Adler.

It ensures that the file descriptor ownership is always correctly
transferred. This way we can remove the dispose() method to
explicitly close the file descriptor and always close it in the
Attachment destructor (unless explicitly transferred to
IPC::Connection or SharedMemory). It simplifies the code and
ensure we don't leak file descriptors.

* Platform/IPC/ArgumentDecoder.cpp:
(IPC::ArgumentDecoder::~ArgumentDecoder): Remove the code to
explicitly dispose attachments.
(IPC::ArgumentDecoder::removeAttachment): Use WTF::move().
* Platform/IPC/ArgumentEncoder.cpp:
(IPC::ArgumentEncoder::~ArgumentEncoder): Remove the code to
explicitly dispose attachments.
(IPC::ArgumentEncoder::addAttachment): Use WTF::move().
(IPC::ArgumentEncoder::releaseAttachments): Simplify by using WTF::move().
* Platform/IPC/ArgumentEncoder.h:
* Platform/IPC/Attachment.cpp:
(IPC::Attachment::encode): Move a copy of the attachment, and
reset the file descriptor, since the ownership is passed to the encoder.
* Platform/IPC/Attachment.h: Make copy constructor and assignment
private to not allow public copies. The only copy allowed is done
by Attachment::encode(). Make m_fileDescriptor mutable so that we
can reset it in Attachment::encode() after passing the ownership
to the encoder.
* Platform/IPC/unix/AttachmentUnix.cpp:
(IPC::Attachment::~Attachment): Close the file descriptor if it
hasn't been released explicitly.
(IPC::Attachment::dispose): Deleted.
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::processMessage): Do not use AttachmentResourceGuard.
(IPC::Connection::sendOutgoingMessage): Ditto.
(IPC::AttachmentResourceGuard::AttachmentResourceGuard): Deleted.
(IPC::AttachmentResourceGuard::~AttachmentResourceGuard): Deleted.
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::Handle::~Handle): Do not call clear().
(WebKit::SharedMemory::Handle::clear): Reset the attachment.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createInspectorPage): Use WTF::move().
* WebProcess/Plugins/PluginProcessConnectionManager.cpp:
(WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
Call releaseFileDescriptor() instead of fileDescritpro() since the
ownership is passed to the connection.

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

5 years agoBuild fix.
ap@apple.com [Thu, 23 Apr 2015 16:08:43 +0000 (16:08 +0000)]
Build fix.

../WebKit2:

* WebProcess/cocoa/WebProcessCocoa.mm: Correct the case of an include file name.

../WTF:

* WTF.xcodeproj/project.pbxproj: Make RAMSize.h a private header, now that it's used
from outside WTF.

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

5 years agoUnreviewed, make a suggested change I overlooked in Darin's review of
eric.carlson@apple.com [Thu, 23 Apr 2015 15:58:16 +0000 (15:58 +0000)]
Unreviewed, make a suggested change I overlooked in Darin's review of
https://bugs.webkit.org/show_bug.cgi?id=144098

* dom/Document.cpp:
(WebCore::Document::removePlaybackTargetPickerClient): const auto& -> auto
(WebCore::Document::showPlaybackTargetPicker): Ditto.
(WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
(WebCore::Document::playbackTargetAvailabilityDidChange): Ditto.
(WebCore::Document::setPlaybackTarget): Ditto.
(WebCore::Document::setShouldPlayToPlaybackTarget): Ditto.

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

5 years agoUse std::unique_ptr instead of OwnPtr in ThreadGlobalData
commit-queue@webkit.org [Thu, 23 Apr 2015 15:52:20 +0000 (15:52 +0000)]
Use std::unique_ptr instead of OwnPtr in ThreadGlobalData
https://bugs.webkit.org/show_bug.cgi?id=141950

Patch by Joonghun Park <jh718.park@samsung.com> on 2015-04-23
Reviewed by Darin Adler.

No new tests, no behavior changes.

* dom/EventNames.h:
(WebCore::EventNames::create):
* loader/cache/CachedResourceRequestInitiators.h:
* platform/ThreadGlobalData.cpp:
(WebCore::ThreadGlobalData::ThreadGlobalData):
(WebCore::ThreadGlobalData::destroy):
* platform/ThreadGlobalData.h:

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

5 years agoSome media tests assert after r183096
eric.carlson@apple.com [Thu, 23 Apr 2015 15:49:47 +0000 (15:49 +0000)]
Some media tests assert after r183096
https://bugs.webkit.org/show_bug.cgi?id=144098

Reviewed by Darin Adler.

* dom/Document.cpp:
(WebCore::Document::removePlaybackTargetPickerClient): Don't assert if the client has already
    been removed from the map. This happens when a media element is removed from the document
    before its destructor runs and is not an error.
(WebCore::Document::showPlaybackTargetPicker): It is an error to call this after the client
    has been removed from the map so leave the assert in a debug build, but return early
    so a release build doesn't crash.
(WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
(WebCore::Document::playbackTargetAvailabilityDidChange): Use "auto" for the map iterator variable.
(WebCore::Document::setPlaybackTarget): Ditto.
(WebCore::Document::setShouldPlayToPlaybackTarget): Ditto.
* dom/Document.h: Fix map typedef names.

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

5 years agoUnreviewed. Fix debug build after r183176.
carlosgc@webkit.org [Thu, 23 Apr 2015 09:43:36 +0000 (09:43 +0000)]
Unreviewed. Fix debug build after r183176.

* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::Handle::decode):
(WebKit::SharedMemory::createHandle):

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

5 years agoDOM nodes should be allocated with fastMalloc().
akling@apple.com [Thu, 23 Apr 2015 09:06:54 +0000 (09:06 +0000)]
DOM nodes should be allocated with fastMalloc().

Unreviewed. This got lost in the TreeShared merge. :|

* dom/Node.h:

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

5 years agoThere should only be one way to get the system memory size.
akling@apple.com [Thu, 23 Apr 2015 08:22:13 +0000 (08:22 +0000)]
There should only be one way to get the system memory size.
<https://webkit.org/b/144081>

Reviewed by Antti Koivisto.

Source/WebKit/mac:

* Misc/WebKitSystemBits.h:
* Misc/WebKitSystemBits.m:
(WebMemorySize): Deleted.
* WebView/WebView.mm:
(+[WebView _setCacheModel:]):
(roundUpToPowerOf2): Deleted.

Source/WebKit/win:

* WebView.cpp:
(WebView::setCacheModel):

Source/WebKit2:

* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformSetCacheModel):
(WebKit::memorySize): Deleted.
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformSetCacheModel):
(WebKit::memorySize): Deleted.

Source/WTF:

Merge all the logic from other RAM size fetcher helpers into WTF's.

Darwin ports now use host_info() instead of sysctl(), since that was the more common way
of doing this.

Also bumped the fallback answer from 128 MB to 512 MB to bring it closer to today's hardware.

Finally, the number is rounded up to the next multiple of 128 MB, to avoid misunderstandings
on some systems where the number returned by the kernel is slightly lower than the marketing
number. Removed the "fudging" that was used in some places, since this fixes that cleanly.

* wtf/RAMSize.cpp:
(WTF::computeRAMSize):

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

5 years ago[WK2] WebDiagnosticLoggingClient is leaking
cdumez@apple.com [Thu, 23 Apr 2015 08:12:30 +0000 (08:12 +0000)]
[WK2] WebDiagnosticLoggingClient is leaking
https://bugs.webkit.org/show_bug.cgi?id=144089
<rdar://problem/19706214>

Reviewed by Darin Adler.

WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
constructor but there is no code destroying it.

This patch adds a new xxxDestroyed() virtual function to
DiagnosticLoggingClient and that is overriden in
WebDiagnosticLoggingClient to call "delete this". This is the same
pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
WebProgressTrackerClient).

Source/WebCore:

* loader/EmptyClients.h:
* page/DiagnosticLoggingClient.h:
* page/MainFrame.cpp:
(WebCore::MainFrame::~MainFrame):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed):
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:

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

5 years agoCrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
antti@apple.com [Thu, 23 Apr 2015 07:57:57 +0000 (07:57 +0000)]
CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
https://bugs.webkit.org/show_bug.cgi?id=144050
rdar://problem/15534973

Reviewed by Chris Dumez.

We are seeing null Element pointer crashes with this stack:

47 com.apple.WebCore:  WebCore::toScriptElementIfPossible + 4 <==
47 com.apple.WebCore:  WebCore::ScriptRunner::timerFired + 452
47 com.apple.WebCore:  WebCore::ThreadTimers::sharedTimerFiredInternal + 175

The most likely cause seems to be that this code

    ASSERT(m_pendingAsyncScripts.contains(scriptElement));
    m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement));

in ScriptRunner::notifyScriptReady fails to find scriptElement and we are left with a null entry in
m_scriptsToExecuteSoon. However I haven't managed to repro this or find the exact path how this
could happen. The related code is fragile with lot of state (in ScriptElement class)
and involves many opportunities for re-entry via scripts.

No repro, no test case.

* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::timerFired):

    Paper this over by adding a null check. We could check m_pendingAsyncScripts.take() above
    but this also covers possibility this is caused by something else.

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

5 years ago[UNIX] Simplify the file descriptor handling in SharedMemory
carlosgc@webkit.org [Thu, 23 Apr 2015 07:28:48 +0000 (07:28 +0000)]
[UNIX] Simplify the file descriptor handling in SharedMemory
https://bugs.webkit.org/show_bug.cgi?id=144046

Reviewed by Darin Adler.

Simplify the file descriptor handling and clarify its ownership by
using IPC::Attachment in SharedMemory::Handle instead of fd and
size members. SharedMemory::Handle::adoptFromAttachment() has been
renamed as SharedMemory::Handle::adoptAttachment() and receives an
IPC::Attachment. And SharedMemory::Handle::releaseToAttachment()
has been renamed as SharedMemory::Handle::releaseAttachment().

* Platform/IPC/Attachment.h: Add move constructor and move assigned operator.
* Platform/IPC/Connection.h:
(IPC::Connection::identifierIsNull): A file descriptor is null
when it's -1 no 0.
* Platform/IPC/unix/AttachmentUnix.cpp:
(IPC::Attachment::Attachment):
(IPC::Attachment::operator=):
(IPC::Attachment::dispose): Reset the file descriptor after
closing it.
* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::processMessage): Use
SharedMemory::Handle::adoptAttachment() that receives an
IPC::Attachment now.
(IPC::Connection::sendOutgoingMessage): Use
SharedMemory::Handle::releaseAttachment().
* Platform/SharedMemory.h:
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::Handle::Handle): Remove initializers for
file descriptor and size members.
(WebKit::SharedMemory::Handle::clear): Dispose the attachment.
(WebKit::SharedMemory::Handle::isNull): Handle is null if the
attachment file descriptor is -1.
(WebKit::SharedMemory::Handle::encode): Use releaseAttachment().
(WebKit::SharedMemory::Handle::decode): Use adoptAttachment().
(WebKit::SharedMemory::Handle::releaseAttachment): Implement it
using move.
(WebKit::SharedMemory::Handle::adoptAttachment): Ditto.
(WebKit::SharedMemory::map): Use
IPC::Attachment::releaseFileDescriptor() instead of manually
changing the member.
(WebKit::SharedMemory::createHandle): Initialize the handle
attachment with the duplicated file descriptor and size.

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

5 years agoUse a typedef for TileGrid tile validation policy flags
simon.fraser@apple.com [Thu, 23 Apr 2015 07:24:57 +0000 (07:24 +0000)]
Use a typedef for TileGrid tile validation policy flags
https://bugs.webkit.org/show_bug.cgi?id=144085

Reviewed by Tim Horton.

Replace 'unsigned' with a typedef for the bitmask of TileValidationPolicyFlags.

* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::tileRevalidationTimerFired):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
* platform/graphics/ca/TileGrid.h:

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

5 years agoSlap Node's reference counting functions with ALWAYS_INLINE stick.
akling@apple.com [Thu, 23 Apr 2015 07:21:35 +0000 (07:21 +0000)]
Slap Node's reference counting functions with ALWAYS_INLINE stick.

Speculative fix for weird ~3% regression on Speedometer seen after TreeShared
was merged into Node. Since the memory layout didn't change, failure to inline
seems like a possible source of regression.

* dom/Node.h:
(WebCore::Node::ref):
(WebCore::Node::deref):
(WebCore::Node::hasOneRef):
(WebCore::Node::refCount):

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

5 years ago[iOS] Move computeCoverageRect code from FrameView into TileController
simon.fraser@apple.com [Thu, 23 Apr 2015 06:03:22 +0000 (06:03 +0000)]
[iOS] Move computeCoverageRect code from FrameView into TileController
https://bugs.webkit.org/show_bug.cgi?id=144087

Reviewed by Benjamin Poulain.

There is code in four different places that adjusts tiling coverage rect:
1. LegacyTileCache. This will remain unchanged.
2. FrameView::computeTileCoverageRect(). This was added to do velocity-based
page tiled coverage expansion for iOS WK2.
3. TileController::computeTileCoverageRect(): this is used for the page tiles
on Mac.
4. GraphicsLayerCA::adjustTiledLayerVisibleRect(). This is used by non-page
tiled layers on both iOS and Mac.

This patch reduced this list to 3, coalescing FrameView::computeTileCoverageRect()
and TileController::computeTileCoverageRect(). It removes the rect inflation that
affects the visibleRect passed into rootLayer->flushCompositingState() for iOS,
but the page tiles now do an identical coverage inflation. The visible rect
change does affect visible rect computations for non-page tiled backings, but
a future patch will restore that.

* page/FrameView.cpp:
(WebCore::FrameView::setScrollVelocity):
(WebCore::FrameView::computeCoverageRect): Deleted.
* page/FrameView.h:
* platform/graphics/TiledBacking.h:
(WebCore::VelocityData::VelocityData):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setVelocity):
(WebCore::TileController::computeTileCoverageRect):
* platform/graphics/ca/TileController.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):

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

5 years agoRemove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
darin@apple.com [Thu, 23 Apr 2015 06:02:14 +0000 (06:02 +0000)]
Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
https://bugs.webkit.org/show_bug.cgi?id=143943

Reviewed by Anders Carlsson.

Source/WebCore:

* editing/Editor.cpp:
(WebCore::Editor::insertDictationPhrases): Changed this iOS-only
function to take a Vector<Vector<String>>&& and not involve PassOwnPtr.
(WebCore::Editor::setDictationPhrasesAsChildOfElement): Changed this iOS-only
function to take a Vector<Vector<String>> and not involve PassOwnPtr. Also made
it take a reference rather than a pointer to the element and simplify the code
a bit using modern for loops and auto.
* editing/Editor.h: Ditto.

* editing/ios/DictationCommandIOS.cpp:
(WebCore::DictationCommandIOS::DictationCommandIOS): Take
a Vector<Vector<String>>&& instead of a PassOwnPtr.
(WebCore::DictationCommandIOS::~DictationCommandIOS): Deleted. No need to
explicitly define this.
(WebCore::DictationCommandIOS::doApply): Updated to use modern for loop and
work with a Vector<Vector<String>> instead of an OwnPtr.
* editing/ios/DictationCommandIOS.h: Updated to not use PassOwnPtr and OwnPtr.
Also modernized a bit by using override.

* platform/network/ios/QuickLook.h: Return an NSURLRequest * instead of a
PassOwnPtr<ResourceRequest> from this iOS-specific function.
* platform/network/ios/QuickLook.mm:
(WebCore::registerQLPreviewConverterIfNeeded): Ditto.

Source/WebKit/cf:

* WebCoreSupport/WebInspectorClientCF.cpp: Removed unneeded include.

Source/WebKit/mac:

* Plugins/Hosted/ProxyInstance.h: Removed unneeded include.
* Plugins/WebBaseNetscapePluginView.h: Ditto.

* Plugins/WebNetscapePluginEventHandler.h: Use unique_ptr instead of
PassOwnPtr for the create function. Also tweaked formatting and removed
unneeded forward declaration of CGRect.
* Plugins/WebNetscapePluginEventHandler.mm:
(WebNetscapePluginEventHandler::create): Changed to use unique_ptr and
make_unique.

* Plugins/WebNetscapePluginView.h: Use unique_ptr instead of OwnPtr for
the _eventHandler field.
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView destroyPlugin]): Changed code to work with unique_ptr.

* WebCoreSupport/WebUserMediaClient.mm: Removed unneeded include.

* WebView/WebDeviceOrientationProviderMock.mm: Changed to use make_unique.
* WebView/WebDeviceOrientationProviderMockInternal.h: Changed to use unique_ptr.

* WebView/WebFrame.mm:
(vectorForDictationPhrasesArray): Changed to return Vector<Vector<String>> and
not a PassOwnPtr. Also rewrote to be much simpler, although there is still a
pre-existing problem here where this could put empty vectors into the result,
and I'm pretty sure the client never expects any of the Vector<String> to be empty.
(-[WebFrame _loadData:MIMEType:textEncodingName:baseURL:unreachableURL:]):
Rewrote logic to involve WebCore types a bit less; old code was round tripping
things through WebCore::URL for no obvious reason.

* WebView/WebFrameInternal.h: Changed vectorForDictationPhrasesArray to return
a Vector<Vector<String>> and not a PassOwnPtr.

* WebView/WebFullScreenController.h: Removed unneeded include.

* WebView/WebViewData.h: Changed m_alternativeTextUIController to be a
m_alternativeTextUIController.
* WebView/WebViewData.mm:
(-[WebViewPrivate init]): Use make_unique to initialize m_alternativeTextUIController.

Source/WebKit2:

* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
Removed unneeded include.

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

5 years agoConvert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
jinwoo7.song@samsung.com [Thu, 23 Apr 2015 05:26:29 +0000 (05:26 +0000)]
Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
https://bugs.webkit.org/show_bug.cgi?id=144033

Reviewed by Darin Adler.

Use unique_ptr for creating a copy of cairo_path_t and use lambda function
for custom deleter, cairo_path_destroy().

* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::drawPathShadow): Use std::unique_ptr instead of OwnPtr.
(WebCore::GraphicsContext::clip): Call cairo_path_destroy() immediately.
* platform/graphics/cairo/OwnPtrCairo.cpp:
(WTF::deleteOwnedPtr<cairo_path_t>): Deleted. Remove unnecessary deleter anymore.
* platform/graphics/cairo/OwnPtrCairo.h: Ditto.

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

5 years agoEliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing...
darin@apple.com [Thu, 23 Apr 2015 05:20:23 +0000 (05:20 +0000)]
Eliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing and platform directories
https://bugs.webkit.org/show_bug.cgi?id=143949

Reviewed by Andreas Kling.

Source/WebCore:

* dom/ContainerNode.h: Removed unneeded includes and forward declarations.
* dom/Document.h: Ditto.

* dom/DocumentParser.h: Fixed comment to not mention PassOwnPtr.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::create): Return a Ref instead of a PassRefPtr.
(WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation): Pass a reference
rather than a pointer to TextTrackRepresentation::create.
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): Return a
RefPtr instead of a PassRefPtr.

* html/shadow/MediaControlElements.h: Use unique_ptr for m_textTrackRepresentation.
Also fix a couple uses of PassRefPtr.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader): Use make_unique.
(WebCore::DocumentLoader::addAllArchiveResources): Ditto.
(WebCore::DocumentLoader::addArchiveResource): Ditto.
(WebCore::DocumentLoader::clearArchiveResources): Set to nullptr instead of calling clear.
(WebCore::DocumentLoader::startLoadingMainResource): Use make_unique.
* loader/DocumentLoader.h: Made m_archiveResourceCollection and
m_applicationCacheHost use unique_ptr.

* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): Use delete here instead
of using OwnPtr to do the deletion. Matches the other code nearby.

* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Handle case where the host is
null; this happens during the DocumentLoader destruction process since unique_ptr sets itself
to null before it destroys the object it points to and OwnPtr does not.

* loader/cocoa/DiskCacheMonitorCocoa.mm:
(WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Use delete instead of adoptPtr
to delete a raw pointer.
(WebCore::DiskCacheMonitor::DiskCacheMonitor): Use unique_ptr instead of OwnPtr.

* page/DragController.h: Removed some unneeded forward declarations and changed the
create function to return unique_ptr.

* platform/LayoutUnit.h: Removed wtf_ceil workaround hack here. Not sure why we ever did it
this way!

* platform/graphics/FontCascade.cpp:
(WTF::deleteOwnedPtr<WebCore::TextLayout>): Deleted.
(WebCore::FontCascade::createLayout): Changed to return a unique_ptr.
(WebCore::FontCascade::deleteLayout): Deleted.
* platform/graphics/FontCascade.h: Made the above changes.

* platform/graphics/ImageBuffer.h: Changed copyImage to return a RefPtr instead of a PassRefPtr.

* platform/graphics/TextTrackRepresentation.cpp:
(WebCore::TextTrackRepresentation::create): Use make_unique and return a unique_ptr.
* platform/graphics/TextTrackRepresentation.h: Removed unneeded includes and forward declarations
and made create return a unique_ptr.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::copyImage): Changed to return a RefPtr.
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::copyImage): Changed to return a RefPtr.

* platform/graphics/ios/TextTrackRepresentationIOS.h: Use reference instead of pointer,
made more things private.
* platform/graphics/ios/TextTrackRepresentationIOS.mm:
(TextTrackRepresentation::create): Use make_unique.
(TextTrackRepresentationIOS::TextTrackRepresentationIOS): Take a reference.

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::FontCascade::createLayout): Return a unique_ptr with a custom destruction function.
The custom destruction function eliminates the need to put TextLayout in a visible header.
(WebCore::FontCascade::deleteLayout): Deleted. Use a lambda instead.
(WebCore::roundCGFloat): Deleted. Old fashioned way to deal with multiple floating point sizes.
Just use std::round instead.
(WebCore::ceilCGFloat): Deleted. Same as above. Just use std::ceil instead.
(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Use std::round and std::ceil.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderTextInfo::RenderTextInfo): Deleted. Can compile constructor and destructor
now thanks to use of unique_ptr with a custom deleter.
(WebCore::RenderTextInfo::~RenderTextInfo): Deleted. Ditto.
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Updated for RenderTextInfo data member
name change.

* rendering/RenderView.h: Removed unneeded include.

* rendering/line/BreakingContext.h: Removed unneeded include.
(WebCore::BreakingContext::handleOutOfFlowPositioned): Updated for RenderTextInfo data member
name change.
(WebCore::BreakingContext::handleFloat): Ditto.
(WebCore::BreakingContext::handleReplaced): Ditto.
(WebCore::BreakingContext::handleText): Ditto.
(WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Ditto.

* rendering/line/LineBreaker.h: Made the RenderTextInfo struct more like a struct by taking
off all the m_ prefixes from the data member names. Initialized all the values in the struct
to defaults so we don't need an explicit constructor. We also don't need an explicit destructor
any more due to use of a unique_ptr with a deleter.

Source/WTF:

* wtf/MathExtras.h:
(wtf_ceil): Deleted. This was a workaround for a bug that was introduced in Leopard and
fixed in Snow Leopard <rdar://problem/6286405>, so we don't need the workaround any more.

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

5 years agoVolume slider appears/doesn't appear at the wrong times.
roger_fong@apple.com [Thu, 23 Apr 2015 04:38:11 +0000 (04:38 +0000)]
Volume slider appears/doesn't appear at the wrong times.
https://bugs.webkit.org/show_bug.cgi?id=144072.
<rdar://problem/20576145>

Reviewed by Dean Jackson.

Set background divs to match volume box dimensions.
* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-volume-slider-container-background):
(audio::-webkit-media-controls-volume-slider-container-tint):

Draw the volume slider immediately on mousing over the mute box.
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.createControls):
(Controller.prototype.handleMuteBoxOver):

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

5 years ago[Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
jer.noble@apple.com [Thu, 23 Apr 2015 04:31:45 +0000 (04:31 +0000)]
[Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
https://bugs.webkit.org/show_bug.cgi?id=144023

Reviewed by Darin Adler.

Partially revert r183097 (as it was not sufficient to protect against re-entrancy). Instead,
protect against re-entrancy in provideMediaData() directly by removing the first sample
from the TrackBuffer's decodeQueue at a time. If provideMediaData() is called re-entrantly,
or if any other method which modifies the decodeQueue is called from inside
provideMediaData, no iterators will be invalidated.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):

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

5 years agoUnreviewed, fix debug build.
fpizlo@apple.com [Thu, 23 Apr 2015 02:40:24 +0000 (02:40 +0000)]
Unreviewed, fix debug build.

* dfg/DFGGraph.h:
(JSC::DFG::Graph::performSubstitutionForEdge):

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

5 years agoNodes should have an optional epoch field
fpizlo@apple.com [Thu, 23 Apr 2015 02:36:08 +0000 (02:36 +0000)]
Nodes should have an optional epoch field
https://bugs.webkit.org/show_bug.cgi?id=144084

Reviewed by Ryosuke Niwa and Mark Lam.

This makes it easier to do epoch-based analyses on nodes. I plan to do just that in
https://bugs.webkit.org/show_bug.cgi?id=143735. Currently the epoch field is not yet
used.

* dfg/DFGCPSRethreadingPhase.cpp:
(JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
* dfg/DFGCSEPhase.cpp:
* dfg/DFGEpoch.h:
(JSC::DFG::Epoch::fromUnsigned):
(JSC::DFG::Epoch::toUnsigned):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::clearReplacements):
(JSC::DFG::Graph::clearEpochs):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::performSubstitutionForEdge):
* dfg/DFGNode.h:
(JSC::DFG::Node::Node):
(JSC::DFG::Node::replaceWith):
(JSC::DFG::Node::replacement):
(JSC::DFG::Node::setReplacement):
(JSC::DFG::Node::epoch):
(JSC::DFG::Node::setEpoch):
* dfg/DFGSSAConversionPhase.cpp:
(JSC::DFG::SSAConversionPhase::run):

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

5 years agoFix assertion failure and race condition in Options::dumpSourceAtDFGTime().
mark.lam@apple.com [Thu, 23 Apr 2015 02:29:14 +0000 (02:29 +0000)]
Fix assertion failure and race condition in Options::dumpSourceAtDFGTime().
https://bugs.webkit.org/show_bug.cgi?id=143898

Reviewed by Filip Pizlo.

CodeBlock::dumpSource() will access SourceCode strings in a way that requires
ref'ing of the underlying StringImpls. This is unsafe to do from arbitrary
compilation threads because StringImpls are not thread safe. As a result, we get
an assertion failure when we run with JSC_dumpSourceAtDFGTime=true on a debug
build.

This patch fixes the issue by only collecting the CodeBlock (and associated info)
into a DeferredSourceDump record while compiling, and stashing it away in a
deferredSourceDump list in the DeferredCompilationCallback object to be dumped
later.

When compilation is done, the callback object will be notified that
compilationDidComplete().  We will dump the SourceCode strings from there.
Since compilationDidComplete() is guaranteed to only be called on the thread
doing JS execution, it is safe to access the SourceCode strings there and ref
their underlying StringImpls as needed.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/DeferredCompilationCallback.cpp:
(JSC::DeferredCompilationCallback::compilationDidComplete):
(JSC::DeferredCompilationCallback::sourceDumpInfo):
(JSC::DeferredCompilationCallback::dumpCompiledSources):
* bytecode/DeferredCompilationCallback.h:
* bytecode/DeferredSourceDump.cpp: Added.
(JSC::DeferredSourceDump::DeferredSourceDump):
(JSC::DeferredSourceDump::dump):
* bytecode/DeferredSourceDump.h: Added.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseCodeBlock):
* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):

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

5 years agoCreate RenderRubyText for <rt> only when the parent renderer is a RenderRuby.
zalan@apple.com [Thu, 23 Apr 2015 02:16:52 +0000 (02:16 +0000)]
Create RenderRubyText for <rt> only when the parent renderer is a RenderRuby.
https://bugs.webkit.org/show_bug.cgi?id=144035
rdar://problem/20604467

Reviewed by Darin Adler.

This patch extends HTMLElement::createElementRenderer()
with the render tree insertion point so that we can create different type
of renderers based on the render tree context.

Source/WebCore:

Test: fast/ruby/ruby-rt-with-region-crash.html

* CMakeLists.txt:
* Modules/plugins/PluginReplacement.h:
* Modules/plugins/QuickTimePluginReplacement.h:
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::createElementRenderer):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::createElementRenderer):
* Modules/plugins/YouTubePluginReplacement.h:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::createElementRenderer):
* dom/Element.h:
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::createElementRenderer):
* html/HTMLAppletElement.h:
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::createElementRenderer):
* html/HTMLAttachmentElement.h:
* html/HTMLBRElement.cpp:
(WebCore::HTMLBRElement::createElementRenderer):
* html/HTMLBRElement.h:
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::createElementRenderer):
* html/HTMLButtonElement.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createElementRenderer):
* html/HTMLCanvasElement.h:
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::createElementRenderer):
* html/HTMLDetailsElement.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createElementRenderer):
* html/HTMLElement.h:
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::createElementRenderer):
* html/HTMLFieldSetElement.h:
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::createElementRenderer):
* html/HTMLFrameElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::createElementRenderer):
* html/HTMLFrameSetElement.h:
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::createElementRenderer):
* html/HTMLIFrameElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::createElementRenderer):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createElementRenderer):
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLMediaElement.h:
* html/HTMLMeterElement.cpp:
(WebCore::HTMLMeterElement::createElementRenderer):
* html/HTMLMeterElement.h:
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::createElementRenderer):
* html/HTMLPlugInElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::createElementRenderer):
* html/HTMLPlugInImageElement.h:
* html/HTMLProgressElement.cpp:
(WebCore::HTMLProgressElement::createElementRenderer):
* html/HTMLProgressElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::createElementRenderer):
* html/HTMLSelectElement.h:
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::createElementRenderer):
* html/HTMLSummaryElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createElementRenderer):
* html/HTMLTextAreaElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::createElementRenderer):
* html/HTMLVideoElement.h:
* html/HTMLWBRElement.cpp:
(WebCore::HTMLWBRElement::createElementRenderer):
* html/HTMLWBRElement.h:
* html/RubyElement.cpp:
(WebCore::RubyElement::createElementRenderer):
* html/RubyElement.h:
* html/RubyTextElement.cpp:
(WebCore::RubyTextElement::createElementRenderer):
* html/RubyTextElement.h:
* html/shadow/DetailsMarkerControl.cpp:
(WebCore::DetailsMarkerControl::createElementRenderer):
* html/shadow/DetailsMarkerControl.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineContainerElement::createElementRenderer):
(WebCore::MediaControlVolumeSliderContainerElement::createElementRenderer):
(WebCore::MediaControlTextTrackContainerElement::createElementRenderer):
* html/shadow/MediaControlElements.h:
* html/shadow/MeterShadowElement.cpp:
(WebCore::MeterInnerElement::createElementRenderer):
* html/shadow/MeterShadowElement.h:
* html/shadow/ProgressShadowElement.cpp:
(WebCore::ProgressInnerElement::createElementRenderer):
* html/shadow/ProgressShadowElement.h:
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::createElementRenderer):
(WebCore::SliderContainerElement::createElementRenderer):
* html/shadow/SliderThumbElement.h:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerContainer::createElementRenderer):
(WebCore::TextControlInnerTextElement::createElementRenderer):
* html/shadow/TextControlInnerElements.h:
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::createElementRenderer):
* html/shadow/mac/ImageControlsButtonElementMac.h:
* html/shadow/mac/ImageControlsRootElementMac.cpp:
(WebCore::ImageControlsRootElementMac::createElementRenderer):
* html/shadow/mac/ImageControlsRootElementMac.h:
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::createElementRenderer):
* html/track/VTTCue.h:
* mathml/MathMLInlineContainerElement.cpp:
(WebCore::MathMLInlineContainerElement::createElementRenderer):
* mathml/MathMLInlineContainerElement.h:
* mathml/MathMLMathElement.cpp:
(WebCore::MathMLMathElement::createElementRenderer):
* mathml/MathMLMathElement.h:
* mathml/MathMLMencloseElement.cpp:
(WebCore::MathMLMencloseElement::createElementRenderer):
* mathml/MathMLMencloseElement.h:
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::createElementRenderer):
* mathml/MathMLSelectElement.h:
* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::createElementRenderer):
* mathml/MathMLTextElement.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::clone):
* rendering/RenderElement.cpp:
* rendering/RenderRuby.h:
(WebCore::isRuby):
* style/RenderTreePosition.cpp: Added.
(WebCore::RenderTreePosition::computeNextSibling):
(WebCore::RenderTreePosition::invalidateNextSibling):
(WebCore::RenderTreePosition::previousSiblingRenderer):
(WebCore::RenderTreePosition::nextSiblingRenderer):
(WebCore::RenderTreePosition::isRendererReparented):
* style/RenderTreePosition.h: Added.
(WebCore::RenderTreePosition::RenderTreePosition):
(WebCore::RenderTreePosition::parent):
(WebCore::RenderTreePosition::canInsert):
(WebCore::RenderTreePosition::insert):
* style/StyleResolveTree.cpp:
(WebCore::Style::createRendererIfNeeded):
(WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
(WebCore::Style::textRendererIsNeeded):
(WebCore::Style::RenderTreePosition::parent): Deleted.
(WebCore::Style::isRendererReparented): Deleted.
(WebCore::Style::nextSiblingRenderer): Deleted.
(WebCore::Style::RenderTreePosition::RenderTreePosition): Deleted.
(WebCore::Style::RenderTreePosition::canInsert): Deleted.
(WebCore::Style::RenderTreePosition::insert): Deleted.
(WebCore::Style::RenderTreePosition::computeNextSibling): Deleted.
(WebCore::Style::RenderTreePosition::invalidateNextSibling): Deleted.
(WebCore::Style::previousSiblingRenderer): Deleted.
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::createElementRenderer):
* svg/SVGAElement.h:
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::createElementRenderer):
* svg/SVGAltGlyphElement.h:
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::createElementRenderer):
* svg/SVGCircleElement.h:
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::createElementRenderer):
* svg/SVGClipPathElement.h:
* svg/SVGDefsElement.cpp:
(WebCore::SVGDefsElement::createElementRenderer):
* svg/SVGDefsElement.h:
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::createElementRenderer):
* svg/SVGEllipseElement.h:
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::createElementRenderer):
* svg/SVGFilterElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::createElementRenderer):
* svg/SVGFilterPrimitiveStandardAttributes.h:
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::createElementRenderer):
* svg/SVGForeignObjectElement.h:
* svg/SVGGElement.cpp:
(WebCore::SVGGElement::createElementRenderer):
* svg/SVGGElement.h:
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::createElementRenderer):
* svg/SVGGraphicsElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::createElementRenderer):
* svg/SVGImageElement.h:
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::createElementRenderer):
* svg/SVGLinearGradientElement.h:
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::createElementRenderer):
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::createElementRenderer):
* svg/SVGMaskElement.h:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::createElementRenderer):
* svg/SVGPathElement.h:
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::createElementRenderer):
* svg/SVGPatternElement.h:
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::createElementRenderer):
* svg/SVGRadialGradientElement.h:
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::createElementRenderer):
* svg/SVGRectElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::createElementRenderer):
* svg/SVGSVGElement.h:
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::createElementRenderer):
* svg/SVGStopElement.h:
* svg/SVGSwitchElement.cpp:
(WebCore::SVGSwitchElement::createElementRenderer):
* svg/SVGSwitchElement.h:
* svg/SVGSymbolElement.cpp:
(WebCore::SVGSymbolElement::createElementRenderer):
* svg/SVGSymbolElement.h:
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::createElementRenderer):
* svg/SVGTRefElement.h:
* svg/SVGTSpanElement.cpp:
(WebCore::SVGTSpanElement::createElementRenderer):
* svg/SVGTSpanElement.h:
* svg/SVGTextElement.cpp:
(WebCore::SVGTextElement::createElementRenderer):
* svg/SVGTextElement.h:
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::createElementRenderer):
* svg/SVGTextPathElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::createElementRenderer):
* svg/SVGUseElement.h:

LayoutTests:

* fast/ruby/ruby-rt-with-region-crash-expected.txt: Added.
* fast/ruby/ruby-rt-with-region-crash.html: Added.

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

5 years ago[CMake] Clean up JSC JIT options
mcatanzaro@igalia.com [Thu, 23 Apr 2015 02:15:02 +0000 (02:15 +0000)]
[CMake] Clean up JSC JIT options
https://bugs.webkit.org/show_bug.cgi?id=143998

Reviewed by Filip Pizlo.

.:

* Source/cmake/OptionsEfl.cmake: Remove handling of ENABLE_LLINT_C_LOOP and preprocessor
  define for ENABLE_FTL_NATIVE_CALL_INLINING.
* Source/cmake/OptionsMac.cmake: Remove override of ENABLE_LLINT_C_LOOP
* Source/cmake/WebKitFeatures.cmake: Remove ENABLE_LLINT_C_LOOP. Add ENABLE_DFG_JIT and
  ENABLE_FTL_NATIVE_CALL_INLINING. Specify proper dependencies for these features.
* Source/cmakeconfig.h.cmake: Remove ENABLE_LLINT_C_LOOP and add ENABLE_DFG_JIT.

Tools:

* Scripts/build-jsc: Do not use -ENABLE_LLINT_C_LOOP on CMake ports.
* Scripts/webkitperl/FeatureList.pm: Remove ENABLE_LLINT_C_LOOP.

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

5 years agoVisibleSelection should only accept Range by reference
bfulgham@apple.com [Thu, 23 Apr 2015 02:14:45 +0000 (02:14 +0000)]
VisibleSelection should only accept Range by reference
https://bugs.webkit.org/show_bug.cgi?id=144047

Reviewed by Tim Horton.

Source/WebCore:

Update VisibleSelection to expect a Range reference argument, rather than a
Range*. Also update all uses of VisibleSelection to pass a reference instead
of a pointer.

No change in behavior, so new tests.

* editing/Editor.cpp:
(WebCore::Editor::selectionForCommand):
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::transpose):
(WebCore::Editor::findString):
(WebCore::Editor::rangeOfString):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectedRange):
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::VisibleSelection):
* editing/VisibleSelection.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::replaceNodeFromPasteboard):
* page/DragController.cpp:
(WebCore::selectElement):
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
* rendering/SelectionSubtreeRoot.cpp:
(WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):

Source/WebKit/mac:

Update all uses of VisibleSelection to pass a Range reference instead
of a Range pointer.

* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::imageForCurrentSharingServicePickerItem):
* WebView/WebFrame.mm:
(-[WebFrame _selectNSRange:]):

Source/WebKit2:

Update all uses of VisibleSelection to pass a Range reference instead
of a Range pointer.

* WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
(WebKit::InjectedBundleRangeHandle::renderedImage):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::getImageForFindMatch):
(WebKit::FindController::selectFindMatch):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync):
(WebKit::WebPage::setCompositionAsync):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::insertDictatedTextAsync):

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

5 years agoAudio controls should render with a black background.
roger_fong@apple.com [Thu, 23 Apr 2015 02:12:44 +0000 (02:12 +0000)]
Audio controls should render with a black background.
https://bugs.webkit.org/show_bug.cgi?id=144074.
<rdar://problem/20596939>

Reviewed by Darin Adler.

* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-panel-background-container):
(audio::-webkit-media-controls-panel .volume-box):

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

5 years agoInline media control icons scale down when video is too small.
roger_fong@apple.com [Thu, 23 Apr 2015 02:11:34 +0000 (02:11 +0000)]
Inline media control icons scale down when video is too small.
https://bugs.webkit.org/show_bug.cgi?id=144073.
<rdar://problem/20659451>

Reviewed by Darin Adler.

Just make sure the buttons use min-width.
* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-rewind-button):
(audio::-webkit-media-controls-play-button):
(audio::-webkit-media-controls-panel .mute-box):
(video::-webkit-media-controls-volume-max-button):
(audio::-webkit-media-controls-wireless-playback-picker-button):
(audio::-webkit-media-controls-toggle-closed-captions-button):
(audio::-webkit-media-controls-fullscreen-button):

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

5 years agoAdd new optimized fullscreen delegate methods
jer.noble@apple.com [Wed, 22 Apr 2015 23:28:48 +0000 (23:28 +0000)]
Add new optimized fullscreen delegate methods
https://bugs.webkit.org/show_bug.cgi?id=144071

Reviewed by Eric Carlson.

AVPlayerViewController requires three new delegate methods to be implemented by WebKit which
notify the delegates exactly when the owning view will enter and leave fullscreen mode. One
of the delegate methods (-enterOptimizedFullScreenModeRedirectingVideoToLayer:) gives the
delegate an opportunity to move the video sublayer into a new CALayer. The matching delegate
(-leaveOptimizedFullScreenMode), allows us to return our sublayer back to its original parent.
The third delegate (-isOptimizedFullscreenPossible) is required so the AVPlayerViewController
knows whether to allow a standard -> optimized fullscreen transition.

Drive-by fix: initialize ivars at declaration time.

* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerController isOptimizedFullscreenPossible]):
(-[WebAVVideoLayer enterOptimizedFullScreenModeRedirectingVideoToLayer:]):
(-[WebAVVideoLayer leaveOptimizedFullScreenMode]):
(WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
(WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal):
(+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]): Deleted.

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

5 years agoContext menu doesn't account for selection semantics
bfulgham@apple.com [Wed, 22 Apr 2015 23:23:14 +0000 (23:23 +0000)]
Context menu doesn't account for selection semantics

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

5 years ago[iOS] Caret does not line up with text when using the system font
mmaxfield@apple.com [Wed, 22 Apr 2015 23:22:50 +0000 (23:22 +0000)]
[iOS] Caret does not line up with text when using the system font
https://bugs.webkit.org/show_bug.cgi?id=144076
<rdar://problem/20578301>

Reviewed by Enrica Casucci.

Determining caret locations often uses the complex text codepath, which means
the complex text codepath must know about custom tracking.

This regression is due to r182512.

Note that this patch is a short-term solution until I can solve the bigger issue of
having two CTFontRefs and using each in their proper place.

No new tests because there is no way to robustly test the system font.

* platform/graphics/Font.h:
(WebCore::Font::hasCustomTracking):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::canUseFastGlyphAdvanceGetter):
(WebCore::Font::platformWidthForGlyph):
(WebCore::hasCustomTracking): Deleted.
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
(WebCore::Font::getCFStringAttributes):

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

5 years agoAdd WK_ARRAY and WK_SET annotations
andersca@apple.com [Wed, 22 Apr 2015 23:19:22 +0000 (23:19 +0000)]
Add WK_ARRAY and WK_SET annotations
https://bugs.webkit.org/show_bug.cgi?id=144075
rdar://problem/19417770

Reviewed by Dan Bernstein.

* Shared/API/Cocoa/WKFoundation.h:
* UIProcess/API/Cocoa/WKBackForwardList.h:
* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.h:
* mac/postprocess-framework-headers.sh:

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

5 years agoUnreviewed test fix after r183138.
bfulgham@apple.com [Wed, 22 Apr 2015 23:02:20 +0000 (23:02 +0000)]
Unreviewed test fix after r183138.

* editing/selection/context-menu-text-selection-lookup-expected.txt: The wrong
expectations were committed.

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

5 years agoUpdate results for two CSS tests affected by new fonts in OS X 10.10.3.
ap@apple.com [Wed, 22 Apr 2015 22:59:40 +0000 (22:59 +0000)]
Update results for two CSS tests affected by new fonts in OS X 10.10.3.

* platform/mac-mavericks/css2.1: Added.
* platform/mac-mavericks/css2.1/t1202-counter-04-b-expected.png: Copied from LayoutTests/platform/mac/css2.1/t1202-counter-04-b-expected.png.
* platform/mac-mavericks/css2.1/t1202-counter-04-b-expected.txt: Copied from LayoutTests/platform/mac/css2.1/t1202-counter-04-b-expected.txt.
* platform/mac-mavericks/css2.1/t1202-counters-04-b-expected.png: Copied from LayoutTests/platform/mac/css2.1/t1202-counters-04-b-expected.png.
* platform/mac-mavericks/css2.1/t1202-counters-04-b-expected.txt: Copied from LayoutTests/platform/mac/css2.1/t1202-counters-04-b-expected.txt.
* platform/mac/TestExpectations:
* platform/mac/css2.1/t1202-counter-04-b-expected.png:
* platform/mac/css2.1/t1202-counter-04-b-expected.txt:
* platform/mac/css2.1/t1202-counters-04-b-expected.png:
* platform/mac/css2.1/t1202-counters-04-b-expected.txt:

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

5 years agofast/text/emoji.html passes on OS X 10.10.3 and higher.
ap@apple.com [Wed, 22 Apr 2015 22:46:13 +0000 (22:46 +0000)]
fast/text/emoji.html passes on OS X 10.10.3 and higher.

* platform/mac/TestExpectations: Mark it as such.

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

5 years ago[Mac] Device picker menu is positioned incorrectly in WK1
eric.carlson@apple.com [Wed, 22 Apr 2015 22:43:41 +0000 (22:43 +0000)]
[Mac] Device picker menu is positioned incorrectly in WK1
https://bugs.webkit.org/show_bug.cgi?id=144049
<rdar://problem/20493101>

Reviewed by Dean Jackson.

* WebView/WebView.mm:
(-[WebView _showPlaybackTargetPicker:location:hasVideo:]): Mouse location is already in
    window coordinates so don't call convertRect:toView:nil.

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

5 years agoImplement String.codePointAt()
benjamin@webkit.org [Wed, 22 Apr 2015 22:25:27 +0000 (22:25 +0000)]
Implement String.codePointAt()
https://bugs.webkit.org/show_bug.cgi?id=143934

Reviewed by Darin Adler.

Source/JavaScriptCore:

This patch adds String.codePointAt() as defined by ES6.
I opted for a C++ implementation for now.

* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
(JSC::codePointAt):
(JSC::stringProtoFuncCodePointAt):

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/string-code-point-at.js: Added.
(objectWithCustomToString.toString):
(objectThrowingOnToString.toString):
(objectCountingToString.toString):
(testLeadSurrogateOutOfBounds):
(testLeadSurrogateAsLastCharacter):
(testTrailSurrogateOutOfbounds):
(testAccessNullInString):
(testNormalCombinationOfSurrogates):
* js/string-code-point-at-expected.txt: Added.
* js/string-code-point-at.html: Added.

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

5 years agoUnreviewed build fix after r183136.
bfulgham@apple.com [Wed, 22 Apr 2015 22:17:49 +0000 (22:17 +0000)]
Unreviewed build fix after r183136.

* WebProcess/WebPage/mac/WebPageMac.mm: Correct capitalization of
'HTMLPluginImageElement.h' -> 'HTMLPlugInImageElement.h'

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

5 years agoContext menu doesn't account for selection semantics
bfulgham@apple.com [Wed, 22 Apr 2015 22:10:29 +0000 (22:10 +0000)]
Context menu doesn't account for selection semantics
https://bugs.webkit.org/show_bug.cgi?id=143958
<rdar://problem/19735706>

Reviewed by Tim Horton.

Source/WebCore:

Before using the default word-only selection for context menus, check with the
lookup service to see if we can get a semantically appropriate selection.

* editing/EditingBehavior.h:
(WebCore::EditingBehavior::shouldSelectBasedOnDictionaryLookup): Added, so that we can
behavior correctly when using non-Mac editing behavior.
* editing/mac/DictionaryLookup.mm:
(WebCore::rangeForDictionaryLookupAtHitTestResult): Modified to honor standard WebKit
behavior when hit testing at end-of-line/end-of-paragraph, etc.
* page/EventHandler.cpp:
(WebCore::EventHandler::shouldAppendTrailingWhitespace): New helper function to share code.
(WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Added.
(WebCore::EventHandler::selectClosestContextualWordFromMouseEvent): Added.
(WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent): Renamed from selectClosestWordOrLinkFromMouseEvent.
Have this call the new 'selectClosestContextualWordFromMouseEvent' instead of the vanilla 'selectClosestWordFromMouseEvent'.
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Added.

LayoutTests:

* editing/selection/context-menu-text-selection-lookup-expected.txt: Added.
* editing/selection/context-menu-text-selection-lookup.html: Added.

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

5 years agoSource/WebCore:
bfulgham@apple.com [Wed, 22 Apr 2015 21:23:54 +0000 (21:23 +0000)]
Source/WebCore:
[Mac] Extend action menus to support PDF
https://bugs.webkit.org/show_bug.cgi?id=143895
<rdar://problem/19003333>

Reviewed by Tim Horton.

Tested by TestWebKitAPI ActionMenus.mm.

Add a new dictionary lookup method to support PDF Selections. This code replicates the
DOM Range-based logic used for HTML documents, but does so using the PDFKit API and
its support types.

* Configurations/Base.xcconfig: Add PDFKit include path for build.
* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::expandSelectionByCharacters): Helper function for PDF support.
(WebCore::dictionaryLookupForPDFSelection): Added.

Source/WebKit/mac:
Extend action menus to support PDF
https://bugs.webkit.org/show_bug.cgi?id=143895
<rdar://problem/19003333>

Reviewed by Tim Horton.

Prevent a crash when someone attempts to invoke an action menu on a PDF hosted
in a WK1 view.

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController performHitTestAtPoint:]): Handle WebPDFView as well as
the WebHTMLView case.
* WebView/WebDocument.h:
* WebView/WebHTMLView.h:
* WebView/WebHTMLView.mm:
(-[WebHTMLView _frame]):
* WebView/WebHTMLViewInternal.h:
* WebView/WebPDFView.h:
* WebView/WebPDFView.mm:
(-[WebPDFView _frame]): Added.

Source/WebKit2:
Extend action menus to support PDF
https://bugs.webkit.org/show_bug.cgi?id=143895
<rdar://problem/19003333>

Reviewed by Tim Horton.

If the mouse pointer is over a PDF, try to provide a relevant action menu for whatever
content is under the mouse. For now, we only support copying text and handling URLs.

If no text is selected, use the dictionary lookup service to find a semantically appropriate
selection underneath the mouse. This is consistent with how normal text is treated in pure HTML
views. If some text is already selected, and the mouse is over the existing selection, continue
using the selected text. Otherwise, discard the old selection and select the most appropriate
region under the mouse pointer.

* Shared/API/c/WKActionMenuTypes.h: Add PDF menu option.
* Shared/WebMouseEvent.cpp: Recognize mouse force events as valid mouse events.
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItemsForPDF]): Add simply copy text option.
(-[WKActionMenuController _defaultMenuItems]): Recognize PDFs and add relevant action
menu entries.
* WebProcess/Plugins/Netscape/NetscapePlugin.h: Provide stub for new method.
* WebProcess/Plugins/PDF/PDFLayerControllerDetails.h: Expose 'rectsForSelectionInLayerSpace',
'rectsForAnnotationInLayoutSpace', 'layout', and 'currentPage'.
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::getSelectionForWordAtPoint): Added.
(WebKit::PDFPlugin::existingSelectionContainsPoint): Added.
(WebKit::PDFPlugin::lookupTextAtLocation): Added.
* WebProcess/Plugins/Plugin.h: Add declaration for new 'getSelectionForWordAtPoint' method.
* WebProcess/Plugins/PluginProxy.h: Provide stub for new method.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::getSelectionForWordAtPoint): Added.
(WebKit::PluginView::existingSelectionContainsPoint): Added.
(WebKit::PluginView::lookupTextAtLocation): Added.
* WebProcess/Plugins/PluginView.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation): Update to support PDF documents and retrieve
relevant content to support later action menu handling.

Tools:
[Mac] Extend action menus to support PDF
https://bugs.webkit.org/show_bug.cgi?id=143895
<rdar://problem/19003333>

Reviewed by Tim Horton.

Reactivate the action menu tests, and add a new PDF-based test to make sure that selection
of PDF content works.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add new 'test.pdf' resource to bundle.
* TestWebKitAPI/Tests/WebKit2/action-menu-targets.html: Update with a new PDF pane.
* TestWebKitAPI/Tests/WebKit2/test.pdf: Added.
* TestWebKitAPI/Tests/WebKit2ObjC/ActionMenus.mm:
(-[ActionMenusTestWKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]):
Update to support PDF tests.
(TestWebKitAPI::windowPointForTarget): Add new target for PDF test.
(TestWebKitAPI::waitForPDFToLoad): New helper function to avoid starting test before the PDF is available.

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

5 years agoWeb Inspector: clicking Timelines tree view nodes should not change the current conte...
commit-queue@webkit.org [Wed, 22 Apr 2015 21:12:40 +0000 (21:12 +0000)]
Web Inspector: clicking Timelines tree view nodes should not change the current content view
https://bugs.webkit.org/show_bug.cgi?id=132202

Patch by Matt Baker <mattbaker@apple.com> on 2015-04-22
Reviewed by Brian Burg.

TimelineSidebarPanel now prevents timeline views from switching to another content view while the content
browser is showing the TimelineRecordingContentView. Code responsible for creating and updating the tree
element close button, which was duplicated in multiple derived TimelineView classes, has been moved to the
TimelineView base class.

* UserInterface/Views/LayoutTimelineView.js:
Updated name of location column, which was broken in a recent patch.
(WebInspector.LayoutTimelineView.prototype.treeElementDeselected):
(WebInspector.LayoutTimelineView.prototype.treeElementSelected):
Added overrides of new base class methods to handle view-specific highlight logic.
(WebInspector.LayoutTimelineView.prototype._treeElementDeselected): Deleted.
(WebInspector.LayoutTimelineView.prototype._treeElementSelected): Deleted.
(WebInspector.LayoutTimelineView.prototype._updateTreeElementWithCloseButton): Deleted.
(WebInspector.LayoutTimelineView.prototype._closeStatusButtonClicked): Deleted.
Removed tree element close button logic.

* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype.showContentViewForTreeElement):
(WebInspector.NetworkTimelineView.prototype.treeElementSelected):
Added overrides of new base class methods.
(WebInspector.NetworkTimelineView.prototype._treeElementDeselected): Deleted.
(WebInspector.NetworkTimelineView.prototype._treeElementSelected): Deleted.
Removed tree element close button logic.

* UserInterface/Views/RenderingFrameTimelineView.js:
(WebInspector.RenderingFrameTimelineView.prototype.showContentViewForTreeElement):
(WebInspector.RenderingFrameTimelineView.prototype.treeElementSelected):
Added overrides of new base class methods.

* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype.get data):
(WebInspector.ResourceTimelineDataGridNode.prototype.createCellContent):
Removed unused Name column and added "go to" button to the Domain column to show the selected resource.

* UserInterface/Views/ScriptTimelineView.js:
(WebInspector.ScriptTimelineView):
(WebInspector.ScriptTimelineView.prototype.showContentViewForTreeElement):
(WebInspector.ScriptTimelineView.prototype.treeElementSelected):
Added overrides of new base class methods.
(WebInspector.ScriptTimelineView.prototype._dataGridNodeSelected):
(WebInspector.ScriptTimelineView.prototype._treeElementDeselected): Deleted.
(WebInspector.ScriptTimelineView.prototype._treeElementSelected): Deleted.
(WebInspector.ScriptTimelineView.prototype._updateTreeElementWithCloseButton): Deleted.
(WebInspector.ScriptTimelineView.prototype._closeStatusButtonClicked): Deleted.
Removed tree element close button logic.

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.showTimelineViewForTimeline.this._timelineTreeElementMap.get select):
Prevent navigating to a different content view when showing the TimelineRecordingContentView.

* UserInterface/Views/TimelineView.js:
(WebInspector.TimelineView):
(WebInspector.TimelineView.prototype.showContentViewForTreeElement):
(WebInspector.TimelineView.prototype.treeElementDeselected):
(WebInspector.TimelineView.prototype.treeElementSelected):
Tree element selection handlers are now protected methods, which derived classes may override as needed.
(WebInspector.TimelineView.prototype.needsLayout):
(WebInspector.TimelineView.prototype._closeStatusButtonClicked):
(WebInspector.TimelineView.prototype._updateTreeElementWithCloseButton):
Encapsulated logic related to close button creation and behavior.

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