WebKit-https.git
4 years agoRefactor BuildbotQueueView._appendPendingRevisionCount to work more generically with...
commit-queue@webkit.org [Fri, 14 Aug 2015 18:06:51 +0000 (18:06 +0000)]
Refactor BuildbotQueueView._appendPendingRevisionCount to work more generically with repositories
other than "openSource" and "internal".
https://bugs.webkit.org/show_bug.cgi?id=147938

Patch by Jason Marcell <jmarcell@apple.com> on 2015-08-14
Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
(BuildbotQueueView.prototype._appendPendingRevisionCount): Refactored to work more generically with
repositories other than "openSource" and "internal".

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

4 years agoFix the Mavericks build.
timothy_horton@apple.com [Fri, 14 Aug 2015 17:43:42 +0000 (17:43 +0000)]
Fix the Mavericks build.

* platform/spi/mac/LookupSPI.h:

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

4 years agoFrequent assertions on animations/restart-after-scroll.html
ap@apple.com [Fri, 14 Aug 2015 17:09:35 +0000 (17:09 +0000)]
Frequent assertions on animations/restart-after-scroll.html
https://bugs.webkit.org/show_bug.cgi?id=148026

* TestExpectations: Skip the test in debug mode.

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

4 years agoUnreviewed, rolling out r188444.
commit-queue@webkit.org [Fri, 14 Aug 2015 16:53:37 +0000 (16:53 +0000)]
Unreviewed, rolling out r188444.
https://bugs.webkit.org/show_bug.cgi?id=148029

Broke GTK and EFL (see bug #148027) (Requested by philn on
#webkit).

Reverted changeset:

"Use WTF::Lock and WTF::Condition instead of WTF::Mutex,
WTF::ThreadCondition, std::mutex, and std::condition_variable"
https://bugs.webkit.org/show_bug.cgi?id=147999
http://trac.webkit.org/changeset/188444

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

4 years agoSpeculative fix for iOS build failure.
simon.fraser@apple.com [Fri, 14 Aug 2015 16:49:54 +0000 (16:49 +0000)]
Speculative fix for iOS build failure.

* Shared/mac/RemoteLayerTreeTransaction.h:

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

4 years agoFix the build.
timothy_horton@apple.com [Fri, 14 Aug 2015 16:48:08 +0000 (16:48 +0000)]
Fix the build.

* platform/spi/mac/LookupSPI.h:

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

4 years ago[GStreamer] Handle missing plugins better at runtime
philn@webkit.org [Fri, 14 Aug 2015 16:31:55 +0000 (16:31 +0000)]
[GStreamer] Handle missing plugins better at runtime
https://bugs.webkit.org/show_bug.cgi?id=146999

Reviewed by Carlos Garcia Campos.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Warn the
user if autoaudiosink wasn't found at runtime. In that case
playbin will try to be smart by itself, hopefully. Also moved a
couple GST_WARNING calls to WARN_MEDIA_MESSAGE.
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Use
WARN_MEDIA_MESSAGE here as well.

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

4 years agoUnreviewed, remove dead code after r188385.
philn@webkit.org [Fri, 14 Aug 2015 16:30:21 +0000 (16:30 +0000)]
Unreviewed, remove dead code after r188385.

* UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
(webkitUserMediaPermissionRequestAllow): Deleted.

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

4 years agoCover memory cache subresource validation policy with cache tests
antti@apple.com [Fri, 14 Aug 2015 14:08:59 +0000 (14:08 +0000)]
Cover memory cache subresource validation policy with cache tests
https://bugs.webkit.org/show_bug.cgi?id=147830

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Existing tests under http/tests/cache/disk-cache currently cover disk and XHR memory cache validation behaviors.
They can be extended to cover the regular subresource policy too.

Add window.internals API to disable CachedRawResource validation behavior. This makes XHR validate like
other resources and allows existing tests (that use XHR) to cover normal subresource policy .

Test results reveal some bugs. For example subresources in memory cache don't respect Vary header.

It is generally bad that we have a separate XHR-and-main-resource validation policy in memory cache. Network cache
doesn't have one.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clearTestingOverrides):
(WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
* loader/FrameLoader.h:
(WebCore::FrameLoader::setOverrideCachePolicyForTesting):
(WebCore::FrameLoader::setOverrideResourceLoadPriorityForTesting):
(WebCore::FrameLoader::setStrictRawResourceValidationPolicyDisabledForTesting):
(WebCore::FrameLoader::isStrictRawResourceValidationPolicyDisabledForTesting):
(WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::setLoadFinishTime):
(WebCore::CachedResource::loadFinishTime):
(WebCore::CachedResource::canReuse): Deleted.

    Made canReuse non-virtual and removed it from the base. Only CachedRawResource has implementation.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy):
* testing/Internals.cpp:
(WebCore::Internals::setOverrideResourceLoadPriority):
(WebCore::Internals::setStrictRawResourceValidationPolicyDisabled):
(WebCore::Internals::clearMemoryCache):
* testing/Internals.h:

LayoutTests:

Add another test round using subresource validation policy.

* http/tests/cache/disk-cache/disk-cache-204-status-code-expected.txt:
* http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt:
* http/tests/cache/disk-cache/disk-cache-307-status-code-expected.txt:
* http/tests/cache/disk-cache/disk-cache-404-status-code-expected.txt:
* http/tests/cache/disk-cache/disk-cache-disable-expected.txt:
* http/tests/cache/disk-cache/disk-cache-media-expected.txt:
* http/tests/cache/disk-cache/disk-cache-range-expected.txt:
* http/tests/cache/disk-cache/disk-cache-request-headers-expected.txt:
* http/tests/cache/disk-cache/disk-cache-request-max-stale-expected.txt:
* http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header-expected.txt:
* http/tests/cache/disk-cache/disk-cache-validation-attachment-expected.txt:
* http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy-expected.txt:
* http/tests/cache/disk-cache/disk-cache-validation-expected.txt:
* http/tests/cache/disk-cache/disk-cache-validation-no-body-expected.txt:
* http/tests/cache/disk-cache/disk-cache-vary-expected.txt:
* http/tests/cache/disk-cache/disk-cache-vary-no-body-expected.txt:
* http/tests/cache/disk-cache/resources/cache-test.js:
(loadResourcesWithOptions):
(.):
(runTests):

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

4 years agoUnreviewed. Fix the build with !ENABLE(MEDIA_STREAM) after r188385.
carlosgc@webkit.org [Fri, 14 Aug 2015 08:47:38 +0000 (08:47 +0000)]
Unreviewed. Fix the build with !ENABLE(MEDIA_STREAM) after r188385.

* UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
(WKUserMediaPermissionRequestDeviceNamesVideo):
(WKUserMediaPermissionRequestDeviceNamesAudio):

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

4 years agoUnreviewed. Fix GTK+ build after r188386.
carlosgc@webkit.org [Fri, 14 Aug 2015 08:45:07 +0000 (08:45 +0000)]
Unreviewed. Fix GTK+ build after r188386.

* UIProcess/API/gtk/WebKitWindowProperties.cpp:
(webkitWindowPropertiesUpdateFromWebWindowFeatures):

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

4 years agoUnreviewed, shorten another test that is timing out.
fpizlo@apple.com [Fri, 14 Aug 2015 07:30:39 +0000 (07:30 +0000)]
Unreviewed, shorten another test that is timing out.

* TestWebKitAPI/Tests/WTF/Lock.cpp:
(TestWebKitAPI::TEST):

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

4 years agoUse WTF::Lock and WTF::Condition instead of WTF::Mutex, WTF::ThreadCondition, std...
fpizlo@apple.com [Fri, 14 Aug 2015 06:46:46 +0000 (06:46 +0000)]
Use WTF::Lock and WTF::Condition instead of WTF::Mutex, WTF::ThreadCondition, std::mutex, and std::condition_variable
https://bugs.webkit.org/show_bug.cgi?id=147999

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* API/JSVirtualMachine.mm:
(initWrapperCache):
(+[JSVMWrapperCache addWrapper:forJSContextGroupRef:]):
(+[JSVMWrapperCache wrapperForJSContextGroupRef:]):
(wrapperCacheMutex): Deleted.
* bytecode/SamplingTool.cpp:
(JSC::SamplingTool::doRun):
(JSC::SamplingTool::notifyOfScope):
* bytecode/SamplingTool.h:
* dfg/DFGThreadData.h:
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::~Worklist):
(JSC::DFG::Worklist::isActiveForVM):
(JSC::DFG::Worklist::enqueue):
(JSC::DFG::Worklist::compilationState):
(JSC::DFG::Worklist::waitUntilAllPlansForVMAreReady):
(JSC::DFG::Worklist::removeAllReadyPlansForVM):
(JSC::DFG::Worklist::completeAllReadyPlansForVM):
(JSC::DFG::Worklist::visitWeakReferences):
(JSC::DFG::Worklist::removeDeadPlans):
(JSC::DFG::Worklist::queueLength):
(JSC::DFG::Worklist::dump):
(JSC::DFG::Worklist::runThread):
* dfg/DFGWorklist.h:
* disassembler/Disassembler.cpp:
* heap/CopiedSpace.cpp:
(JSC::CopiedSpace::doneFillingBlock):
(JSC::CopiedSpace::doneCopying):
* heap/CopiedSpace.h:
* heap/CopiedSpaceInlines.h:
(JSC::CopiedSpace::recycleBorrowedBlock):
(JSC::CopiedSpace::allocateBlockForCopyingPhase):
* heap/GCThread.cpp:
(JSC::GCThread::waitForNextPhase):
(JSC::GCThread::gcThreadMain):
* heap/GCThreadSharedData.cpp:
(JSC::GCThreadSharedData::GCThreadSharedData):
(JSC::GCThreadSharedData::~GCThreadSharedData):
(JSC::GCThreadSharedData::startNextPhase):
(JSC::GCThreadSharedData::endCurrentPhase):
(JSC::GCThreadSharedData::didStartMarking):
(JSC::GCThreadSharedData::didFinishMarking):
* heap/GCThreadSharedData.h:
* heap/HeapTimer.h:
* heap/MachineStackMarker.cpp:
(JSC::ActiveMachineThreadsManager::Locker::Locker):
(JSC::ActiveMachineThreadsManager::add):
(JSC::ActiveMachineThreadsManager::remove):
(JSC::ActiveMachineThreadsManager::ActiveMachineThreadsManager):
(JSC::MachineThreads::~MachineThreads):
(JSC::MachineThreads::addCurrentThread):
(JSC::MachineThreads::removeThreadIfFound):
(JSC::MachineThreads::tryCopyOtherThreadStack):
(JSC::MachineThreads::tryCopyOtherThreadStacks):
(JSC::MachineThreads::gatherConservativeRoots):
* heap/MachineStackMarker.h:
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::donateKnownParallel):
(JSC::SlotVisitor::drain):
(JSC::SlotVisitor::drainFromShared):
(JSC::SlotVisitor::mergeOpaqueRoots):
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::containsOpaqueRootTriState):
* inspector/remote/RemoteInspectorDebuggableConnection.h:
* inspector/remote/RemoteInspectorDebuggableConnection.mm:
(Inspector::RemoteInspectorHandleRunSourceGlobal):
(Inspector::RemoteInspectorQueueTaskOnGlobalQueue):
(Inspector::RemoteInspectorInitializeGlobalQueue):
(Inspector::RemoteInspectorHandleRunSourceWithInfo):
(Inspector::RemoteInspectorDebuggableConnection::setup):
(Inspector::RemoteInspectorDebuggableConnection::closeFromDebuggable):
(Inspector::RemoteInspectorDebuggableConnection::close):
(Inspector::RemoteInspectorDebuggableConnection::sendMessageToBackend):
(Inspector::RemoteInspectorDebuggableConnection::queueTaskOnPrivateRunLoop):
* interpreter/JSStack.cpp:
(JSC::JSStack::JSStack):
(JSC::JSStack::releaseExcessCapacity):
(JSC::JSStack::addToCommittedByteCount):
(JSC::JSStack::committedByteCount):
(JSC::stackStatisticsMutex): Deleted.
(JSC::JSStack::initializeThreading): Deleted.
* interpreter/JSStack.h:
(JSC::JSStack::gatherConservativeRoots):
(JSC::JSStack::sanitizeStack):
(JSC::JSStack::size):
(JSC::JSStack::initializeThreading): Deleted.
* jit/ExecutableAllocator.cpp:
(JSC::DemandExecutableAllocator::DemandExecutableAllocator):
(JSC::DemandExecutableAllocator::~DemandExecutableAllocator):
(JSC::DemandExecutableAllocator::bytesAllocatedByAllAllocators):
(JSC::DemandExecutableAllocator::bytesCommittedByAllocactors):
(JSC::DemandExecutableAllocator::dumpProfileFromAllAllocators):
(JSC::DemandExecutableAllocator::allocators):
(JSC::DemandExecutableAllocator::allocatorsMutex):
* jit/JITThunks.cpp:
(JSC::JITThunks::ctiStub):
* jit/JITThunks.h:
* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::ensureBytecodesFor):
(JSC::Profiler::Database::notifyDestruction):
* profiler/ProfilerDatabase.h:
* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):
* runtime/JSLock.cpp:
(JSC::GlobalJSLock::GlobalJSLock):
(JSC::GlobalJSLock::~GlobalJSLock):
(JSC::JSLockHolder::JSLockHolder):
(JSC::GlobalJSLock::initialize): Deleted.
* runtime/JSLock.h:

Source/WTF:

* wtf/Condition.h: "using WTF::Condition".
* wtf/Lock.h:
(WTF::LockBase::lock):
(WTF::LockBase::tryLock): Add tryLock() because it turns out that we use it sometimes.
(WTF::LockBase::try_lock): unique_lock needs this.
(WTF::LockBase::unlock):

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

4 years agoPerforming a Lookup on wrapped text puts the popover arrow in the wrong place (off...
timothy_horton@apple.com [Fri, 14 Aug 2015 06:31:24 +0000 (06:31 +0000)]
Performing a Lookup on wrapped text puts the popover arrow in the wrong place (off to the right)
https://bugs.webkit.org/show_bug.cgi?id=148012
<rdar://problem/19238094>

Reviewed by Simon Fraser.

* platform/spi/mac/LookupSPI.h:
Add some SPI.

* WebView/WebView.mm:
(-[WebView _animationControllerForDictionaryLookupPopupInfo:]):
(-[WebView _showDictionaryLookupPopup:]):
Adopt the new SPI, handing it the first text rect, instead of having it
guess where to put the popover.
Also, null-check the TextIndicator.

* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformDictionaryLookup):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _animationControllerForText]):
Adopt the new SPI, handing it the first text rect, instead of having it
guess where to put the popover.

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

4 years agoWeb Inspector: Can't resize split console when window is too narrow
nvasilyev@apple.com [Fri, 14 Aug 2015 06:21:03 +0000 (06:21 +0000)]
Web Inspector: Can't resize split console when window is too narrow
https://bugs.webkit.org/show_bug.cgi?id=147924

Make some items inside of the navigation bar click-through to incsease
the draggable area.

Reviewed by Timothy Hatcher.

* UserInterface/Views/Main.css:
(#split-content-browser > .navigation-bar > :matches(.hierarchical-path, .log-search-bar, .log-scope-bar)):
(#split-content-browser > .navigation-bar > :matches(.log-search-bar, .log-scope-bar) > :matches(li, input)):

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

4 years agoUnreviewed, rolling out r188418.
commit-queue@webkit.org [Fri, 14 Aug 2015 06:06:37 +0000 (06:06 +0000)]
Unreviewed, rolling out r188418.
https://bugs.webkit.org/show_bug.cgi?id=148017

Fix EFL after the rollout of r188404 (Requested by smfr on
#webkit).

Reverted changeset:

"[CMake] Unreviewed build fix after r188404"
http://trac.webkit.org/changeset/188418

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

4 years agoWindows build fix.
simon.fraser@apple.com [Fri, 14 Aug 2015 05:58:13 +0000 (05:58 +0000)]
Windows build fix.

* FullscreenVideoController.cpp:

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

4 years agoAnother Windows build fix.
simon.fraser@apple.com [Fri, 14 Aug 2015 05:48:07 +0000 (05:48 +0000)]
Another Windows build fix.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:

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

4 years agoTry to fix Windows build after r188430.
simon.fraser@apple.com [Fri, 14 Aug 2015 05:36:17 +0000 (05:36 +0000)]
Try to fix Windows build after r188430.

* platform/graphics/ca/win/PlatformCALayerWin.h:

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

4 years agoGenerated files don't all need to include ScriptExecutionContext.h
simon.fraser@apple.com [Fri, 14 Aug 2015 05:23:34 +0000 (05:23 +0000)]
Generated files don't all need to include ScriptExecutionContext.h
https://bugs.webkit.org/show_bug.cgi?id=148011

Reviewed by Alexey Proskuryakov.

Generated files which are not callbacks or constructors do not need to include
ScriptExecutionContext.h.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Deleted.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* bindings/scripts/test/JS/JSattribute.cpp:

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

4 years agoUnreviewed, rolling out r188428.
commit-queue@webkit.org [Fri, 14 Aug 2015 04:53:20 +0000 (04:53 +0000)]
Unreviewed, rolling out r188428.
https://bugs.webkit.org/show_bug.cgi?id=148015

broke cmake build (Requested by alexchristensen on #webkit).

Reverted changeset:

"Move some commands from ./CMakeLists.txt to Source/cmake"
https://bugs.webkit.org/show_bug.cgi?id=148003
http://trac.webkit.org/changeset/188428

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

4 years agoUnreviewed, rolling out r188404.
commit-queue@webkit.org [Fri, 14 Aug 2015 04:41:26 +0000 (04:41 +0000)]
Unreviewed, rolling out r188404.
https://bugs.webkit.org/show_bug.cgi?id=148014

Broke 4 API tests (Requested by smfr on #webkit).

Reverted changeset:

"Add WKWindowFeaturesRef and a new modern createNewPage UI
client callback"
https://bugs.webkit.org/show_bug.cgi?id=147989
http://trac.webkit.org/changeset/188404

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

4 years agoUnreviewed, rolling out r188431.
commit-queue@webkit.org [Fri, 14 Aug 2015 04:38:56 +0000 (04:38 +0000)]
Unreviewed, rolling out r188431.
https://bugs.webkit.org/show_bug.cgi?id=148013

JSC headers are too hard to understand (Requested by smfr on
#webkit).

Reverted changeset:

"Remove a few includes from JSGlobalObject.h"
https://bugs.webkit.org/show_bug.cgi?id=148004
http://trac.webkit.org/changeset/188431

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

4 years agoRemove pixelSnapped* functions from RenderBoxModelObject/RenderBox.
zalan@apple.com [Fri, 14 Aug 2015 04:34:31 +0000 (04:34 +0000)]
Remove pixelSnapped* functions from RenderBoxModelObject/RenderBox.
https://bugs.webkit.org/show_bug.cgi?id=147982

Reviewed by Simon Fraser.

RenderBoxModelObject/RenderBox::pixelSnapped* functions are misleading.
They all round to integral values, while the rest of the pixel snapping
functions round to device pixels.
This patch moves integral rounding to the callers. (Note that they all will eventually
go away as we convert additional modules to subpixel rendering (tables, scrolling etc).)

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* dom/Element.cpp:
(WebCore::Element::offsetLeft):
(WebCore::Element::offsetTop):
(WebCore::Element::offsetWidth):
(WebCore::Element::offsetHeight):
(WebCore::Element::clientWidth):
(WebCore::Element::clientHeight):
* dom/Position.cpp:
(WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::width):
(WebCore::HTMLImageElement::height):
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::defaultEventHandler):
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForElementData):
* page/FrameView.cpp:
(WebCore::FrameView::applyPaginationToViewport):
(WebCore::FrameView::calculateScrollbarModesForLayout):
(WebCore::FrameView::calculateExtendedBackgroundMode):
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
* page/PrintContext.cpp:
(WebCore::PrintContext::pageNumberForElement):
* platform/graphics/LayoutRect.h:
(WebCore::LayoutRect::pixelSnappedSize): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::pixelSnappedClientWidth): Deleted.
(WebCore::RenderBox::pixelSnappedClientHeight): Deleted.
(WebCore::RenderBox::pixelSnappedOffsetWidth): Deleted.
(WebCore::RenderBox::pixelSnappedOffsetHeight): Deleted.
* rendering/RenderBox.h:
(WebCore::RenderBox::pixelSnappedLogicalHeight): Deleted.
(WebCore::RenderBox::pixelSnappedLogicalWidth): Deleted.
(WebCore::RenderBox::pixelSnappedSize): Deleted.
(WebCore::RenderBox::pixelSnappedBorderBoxRect): Deleted.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::pixelSnappedOffsetWidth): Deleted.
(WebCore::RenderBoxModelObject::pixelSnappedOffsetHeight): Deleted.
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::pixelSnappedOffsetLeft): Deleted.
(WebCore::RenderBoxModelObject::pixelSnappedOffsetTop): Deleted.
* rendering/RenderFileUploadControl.cpp:
(WebCore::nodeWidth):
(WebCore::nodeHeight):
(WebCore::RenderFileUploadControl::maxFilenameWidth):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::perspectiveTransform):
(WebCore::RenderLayer::clampScrollOffset):
(WebCore::RenderLayer::visibleSize):
(WebCore::RenderLayer::positionOverflowControls):
(WebCore::RenderLayer::hasHorizontalOverflow):
(WebCore::RenderLayer::hasVerticalOverflow):
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
(WebCore::RenderLayer::overflowControlsIntersectRect):
(WebCore::RenderLayer::isPointInResizeControl):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::startTransition):
* rendering/RenderLayerBacking.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::scrollWidth):
(WebCore::RenderListBox::scrollHeight):
* rendering/RenderMediaControlElements.cpp:
(WebCore::RenderMediaVolumeSliderContainer::layout):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::buttonRect):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addOverflowFromChildren):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeIntrinsicPadding):
(WebCore::RenderTableCell::paintCollapsedBorders):
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
(WebCore::RenderTableCell::paintBoxDecorations):
(WebCore::RenderTableCell::paintMask):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::logicalHeightForRowSizing):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
* rendering/RenderTheme.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeMac::paintSearchFieldResultsButton):
* rendering/RenderTreeAsText.cpp:
(WebCore::write):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::paint):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::paint):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):
(WebCore::RenderSVGRoot::computeFloatRectForRepaint):

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

4 years ago[JSC] Add support for GetByVal on arrays of Undecided shape
benjamin@webkit.org [Fri, 14 Aug 2015 03:54:32 +0000 (03:54 +0000)]
[JSC] Add support for GetByVal on arrays of Undecided shape
https://bugs.webkit.org/show_bug.cgi?id=147814

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-08-13
Reviewed by Filip Pizlo.

Previously, GetByVal on Array::Undecided would just take
the generic path. The problem is the generic path is so
slow that it could take a significant amount of time
even for unfrequent accesses.

With this patch, if the following conditions are met,
the GetByVal just returns a "undefined" constant:
-The object is an OriginalArray.
-The prototype chain is sane.
-The index is an integer.
-The integer is positive (runtime check).

Ideally, the 4th conditions should be removed
deducing a compile-time constant gives us so much better
opportunities at getting rid of this code.

There are two cases where this patch removes the runtime
check:
-If the index is constant (uncommon but easy)
-If the index is within a range known to be positive.
 (common case and made possible with DFGIntegerRangeOptimizationPhase).

When we get into those cases, DFG just nukes everything
and all we have left is a structure check :)

This patch is a 14% improvement on audio-beat-detection,
a few percent faster here and there and no regression.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
If the index is a positive constant, we can get rid of the GetByVal
entirely. :)

* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::fromObserved):
The returned type is now Array::Undecided + profiling information.
The useful type is set in ArrayMode::refine().

(JSC::DFG::ArrayMode::refine):
If we meet the particular set conditions, we speculate an Undecided
array type with sane chain. Anything else comes back to Generic.

(JSC::DFG::ArrayMode::originalArrayStructure):
To enable the structure check for Undecided array.

(JSC::DFG::ArrayMode::alreadyChecked):
* dfg/DFGArrayMode.h:
(JSC::DFG::ArrayMode::withProfile):
(JSC::DFG::ArrayMode::canCSEStorage):
(JSC::DFG::ArrayMode::benefitsFromOriginalArray):
(JSC::DFG::ArrayMode::lengthNeedsStorage): Deleted.
(JSC::DFG::ArrayMode::isSpecific): Deleted.A

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsic): Deleted.
This is somewhat unrelated.

Having Array::Undecided on ArrayPush was impossible before
since ArrayMode::fromObserved() used to return Array::Generic.

Now that Array::Undecided is possible, we must make sure not
to provide it to ArrayPush since there is no code to handle it
properly.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
The operation only depends on the index, it is pure.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode): Deleted.
* dfg/DFGIntegerRangeOptimizationPhase.cpp:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::jumpSlowForUnwantedArrayMode):
(JSC::DFG::SpeculativeJIT::checkArray):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileGetByVal):
* tests/stress/get-by-val-on-undecided-array-type.js: Added.
* tests/stress/get-by-val-on-undecided-sane-chain-1.js: Added.
* tests/stress/get-by-val-on-undecided-sane-chain-2.js: Added.
* tests/stress/get-by-val-on-undecided-sane-chain-3.js: Added.
* tests/stress/get-by-val-on-undecided-sane-chain-4.js: Added.
* tests/stress/get-by-val-on-undecided-sane-chain-5.js: Added.
* tests/stress/get-by-val-on-undecided-sane-chain-6.js: Added.

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

4 years agoRemove a few includes from JSGlobalObject.h
simon.fraser@apple.com [Fri, 14 Aug 2015 02:36:22 +0000 (02:36 +0000)]
Remove a few includes from JSGlobalObject.h
https://bugs.webkit.org/show_bug.cgi?id=148004

Reviewed by Tim Horton.

Remove 4 #includes from JSGlobalObject.h, and fix the fallout.

* parser/VariableEnvironment.cpp:
* parser/VariableEnvironment.h:
* runtime/JSGlobalObject.h:
* runtime/Structure.h:
* runtime/StructureInlines.h:

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

4 years agoMinor GraphicsLayer.h/PlatformCALayer.h cleanup
simon.fraser@apple.com [Fri, 14 Aug 2015 02:23:24 +0000 (02:23 +0000)]
Minor GraphicsLayer.h/PlatformCALayer.h cleanup
https://bugs.webkit.org/show_bug.cgi?id=148009

Reviewed by Tim Horton.

Remove some #includes.

* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/PlatformCALayer.h:

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

4 years agoWeb Inspector: Flash DOM node attribute on change
drousso@apple.com [Fri, 14 Aug 2015 02:20:02 +0000 (02:20 +0000)]
Web Inspector: Flash DOM node attribute on change
https://bugs.webkit.org/show_bug.cgi?id=147973

Reviewed by Timothy Hatcher.

Whenever an attribute on a DOM node changes, flash the attribute value.
If that value doesn't exist, flash the attribute name instead.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement):
(WebInspector.DOMTreeElement.prototype.nodeChanged):
(WebInspector.DOMTreeElement.prototype._buildAttributeDOM):
If the node has been marked with a general change, mark the attribute element for animation.
(WebInspector.DOMTreeElement.prototype._markNodeChanged.animationEnd):
(WebInspector.DOMTreeElement.prototype._markNodeChanged):
Adds a class to the given element that applies a simple background flash animation.
(WebInspector.DOMTreeElement.prototype._fireDidChange):
Add the animation class once all building of the represented DOM object for that node is done.

* UserInterface/Views/DOMTreeOutline.css:
(@keyframes node-state-changed):
Applies a semi-transparent background that fades to default.
(.node-state-changed):

* UserInterface/Views/DOMTreeUpdater.js:
(WebInspector.DOMTreeUpdater.prototype._attributesUpdated):
Now passes along the name of the modified attribute.
(WebInspector.DOMTreeUpdater.prototype._updateModifiedNodes):
If the modified node object has an attribute member, mark the node as being generally changed.

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

4 years agoMove some commands from ./CMakeLists.txt to Source/cmake
commit-queue@webkit.org [Fri, 14 Aug 2015 02:14:09 +0000 (02:14 +0000)]
Move some commands from ./CMakeLists.txt to Source/cmake
https://bugs.webkit.org/show_bug.cgi?id=148003

Patch by Alex Christensen <achristensen@webkit.org> on 2015-08-13
Reviewed by Brent Fulgham.

* CMakeLists.txt:
.:

Moved functionality to WebKitCommon.cmake and WebKitFS.cmake and made conditional
so we can change directory structure from command line parameters.
* Source/cmake/WebKitCommon.cmake: Added.
* Source/cmake/WebKitFS.cmake:

Source/JavaScriptCore:

Added commands needed to build JSC by itself.

Source/WebCore:

Added commands needed to build WebCore by itself.

Source/WebKit:

Added some commands needed to build WebKit by itself.

Source/WTF:

Added commands needed to build WTF by itself.

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

4 years agoREGRESSION (r184000): Web Inspector: Stripped whitespace after editing CSS in Styles...
drousso@apple.com [Fri, 14 Aug 2015 01:51:06 +0000 (01:51 +0000)]
REGRESSION (r184000): Web Inspector: Stripped whitespace after editing CSS in Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=145679

Reviewed by Timothy Hatcher.

The formatter will now calculate the number of beginning spaces before the first line in a rule
and duplicate them in front of every other line.  If there is no new line at the beginning or are
no spaces, assume 4 spaces and a new line for each property.
Also cleaned up the code for _resetContent a bit.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._resetContent.update.set get this):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._resetContent.update.get this):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._resetContent.update):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._resetContent):

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

4 years agoWeb Inspector: Reduce flakiness of inspector/indexeddb/requestDatabaseNames
joepeck@webkit.org [Fri, 14 Aug 2015 01:29:48 +0000 (01:29 +0000)]
Web Inspector: Reduce flakiness of inspector/indexeddb/requestDatabaseNames
https://bugs.webkit.org/show_bug.cgi?id=148008

Reviewed by Timothy Hatcher.

* inspector/indexeddb/requestDatabaseNames.html:
Follow-up fix to reduce flakiness in the test caused by other tests
creating IndexedDB databases.

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

4 years agoTry to fix the Gtk/EFL build.
timothy_horton@apple.com [Fri, 14 Aug 2015 01:06:05 +0000 (01:06 +0000)]
Try to fix the Gtk/EFL build.

* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):

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

4 years agoiOS test gardening.
jhoneycutt@apple.com [Fri, 14 Aug 2015 00:45:07 +0000 (00:45 +0000)]
iOS test gardening.

* platform/ios-simulator/TestExpectations:
* platform/ios-simulator-wk1/fast/forms/indeterminate-progress-inline-height-expected.txt: Added.
* platform/ios-simulator-wk1/fast/forms/input-appearance-spinbutton-expected.txt: Added.
* platform/ios-simulator-wk1/fast/forms/input-appearance-spinbutton-up-expected.txt: Added.

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

4 years agoRefactor and improve TextIndicator to prepare for tests
timothy_horton@apple.com [Fri, 14 Aug 2015 00:06:28 +0000 (00:06 +0000)]
Refactor and improve TextIndicator to prepare for tests
https://bugs.webkit.org/show_bug.cgi?id=147622

Reviewed by Simon Fraser.

No new tests because they're coming soon!

* page/TextIndicator.cpp:
(WebCore::TextIndicator::TextIndicator):
(WebCore::TextIndicator::~TextIndicator):
(WebCore::TextIndicator::createWithRange):
(WebCore::TextIndicator::createWithSelectionInFrame):
(WebCore::hasNonInlineOrReplacedElements):
(WebCore::snapshotOptionsForTextIndicatorOptions):
(WebCore::takeSnapshot):
(WebCore::takeSnapshots):
(WebCore::initializeIndicator):
(WebCore::snapshotSelectionWithHighlight): Deleted.
(WebCore::TextIndicator::wantsBounce): Deleted.
(WebCore::TextIndicator::wantsContentCrossfade): Deleted.
(WebCore::TextIndicator::wantsFadeIn): Deleted.
(WebCore::TextIndicator::wantsManualAnimation): Deleted.
* page/TextIndicator.h:
(WebCore::TextIndicator::indicatesCurrentSelection):
(WebCore::TextIndicator::setWantsMargin): Deleted.
(WebCore::TextIndicator::wantsMargin): Deleted.
Rename wantsMargin to indicatesCurrentSelection. It's really about whether
the TextIndicator indicates the existing selection, and the Mac presentation
just uses that to determine whether or not to show a margin, but that
margin has nothing to do with the cross-platform TextIndicator code.

Move most of the snapshotting and rect gathering code to initializeTextIndicator, and call it
from both ::createWithRange and ::createWithSelectionInFrame, instead of calling
::createWithSelectionInFrame from ::createWithRange after setting the selection.
This way, the range passed into ::createWithRange is preserved for use in initializeTextIndicator,
instead of round-tripping through selection code, which can change it (e.g. in the case
of user-select: none; elements).

Add TextIndicatorOptions, which allow callers to adjust the behavior of TextIndicator
instead of having #if PLATFORM(X) strewn throughout TextIndicator.

Add an option which was previously implemented at the iOS-specific callsites,
TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges,
which falls back to indicating a bounding rect and not doing a range-only paint
if the given range includes any non-inline elements or any replaced elements.
This makes it so that we do something reasonable-looking for very complex ranges,
like article links on the New York Times, which include multiple disparate paragraphs
of text and one or more images, and also so that indicating a range that only
includes an image does something fairly reasonable.

Move presentation-specific functions (wantsBounce, wantsContentCrossfade, etc.)
to TextIndicatorWindow. Ideally TextIndicatorPresentationTransition would also move,
but that is a fairly large and complicated change that should be made separately.

* page/mac/TextIndicatorWindow.h:
* page/mac/TextIndicatorWindow.mm:
(indicatorWantsBounce):
(indicatorWantsContentCrossfade):
(indicatorWantsFadeIn):
(indicatorWantsManualAnimation):
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
(-[WebTextIndicatorView _animationDuration]):
(-[WebTextIndicatorView present]):
(WebCore::TextIndicatorWindow::~TextIndicatorWindow):
(WebCore::TextIndicatorWindow::clearTextIndicator):
(WebCore::TextIndicatorWindow::setTextIndicator):
Rename TextIndicatorDismissalAnimation to TextIndicatorWindowDismissalAnimation,
and TextIndicatorLifetime to TextIndicatorWindowLifetime, because
they are TextIndicatorWindow specific.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
* bindings/objc/DOM.mm:
(-[DOMNode getPreviewSnapshotImage:andRects:]):
(-[DOMRange boundingBox]):
(-[DOMRange textRects]):
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addTextMatchMarker):
* dom/Node.cpp:
(WebCore::Node::textRects):
* dom/Range.cpp:
(WebCore::Range::intersectsNode):
(WebCore::Range::absoluteBoundingBox):
(WebCore::Range::absoluteTextRects):
(WebCore::Range::absoluteTextQuads):
(WebCore::Range::getClientRects):
(WebCore::Range::getBoundingClientRect):
(WebCore::Range::getBorderAndTextQuads):
(WebCore::Range::boundingRectInternal):
(WebCore::Range::absoluteBoundingRect):
(WebCore::Range::boundingBox): Deleted.
(WebCore::Range::textRects): Deleted.
(WebCore::Range::textQuads): Deleted.
(WebCore::Range::boundingRect): Deleted.
* dom/Range.h:
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::rootViewRectForRange):
* editing/Editor.cpp:
(WebCore::Editor::findStringAndScrollToVisible):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::getClippedVisibleTextRectangles):
* editing/mac/DataDetection.mm:
(WebCore::DataDetection::detectItemAroundHitTestResult):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::absoluteBoundingBoxRectForRange):
Rename various Range methods to make it clear whether they return absolute or client rects.

* WebView/WebFrame.mm:
(-[WebFrame _rectsForRange:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView _lookUpInDictionaryFromMenu:]):
(-[WebHTMLView quickLookWithEvent:]):
* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController webView:didHandleScrollWheel:]):
(-[WebImmediateActionController _cancelImmediateAction]):
(-[WebImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
(-[WebImmediateActionController _defaultAnimationController]):
(-[WebImmediateActionController menuItemDidClose:]):
(-[WebImmediateActionController _animationControllerForDataDetectedText]):
(-[WebImmediateActionController _animationControllerForDataDetectedLink]):
(dictionaryPopupInfoForRange):
* WebView/WebView.mm:
(-[WebView _animationControllerForDictionaryLookupPopupInfo:]):
(-[WebView _setTextIndicator:]):
(-[WebView _setTextIndicator:withLifetime:]):
(-[WebView _clearTextIndicatorWithAnimation:]):
(-[WebView _showDictionaryLookupPopup:]):
(-[WebView _dictionaryLookupPopoverWillClose:]):
* WebView/WebViewInternal.h:
Adopt TextIndicatorOptions.
Adjust to Range method renames.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::encodeOptionalImage):
(IPC::decodeOptionalImage):
(IPC::ArgumentCoder<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
Move encode/decodeOptionalImage to their own functions to avoid duplication.

* UIProcess/API/mac/WKView.mm:
(-[WKView _dictionaryLookupPopoverWillClose:]):
(-[WKView _setTextIndicator:]):
(-[WKView _setTextIndicator:withLifetime:]):
(-[WKView _clearTextIndicatorWithAnimation:]):
(-[WKView _dismissContentRelativeChildWindows]):
(-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setTextIndicator):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setTextIndicator):
(WebKit::PageClientImpl::clearTextIndicator):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setTextIndicator):
(WebKit::PageClientImpl::clearTextIndicator):
(WebKit::PageClientImpl::didPerformDictionaryLookup):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _animationControllerForText]):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
(WebKit::shouldUseTextIndicatorForLink): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):
(WebKit::WebPage::performImmediateActionHitTestAtLocation):
Adopt TextIndicatorOptions.
Adjust to Range method renames.

* WebCoreSupport/WebFrameIOS.mm:
(-[WebFrame closestCaretRectInMarkedTextRangeForPoint:]):
Adjust to Range method renames.

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

4 years agoAppScale: Assertion hit when hovering a webkit-queue bubble
commit-queue@webkit.org [Fri, 14 Aug 2015 00:01:23 +0000 (00:01 +0000)]
AppScale: Assertion hit when hovering a webkit-queue bubble
https://bugs.webkit.org/show_bug.cgi?id=147997

Patch by Aakash Jain <aakash_jain@apple.com> on 2015-08-13
Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueue.js:
(BubbleQueue.prototype.loadDetailedStatus): Strip off http(s) before asserting.

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

4 years ago[CMake] Unreviewed build fix after r188404
ljaehun.lim@samsung.com [Thu, 13 Aug 2015 23:59:13 +0000 (23:59 +0000)]
[CMake] Unreviewed build fix after r188404

* CMakeLists.txt: Add UIProcess/API/APIWindowFeatures.cpp, UIProcess/API/C/WKWindowFeaturesRef.cpp

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

4 years agoUnify JSParserCodeType, FunctionParseMode and ModuleParseMode into SourceParseMode
utatane.tea@gmail.com [Thu, 13 Aug 2015 23:55:35 +0000 (23:55 +0000)]
Unify JSParserCodeType, FunctionParseMode and ModuleParseMode into SourceParseMode
https://bugs.webkit.org/show_bug.cgi?id=147353

Reviewed by Saam Barati.

This is the follow-up patch after r188355.
It includes the following changes.

- Unify JSParserCodeType, FunctionParseMode and ModuleParseMode into SourceParseMode
- Make SourceParseMode to C++ strongly-typed enum.
- Fix the comments.
- Rename ModuleSpecifier to ModuleName.
- Add the type name `ImportEntry` before the C++11 uniform initialization.
- Fix the thrown message for duplicate 'default' names.
- Assert the all statements in the top-level source elements are the module declarations under the module analyzer phase.

* API/JSScriptRef.cpp:
(parseScript):
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutableInternal):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateFunctionCodeBlock):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::makeFunction):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createFunctionMetadata):
(JSC::ASTBuilder::createModuleName):
(JSC::ASTBuilder::createImportDeclaration):
(JSC::ASTBuilder::createExportAllDeclaration):
(JSC::ASTBuilder::createExportNamedDeclaration):
(JSC::ASTBuilder::createModuleSpecifier): Deleted.
* parser/ModuleAnalyzer.cpp:
(JSC::ModuleAnalyzer::analyze):
* parser/NodeConstructors.h:
(JSC::ModuleNameNode::ModuleNameNode):
(JSC::ImportDeclarationNode::ImportDeclarationNode):
(JSC::ExportAllDeclarationNode::ExportAllDeclarationNode):
(JSC::ExportNamedDeclarationNode::ExportNamedDeclarationNode):
(JSC::ModuleSpecifierNode::ModuleSpecifierNode): Deleted.
* parser/Nodes.cpp:
(JSC::FunctionMetadataNode::FunctionMetadataNode):
* parser/Nodes.h:
(JSC::StatementNode::isModuleDeclarationNode):
(JSC::ModuleDeclarationNode::isModuleDeclarationNode):
(JSC::ImportDeclarationNode::moduleName):
(JSC::ExportAllDeclarationNode::moduleName):
(JSC::ExportNamedDeclarationNode::moduleName):
(JSC::ImportDeclarationNode::moduleSpecifier): Deleted.
(JSC::ExportAllDeclarationNode::moduleSpecifier): Deleted.
(JSC::ExportNamedDeclarationNode::moduleSpecifier): Deleted.
* parser/NodesAnalyzeModule.cpp:
(JSC::SourceElements::analyzeModule):
(JSC::ImportDeclarationNode::analyzeModule):
(JSC::ExportAllDeclarationNode::analyzeModule):
(JSC::ExportNamedDeclarationNode::analyzeModule):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseModuleSourceElements):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::stringForFunctionMode):
(JSC::Parser<LexerType>::parseFunctionParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseModuleName):
(JSC::Parser<LexerType>::parseImportDeclaration):
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parsePropertyMethod):
(JSC::Parser<LexerType>::parseGetterSetter):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseArrowFunctionExpression):
(JSC::Parser<LexerType>::parseModuleSpecifier): Deleted.
* parser/Parser.h:
(JSC::Parser<LexerType>::parse):
(JSC::parse):
* parser/ParserModes.h:
(JSC::isFunctionParseMode):
(JSC::isModuleParseMode):
(JSC::isProgramParseMode):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createFunctionMetadata):
(JSC::SyntaxChecker::createModuleName):
(JSC::SyntaxChecker::createImportDeclaration):
(JSC::SyntaxChecker::createExportAllDeclaration):
(JSC::SyntaxChecker::createExportNamedDeclaration):
(JSC::SyntaxChecker::createModuleSpecifier): Deleted.
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
* runtime/Completion.cpp:
(JSC::checkSyntax):
(JSC::checkModuleSyntax):
* runtime/Executable.cpp:
(JSC::ProgramExecutable::checkSyntax):
* tests/stress/modules-syntax-error-with-names.js:

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

4 years agoDon't short circuit seeking
jer.noble@apple.com [Thu, 13 Aug 2015 23:39:01 +0000 (23:39 +0000)]
Don't short circuit seeking
https://bugs.webkit.org/show_bug.cgi?id=147892

Reviewed by Eric Carlson.

When two seekWithTolerance() requests come in before the first is acted upon in seekTask(),
the second will result in a "no seek required" conditional, because the new "currentTime" is
assumed to be the destination time of the first seek.

When cancelling a pending seek, first replace the "now" value with the "now" value from the
replaced seek, thus preserving the original currentTime across all replacement seeks.

Drive-by fix: some added logging causes occasional crashes, due to the underlying object being
accessed having been deleted.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::seekWithTolerance):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):

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

4 years agoWorkQueue::dispatchAfter() on Windows fires early.
mark.lam@apple.com [Thu, 13 Aug 2015 23:38:57 +0000 (23:38 +0000)]
WorkQueue::dispatchAfter() on Windows fires early.
https://bugs.webkit.org/show_bug.cgi?id=147992

Reviewed by Brent Fulgham.

The Windows implementation of WorkQueue::dispatchAfter() uses CreateTimerQueueTimer().
Unfortunately, CreateTimerQueueTimer() is sloppy and can fire early.  We need to compensate
for this slop to ensure that the specified duration does expire before the callback function
is called.  Otherwise, the JSC watchdog (which depends on this) can fail randomly.

* wtf/win/WorkQueueWin.cpp:
(WTF::WorkQueue::dispatchAfter):

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

4 years agoTeach Scripts/copy-webkitlibraries-to-product-directory to copy the El Capitan Library.
lforschler@apple.com [Thu, 13 Aug 2015 23:26:57 +0000 (23:26 +0000)]
Teach Scripts/copy-webkitlibraries-to-product-directory to copy the El Capitan Library.

Unreviewed.

* Scripts/copy-webkitlibraries-to-product-directory:

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

4 years agoUpdate WebKitSystemInterface Libraries.
lforschler@apple.com [Thu, 13 Aug 2015 23:25:13 +0000 (23:25 +0000)]
Update WebKitSystemInterface Libraries.

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

4 years agoRebaseline some iOS simulator test results for font changes.
jhoneycutt@apple.com [Thu, 13 Aug 2015 23:05:17 +0000 (23:05 +0000)]
Rebaseline some iOS simulator test results for font changes.

Rubber-stamped by Sam Weinig.

* platform/ios-simulator/editing/selection/vertical-lr-ltr-extend-line-backward-br-expected.txt:
* platform/ios-simulator/editing/selection/vertical-lr-ltr-extend-line-forward-br-expected.txt:
* platform/ios-simulator/editing/selection/vertical-rl-ltr-extend-line-backward-br-expected.txt:
* platform/ios-simulator/editing/selection/vertical-rl-ltr-extend-line-backward-p-expected.txt:
* platform/ios-simulator/editing/selection/vertical-rl-ltr-extend-line-backward-wrap-expected.txt:
* platform/ios-simulator/editing/selection/vertical-rl-ltr-extend-line-forward-br-expected.txt:
* platform/ios-simulator/editing/selection/vertical-rl-ltr-extend-line-forward-p-expected.txt:
* platform/ios-simulator/editing/selection/vertical-rl-ltr-extend-line-forward-wrap-expected.txt:
* platform/ios-simulator/fast/ruby/bopomofo-expected.txt:
* platform/ios-simulator/fast/ruby/bopomofo-letter-spacing-expected.txt:
* platform/ios-simulator/fast/ruby/bopomofo-rl-expected.txt:
* platform/ios-simulator/fast/text/backslash-to-yen-sign-euc-expected.txt:
* platform/ios-simulator/fast/text/backslash-to-yen-sign-expected.txt:
* platform/ios-simulator/fast/text/font-weights-zh-expected.txt:
* platform/ios-simulator/fast/text/indic-expected.txt:
* platform/ios-simulator/fast/text/international/plane2-expected.txt:
* platform/ios-simulator/fast/text/international/synthesized-italic-vertical-latin-expected.txt:
* platform/ios-simulator/fast/text/international/text-combine-image-test-expected.txt:
* platform/ios-simulator/fast/text/international/text-spliced-font-expected.txt:
* platform/ios-simulator/fast/text/tatechuyoko-expected.txt:
* platform/ios-simulator/fast/text/text-combine-different-fonts-expected.txt:
* platform/ios-simulator/fast/writing-mode/japanese-lr-selection-expected.txt:
* platform/ios-simulator/fast/writing-mode/japanese-lr-text-expected.txt:
* platform/ios-simulator/fast/writing-mode/japanese-rl-selection-expected.txt:
* platform/ios-simulator/fast/writing-mode/japanese-rl-text-expected.txt:
* platform/ios-simulator/fast/writing-mode/japanese-ruby-horizontal-bt-expected.txt:
* platform/ios-simulator/fast/writing-mode/japanese-ruby-vertical-lr-expected.txt:
* platform/ios-simulator/fast/writing-mode/japanese-ruby-vertical-rl-expected.txt:
* platform/ios-simulator/fast/writing-mode/vertical-align-table-baseline-expected.txt:

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

4 years agoProspective Mac/iOS build fix after the last Windows build fix.
bfulgham@apple.com [Thu, 13 Aug 2015 23:00:07 +0000 (23:00 +0000)]
Prospective Mac/iOS build fix after the last Windows build fix.

* page/CaptionUserPreferences.cpp:
* page/UserContentController.cpp:

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

4 years agoRun benchmark customized Dromaeo should not assume there is an internet connection.
commit-queue@webkit.org [Thu, 13 Aug 2015 22:39:13 +0000 (22:39 +0000)]
Run benchmark customized Dromaeo should not assume there is an internet connection.
https://bugs.webkit.org/show_bug.cgi?id=147995

Patch by Dewei Zhu <dewei_zhu@apple.com> on 2015-08-13
Reviewed by Ryosuke Niwa.

Add several dependency js libs to local.

* Scripts/webkitpy/benchmark_runner/data/patches/Dromaeo.patch:

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

4 years ago[Win] More build fixes.
bfulgham@apple.com [Thu, 13 Aug 2015 22:31:21 +0000 (22:31 +0000)]
[Win] More build fixes.

* dom/make_event_factory.pl:
(generateImplementation):
* page/CaptionUserPreferences.cpp:
* page/PageGroup.cpp:
* page/UserContentController.cpp:

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

4 years agoWeb Inspector: Skip rendering frame records without children
mattbaker@apple.com [Thu, 13 Aug 2015 22:27:33 +0000 (22:27 +0000)]
Web Inspector: Skip rendering frame records without children
https://bugs.webkit.org/show_bug.cgi?id=147993

Reviewed by Reviewed by Joseph Pecoraro.

This became an issue for frames which include an IndexedDB "success" event. This caused the
payload to pass the "has children" test, but resulted in model objects with no child records.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype.eventRecorded):
Fixed record type check and moved rendering frame index assignment.

* UserInterface/Models/RenderingFrameTimelineRecord.js:
(WebInspector.RenderingFrameTimelineRecord):
(WebInspector.RenderingFrameTimelineRecord.prototype.setupFrameIndex):
Frame index is now set externally, and can only be set once.

* UserInterface/Views/RenderingFrameTimelineView.js:
(WebInspector.RenderingFrameTimelineView.prototype._renderingFrameTimelineRecordAdded):
Added assertion.

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

4 years agoWeb Inspector: Watch Expressions
joepeck@webkit.org [Thu, 13 Aug 2015 22:03:58 +0000 (22:03 +0000)]
Web Inspector: Watch Expressions
https://bugs.webkit.org/show_bug.cgi?id=147904

Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject):
A RemoteObject's description string is optional, but we always
assume it exists and is a string, so default to the empty string.

* UserInterface/Controllers/RuntimeManager.js:
(WebInspector.RuntimeManager.prototype.evaluateInInspectedWindow.evalCallback):
Include the object group in the DidEvaluate event.

(WebInspector.RemoteObject.fakeRemoteObject):
(WebInspector.RemoteObject.prototype.getDisplayablePropertyDescriptors):
(WebInspector.RemoteObject.prototype.deprecatedGetDisplayableProperties.get return):
(WebInspector.RemoteObject.prototype.deprecatedGetDisplayableProperties):
(WebInspector.RemoteObject.prototype._isFakeObject):
(WebInspector.RemoteObject.prototype._getPropertyDescriptors):
(WebInspector.RemoteObject.prototype._deprecatedGetProperties):
Support a fake RemoteObject. We use this fake RemoteObject to
back a ObjectTreeView where we add custom Properties which are of the form
"Expressions => RemoteObject" instead of "Object Property => RemoteObject".
Ensure a fake remote object is not used in unexpected ways.

* UserInterface/Views/Popover.js:
(WebInspector.Popover.prototype.update):
Default a popover update to animate, but allow not animating.

(WebInspector.Popover.prototype.handleEvent):
Vend a class that other content can use so that the Popover won't
dismiss if content with that class is scrolled. For example, a
completions list may be showing over a popover, if that scrolls
it should not dismiss the popover.

* UserInterface/Views/CompletionSuggestionsView.js:
(WebInspector.CompletionSuggestionsView):
Adopt the Popover ignore class so a popover won't dismiss if the
completion suggestions view is scrolled.

* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement.get return):
(WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement):
Allow modifying the context menu on an ObjectTreeView by looking for a delegate
on the TreeOutline.

* UserInterface/Views/ScopeChainDetailsSidebarPanel.css: Added.
(.details-section.watch-expressions .options > *):
(.details-section.watch-expressions .options > *:active):
(.details-section.watch-expressions .options > .watch-expression-add):
(.details-section.watch-expressions .options > .watch-expression-clear):
(.details-section.watch-expressions .options > .watch-expression-refresh):
(.popover .watch-expression):
(.watch-expression-editor):
(.watch-expression-editor > .CodeMirror):
(.watch-expression-editor > .CodeMirror-scroll):
Styles for the new Watch Expressions section, buttons, popover, and editor.

* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.inspect):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.refresh):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
Because we update the UI after a delay, to allow ObjectTreeView's to asynchronously
expand and fetch their list of properties, we convert updating the watch expression
and call frame sections asynchronously and return a promise. This lets us visually
update the UI after both sections have updated.

(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpression):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._removeWatchExpression):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._clearAllWatchExpressions):
Modify the saved list of watch expressions.

(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked.presentPopoverOverTargetElement):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked.this._codeMirror.addKeyMap):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._addWatchExpressionButtonClicked):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype.willDismissPopover):
Handle presenting and dismissing the add watch expression popover.

(WebInspector.ScopeChainDetailsSidebarPanel.prototype._refreshAllWatchExpressionsButtonClicked):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._clearAllWatchExpressionsButtonClicked):
Other button handlers.

(WebInspector.ScopeChainDetailsSidebarPanel.prototype._mainResourceDidChange):
Refresh the sidebar on navigation, as the watch expressions may change value (`location.href`).

(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeElementAddContextMenuItems):
Add our own context menu items to watch expression ObjectTreeView tree elements to
allow removing a watch expression.

(WebInspector.ScopeChainDetailsSidebarPanel.prototype._propertyPathIdentifierForTreeElement):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeAddHandler):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeExpandHandler):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeCollapseHandler):
Convert code to use `let`.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
Misc. changes.

LayoutTests:

* inspector/model/remote-object-fake-object-expected.txt: Added.
* inspector/model/remote-object-fake-object.html: Added.

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

4 years agoWeb Inspector: refactor ProtocolTest to be an InjectedTestHarness subclass
bburg@apple.com [Thu, 13 Aug 2015 21:53:05 +0000 (21:53 +0000)]
Web Inspector: refactor ProtocolTest to be an InjectedTestHarness subclass
https://bugs.webkit.org/show_bug.cgi?id=147954

Reviewed by Joseph Pecoraro.

In preparation for sharing the same test harness API between protocol tests
and frontend tests, this patch refactors ProtocolTest into the desired
class structure. Each type of test (currently: protocol, frontend) extends
InjectedTestHarness and fills in a few key methods for communicating with
the test page-side code.

This patch standardizes on assert() only logging when the condition is false.
Update protocol tests to use ProtocolTestHarness.expectThat, rather than assert.

* http/tests/inspector/resources/ProtocolTestStub.js:
(window.InjectedTestHarness):
(window.InjectedTestHarness.prototype.createAsyncSuite):
(window.InjectedTestHarness.prototype.createSyncSuite):
(window.InjectedTestHarness.prototype.completeTest):
(window.InjectedTestHarness.prototype.addResult):
(window.InjectedTestHarness.prototype.debugLog):
(window.InjectedTestHarness.prototype.evaluateInPage):
(window.InjectedTestHarness.prototype.importScript):
(window.InjectedTestHarness.prototype.get logCount):
(window.InjectedTestHarness.prototype.log):
(window.InjectedTestHarness.prototype.assert):
(window.InjectedTestHarness.prototype.expectThat):

(InjectedTestHarness.AsyncTestSuite): Use a stored reference to the harness
rather than hardcoding a specific InjectedTestHarness instance.

(InjectedTestHarness.AsyncTestSuite.prototype.runTestCasesAndFinish.finish):
(InjectedTestHarness.AsyncTestSuite.prototype.runTestCasesAndFinish):
(InjectedTestHarness.AsyncTestSuite.prototype.runTestCases):

(InjectedTestHarness.SyncTestSuite): Use a stored reference to the harness
rather than hardcoding a specific InjectedTestHarness instance.

(InjectedTestHarness.SyncTestSuite.prototype.runTestCasesAndFinish):
(InjectedTestHarness.SyncTestSuite.prototype.runTestCases):

(ProtocolTestHarness.prototype.completeTest):
(ProtocolTestHarness.prototype.addResult):
(ProtocolTestHarness.prototype.debugLog):
(ProtocolTestHarness.prototype.evaluateInPage):
(ProtocolTestHarness):
(InspectorProtocol.sendCommand):
(InspectorProtocol.awaitCommand):
(InspectorProtocol.awaitEvent.):
(InspectorProtocol.awaitEvent):
(InspectorProtocol.addEventListener):
(InspectorProtocol.sendMessage):
(InspectorProtocol.checkForError):
(InspectorFrontendAPI.dispatchMessageAsync):
(ProtocolTest.AsyncTestSuite): Moved.
(ProtocolTest.AsyncTestSuite.prototype.runTestCasesAndFinish.finish): Moved.
(ProtocolTest.AsyncTestSuite.prototype.runTestCasesAndFinish): Moved.
(ProtocolTest.AsyncTestSuite.prototype.runTestCases): Moved.
(ProtocolTest.SyncTestSuite): Moved.
(ProtocolTest.SyncTestSuite.prototype.runTestCasesAndFinish): Moved.
(ProtocolTest.SyncTestSuite.prototype.runTestCases): Moved.
(ProtocolTest.log): Moved.
(ProtocolTest.assert): Moved.
(ProtocolTest.debugLog): Moved.
(ProtocolTest.completeTest): Moved.
(ProtocolTest.importScript): Moved.
* http/tests/inspector/resources/console-test.js:
(.suite.addTestCase.):
(.suite.addTestCase):
(ProtocolTest.Console.addTestCase):
* http/tests/inspector/resources/protocol-test.js:
(closeTest):
* inspector/console/console-message.html:
* inspector/console/x-frame-options-message.html:
* inspector/debugger/didSampleProbe-multiple-probes.html:
* inspector/dom-debugger/node-removed.html:
* inspector/dom/dom-remove-events.html:
* inspector/runtime/getProperties.html:
* inspector/unit-tests/async-test-suite-expected.txt:
* inspector/unit-tests/async-test-suite.html:
* inspector/unit-tests/sync-test-suite-expected.txt:
* inspector/unit-tests/sync-test-suite.html:

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

4 years agoA focused node should not be assisted when handling touch events synchronously
wenson_hsieh@apple.com [Thu, 13 Aug 2015 21:48:50 +0000 (21:48 +0000)]
A focused node should not be assisted when handling touch events synchronously
https://bugs.webkit.org/show_bug.cgi?id=147836
.:

Reviewed by Enrica Casucci.

Added manual tests for keyboard assistance behavior due to receiving touch events on iOS.

* ManualTests/ios/focused-input-should-assist-on-touch.html: Checks that a currently focused
        input can still be assisted due to a touch event.
* ManualTests/ios/keyboard-should-not-show-on-touch-event.html: Checks that handling a touch
        event does not automatically cause us to assist the currently focused node.

Source/WebCore:

<rdar://problem/22204108>

Reviewed by Enrica Casucci.

Makes interaction with touch handlers no longer assist the currently focused element in the
general case. Added plumbing to reassist a currently focused node when dispatching touch events,
so that an input that programmatically focuses itself and prevents default on a touch event will
be properly assisted when it has been programmatically focused (either through Javascript or the
autofocus attribute) prior to receiving the touch event. This patch also removes the now
unnecessary special-casing of the Gmail settings app that currently makes the keyboard deploy
upon autofocus.

* dom/Element.cpp:
(WebCore::Element::focus): Notifies the chrome client that the element has refocused before
    returning early.
* page/ChromeClient.h: Refocusing an element does nothing by default.
* platform/RuntimeApplicationChecksIOS.h: Removed special casing for Gmail Add Account.
* platform/RuntimeApplicationChecksIOS.mm: See above.
(WebCore::applicationIsGmailAddAccountOnIOS): See above.

Source/WebKit2:

<rdar://problem/22204108>

Reviewed by Enrica Casucci.

Makes interaction with touch handlers no longer assist the currently focused element in the
general case. Added plumbing to reassist a currently focused node when dispatching touch events,
so that an input that programmatically focuses itself and prevents default on a touch event will
be properly assisted when it has been programmatically focused (either through Javascript or the
autofocus attribute) prior to receiving the touch event. This patch also removes the now
unnecessary special-casing of the Gmail settings app that currently makes the keyboard deploy
upon autofocus.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Removed
    special case to avoid the early return for Gmail Add Account.
* WebProcess/WebCoreSupport/WebChromeClient.h: Added a handler for refocusing an element.
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::elementDidRefocus): Makes refocusing an element trigger input
    assistance on iOS.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchTouchEvent): Removes logic to focus the currently focused element upon
    receiving a touch event.

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

4 years agoAdd WKWindowFeaturesRef and a new modern createNewPage UI client callback
andersca@apple.com [Thu, 13 Aug 2015 21:31:36 +0000 (21:31 +0000)]
Add WKWindowFeaturesRef and a new modern createNewPage UI client callback
https://bugs.webkit.org/show_bug.cgi?id=147989

Reviewed by Tim Horton.

* Platform/IPC/mac/ConnectionMac.mm:
* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* UIProcess/API/APIWindowFeatures.cpp: Added.
* UIProcess/API/APIWindowFeatures.h: Added.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/API/C/WKWindowFeaturesRef.cpp: Added.
(WKWindowFeaturesGetTypeID):
* UIProcess/API/C/WKWindowFeaturesRef.h: Added.
* UIProcess/API/Cocoa/WKWindowFeatures.mm:
(-[WKWindowFeatures dealloc]):
(-[WKWindowFeatures menuBarVisibility]):
(-[WKWindowFeatures statusBarVisibility]):
(-[WKWindowFeatures toolbarsVisibility]):
(-[WKWindowFeatures allowsResizing]):
(-[WKWindowFeatures x]):
(-[WKWindowFeatures y]):
(-[WKWindowFeatures width]):
(-[WKWindowFeatures height]):
(-[WKWindowFeatures _apiObject]):
(-[WKWindowFeatures _initWithWindowFeatures:]): Deleted.
* UIProcess/API/Cocoa/WKWindowFeaturesInternal.h:
(WebKit::wrapper):
* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPage):
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoWeb Inspector: A {Map, WeakMap, Set, WeakSet} object contains itself will hang the...
commit-queue@webkit.org [Thu, 13 Aug 2015 21:30:13 +0000 (21:30 +0000)]
Web Inspector: A {Map, WeakMap, Set, WeakSet} object contains itself will hang the console
https://bugs.webkit.org/show_bug.cgi?id=147966

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

Source/JavaScriptCore:

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype._initialPreview):
Renamed to initial preview. This is not a complete preview for
this object, and it needs some processing in order to be a
complete accurate preview.

(InjectedScript.RemoteObject.prototype._emptyPreview):
This attempts to be an accurate empty preview for the given object.
For types with entries, it adds an empty entries list and updates
the overflow and lossless properties.

(InjectedScript.RemoteObject.prototype._createObjectPreviewForValue):
Take a generatePreview parameter to generate a full preview or empty preview.

(InjectedScript.RemoteObject.prototype._appendPropertyPreviews):
(InjectedScript.RemoteObject.prototype._appendEntryPreviews):
(InjectedScript.RemoteObject.prototype._isPreviewableObject):
Take care to avoid cycles.

Source/WebInspectorUI:

* UserInterface/Views/ObjectPreviewView.js:
(WebInspector.ObjectPreviewView.prototype._appendEntryPreviews):
(WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews):
For empty overflow previews, don't show ", ..." if we didn't show any
values; just show "..." in these cases.

LayoutTests:

* inspector/model/remote-object.html:
* inspector/model/remote-object-expected.txt:
Add tests for a cylic array, set, and map.

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

4 years ago[Win] Unreviewed build fix.
bfulgham@apple.com [Thu, 13 Aug 2015 21:17:30 +0000 (21:17 +0000)]
[Win] Unreviewed build fix.

* accessibility/AXObjectCache.cpp: Add missing 'DataLog.h' include.

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

4 years agoPeriodic code deletion should delete RegExp code
ggaren@apple.com [Thu, 13 Aug 2015 21:06:46 +0000 (21:06 +0000)]
Periodic code deletion should delete RegExp code
https://bugs.webkit.org/show_bug.cgi?id=147990

Reviewed by Filip Pizlo.

The RegExp code cache was created for the sake of simple loops that
re-created the same RegExps. It's reasonable to delete it periodically.

* heap/Heap.cpp:
(JSC::Heap::deleteOldCode):

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

4 years agoWTF should have a compact Condition object to use with Lock
fpizlo@apple.com [Thu, 13 Aug 2015 20:42:11 +0000 (20:42 +0000)]
WTF should have a compact Condition object to use with Lock
https://bugs.webkit.org/show_bug.cgi?id=147986

Reviewed by Geoffrey Garen.

Source/WTF:

Adds a condition variable implementation based on ParkingLot, called simply WTF::Condition.
It can be used with WTF::Lock or actually any lock implementation. It should even work with
WTF::SpinLock, WTF::Mutex, or std::mutex. Best of all, Condition only requires one byte.

ParkingLot almost contained all of the functionality needed to implemenet wait/notify. We
could have implemented Condition using a 32-bit (or even 64-bit) version that protects
against a notify that happens just before we park. But, this changes the ParkingLot API to
give us the ability to run some code between when ParkingLot enqueues the current thread
and when it actually sleeps. This callback is called with no locks held, so it can call
unlock() on any kind of lock, so long as that lock's unlock() method doesn't recurse into
ParkingLot::parkConditionally(). That seems unlikely; unlock() is more likely to call
ParkingLot::unparkOne() or unparkAll(). WTF::Lock will never call parkConditionally()
inside unlock(), so WTF::Lock is definitely appropriate for use with Condition.

Condition supports most of the API that std::condition_variable supports. It does some
things to try to reduce footgun potential. The preferred timeout form is waitUntil() which
takes an absolute time from the steady_clock. The only relative timeout form also takes a
predicate callback, so it's impossible to write the subtly incorrect
"while (...) wait_for(...)" idiom.

This patch doesn't actually introduce any uses of WTF::Condition other than the unit tests.
I'll start switching code over to using WTF::Condition in another patch.

* WTF.vcxproj/WTF.vcxproj:
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Condition.h: Added.
(WTF::Condition::Condition):
(WTF::Condition::waitUntil):
(WTF::Condition::waitFor):
(WTF::Condition::wait):
(WTF::Condition::notifyOne):
(WTF::Condition::notifyAll):
* wtf/Lock.cpp:
(WTF::LockBase::unlockSlow): Make this useful assertion be a release assertion. It catches cases where you unlock the lock even though you don't hold it.
* wtf/ParkingLot.cpp:
(WTF::ParkingLot::parkConditionally): Add the beforeSleep() callback.
(WTF::ParkingLot::unparkOne):
* wtf/ParkingLot.h:
(WTF::ParkingLot::compareAndPark):

Tools:

Add a test for WTF::Condition.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/Condition.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/Lock.cpp:
(TestWebKitAPI::runLockTest): Change the name of the thread.

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

4 years agoSelects should scale when rendering while zoomed
wenson_hsieh@apple.com [Thu, 13 Aug 2015 20:30:32 +0000 (20:30 +0000)]
Selects should scale when rendering while zoomed
https://bugs.webkit.org/show_bug.cgi?id=147868

Reviewed by Daniel Bates.

When rendering zoomed <select> elements, draw to an image buffer instead of drawing directly
into the context. This allows us to scale the image buffer up before rendering.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintMenuList): Use ThemeMac::drawCellOrFocusRingWithViewIntoContext
    to render search fields, utilizing an offscreen image buffer only when necessary.

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

4 years agoWeb Inspector: Hide child rows for filtered tasks in the Rendering Frames data grid
mattbaker@apple.com [Thu, 13 Aug 2015 20:29:20 +0000 (20:29 +0000)]
Web Inspector: Hide child rows for filtered tasks in the Rendering Frames data grid
https://bugs.webkit.org/show_bug.cgi?id=147960

Reviewed by Timothy Hatcher.

* UserInterface/Models/RenderingFrameTimelineRecord.js:
(WebInspector.RenderingFrameTimelineRecord.taskTypeForTimelineRecord):
New static method for mapping TimelineRecords to rendering frame tasks.
(WebInspector.RenderingFrameTimelineRecord.prototype.durationForTask):
Refactored to use taskTypeForTimelineRecord.

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
Task filtering is applied to children of the frame record only. Parent frame
record is hidden by default, and visible by virtue of having unfiltered children.

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

4 years agoRegExpCache::finalize should not delete code
ggaren@apple.com [Thu, 13 Aug 2015 20:28:12 +0000 (20:28 +0000)]
RegExpCache::finalize should not delete code
https://bugs.webkit.org/show_bug.cgi?id=147987

Reviewed by Mark Lam.

The RegExp object already knows how to delete its own code in its
destructor. Our job is just to clear our stale pointer.

* runtime/RegExpCache.cpp:
(JSC::RegExpCache::finalize):
(JSC::RegExpCache::addToStrongCache):

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

4 years agoWeb Inspector: Clearing frames timeline doesn't remove current time marker
mattbaker@apple.com [Thu, 13 Aug 2015 20:27:57 +0000 (20:27 +0000)]
Web Inspector: Clearing frames timeline doesn't remove current time marker
https://bugs.webkit.org/show_bug.cgi?id=147650

Reviewed by Timothy Hatcher.

The rendering frames timeline offsets all markers by 1px to align them on frame
boundaries, which causes the current time marker to be visible even with left: 0px.
We can exclude the current time marker without it being noticable during recording.

* UserInterface/Views/TimelineOverview.css:

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

4 years ago[Win] Unreviewed build fix after r188388.
achristensen@apple.com [Thu, 13 Aug 2015 20:26:45 +0000 (20:26 +0000)]
[Win] Unreviewed build fix after r188388.

* bindings/js/JSWebGLRenderingContextCustom.cpp:
* dom/EventFactory.h:
* rendering/RenderThemeWin.cpp:
Strange things happen when you change including headers.  This fixed my local build.

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

4 years agoStandardize on the phrase "delete code"
ggaren@apple.com [Thu, 13 Aug 2015 20:17:02 +0000 (20:17 +0000)]
Standardize on the phrase "delete code"
https://bugs.webkit.org/show_bug.cgi?id=147984

Reviewed by Mark Lam.

Source/JavaScriptCore:

Use "delete" when we talk about throwing away code, as opposed to
"invalidate" or "discard".

* debugger/Debugger.cpp:
(JSC::Debugger::forEachCodeBlock):
(JSC::Debugger::setSteppingMode):
(JSC::Debugger::recompileAllJSFunctions):
* heap/Heap.cpp:
(JSC::Heap::deleteAllCompiledCode):
* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::recompileAllJSFunctionsForTypeProfiling):
* runtime/RegExp.cpp:
(JSC::RegExp::match):
(JSC::RegExp::deleteCode):
(JSC::RegExp::invalidateCode): Deleted.
* runtime/RegExp.h:
* runtime/RegExpCache.cpp:
(JSC::RegExpCache::finalize):
(JSC::RegExpCache::addToStrongCache):
(JSC::RegExpCache::deleteAllCode):
(JSC::RegExpCache::invalidateCode): Deleted.
* runtime/RegExpCache.h:
* runtime/VM.cpp:
(JSC::VM::stopSampling):
(JSC::VM::prepareToDeleteCode):
(JSC::VM::deleteAllCode):
(JSC::VM::setEnabledProfiler):
(JSC::VM::prepareToDiscardCode): Deleted.
(JSC::VM::discardAllCode): Deleted.
* runtime/VM.h:
(JSC::VM::apiLock):
(JSC::VM::codeCache):
* runtime/Watchdog.cpp:
(JSC::Watchdog::setTimeLimit):

Source/WebCore:

Use "delete" when we talk about throwing away code, as opposed to
"invalidate" or "discard".

* bindings/js/GCController.cpp:
(WebCore::GCController::setJavaScriptGarbageCollectorTimerEnabled):
(WebCore::GCController::deleteAllCode):
(WebCore::GCController::discardAllCompiledCode): Deleted.
* bindings/js/GCController.h:
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseCriticalMemory):

Source/WebKit/mac:

* WebView/WebView.mm:
(+[WebView discardAllCompiledCode]):
(+[WebView isCharacterSmartReplaceExempt:isPreviousCharacter:]):

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

4 years agoDon't short circuit seeking
eric.carlson@apple.com [Thu, 13 Aug 2015 19:16:09 +0000 (19:16 +0000)]
Don't short circuit seeking
https://bugs.webkit.org/show_bug.cgi?id=147892

Reviewed by Jer Noble.

Source/WebCore:

Test: media/video-seek-to-current-time.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad): Call clearSeeking.
(WebCore::HTMLMediaElement::fastSeek): Add logging.
(WebCore::HTMLMediaElement::seekWithTolerance): Add logging. Set m_pendingSeekType.
(WebCore::HTMLMediaElement::seekTask):  Call clearSeeking. Don't short circuit a
  if the current or pending seek is a fast seek. Set m_seeking to true immediately
  before calling media engine as it may have been cleared before the seek task
  queue ran.
(WebCore::HTMLMediaElement::clearSeeking): New.
* html/HTMLMediaElement.h:
* html/HTMLMediaElementEnums.h:

* platform/GenericTaskQueue.h:
(WebCore::GenericTaskQueue::enqueueTask): Clear m_pendingTasks.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): Don't return early
  when asked to seek to the current time.
(WebCore::MediaPlayerPrivateAVFoundation::invalidateCachedDuration): Remove some
  extremely noisy logging.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): Add logging.

LayoutTests:

* media/event-attributes-expected.txt: Update for test change.
* media/event-attributes.html: There is no reason to expect that a 'timeupdate' will have
  been sent before 'canplaythrough'.
* media/video-seek-to-current-time-expected.txt: Added.
* media/video-seek-to-current-time.html: Added.
* platform/efl/TestExpectations: Skip new test.
* platform/gtk/TestExpectations: Ditto.
* platform/mac/TestExpectations: Mark the new test as sometimes failing because of
  webkit.org/b/147944.
* platform/win/TestExpectations: Skip new test.

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

4 years agoFilterOperation.h should not include FilterEffect.h
simon.fraser@apple.com [Thu, 13 Aug 2015 19:08:42 +0000 (19:08 +0000)]
FilterOperation.h should not include FilterEffect.h
https://bugs.webkit.org/show_bug.cgi?id=147970

Reviewed by Daniel Bates.

FilterEffect.h pulls in lots of JSC goop via runtime/Uint8ClampedArray.h,
so move its include to FilterOperation.cpp.

Causes include bloat because FilterOperation.h is pulled in via RenderStyle.h.

Source/WebCore:

* platform/graphics/filters/FilterOperation.cpp:
(WebCore::ReferenceFilterOperation::setFilterEffect):
* platform/graphics/filters/FilterOperation.h:
(WebCore::ReferenceFilterOperation::setFilterEffect): Deleted.

Source/WebKit2:

* UIProcess/ios/WebVideoFullscreenManagerProxy.h:

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

4 years agoScriptExecutionContext.h pulls in all the JSC headers
simon.fraser@apple.com [Thu, 13 Aug 2015 19:08:37 +0000 (19:08 +0000)]
ScriptExecutionContext.h pulls in all the JSC headers
https://bugs.webkit.org/show_bug.cgi?id=147969

Reviewed by Alexey Proskuryakov.

ScriptExecutionContext.h included ScheduledAction.h, which pulled in all the
JSC headers via JSDOMBinding.h. There was no need for this #include, so remove
it and fix the fallout.

* Modules/webdatabase/DatabaseTracker.cpp:
* Modules/webdatabase/SQLTransaction.h:
* bindings/js/JSWebGLRenderingContextCustom.cpp:
* contentextensions/ContentExtensionStyleSheet.cpp:
* dom/ScriptExecutionContext.h:
* html/FTPDirectoryDocument.cpp:
* html/canvas/WebGLRenderingContext.cpp:
* html/parser/HTMLTreeBuilder.h:

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

4 years agoUnreviewed, shorten another test. It's timing out in debug on some bot.
fpizlo@apple.com [Thu, 13 Aug 2015 18:10:36 +0000 (18:10 +0000)]
Unreviewed, shorten another test. It's timing out in debug on some bot.

* TestWebKitAPI/Tests/WTF/Lock.cpp:
(TestWebKitAPI::TEST):

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

4 years agoUse WTF::Optional in WindowFeatures
andersca@apple.com [Thu, 13 Aug 2015 17:37:27 +0000 (17:37 +0000)]
Use WTF::Optional in WindowFeatures
https://bugs.webkit.org/show_bug.cgi?id=147956

Reviewed by Sam Weinig.

Source/WebCore:

* loader/FrameLoader.cpp:
(WebCore::createWindow):
* page/WindowFeatures.cpp:
(WebCore::WindowFeatures::WindowFeatures):
(WebCore::WindowFeatures::setWindowFeature):
(WebCore::WindowFeatures::boolFeature):
(WebCore::WindowFeatures::floatFeature):
(WebCore::WindowFeatures::parseDialogFeatures):
* page/WindowFeatures.h:
(WebCore::WindowFeatures::WindowFeatures):

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::createWindow):

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
(createWindowFeaturesPropertyBag):

Source/WebKit2:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<WindowFeatures>::encode): Deleted.
(IPC::ArgumentCoder<WindowFeatures>::decode): Deleted.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageUIClient):
* UIProcess/API/Cocoa/WKWindowFeatures.mm:
(-[WKWindowFeatures _initWithWindowFeatures:]):

Source/WTF:

Add new operators to WTF::Optional to make it more like std::optional.

* wtf/Optional.h:
(WTF::Optional::operator->):
(WTF::Optional::operator*):

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

4 years agoSource/WebCore:
mdaiter@apple.com [Thu, 13 Aug 2015 17:33:43 +0000 (17:33 +0000)]
Source/WebCore:
UserMediaRequest should supply IDs of devices selected by user
https://bugs.webkit.org/show_bug.cgi?id=147263
<rdar://problem/21983345>

Reviewed by Jer Noble.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::userMediaAccessGranted):
* Modules/mediastream/UserMediaRequest.h:
* platform/mock/UserMediaClientMock.h:

Source/WebKit/mac:
Linking device query ability from WebKit2 to clients
https://bugs.webkit.org/show_bug.cgi?id=147263
<rdar://problem/21983345>

Reviewed by Jer Noble.

* WebCoreSupport/WebUserMediaClient.mm:
(-[WebUserMediaPolicyListener allow]):
(-[WebUserMediaPolicyListener allowDeviceWithVideoUID:andAudioUID:]):

Source/WebKit2:
Linking device query ability from WebKit2 to clients
https://bugs.webkit.org/show_bug.cgi?id=147263
<rdar://problem/21983345>

Reviewed by Jer Noble.

* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::setColorMatchUntaggedContent):
(WebKit::LayerHostingContext::colorMatchUntaggedContent):
* UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
(WKUserMediaPermissionRequestAllow):
(WKUserMediaPermissionRequestDeviceNamesVideo):
(WKUserMediaPermissionRequestDeviceNamesAudio):
* UIProcess/API/C/WKUserMediaPermissionRequest.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Deleted.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:
* UIProcess/UserMediaPermissionRequestProxy.cpp:
(WebKit::UserMediaPermissionRequestProxy::allow):
(WebKit::UserMediaPermissionRequestProxy::deny):
* UIProcess/UserMediaPermissionRequestProxy.h:
* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision):

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

4 years agoX.[[SetPrototypeOf]](Y) should succeed if X.[[Prototype]] is already Y even if X...
utatane.tea@gmail.com [Thu, 13 Aug 2015 17:25:01 +0000 (17:25 +0000)]
X.[[SetPrototypeOf]](Y) should succeed if X.[[Prototype]] is already Y even if X is not extensible
https://bugs.webkit.org/show_bug.cgi?id=147930

Reviewed by Saam Barati.

When the passed prototype object to be set is the same to the existing
prototype object, [[SetPrototypeOf]] just finishes its operation even
if the extensibility of the target object is `false`.

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncProtoSetter):
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorSetPrototypeOf):
* runtime/ReflectObject.cpp:
(JSC::reflectObjectSetPrototypeOf):
* tests/stress/set-same-prototype.js: Added.
(shouldBe):
(shouldThrow):

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

4 years ago[Cocoa] [CJK-configured device] System font has vertical punctuation
ap@apple.com [Thu, 13 Aug 2015 15:53:50 +0000 (15:53 +0000)]
[Cocoa] [CJK-configured device] System font has vertical punctuation
https://bugs.webkit.org/show_bug.cgi?id=147964
<rdar://problem/22256660>

* platform/mac/fast/text/system-font-punctuation-expected.txt: Actually landing
results for Mac.

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

4 years agoREGRESSION (r188325): Web Inspector: Fix vertical spacing in CodeMirror
nvasilyev@apple.com [Thu, 13 Aug 2015 11:49:43 +0000 (11:49 +0000)]
REGRESSION (r188325): Web Inspector: Fix vertical spacing in CodeMirror
https://bugs.webkit.org/show_bug.cgi?id=147971

r188325 inceased line-height by 2px. Remove top and bottom 1px padding
to compensate for line-height changes.

In the feature we may highlight the backgroud of text tokens (e.g. for the
heatmap profiler) so we would want to get rid of the gaps between the lines
(caused by the paddind) regardless of this regression.

Reviewed by Timothy Hatcher.

* UserInterface/Views/CodeMirrorOverrides.css:
(.CodeMirror pre):

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

4 years agoMac TestExpectations gardening.
ap@apple.com [Thu, 13 Aug 2015 06:10:57 +0000 (06:10 +0000)]
Mac TestExpectations gardening.

* platform/mac/TestExpectations:

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

4 years ago[Cairo] Improve image quality when using newer versions of cairo/pixman
carlosgc@webkit.org [Thu, 13 Aug 2015 06:07:23 +0000 (06:07 +0000)]
[Cairo] Improve image quality when using newer versions of cairo/pixman
https://bugs.webkit.org/show_bug.cgi?id=147826

Reviewed by Martin Robinson.

Since cairo 1.14 the image filters changed a bit:

 - CAIRO_FILTER_GOOD uses a box filter when downscaling if the
   scale factor is less than 0.75, otherwise it uses a filter
   equivalent to CAIRO_FILTER_BILINEAR.
 - CAIRO_FILTER_BEST uses always a Catmull-Rom filter.

We are currently using CAIRO_FILTER_BILINEAR for medium, high and
default interpolation levels. We could use CAIRO_FILTER_GOOD for
medium and default, and CAIRO_FILTER_BEST for high. This will not
have any effect in previous versions of cairo because before 1.14
CAIRO_FILTER_GOOD, CAIRO_FILTER_BILINEAR and CAIRO_FILTER_BEST had
the same implementation in pixman.

* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::drawSurfaceToContext):

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

4 years agoWeb Inspector: Sometimes CSS resources don't update after editing via Styles panel
joepeck@webkit.org [Thu, 13 Aug 2015 05:51:38 +0000 (05:51 +0000)]
Web Inspector: Sometimes CSS resources don't update after editing via Styles panel
https://bugs.webkit.org/show_bug.cgi?id=143244

Reviewed by Timothy Hatcher.

* UserInterface/Models/SourceCode.js:
(WebInspector.SourceCode.prototype._processContent):
This code is brittle and we should move off of putting the
possibly stale content in the Promise result.

* UserInterface/Views/ResourceContentView.js:
(WebInspector.ResourceContentView.prototype._contentAvailable):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._contentAvailable):
* UserInterface/Models/Script.js:
(WebInspector.Script.prototype.requestScriptSyntaxTree):
Use the current source code's content.

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

4 years ago[Cocoa] [CJK-configured device] System font has vertical punctuation
mmaxfield@apple.com [Thu, 13 Aug 2015 05:36:21 +0000 (05:36 +0000)]
[Cocoa] [CJK-configured device] System font has vertical punctuation
https://bugs.webkit.org/show_bug.cgi?id=147964
<rdar://problem/22256660>

Reviewed by Dean Jackson.

Source/WebCore:

GlyphPage::fill() has multiple code paths to accomplish its goal. It uses the shouldUseCoreText() helper
function to determine which one of the paths should be taken. However, not all of the code paths in
GlyphPage::fill() are able of handling all situations. Indeed, the CoreText code paths in GlyphPage::fill()
are only able to handle the situations which shouldUseCoreText() returns true for. This happens in the
following cases:

1. If the font is a composite font
2. If the font is used for text-combine
3. If the font has vertical glyphs

In r187693, I added one more case to this list: If the font is the system font. However, I failed to add
the necessary support to GlyphPage::fill() for this case. Becasue of this, we just happened to fall into
the case of vertical fonts (just by coincidence), which causes us to use
CTFontGetVerticalGlyphsForCharacters() instead of CTFontGetGlyphsForCharacters().

The solution is to adopt the same behavior we were using before r187693. Back then, we were using
CGFontGetGlyphsForUnichars(), which always returned horizontal glyphs. We should simply adopt this same
behavior, except in the Core Text case. Therefore, this patch is just a simple check to see if we are
using the system font when determining which Core Text function to use.

Test: fast/text/system-font-punctuation.html

* platform/graphics/FontDescription.h:
(WebCore::FontDescription::setWidthVariant):
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isForTextCombine):
* platform/graphics/mac/GlyphPageMac.cpp:
(WebCore::shouldUseCoreText):
(WebCore::GlyphPage::fill):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineText):

LayoutTests:

Make sure punctuation isn't vertical.

* fast/text/system-font-punctuation.html: Added.
* platform/ios-simulator/fast/text/system-font-punctuation-expected.txt: Added
* platform/mac/fast/text/system-font-punctuation-expected.txt: Added

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

4 years agoRemoving an expectation for a long fixed bug.
ap@apple.com [Thu, 13 Aug 2015 05:30:21 +0000 (05:30 +0000)]
Removing an expectation for a long fixed bug.

* TestExpectations: Unskip fast/multicol/newmulticol/spanner-crash.html.

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

4 years ago[WinCairo] Turn on WOFF font
commit-queue@webkit.org [Thu, 13 Aug 2015 04:38:33 +0000 (04:38 +0000)]
[WinCairo] Turn on WOFF font
https://bugs.webkit.org/show_bug.cgi?id=147878

WOFF is already usable in Windows Cairo. Just turn it on.

Patch by Jinyoung Hur <hur.ims@navercorp.com> on 2015-08-12
Reviewed by Myles C. Maxfield.

Test: fast\css\font-face-woff.html

* platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):

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

4 years agoWTF::Lock should not suffer from the thundering herd
fpizlo@apple.com [Thu, 13 Aug 2015 03:51:25 +0000 (03:51 +0000)]
WTF::Lock should not suffer from the thundering herd
https://bugs.webkit.org/show_bug.cgi?id=147947

Reviewed by Geoffrey Garen.

Source/WTF:

This changes Lock::unlockSlow() to use unparkOne() instead of unparkAll(). The problem with
doing this is that it's not obvious after calling unparkOne() if there are any other threads
that are still parked on the lock's queue. If we assume that there are and leave the
hasParkedBit set, then future calls to unlock() will take the slow path. We don't want that
if there aren't actually any threads parked. On the other hand, if we assume that there
aren't any threads parked and clear the hasParkedBit, then if there actually were some
threads parked, then they may never be awoken since future calls to unlock() won't take slow
path and so won't call unparkOne(). In other words, we need a way to be very precise about
when we clear the hasParkedBit and we need to do it in a race-free way: it can't be the case
that we clear the bit just as some thread gets parked on the queue.

A similar problem arises in futexes, and one of the solutions is to have a thread that
acquires a lock after parking sets the hasParkedBit. This is what Rusty Russel's usersem
does. It's a subtle algorithm. Also, it means that if a thread barges in before the unparked
thread runs, then that barging thread will not know that there are threads parked. This
could increase the severity of barging.

Since ParkingLot is a user-level API, we don't have to worry about the kernel-user security
issues and so we can expose callbacks while ParkingLot is holding its internal locks. This
change does exactly that for unparkOne(). The new variant of unparkOne() will call a user
function while the queue from which we are unparking is locked. The callback is told basic
stats about the queue: did we unpark a thread this time, and could there be more threads to
unpark in the future. The callback runs while it's impossible for the queue state to change,
since the ParkingLot's internal locks for the queue is held. This means that
Lock::unlockSlow() can either clear, or leave, the hasParkedBit while releasing the lock
inside the callback from unparkOne(). This takes care of the thundering herd problem while
also reducing the greed that arises from barging threads.

This required some careful reworking of the ParkingLot algorithm. The first thing I noticed
was that the ThreadData::shouldPark flag was useless, since it's set exactly when
ThreadData::address is non-null. Then I had to make sure that dequeue() could lazily create
both hashtables and buckets, since the "callback is called while queue is locked" invariant
requires that we didn't exit early due to the hashtable or bucket not being present. Note
that all of this is done in such a way that the old unparkOne() and unparkAll() don't have
to create any buckets, though they now may create the hashtable. We don't care as much about
the hashtable being created by unpark since it's just such an unlikely scenario and it would
only happen once.

This change reduces the kernel CPU usage of WTF::Lock for the long critical section test by
about 8x and makes it always perform as well as WTF::WordLock and WTF::Mutex for that
benchmark.

* benchmarks/LockSpeedTest.cpp:
* wtf/Lock.cpp:
(WTF::LockBase::unlockSlow):
* wtf/Lock.h:
(WTF::LockBase::isLocked):
(WTF::LockBase::isFullyReset):
* wtf/ParkingLot.cpp:
(WTF::ParkingLot::parkConditionally):
(WTF::ParkingLot::unparkOne):
(WTF::ParkingLot::unparkAll):
* wtf/ParkingLot.h:
* wtf/WordLock.h:
(WTF::WordLock::isLocked):
(WTF::WordLock::isFullyReset):

Tools:

Add testing that checks that locks return to a pristine state after contention is over.

* TestWebKitAPI/Tests/WTF/Lock.cpp:
(TestWebKitAPI::LockInspector::isFullyReset):
(TestWebKitAPI::runLockTest):
(TestWebKitAPI::TEST):

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

4 years agoWeb Inspector: Fix Poor Class Names
commit-queue@webkit.org [Thu, 13 Aug 2015 02:12:13 +0000 (02:12 +0000)]
Web Inspector: Fix Poor Class Names
https://bugs.webkit.org/show_bug.cgi?id=147958

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

* UserInterface/Views/ClusterContentView.js:
* UserInterface/Views/ResourceContentView.js:

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

4 years agoWeb Inspector: Opening the Elements tab without a selected sidebar panel causes a...
drousso@apple.com [Thu, 13 Aug 2015 02:08:47 +0000 (02:08 +0000)]
Web Inspector: Opening the Elements tab without a selected sidebar panel causes a crash
https://bugs.webkit.org/show_bug.cgi?id=147965

Reviewed by Timothy Hatcher.

* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
(WebInspector.CSSStyleDetailsSidebarPanel):
If the saved setting for the selectedPanel does not exist, default to the rules panel.

(WebInspector.CSSStyleDetailsSidebarPanel.prototype._switchPanels):
Only save the new navigationItem info if the selectedPanel exists.

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

4 years agoBenchmarks supported by run_benchmark script should not assume we have internet access.
commit-queue@webkit.org [Thu, 13 Aug 2015 01:38:43 +0000 (01:38 +0000)]
Benchmarks supported by run_benchmark script should not assume we have internet access.
https://bugs.webkit.org/show_bug.cgi?id=147959

Patch by Dewei Zhu <dewei_zhu@apple.com> on 2015-08-12
Reviewed by Ryosuke Niwa.

For JSBench we should not request jquery.min.js from google through the internet.

* Scripts/webkitpy/benchmark_runner/data/patches/JSBench.patch:

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

4 years agoMove RenderBox-specific Scroll Snap code from RenderElement to RenderBox
bfulgham@apple.com [Thu, 13 Aug 2015 01:20:25 +0000 (01:20 +0000)]
Move RenderBox-specific Scroll Snap code from RenderElement to RenderBox
https://bugs.webkit.org/show_bug.cgi?id=147963

Reviewed by Simon Fraser.

No new tests: No change in functionality.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleWillChange): Remove RenderBox-specific code.
(WebCore::RenderBox::willBeRemovedFromTree): Ditto.
* rendering/RenderBox.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange): Move code from RenderElement to
handle Scroll Snap Points.
(WebCore::RenderElement::willBeRemovedFromTree): Added new override to handle
scroll-snap point logic.

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

4 years agoCheck in LLVM 3.6.2 binary drops for Yosemite.
lforschler@apple.com [Thu, 13 Aug 2015 01:08:14 +0000 (01:08 +0000)]
Check in LLVM 3.6.2 binary drops for Yosemite.

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

4 years agohttp/tests/security/cors-post-redirect-308.html doesn't work properly
ap@apple.com [Thu, 13 Aug 2015 00:45:56 +0000 (00:45 +0000)]
http/tests/security/cors-post-redirect-308.html doesn't work properly
https://bugs.webkit.org/show_bug.cgi?id=147914

Reviewed by Brady Eidson.

* http/tests/resources/redirect.php: Trying to return
code 308 without a reason phrase results in an internal server error with Apache/2.2.
While at it, also corrected the script to always set Cache-Control: no-store.

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

4 years ago[Mac] WebKit processes should have access to com.apple.nesessionmanager.flow-divert...
ap@apple.com [Thu, 13 Aug 2015 00:40:06 +0000 (00:40 +0000)]
[Mac] WebKit processes should have access to com.apple.nesessionmanager.flow-divert-token
https://bugs.webkit.org/show_bug.cgi?id=147949
rdar://problem/22254920

Reviewed by Anders Carlsson.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* WebProcess/com.apple.WebProcess.sb.in:

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

4 years agoRemoved clearEvalCodeCache()
ggaren@apple.com [Thu, 13 Aug 2015 00:04:56 +0000 (00:04 +0000)]
Removed clearEvalCodeCache()
https://bugs.webkit.org/show_bug.cgi?id=147957

Reviewed by Filip Pizlo.

It was unused.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::linkIncomingCall):
(JSC::CodeBlock::install):
(JSC::CodeBlock::clearEvalCache): Deleted.
* bytecode/CodeBlock.h:
(JSC::CodeBlock::numberOfJumpTargets):
(JSC::CodeBlock::jumpTarget):
(JSC::CodeBlock::numberOfArgumentValueProfiles):

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

4 years agoRemoving an expectation for a test that's fixed.
ap@apple.com [Thu, 13 Aug 2015 00:00:49 +0000 (00:00 +0000)]
Removing an expectation for a test that's fixed.

* platform/mac/TestExpectations:

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

4 years agoWeb Inspector: CRASH under WebInspector::closeFrontend for some protocol tests
bburg@apple.com [Wed, 12 Aug 2015 23:02:40 +0000 (23:02 +0000)]
Web Inspector: CRASH under WebInspector::closeFrontend for some protocol tests
https://bugs.webkit.org/show_bug.cgi?id=147948

Reviewed by Joseph Pecoraro.

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::closeFrontend): Don't invalidate the channel if it's null.
* WebProcess/WebPage/WebInspector.h: Add default member variable values.

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

4 years ago[ES6] Implement Reflect.defineProperty
utatane.tea@gmail.com [Wed, 12 Aug 2015 22:59:05 +0000 (22:59 +0000)]
[ES6] Implement Reflect.defineProperty
https://bugs.webkit.org/show_bug.cgi?id=147943

Reviewed by Saam Barati.

This patch implements Reflect.defineProperty.
The difference from the Object.defineProperty is,

1. Reflect.defineProperty does not perform ToObject operation onto the first argument.
2. Reflect.defineProperty does not throw a TypeError when the [[DefineOwnProperty]] operation fails.
3. Reflect.defineProperty returns the boolean value that represents whether [[DefineOwnProperty]] succeeded.

And this patch comments the links to the ES6 spec.

* builtins/ReflectObject.js:
* runtime/ObjectConstructor.cpp:
(JSC::toPropertyDescriptor):
* runtime/ObjectConstructor.h:
* runtime/ReflectObject.cpp:
(JSC::reflectObjectDefineProperty):
* tests/stress/reflect-define-property.js: Added.
(shouldBe):
(shouldThrow):
(.set getter):
(setter):
(.get testDescriptor):
(.set get var):
(.set testDescriptor):
(.set get testDescriptor):
(.set get shouldThrow):
(.get var):

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

4 years agoWeb Inspector: Remove clamp and adopt Number.constrain
mattbaker@apple.com [Wed, 12 Aug 2015 21:39:49 +0000 (21:39 +0000)]
Web Inspector: Remove clamp and adopt Number.constrain
https://bugs.webkit.org/show_bug.cgi?id=147952

Reviewed by Timothy Hatcher.

* UserInterface/Base/Utilities.js:
Removed clamp function.

* UserInterface/Views/BezierEditor.js:
(WebInspector.BezierEditor.prototype._updateControlPointsForMouseEvent):
* UserInterface/Views/ProfileNodeDataGridNode.js:
(WebInspector.ProfileNodeDataGridNode.prototype.updateRangeTimes):
* UserInterface/Views/ScriptTimelineDataGridNode.js:
(WebInspector.ScriptTimelineDataGridNode.prototype.updateRangeTimes):
* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype._updateSelection):
Replaced instances of clamp with Number.constrain.

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

4 years agoRefactor BuildbotQueueView.revisionContentForIteration to work more generically with...
commit-queue@webkit.org [Wed, 12 Aug 2015 21:10:25 +0000 (21:10 +0000)]
Refactor BuildbotQueueView.revisionContentForIteration to work more generically with repositories
other than "openSource" and "internal".
https://bugs.webkit.org/show_bug.cgi?id=147796

Patch by Jason Marcell <jmarcell@apple.com> on 2015-08-12
Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
(BuildbotQueueView.prototype._revisionContentWithPopoverForIteration): The "repository" parameter
is now a repository object instead of the repository name, thus we don't have to pass the "trac"
object in separately. Also added an assertion to see if the given repository is in iteration.revision,
and another assertion that, if the previousIteration is non-null, the given repository is in
previousIteration.revision.
(BuildbotQueueView.prototype.revisionContentForIteration): Refactored to work more generically
with repositories other than "openSource" and "internal". Also added an assertion that the returned
fragment has at least one child node.

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

4 years agoCachedResource leak in validation code
antti@apple.com [Wed, 12 Aug 2015 21:07:49 +0000 (21:07 +0000)]
CachedResource leak in validation code
https://bugs.webkit.org/show_bug.cgi?id=147941

Reviewed by Chris Dumez.

Source/WebCore:

While adding test coverage I discovered a way to hit ASSERT(!resource->m_proxyResource) in CachedResource::setResourceToRevalidate.
I think this ends up leaking a resource too.

Test: http/tests/cache/recursive-validation.html

* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient):

    Tighten the condition.

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setResourceToRevalidate):
(WebCore::CachedResource::clearResourceToRevalidate):

    Replace workaround for this bug with an assert.

* loader/cache/CachedResource.h:
(WebCore::CachedResource::validationInProgress):
(WebCore::CachedResource::validationCompleting):
(WebCore::CachedResource::didSendData):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy):

    Fix the bug by using (instead of revalidating) resource that we are just finishing revalidating.
    This can happen when a succesful revalidation synchronously triggers another load for the same resource.

LayoutTests:

* http/tests/cache/recursive-validation.html: Added.
* http/tests/cache/resources/no-cache-with-validation.php: Added.

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

4 years agoDFG::ByteCodeParser should attempt constant folding on loads from structures that...
fpizlo@apple.com [Wed, 12 Aug 2015 21:01:15 +0000 (21:01 +0000)]
DFG::ByteCodeParser should attempt constant folding on loads from structures that are DFG-watchable
https://bugs.webkit.org/show_bug.cgi?id=147950

Reviewed by Michael Saboff.

Previously we reduced the constant folding power of ByteCodeParser::load() because that code was
responsible for memory corruption, since it would sometimes install watchpoints on structures that
weren't being traced.  It seemed like the safest fix was to remove the constant folding rule
entirely since later phases also do constant folding, and they do it without introducing the bug.
Well, that change (http://trac.webkit.org/changeset/188292) caused a big regression, because we
still have some constant folding rules that only exist in ByteCodeParser, and so ByteCodeParser must
be maximally aggressive in constant-folding whenever possible.

So, this change now brings back that constant folding rule - for loads from object constants that
have DFG-watchable structures - and implements it properly, by ensuring that we only call into
tryGetConstantProperty() if we have registered the structure set.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::load):

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

4 years agoNeed to add stubs to enumerateDevices
mdaiter@apple.com [Wed, 12 Aug 2015 20:51:57 +0000 (20:51 +0000)]
Need to add stubs to enumerateDevices
https://bugs.webkit.org/show_bug.cgi?id=147903

Reviewed by Eric Carlson.

* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::enumerateDevices):
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::enumerateDevices):
* Modules/mediastream/UserMediaRequest.h:

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

4 years ago[ES6] Add ES6 Modules preparsing phase to collect the dependencies
utatane.tea@gmail.com [Wed, 12 Aug 2015 20:38:45 +0000 (20:38 +0000)]
[ES6] Add ES6 Modules preparsing phase to collect the dependencies
https://bugs.webkit.org/show_bug.cgi?id=147353

Reviewed by Geoffrey Garen.

This patch implements ModuleRecord and ModuleAnalyzer.
ModuleAnalyzer analyzes the produced AST from the parser.
By collaborating with the parser, ModuleAnalyzer collects the information
that is necessary to request the loading for the dependent modules and
construct module's environment and namespace object before executing the actual
module body.

In the parser, we annotate which variable is imported binding and which variable
is exported from the current module. This information is leveraged in the ModuleAnalyzer
to categorize the export entries.

To preparse the modules in the parser, we just add the new flag `ModuleParseMode`
instead of introducing a new TreeContext type. This is because only 2 users use the
parseModuleSourceElements; preparser and actual compiler. Adding the flag is simple
enough to switch the context to the SyntaxChecker when parsing the non-module related
statement in the preparsing phase.

To demonstrate the module analyzer, we added the new option dumpModuleRecord option
into the JSC shell. By specifying this, the result of analysis is dumped when the module
is parsed and analyzed.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinNames.h:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createExportDefaultDeclaration):
* parser/ModuleAnalyzer.cpp: Added.
(JSC::ModuleAnalyzer::ModuleAnalyzer):
(JSC::ModuleAnalyzer::exportedBinding):
(JSC::ModuleAnalyzer::declareExportAlias):
(JSC::ModuleAnalyzer::exportVariable):
(JSC::ModuleAnalyzer::analyze):
* parser/ModuleAnalyzer.h: Added.
(JSC::ModuleAnalyzer::vm):
(JSC::ModuleAnalyzer::moduleRecord):
* parser/ModuleRecord.cpp: Added.
(JSC::printableName):
(JSC::ModuleRecord::dump):
* parser/ModuleRecord.h: Added.
(JSC::ModuleRecord::ImportEntry::isNamespace):
(JSC::ModuleRecord::create):
(JSC::ModuleRecord::appendRequestedModule):
(JSC::ModuleRecord::addImportEntry):
(JSC::ModuleRecord::addExportEntry):
(JSC::ModuleRecord::addStarExportEntry):
* parser/NodeConstructors.h:
(JSC::ModuleDeclarationNode::ModuleDeclarationNode):
(JSC::ImportDeclarationNode::ImportDeclarationNode):
(JSC::ExportAllDeclarationNode::ExportAllDeclarationNode):
(JSC::ExportDefaultDeclarationNode::ExportDefaultDeclarationNode):
(JSC::ExportLocalDeclarationNode::ExportLocalDeclarationNode):
(JSC::ExportNamedDeclarationNode::ExportNamedDeclarationNode):
* parser/Nodes.h:
(JSC::ExportDefaultDeclarationNode::localName):
* parser/NodesAnalyzeModule.cpp: Added.
(JSC::ScopeNode::analyzeModule):
(JSC::SourceElements::analyzeModule):
(JSC::ImportDeclarationNode::analyzeModule):
(JSC::ExportAllDeclarationNode::analyzeModule):
(JSC::ExportDefaultDeclarationNode::analyzeModule):
(JSC::ExportLocalDeclarationNode::analyzeModule):
(JSC::ExportNamedDeclarationNode::analyzeModule):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseModuleSourceElements):
(JSC::Parser<LexerType>::parseVariableDeclarationList):
(JSC::Parser<LexerType>::createBindingPattern):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClassDeclaration):
(JSC::Parser<LexerType>::parseImportClauseItem):
(JSC::Parser<LexerType>::parseExportSpecifier):
(JSC::Parser<LexerType>::parseExportDeclaration):
* parser/Parser.h:
(JSC::Scope::lexicalVariables):
(JSC::Scope::declareLexicalVariable):
(JSC::Parser::declareVariable):
(JSC::Parser::exportName):
(JSC::Parser<LexerType>::parse):
(JSC::parse):
* parser/ParserModes.h:
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createExportDefaultDeclaration):
* parser/VariableEnvironment.cpp:
(JSC::VariableEnvironment::markVariableAsImported):
(JSC::VariableEnvironment::markVariableAsExported):
* parser/VariableEnvironment.h:
(JSC::VariableEnvironmentEntry::isExported):
(JSC::VariableEnvironmentEntry::isImported):
(JSC::VariableEnvironmentEntry::setIsExported):
(JSC::VariableEnvironmentEntry::setIsImported):
* runtime/CommonIdentifiers.h:
* runtime/Completion.cpp:
(JSC::checkModuleSyntax):
* runtime/Options.h:

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

4 years agoWeb Inspector: Not receiving responses for async request IndexedDB.requestDatabaseNames
commit-queue@webkit.org [Wed, 12 Aug 2015 20:20:37 +0000 (20:20 +0000)]
Web Inspector: Not receiving responses for async request IndexedDB.requestDatabaseNames
https://bugs.webkit.org/show_bug.cgi?id=147844

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-08-12
Reviewed by Brian Burg.

Source/WebKit2:

* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
(WebKit::WebIDBFactoryBackend::getDatabaseNames):
This method should not return without calling either the success
or error callbacks. In this case, it can succeed with an empty list.

LayoutTests:

* inspector/indexeddb/requestDatabaseNames-expected.txt: Added.
* inspector/indexeddb/requestDatabaseNames.html: Added.

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

4 years agoRe-land r188339, since Alex fixed it in r188341 by landing the WebCore half.
ggaren@apple.com [Wed, 12 Aug 2015 20:12:05 +0000 (20:12 +0000)]
Re-land r188339, since Alex fixed it in r188341 by landing the WebCore half.

* jit/ExecutableAllocator.h:
* jsc.cpp:
(GlobalObject::finishCreation):
(functionAddressOf):
(functionVersion):
(functionReleaseExecutableMemory): Deleted.
* runtime/VM.cpp:
(JSC::StackPreservingRecompiler::operator()):
(JSC::VM::throwException):
(JSC::VM::updateFTLLargestStackSize):
(JSC::VM::gatherConservativeRoots):
(JSC::VM::releaseExecutableMemory): Deleted.
(JSC::releaseExecutableMemory): Deleted.
* runtime/VM.h:
(JSC::VM::isCollectorBusy):
* runtime/Watchdog.cpp:
(JSC::Watchdog::setTimeLimit):

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

4 years agoAdd a tool that dumps class and struct member layout, showing padding
simon.fraser@apple.com [Wed, 12 Aug 2015 19:31:38 +0000 (19:31 +0000)]
Add a tool that dumps class and struct member layout, showing padding
https://bugs.webkit.org/show_bug.cgi?id=147898

Reviewed by Zalan Bujtas.

This 'dump-class-layout' script uses the lldb Python bindings to collect data
about data member layout, and displays it.

Sample output:

      +0 { 72} WTF::ListHashSet<WebCore::URL, WebCore::URLHash>::Node
      +0 < 56>     WebCore::URL m_value;
      +0 <  8>         WTF::String m_string;
      +0 <  8>             WTF::RefPtr<WTF::StringImpl> m_impl;
      +0 <  8>                 WTF::StringImpl * m_ptr;
      +8 <  1>         bool:1 m_isValid;
      +8 <  1>         bool:1 m_protocolIsInHTTPFamily;
      +9 <  3>         <PADDING>
     +12 <  4>         int m_schemeEnd;
     +16 <  4>         int m_userStart;
     +20 <  4>         int m_userEnd;
     +24 <  4>         int m_passwordEnd;
     +28 <  4>         int m_hostEnd;
     +32 <  4>         int m_portEnd;
     +36 <  4>         int m_pathAfterLastSlash;
     +40 <  4>         int m_pathEnd;
     +44 <  4>         int m_queryEnd;
     +48 <  4>         int m_fragmentEnd;
     +52 <  4>         <PADDING>
     +52 <  4>     <PADDING>
     +56 <  8>     WTF::ListHashSetNode<WebCore::URL> * m_prev;
     +64 <  8>     WTF::ListHashSetNode<WebCore::URL> * m_next;
    Total byte size: 72
    Total pad bytes: 11
    Padding percentage: 15.28 %

* Scripts/dump-class-layout: Added.
(webkit_build_dir):
(developer_dir):
(import_lldb):
(find_build_directory):
(verify_type):
(verify_type_recursive):
(dump_class):
(main):
(main.or):

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

4 years agoElement interaction should not be canceled when the menu is already being shown.
enrica@apple.com [Wed, 12 Aug 2015 19:29:29 +0000 (19:29 +0000)]
Element interaction should not be canceled when the menu is already being shown.
https://bugs.webkit.org/show_bug.cgi?id=147945
rdar://problem/22206433

Reviewed by Beth Dakin.

When preview is canceled by the action menu gesture, we should not stop interacting
with the element, since the information about the element is used for the menu actions.
We now expose a new method in the action sheet assistant to know if the action sheed is
being shown and we use this as an indication that we should not stop the interaction
with the element.

* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant isShowingSheet]): Added.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interactionStoppedFromPreviewItemController:]): Do not stop
the interaction if the sheet is being shown.

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

4 years agoFixed the Release build when MEDIA_SESSION is enabled.
mrajca@apple.com [Wed, 12 Aug 2015 19:23:03 +0000 (19:23 +0000)]
Fixed the Release build when MEDIA_SESSION is enabled.

WebCore:
* testing/Internals.cpp:
(WebCore::interruptingCategoryFromString):

WebKit2:
* UIProcess/API/C/WKPage.cpp:
(WKPageHandleMediaEvent):

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

4 years agoMedia Session: test Play/Pause media control events delivered to Default media sessions
mrajca@apple.com [Wed, 12 Aug 2015 19:23:00 +0000 (19:23 +0000)]
Media Session: test Play/Pause media control events delivered to Default media sessions
https://bugs.webkit.org/show_bug.cgi?id=147910

Reviewed by Eric Carlson.

Media elements that aren't explicitly assigned a media session should respond to play/pause media control events.

* media/session/play-pause-media-events-in-default-sessions-expected.txt: Added.
* media/session/play-pause-media-events-in-default-sessions.html: Added.

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

4 years agoMedia Session: add test for Content media session focus
mrajca@apple.com [Wed, 12 Aug 2015 19:22:58 +0000 (19:22 +0000)]
Media Session: add test for Content media session focus
https://bugs.webkit.org/show_bug.cgi?id=147902

Reviewed by Eric Carlson.

Playing a media element that belongs to a Content media session should pause other media elements that belong
to Content media sessions.

* media/session/content-session-focus-expected.txt: Added.
* media/session/content-session-focus.html: Added.

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