WebKit-https.git
4 years agoSupport images above the title on webkit.org posts
jond@apple.com [Tue, 29 Mar 2016 19:40:11 +0000 (19:40 +0000)]
Support images above the title on webkit.org posts
https://bugs.webkit.org/show_bug.cgi?id=155979

Reviewed by Timothy Hatcher.

* wp-content/themes/webkit/functions.php:
* wp-content/themes/webkit/single.php:

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

4 years ago[Cocoa] Rename ScrollbarPainter variables to ScrollerImp
mmaxfield@apple.com [Tue, 29 Mar 2016 19:04:02 +0000 (19:04 +0000)]
[Cocoa] Rename ScrollbarPainter variables to ScrollerImp
https://bugs.webkit.org/show_bug.cgi?id=155976

Reviewed by Simon Fraser.

This patch continues where r198078 left off. That patch renamed all the types,
however, there are some variables which were left as "scrollbarPainter". This
patch completes the transition to ScrollerImp.

No new tests because there is no behavior change.

* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(scrollerImpForScrollbar):
(-[WebScrollerImpPairDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
(-[WebScrollbarPartAnimation startAnimation]):
(-[WebScrollbarPartAnimation setCurrentProgress:]):
(-[WebScrollerImpDelegate mouseLocationInScrollerForScrollerImp:]):
(-[WebScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
(-[WebScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
(-[WebScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
(-[WebScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::contentAreaWillPaint):
(WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
(WebCore::ScrollAnimatorMac::mouseExitedContentArea):
(WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
(WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
(WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
(WebCore::ScrollAnimatorMac::mouseIsDownInScrollbar):
(WebCore::ScrollAnimatorMac::willStartLiveResize):
(WebCore::ScrollAnimatorMac::contentsResized):
(WebCore::ScrollAnimatorMac::willEndLiveResize):
(WebCore::ScrollAnimatorMac::contentAreaDidShow):
(WebCore::ScrollAnimatorMac::contentAreaDidHide):
(WebCore::ScrollAnimatorMac::didBeginScrollGesture):
(WebCore::ScrollAnimatorMac::didEndScrollGesture):
(WebCore::ScrollAnimatorMac::mayBeginScrollGesture):
(WebCore::ScrollAnimatorMac::lockOverlayScrollbarStateToHidden):
(WebCore::ScrollAnimatorMac::scrollbarsCanBeActive):
(WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
(WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
(WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
(WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
(WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
(WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
(WebCore::ScrollAnimatorMac::sendContentAreaScrolled):
(scrollbarPainterForScrollbar): Deleted.
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::registerScrollbar):
(WebCore::ScrollbarThemeMac::scrollbarThickness):
(WebCore::scrollerImpPaint):
(WebCore::ScrollbarThemeMac::paint):
(WebCore::scrollbarPainterPaint): Deleted.

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

4 years agoWeb Inspector: We should have a way to capture heap snapshots programatically.
commit-queue@webkit.org [Tue, 29 Mar 2016 18:51:35 +0000 (18:51 +0000)]
Web Inspector: We should have a way to capture heap snapshots programatically.
https://bugs.webkit.org/show_bug.cgi?id=154407
<rdar://problem/24726292>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-29
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/Console.json:
Add a new Console.heapSnapshot event for when a heap snapshot is taken.

* runtime/ConsolePrototype.cpp:
(JSC::ConsolePrototype::finishCreation):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
* runtime/ConsoleClient.h:
Add the console.takeHeapSnapshot method and dispatch to the ConsoleClient.

* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::takeHeapSnapshot):
* inspector/JSGlobalObjectConsoleClient.h:
Have the InspectorConsoleAgent handle this.

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
* inspector/agents/InspectorConsoleAgent.cpp:
(Inspector::InspectorConsoleAgent::InspectorConsoleAgent):
(Inspector::InspectorConsoleAgent::takeHeapSnapshot):
* inspector/agents/InspectorConsoleAgent.h:
* inspector/agents/JSGlobalObjectConsoleAgent.cpp:
(Inspector::JSGlobalObjectConsoleAgent::JSGlobalObjectConsoleAgent):
* inspector/agents/JSGlobalObjectConsoleAgent.h:
Give the ConsoleAgent a HeapAgent pointer so that it can have the HeapAgent
perform the snapshot building work like it normally does.

Source/WebCore:

Test: inspector/console/heapSnapshot.html

* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::takeHeapSnapshot):
* page/PageConsoleClient.h:
Pass through to Inspector Instrumentation.

* inspector/InspectorConsoleInstrumentation.h:
(WebCore::InspectorInstrumentation::takeHeapSnapshot):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::takeHeapSnapshotImpl):
* inspector/InspectorInstrumentation.h:
Pass through to InspectorConsoleAgent.

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/PageConsoleAgent.cpp:
(WebCore::PageConsoleAgent::PageConsoleAgent):
* inspector/PageConsoleAgent.h:
* inspector/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::WebConsoleAgent):
* inspector/WebConsoleAgent.h:
* workers/WorkerConsoleClient.cpp:
(WebCore::WorkerConsoleClient::takeHeapSnapshot):
* workers/WorkerConsoleClient.h:
Provide a HeapAgent to the ConsoleAgent.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Protocol/ConsoleObserver.js:
(WebInspector.ConsoleObserver.prototype.heapSnapshot):
(WebInspector.ConsoleObserver):
Create a HeapSnapshot with an optional title and add to the timeline.

(WebInspector.HeapAllocationsTimelineDataGridNode):
* UserInterface/Views/TimelineTabContentView.js:
(WebInspector.TimelineTabContentView.displayNameForRecord):
Share code for snapshot display names which may now include a title.

* UserInterface/Proxies/HeapSnapshotProxy.js:
(WebInspector.HeapSnapshotProxy):
(WebInspector.HeapSnapshotProxy.deserialize):
(WebInspector.HeapSnapshotProxy.prototype.get title):
* UserInterface/Views/HeapAllocationsTimelineDataGridNode.js:
* UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot):
(HeapSnapshot.prototype.serialize):
* UserInterface/Workers/HeapSnapshot/HeapSnapshotWorker.js:
(HeapSnapshotWorker.prototype.createSnapshot):
Include an optional title in a HeapSnapshot.

LayoutTests:

* inspector/console/heapSnapshot-expected.txt: Added.
* inspector/console/heapSnapshot.html: Added.
Test that we get expected data and events after calling
console.takeHeapSnapshot when the inspector is open.

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

4 years agoREGRESSION (r196813): Missing plug-in placeholder is missing
zalan@apple.com [Tue, 29 Mar 2016 18:33:35 +0000 (18:33 +0000)]
REGRESSION (r196813): Missing plug-in placeholder is missing
https://bugs.webkit.org/show_bug.cgi?id=155973
<rdar://problem/25068392>

Reviewed by Andy Estes.

Show unavailable plugin indicator when UnavailablePluginIndicatorState (uninitialized, hidden, visible) is not set to hidden explicitly.
It matches pre-196813 behaviour.

Unable to test.

* rendering/RenderEmbeddedObject.h:
(WebCore::RenderEmbeddedObject::showsUnavailablePluginIndicator):

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

4 years ago[OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
mmaxfield@apple.com [Tue, 29 Mar 2016 17:16:25 +0000 (17:16 +0000)]
[OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
https://bugs.webkit.org/show_bug.cgi?id=155962

Reviewed by Simon Fraser.

We can control the animation direction with the NSScrollerImp property
userInterfaceLayoutDirection.

Not testable.

* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::setScrollbarLayoutDirection):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::horizontalScrollbar):
(WebCore::ScrollableArea::verticalScrollbar):
(WebCore::ScrollableArea::tiledBacking):
(WebCore::ScrollableArea::layerForHorizontalScrollbar):
(WebCore::ScrollableArea::layerForVerticalScrollbar):
(WebCore::ScrollableArea::layerForScrolling):
(WebCore::ScrollableArea::layerForScrollCorner):
(WebCore::ScrollableArea::layerForOverhangAreas):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
* platform/mac/ScrollableAreaMac.mm:
(WebCore::ScrollableArea::setScrollbarDirection):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::registerScrollbar):
* platform/spi/mac/NSScrollerImpSPI.h:

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

4 years agoInline WebFullScreenVideoRootViewController.m
mitz@apple.com [Tue, 29 Mar 2016 16:49:07 +0000 (16:49 +0000)]
Inline WebFullScreenVideoRootViewController.m
https://bugs.webkit.org/show_bug.cgi?id=155971

Reviewed by Anders Carlsson.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(createFullScreenVideoRootViewControllerClass): Replaced with the code from
  WebFullScreenVideoRootViewController.m.

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

4 years agoCreate a CG ImageDecoder class instead of defining it as CGImageSourceRef
commit-queue@webkit.org [Tue, 29 Mar 2016 16:18:25 +0000 (16:18 +0000)]
Create a CG ImageDecoder class instead of defining it as CGImageSourceRef
https://bugs.webkit.org/show_bug.cgi?id=155422

Patch by Said Abou-Hallawa <sabouhallawa@apple,com> on 2016-03-29
Reviewed by Simon Fraser.

Move the image CG decoding code from the class ImageSource out to a new
class named ImageDecoder. The purpose of this split is to unify the code
of the ImageSource for all platforms. This class should be a container
for the ImageDecoder. All the direct frame manipulation like querying the
frame metadata or creating a frame image should be the responsibility of
the ImageDecoder. The ImageSource will be responsible of the image frame
caching. When responding to a frame metadata query, for example. the
ImageSource checks its cache first. If an entry does not exist for the
requested frame, the ImageSource will cache the image and the metadata
of this frame. The ImageSource will respond at the end from the image
frame cache.

The plan after this patch is is the following:
    -- Move the new class to separate files
    -- Merge the ImageSource.cpp and ImageSourceCG.cpp. in one file
    -- Move caching the FrameData from BitmapImage to ImageSource.

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::imageSizeForRenderer):
BitmapImage::sizeRespectingOrientation() does not take any argument now.
Fix the call to this function and delete the conditionally compiled code
since the code is the same for the two cases.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::updateSize):
(WebCore::BitmapImage::sizeRespectingOrientation):
(WebCore::BitmapImage::frameImageAtIndex):
(WebCore::BitmapImage::BitmapImage):
An image can have two sizes: size() and sizeRespectingOrientation(). The
sizeRespectingOrientation() is the transpose of size() iff the image
orientation has usesWidthAsHeight() is true. So there is no need for the
ImageOrientationDescription argument. So there is no need for the members
m_imageOrientation or m_shouldRespectImageOrientation. Also move
m_allowSubsampling and m_minimumSubsamplingLevel (which should be named
m_maximumSubsamplingLevel) to ImageSource instead.

(WebCore::BitmapImage::frameOrientationAtIndex): Replace DefaultImageOrientation
by ImageOrientation().

(WebCore::BitmapImage::dump): Move dumping the image metadata to the
ImageSource.

* platform/graphics/BitmapImage.h:

* platform/graphics/GraphicsContext.h:
* platform/graphics/ImageOrientation.h:
(WebCore::ImageOrientation::ImageOrientation):
(WebCore::ImageOrientation::fromEXIFValue):
(WebCore::ImageOrientation::operator ImageOrientationEnum):
Add a casting operator to ImageOrientation so it can be dumped as enum
value. Also add a default constructor and make the other constructor be
explicit. All the rvalues DefaultImageOrientation should be replaced by
ImageOrientation().

* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ImageSource):
(WebCore::ImageSource::clear):
m_decoder is now a unique_ptr. To release it, assign it to nullptr.

(WebCore::ImageSource::ensureDecoderIsCreated): Ensure m_decoder is created.

(WebCore::ImageSource::setData): Call ensureDecoderIsCreated() before
actually setting the data.

(WebCore::ImageSource::isSizeAvailable): Use initialized();

(WebCore::ImageSource::size):
(WebCore::ImageSource::sizeRespectingOrientation):
(WebCore::ImageSource::frameSizeAtIndex):
These functions return the size of the image.

(WebCore::ImageSource::getHotSpot):
(WebCore::ImageSource::repetitionCount):
(WebCore::ImageSource::frameCount):
(WebCore::ImageSource::createFrameImageAtIndex):
(WebCore::ImageSource::frameDurationAtIndex):
(WebCore::ImageSource::orientationAtIndex):
(WebCore::ImageSource::frameHasAlphaAtIndex):
(WebCore::ImageSource::frameIsCompleteAtIndex):
(WebCore::ImageSource::frameBytesAtIndex):
Check for initialized() instead of checking m_decoder.

(WebCore::ImageSource::dump): Dump the image metadata.

(WebCore::ImageSource::initialized): Deleted.

* platform/graphics/ImageSource.h: The image decoder is now named
ImageDecoder for all platforms.

(WebCore::ImageSource::initialized): Moved to the header file.

(WebCore::ImageSource::setAllowSubsampling): Moved from BitmapImage.

* platform/graphics/cairo/BitmapImageCairo.cpp:
(WebCore::BitmapImage::BitmapImage):
(WebCore::BitmapImage::determineMinimumSubsamplingLevel): Deleted.
Delete initializing m_minimumSubsamplingLevel and determineMinimumSubsamplingLevel()
since they are moved to ImageSource.

* platform/graphics/cg/BitmapImageCG.cpp:
(WebCore::BitmapImage::BitmapImage):
(WebCore::BitmapImage::determineMinimumSubsamplingLevel): Deleted.
Delete members and methods which are now owned and calculated by ImageSource.

* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageDecoder::create): Returns a CG ImageDecoder object.

(WebCore::orientationFromProperties):  Replace DefaultImageOrientation
by ImageOrientation().

(WebCore::ImageDecoder::ImageDecoder): Creates a native CG image decoder.

(WebCore::ImageDecoder::~ImageDecoder): Releases the native CG image decoder.

(WebCore::ImageDecoder::subsamplingLevelForScale): Moved from ImageSource.
A new argument named 'maximumSubsamplingLevel' is added to low filter the
return value.

(WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
(WebCore::ImageDecoder::filenameExtension):
(WebCore::ImageDecoder::isSizeAvailable):
(WebCore::ImageDecoder::size):
(WebCore::ImageDecoder::frameCount):
(WebCore::ImageDecoder::repetitionCount):
(WebCore::ImageDecoder::hotSpot):
(WebCore::ImageDecoder::frameSizeAtIndex):
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::orientationAtIndex):
(WebCore::ImageDecoder::frameDurationAtIndex):
(WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
(WebCore::ImageDecoder::frameHasAlphaAtIndex):
(WebCore::ImageDecoder::frameBytesAtIndex):
(WebCore::ImageDecoder::createFrameImageAtIndex):
(WebCore::ImageDecoder::setData):
The code of these function was moved from the functions of ImageSource.

(WebCore::ImageSource::ImageSource):
(WebCore::ImageSource::~ImageSource):
(WebCore::ImageSource::clear):
(WebCore::ImageSource::ensureDecoderIsCreated):
(WebCore::ImageSource::setData):
(WebCore::ImageSource::filenameExtension):
(WebCore::ImageSource::calculateMaximumSubsamplingLevel):
(WebCore::ImageSource::maximumSubsamplingLevel):
(WebCore::ImageSource::subsamplingLevelForScale):
(WebCore::ImageSource::isSizeAvailable):
(WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
(WebCore::ImageSource::frameSizeAtIndex):
(WebCore::ImageSource::orientationAtIndex):
(WebCore::ImageSource::size):
(WebCore::ImageSource::sizeRespectingOrientation):
(WebCore::ImageSource::getHotSpot):
(WebCore::ImageSource::bytesDecodedToDetermineProperties):
(WebCore::ImageSource::repetitionCount):
(WebCore::ImageSource::frameCount):
(WebCore::ImageSource::createFrameImageAtIndex):
(WebCore::ImageSource::frameIsCompleteAtIndex):
(WebCore::ImageSource::frameDurationAtIndex):
(WebCore::ImageSource::frameHasAlphaAtIndex):
(WebCore::ImageSource::frameBytesAtIndex):
Call m_decoder's function to do the real work.

(WebCore::ImageSource::dump): Dump the image metadata.

(WebCore::ImageSource::initialized): Deleted.

* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::create):
* platform/image-decoders/ImageDecoder.h:
Change the return of ImageDecoder::create() to be unique_ptr.

* platform/mac/DragImageMac.mm:
(WebCore::createDragImageFromImage): Delete unneeded argument.

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

4 years ago[Win] CMake seems to build all generated files every time
bfulgham@apple.com [Tue, 29 Mar 2016 15:42:46 +0000 (15:42 +0000)]
[Win] CMake seems to build all generated files every time
https://bugs.webkit.org/show_bug.cgi?id=155872

Reviewed by Alex Christensen.

This seems to be caused by Visual Studio being unhappy receiving multiple output targets
for its custom build rules. If I limit the output to just the header file on Windows, the
dependency check seems to do the right thing.

* Source/cmake/WebKitMacros.cmake:

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

4 years agomedia/track/track-remove-track.html is flaky, crashing and failing
eric.carlson@apple.com [Tue, 29 Mar 2016 15:40:33 +0000 (15:40 +0000)]
media/track/track-remove-track.html is flaky, crashing and failing
https://bugs.webkit.org/show_bug.cgi?id=130971

Reviewed by Alexey Proskuryakov.
Source/WebCore:

Prevent HTMLMediaElement from being collected while it is creating media controls.
These changes prevent the test from crashing but they do not fix the flakiness,
which is caused by another bug. Fixing that is tracked by
https://bugs.webkit.org/show_bug.cgi?id=155956.

* html/HTMLMediaElement.cpp:
(WebCore::actionName): New, debugging-only helper function.
(WebCore::HTMLMediaElement::HTMLMediaElement): Initialize new variables.
(WebCore::HTMLMediaElement::scheduleDelayedAction): Log the flag names to make debugging easier.
(WebCore::HTMLMediaElement::scheduleNextSourceChild): Add logging.
(WebCore::HTMLMediaElement::updateActiveTextTrackCues): Update logging.
(WebCore::HTMLMediaElement::configureTextTrackGroup): Drive-by optimization: don't call
  updateCaptionContainer here, call it before exiting configureTextTracks so we only call
  it once instead of once per track group.
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::ensureMediaControlsShadowRoot): New, wrapper around calling
  ensureUserAgentShadowRoot so m_creatingControls can be set and cleared appropriately.
(WebCore::HTMLMediaElement::updateCaptionContainer): ensureUserAgentShadowRoot ->
  ensureMediaControlsShadowRoot. Drive by optimization: set/test m_haveSetupCaptionContainer
  so we only do this setup once.
(WebCore::HTMLMediaElement::configureTextTracks): Call updateCaptionContainer.
(WebCore::HTMLMediaElement::clearMediaPlayer): Log flag names.
(WebCore::HTMLMediaElement::hasPendingActivity): Return true when creating controls so GC
  won't happen during controls setup.
(WebCore::HTMLMediaElement::updateTextTrackDisplay): ensureUserAgentShadowRoot ->
  ensureMediaControlsShadowRoot.
(WebCore::HTMLMediaElement::createMediaControls): Ditto.
(WebCore::HTMLMediaElement::configureMediaControls): Ditto.
(WebCore::HTMLMediaElement::configureTextTrackDisplay): Ditto.
* html/HTMLMediaElement.h:

LayoutTests:

* platform/mac/TestExpectations: Mark crash as flaky only.

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

4 years ago[EFL] Skip to test custom element test cases
gyuyoung.kim@webkit.org [Tue, 29 Mar 2016 13:22:12 +0000 (13:22 +0000)]
[EFL] Skip to test custom element test cases

Unreviewed EFL gardening.

Custom element is not supported by EFL yet. Additionally mark 4 security tests to timeout.

* platform/efl/TestExpectations:

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

4 years agoREGRESSION(r192914): 10% regression on Sunspider's date-format-tofte
utatane.tea@gmail.com [Tue, 29 Mar 2016 10:25:44 +0000 (10:25 +0000)]
REGRESSION(r192914): 10% regression on Sunspider's date-format-tofte
https://bugs.webkit.org/show_bug.cgi?id=155559

Reviewed by Saam Barati.

Source/JavaScriptCore:

The fast path of the eval function is the super hot path in date-format-tofte.
Any performance regression is not allowed here.
Before this patch, we allocated SourceCode in the fast path.
This allocation incurs 10% performance regression.

This patch removes this allocation in the fast path.
And change the key of the EvalCodeCache to EvalCodeCache::CacheKey.
It combines RefPtr<StringImpl> and isArrowFunctionContext.
Since EvalCodeCache does not cache any eval code evaluated under the strict mode,
it is unnecessary to include several options (ThisTDZMode, and DerivedContextType) in the cache map's key.
But isArrowFunctionContext is necessary since the sloppy mode arrow function exists.

To validate this change, we add a new test that evaluates the same code
under the non-arrow function context and the arrow function context.

After introducing CacheKey, we observed 1% regression compared to the RefPtr<StringImpl> keyed case.
This is because HashMap<RefPtr<T>, ...>::get(T*) is specially optimized; this path is inlined while the normal ::get() is not inlined.
To avoid this performance regression, we introduce HashMap::fastGet, that aggressively encourages inlining.
The relationship between fastGet() and get() is similar to fastAdd() and add().
After applying this change, the evaluation shows no performance regression in comparison with the RefPtr<StringImpl> keyed case.

* bytecode/EvalCodeCache.h:
(JSC::EvalCodeCache::CacheKey::CacheKey):
(JSC::EvalCodeCache::CacheKey::hash):
(JSC::EvalCodeCache::CacheKey::isEmptyValue):
(JSC::EvalCodeCache::CacheKey::operator==):
(JSC::EvalCodeCache::CacheKey::isHashTableDeletedValue):
(JSC::EvalCodeCache::CacheKey::Hash::hash):
(JSC::EvalCodeCache::CacheKey::Hash::equal):
(JSC::EvalCodeCache::tryGet):
(JSC::EvalCodeCache::getSlow):
(JSC::EvalCodeCache::isCacheable):
* interpreter/Interpreter.cpp:
(JSC::eval):
* tests/stress/eval-in-arrow-function.js: Added.
(shouldBe):
(i):

Source/WTF:

Add HashTable::inlineLookup and HashMap::fastGet.

* wtf/HashMap.h:
* wtf/HashTable.h:

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

4 years agoUnreviewed EFL build fix caused by r198773
gyuyoung.kim@webkit.org [Tue, 29 Mar 2016 09:13:49 +0000 (09:13 +0000)]
Unreviewed EFL build fix caused by r198773

* CMakeLists.txt: Append WebCore_DERIVED_SOURCES to WebCore source list.

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

4 years agoAudit WebCore builtins for user overridable code
commit-queue@webkit.org [Tue, 29 Mar 2016 08:14:39 +0000 (08:14 +0000)]
Audit WebCore builtins for user overridable code
https://bugs.webkit.org/show_bug.cgi?id=155923

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-29
Reviewed by Youenn Fablet.

Source/JavaScriptCore:

* runtime/CommonIdentifiers.h:
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::finishCreation):
Expose @Object.@defineProperty to built-ins.

Source/WebCore:

Tests: fetch/builtin-overrides.html
       streams/builtin-overrides.html

* Modules/fetch/FetchHeaders.js:
(initializeFetchHeaders):
Avoid using an Array.prototype.forEach that could be overriden.

* Modules/streams/ByteLengthQueuingStrategy.js:
(initializeByteLengthQueuingStrategy):
* Modules/streams/CountQueuingStrategy.js:
(initializeCountQueuingStrategy):
Use the private Object.defineProperty not one that could be overriden.

* Modules/streams/ReadableStreamInternals.js:
(finishClosingReadableStream):
Fix style.

* Modules/streams/WritableStream.js:
(write):
Fix error message to use the correct function name.

LayoutTests:

* fetch/builtin-overrides-expected.txt: Added.
* fetch/builtin-overrides.html: Added.
* streams/builtin-overrides-expected.txt: Added.
* streams/builtin-overrides.html: Added.

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

4 years agoUnreviewed. Follow up to r198580.
carlosgc@webkit.org [Tue, 29 Mar 2016 07:27:16 +0000 (07:27 +0000)]
Unreviewed. Follow up to r198580.

Simplify the code even more as suggested by Darin.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::setViewNeedsDisplay):

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

4 years agoWeb Inspector: Ensure maximum accuracy while profiling
commit-queue@webkit.org [Tue, 29 Mar 2016 03:28:10 +0000 (03:28 +0000)]
Web Inspector: Ensure maximum accuracy while profiling
https://bugs.webkit.org/show_bug.cgi?id=155809
<rdar://problem/25325035>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-28
Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
New strings.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager):
When starting the inspector, if it was previously closed while
breakpoints were temporarily disabled, restore the correct
breakpoints enabled state.

(WebInspector.DebuggerManager.prototype.set breakpointsEnabled):
Warn if we ever try to enable breakpoints during timeline recordings.

(WebInspector.DebuggerManager.prototype.get breakpointsDisabledTemporarily):
(WebInspector.DebuggerManager.prototype.startDisablingBreakpointsTemporarily):
(WebInspector.DebuggerManager.prototype.stopDisablingBreakpointsTemporarily):
Method to start/stop temporarily disabling breakpoints.

(WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
(WebInspector.DebuggerManager.prototype._setBreakpoint):
When temporarily disabling breakpoints avoid the convenience behavior of
enabling all breakpoints when enabling or setting a single breakpoint.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype.startCapturing):
Emit a will start capturing event to do work before enabling instruments.

* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .timeline-recording-warning):
(.sidebar > .panel.navigation.debugger .timeline-recording-warning > a):
Styles for a warning section in the Debugger Sidebar when the Debugger
is temporarily disabled due to a Timeline recording.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingWillStart):
(WebInspector.DebuggerSidebarPanel.prototype._timelineRecordingStopped):
Modify the Debugger state and UI before and after a Timeline recording.

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

4 years agoFix Mac Ninja build after r198766.
achristensen@apple.com [Tue, 29 Mar 2016 02:03:22 +0000 (02:03 +0000)]
Fix Mac Ninja build after r198766.

.:

* Source/cmake/WebKitMacros.cmake:
WebCore_DERIVED_SOURCES are intentionally in a separate library to reduce linker line length.
This is now only specific to WebKit2_DERIVED_SOURCES, so I'm moving it there.

Source/WebKit2:

* CMakeLists.txt:

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

4 years agoFix Windows build after r198766.
achristensen@apple.com [Tue, 29 Mar 2016 01:27:51 +0000 (01:27 +0000)]
Fix Windows build after r198766.

* Source/cmake/WebKitMacros.cmake:
Use the filename from the cpp so that WebCorePrefix.cpp and WebCoreDerivedSourcesPrefix.cpp
generate unique .pch files, even though they both include WebCorePrefix.h

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

4 years agoPixel turds when bordered div is resized on SMF forum software.
zalan@apple.com [Tue, 29 Mar 2016 01:06:56 +0000 (01:06 +0000)]
Pixel turds when bordered div is resized on SMF forum software.
https://bugs.webkit.org/show_bug.cgi?id=155957
<rdar://problem/25010646>

Reviewed by Simon Fraser.

Use unmodified, non-snapped bounding box rect when computing dirty rects.

Source/WebCore:

Test: fast/repaint/hidpi-box-with-subpixel-height-inflates.html

* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getTrailingCorner):
* rendering/RenderInline.h:
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::borderBoundingBox): Deleted.
* rendering/RenderLineBreak.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::setBestTruncatedAt):

LayoutTests:

* fast/repaint/hidpi-box-with-subpixel-height-inflates-expected.txt: Added.
* fast/repaint/hidpi-box-with-subpixel-height-inflates.html: Added.

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

4 years ago[JSC] ArithSub should not propagate "UsesAsOther"
commit-queue@webkit.org [Tue, 29 Mar 2016 00:59:07 +0000 (00:59 +0000)]
[JSC] ArithSub should not propagate "UsesAsOther"
https://bugs.webkit.org/show_bug.cgi?id=155932

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-03-28
Reviewed by Mark Lam.

The node ArithSub was backpropagating UsesAsOther.
This causes any GetByVal on a Double Array to have an extra
hole check if it flows into an ArithSub.

The definition of ArithSub (12.8.4.1) has both operands go
through ToNumber(). ToNumber() on "undefined" always produces
NaN. It is safe to ignore the NaN marker from hole when
the DAG flows into ArithSub.

This patch also adds this change and test coverage to ArithAdd.
ArithAdd was not a problem in practice because it is only
generated before Fixup if both operands are known to be numerical.
The change to ArithAdd is there to protect us of the ArithSub-like
problems if we ever improve our support of arithmetic operators.

* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* tests/stress/arith-add-on-double-array-with-holes.js: Added.
(let.testCase.of.testCases.eval.nonObservableHoleOnLhs):
(let.testCase.of.testCases.observableHoleOnLhs):
(let.testCase.of.testCases.nonObservableHoleOnRhs):
(let.testCase.of.testCases.observableHoleOnRhs):
* tests/stress/arith-sub-on-double-array-with-holes.js: Added.
(let.testCase.of.testCases.eval.nonObservableHoleOnLhs):
(let.testCase.of.testCases.observableHoleOnLhs):
(let.testCase.of.testCases.nonObservableHoleOnRhs):
(let.testCase.of.testCases.observableHoleOnRhs):
* tests/stress/value-add-on-double-array-with-holes.js: Added.
(let.testCase.of.testCases.eval.nonObservableHoleOnLhs):
(let.testCase.of.testCases.observableHoleOnLhs):
(let.testCase.of.testCases.nonObservableHoleOnRhs):
(let.testCase.of.testCases.observableHoleOnRhs):

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

4 years agoAX: Crash when AX trying to create element for an old auto fill element
cfleizach@apple.com [Tue, 29 Mar 2016 00:58:23 +0000 (00:58 +0000)]
AX: Crash when AX trying to create element for an old auto fill element
https://bugs.webkit.org/show_bug.cgi?id=155943

Reviewed by Joanmarie Diggs.

Source/WebCore:

When an auto-fill element is removed, the Node hangs around but the renderer is gone.
In those cases, we can't blindly add the result of getOrCreate to the children array.

Test: accessibility/auto-fill-crash.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::addTextFieldChildren):

LayoutTests:

* accessibility/auto-fill-crash-expected.txt: Added.
* accessibility/auto-fill-crash.html: Added.

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

4 years agoAX: iOS: Can't navigate inside ContentEditable fields with voiceover enabled
cfleizach@apple.com [Tue, 29 Mar 2016 00:42:32 +0000 (00:42 +0000)]
AX: iOS: Can't navigate inside ContentEditable fields with voiceover enabled
https://bugs.webkit.org/show_bug.cgi?id=155942

Reviewed by Joanmarie Diggs.

Source/WebCore:

The code to set the selected text range on a non-native text control (like a contenteditable) was either
wrong or broke at some point. It assumed that creating a Position with the contenteditable node with the right
offset would make a valid Position, but it almost never did.

Instead we can use this helper method to create a valid Position.

Test: accessibility/set-selected-text-range-contenteditable.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::setSelectedTextRange):

LayoutTests:

* accessibility/set-selected-text-range-contenteditable-expected.txt: Added.
* accessibility/set-selected-text-range-contenteditable.html: Added.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:

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

4 years agoUnreviewed EFL gardening on 29th Mar.
gyuyoung.kim@webkit.org [Tue, 29 Mar 2016 00:36:59 +0000 (00:36 +0000)]
Unreviewed EFL gardening on 29th Mar.

Mark svg text tests to failure. Besides remove duplicated a test.

* platform/efl/TestExpectations:

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

4 years agoFix Ninja build on Mac
achristensen@apple.com [Tue, 29 Mar 2016 00:19:05 +0000 (00:19 +0000)]
Fix Ninja build on Mac
https://bugs.webkit.org/show_bug.cgi?id=151399

Reviewed by Darin Adler.

.:

* Source/CMakeLists.txt:
* Source/cmake/WebKitMacros.cmake:

Source/WebCore:

* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
This moves WebCoreDerivedSources to a separate static library to reduce linker command
line lengths when using ninja on mac. This also helps Windows builds, which sometimes
regenerate everything every time you build; now you'll be able to just build WebCore
and WebKit without all the WebCoreDerivedSources stuff.

Source/WebKit:

* PlatformWin.cmake:

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

4 years agoFix build on some stricter compilers by removing unnecessary WTFMove.
beidson@apple.com [Mon, 28 Mar 2016 23:26:23 +0000 (23:26 +0000)]
Fix build on some stricter compilers by removing unnecessary WTFMove.
Opportunistically remove some unnecessary "WebCore::"s
Followup to r198762

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::keyPathAny):
(WebCore::IDBObjectStore::transaction):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::add):
(WebCore::IDBObjectStore::put):
(WebCore::IDBObjectStore::deleteFunction):
(WebCore::IDBObjectStore::clear):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
(WebCore::IDBObjectStore::count):
(WebCore::IDBObjectStore::doCount):

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

4 years agoModern IDB: Remove abstract base classes for all IDB DOM classes.
beidson@apple.com [Mon, 28 Mar 2016 22:49:04 +0000 (22:49 +0000)]
Modern IDB: Remove abstract base classes for all IDB DOM classes.
https://bugs.webkit.org/show_bug.cgi?id=155951

Reviewed by Alex Christensen.

Source/WebCore:

Refactor - No behavior change.

* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::indexedDB):
* Modules/indexeddb/IDBAny.cpp:
(WebCore::IDBAny::IDBAny):
(WebCore::IDBAny::~IDBAny):
(WebCore::IDBAny::idbDatabase):
(WebCore::IDBAny::domStringList):
(WebCore::IDBAny::idbCursor):
(WebCore::IDBAny::idbCursorWithValue):
(WebCore::IDBAny::idbFactory):
(WebCore::IDBAny::idbIndex):
(WebCore::IDBAny::idbObjectStore):
(WebCore::IDBAny::idbTransaction):
(WebCore::IDBAny::scriptValue):
(WebCore::IDBAny::integer):
(WebCore::IDBAny::string):
(WebCore::IDBAny::keyPath):
* Modules/indexeddb/IDBAny.h:
(WebCore::IDBAny::create):
(WebCore::IDBAny::createUndefined):
(WebCore::IDBAny::type):
(WebCore::IDBAny::~IDBAny): Deleted.
(WebCore::IDBAny::isLegacy): Deleted.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::create):
(WebCore::IDBCursor::IDBCursor):
(WebCore::IDBCursor::~IDBCursor):
(WebCore::IDBCursor::sourcesDeleted):
(WebCore::IDBCursor::effectiveObjectStore):
(WebCore::IDBCursor::transaction):
(WebCore::IDBCursor::direction):
(WebCore::IDBCursor::key):
(WebCore::IDBCursor::primaryKey):
(WebCore::IDBCursor::value):
(WebCore::IDBCursor::source):
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::uncheckedIterateCursor):
(WebCore::IDBCursor::deleteFunction):
(WebCore::IDBCursor::setGetResult):
(WebCore::IDBCursor::activeDOMObjectName):
(WebCore::IDBCursor::canSuspendForDocumentSuspension):
(WebCore::IDBCursor::hasPendingActivity):
(WebCore::IDBCursor::decrementOutstandingRequestCount):
* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::info):
(WebCore::IDBCursor::setRequest):
(WebCore::IDBCursor::clearRequest):
(WebCore::IDBCursor::request):
(WebCore::IDBCursor::isKeyCursor):
(WebCore::IDBCursor::~IDBCursor): Deleted.
(WebCore::IDBCursor::continueFunction): Deleted.
(WebCore::IDBCursor::isModernCursor): Deleted.
(WebCore::IDBCursor::hasPendingActivity): Deleted.
* Modules/indexeddb/IDBCursorWithValue.cpp:
(WebCore::IDBCursorWithValue::create):
(WebCore::IDBCursorWithValue::IDBCursorWithValue):
(WebCore::IDBCursorWithValue::~IDBCursorWithValue):
* Modules/indexeddb/IDBCursorWithValue.h:
(WebCore::IDBCursorWithValue::~IDBCursorWithValue): Deleted.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::create):
(WebCore::IDBDatabase::IDBDatabase):
(WebCore::IDBDatabase::~IDBDatabase):
(WebCore::IDBDatabase::hasPendingActivity):
(WebCore::IDBDatabase::name):
(WebCore::IDBDatabase::version):
(WebCore::IDBDatabase::objectStoreNames):
(WebCore::IDBDatabase::createObjectStore):
(WebCore::IDBDatabase::transaction):
(WebCore::IDBDatabase::deleteObjectStore):
(WebCore::IDBDatabase::close):
(WebCore::IDBDatabase::maybeCloseInServer):
(WebCore::IDBDatabase::activeDOMObjectName):
(WebCore::IDBDatabase::canSuspendForDocumentSuspension):
(WebCore::IDBDatabase::stop):
(WebCore::IDBDatabase::startVersionChangeTransaction):
(WebCore::IDBDatabase::didStartTransaction):
(WebCore::IDBDatabase::willCommitTransaction):
(WebCore::IDBDatabase::didCommitTransaction):
(WebCore::IDBDatabase::willAbortTransaction):
(WebCore::IDBDatabase::didAbortTransaction):
(WebCore::IDBDatabase::didCommitOrAbortTransaction):
(WebCore::IDBDatabase::fireVersionChangeEvent):
(WebCore::IDBDatabase::dispatchEvent):
(WebCore::IDBDatabase::didCreateIndexInfo):
(WebCore::IDBDatabase::didDeleteIndexInfo):
* Modules/indexeddb/IDBDatabase.h:
(WebCore::IDBDatabase::info):
(WebCore::IDBDatabase::databaseConnectionIdentifier):
(WebCore::IDBDatabase::serverConnection):
(WebCore::IDBDatabase::isClosingOrClosed):
(WebCore::IDBDatabase::~IDBDatabase): Deleted.
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::shouldThrowSecurityException):
(WebCore::IDBFactory::create):
(WebCore::IDBFactory::IDBFactory):
(WebCore::IDBFactory::getDatabaseNames):
(WebCore::IDBFactory::open):
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
(WebCore::IDBFactory::cmp):
* Modules/indexeddb/IDBFactory.h:
(WebCore::IDBFactory::~IDBFactory): Deleted.
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::IDBIndex):
(WebCore::IDBIndex::~IDBIndex):
(WebCore::IDBIndex::activeDOMObjectName):
(WebCore::IDBIndex::canSuspendForDocumentSuspension):
(WebCore::IDBIndex::hasPendingActivity):
(WebCore::IDBIndex::name):
(WebCore::IDBIndex::objectStore):
(WebCore::IDBIndex::keyPathAny):
(WebCore::IDBIndex::keyPath):
(WebCore::IDBIndex::unique):
(WebCore::IDBIndex::multiEntry):
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::count):
(WebCore::IDBIndex::doCount):
(WebCore::IDBIndex::openKeyCursor):
(WebCore::IDBIndex::get):
(WebCore::IDBIndex::doGet):
(WebCore::IDBIndex::getKey):
(WebCore::IDBIndex::doGetKey):
(WebCore::IDBIndex::markAsDeleted):
(WebCore::IDBIndex::ref):
(WebCore::IDBIndex::deref):
* Modules/indexeddb/IDBIndex.h:
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::openKeyCursor):
(WebCore::IDBIndex::info):
(WebCore::IDBIndex::modernObjectStore):
(WebCore::IDBIndex::isDeleted):
(WebCore::IDBIndex::~IDBIndex): Deleted.
(WebCore::IDBIndex::isModern): Deleted.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::create):
(WebCore::IDBObjectStore::IDBObjectStore):
(WebCore::IDBObjectStore::~IDBObjectStore):
(WebCore::IDBObjectStore::activeDOMObjectName):
(WebCore::IDBObjectStore::canSuspendForDocumentSuspension):
(WebCore::IDBObjectStore::hasPendingActivity):
(WebCore::IDBObjectStore::name):
(WebCore::IDBObjectStore::keyPathAny):
(WebCore::IDBObjectStore::keyPath):
(WebCore::IDBObjectStore::indexNames):
(WebCore::IDBObjectStore::transaction):
(WebCore::IDBObjectStore::autoIncrement):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::add):
(WebCore::IDBObjectStore::put):
(WebCore::IDBObjectStore::putForCursorUpdate):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::deleteFunction):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::modernDelete):
(WebCore::IDBObjectStore::clear):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::count):
(WebCore::IDBObjectStore::doCount):
(WebCore::IDBObjectStore::markAsDeleted):
(WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort):
(WebCore::IDBObjectStore::visitReferencedIndexes):
* Modules/indexeddb/IDBObjectStore.h:
(WebCore::IDBObjectStore::isDeleted):
(WebCore::IDBObjectStore::info):
(WebCore::IDBObjectStore::modernTransaction):
(WebCore::IDBObjectStore::~IDBObjectStore): Deleted.
(WebCore::IDBObjectStore::isModern): Deleted.
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::createDeleteRequest):
(WebCore::IDBOpenDBRequest::createOpenRequest):
(WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
(WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
(WebCore::IDBOpenDBRequest::onError):
(WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish):
(WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
(WebCore::IDBOpenDBRequest::dispatchEvent):
(WebCore::IDBOpenDBRequest::onSuccess):
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
(WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
(WebCore::IDBOpenDBRequest::requestCompleted):
(WebCore::IDBOpenDBRequest::requestBlocked):
* Modules/indexeddb/IDBOpenDBRequest.h:
(WebCore::IDBOpenDBRequest::databaseIdentifier):
(WebCore::IDBOpenDBRequest::version):
(WebCore::IDBOpenDBRequest::~IDBOpenDBRequest): Deleted.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::create):
(WebCore::IDBRequest::createCount):
(WebCore::IDBRequest::createGet):
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::~IDBRequest):
(WebCore::IDBRequest::result):
(WebCore::IDBRequest::errorCode):
(WebCore::IDBRequest::error):
(WebCore::IDBRequest::source):
(WebCore::IDBRequest::setSource):
(WebCore::IDBRequest::setVersionChangeTransaction):
(WebCore::IDBRequest::transaction):
(WebCore::IDBRequest::readyState):
(WebCore::IDBRequest::sourceObjectStoreIdentifier):
(WebCore::IDBRequest::sourceIndexIdentifier):
(WebCore::IDBRequest::requestedIndexRecordType):
(WebCore::IDBRequest::eventTargetInterface):
(WebCore::IDBRequest::activeDOMObjectName):
(WebCore::IDBRequest::canSuspendForDocumentSuspension):
(WebCore::IDBRequest::hasPendingActivity):
(WebCore::IDBRequest::stop):
(WebCore::IDBRequest::enqueueEvent):
(WebCore::IDBRequest::dispatchEvent):
(WebCore::IDBRequest::uncaughtExceptionInEventHandler):
(WebCore::IDBRequest::setResult):
(WebCore::IDBRequest::setResultToStructuredClone):
(WebCore::IDBRequest::setResultToUndefined):
(WebCore::IDBRequest::resultCursor):
(WebCore::IDBRequest::willIterateCursor):
(WebCore::IDBRequest::didOpenOrIterateCursor):
(WebCore::IDBRequest::requestCompleted):
(WebCore::IDBRequest::onError):
(WebCore::IDBRequest::onSuccess):
* Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::resourceIdentifier):
(WebCore::IDBRequest::connection):
(WebCore::IDBRequest::modernResult):
(WebCore::IDBRequest::pendingCursor):
(WebCore::IDBRequest::requestType):
(WebCore::IDBRequest::isOpenDBRequest):
(WebCore::IDBRequest::~IDBRequest): Deleted.
* Modules/indexeddb/IDBRequestCompletionEvent.cpp:
(WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent):
* Modules/indexeddb/IDBRequestCompletionEvent.h:
(WebCore::IDBRequestCompletionEvent::create):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::create):
(WebCore::IDBTransaction::IDBTransaction):
(WebCore::IDBTransaction::~IDBTransaction):
(WebCore::IDBTransaction::mode):
(WebCore::IDBTransaction::db):
(WebCore::IDBTransaction::serverConnection):
(WebCore::IDBTransaction::error):
(WebCore::IDBTransaction::objectStore):
(WebCore::IDBTransaction::abortDueToFailedRequest):
(WebCore::IDBTransaction::transitionedToFinishing):
(WebCore::IDBTransaction::abort):
(WebCore::IDBTransaction::abortOnServerAndCancelRequests):
(WebCore::IDBTransaction::activeDOMObjectName):
(WebCore::IDBTransaction::canSuspendForDocumentSuspension):
(WebCore::IDBTransaction::hasPendingActivity):
(WebCore::IDBTransaction::stop):
(WebCore::IDBTransaction::isActive):
(WebCore::IDBTransaction::isFinishedOrFinishing):
(WebCore::IDBTransaction::addRequest):
(WebCore::IDBTransaction::removeRequest):
(WebCore::IDBTransaction::scheduleOperation):
(WebCore::IDBTransaction::scheduleOperationTimer):
(WebCore::IDBTransaction::operationTimerFired):
(WebCore::IDBTransaction::commit):
(WebCore::IDBTransaction::commitOnServer):
(WebCore::IDBTransaction::finishAbortOrCommit):
(WebCore::IDBTransaction::didStart):
(WebCore::IDBTransaction::notifyDidAbort):
(WebCore::IDBTransaction::didAbort):
(WebCore::IDBTransaction::didCommit):
(WebCore::IDBTransaction::fireOnComplete):
(WebCore::IDBTransaction::fireOnAbort):
(WebCore::IDBTransaction::enqueueEvent):
(WebCore::IDBTransaction::dispatchEvent):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::createObjectStoreOnServer):
(WebCore::IDBTransaction::didCreateObjectStoreOnServer):
(WebCore::IDBTransaction::createIndex):
(WebCore::IDBTransaction::createIndexOnServer):
(WebCore::IDBTransaction::didCreateIndexOnServer):
(WebCore::IDBTransaction::requestOpenCursor):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::openCursorOnServer):
(WebCore::IDBTransaction::didOpenCursorOnServer):
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::iterateCursorOnServer):
(WebCore::IDBTransaction::didIterateCursorOnServer):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestGetValue):
(WebCore::IDBTransaction::requestGetKey):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::getRecordOnServer):
(WebCore::IDBTransaction::didGetRecordOnServer):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::getCountOnServer):
(WebCore::IDBTransaction::didGetCountOnServer):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::deleteRecordOnServer):
(WebCore::IDBTransaction::didDeleteRecordOnServer):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::clearObjectStoreOnServer):
(WebCore::IDBTransaction::didClearObjectStoreOnServer):
(WebCore::IDBTransaction::requestPutOrAdd):
(WebCore::IDBTransaction::putOrAddOnServer):
(WebCore::IDBTransaction::didPutOrAddOnServer):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::deleteObjectStoreOnServer):
(WebCore::IDBTransaction::didDeleteObjectStoreOnServer):
(WebCore::IDBTransaction::deleteIndex):
(WebCore::IDBTransaction::deleteIndexOnServer):
(WebCore::IDBTransaction::didDeleteIndexOnServer):
(WebCore::IDBTransaction::operationDidComplete):
(WebCore::IDBTransaction::establishOnServer):
(WebCore::IDBTransaction::activate):
(WebCore::IDBTransaction::deactivate):
* Modules/indexeddb/IDBTransaction.h:
(WebCore::IDBTransaction::info):
(WebCore::IDBTransaction::database):
(WebCore::IDBTransaction::originalDatabaseInfo):
(WebCore::IDBTransaction::isVersionChange):
(WebCore::IDBTransaction::isReadOnly):
(WebCore::IDBTransaction::isFinished):
(WebCore::TransactionActivator::TransactionActivator):
(WebCore::TransactionActivator::~TransactionActivator):
(WebCore::IDBTransaction::~IDBTransaction): Deleted.
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
(WebCore::IDBVersionChangeEvent::newVersion):
(WebCore::IDBVersionChangeEvent::eventInterface):
(WebCore::IDBVersionChangeEvent::create): Deleted.
* Modules/indexeddb/IDBVersionChangeEvent.h:
(isType):
* Modules/indexeddb/client/IDBAnyImpl.cpp: Removed.
* Modules/indexeddb/client/IDBAnyImpl.h: Removed.
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBCursorImpl.cpp: Removed.
* Modules/indexeddb/client/IDBCursorImpl.h: Removed.
* Modules/indexeddb/client/IDBCursorWithValueImpl.cpp: Removed.
* Modules/indexeddb/client/IDBCursorWithValueImpl.h: Removed.
* Modules/indexeddb/client/IDBDatabaseImpl.cpp: Removed.
* Modules/indexeddb/client/IDBDatabaseImpl.h: Removed.
* Modules/indexeddb/client/IDBFactoryImpl.cpp: Removed.
* Modules/indexeddb/client/IDBFactoryImpl.h: Removed.
* Modules/indexeddb/client/IDBIndexImpl.cpp: Removed.
* Modules/indexeddb/client/IDBIndexImpl.h: Removed.
* Modules/indexeddb/client/IDBObjectStoreImpl.cpp: Removed.
* Modules/indexeddb/client/IDBObjectStoreImpl.h: Removed.
* Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: Removed.
* Modules/indexeddb/client/IDBOpenDBRequestImpl.h: Removed.
* Modules/indexeddb/client/IDBRequestImpl.cpp: Removed.
* Modules/indexeddb/client/IDBRequestImpl.h: Removed.
* Modules/indexeddb/client/IDBTransactionImpl.cpp: Removed.
* Modules/indexeddb/client/IDBTransactionImpl.h: Removed.
* Modules/indexeddb/client/IDBVersionChangeEventImpl.cpp: Removed.
* Modules/indexeddb/client/IDBVersionChangeEventImpl.h: Removed.
* Modules/indexeddb/client/TransactionOperation.cpp:
* Modules/indexeddb/client/TransactionOperation.h:
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::objectStoreCursor):
(WebCore::IDBCursorInfo::indexCursor):
(WebCore::IDBCursorInfo::IDBCursorInfo):
* Modules/indexeddb/shared/IDBCursorInfo.h:
* Modules/indexeddb/shared/IDBRequestData.cpp:
(WebCore::IDBRequestData::IDBRequestData):
* Modules/indexeddb/shared/IDBRequestData.h:
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
* Modules/indexeddb/shared/IDBResourceIdentifier.h:
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
* Modules/indexeddb/shared/InProcessIDBServer.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSIDBCursorCustom.cpp:
(WebCore::JSIDBCursor::visitAdditionalChildren):
* bindings/js/JSIDBCursorWithValueCustom.cpp:
* bindings/js/JSIDBIndexCustom.cpp:
(WebCore::JSIDBIndex::visitAdditionalChildren):
* bindings/js/JSIDBObjectStoreCustom.cpp:
(WebCore::JSIDBObjectStore::visitAdditionalChildren):
* inspector/InspectorIndexedDBAgent.cpp:

Source/WebKit2:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:

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

4 years agoWeb Automation: add commands to move and resize a browsing context's window
bburg@apple.com [Mon, 28 Mar 2016 22:34:44 +0000 (22:34 +0000)]
Web Automation: add commands to move and resize a browsing context's window
https://bugs.webkit.org/show_bug.cgi?id=155349
<rdar://problem/25104911>

Reviewed by Timothy Hatcher.

Parse the new origin or size and request the window to change to the
new frame. This calls through to PageUIClient::setWindowFrame().

* UIProcess/Automation/Automation.json:
Add new enum values for protocol parsing error cases.
Add new commands.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
Added. Parse the incoming payload and bail if nothing would happen
or the values are not usable or out of range. Complain if a change
did not happen when the requested and actual size are different.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/WebPageProxy.h: Move setWindowFrame to be public.

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

4 years agoWeb Automation: split protocol object BrowsingContext.windowFrame into two separate...
bburg@apple.com [Mon, 28 Mar 2016 22:34:36 +0000 (22:34 +0000)]
Web Automation: split protocol object BrowsingContext.windowFrame into two separate members
https://bugs.webkit.org/show_bug.cgi?id=155952
<rdar://problem/25393597>

Reviewed by Timothy Hatcher.

Using the name 'windowFrame' causes conflicts with some Objective-C code.

* UIProcess/Automation/Automation.json:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::buildBrowsingContextForPage):

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

4 years ago[RTL Scrollbars] Position:sticky can be positioned under vertical RTL scrollbar
mmaxfield@apple.com [Mon, 28 Mar 2016 21:37:39 +0000 (21:37 +0000)]
[RTL Scrollbars] Position:sticky can be positioned under vertical RTL scrollbar
https://bugs.webkit.org/show_bug.cgi?id=155949

Reviewed by Simon Fraser.

Source/WebCore:

When performing sticky positioning logic, we were setting the clip rect's position
equal to the scrollPosition of the layer. This computation assumes that the top
left of the scroll position is the same as the top left of the clip rect. When
using RTL scrollbars, this is not true, so this code simply needs to be made aware
of the presence of an RTL scrollbar.

Tests: fast/scrolling/rtl-scrollbars-sticky-document-2.html
       fast/scrolling/rtl-scrollbars-sticky-document.html
       fast/scrolling/rtl-scrollbars-sticky-iframe-2.html
       fast/scrolling/rtl-scrollbars-sticky-iframe.html
       fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html
       fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):

LayoutTests:

* platform/ios-simulator/TestExpectations:
* fast/scrolling/rtl-scrollbars-sticky-document-2-expected.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-document-2.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-document-expected.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-document.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-iframe-2-expected.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-iframe-2.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-iframe-expected.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-iframe.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2-expected.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-expected.html: Added.
* fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html: Added.

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

4 years ago[CMake] Unreviewed build fix after r198736.
clopez@igalia.com [Mon, 28 Mar 2016 20:59:56 +0000 (20:59 +0000)]
[CMake] Unreviewed build fix after r198736.
https://bugs.webkit.org/show_bug.cgi?id=155221

Unreviewed.

* CMakeLists.txt: Fix typo, add WebAutomationSession.cpp and declare JavaScriptCore_SCRIPTS_DIR.
* WebProcess/Automation/WebAutomationSessionProxy.h: Add missing include.

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

4 years agoRename PlatformWheelEvent::isEndGesture to isEndOfMomentumScroll.
tonikitoo@webkit.org [Mon, 28 Mar 2016 20:58:05 +0000 (20:58 +0000)]
Rename PlatformWheelEvent::isEndGesture to isEndOfMomentumScroll.
https://bugs.webkit.org/show_bug.cgi?id=155940

Reviewed by Simon Fraser.

No new tests needed.

The new name better reflects its purpose. Also it is a preparation to fix bug 155746.

* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::shouldResetLatching):
(WebCore::PlatformWheelEvent::isEndOfMomentumScroll: Renamed; Formally isEndGesture.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::gestureShouldBeginSnap):

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

4 years agoUse std::exchange for std::functions instead of WTFMove
achristensen@apple.com [Mon, 28 Mar 2016 20:32:56 +0000 (20:32 +0000)]
Use std::exchange for std::functions instead of WTFMove
https://bugs.webkit.org/show_bug.cgi?id=155950
rdar://problem/25348817

Reviewed by Anders Carlsson.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::convertTaskToDownload):
(WebKit::NetworkLoad::setPendingDownloadID):
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
This makes the member variable nullptr when the value is moved so we don't use it again.

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

4 years agoWeb Automation: report the browsing context's window frame (size and origin)
bburg@apple.com [Mon, 28 Mar 2016 18:52:12 +0000 (18:52 +0000)]
Web Automation: report the browsing context's window frame (size and origin)
https://bugs.webkit.org/show_bug.cgi?id=155323
<rdar://problem/25094089>

Reviewed by Timothy Hatcher.

To prepare for implementing resize and move commands, add a
windowFrame member to the browsing context protocol type.

* UIProcess/Automation/Automation.json:
Add a frame Rect to BrowsingContext.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::handleForWebPageProxy):
(WebKit::WebAutomationSession::buildBrowsingContextForPage):
Extract the code to build a BrowsingContext object. Add
code to calculate and insert the page's window frame size.

(WebKit::WebAutomationSession::getBrowsingContexts):
(WebKit::WebAutomationSession::getBrowsingContext):
(WebKit::WebAutomationSession::createBrowsingContext):
(WebKit::WebAutomationSession::switchToBrowsingContext):
Refactoring as above.

* UIProcess/Automation/WebAutomationSession.h:
Adjust signatures.

* UIProcess/WebPageProxy.h: Make getWindowFrame public.

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

4 years agoSetup cloned continuation renderer properly.
zalan@apple.com [Mon, 28 Mar 2016 18:39:21 +0000 (18:39 +0000)]
Setup cloned continuation renderer properly.
https://bugs.webkit.org/show_bug.cgi?id=155640

Reviewed by Simon Fraser.

Set the "renderer has outline ancestor" flag on the cloned inline renderer when
we split the original renderer for continuation.
It ensures that when the cloned part of the continuation requests repaint, we properly
invalidate the ancestor outline (if needed).

Source/WebCore:

Test: fast/inline/outline-with-continuation-assert.html

* rendering/RenderInline.cpp:
(WebCore::RenderInline::clone):

LayoutTests:

* fast/inline/outline-with-continuation-assert-expected.txt: Added.
* fast/inline/outline-with-continuation-assert.html: Added.

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

4 years agoWeb Inspector: protocol generator should generate C++ string-to-enum helper functions
bburg@apple.com [Mon, 28 Mar 2016 18:21:08 +0000 (18:21 +0000)]
Web Inspector: protocol generator should generate C++ string-to-enum helper functions
https://bugs.webkit.org/show_bug.cgi?id=155691
<rdar://problem/25258078>

Reviewed by Timothy Hatcher.

There's a lot of code throughout the Inspector agents and automation code
that needs to convert a raw string into a typed protocol enum. Generate
some helpers that do this conversion so clients can move over to using it.

These helpers are necessary for when we eventually switch to calling backend
dispatcher handlers with typed arguments instead of untyped JSON objects.

To correctly generate a conversion function for an anonymous enum, the
generator needs to be able to get the containing object type's declaration.
Since the model's Type object each have only one instance, there is a
one-to-one association between type and its declaration.

* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
(CppProtocolTypesHeaderGenerator.generate_output):
(CppProtocolTypesHeaderGenerator._generate_forward_declarations):
Clean up this method to use methodcaller to sort types by raw name.

(_generate_declarations_for_enum_conversion_methods):
(_generate_declarations_for_enum_conversion_methods.return_type_with_export_macro):
(_generate_declarations_for_enum_conversion_methods.type_member_is_anonymous_enum_type):
Added. Generates a new section with an unfilled template and specializations of
the template for every named and anonymous enum in every domain. Guards for
domains wrap the forward declarations. This is added to the end of the header
file so that specializations for both types of enums are in the same place.

* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator.generate_output):
(CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain):
(CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain.type_member_is_anonymous_enum_type):
(CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain.generate_conversion_method_body):
Added. Generate a static array of offsets into the enum constant value array.
Then, loop over this array of offsets and do string comparisons against the
provided string and enum constant values at the relevant offsets for this enum.

* inspector/scripts/codegen/generator_templates.py:
(GeneratorTemplates): Update copyright year in generated files.

* inspector/scripts/codegen/models.py:
(AliasedType.__init__):
(EnumType.__init__):
(EnumType.enum_values):
(EnumType.declaration):
(ArrayType.__init__):
(ArrayType.declaration):
(ObjectType.__init__):
(ObjectType.declaration):
(Protocol.resolve_types):
(Protocol.lookup_type_reference):
Pass the type declaration to Type constructors if available. If not,
fill in a placeholder name for the type in the constructor instead of caller.

Rebaseline all the things, mostly for copyright block changes.

* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:

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

4 years agoWeb Inspector: Use font-variant-numeric: tabular-nums instead of -apple-system-monosp...
nvasilyev@apple.com [Mon, 28 Mar 2016 18:01:41 +0000 (18:01 +0000)]
Web Inspector: Use font-variant-numeric: tabular-nums instead of -apple-system-monospaced-numbers
https://bugs.webkit.org/show_bug.cgi?id=155826
<rdar://problem/25330631>

Reviewed by Myles C. Maxfield.

* UserInterface/Views/CodeMirrorOverrides.css:
(.CodeMirror .CodeMirror-linenumber):
* UserInterface/Views/DataGrid.css:
(.data-grid td):
* UserInterface/Views/DefaultDashboardView.css:
(.toolbar .dashboard.default > .item):
* UserInterface/Views/ObjectTreeArrayIndexTreeElement.css:
(.object-tree-array-index .index-name):

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

4 years agoWeb Inspector: Add font-variant-numeric to CSS autocompletions
nvasilyev@apple.com [Mon, 28 Mar 2016 17:49:17 +0000 (17:49 +0000)]
Web Inspector: Add font-variant-numeric to CSS autocompletions
https://bugs.webkit.org/show_bug.cgi?id=155941
<rdar://problem/25381735>

Reviewed by Timothy Hatcher.

Also, remove -apple-system-monospaced-numbers.
`font-variant-numeric: tabular-nuns` should be used instead.

* UserInterface/Models/CSSKeywordCompletions.js:

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

4 years agoMarking transitions/cancel-transition.html as flaky on ios-sim-wk2
ryanhaddad@apple.com [Mon, 28 Mar 2016 17:48:55 +0000 (17:48 +0000)]
Marking transitions/cancel-transition.html as flaky on ios-sim-wk2
https://bugs.webkit.org/show_bug.cgi?id=155948

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoREGRESSION (r195303): Web Inspector: Wrong indentation in the type coverage profiler...
mattbaker@apple.com [Mon, 28 Mar 2016 17:47:53 +0000 (17:47 +0000)]
REGRESSION (r195303): Web Inspector: Wrong indentation in the type coverage profiler popovers
https://bugs.webkit.org/show_bug.cgi?id=155930
<rdar://problem/25377042>

Reviewed by Timothy Hatcher.

Increased specificity of TypeTreeView CSS selectors, and added new
overrides for rules made global by r195303, which don't apply to the
TypeTreeView's or its tree elements.

* UserInterface/Views/TypeTreeElement.css:
(.item.type-tree-element):
(.item.type-tree-element > .titles):
(.item.type-tree-element > .disclosure-button):
(.item.type-tree-element.parent > .disclosure-button):
(.item.type-tree-element.parent.expanded > .disclosure-button):
(.item.type-tree-element > .icon):
(.item.type-tree-element.prototype):
(.item.type-tree-element.prototype:focus):
(.item.type-tree-element.prototype + ol):
(.type-tree-element): Deleted.
(.type-tree-element > .titles): Deleted.
(.type-tree-element > .disclosure-button): Deleted.
(.type-tree-element.parent > .disclosure-button): Deleted.
(.type-tree-element.parent.expanded > .disclosure-button): Deleted.
(.type-tree-element > .icon): Deleted.
(.type-tree-element.prototype): Deleted.
(.type-tree-element.prototype:focus): Deleted.
(.type-tree-element.prototype + ol): Deleted.

* UserInterface/Views/TypeTreeView.css:
(.tree-outline.type li):

* UserInterface/Views/TypeTreeView.js:
(WebInspector.TypeTreeView):
Use custom indentation.

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

4 years agoWeb Inspector: Large repaints while typing in the console tab
nvasilyev@apple.com [Mon, 28 Mar 2016 17:46:01 +0000 (17:46 +0000)]
Web Inspector: Large repaints while typing in the console tab
https://bugs.webkit.org/show_bug.cgi?id=155627
<rdar://problem/25234875>

Reviewed by Timothy Hatcher.

Specify the height of flexbox elements to reduce repaint areas.

* UserInterface/Views/Main.css:
(#navigation-sidebar):
(#content): z-index doesn't affect repaint areas once the height is set.
(#details-sidebar):

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

4 years agoMarking fast/loader/scroll-position-restored-on-back.html as flaky on ios-sim debug WK2
ryanhaddad@apple.com [Mon, 28 Mar 2016 17:44:03 +0000 (17:44 +0000)]
Marking fast/loader/scroll-position-restored-on-back.html as flaky on ios-sim debug WK2
https://bugs.webkit.org/show_bug.cgi?id=155947

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoInspector Memory Timeline sometimes encounters unstoppable rAF drawing
simon.fraser@apple.com [Mon, 28 Mar 2016 17:17:51 +0000 (17:17 +0000)]
Inspector Memory Timeline sometimes encounters unstoppable rAF drawing
https://bugs.webkit.org/show_bug.cgi?id=155906

Reviewed by Anders Carlsson.

It was possible to get Web Inspector into a state where repeated, expensive
requestAnimationFrame calls prevented user events from being handled, making it
unresponsive.

requestAnimationFrame uses callOnMainThread() to get a notification from the
CVDispayLink thread to the main thread, which is a -performSelectorOnMainThread...
Under the hood, this ends up as a CFRunLoopPerformBlock().

User events come in via Connection::enqueueIncomingMessage(), which uses RunLoop::main()::dispatch(),
which uses a CFRunLoopSource. Evidently, repeated calls to CFRunLoopPerformBlock() can prevent the
CFRunLoopSource from being handled.

Fix by moving requestAnimationFrame from callOnMainThread() to RunLoop::main()::dispatch().

* platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
(WebCore::DisplayRefreshMonitorMac::displayLinkFired):

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

4 years agoAdd myself as reviewer
jdiggs@igalia.com [Mon, 28 Mar 2016 17:15:50 +0000 (17:15 +0000)]
Add myself as reviewer

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

4 years agoUnreviewed, fix the build.
bburg@apple.com [Mon, 28 Mar 2016 16:34:58 +0000 (16:34 +0000)]
Unreviewed, fix the build.

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
InspectorProtocolObjects.h was renamed to AutomationProtocolObjects.h.

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

4 years agoUnreviewed rebaselining; Different track IDs are selected in El Capitan.
jer.noble@apple.com [Mon, 28 Mar 2016 16:15:01 +0000 (16:15 +0000)]
Unreviewed rebaselining; Different track IDs are selected in El Capitan.

* platform/mac/media/track/video-track-alternate-groups-expected.txt: Added.

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

4 years agoDisk cache speculative validation requests do not have the 'Referer' HTTP header set
cdumez@apple.com [Mon, 28 Mar 2016 16:04:33 +0000 (16:04 +0000)]
Disk cache speculative validation requests do not have the 'Referer' HTTP header set
https://bugs.webkit.org/show_bug.cgi?id=155890
<rdar://problem/25279962>

Reviewed by Antti Koivisto.

Source/WebCore:

Export a couple more symbols so we can use them from WebKit2.

* platform/network/HTTPHeaderMap.h:
* platform/network/ResourceRequestBase.h:

Source/WebKit2:

Disk cache speculative validation requests did not have the 'Referer'
HTTP header set. This was breaking some streaming sites (such as
twitch.tv).

We now store all the original request's HTTP headers in the disk cache
so we can re-use them for the speculative validation requests. When the
actual request comes later on, we also make sure that the HTTP headers
used in the speculative validation request match the ones from the
effective request. If they don't we don't use the speculatively
validated resource as the server may return a different resource in
such case.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::retrieve):
Pass the effective ResourceRequest to the NetworkCacheSpeculativeLoadManager
so it can check that the speculative validation request's HTTP headers
match the effective request's headers.

* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::constructRevalidationRequest):
(WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
(WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::wasRevalidated):
We now have a member in PreloadedEntry to keep the request used for validation, if
speculative validation was done. This is so that we can compare its HTTP headers
with the ones of the effective request later on.

(WebKit::NetworkCache::dumpHTTPHeadersDiff):
Debug function that prints which HTTP headers did not match in the speculative
validation request and in the effective request.

(WebKit::NetworkCache::requestsHeadersMatch):
New utility function to check that the speculative validation request's HTTP
headers match the ones of the effective requests. Note that we allow for
headers related to validation to differ.

(WebKit::NetworkCache::SpeculativeLoadManager::canUsePreloadedEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::canUsePendingPreload):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
Check that the speculative validation request's HTTP headers match the
ones of the effective request. If they don't then do not use the
speculatively validated resource.

(WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:

* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode):
(WebKit::NetworkCache::SubresourceInfo::decode):
(WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
(WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
- Keep all the request's headers in SubresourceInfo instead of just the
  'User-Agent' one.
- Drop the custom copy constructor / assignment operator for
  SubresourceInfo that were making isolated copies on the members.
  We technically don't need to use SubresourceInfo objects in other
  threads than the main one. In SpeculativeLoadManager::preloadEntry(),
  we now make capture a SubresourceInfo* in the lambda to avoid calling
  the copy constructor. We also make sure that the object gets destroyed
  in the lambda function, which is executed in the main thread.

LayoutTests:

Update existing layout test to make sure that speculative validation
requests have their HTTP 'Referer' header set.

* http/tests/cache/disk-cache/speculative-validation/validation-request-expected.txt:
* http/tests/cache/disk-cache/speculative-validation/validation-request.html:

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

4 years agoWeb Automation: Add Automation protocol commands to handle JavaScript dialogs
timothy@apple.com [Mon, 28 Mar 2016 15:57:49 +0000 (15:57 +0000)]
Web Automation: Add Automation protocol commands to handle JavaScript dialogs

https://bugs.webkit.org/show_bug.cgi?id=155888
rdar://problem/25360218

Reviewed by Brian Burg.

* UIProcess/API/APIAutomationSessionClient.h:
(API::AutomationSessionClient::isShowingJavaScriptDialogOnPage): Added.
(API::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage): Added.
(API::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage): Added.
(API::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage): Added.
(API::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage): Added.

* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:

* UIProcess/Automation/Automation.json: Added new commands.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::isShowingJavaScriptDialog): Added.
(WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog): Added.
(WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog): Added.
(WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog): Added.
(WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt): Added.
* UIProcess/Automation/WebAutomationSession.h:

* UIProcess/Cocoa/AutomationSessionClient.h:
* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient): Added.
(WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage): Added.
(WebKit::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage): Added.
(WebKit::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage): Added.
(WebKit::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage): Added.
(WebKit::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage): Added.

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

4 years agoWeb Automation: Add commands to compute layout of an element
timothy@apple.com [Mon, 28 Mar 2016 15:57:37 +0000 (15:57 +0000)]
Web Automation: Add commands to compute layout of an element

https://bugs.webkit.org/show_bug.cgi?id=155841
rdar://problem/25340075

Reviewed by Brian Burg.

Source/WebCore:

* dom/Element.h: Mark scrollIntoViewIfNeeded() method as exported so WK2 can use it.
* platform/ScrollView.h: Mark rootViewToContents(IntRect) method as exported so WK2 can use it.

Source/WebKit2:

* UIProcess/Automation/Automation.json: Added computeElementLayout.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::computeElementLayout): Added.
(WebKit::WebAutomationSession::didComputeElementLayout): Added.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.messages.in:
(DidComputeElementLayout): Added.

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::computeElementLayout): Added.
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.messages.in:
(ComputeElementLayout): Added.

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

4 years agoWeb Automation: Add Automation protocol commands to resolve frames as handles
timothy@apple.com [Mon, 28 Mar 2016 15:57:23 +0000 (15:57 +0000)]
Web Automation: Add Automation protocol commands to resolve frames as handles

https://bugs.webkit.org/show_bug.cgi?id=155650
rdar://problem/25242422

Reviewed by Brian Burg.

Source/WebCore:

* page/DOMWindow.h: Marked focus() method as exported so WK2 can use them.
* page/FrameTree.h: Marked scopedChild() methods as exported so WK2 can use them.

Source/WebKit2:

* UIProcess/Automation/Automation.json:
Added resolveFrameHandle and resolveParentFrameHandle.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::webFrameProxyForHandle): Added.
(WebKit::WebAutomationSession::handleForWebFrameID): Added.
(WebKit::WebAutomationSession::handleForWebFrameProxy): Added.
(WebKit::WebAutomationSession::evaluateJavaScriptFunction): Use frame handles now.
(WebKit::WebAutomationSession::resolveChildFrameHandle): Added.
(WebKit::WebAutomationSession::didChildResolveFrame): Added.
(WebKit::WebAutomationSession::resolveParentFrameHandle): Added.
(WebKit::WebAutomationSession::didResolveParentFrame): Added.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.messages.in:
(DidResolveChildFrame): Added.
(DidResolveParentFrame): Added.

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::elementForNodeHandle): Added.
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal): Added.
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle): Added.
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithName): Added.
(WebKit::WebAutomationSessionProxy::resolveParentFrame): Added.
(WebKit::WebAutomationSessionProxy::focusFrame): Added.
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.messages.in:
(ResolveChildFrameWithOrdinal): Added.
(ResolveChildFrameWithNodeHandle): Added.
(ResolveChildFrameWithName): Added.
(ResolveParentFrame): Added.
(FocusFrame): Added.

* WebProcess/Automation/WebAutomationSessionProxy.js:
(AutomationSessionProxy.prototype.nodeForIdentifier): Added.
Public method that eats the exception thrown by the private method.

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

4 years agoWeb Automation: Add Automation.evaluateJavaScriptFunction
timothy@apple.com [Mon, 28 Mar 2016 15:57:06 +0000 (15:57 +0000)]
Web Automation: Add Automation.evaluateJavaScriptFunction

https://bugs.webkit.org/show_bug.cgi?id=155524
rdar://problem/25181888

Reviewed by Joseph Pecoraro.

* UIProcess/Automation/Automation.json: Added evaluateJavaScriptFunction command.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::evaluateJavaScriptFunction): Added.
(WebKit::WebAutomationSession::didEvaluateJavaScriptFunction): Added.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.messages.in: Added didEvaluateJavaScriptFunction.

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::toJSArray): Added.
(WebKit::callPropertyFunction): Added.
(WebKit::evaluateJavaScriptCallback): Added.
(WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame): Dispatch pending callbacks as errors.
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Added.
(WebKit::WebAutomationSessionProxy::didEvaluateJavaScriptFunction): Added.
* WebProcess/Automation/WebAutomationSessionProxy.h:

* WebProcess/Automation/WebAutomationSessionProxy.js:
(AutomationSessionProxy): Added maps for node handles.
(AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Added.
(AutomationSessionProxy.prototype._jsonParse): Added.
(AutomationSessionProxy.prototype._jsonStringify): Added.
(AutomationSessionProxy.prototype._reviveJSONValue): Added.
(AutomationSessionProxy.prototype._replaceJSONValue): Added.
(AutomationSessionProxy.prototype._createNodeHandle): Added.
(AutomationSessionProxy.prototype._nodeForIdentifier): Added.
(AutomationSessionProxy.prototype._identifierForNode): Added.

* WebProcess/Automation/WebAutomationSessionProxy.messages.in: Added evaluateJavaScriptFunction.

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

4 years agoAdd WebAutomationSessionProxy for WebProcess side automation tasks
timothy@apple.com [Mon, 28 Mar 2016 15:56:53 +0000 (15:56 +0000)]
Add WebAutomationSessionProxy for WebProcess side automation tasks

https://bugs.webkit.org/show_bug.cgi?id=155221
rdar://problem/25054868

Reviewed by Joseph Pecoraro.

* CMakeLists.txt: Add build step to build-in WebAutomationSessionProxy.js.
* DerivedSources.make: Ditto.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::~WebAutomationSession):
(WebKit::WebAutomationSession::setProcessPool): Add / remove message receiver.
* UIProcess/Automation/WebAutomationSession.h:

* UIProcess/Automation/WebAutomationSession.messages.in: Added.
Test message to get things to build.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::removeMessageReceiver):
(WebKit::WebProcessPool::setAutomationSession):
* UIProcess/WebProcessPool.h:

* WebKit2.xcodeproj/project.pbxproj: Added new files.

* WebProcess/Automation/WebAutomationSessionProxy.cpp: Added.
(WebKit::toJSString):
(WebKit::toJSValue):
(WebKit::WebAutomationSessionProxy::WebAutomationSessionProxy):
(WebKit::WebAutomationSessionProxy::~WebAutomationSessionProxy):
(WebKit::evaluate):
(WebKit::createUUID):
(WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
(WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
Create a script object per frame that is evaluated from WebAutomationSessionProxy.js.
Clear the script object when the window object is cleared.

* WebProcess/Automation/WebAutomationSessionProxy.h: Added.
(WebKit::WebAutomationSessionProxy::test):
Added test message to let the messages files build.

* WebProcess/Automation/WebAutomationSessionProxy.js: Added.

* WebProcess/Automation/WebAutomationSessionProxy.messages.in: Added.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
Call WebAutomationSessionProxy::didClearWindowObjectForFrame to clear the script object.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureAutomationSessionProxy):
(WebKit::WebProcess::destroyAutomationSessionProxy):
Creates and destroys the WebAutomationSessionProxy when the UIProcess WebAutomationSession
is set or removed on the WebProcessPool.

* WebProcess/WebProcess.h:
(WebKit::WebProcess::automationSessionProxy): Added.

* WebProcess/WebProcess.messages.in: Added. Test message to get things to build.

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

4 years agoRemove USE(TEXTURE_MAPPER) guards inside TextureMapper sources.
commit-queue@webkit.org [Mon, 28 Mar 2016 15:23:01 +0000 (15:23 +0000)]
Remove USE(TEXTURE_MAPPER) guards inside TextureMapper sources.
https://bugs.webkit.org/show_bug.cgi?id=155944

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-03-28
Reviewed by Michael Catanzaro.

After r196429 TextureMapper sources are built only in ports which actually
use TextureMapper, so USE(TEXTURE_MAPPER) guards in them are redundant now.

No new tests needed.

* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapper.cpp:
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperBackingStore.cpp:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
* platform/graphics/texmap/TextureMapperFPSCounter.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/TextureMapperTile.cpp:
* platform/graphics/texmap/TextureMapperTile.h:
* platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:

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

4 years ago[EFL] Mark failing indexeddb tests to failure
gyuyoung.kim@webkit.org [Mon, 28 Mar 2016 14:06:42 +0000 (14:06 +0000)]
[EFL] Mark failing indexeddb tests to failure

Unreviewed EFL gardening.

Additionally a shadow dom test is marked to failure because shadow dom is not enabled on EFL port yet.

* platform/efl/TestExpectations:

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

4 years agoTried to fix the build after r198728.
mitz@apple.com [Mon, 28 Mar 2016 14:03:25 +0000 (14:03 +0000)]
Tried to fix the build after r198728.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::gestureEvent):

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

4 years ago[css-grid] Remove unneeded lines in offsetAndBreadthForPositionedChild()
rego@igalia.com [Mon, 28 Mar 2016 11:22:45 +0000 (11:22 +0000)]
[css-grid] Remove unneeded lines in offsetAndBreadthForPositionedChild()
https://bugs.webkit.org/show_bug.cgi?id=155788

Reviewed by Sergio Villar Senin.

Just remove 2 lines/variables that were not needed at all in
RenderGrid::offsetAndBreadthForPositionedChild().

No new tests, no change of behavior.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):

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

4 years ago[EFL] Remove the more passed tests after r198728
hs85.jeong@samsung.com [Mon, 28 Mar 2016 08:45:44 +0000 (08:45 +0000)]
[EFL] Remove the more passed tests after r198728

Unreviewed EFL gardening.

* platform/efl/TestExpectations:

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

4 years agoUnreviewed GTK build fix for the threaded compositor feature after r198655.
zandobersek@gmail.com [Mon, 28 Mar 2016 08:02:45 +0000 (08:02 +0000)]
Unreviewed GTK build fix for the threaded compositor feature after r198655.
Adjust the first parameter of ThreadSafeCoordinatedSurface::copyToTexture().

* Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
(WebKit::ThreadSafeCoordinatedSurface::copyToTexture):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h:

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

4 years agoRemoved redundant #if conditions in ANGLEWebKitBridge.h
commit-queue@webkit.org [Mon, 28 Mar 2016 06:47:34 +0000 (06:47 +0000)]
Removed redundant #if conditions in ANGLEWebKitBridge.h
https://bugs.webkit.org/show_bug.cgi?id=155880

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-03-27
Reviewed by Csaba Osztrogon√°c.

GTK, Efl, AppleWin, and WinCairo ports can be built only with cmake,
so condition !defined(BUILDING_WITH_CMAKE) implies
!PLATFORM(GTK) && !PLATFORM(EFL) && !PLATOFRM(WIN).

No new tests needed.

* platform/graphics/ANGLEWebKitBridge.h:

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

4 years ago[EFL] REGRESSION(r188793): It made 200 layout tests and Bindings/event-target-wrapper...
hs85.jeong@samsung.com [Mon, 28 Mar 2016 05:59:51 +0000 (05:59 +0000)]
[EFL] REGRESSION(r188793): It made 200 layout tests and Bindings/event-target-wrapper.html performance test fail
PerformanceTests:

https://bugs.webkit.org/show_bug.cgi?id=148470

Reviewed by Darin Adler.

* Skipped: Unskip the Bindings/event-target-wrapper test.

Source/WebKit2:

https://bugs.webkit.org/show_bug.cgi?id=148470

Reviewed by Darin Adler.

UI events are suppressed in webPage after r188793.
I revert the r136133 for passing the events to WebPage

* WebProcess/WebPage/WebPage.cpp: Removed the codes which was uploaded at r136133.
(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::wheelEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::touchEvent):
(WebKit::WebPage::canHandleUserEvents): Deleted.
* WebProcess/WebPage/WebPage.h:

LayoutTests:

https://bugs.webkit.org/show_bug.cgi?id=148470

Reviewed by Darin Adler.

* platform/efl/TestExpectations: Unskip the passed tests.

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

4 years agoWebKit.xcworkspace "All Source" scheme always copies OS X WebKitSystemInterface libraries
dbates@webkit.org [Mon, 28 Mar 2016 05:07:10 +0000 (05:07 +0000)]
WebKit.xcworkspace "All Source" scheme always copies OS X WebKitSystemInterface libraries
https://bugs.webkit.org/show_bug.cgi?id=155889

Reviewed by Alexey Proskuryakov.

Fixes an issue where building the "All Source" scheme in WebKit.xcworkspace would
always copy the OS X WebKitSystemInterface libraries regardless of the selected
base SDK. In particular, it would copy the OS X WebKitSystemInterface libraries
when building with SDK iphonesimulator. WebKit.xcworkspace should copy the SDK-
specific WebKitSystemInterface libraries.

* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:

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

4 years ago[EFL][AX] Mark AX failing tests to failure
gyuyoung.kim@webkit.org [Mon, 28 Mar 2016 02:31:44 +0000 (02:31 +0000)]
[EFL][AX] Mark AX failing tests to failure

Unreveiwed EFL gardening.

* platform/efl/TestExpectations:

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

4 years agoMark rtl-scrollbar's tests to pass with incorrectly
gyuyoung.kim@webkit.org [Sun, 27 Mar 2016 14:32:41 +0000 (14:32 +0000)]
Mark rtl-scrollbar's tests to pass with incorrectly

Unreviewed EFL gardening.

* platform/efl/TestExpectations: Though rtl scrollbar isn't supported by EFL yet, it has been passed.

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

4 years agoTried to fix the build.
mitz@apple.com [Sun, 27 Mar 2016 03:07:04 +0000 (03:07 +0000)]
Tried to fix the build.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):

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

4 years agoTried to fix the build.
mitz@apple.com [Sun, 27 Mar 2016 02:13:01 +0000 (02:13 +0000)]
Tried to fix the build.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _takeViewSnapshot]):

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

4 years agoMac CMake build fix.
achristensen@apple.com [Sun, 27 Mar 2016 01:05:12 +0000 (01:05 +0000)]
Mac CMake build fix.

* PlatformMac.cmake:
Link with AVFoundation libraries.

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

4 years agoFix the build by removing the #endif I left in on my last attempt.
dino@apple.com [Sun, 27 Mar 2016 00:59:41 +0000 (00:59 +0000)]
Fix the build by removing the #endif I left in on my last attempt.

* UIProcess/API/Cocoa/WKWebView.mm:

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

4 years agoFix build after my most recent commit.
dino@apple.com [Sun, 27 Mar 2016 00:44:49 +0000 (00:44 +0000)]
Fix build after my most recent commit.

* UIProcess/API/Cocoa/WKWebView.mm:
(WebKit::bufferFormat): Delete the WebKitAdditions include.

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

4 years agoMove extended color detection into Open Source
dino@apple.com [Sat, 26 Mar 2016 23:50:38 +0000 (23:50 +0000)]
Move extended color detection into Open Source
https://bugs.webkit.org/show_bug.cgi?id=155909
<rdar://problem/25369754>

Reviewed by Anders Carlsson.

The code for detecting extended color displays
was hidden while the iPad Pro 9.7" was in development.
Now it is public, move the detection to Open Source.

While doing this, add a new method to PlatformScreen
so that we have a more obvious way to detect such
displays.

Source/WebCore:

* platform/PlatformScreen.h: Add screenSupportsExtendedColor.

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::commonInit): Set the backing
store format to the RGBA10XR if we're on an extended
display.
* platform/ios/LegacyTileGridTile.mm:
(WebCore::LegacyTileGridTile::LegacyTileGridTile): Ditto.
(WebCore::setBackingStoreFormat): Deleted. Now set directly
in the constructor.

* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenDepthPerComponent): Cleanup.
(WebCore::screenSupportsExtendedColor): Implement the
iOS version of this using MobileGestalt.

* platform/mac/PlatformScreenMac.mm:
(WebCore::displayFromWidget): Whitespace cleanup.
(WebCore::screenForWidget):
(WebCore::screenForWindow):
(WebCore::screenSupportsExtendedColor): Default implementation
returns false for all screens at the moment.

* platform/spi/cocoa/QuartzCoreSPI.h: New constant.
* platform/spi/ios/MobileGestaltSPI.h: Ditto.

Source/WebKit2:

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::bufferFormat): No need to use WebKitAdditions any
more.

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

4 years ago2016-03-26 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Sat, 26 Mar 2016 20:07:25 +0000 (20:07 +0000)]
2016-03-26  Geoffrey Garen  <ggaren@apple.com>

        Unreviewed, rolling out r198702, r198704.

        Caused a memory regression on PLUM.

        Reverted changeset:

        bmalloc: fix an ASSERT on iOS
        https://bugs.webkit.org/show_bug.cgi?id=155911
        http://trac.webkit.org/changeset/198704

        bmalloc: support physical page sizes that don't match the virtual page size
        https://bugs.webkit.org/show_bug.cgi?id=155898
        http://trac.webkit.org/changeset/198702

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

4 years ago[OS X] Layout sometimes flakily assumes overlay scrollbars when clicky-scroll-wheel...
mmaxfield@apple.com [Sat, 26 Mar 2016 18:37:03 +0000 (18:37 +0000)]
[OS X] Layout  sometimes flakily assumes overlay scrollbars when clicky-scroll-wheel-mouse is attached and system preference detects scrollbar mode
https://bugs.webkit.org/show_bug.cgi?id=155912

Reviewed by Simon Fraser.

When the system preference is set to detect the scrollbar type (overlay or
always-on, and a clicky scroll wheel mouse is connected, AppKit
asynchronously tells all the NSScrollerImpPairs about the kind of scrollbar
it should be using. However, when this notification is delivered, it may
be in between FrameViews, which means we may not have any
NSScrollerImpPairs created to listen to the notification.

r198444 solved this by asking if we missed any update whenever we create
an NSScrollerImpPair. This works partially; however, there is a significant
amount of layout which occurs before we create the first ScrollAnimatorMac.
This layout will ask the ScrollbarThemeMac if overlay scrollbars are
enabled, and the results will be stale (because we haven't created any the
NSScrollerImpPairs yet).

Luckly, AppKit fires a notification when it discovers what kind of
scrollbars should be used. We can rely on this notification in the event
that we don't have any NSScrollerImpPairs created.

Covered (as best as possible) by existing RTL scrollbar tests. However,
the system preference that governs this is not currently testable.

* platform/mac/ScrollbarThemeMac.mm:
(+[WebScrollbarPrefsObserver registerAsObserver]):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):  Remove the old code.

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

4 years agoRemove duplicated tests in EFL TextExpectations.
gyuyoung.kim@webkit.org [Sat, 26 Mar 2016 12:53:06 +0000 (12:53 +0000)]
Remove duplicated tests in EFL TextExpectations.

Unreviewed EFL gardening.

* platform/efl/TestExpectations: Clean up duplicated pathes.

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

4 years agoTreat SHA-1-signed certificates as insecure by default.
mitz@apple.com [Sat, 26 Mar 2016 07:31:46 +0000 (07:31 +0000)]
Treat SHA-1-signed certificates as insecure by default.

Reviewed by Sam Weinig.

* UIProcess/API/APIPageConfiguration.h: Initialize m_treatsSHA1SignedCertificatesAsInsecure
  to true.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]): Initialize _treatsSHA1SignedCertificatesAsInsecure to YES.

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

4 years agoES6 Class syntax. Invoking method of parent class in constructor before super() lead...
commit-queue@webkit.org [Sat, 26 Mar 2016 07:08:21 +0000 (07:08 +0000)]
ES6 Class syntax. Invoking method of parent class in constructor before super() lead to crash
https://bugs.webkit.org/show_bug.cgi?id=152108

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-26
Reviewed by Ryosuke Niwa.

* js/arrowfunction-superproperty-expected.txt:
* js/script-tests/arrowfunction-superproperty.js:
* js/script-tests/class-syntax-name.js:
* js/script-tests/class-syntax-string-and-numeric-names.js:
Remove stale FIXMEs from LayoutTests where the bugs have been fixed.

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

4 years agoMisc. JavaScriptCore built-ins cleanups
commit-queue@webkit.org [Sat, 26 Mar 2016 06:51:11 +0000 (06:51 +0000)]
Misc. JavaScriptCore built-ins cleanups
https://bugs.webkit.org/show_bug.cgi?id=155920

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-25
Reviewed by Mark Lam.

* builtins/RegExpPrototype.js:
(match):
No need for an else after an if that always returns.

* builtins/TypedArrayConstructor.js:
(of):
Fix error message to use the correct function name.

(allocateInt8Array):
(allocateInt16Array):
(allocateInt32Array):
(allocateUint32Array):
(allocateUint16Array):
(allocateUint8Array):
(allocateUint8ClampedArray):
(allocateFloat32Array):
(allocateFloat64Array):
Cleanup style to be like all the other code.

* tests/stress/typedarray-of.js:
Test the exception message.

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

4 years agoWeb Inspector: make at the root should not create a WebKitLibraries/--lvm directory
commit-queue@webkit.org [Sat, 26 Mar 2016 05:36:14 +0000 (05:36 +0000)]
Web Inspector: make at the root should not create a WebKitLibraries/--lvm directory
https://bugs.webkit.org/show_bug.cgi?id=155918

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-25
Reviewed by Timothy Hatcher.

* Makefile:
Remove no longer used --llvm option.

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

4 years agoDate.prototype.toLocaleDateString uses overridable Object.create
commit-queue@webkit.org [Sat, 26 Mar 2016 05:31:22 +0000 (05:31 +0000)]
Date.prototype.toLocaleDateString uses overridable Object.create
https://bugs.webkit.org/show_bug.cgi?id=155917

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-25
Reviewed by Mark Lam.

Source/JavaScriptCore:

* builtins/DatePrototype.js:
(toLocaleString.toDateTimeOptionsAnyAll):
(toLocaleDateString.toDateTimeOptionsDateDate):
(toLocaleTimeString.toDateTimeOptionsTimeTime):
Switch from @Object.create to @Object.@create to guarentee we are
using the built-in create method and not user defined code.

* runtime/CommonIdentifiers.h:
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::finishCreation):
Setup the @create private symbol.

LayoutTests:

* js/regress-155917-expected.txt: Added.
* js/regress-155917.html: Added.
* js/script-tests/regress-155917.js: Added.
(Object.create):

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

4 years ago[JSC] Put the x86 Assembler on a binary diet
commit-queue@webkit.org [Sat, 26 Mar 2016 03:47:23 +0000 (03:47 +0000)]
[JSC] Put the x86 Assembler on a binary diet
https://bugs.webkit.org/show_bug.cgi?id=155683

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-03-25
Reviewed by Darin Adler.

The MacroAssemblers are heavily inlined. This is unfortunately
important for baseline JIT where many branches can be eliminated
at compile time.

This inlining causes a lot of binary bloat. The phases
lowering to ASM are massively large.

This patch improves the situation a bit for x86 through
many small improvements:

-Every instruction starts with ensureSpace(). The slow
 path realloc the buffer.
 From that slow path, only fastRealloc() was a function
 call. What is around does not need to be fast, I moved
 the whole grow() function out of line for those cases.

-When testing multiple registers for REX requirements,
 we had something like this:
     byteRegRequiresRex(reg) || byteRegRequiresRex(rm)
     regRequiresRex(index) || regRequiresRex(base)
 Those were producing multiple test-and-branch. Those branches
 are effectively random so we don't have to care about individual
 branches being predictable.

 The new code effectively does:
     byteRegRequiresRex(reg | rm)
     regRequiresRex(index | base)

-Change "ModRmMode" to have the value we can OR directly
 to the generated ModRm.
 This is important because some ModRM code is so large
 that is goes out of line;

-Finally, a big change on how we write to the AssemblerBuffer.

 Previously, instructions were written byte by byte into
 the assembler buffer of the MacroAssembler.

 The problem with that is the compiler cannot prove that
 the buffer pointer and the AssemblerBuffer are not pointing
 to the same memory.

 Because of that, before any write, all the local register
 were pushed back to the AssemblerBuffer memory, then everything
 was read back after the write to compute the next write.

 I attempted to use the "restrict" keyword and wrapper types
 to help Clang with that but nothing worked.

 The current solution is to keep a local copy of the index
 and the buffer pointer in the scope of each instruction.
 That is done by AssemblerBuffer::LocalWriter.

 Since LocalWriter only exists locally, it stays in
 register and we don't have all the memory churn between
 each byte writing. This also allows clang to combine
 obvious cases since there are no longer observable side
 effects between bytes.

This patch reduces the binary size by 66k. It is a small
speed-up on Sunspider.

* assembler/AssemblerBuffer.h:
(JSC::AssemblerBuffer::ensureSpace):
(JSC::AssemblerBuffer::LocalWriter::LocalWriter):
(JSC::AssemblerBuffer::LocalWriter::~LocalWriter):
(JSC::AssemblerBuffer::LocalWriter::putByteUnchecked):
(JSC::AssemblerBuffer::LocalWriter::putShortUnchecked):
(JSC::AssemblerBuffer::LocalWriter::putIntUnchecked):
(JSC::AssemblerBuffer::LocalWriter::putInt64Unchecked):
(JSC::AssemblerBuffer::LocalWriter::putIntegralUnchecked):
(JSC::AssemblerBuffer::putIntegral):
(JSC::AssemblerBuffer::outOfLineGrow):
* assembler/MacroAssemblerX86Common.h:
* assembler/X86Assembler.h:
(JSC::X86Assembler::X86InstructionFormatter::byteRegRequiresRex):
(JSC::X86Assembler::X86InstructionFormatter::regRequiresRex):
(JSC::X86Assembler::X86InstructionFormatter::LocalBufferWriter::LocalBufferWriter):
(JSC::X86Assembler::X86InstructionFormatter::LocalBufferWriter::emitRex):
(JSC::X86Assembler::X86InstructionFormatter::LocalBufferWriter::emitRexW):
(JSC::X86Assembler::X86InstructionFormatter::LocalBufferWriter::emitRexIf):
(JSC::X86Assembler::X86InstructionFormatter::LocalBufferWriter::emitRexIfNeeded):
(JSC::X86Assembler::X86InstructionFormatter::LocalBufferWriter::putModRm):
(JSC::X86Assembler::X86InstructionFormatter::LocalBufferWriter::putModRmSib):
(JSC::X86Assembler::X86InstructionFormatter::LocalBufferWriter::registerModRM):
(JSC::X86Assembler::X86InstructionFormatter::LocalBufferWriter::memoryModRM):
(JSC::X86Assembler::X86InstructionFormatter::oneByteOp): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp32): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp8): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::twoByteOp): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::threeByteOp): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::oneByteOp64): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp32): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp8): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::twoByteOp64): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::oneByteOp8): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::twoByteOp8): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::emitRex): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::emitRexW): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::emitRexIf): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::emitRexIfNeeded): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::putModRm): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::putModRmSib): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::registerModRM): Deleted.
(JSC::X86Assembler::X86InstructionFormatter::memoryModRM): Deleted.

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

4 years agoWeb Inspector: Sometimes clearing focused nodes in ProfileView leaves a dangling...
commit-queue@webkit.org [Sat, 26 Mar 2016 03:45:01 +0000 (03:45 +0000)]
Web Inspector: Sometimes clearing focused nodes in ProfileView leaves a dangling call stack that can never be removed
https://bugs.webkit.org/show_bug.cgi?id=155915

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-25
Reviewed by Timothy Hatcher.

* UserInterface/Views/ProfileDataGridTree.js:
(WebInspector.ProfileDataGridTree.prototype.addFocusNode):
(WebInspector.ProfileDataGridTree.prototype.rollbackFocusNode):
(WebInspector.ProfileDataGridTree.prototype.clearFocusNodes):
(WebInspector.ProfileDataGridTree.prototype._focusChanged):
(WebInspector.ProfileDataGridTree.prototype._saveFocusedNodeOriginalParent):
(WebInspector.ProfileDataGridTree.prototype._restoreFocusedNodeToOriginalParent):
Be a little more explicit about saving and resotring nodes.
When restoring, work around a DataGrid issue by temporarily
collapsing and expanding the part of the node we are being
reattached to. This is a cheap workaround for an otherwise
complex DataGrid / DataGridTree issue.

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

4 years agoDromaeo patch used by run-benchmark should not include an invalid address.
dewei_zhu@apple.com [Sat, 26 Mar 2016 02:09:34 +0000 (02:09 +0000)]
Dromaeo patch used by run-benchmark should not include an invalid address.
https://bugs.webkit.org/show_bug.cgi?id=155910

Reviewed by Ryosuke Niwa.

Should not use invalid 'http://127.0.0.1/Icons/w3c_home' in the patched version of test.
* Scripts/webkitpy/benchmark_runner/data/patches/Dromaeo.patch:

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

4 years agoRegExp.prototype.test should be an intrinsic again
sbarati@apple.com [Sat, 26 Mar 2016 01:12:59 +0000 (01:12 +0000)]
RegExp.prototype.test should be an intrinsic again
https://bugs.webkit.org/show_bug.cgi?id=155861

Reviewed by Yusuke Suzuki.

* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):

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

4 years agobmalloc: fix an ASSERT on iOS
ggaren@apple.com [Sat, 26 Mar 2016 00:50:51 +0000 (00:50 +0000)]
bmalloc: fix an ASSERT on iOS
https://bugs.webkit.org/show_bug.cgi?id=155911

Reviewed by Gavin Barraclough.

* bmalloc/VMAllocate.h:
(bmalloc::vmValidatePhysical): Call through to vmValidatePhysical because
the vmValidate function validates virtual sizes rather than physical
sizes.

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

4 years ago[Mac] Audio tracks in alternate groups are not represented correctly as AudioTracks
jer.noble@apple.com [Sat, 26 Mar 2016 00:21:37 +0000 (00:21 +0000)]
[Mac] Audio tracks in alternate groups are not represented correctly as AudioTracks
https://bugs.webkit.org/show_bug.cgi?id=155891
<rdar://problem/24841372>

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/track/video-track-alternate-groups.html

Previously, we created an AudioTrack for every AVPlayerItemTrack, and additionally, a
AudioTrack for every AVMediaSelectionOption that did not have an associated AVAssetTrack.
This caused a number of issues with various types of media, including media with fallback
tracks.

Now, we will create an AudioTrack for every AVMediaSelectionOption, and only create an
AudioTrack for every AVPlayerItem track if no AVMediaSelectionGroups (and thus no
AVMediaSeletionOptions) exist.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::determineChangedTracksFromNewTracksAndOldItems):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):

LayoutTests:

* media/content/audio-tracks-alternate-group-with-fallback.mp4: Added.
* media/content/audio-tracks-no-alternate-group.mp4: Added.
* media/content/audio-tracks-some-in-alternate-group.mp4: Added.
* media/track/video-track-alternate-groups-expected.txt: Added.
* media/track/video-track-alternate-groups.html: Added.
* platform/mac-yosemite/media/track/video-track-alternate-groups-expected.txt: Added.

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

4 years agobmalloc: support physical page sizes that don't match the virtual page size
ggaren@apple.com [Fri, 25 Mar 2016 23:46:01 +0000 (23:46 +0000)]
bmalloc: support physical page sizes that don't match the virtual page size
https://bugs.webkit.org/show_bug.cgi?id=155898

Reviewed by Gavin Barraclough.

This is a memory savings on iOS devices where the virtual page size
is 16kB but the physical page size is 4kB.

* bmalloc/Chunk.h:
(bmalloc::Chunk::Chunk): smallPageSize is now unrelated to the OS's
page size -- it just reflects the optimal unit of memory to recycle
between small objects.

We only need to round up to largeAlignment because small objects allocate
as subsets of large objects now.

(bmalloc::Chunk::page):
(bmalloc::Object::pageBegin):
(bmalloc::Object::line): Adopt smallPageSize.

* bmalloc/Heap.cpp:
(bmalloc::Heap::initializeLineMetadata):
(bmalloc::Heap::allocateSmallPage):
(bmalloc::Heap::allocateLarge): Adopt smallPageSize.

(bmalloc::Heap::splitAndAllocate):
(bmalloc::Heap::tryAllocateXLarge):
(bmalloc::Heap::shrinkXLarge): Adopt vmPageSizePhysical(). We want the
physical page size because that's the unit at which the hardware MMU
will recycle memory.

* bmalloc/Sizes.h: Adopt smallPageSize.

* bmalloc/VMAllocate.h:
(bmalloc::vmPageSizePhysical):
(bmalloc::vmPageSize): Distinguish between page size, which is the virtual
memory page size advertised by the OS, and physical page size, which the
true hardware page size.

(bmalloc::vmSize):
(bmalloc::vmValidate):
(bmalloc::vmValidatePhysical):
(bmalloc::tryVMAllocate):
(bmalloc::vmDeallocatePhysicalPages):
(bmalloc::vmAllocatePhysicalPages):
(bmalloc::vmDeallocatePhysicalPagesSloppy):
(bmalloc::vmAllocatePhysicalPagesSloppy): Adopt vmPageSize() and
vmPageSizePhyiscal().

* bmalloc/Vector.h:
(bmalloc::Vector::initialCapacity):
(bmalloc::Vector<T>::shrink):
(bmalloc::Vector<T>::shrinkCapacity):
(bmalloc::Vector<T>::growCapacity): Adopt vmPageSize(). We'd prefer to
use vmPageSizePhysical() but mmap() doesn't support it.

* bmalloc/XLargeMap.cpp: #include.

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

4 years agoRenderImage::repaintOrMarkForLayout fails when the renderer is detached.
zalan@apple.com [Fri, 25 Mar 2016 23:45:13 +0000 (23:45 +0000)]
RenderImage::repaintOrMarkForLayout fails when the renderer is detached.
https://bugs.webkit.org/show_bug.cgi?id=155885
<rdar://problem/25359164>

Reviewed by Simon Fraser.

Making containingBlockFor* functions standalone ensures that we don't
call them on an invalid object.

Covered by existing tests.

* dom/Element.cpp:
(WebCore::layoutOverflowRectContainsAllDescendants):
* rendering/LogicalSelectionOffsetCaches.h:
(WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
* rendering/RenderElement.cpp:
(WebCore::containingBlockForFixedPosition):
(WebCore::containingBlockForAbsolutePosition):
(WebCore::containingBlockForObjectInFlow):
(WebCore::RenderElement::containingBlockForFixedPosition): Deleted.
(WebCore::RenderElement::containingBlockForAbsolutePosition): Deleted.
(WebCore::isNonRenderBlockInline): Deleted.
(WebCore::RenderElement::containingBlockForObjectInFlow): Deleted.
* rendering/RenderElement.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::styleWillChange):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::containingBlock):

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

4 years ago2016-03-25 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Fri, 25 Mar 2016 23:44:53 +0000 (23:44 +0000)]
2016-03-25  Geoffrey Garen  <ggaren@apple.com>

        Unreviewed, rolling in r198679.

        r198679 was just a rename. The regression was caused by r198675 and then
        fixed in r198693.

        Restored changeset:

        "bmalloc: Renamed LargeChunk => Chunk"
        https://bugs.webkit.org/show_bug.cgi?id=155894
        http://trac.webkit.org/changeset/198679

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

4 years agoES6's throwing of TypeErrors on access of RegExp.prototype flag properties breaks...
mark.lam@apple.com [Fri, 25 Mar 2016 23:23:17 +0000 (23:23 +0000)]
ES6's throwing of TypeErrors on access of RegExp.prototype flag properties breaks websites.
https://bugs.webkit.org/show_bug.cgi?id=155904

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

There exists a JS library XRegExp (see http://xregexp.com) that extends the regexp
implementation.  XRegExp does feature testing by comparing RegExp.prototype.sticky
to undefined.  See:

Example 1. https://github.com/slevithan/xregexp/blob/28a2b033c5951477bed8c7c867ddf7e89c431cd4/tests/perf/index.html
    ...
    } else if (knownVersion[version]) {
        // Hack around ES6 incompatibility in XRegExp versions prior to 3.0.0
        if (parseInt(version, 10) < 3) {
            delete RegExp.prototype.sticky;
    }
    ...

Example 2. https://github.com/slevithan/xregexp/blob/d0e665d4068cec4d15919215b098b2373f1f12e9/tests/perf/versions/xregexp-all-v2.0.0.js
    ...
    // Check for flag y support (Firefox 3+)
        hasNativeY = RegExp.prototype.sticky !== undef,
    ...

The ES6 spec states that we should throw a TypeError here because RegExp.prototype
is not a RegExp object, and the sticky getter is only allowed to be called on
RegExp objects.  See https://tc39.github.io/ecma262/2016/#sec-get-regexp.prototype.sticky.
As a result, websites that uses XRegExp can break (e.g. some Atlassian tools).

As a workaround, we'll return undefined instead of throwing on access of these
flag properties that may be used for feature testing.

* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoGetterGlobal):
(JSC::regExpProtoGetterIgnoreCase):
(JSC::regExpProtoGetterMultiline):
(JSC::regExpProtoGetterSticky):
(JSC::regExpProtoGetterUnicode):

LayoutTests:

* ietestcenter/Javascript/TestCases/15.10.7.2-1.js:
(ES5Harness.registerTest.test):
* ietestcenter/Javascript/TestCases/15.10.7.3-1.js:
(ES5Harness.registerTest.test):
* ietestcenter/Javascript/TestCases/15.10.7.4-1.js:
(ES5Harness.registerTest.test):
- updated these tests to not expect a TypeError due to the workaround.

* js/pic/cached-named-property-getter.html:
- updated this test to use the source property (which still throws a TypeError)
  instead of the ignoreCase property which no longer does.

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

4 years agoRemove use of extern "C" to include QuartzCore files
dino@apple.com [Fri, 25 Mar 2016 23:15:03 +0000 (23:15 +0000)]
Remove use of extern "C" to include QuartzCore files
https://bugs.webkit.org/show_bug.cgi?id=155905
Source/WebCore:

<rdar://problem/25364798>

Reviewed by Anders Carlson.

We can avoid having to wrap constants in extern "C", since they
are mangled the same in both C and C++.

* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Now that
QuartzCoreSPI.h has CABackdropLayer, remove the duplicate entry.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Ditto.
* platform/spi/cocoa/QuartzCoreSPI.h: Include the framework private
file. Repace EXTERN_C with "extern".

Source/WebKit2:

Reviewed by Anders Carlson.

We can avoid having to wrap constants in extern "C", since they
are mangled the same in both C and C++.

* UIProcess/mac/RemoteLayerTreeHost.mm: Remove the
mention of CABackdropLayer.

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

4 years agoAdd a compile time flag for using QTKit
commit-queue@webkit.org [Fri, 25 Mar 2016 23:06:06 +0000 (23:06 +0000)]
Add a compile time flag for using QTKit
https://bugs.webkit.org/show_bug.cgi?id=155868

Patch by Alex Christensen <achristensen@webkit.org> on 2016-03-25
Reviewed by Daniel Bates.

* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
* platform/graphics/mac/MediaTimeQTKit.h:
* platform/graphics/mac/MediaTimeQTKit.mm:
* platform/mac/WebVideoFullscreenController.mm:
(SOFT_LINK_CLASS):
(-[WebVideoFullscreenController setVideoElement:]):
(-[WebVideoFullscreenController updatePowerAssertions]):

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

4 years ago[JSC] fix divide-by-zero in String.prototype.padStart/padEnd
commit-queue@webkit.org [Fri, 25 Mar 2016 23:04:02 +0000 (23:04 +0000)]
[JSC] fix divide-by-zero in String.prototype.padStart/padEnd
https://bugs.webkit.org/show_bug.cgi?id=155903

Patch by Caitlin Potter <caitp@igalia.com> on 2016-03-25
Reviewed by Filip Pizlo.

* runtime/StringPrototype.cpp:
(JSC::padString):

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

4 years ago[JSC] materialize-past-butterfly-allocation.js time out in debug
benjamin@webkit.org [Fri, 25 Mar 2016 22:55:44 +0000 (22:55 +0000)]
[JSC] materialize-past-butterfly-allocation.js time out in debug

* tests/stress/materialize-past-butterfly-allocation.js:
The test times out on the debug bots. We suspect there is nothing
wrong, just overkill loops.

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

4 years ago2016-03-25 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Fri, 25 Mar 2016 22:04:53 +0000 (22:04 +0000)]
2016-03-25  Geoffrey Garen  <ggaren@apple.com>

        Unreviewed, try to fix a crash seen on the bots.

        * bmalloc/Allocator.cpp:
        (bmalloc::Allocator::reallocate): We have to take the lock even if we're
        only reading our own data becuse LargeObject contains validation code
        that will read our neighbors' data as well.

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

4 years agoAutoscrolling from a drag selection does not work in full screen, or when the
bdakin@apple.com [Fri, 25 Mar 2016 22:01:30 +0000 (22:01 +0000)]
Autoscrolling from a drag selection does not work in full screen, or when the
window is against the screen edge
https://bugs.webkit.org/show_bug.cgi?id=155858
-and corresponding-
rdar://problem/9338465

Reviewed by Simon Fraser.

WebKit2 has always had this bug. Since WebKit1 scrolling in handled largely
by AppKit, we did not have this bug because AppKit adjusts the autoscroll
amount whenever the window is at the edge of the screen and the user is
trying to autoscroll in that direction. This patch employs the same technique
in WebCore.

Instead of using EventHandler::lastKnownMousePosition() as the autoscroll
amount, use EventHandler::effectiveMousePositionForSelectionAutoscroll()
which will adjust the lastKnownMousePosition if the window is at the edge of
the screen.
* page/AutoscrollController.cpp:
(WebCore::AutoscrollController::autoscrollTimerFired):

For most ports, effectiveMousePositionForSelectionAutoscroll() will just
return m_lastKnownMousePosition. We override it in EventHandlerMac to return
an adjusted amount.
* page/EventHandler.cpp:
(WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll):
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::autoscrollAdjustmentFactorForScreenBoundaries):
(WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll):

Make screenForDisplayID available as on PlatformScreen.h instead of just
being a static function in the implementation file.
* platform/PlatformScreen.h:
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenForDisplayID):

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

4 years agoMigrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
rniwa@webkit.org [Fri, 25 Mar 2016 21:55:34 +0000 (21:55 +0000)]
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code
https://bugs.webkit.org/show_bug.cgi?id=155863

Reviewed by Joseph Pecoraro.

Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability
added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed
/admin/regenerate-manifest since it has been superseded by /api/manifest.

This patch also extracts manifest.js out of main.js so that it could be used and tested without the
DOM support in node.

* public/admin/regenerate-manifest.php: Deleted.
* public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with
a trailing backslash.
* public/include/manifest.php:
(ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories.
* public/v3/index.html:
* public/v3/main.js:
(main):
* public/v3/models/bug-tracker.js:
(BugTracker.prototype.newBugUrl): Added.
(BugTracker.prototype.repositories): Added.
* public/v3/models/manifest.js: Added. Extracted from main.js.
(Manifest.fetch): Moved from main.js' fetchManifest.
(Manifest._didFetchManifest): Moved from main.js' didFetchManifest.
* public/v3/models/platform.js:
(Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of
the same name. This is tested by the newly added test cases.
* server-tests/api-build-requests-tests.js:
* server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js
with additional assertions for v3 UI model objects.
* server-tests/resources/test-server.js:
(TestServer.prototype.start):
(TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API.
Also no longer takes dataDirectory as an argument since it's always the same.
(TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data.
(TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests.
(TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an
unintended side effect of slowing down unit tests even through they don't need Postgres or Apache.
* tests/admin-regenerate-manifest.js: Removed.
* tools/js/database.js:
* tools/js/v3-models.js:

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

4 years agoWeb Inspector: Clicking a result in Quick Open dialog dismisses the dialog, does...
mattbaker@apple.com [Fri, 25 Mar 2016 20:57:04 +0000 (20:57 +0000)]
Web Inspector: Clicking a result in Quick Open dialog dismisses the dialog, does nothing
https://bugs.webkit.org/show_bug.cgi?id=155892
<rdar://problem/25361220>

Reviewed by Timothy Hatcher.

* UserInterface/Views/OpenResourceDialog.js:
(WebInspector.OpenResourceDialog):
Allow repeat selection so clicking a selected element makes a selection
and dismisses the dialog.

(WebInspector.OpenResourceDialog.prototype._populateResourceTreeOutline):
Suppress select and deselect. Only user clicks should cause a selection event.

(WebInspector.OpenResourceDialog.prototype._handleBlurEvent):
Prevent the dialog from being dismissed before tree item selection occurs.

(WebInspector.OpenResourceDialog.prototype._treeSelectionDidChange):
Set the represented object (dialog result) and dismiss.

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

4 years agoMarking compositing/repaint/become-overlay-composited-layer.html as flaky on ios...
ryanhaddad@apple.com [Fri, 25 Mar 2016 20:52:39 +0000 (20:52 +0000)]
Marking compositing/repaint/become-overlay-composited-layer.html as flaky on ios-sim-wk2
https://bugs.webkit.org/show_bug.cgi?id=155737

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoUnreviewed, rolling out r198619.
commit-queue@webkit.org [Fri, 25 Mar 2016 20:45:35 +0000 (20:45 +0000)]
Unreviewed, rolling out r198619.
https://bugs.webkit.org/show_bug.cgi?id=155902

Switching to Console tab sometimes results in blank tab.
(Requested by JoePeck on #webkit).

Reverted changeset:

"Web Inspector: Large repaints while typing in the console
tab"
https://bugs.webkit.org/show_bug.cgi?id=155627
http://trac.webkit.org/changeset/198619

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

4 years agoSoften push/replaceState frequency restrictions.
beidson@apple.com [Fri, 25 Mar 2016 20:37:49 +0000 (20:37 +0000)]
Soften push/replaceState frequency restrictions.
<rdar://problem/25228439> and https://bugs.webkit.org/show_bug.cgi?id=155901
.:

Rubber-stamped by Timothy Hatcher.

* ManualTests/state-objects-time-limit.html: Added.

Source/WebCore:

Rubber-stamped by Timothy Hatcher.

Covered by existing LayoutTests and a new Manual Test.

* page/History.cpp:
(WebCore::History::stateObjectAdded): Allow 100 state object operations every 30 seconds.
* page/History.h:

LayoutTests:

Rubber-stamped by Timothy Hatcher.

* fast/loader/stateobjects/pushstate-frequency-with-user-gesture-expected.txt: Removed.
* fast/loader/stateobjects/pushstate-frequency-with-user-gesture.html: Removed.
* fast/loader/stateobjects/replacestate-frequency-with-user-gesture-expected.txt: Removed.
* fast/loader/stateobjects/replacestate-frequency-with-user-gesture.html: Removed.

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

4 years agoUnreviewed, rolling out r198679.
ryanhaddad@apple.com [Fri, 25 Mar 2016 20:30:54 +0000 (20:30 +0000)]
Unreviewed, rolling out r198679.

This change caused flaky LayoutTest crashes

Reverted changeset:

"bmalloc: Renamed LargeChunk => Chunk"
https://bugs.webkit.org/show_bug.cgi?id=155894
http://trac.webkit.org/changeset/198679

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

4 years agoData Detection creates multiple links even when the detected content is within the...
enrica@apple.com [Fri, 25 Mar 2016 19:32:53 +0000 (19:32 +0000)]
Data Detection creates multiple links even when the detected content is within the same node.
https://bugs.webkit.org/show_bug.cgi?id=155860
rdar://problem/25319579

Reviewed by Tim Horton.

If the detected content spans over multiple query fragments,
we need to check if consecutive fragments are all within the
same node. This way we can avoid creating multiple ranges and
consequntly more links.

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):

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

4 years agoImplement the allow-end value of the hanging-punctuation CSS property.
hyatt@apple.com [Fri, 25 Mar 2016 19:25:05 +0000 (19:25 +0000)]
Implement the allow-end value of the hanging-punctuation CSS property.
https://bugs.webkit.org/show_bug.cgi?id=104996

Reviewed by Simon Fraser.

Source/WebCore:

Added new tests in fast/text.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::constructLine):
Fix a bug where empty RenderInlines were incorrectly excluding their end borders if
they occurred at the end of a line. Needed to adequately test allow-end and empty
inline borders.

* rendering/RenderText.cpp:
(WebCore::RenderText::isHangableStopOrComma):
Helper function that identifies the hangable stops and commas.

* rendering/RenderText.h:
Add new isHangableStopOrComma function to RenderText.

* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::lineBreak):
(WebCore::BreakingContext::lineWidth):
(WebCore::BreakingContext::atEnd):
(WebCore::BreakingContext::fitsOnLineOrHangsAtEnd):
(WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
(WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
(WebCore::BreakingContext::handleBR):
(WebCore::BreakingContext::handleEmptyInline):
(WebCore::BreakingContext::handleReplaced):
(WebCore::tryHyphenating):
(WebCore::BreakingContext::computeAdditionalBetweenWordsWidth):
(WebCore::BreakingContext::handleText):
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
Modified breaking rules to handle allow-end. The basic idea is to see if you can
fit without the comma and only hang if you do, and if nothing else gets added to the
line after the comma. This involves tracking a new state, m_hangsAtEnd, that can
be set/cleared while iterating over the objects that will end up on the line.

LayoutTests:

* fast/text/hanging-punctuation-allow-end-basic-expected.html: Added.
* fast/text/hanging-punctuation-allow-end-basic.html: Added.
* fast/text/hanging-punctuation-allow-end-expected.html: Added.
* fast/text/hanging-punctuation-allow-end-inlines-expected.html: Added.
* fast/text/hanging-punctuation-allow-end-inlines.html: Added.
* fast/text/hanging-punctuation-allow-end.html: Added.

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

4 years agoAdd WebKitSystemInterface for iOS 9.3
dbates@webkit.org [Fri, 25 Mar 2016 18:44:38 +0000 (18:44 +0000)]
Add WebKitSystemInterface for iOS 9.3
https://bugs.webkit.org/show_bug.cgi?id=155893

Rubber-stamped by Alexey Proskuryakov.

Tools:

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

WebKitLibraries:

* libWebKitSystemInterfaceIOSDevice9.3.a: Added.
* libWebKitSystemInterfaceIOSSimulator9.3.a: Added.

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