WebKit-https.git
6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 years agoMedia Session: notify the UI process when media controls are enabled/disabled
mrajca@apple.com [Wed, 12 Aug 2015 19:22:49 +0000 (19:22 +0000)]
Media Session: notify the UI process when media controls are enabled/disabled
https://bugs.webkit.org/show_bug.cgi?id=147802

Reviewed by Eric Carlson.

WebCore:
* Modules/mediasession/MediaRemoteControls.cpp:
(WebCore::MediaRemoteControls::MediaRemoteControls): Keep track of the parent session.
(WebCore::MediaRemoteControls::~MediaRemoteControls): Removed unnecessary line.
(WebCore::MediaRemoteControls::setPreviousTrackEnabled): Tell the session a control was enabled/disabled.
(WebCore::MediaRemoteControls::setNextTrackEnabled): Tell the session a control was enabled/disabled.
* Modules/mediasession/MediaRemoteControls.h:
(WebCore::MediaRemoteControls::create):
(WebCore::MediaRemoteControls::setPreviousTrackEnabled): Moved to implementation file.
(WebCore::MediaRemoteControls::setNextTrackEnabled): Moved to implementation file.
* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::MediaSession): Keep track of the remote controls' parent session.
(WebCore::MediaSession::controlIsEnabledDidChange): Propagate the new media state to the UI process.
* Modules/mediasession/MediaSession.h:
* dom/Document.cpp:
(WebCore::Document::updateIsPlayingMedia): Include whether we can skip to the previous/next track.
* page/MediaProducer.h:

WebKit2:
* UIProcess/WebMediaSessionFocusManager.cpp:
(WebKit::WebMediaSessionFocusManager::playbackAttributeDidChange): Generalized to take different attributes.
(WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange): Deleted.
* UIProcess/WebMediaSessionFocusManager.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange): Process new attributes for enabling/disabling media controls.

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

6 years agoRoll out r188339, which broke the build.
jhoneycutt@apple.com [Wed, 12 Aug 2015 19:16:49 +0000 (19:16 +0000)]
Roll out r188339, which broke the build.

Unreviewed.

* jit/ExecutableAllocator.h:
* jsc.cpp:
(GlobalObject::finishCreation):
(functionReleaseExecutableMemory):
* runtime/VM.cpp:
(JSC::StackPreservingRecompiler::visit):
(JSC::StackPreservingRecompiler::operator()):
(JSC::VM::releaseExecutableMemory):
(JSC::releaseExecutableMemory):
* runtime/VM.h:
* runtime/Watchdog.cpp:
(JSC::Watchdog::setTimeLimit):

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

6 years agoWeb Inspector: DOM Node should have context menu to scroll it into view on the inspec...
joepeck@webkit.org [Wed, 12 Aug 2015 19:03:12 +0000 (19:03 +0000)]
Web Inspector: DOM Node should have context menu to scroll it into view on the inspected page
https://bugs.webkit.org/show_bug.cgi?id=147913

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype._updateChildren.set continue):
(WebInspector.DOMTreeElement.prototype._populateNodeContextMenu):
Add a context menu item to scroll into view for element nodes.

(WebInspector.DOMTreeElement.prototype._scrollIntoView.resolvedNode.scrollIntoView):
(WebInspector.DOMTreeElement.prototype._scrollIntoView.resolvedNode):
(WebInspector.DOMTreeElement.prototype._scrollIntoView):
Call scrollIntoViewIfNeeded on the real Node.

* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline.prototype.populateContextMenu):
Remove unused parameter.

* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
Add context menu for Nodes in ObjectTrees.

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

6 years agoFix Debug CMake builds on Windows
achristensen@apple.com [Wed, 12 Aug 2015 19:00:48 +0000 (19:00 +0000)]
Fix Debug CMake builds on Windows
https://bugs.webkit.org/show_bug.cgi?id=147940

Reviewed by Chris Dumez.

.:

* Source/cmake/OptionsWindows.cmake:
Put 32-bit binaries in a bin32 subdirectory and 64-bit binaries in a bin64 subdirectory.

Source/JavaScriptCore:

* PlatformWin.cmake:
Copy the plist to the JavaScriptCore.resources directory.

Source/WebCore:

* PlatformWin.cmake:
Copy localized strings to the WebKit.resources directory.

Source/WebKit:

* PlatformWin.cmake:
We need /NODEFAULTLIB with the debug version of libraries, too.

Tools:

* DumpRenderTree/PlatformWin.cmake:
* TestWebKitAPI/PlatformWin.cmake:
The BitmapImage test is not enabled on the AppleWin port.
* WinLauncher/CMakeLists.txt:
Debug builds need /NODEFAULTLIB:MSVCRTD, too.

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

6 years agoUnreviewed build fix after r188339.
achristensen@apple.com [Wed, 12 Aug 2015 18:56:50 +0000 (18:56 +0000)]
Unreviewed build fix after r188339.

* bindings/js/GCController.cpp:
(WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
(WebCore::GCController::setJavaScriptGarbageCollectorTimerEnabled):
(WebCore::GCController::releaseExecutableMemory): Deleted.
* bindings/js/GCController.h:
Commit WebCore part of patch.

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

6 years agoREGRESSION(r185606): ASSERT in WebCore::RenderElement::styleWillChange
bfulgham@apple.com [Wed, 12 Aug 2015 18:54:05 +0000 (18:54 +0000)]
REGRESSION(r185606): ASSERT in WebCore::RenderElement::styleWillChange
https://bugs.webkit.org/show_bug.cgi?id=147596
<rdar://problem/21963355>

Reviewed by Jon Honeycutt.

Source/WebCore:

Only add (or remove) a RenderElement from the container of RenderBoxes with
scroll snap coordinates if the element actually is a RenderBox.

Tested by css3/scroll-snap/improper-snap-points-crash.html.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::willBeRemovedFromTree):

LayoutTests:

* css3/scroll-snap/improper-snap-points-crash-expected.txt: Added.
* css3/scroll-snap/improper-snap-points-crash.html: Added.

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

6 years agoRemove VM::releaseExecutableMemory
ggaren@apple.com [Wed, 12 Aug 2015 18:28:20 +0000 (18:28 +0000)]
Remove VM::releaseExecutableMemory
https://bugs.webkit.org/show_bug.cgi?id=147915

Reviewed by Saam Barati.

releaseExecutableMemory() was only used in one place, where discardAllCode()
would work just as well.

It's confusing to have two slightly different ways to discard code. Also,
releaseExecutableMemory() is unused in any production code, and it seems
to have bit-rotted.

* 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@188339 268f45cc-cd09-0410-ab3c-d52691b4dbfc

6 years agoAdd a JSC option to enable the watchdog for testing.
mark.lam@apple.com [Wed, 12 Aug 2015 18:14:02 +0000 (18:14 +0000)]
Add a JSC option to enable the watchdog for testing.
https://bugs.webkit.org/show_bug.cgi?id=147939

Reviewed by Michael Saboff.

* API/JSContextRef.cpp:
(JSContextGroupSetExecutionTimeLimit):
(createWatchdogIfNeeded): Deleted.
* runtime/Options.h:
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::~VM):
(JSC::VM::sharedInstanceInternal):
(JSC::VM::ensureWatchdog):
(JSC::thunkGeneratorForIntrinsic):
* runtime/VM.h:

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

6 years agoWeb Inspector: Implement selector highlighting for iOS
drousso@apple.com [Wed, 12 Aug 2015 17:53:55 +0000 (17:53 +0000)]
Web Inspector: Implement selector highlighting for iOS
https://bugs.webkit.org/show_bug.cgi?id=147919

Reviewed by Timothy Hatcher.

Source/WebCore:

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::getHighlight):
If the current highlight is a nodeList, generate highlights for each node in the list and
return the concatenated value of those highlights.

Source/WebKit2:

* UIProcess/WKInspectorHighlightView.mm:
(-[WKInspectorHighlightView _layoutForNodeHighlight:offset:]):
Added offset parameter to start drawing the highlight at that index of the highlight quad list.

(-[WKInspectorHighlightView _layoutForNodeListHighlight:]):
Loops through the highlight quads and draws a new highlight for every 4 highlight quad objects.

(-[WKInspectorHighlightView update:]):
Now uses the light highlighting for both nodes and lists of nodes.

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

6 years agoRemoved the executable bit from non-executable source.
mitz@apple.com [Wed, 12 Aug 2015 14:28:25 +0000 (14:28 +0000)]
Removed the executable bit from non-executable source.

* UserInterface/External/CodeMirror/LICENSE: Removed property svn:executable.
* UserInterface/External/CodeMirror/clojure.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/closebrackets.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/codemirror.css: Removed property svn:executable.
* UserInterface/External/CodeMirror/codemirror.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/coffeescript.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/comment.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/css.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/htmlmixed.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/javascript.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/livescript.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/matchbrackets.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/overlay.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/placeholder.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/runmode.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/sass.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/searchcursor.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/sql.js: Removed property svn:executable.
* UserInterface/External/CodeMirror/xml.js: Removed property svn:executable.

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

6 years agoUnreviewed. run-gtk-tests: Use a longer timeout for slow tests.
carlosgc@webkit.org [Wed, 12 Aug 2015 10:35:33 +0000 (10:35 +0000)]
Unreviewed. run-gtk-tests: Use a longer timeout for slow tests.

In r188125 I added a way to mark tests as slow to use a longer
timeout. But it seems it was not enough for
WTF_Lock.ContendedShortSection, so let's try again with a longer
timeout now.

* Scripts/run-gtk-tests:
(TestRunner._run_google_test):

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

6 years agoRemove promise attribute specific handling from binding generator
youenn.fablet@crf.canon.fr [Wed, 12 Aug 2015 10:33:41 +0000 (10:33 +0000)]
Remove promise attribute specific handling from binding generator
https://bugs.webkit.org/show_bug.cgi?id=147828

Reviewed by Darin Adler.

Reverting http://trac.webkit.org/changeset/184643, as CachedAttribute is used instead.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjConstructor): Deleted.
(WebCore::setJSTestObjConstructorStaticStringAttr): Deleted.
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj voidMethod]): Deleted.
(-[DOMTestObj voidMethodWithArgs:strArg:objArg:]): Deleted.
* bindings/scripts/test/TestObj.idl:

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

6 years agoXHR.setRequestHeader should remove trailing and leading whitespaces from the header...
youenn.fablet@crf.canon.fr [Wed, 12 Aug 2015 10:12:28 +0000 (10:12 +0000)]
XHR.setRequestHeader should remove trailing and leading whitespaces from the header value
https://bugs.webkit.org/show_bug.cgi?id=147445

Reviewed by Darin Adler.

Source/WebCore:

Covered by added and modifed tests.

* platform/network/HTTPParsers.h:
(WebCore::isHTTPSpace):
(WebCore::stripLeadingAndTrailingHTTPSpaces):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setRequestHeader): strip trailing and leading whitespace before testing for header value validity and storing.

LayoutTests:

* http/tests/xmlhttprequest/inject-header-expected.txt:
* http/tests/xmlhttprequest/inject-header.html:
* http/tests/xmlhttprequest/resources/print-xtest-header.cgi: Added.
* http/tests/xmlhttprequest/set-bad-headervalue-expected.txt:
* http/tests/xmlhttprequest/set-bad-headervalue.html:
* http/tests/xmlhttprequest/setrequestheader-allow-whitespace-in-value-expected.txt: Added.
* http/tests/xmlhttprequest/setrequestheader-allow-whitespace-in-value.htm: Added.

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

6 years agoAllow --debug option in run-jsc
utatane.tea@gmail.com [Wed, 12 Aug 2015 07:29:33 +0000 (07:29 +0000)]
Allow --debug option in run-jsc
https://bugs.webkit.org/show_bug.cgi?id=147923

Reviewed by Csaba Osztrogonác.

When `--debug` option is specified in run-jsc, it runs the JSC shell built in the debug mode.

* Scripts/run-jsc:

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

6 years agoNetworkProcess: DNS prefetch happens in the Web Process
carlosgc@webkit.org [Wed, 12 Aug 2015 07:13:01 +0000 (07:13 +0000)]
NetworkProcess: DNS prefetch happens in the Web Process
https://bugs.webkit.org/show_bug.cgi?id=147824

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Use FrameLoaderClient to do the DNS prefetch.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
* loader/FrameLoaderClient.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):
* page/Chrome.cpp:
(WebCore::Chrome::mouseDidMoveOverElement):

Source/WebKit2:

DNS prefetch requests started in the WebProcess should be sent to
the network process when it's enabled.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::prefetchDNS): Do the
actual DNS prefetch.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in: Add
PrefetchDNS message.
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
(webkitWebExtensionDidReceiveMessage): Use WebProcess::prefetchDNS().
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::prefetchDNS): Ditto.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary): Use
FrameLoaderClient to do the DNS prefetch.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::prefetchDNS): Send the request to the network
process if it's enabled, otherwise do the actual DNS prefetch.
* WebProcess/WebProcess.h:

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

6 years agoWeb Inspector: TimelineView data not cleared when recording is reset
mattbaker@apple.com [Wed, 12 Aug 2015 06:05:08 +0000 (06:05 +0000)]
Web Inspector: TimelineView data not cleared when recording is reset
https://bugs.webkit.org/show_bug.cgi?id=147916

Reviewed by Timothy Hatcher.

Each derived timeline view maintains a separate array of timeline records. These weren't
cleared on reset, so switching to a timeline view after clearing the recording caused
the view to populate its tree outline.

* UserInterface/Views/LayoutTimelineView.js:
(WebInspector.LayoutTimelineView.set columns):
(WebInspector.LayoutTimelineView):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.set columns):
(WebInspector.NetworkTimelineView):
* UserInterface/Views/OverviewTimelineView.js:
(WebInspector.OverviewTimelineView.prototype.reset):
(WebInspector.OverviewTimelineView.prototype._processPendingRepresentedObjects):
* UserInterface/Views/RenderingFrameTimelineView.js:
(WebInspector.RenderingFrameTimelineView.prototype.reset):
* UserInterface/Views/ScriptTimelineView.js:
(WebInspector.ScriptTimelineView.prototype.reset):

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

6 years agoImplementation JavaScript watchdog using WTF::WorkQueue.
mark.lam@apple.com [Wed, 12 Aug 2015 05:56:20 +0000 (05:56 +0000)]
Implementation JavaScript watchdog using WTF::WorkQueue.
https://bugs.webkit.org/show_bug.cgi?id=147107

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

How the Watchdog works?
======================

1. When do we start the Watchdog?
   =============================
   The watchdog should only be started if both the following conditions are true:
   1. A time limit has been set.
   2. We have entered the VM.

2. CPU time vs Wall Clock time
   ===========================
   Why do we need 2 time deadlines: m_cpuDeadline and m_wallClockDeadline?

   The watchdog uses WorkQueue dispatchAfter() to queue a timer to measure the watchdog time
   limit. WorkQueue timers measure time in monotonic wall clock time. m_wallClockDeadline
   indicates the wall clock time point when the WorkQueue timer is expected to fire.

   The time limit for which we allow JS code to run should be measured in CPU time, which can
   differ from wall clock time.  m_cpuDeadline indicates the CPU time point when the watchdog
   should fire.

   Note: the timer firing is not the same thing as the watchdog firing.  When the timer fires,
   we need to check if m_cpuDeadline has been reached.

   If m_cpuDeadline has been reached, the watchdog is considered to have fired.

   If not, then we have a remaining amount of CPU time, Tremainder, that we should allow JS
   code to continue to run for.  Hence, we need to start a new timer to fire again after
   Tremainder microseconds.

   See Watchdog::didFireSlow().

3. Spurious wake ups
   =================
   Because the WorkQueue timer cannot be cancelled, the watchdog needs to ignore stale timers.
   It does this by checking the m_wallClockDeadline.  A wakeup that occurs right after
   m_wallClockDeadline expires is considered to be the wakeup for the active timer.  All other
   wake ups are considered to be spurious and will be ignored.

   See Watchdog::didFireSlow().

4. Minimizing Timer creation cost
   ==============================
   Conceptually, we could start a new timer every time we start the watchdog. But we can do better
   than this.

   In practice, the time limit of a watchdog tends to be long, and the amount of time a watchdog
   stays active tends to be short for well-behaved JS code. The user also tends to re-use the same
   time limit. Consider the following example:

       |---|-----|---|----------------|---------|
       t0  t1    t2  t3            t0 + L    t2 + L

       |<--- T1 --------------------->|
                 |<--- T2 --------------------->|
       |<-- Td ->|                    |<-- Td ->|

   1. The user initializes the watchdog with time limit L.
   2. At t0, we enter the VM to execute JS code, and starts the watchdog timer, T1.
      The timer is set to expire at t0 + L.
   3. At t1, we exit the VM.
   4. At t2, we enter the VM again, and would like to start a new watchdog timer, T2.

      However, we can note that the expiration time for T2 would be after the expiration time
      of T1. Specifically, T2 would have expired at Td after T1 expires.

      Hence, we can just wait for T1 to expire, and then start a new timer T2' at time t0 + L
      for a period or Td instead.

   Note that didFireSlow() already compensates for time differences between wall clock and CPU time,
   as well as handle spurious wake ups (see note 2 and 3 above).  As a result, didFireSlow() will
   automatically take care of starting a new timer for the difference Td in the example above.
   Instead of starting the new timer T2 and time t2, we just verify that if the active timer, T1's
   expiration is less than T2s, then we are already covered by T1 and there's no need to start T2.

   The benefit:

   1. we minimize the number of timer instances we have queued in the workqueue at the same time
      (ideally only 1 or 0), and use less peak memory usage.

   2. we minimize the frequency of instantiating timer instances. By waiting for the current
      active timer to expire first, on average, we get to start one timer per time limit
      (which is infrequent because time limits tend to be long) instead of one timer per
      VM entry (which tends to be frequent).

   See Watchdog::startTimer().

* API/JSContextRef.cpp:
(createWatchdogIfNeeded):
(JSContextGroupClearExecutionTimeLimit):
- No need to create the watchdog (if not already created) just to clear it.
  If the watchdog is not created yet, then it is effectively cleared.

* API/tests/ExecutionTimeLimitTest.cpp:
(currentCPUTimeAsJSFunctionCallback):
(testExecutionTimeLimit):
(currentCPUTime): Deleted.
* API/tests/testapi.c:
(main):
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj:
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj.filters:
- Enable watchdog tests for all platforms.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
- Remove now unneeded WatchdogMac.cpp and WatchdogNone.cpp.

* PlatformEfl.cmake:

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGSpeculativeJIT32_64.cpp:
* dfg/DFGSpeculativeJIT64.cpp:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_loop_hint):
(JSC::JIT::emitSlow_op_loop_hint):
* jit/JITOperations.cpp:
* llint/LLIntOffsetsExtractor.cpp:
* llint/LLIntSlowPaths.cpp:
* runtime/VM.cpp:
- #include Watchdog.h in these files directly instead of doing it via VM.h.
  These saves us from having to recompile the world when we change Watchdog.h.

* runtime/VM.h:
- See comment in Watchdog::startTimer() below for why the Watchdog needs to be
  thread-safe ref counted.

* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::~VMEntryScope):
- We have done away with the WatchdogScope and arming/disarming of the watchdog.
  Instead, the VMEntryScope will inform the watchdog of when we have entered and
  exited the VM.

* runtime/Watchdog.cpp:
(JSC::currentWallClockTime):
(JSC::Watchdog::Watchdog):
(JSC::Watchdog::hasStartedTimer):
(JSC::Watchdog::setTimeLimit):
(JSC::Watchdog::didFireSlow):
(JSC::Watchdog::hasTimeLimit):
(JSC::Watchdog::fire):
(JSC::Watchdog::enteredVM):
(JSC::Watchdog::exitedVM):

(JSC::Watchdog::startTimer):
- The Watchdog is now thread-safe ref counted because the WorkQueue may access it
  (from a different thread) even after the VM shuts down.  We need to keep it
  alive until the WorkQueue callback completes.

  In Watchdog::startTimer(), we'll ref the Watchdog to keep it alive for each
  WorkQueue callback we dispatch.  The callback will deref the Watchdog after it
  is done with it.  This ensures that the Watchdog is kept alive until all
  WorkQueue callbacks are done.

(JSC::Watchdog::stopTimer):
(JSC::Watchdog::~Watchdog): Deleted.
(JSC::Watchdog::didFire): Deleted.
(JSC::Watchdog::isEnabled): Deleted.
(JSC::Watchdog::arm): Deleted.
(JSC::Watchdog::disarm): Deleted.
(JSC::Watchdog::startCountdownIfNeeded): Deleted.
(JSC::Watchdog::startCountdown): Deleted.
(JSC::Watchdog::stopCountdown): Deleted.
* runtime/Watchdog.h:
(JSC::Watchdog::didFire):
(JSC::Watchdog::timerDidFireAddress):
(JSC::Watchdog::isArmed): Deleted.
(JSC::Watchdog::Scope::Scope): Deleted.
(JSC::Watchdog::Scope::~Scope): Deleted.
* runtime/WatchdogMac.cpp:
(JSC::Watchdog::initTimer): Deleted.
(JSC::Watchdog::destroyTimer): Deleted.
(JSC::Watchdog::startTimer): Deleted.
(JSC::Watchdog::stopTimer): Deleted.
* runtime/WatchdogNone.cpp:
(JSC::Watchdog::initTimer): Deleted.
(JSC::Watchdog::destroyTimer): Deleted.
(JSC::Watchdog::startTimer): Deleted.
(JSC::Watchdog::stopTimer): Deleted.

Source/WebCore:

No new tests because we're not introducing any behavior change to WebCore here.
We're only #include'ing Watchdog.h directly instead of going through VM.h.

* ForwardingHeaders/runtime/Watchdog.h: Added.
* PlatformEfl.cmake:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* bindings/js/JSEventListener.cpp:
* bindings/js/WorkerScriptController.cpp:

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

6 years agoWeb Inspector: Dragging a timeline ruler handle when both handles clamped is broken
mattbaker@apple.com [Wed, 12 Aug 2015 05:54:14 +0000 (05:54 +0000)]
Web Inspector: Dragging a timeline ruler handle when both handles clamped is broken
https://bugs.webkit.org/show_bug.cgi?id=147912

Reviewed by Timothy Hatcher.

When clamped handles overlap, the handle nearest in time to the ruler's edge should be visible and
clickable, and the other should be hidden. This change ensures that clicking and dragging a ruler
handle to modify a selection outside the visible area works correctly.

* UserInterface/Views/TimelineOverview.css:
(.timeline-overview.frames > .timeline-ruler:not(.both-handles-clamped) > .selection-handle.right):
Style adjustment for rendering frames, which offsets the right handle by 5px instead of 4px.
(.timeline-overview.frames > .timeline-ruler:not(.both-handles-clamped) > .shaded-area.right):
Style adjustment for rendering frames, which offsets the right shaded area by 1px.
(.timeline-overview.frames > .timeline-ruler > .selection-handle.right): Deleted.
(.timeline-overview.frames > .timeline-ruler > .shaded-area.right): Deleted.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler.both-handles-clamped > .selection-handle):
Updated handle style when both are clamped.
(.timeline-ruler > .selection-handle.clamped.hidden):
Hide the clamped handle that is beneath the other clamped handle.

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype._updateSelection):

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

6 years agoFix test after build fix in r188286.
commit-queue@webkit.org [Wed, 12 Aug 2015 05:49:09 +0000 (05:49 +0000)]
Fix test after build fix in r188286.
https://bugs.webkit.org/show_bug.cgi?id=147907

Patch by Alex Christensen <achristensen@webkit.org> on 2015-08-11
Reviewed by Anders Carlsson.

* TestWebKitAPI/Tests/WTF/ParkingLot.cpp:
sleep_for can now be used, but we need to include <thread>

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

6 years agoWeb Inspector: Disabling attribute styles should not be possible
drousso@apple.com [Wed, 12 Aug 2015 05:45:49 +0000 (05:45 +0000)]
Web Inspector: Disabling attribute styles should not be possible
https://bugs.webkit.org/show_bug.cgi?id=147922

Reviewed by Timothy Hatcher.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection):
Increases the specificity of the if statement that adds rule disable state toggling to the icon.

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

6 years agoWeb Inspector: Update to CodeMirror 5.5 or later
drousso@apple.com [Wed, 12 Aug 2015 05:40:27 +0000 (05:40 +0000)]
Web Inspector: Update to CodeMirror 5.5 or later
https://bugs.webkit.org/show_bug.cgi?id=147109

Reviewed by Timothy Hatcher.

Updated CodeMirror to version 5.5, as well as the extension files for CodeMirror
that are currently used in WebInspector.

* Localizations/en.lproj/localizedStrings.js:
* Tools/PrettyPrinting/FormatterDebug.js:
Added WebInspector namespace for formatters.

* Tools/PrettyPrinting/index.html:
Added WebInspector namespace for formatters.

* UserInterface/External/CodeMirror/LICENSE:
* UserInterface/External/CodeMirror/clojure.js:
* UserInterface/External/CodeMirror/closebrackets.js:
* UserInterface/External/CodeMirror/codemirror.css:
* UserInterface/External/CodeMirror/codemirror.js:
* UserInterface/External/CodeMirror/coffeescript.js:
* UserInterface/External/CodeMirror/comment.js:
* UserInterface/External/CodeMirror/css.js:
* UserInterface/External/CodeMirror/htmlmixed.js:
* UserInterface/External/CodeMirror/javascript.js:
* UserInterface/External/CodeMirror/livescript.js:
* UserInterface/External/CodeMirror/matchbrackets.js:
* UserInterface/External/CodeMirror/overlay.js:
* UserInterface/External/CodeMirror/sass.js:
* UserInterface/External/CodeMirror/searchcursor.js:
* UserInterface/External/CodeMirror/sql.js:
* UserInterface/External/CodeMirror/xml.js:
* UserInterface/Views/CodeMirrorFormatters.js:
Now uses the new token in CodeMirror for media query parenthesis.

* UserInterface/Views/CSSStyleDeclarationTextEditor.css:
(.css-style-text-editor > .CodeMirror pre):
Removed the additional vertical padding.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype._handleMouseDown):
(WebInspector.CSSStyleDeclarationTextEditor.prototype._handleMouseUp):
Clicking on the end of a line in a style will now correctly insert a new line.

* UserInterface/Views/ComputedStyleDetailsPanel.css:
(.details-section > .content > .group > .row .CodeMirror-code pre .go-to-arrow):
The go-to arrow now has the proper dimensions.

* UserInterface/Views/HoverMenu.css:
(.hover-menu > img):
* UserInterface/Views/SourceCodeTextEditor.css:
(.hover-menu.color > img):

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

6 years ago[iOS WK2] ASSERT(!m_properties.backingStore || owner()) sometimes on zooming
simon.fraser@apple.com [Wed, 12 Aug 2015 04:58:37 +0000 (04:58 +0000)]
[iOS WK2] ASSERT(!m_properties.backingStore || owner()) sometimes on zooming
https://bugs.webkit.org/show_bug.cgi?id=147854

Reviewed by Tim Horton.

When destroying a TileGrid, the container layer remains alive by virtue of being
in the layer tree, and it and its tiles get visited during layer tree transaction
building but we assert because we've cleared the owner on the tile layers.

The real bug is that TileController doesn't tell GraphicsLayerCA when the custom
sublayers change. Make this possible via a new PlatformCALayerClient function,
and make TileController use this when rearranging its tile grids.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerCustomSublayersChanged):
(WebCore::GraphicsLayerCA::updateContentsScale): No need to explicitly set
the ChildrenChanged flag now.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerCustomSublayersChanged):
(WebCore::PlatformCALayerClient::platformCALayerLayerDidDisplay):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setNeedsDisplay):
(WebCore::TileController::setContentsScale):
(WebCore::TileController::setZoomedOutContentsScale):
(WebCore::TileController::revalidateTiles):
(WebCore::TileController::clearZoomedOutTileGrid):
(WebCore::TileController::tileGridsChanged):
(WebCore::TileController::tileRevalidationTimerFired):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.h: Default param.

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

6 years agoAlways use a byte-sized lock implementation
fpizlo@apple.com [Wed, 12 Aug 2015 04:20:24 +0000 (04:20 +0000)]
Always use a byte-sized lock implementation
https://bugs.webkit.org/show_bug.cgi?id=147908

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* runtime/ConcurrentJITLock.h: Lock is now byte-sized and ByteLock is gone, so use Lock.

Source/WTF:

At the start of my locking algorithm crusade, I implemented Lock, which is a sizeof(void*)
lock implementation with some nice theoretical properties and good performance. Then I added
the ParkingLot abstraction and ByteLock. ParkingLot uses Lock in its implementation.
ByteLock uses ParkingLot to create a sizeof(char) lock implementation that performs like
Lock.

It turns out that ByteLock is always at least as good as Lock, and sometimes a lot better:
it requires 8x less memory on 64-bit systems. It's hard to construct a benchmark where
ByteLock is significantly slower than Lock, and when you do construct such a benchmark,
tweaking it a bit can also create a scenario where ByteLock is significantly faster than
Lock.

So, the thing that we call "Lock" should really use ByteLock's algorithm, since it is more
compact and just as fast. That's what this patch does.

But we still need to keep the old Lock algorithm, because it's used to implement ParkingLot,
which in turn is used to implement ByteLock. So this patch does this transformation:

- Move the algorithm in Lock into files called WordLock.h|cpp. Make ParkingLot use
  WordLock.

- Move the algorithm in ByteLock into Lock.h|cpp. Make everyone who used ByteLock use Lock
  instead. All other users of Lock now get the byte-sized lock implementation.

- Remove the old ByteLock files.

* WTF.vcxproj/WTF.vcxproj:
* WTF.xcodeproj/project.pbxproj:
* benchmarks/LockSpeedTest.cpp:
(main):
* wtf/WordLock.cpp: Added.
(WTF::WordLock::lockSlow):
(WTF::WordLock::unlockSlow):
* wtf/WordLock.h: Added.
(WTF::WordLock::WordLock):
(WTF::WordLock::lock):
(WTF::WordLock::unlock):
(WTF::WordLock::isHeld):
(WTF::WordLock::isLocked):
* wtf/ByteLock.cpp: Removed.
* wtf/ByteLock.h: Removed.
* wtf/CMakeLists.txt:
* wtf/Lock.cpp:
(WTF::LockBase::lockSlow):
(WTF::LockBase::unlockSlow):
* wtf/Lock.h:
(WTF::LockBase::lock):
(WTF::LockBase::unlock):
(WTF::LockBase::isHeld):
(WTF::LockBase::isLocked):
(WTF::Lock::Lock):
* wtf/ParkingLot.cpp:

Tools:

All previous tests of Lock are now tests of WordLock. All previous tests of ByteLock are
now tests of Lock.

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

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

6 years agoDisconnect LayoutStateDisabler logic and RenderView pointer.
zalan@apple.com [Wed, 12 Aug 2015 03:41:40 +0000 (03:41 +0000)]
Disconnect LayoutStateDisabler logic and RenderView pointer.
https://bugs.webkit.org/show_bug.cgi?id=147906

Reviewed by Simon Fraser.

LayoutStateDisabler should disable layout state unconditionally.
The only place where it was actually conditional was the subtree layout branch.
Create a dedicated SubtreeLayoutStateMaintainer to manage the subtree layout case.

No change in behaviour.

* page/FrameView.cpp:
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
(WebCore::FrameView::layout):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateFirstLetterStyle):
(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::repaintOverhangingFloats):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::repaintRectangleInRegions):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::layout):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
* rendering/RenderMediaControlElements.cpp:
(WebCore::RenderMediaVolumeSliderContainer::layout):
(WebCore::RenderMediaControlTimelineContainer::layout):
(WebCore::RenderTextTrackContainerElement::layout):
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::populate):
(WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
* rendering/RenderView.h:
(WebCore::LayoutStateDisabler::LayoutStateDisabler):
(WebCore::LayoutStateDisabler::~LayoutStateDisabler):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):

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

6 years agoWeb Inspector: Add the ability to filter out tasks in the Rendering Frames timeline
mattbaker@apple.com [Wed, 12 Aug 2015 03:16:15 +0000 (03:16 +0000)]
Web Inspector: Add the ability to filter out tasks in the Rendering Frames timeline
https://bugs.webkit.org/show_bug.cgi?id=147389

Reviewed by Timothy Hatcher.

Added filtering by task type to the Rendering Frames timeline view. Legend item checkboxes
in the timeline sidebar toggle filtering for the corresponding task. The "Other" category
cannot be filtered, since all rendering frame records include some "other" time in addition to
child records from at least one additional task type.

A row is filtered (hidden) from the data grid when the corresponding rendering frame has no
unfiltered child records.

* UserInterface/Base/Main.js:
(WebInspector._windowFocused):
(WebInspector._windowBlurred):
Added inactive style for docked window.

* UserInterface/Views/ChartDetailsSectionRow.css:
(.details-section > .content > .group > .row.chart > .chart-content > .legend > .legend-item > label > .color-key):
(.details-section > .content > .group > .row.chart > .chart-content > .legend > .legend-item > label):
(.details-section > .content > .group > .row.chart > .chart-content > .legend > .legend-item > label > input[type=checkbox]):
(body.window-inactive .details-section > .content > .group > .row.chart > .chart-content > .legend > .legend-item > label > input[type=checkbox]):
(.details-section > .content > .group > .row.chart > .defs-only):
(.details-section > .content > .group > .row.chart > .chart-content > .legend > .legend-item > .label > .color-swatch): Deleted.
(.details-section > .content > .group > .row.chart > .chart-content > .legend > .legend-item > .label): Deleted.
Switched to label elements, added checkbox styles, and updated color swatch style for non-checkbox items.

* UserInterface/Views/ChartDetailsSectionRow.js:
(WebInspector.ChartDetailsSectionRow):
Added svg filter container and style sheet element.
(WebInspector.ChartDetailsSectionRow.prototype.set data):
(WebInspector.ChartDetailsSectionRow.prototype._createLegend.createGammaPrimitive):
(WebInspector.ChartDetailsSectionRow.prototype._createLegend.createCheckboxFilterElement):
Helper function to create an svg:filter to blend legend key color over the native checkbox element.
Filter assumes grayscale input, and each checkbox requires a separate filter.
(WebInspector.ChartDetailsSectionRow.prototype._createLegend):
Creates legend items, svg filters, and checkbox style sheet.
(WebInspector.ChartDetailsSectionRow.prototype._legendItemCheckboxValueChanged):
Repackage and forward checkbox changed event.
(WebInspector.ChartDetailsSectionRow.prototype._createLegendItem): Deleted.
Logic moved to WebInspector.ChartDetailsSectionRow.prototype._createLegend.

* UserInterface/Views/TimelineSidebarPanel.js:
Added set of rendering frame task types against which tree elements can be filtered.
(WebInspector.TimelineSidebarPanel.prototype.matchTreeElementAgainstCustomFilters):
If filter is not empty, check ancestor rendering frame record for unfiltered data.
(WebInspector.TimelineSidebarPanel.prototype._frameSelectionLegendItemChecked):
Update task filter in response when legend items are checked/unchecked.

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

6 years agoFix ViewportConfiguration dumping.
simon.fraser@apple.com [Wed, 12 Aug 2015 02:35:34 +0000 (02:35 +0000)]
Fix ViewportConfiguration dumping.

ViewportConfiguration::dump() was dumping parameters.width as parameters.initialScale.

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfigurationTextStream::operator<<):

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

6 years ago[font-features] Map OpenType feature tags to TrueType feature selectors
mmaxfield@apple.com [Wed, 12 Aug 2015 01:59:41 +0000 (01:59 +0000)]
[font-features] Map OpenType feature tags to TrueType feature selectors
https://bugs.webkit.org/show_bug.cgi?id=147819

Reviewed by Dean Jackson.

Source/WebCore:

Allow uses of font-feature-settings even on TrueType fonts.

Test: css3/font-feature-settings-preinstalled-fonts.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::appendRawTrueTypeFeature):
(WebCore::appendTrueTypeFeature):

LayoutTests:

Updated test results.

* platform/mac/css3/font-feature-settings-preinstalled-fonts-expected.png: Added.
* platform/mac/css3/font-feature-settings-preinstalled-fonts-expected.txt:

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

6 years agoTry to fix the EFL build after r188279
gyuyoung.kim@webkit.org [Wed, 12 Aug 2015 01:46:06 +0000 (01:46 +0000)]
Try to fix the EFL build after r188279
https://bugs.webkit.org/show_bug.cgi?id=147917

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-08-11
Reviewed by Gyuyoung Kim.

Replaced the WKPageLoaderClient with variable name because it is removed in r188279.

* UIProcess/efl/PageLoadClientEfl.cpp:
(WebKit::PageLoadClientEfl::PageLoadClientEfl):
* UIProcess/efl/PagePolicyClientEfl.cpp:
(WebKit::PagePolicyClientEfl::PagePolicyClientEfl):

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

6 years agoReduce use of PassRefPtr in WebCore/css
gyuyoung.kim@webkit.org [Wed, 12 Aug 2015 01:12:58 +0000 (01:12 +0000)]
Reduce use of PassRefPtr in WebCore/css
https://bugs.webkit.org/show_bug.cgi?id=147821

Reviewed by Daniel Bates.

Use RefPtr when returning nullptr or RefPtr, if not, use Ref.

* css/CSSBasicShapes.cpp:
(WebCore::buildSerializablePositionOffset):
(WebCore::CSSBasicShapeCircle::cssText):
(WebCore::CSSBasicShapeEllipse::cssText):
* css/CSSBasicShapes.h:
* css/CSSCalculationValue.cpp:
(WebCore::determineCategory):
(WebCore::CSSCalcExpressionNodeParser::parseCalc):
(WebCore::createBlendHalf):
(WebCore::createCSS):
* css/CSSCanvasValue.cpp:
(WebCore::CSSCanvasValue::image):
* css/CSSCanvasValue.h:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::positionOffsetValue):
(WebCore::ComputedStyleExtractor::currentColorOrValidColor):
(WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
(WebCore::counterToCSSValue):
(WebCore::zoomAdjustedPaddingOrMarginPixelValue):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
(WebCore::computeRenderStyleForProperty):
(WebCore::valueForItemPositionWithOverflowAlignment):
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValueInternal):
(WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
* css/CSSComputedStyleDeclaration.h:
* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::image):
(WebCore::CSSCrossfadeValue::blend):
* css/CSSCrossfadeValue.h:
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::image):
* css/CSSFilterImageValue.h:
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::image):
(WebCore::CSSGradientValue::gradientWithStylesResolved):
(WebCore::CSSLinearGradientValue::createGradient):
(WebCore::CSSRadialGradientValue::createGradient):
* css/CSSGradientValue.h:
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::cloneForCSSOM):
* css/CSSImageSetValue.h:
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::cloneForCSSOM):
* css/CSSImageValue.h:
* css/CSSParser.cpp:
(WebCore::CSSParser::parseRule):
(WebCore::CSSParser::parseKeyframeRule):
(WebCore::CSSParser::parseFontFaceValue):
(WebCore::CSSParser::parseValidPrimitive):
(WebCore::CSSParser::parseContentDistributionOverflowPosition):
(WebCore::CSSParser::parseAttr):
(WebCore::CSSParser::parseBackgroundColor):
(WebCore::CSSParser::parsePositionX):
(WebCore::CSSParser::parsePositionY):
(WebCore::CSSParser::parseFillPositionComponent):
(WebCore::CSSParser::parseFillSize):
(WebCore::CSSParser::parseAnimationDelay):
(WebCore::CSSParser::parseAnimationDirection):
(WebCore::CSSParser::parseAnimationDuration):
(WebCore::CSSParser::parseAnimationFillMode):
(WebCore::CSSParser::parseAnimationIterationCount):
(WebCore::CSSParser::parseAnimationName):
(WebCore::CSSParser::parseAnimationPlayState):
(WebCore::CSSParser::parseAnimationTrigger):
(WebCore::CSSParser::parseAnimationProperty):
(WebCore::CSSParser::parseAnimationTimingFunction):
(WebCore::CSSParser::parseGridPosition):
(WebCore::gridMissingGridPositionValue):
(WebCore::CSSParser::parseGridTrackList):
(WebCore::CSSParser::parseGridTrackSize):
(WebCore::CSSParser::parseGridBreadth):
(WebCore::CSSParser::parseGridAutoFlow):
(WebCore::CSSParser::parseGridTemplateAreas):
(WebCore::CSSParser::parseCounterContent):
(WebCore::CSSParser::parseInsetRoundedCorners):
(WebCore::CSSParser::parseBasicShapeInset):
(WebCore::CSSParser::parseShapeRadius):
(WebCore::CSSParser::parseBasicShapeCircle):
(WebCore::CSSParser::parseBasicShapeEllipse):
(WebCore::CSSParser::parseBasicShapePolygon):
(WebCore::CSSParser::parseBasicShapeAndOrBox):
(WebCore::CSSParser::parseShapeProperty):
(WebCore::CSSParser::parseClipPath):
(WebCore::CSSParser::parseBasicShape):
(WebCore::CSSParser::parseFontFamily):
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::parseShadow):
(WebCore::CSSParser::parseImageResolution):
(WebCore::CSSParser::parseImageSet):
(WebCore::CSSParser::parseTransform):
(WebCore::CSSParser::parseTransformValue):
(WebCore::CSSParser::parseBuiltinFilterArguments):
(WebCore::CSSParser::parseTextIndent):
(WebCore::CSSParser::createImportRule):
(WebCore::CSSParser::createMediaRule):
(WebCore::CSSParser::createEmptyMediaRule):
(WebCore::CSSParser::createSupportsRule):
(WebCore::CSSParser::popSupportsRuleData):
(WebCore::CSSParser::createKeyframesRule):
(WebCore::CSSParser::createStyleRule):
(WebCore::CSSParser::createFontFaceRule):
(WebCore::CSSParser::createPageRule):
(WebCore::CSSParser::createRegionRule):
(WebCore::CSSParser::createKeyframe):
* css/CSSParser.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
* css/CSSPrimitiveValue.h:
* css/CSSStyleDeclaration.h:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::rules):
(WebCore::CSSStyleSheet::cssRules):
* css/CSSStyleSheet.h:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::styleImage):
* css/CSSToStyleMap.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
* css/CSSValueList.cpp:
(WebCore::CSSValueList::cloneForCSSOM):
* css/CSSValueList.h:
* css/MediaList.h:
(WebCore::MediaQuerySet::copy):
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::matchMedia):
* css/MediaQueryMatcher.h:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
* css/PropertySetCSSStyleDeclaration.h:
* css/RGBColor.cpp:
(WebCore::RGBColor::red):
(WebCore::RGBColor::green):
(WebCore::RGBColor::blue):
(WebCore::RGBColor::alpha):
* css/RGBColor.h:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::glyphOrientationToCSSPrimitiveValue):
(WebCore::strokeDashArrayToCSSValueList):
(WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGStrokeDasharray):
(WebCore::CSSParser::parseSVGPaint):
(WebCore::CSSParser::parseSVGColor):
(WebCore::CSSParser::parsePaintOrder):
* css/WebKitCSSFilterValue.cpp:
(WebCore::WebKitCSSFilterValue::cloneForCSSOM):
* css/WebKitCSSFilterValue.h:
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::multiply):
(WebCore::WebKitCSSMatrix::inverse):
(WebCore::WebKitCSSMatrix::translate):
(WebCore::WebKitCSSMatrix::scale):
(WebCore::WebKitCSSMatrix::rotate):
(WebCore::WebKitCSSMatrix::rotateAxisAngle):
(WebCore::WebKitCSSMatrix::skewX):
(WebCore::WebKitCSSMatrix::skewY):
* css/WebKitCSSMatrix.h:
* css/WebKitCSSTransformValue.cpp:
(WebCore::WebKitCSSTransformValue::cloneForCSSOM):
* css/WebKitCSSTransformValue.h:

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

6 years agoMake ASan build not depend on asan.xcconfig
ap@apple.com [Tue, 11 Aug 2015 23:50:02 +0000 (23:50 +0000)]
Make ASan build not depend on asan.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=147840
rdar://problem/21093702

Reviewed by Daniel Bates.

Source/JavaScriptCore:

* dfg/DFGOSREntry.cpp:
(JSC::DFG::OSREntryData::dump):
(JSC::DFG::prepareOSREntry):
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::genericAddPointer):
(JSC::ConservativeRoots::genericAddSpan):
* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::removeThreadIfFound):
(JSC::MachineThreads::gatherFromCurrentThread):
(JSC::MachineThreads::Thread::captureStack):
(JSC::copyMemory):
* interpreter/Register.h:
(JSC::Register::operator=):
(JSC::Register::asanUnsafeJSValue):
(JSC::Register::jsValue):

Tools:

* asan/asan.xcconfig:
* asan/webkit-asan-ignore.txt: Removed. It's no longer needed, as unsafe functions
are now marked in source code.

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

6 years agoUnreviewed, shorten another test since it timed out.
fpizlo@apple.com [Tue, 11 Aug 2015 23:36:30 +0000 (23:36 +0000)]
Unreviewed, shorten another test since it timed out.

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

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

6 years agoFix names of Lock tests: should be "Contended", not "Contented".
mark.lam@apple.com [Tue, 11 Aug 2015 23:23:16 +0000 (23:23 +0000)]
Fix names of Lock tests: should be "Contended", not "Contented".
https://bugs.webkit.org/show_bug.cgi?id=147905

Reviewed by Saam Barati.

We're testing the behavior of lock contention (i.e. when threads contend), not
whether the locks are happy (contented).

* Scripts/run-gtk-tests:
(TestRunner):
(TestRunner.__init__): Deleted.
* TestWebKitAPI/Tests/WTF/Lock.cpp:
(TestWebKitAPI::runLockTest):
(TestWebKitAPI::TEST):

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

6 years agoUpdate WinCairoRequirements to VS2015.
achristensen@apple.com [Tue, 11 Aug 2015 23:17:03 +0000 (23:17 +0000)]
Update WinCairoRequirements to VS2015.

* Scripts/update-webkit-wincairo-libs:
Update WinCairoRequirements location.

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

6 years agoWindows test gardening.
simon.fraser@apple.com [Tue, 11 Aug 2015 23:10:07 +0000 (23:10 +0000)]
Windows test gardening.

* platform/win/TestExpectations:
* platform/win/css3/font-feature-settings-preinstalled-fonts-expected.txt: Added.
* platform/win/fast/forms/input-appearance-spinbutton-expected.txt: Added.
* platform/win/fast/forms/input-appearance-spinbutton-up-expected.txt: Added.

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

6 years agoMove CountQueuingStrategy and related to files to their correct place in the Xcode...
commit-queue@webkit.org [Tue, 11 Aug 2015 23:04:21 +0000 (23:04 +0000)]
Move CountQueuingStrategy and related to files to their correct place in the Xcode project
https://bugs.webkit.org/show_bug.cgi?id=147901

Patch by Sam Weinig <sam@webkit.org> on 2015-08-11
Reviewed by Anders Carlsson.

* WebCore.xcodeproj/project.pbxproj:

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

6 years agoUse more references in FrameView.
zalan@apple.com [Tue, 11 Aug 2015 23:00:00 +0000 (23:00 +0000)]
Use more references in FrameView.
https://bugs.webkit.org/show_bug.cgi?id=147899

Reviewed by Simon Fraser.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::flushCompositingStateForThisFrame):
(WebCore::FrameView::flushCompositingStateIncludingSubframes):
(WebCore::FrameView::addSlowRepaintObject):
(WebCore::FrameView::scrollElementToRect):
* page/FrameView.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeDestroyed):
* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::imageChanged):
* testing/Internals.cpp:
(WebCore::Internals::scrollElementToRect):

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

6 years agoSubstituted Dashboard.Repository.OpenSource.trac for webkitTrac and Dashboard.Reposit...
commit-queue@webkit.org [Tue, 11 Aug 2015 22:47:30 +0000 (22:47 +0000)]
Substituted Dashboard.Repository.OpenSource.trac for webkitTrac and Dashboard.Repository.Internal.trac
for internalTrac.
https://bugs.webkit.org/show_bug.cgi?id=147805

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

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
(BuildbotQueueView): Substituted Dashboard.Repository.OpenSource.trac for webkitTrac and
Dashboard.Repository.Internal.trac for internalTrac.
(BuildbotQueueView.prototype._appendPendingRevisionCount): Added local variables webkitTrac
and internalTrac for Dashboard.Repository.OpenSource.trac and Dashboard.Repository.Internal.trac,
respectively.
(BuildbotQueueView.prototype._presentPopoverForPendingCommits): Ditto.
(BuildbotQueueView.prototype.revisionContentForIteration): Substituted
Dashboard.Repository.OpenSource.trac for webkitTrac and Dashboard.Repository.Internal.trac for
internalTrac.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Initialization.js: Ditto.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Main.js: Ditto.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/MetricsAnalyzer.js:
(Analyzer): Ditto.
(Analyzer.prototype.analyze): Ditto.

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

6 years agoUnreviewed, gardening these tests to run faster so that they don't timeout on slower...
fpizlo@apple.com [Tue, 11 Aug 2015 22:39:51 +0000 (22:39 +0000)]
Unreviewed, gardening these tests to run faster so that they don't timeout on slower OSes.

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

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

6 years agoRemove ByteSpinLock
fpizlo@apple.com [Tue, 11 Aug 2015 22:04:20 +0000 (22:04 +0000)]
Remove ByteSpinLock
https://bugs.webkit.org/show_bug.cgi?id=147900

Rubber stamped by Mark Lam.

* WTF.xcodeproj/project.pbxproj:
* wtf/ByteSpinLock.h: Removed.

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

6 years ago[Win] Unreviewed build fix for VS2015 targets.
bfulgham@apple.com [Tue, 11 Aug 2015 22:02:18 +0000 (22:02 +0000)]
[Win] Unreviewed build fix for VS2015 targets.

* win/lib32/WebKitSystemInterface.lib: Update with VS2015 version of library.

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

6 years agoIntroduce get_by_id like IC into get_by_val when the given name is String or Symbol
utatane.tea@gmail.com [Tue, 11 Aug 2015 22:02:09 +0000 (22:02 +0000)]
Introduce get_by_id like IC into get_by_val when the given name is String or Symbol
https://bugs.webkit.org/show_bug.cgi?id=147480

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This patch adds get_by_id IC to get_by_val operation by caching the string / symbol id.
The IC site only caches one id. After checking that the given id is the same to the
cached one, we perform the get_by_id IC onto it.
And by collecting IC StructureStubInfo information, we pass it to the DFG and DFG
compiles get_by_val op code into CheckIdent (with edge type check) and GetById related
operations when the given get_by_val leverages the property load with the cached id.

To ensure the incoming value is the expected id, in DFG layer, we use SymbolUse and
StringIdentUse to enforce the type. To use it, this patch implements SymbolUse.
This can be leveraged to optimize symbol operations in DFG.

And since byValInfo is frequently used, we align the byValInfo design to the stubInfo like one.
Allocated by the Bag and operations take the raw byValInfo pointer directly instead of performing
binary search onto m_byValInfos. And by storing ArrayProfile* under the ByValInfo, we replaced the
argument ArrayProfile* in the operations with ByValInfo*.

* bytecode/ByValInfo.h:
(JSC::ByValInfo::ByValInfo):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::getByValInfoMap):
(JSC::CodeBlock::addByValInfo):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::getByValInfo): Deleted.
(JSC::CodeBlock::setNumberOfByValInfos): Deleted.
(JSC::CodeBlock::numberOfByValInfos): Deleted.
(JSC::CodeBlock::byValInfo): Deleted.
* bytecode/ExitKind.cpp:
(JSC::exitKindToString):
* bytecode/ExitKind.h:
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFor):
(JSC::GetByIdStatus::computeForStubInfo):
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
* bytecode/GetByIdStatus.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::observeUseKindOnNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasUidOperand):
(JSC::DFG::Node::uidOperand):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::SafeToExecuteEdge::operator()):
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCheckIdent):
(JSC::DFG::SpeculativeJIT::speculateSymbol):
(JSC::DFG::SpeculativeJIT::speculate):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGUseKind.cpp:
(WTF::printInternal):
* dfg/DFGUseKind.h:
(JSC::DFG::typeFilterFor):
(JSC::DFG::isCell):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCheckIdent):
(JSC::FTL::DFG::LowerDFGToLLVM::lowSymbol):
(JSC::FTL::DFG::LowerDFGToLLVM::speculate):
(JSC::FTL::DFG::LowerDFGToLLVM::isNotSymbol):
(JSC::FTL::DFG::LowerDFGToLLVM::speculateSymbol):
* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* jit/JIT.h:
(JSC::ByValCompilationInfo::ByValCompilationInfo):
(JSC::JIT::compileGetByValWithCachedId):
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_has_indexed_property):
(JSC::JIT::emitSlow_op_has_indexed_property):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_has_indexed_property):
(JSC::JIT::emitSlow_op_has_indexed_property):
* jit/JITOperations.cpp:
(JSC::getByVal):
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitGetByValWithCachedId):
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emitSlow_op_put_by_val):
(JSC::JIT::privateCompileGetByVal):
(JSC::JIT::privateCompileGetByValWithCachedId):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitGetByValWithCachedId):
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emitSlow_op_put_by_val):
* runtime/Symbol.h:
* tests/stress/get-by-val-with-string-constructor.js: Added.
(Hello):
(get Hello.prototype.generate):
(ok):
* tests/stress/get-by-val-with-string-exit.js: Added.
(shouldBe):
(getByVal):
(getStr1):
(getStr2):
* tests/stress/get-by-val-with-string-generated.js: Added.
(shouldBe):
(getByVal):
(getStr1):
(getStr2):
* tests/stress/get-by-val-with-string-getter.js: Added.
(object.get hello):
(ok):
* tests/stress/get-by-val-with-string.js: Added.
(shouldBe):
(getByVal):
(getStr1):
(getStr2):
* tests/stress/get-by-val-with-symbol-constructor.js: Added.
(Hello):
(get Hello.prototype.generate):
(ok):
* tests/stress/get-by-val-with-symbol-exit.js: Added.
(shouldBe):
(getByVal):
(getSym1):
(getSym2):
* tests/stress/get-by-val-with-symbol-getter.js: Added.
(object.get hello):
(.get ok):
* tests/stress/get-by-val-with-symbol.js: Added.
(shouldBe):
(getByVal):
(getSym1):
(getSym2):

LayoutTests:

Add synthetic benchmarks that replaces normal property load with symbol/string keyed load.

* js/regress/get-by-val-with-string-bimorphic-check-structure-elimination-expected.txt: Added.
* js/regress/get-by-val-with-string-bimorphic-check-structure-elimination-simple-expected.txt: Added.
* js/regress/get-by-val-with-string-bimorphic-check-structure-elimination-simple.html: Added.
* js/regress/get-by-val-with-string-bimorphic-check-structure-elimination.html: Added.
* js/regress/get-by-val-with-string-chain-from-try-block-expected.txt: Added.
* js/regress/get-by-val-with-string-chain-from-try-block.html: Added.
* js/regress/get-by-val-with-string-check-structure-elimination-expected.txt: Added.
* js/regress/get-by-val-with-string-check-structure-elimination.html: Added.
* js/regress/get-by-val-with-string-proto-or-self-expected.txt: Added.
* js/regress/get-by-val-with-string-proto-or-self.html: Added.
* js/regress/get-by-val-with-string-quadmorphic-check-structure-elimination-simple-expected.txt: Added.
* js/regress/get-by-val-with-string-quadmorphic-check-structure-elimination-simple.html: Added.
* js/regress/get-by-val-with-string-self-or-proto-expected.txt: Added.
* js/regress/get-by-val-with-string-self-or-proto.html: Added.
* js/regress/get-by-val-with-symbol-bimorphic-check-structure-elimination-expected.txt: Added.
* js/regress/get-by-val-with-symbol-bimorphic-check-structure-elimination-simple-expected.txt: Added.
* js/regress/get-by-val-with-symbol-bimorphic-check-structure-elimination-simple.html: Added.
* js/regress/get-by-val-with-symbol-bimorphic-check-structure-elimination.html: Added.
* js/regress/get-by-val-with-symbol-chain-from-try-block-expected.txt: Added.
* js/regress/get-by-val-with-symbol-chain-from-try-block.html: Added.
* js/regress/get-by-val-with-symbol-check-structure-elimination-expected.txt: Added.
* js/regress/get-by-val-with-symbol-check-structure-elimination.html: Added.
* js/regress/get-by-val-with-symbol-proto-or-self-expected.txt: Added.
* js/regress/get-by-val-with-symbol-proto-or-self.html: Added.
* js/regress/get-by-val-with-symbol-quadmorphic-check-structure-elimination-simple-expected.txt: Added.
* js/regress/get-by-val-with-symbol-quadmorphic-check-structure-elimination-simple.html: Added.
* js/regress/get-by-val-with-symbol-self-or-proto-expected.txt: Added.
* js/regress/get-by-val-with-symbol-self-or-proto.html: Added.
* js/regress/script-tests/get-by-val-with-string-bimorphic-check-structure-elimination-simple.js: Added.
* js/regress/script-tests/get-by-val-with-string-bimorphic-check-structure-elimination.js: Added.
* js/regress/script-tests/get-by-val-with-string-chain-from-try-block.js: Added.
(A):
(B):
(C):
(D):
(E):
(F):
(G):
(foo):
* js/regress/script-tests/get-by-val-with-string-check-structure-elimination.js: Added.
* js/regress/script-tests/get-by-val-with-string-proto-or-self.js: Added.
(foo):
(bar):
(Foo):
* js/regress/script-tests/get-by-val-with-string-quadmorphic-check-structure-elimination-simple.js: Added.
* js/regress/script-tests/get-by-val-with-string-self-or-proto.js: Added.
(foo):
(bar):
(Foo):
* js/regress/script-tests/get-by-val-with-symbol-bimorphic-check-structure-elimination-simple.js: Added.
* js/regress/script-tests/get-by-val-with-symbol-bimorphic-check-structure-elimination.js: Added.
* js/regress/script-tests/get-by-val-with-symbol-chain-from-try-block.js: Added.
(A):
(B):
(C):
(D):
(E):
(F):
(G):
(foo):
* js/regress/script-tests/get-by-val-with-symbol-check-structure-elimination.js: Added.
* js/regress/script-tests/get-by-val-with-symbol-proto-or-self.js: Added.
(foo):
(bar):
(Foo):
* js/regress/script-tests/get-by-val-with-symbol-quadmorphic-check-structure-elimination-simple.js: Added.
* js/regress/script-tests/get-by-val-with-symbol-self-or-proto.js: Added.
(foo):
(bar):
(Foo):

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

6 years agoInvalid FrameView::m_viewportRenderer after layout is finished.
zalan@apple.com [Tue, 11 Aug 2015 21:50:32 +0000 (21:50 +0000)]
Invalid FrameView::m_viewportRenderer after layout is finished.
https://bugs.webkit.org/show_bug.cgi?id=147848
rdar://problem/22205197

Reviewed by Simon Fraser.

We cache the current viewport renderer (FrameView::m_viewportRenderer) right before layout.
It gets dereferenced later when layout is finished to update the overflow status.
If the viewport renderer gets destroyed during layout, we end up with a dangling pointer.
This patch replaces the pointer caching with type caching (none, body, document).

Unable to construct a test case.

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

6 years agoTried again to fix the iOS build.
aestes@apple.com [Tue, 11 Aug 2015 21:42:05 +0000 (21:42 +0000)]
Tried again to fix the iOS build.

* UIProcess/ios/WKGeolocationProviderIOS.mm:
(-[WKGeolocationProviderIOS initWithProcessPool:]):

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

6 years agoDFG::ByteCodeParser shouldn't call tryGetConstantProperty() with some StructureSet...
fpizlo@apple.com [Tue, 11 Aug 2015 21:04:00 +0000 (21:04 +0000)]
DFG::ByteCodeParser shouldn't call tryGetConstantProperty() with some StructureSet if it isn't checking that the base has a structure in that StructureSet
https://bugs.webkit.org/show_bug.cgi?id=147891
rdar://problem/22129447

Reviewed by Mark Lam.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetByOffset): Get rid of this.
(JSC::DFG::ByteCodeParser::load): Don't call the version of handleGetByOffset() that assumes that we had CheckStructure'd some StructureSet, since we may not have CheckStructure'd anything.
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::assertIsRegistered): Make this always assert even before the StructureRegistrationPhase.
* dfg/DFGStructureRegistrationPhase.cpp:
(JSC::DFG::StructureRegistrationPhase::run): Add a FIXME that notes that we no longer believe that structures should be registered only at this phase. They should be registered before this phase and this phase should be removed.

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

6 years ago[Win] Switch Windows build to Visual Studio 2015
bfulgham@apple.com [Tue, 11 Aug 2015 21:02:46 +0000 (21:02 +0000)]
[Win] Switch Windows build to Visual Studio 2015
https://bugs.webkit.org/show_bug.cgi?id=147887
<rdar://problem/22235098>

Reviewed by Alex Christensen.

Update Visual Studio project file settings to use the current Visual
Studio and compiler. Continue targeting binaries to run on our minimum
supported configuration of Windows 7.

Source/JavaScriptCore:

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCoreGenerated.vcxproj:
* JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.vcxproj:
* JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/LLIntDesiredOffsets.vcxproj:
* JavaScriptCore.vcxproj/LLInt/LLIntOffsetsExtractor/LLIntOffsetsExtractor.vcxproj:
* JavaScriptCore.vcxproj/jsc/jsc.vcxproj:
* JavaScriptCore.vcxproj/jsc/jscLauncher.vcxproj:
* JavaScriptCore.vcxproj/libllvmForJSC/libllvmForJSC.vcxproj:
* JavaScriptCore.vcxproj/testRegExp/testRegExp.vcxproj:
* JavaScriptCore.vcxproj/testRegExp/testRegExpLauncher.vcxproj:
* JavaScriptCore.vcxproj/testapi/testapi.vcxproj:
* JavaScriptCore.vcxproj/testapi/testapiLauncher.vcxproj:

Source/ThirdParty:

* gtest/msvc/gtest-md.vcxproj:

Source/ThirdParty/ANGLE:

* ANGLE.vcxproj/libEGL.vcxproj:
* ANGLE.vcxproj/libGLESv2.vcxproj:
* ANGLE.vcxproj/preprocessor.vcxproj:
* ANGLE.vcxproj/translator_common.vcxproj:
* ANGLE.vcxproj/translator_glsl.vcxproj:
* ANGLE.vcxproj/translator_hlsl.vcxproj:

Source/WebCore:

No change in behavior, so no new tests.

* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCoreGenerated.vcxproj:
* WebCore.vcxproj/WebCoreTestSupport.vcxproj:

Source/WebInspectorUI:

* WebInspectorUI.vcxproj/WebInspectorUI.vcxproj:

Source/WebKit:

* WebKit.vcxproj/Interfaces/Interfaces.vcxproj:
* WebKit.vcxproj/WebKit.sln:
* WebKit.vcxproj/WebKit/WebKit.vcxproj:
* WebKit.vcxproj/WebKitGUID/WebKitGUID.vcxproj:

Source/WTF:

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTFGenerated.vcxproj:

Tools:

* DumpRenderTree/DumpRenderTree.vcxproj/DumpRenderTree/DumpRenderTree.vcxproj:
* DumpRenderTree/DumpRenderTree.vcxproj/DumpRenderTree/DumpRenderTreeLauncher.vcxproj:
* DumpRenderTree/DumpRenderTree.vcxproj/ImageDiff/ImageDiff.vcxproj:
* DumpRenderTree/DumpRenderTree.vcxproj/ImageDiff/ImageDiffLauncher.vcxproj:
* DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.vcxproj:
* Scripts/webkitdirs.pm: Modify our Visual Studio search routines to
prefer the newer MSBuild included in Visual Studio 2015.
(visualStudioInstallDir):
(msBuildInstallDir):
(visualStudioVersion):
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters:
* WinLauncher/WinLauncher.vcxproj/WinLauncher.vcxproj:
* WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj:
* win/AssembleBuildLogs/AssembleBuildLogs.vcxproj:
* win/record-memory/record-memory.vcxproj:

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

6 years agoTried to fix the iOS build.
mitz@apple.com [Tue, 11 Aug 2015 20:47:02 +0000 (20:47 +0000)]
Tried to fix the iOS build.

* UIProcess/ios/WKGeolocationProviderIOS.mm:
(-[WKGeolocationProviderIOS initWithProcessPool:]):

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

6 years agoWebFrameLoaderClient::dispatchDecidePolicyForResponse() calls an std::function after...
aestes@apple.com [Tue, 11 Aug 2015 20:41:22 +0000 (20:41 +0000)]
WebFrameLoaderClient::dispatchDecidePolicyForResponse() calls an std::function after it's been moved from
https://bugs.webkit.org/show_bug.cgi?id=147873

Reviewed by Alexey Proskuryakov.

I noticed during code inspection that we were calling an std::function after WTF::move() has been called on it.
Calling an empty std::function results in a C++ exception being thrown. I don't know how to make a sync IPC
message fail, so I'm not sure how to test this.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Called didReceivePolicyDecision instead.

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

6 years agoAnother speculative build fix after r188280.
achristensen@apple.com [Tue, 11 Aug 2015 20:38:17 +0000 (20:38 +0000)]
Another speculative build fix after r188280.

* TestWebKitAPI/Tests/WTF/ParkingLot.cpp:
std::this_thread is too modern c++ for VS2013 and supported GCC versions,
so let's go back to usleep and I made something close to usleep, but with much lower resolution.

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

6 years agoREGRESSION (r188053): Sometimes unable to save an image from Google Search/
bdakin@apple.com [Tue, 11 Aug 2015 20:36:06 +0000 (20:36 +0000)]
REGRESSION (r188053): Sometimes unable to save an image from Google Search/
imgur via long press
https://bugs.webkit.org/show_bug.cgi?id=147896

Reviewed by Enrica Casucci.

http://trac.webkit.org/changeset/188053 added code to call cleanupSheet when
the long press gesture is cancelled. However, the gesture will be called with
the cancelled state when then user taps an item in the action sheet (such as
“save image”), and sometimes the “cancel” comes in before the image has been
saved. That is a problem because we need to avoid cleaning up the sheet until
after the image is saved. Before that patch, we never cleaned up the sheet on
cancel, so this patch goes back to that behavior. We also have to remove some
assertions that assume that everything will be totally cleaned up when a new
sheet is created, but that is not necessarily true due to interactions
between the preview gesture and the long press gesture.

Remove assertions.
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
(-[WKActionSheetAssistant showImageSheet]):
(-[WKActionSheetAssistant showLinkSheet]):
(-[WKActionSheetAssistant showDataDetectorsSheet]):

Revert the part of Enrica’s patch that called cleanupSheet when the gesture
is cancelled.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _longPressRecognized:]):

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

6 years agoUnreviewed build fix after r188280.
achristensen@apple.com [Tue, 11 Aug 2015 20:20:52 +0000 (20:20 +0000)]
Unreviewed build fix after r188280.

* TestWebKitAPI/Tests/WTF/ParkingLot.cpp:
Include DataLog.h, and usleep is not available on Windows, so I used what I think is the c++11 equivalent.

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

6 years agoWeb Inspector: Agent commands do not actually return a promise when expected
burg@cs.washington.edu [Tue, 11 Aug 2015 20:15:16 +0000 (20:15 +0000)]
Web Inspector: Agent commands do not actually return a promise when expected
https://bugs.webkit.org/show_bug.cgi?id=138665

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

This patch unifies the handling of different invocation and dispatch modes in the
InspectorBackend protocol system. Command responses are dispatched to a provided
callback function; if no function was provided, then the command returns a promise.

Rather than awkwardly converting between promises and callbacks at invocation and
response dispatch time, the backend now stores the callback or promise thunks and
knows how to invoke each when the response comes. This mirrors how response handling
works in ProtocolTestStub.js. InspectorBackend includes more machinery to support Agent
objects and various debug flags.

Performanace impact is expected to be negligible, because there are relatively
few commands issued by the inspector frontend and returned promises are short-lived.

Remove all uses of Command.prototype.promise, since it is no longer necessary.

* UserInterface/Base/Test.js:
(InspectorTest.reloadPage):
* UserInterface/Controllers/ReplayManager.js:
(WebInspector.ReplayManager.prototype.getSession.get var):
(WebInspector.ReplayManager.getSegment.get var):
* UserInterface/Models/ReplaySession.js:
(WebInspector.ReplaySession.prototype.segmentsChanged):
* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.requestContentFromBackend):
* UserInterface/Models/Script.js:
(WebInspector.Script.prototype.requestContentFromBackend):
* UserInterface/Models/SourceMapResource.js:
(WebInspector.SourceMapResource.prototype.requestContentFromBackend):
* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass):
(InspectorBackendClass.prototype.dispatch):
(InspectorBackendClass.prototype.runAfterPendingDispatches):
(InspectorBackendClass.prototype._sendCommandToBackendWithCallback.set this):
(InspectorBackendClass.set this):
(InspectorBackendClass.prototype._sendCommandToBackendWithCallback):
(InspectorBackendClass.prototype._dispatchResponseToCallback):
(InspectorBackendClass.prototype._dispatchResponseToPromise):
(InspectorBackendClass.prototype._flushPendingScripts):
(InspectorBackend.Command.prototype.invoke):
(InspectorBackend.Command.prototype._invokeWithArguments):
(InspectorBackendClass.prototype._willSendMessageToBackend.set return): Deleted.
(InspectorBackendClass._dispatchCallback.get if): Deleted.
(InspectorBackendClass.prototype._willSendMessageToBackend): Deleted.
(InspectorBackendClass.prototype._invokeCommand): Deleted.
(.callable): Deleted.
(InspectorBackend.Command.create): Deleted.
(InspectorBackend.Command.prototype.promise): Deleted.

LayoutTests:

Add a new test that only checks for proper invocation return values.
Once the async test suite infrastructure is available for frontend tests,
more thorough tests of promises and callbacks will be added.

* inspector/protocol/inspector-backend-invocation-return-value-expected.txt: Added.
* inspector/protocol/inspector-backend-invocation-return-value.html: Added.
* inspector/protocol/protocol-promise-result-expected.txt: Removed.
* inspector/protocol/protocol-promise-result.html: Removed.
* platform/win/TestExpectations: Remove deleted test.

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

6 years agoWTF should have a ParkingLot for parking sleeping threads, so that locks can fit...
fpizlo@apple.com [Tue, 11 Aug 2015 19:51:35 +0000 (19:51 +0000)]
WTF should have a ParkingLot for parking sleeping threads, so that locks can fit in 1.6 bits
https://bugs.webkit.org/show_bug.cgi?id=147665

Reviewed by Mark Lam.

Source/JavaScriptCore:

Replace ByteSpinLock with ByteLock.

* runtime/ConcurrentJITLock.h:

Source/WTF:

This change adds a major new abstraction for concurrency algorithms in WebKit. It's called a
ParkingLot, and it makes available a thread parking queue for each virtual address in memory.
The queues are maintained by a data-access-parallel concurrent hashtable implementation. The
memory usage is bounded at around half a KB per thread.

The ParkingLot makes it easy to turn any spinlock-based concurrency protocol into one that
parks threads after a while. Because queue state management is up to the ParkingLot and not
the user's data structure, this patch uses it to implement a full adaptive mutex in one byte.
In fact, only three states of that byte are used (0 = available, 1 = locked, 2 = locked and
there are parked threads). Hence the joke that ParkingLot allows locks that fit in 1.6 bits.

ByteLock is used as a replacement for ByteSpinLock in JavaScriptCore.

The API tests for this also demo how to create a completely fair (FIFO) binary semamphore. The
comment in Lock.h shows how we could accelerate Lock performance using ParkingLot. After we
are sure that this code works, we can expand the use of ParkingLot. That's covered by
https://bugs.webkit.org/show_bug.cgi?id=147841.

* WTF.vcxproj/WTF.vcxproj:
* WTF.xcodeproj/project.pbxproj:
* benchmarks/LockSpeedTest.cpp:
(main):
* wtf/Atomics.h:
(WTF::Atomic::compareExchangeWeak):
(WTF::Atomic::compareExchangeStrong):
* wtf/ByteLock.cpp: Added.
(WTF::ByteLock::lockSlow):
(WTF::ByteLock::unlockSlow):
* wtf/ByteLock.h: Added.
(WTF::ByteLock::ByteLock):
(WTF::ByteLock::lock):
(WTF::ByteLock::unlock):
(WTF::ByteLock::isHeld):
(WTF::ByteLock::isLocked):
* wtf/CMakeLists.txt:
* wtf/Lock.h:
* wtf/ParkingLot.cpp: Added.
(WTF::ParkingLot::parkConditionally):
(WTF::ParkingLot::unparkOne):
(WTF::ParkingLot::unparkAll):
(WTF::ParkingLot::forEach):
* wtf/ParkingLot.h: Added.
(WTF::ParkingLot::compareAndPark):

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/Lock.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/ParkingLot.cpp: Added.
(TestWebKitAPI::TEST):

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

6 years agoRemove unversioned client structs from the C SPI
andersca@apple.com [Tue, 11 Aug 2015 19:48:50 +0000 (19:48 +0000)]
Remove unversioned client structs from the C SPI
https://bugs.webkit.org/show_bug.cgi?id=147894

Reviewed by Dan Bernstein.

* Shared/API/c/WKConnectionRef.h:
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKContextConnectionClient.h:
* UIProcess/API/C/WKContextDownloadClient.h:
* UIProcess/API/C/WKContextHistoryClient.h:
* UIProcess/API/C/WKContextInjectedBundleClient.h:
* UIProcess/API/C/WKCookieManager.h:
* UIProcess/API/C/WKDatabaseManager.h:
* UIProcess/API/C/WKGeolocationManager.h:
* UIProcess/API/C/WKIconDatabase.h:
* UIProcess/API/C/WKNotificationProvider.h:
* UIProcess/API/C/WKPageContextMenuClient.h:
* UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
* UIProcess/API/C/WKPageFindClient.h:
* UIProcess/API/C/WKPageFindMatchesClient.h:
* UIProcess/API/C/WKPageFormClient.h:
* UIProcess/API/C/WKPageLoaderClient.h:
* UIProcess/API/C/WKPagePolicyClient.h:
* UIProcess/API/C/WKPageUIClient.h:
* WebProcess/InjectedBundle/API/c/WKBundle.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageBanner.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
* WebProcess/InjectedBundle/API/c/WKBundlePagePolicyClient.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageResourceLoadClient.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:

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

6 years agofeMorphology is not rendered correctly on Retina display
commit-queue@webkit.org [Tue, 11 Aug 2015 19:27:12 +0000 (19:27 +0000)]
feMorphology is not rendered correctly on Retina display
https://bugs.webkit.org/show_bug.cgi?id=147589

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-08-11
Reviewed by Dean Jackson.

Source/WebCore:

The result ImageBuffer of any FilterEffect is already scaled up for 2x
display. The FEMorphology needs to fix its painting data dimension and
radius by multiplying them by the filter scale factor.

Test: fast/hidpi/filters-morphology.html

* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::platformApplySoftware):

LayoutTests:

Ensure we take the filter scale factor into consideration when applying
the FEMorphology.

* fast/hidpi/filters-morphology-expected.html: Added.
* fast/hidpi/filters-morphology.html: Added.

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