WebKit-https.git
5 years agoUnreviewed, revert changes accidentally committed with previous patch.
eric.carlson@apple.com [Thu, 10 Mar 2016 12:26:21 +0000 (12:26 +0000)]
Unreviewed, revert changes accidentally committed with previous patch.

* WebProcess/com.apple.WebProcess.sb.in:

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

5 years ago[css-grid] Fix placement for unknown named grid lines
rego@igalia.com [Thu, 10 Mar 2016 12:15:34 +0000 (12:15 +0000)]
[css-grid] Fix placement for unknown named grid lines
https://bugs.webkit.org/show_bug.cgi?id=155230

Reviewed by Sergio Villar Senin.

Source/WebCore:

The spec has changed and now all the implicit lines should be considered
when we're resolving named grid lines with an unknown name.

The relevant part of the spec is
(http://dev.w3.org/csswg/css-grid/#line-placement):
"If a name is given as a <custom-ident>, only lines with that name
 are counted. If not enough lines with that name exist,
 all implicit grid lines are assumed to have that name
 for the purpose of finding this position."

Modified the code to resolve named grid lines in GridResolvedPosition.
We need to keep the old behavior of considering "auto" unknown named
grid lines for the case of positioned grid items.

Test: fast/css-grid-layout/grid-item-unknown-named-grid-line-resolution.html

* rendering/style/GridResolvedPosition.cpp:
(WebCore::adjustGridPositionsFromStyle):
(WebCore::lookAheadForNamedGridLine):
(WebCore::lookBackForNamedGridLine):
(WebCore::resolveNamedGridLinePositionFromStyle):
(WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite):
(WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
(WebCore::resolveGridPositionAgainstOppositePosition):
(WebCore::resolveGridPositionFromStyle):

LayoutTests:

Updated current tests to the new expected behavior and created a new
test checking different cases explicitly.

* fast/css-grid-layout/grid-container-change-named-grid-lines-recompute-child.html:
* fast/css-grid-layout/grid-item-bad-named-area-auto-placement-expected.txt:
* fast/css-grid-layout/grid-item-bad-named-area-auto-placement.html:
* fast/css-grid-layout/grid-item-named-grid-area-resolution.html:
* fast/css-grid-layout/grid-item-named-grid-line-resolution-expected.txt:
* fast/css-grid-layout/grid-item-named-grid-line-resolution.html:
* fast/css-grid-layout/grid-item-negative-position-resolution.html:
* fast/css-grid-layout/grid-item-position-changed-dynamic.html:
* fast/css-grid-layout/grid-item-unknown-named-grid-line-resolution-expected.txt: Added.
* fast/css-grid-layout/grid-item-unknown-named-grid-line-resolution.html: Added.
* fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html:

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

5 years ago[MediaStream] push media stream state to the UI process
eric.carlson@apple.com [Thu, 10 Mar 2016 12:05:59 +0000 (12:05 +0000)]
[MediaStream] push media stream state to the UI process
https://bugs.webkit.org/show_bug.cgi?id=155281

Reviewed by Darin Adler.

Source/WebCore:

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): Register with the document as an audio producer.
(WebCore::MediaStream::~MediaStream): Unregister.
(WebCore::MediaStream::setIsActive): Update document status.
(WebCore::MediaStream::pageMutedStateDidChange): Mute/unmute according to the page mute setting.
(WebCore::MediaStream::mediaState): Return state.
(WebCore::MediaStream::statusDidChange): Call document.updateIsPlayingMedia.
(WebCore::MediaStream::characteristicsChanged): Track stream mute state.
(WebCore::MediaStream::scheduleActiveStateChange): m_isActive -> m_active.
* Modules/mediastream/MediaStream.h:

* page/MediaProducer.h: Add HasActiveMediaCaptureDevice.

* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::hasVideo): Make const.
(WebCore::MediaStreamPrivate::hasAudio): Ditto.
(WebCore::MediaStreamPrivate::muted): New.
* platform/mediastream/MediaStreamPrivate.h:

* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Initialize muted to true.
(WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Set muted.

Source/WebKit2:

* UIProcess/API/C/WKPage.cpp:
(WKPageGetMediaState): New.
* UIProcess/API/C/WKPagePrivate.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame): Clear m_mediaState.
(WebKit::WebPageProxy::isPlayingMediaDidChange): Call m_pageClient.isPlayingMediaDidChange when
  audio or video state changes, call m_uiClient->isPlayingAudioDidChange when audio, vidoe,
  or media stream state changes.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::mediaStateFlags): New.

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

5 years agoHow we load new.target in arrow functions is broken
gskachkov@gmail.com [Thu, 10 Mar 2016 08:19:42 +0000 (08:19 +0000)]
How we load new.target in arrow functions is broken
https://bugs.webkit.org/show_bug.cgi?id=155153

Reviewed by Saam Barati.

Fixed not correct approach of caching new.target. In current patch was added code feature
flag that shows that current function is using new.target, when generating byte code an arrow
function we are loading new.target value to its register from arrow function lexical environment.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitLoadNewTargetFromArrowFunctionLexicalEnvironment):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::newTarget):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createNewTargetExpr):
(JSC::ASTBuilder::usesNewTarget):
* parser/Nodes.h:
(JSC::ScopeNode::usesNewTarget):
* parser/ParserModes.h:
* tests/stress/arrowfunction-lexical-bind-newtarget.js:

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

5 years ago[GTK] Artifacts when using web view background color
carlosgc@webkit.org [Thu, 10 Mar 2016 07:13:48 +0000 (07:13 +0000)]
[GTK] Artifacts when using web view background color
https://bugs.webkit.org/show_bug.cgi?id=155229

Reviewed by Mario Sanchez Prada.

This is because when using a web view color, we fill with the
color every rectangle updated by the web process, but we should
always fill the entire backing store before rendering the actual
contents on top.

* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::display): Ensure the web process always
renders the whole visible rectangle when background is rendered by
the UI process.

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

5 years agoWeb Inspector: Get a RemoteObject or ObjectPreview from HeapSnapshot Object Identifier
commit-queue@webkit.org [Thu, 10 Mar 2016 06:15:25 +0000 (06:15 +0000)]
Web Inspector: Get a RemoteObject or ObjectPreview from HeapSnapshot Object Identifier
https://bugs.webkit.org/show_bug.cgi?id=155264
<rdar://problem/25070716>

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

Source/JavaScriptCore:

* inspector/InjectedScript.h:
* inspector/InjectedScript.cpp:
(Inspector::InjectedScript::functionDetails):
(Inspector::InjectedScript::previewValue):
New InjectedScript methods for building Debugger.FunctionDetails
or Runtime.ObjectPreview protocol objects from a JSValue.

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype.previewValue):
(InjectedScript.prototype.functionDetails):
(InjectedScript.prototype.getFunctionDetails):
(InjectedScript.RemoteObject.prototype._isPreviewableObjectInternal):
(InjectedScript.RemoteObject.prototype._createObjectPreviewForValue): Deleted.
(InjectedScript.RemoteObject.prototype._appendEntryPreviews): Deleted.
Share code around creating function details or object preview objects.

* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::InspectorHeapAgent):
(Inspector::InspectorHeapAgent::nodeForHeapObjectIdentifier):
(Inspector::InspectorHeapAgent::getPreview):
(Inspector::InspectorHeapAgent::getRemoteObject):
* inspector/agents/InspectorHeapAgent.h:
* inspector/protocol/Heap.json:
New protocol methods that go from heap object identifier to a
remote object or some kind of preview.

* inspector/scripts/codegen/generator.py:
Allow runtime casts for ObjectPreview.

LayoutTests:

* inspector/heap/getPreview-expected.txt: Added.
* inspector/heap/getPreview.html: Added.
* inspector/heap/getRemoteObject-expected.txt: Added.
* inspector/heap/getRemoteObject.html: Added.
Test the new protocol methods in different scenarios.

* inspector/heap/snapshot-expected.txt:
* inspector/heap/snapshot.html:
Fix typo.

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

5 years ago[INTL] Intl Constructors not web compatible with Object.create usage
commit-queue@webkit.org [Thu, 10 Mar 2016 05:28:34 +0000 (05:28 +0000)]
[INTL] Intl Constructors not web compatible with Object.create usage
https://bugs.webkit.org/show_bug.cgi?id=153679

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2016-03-09
Reviewed by Darin Adler.

Source/JavaScriptCore:

Add workaround for initializing NumberFormat and DateTimeFormat objects
using Object.create followed by constructor.call. This is necessary for
backwards compatibility with libraries relying on v1 behavior of Intl
constructors.

Collator does not get the workaround, since polyfills do not include it,
and there are not any known instances of v2 incompatible libraries.

The workaround involves checking for an object that inherits from the
*Format constructor, but was not actually initialized with that type. A
substitute instance is created and attached to the object using a private
name. The prototype functions then check for the private property to use
in place of the original object.

Since this behavior is not part of the v2 spec, it should be removed as
soon as the incompatible behavior is no longer in common use.

* runtime/CommonIdentifiers.h:
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::callIntlDateTimeFormat):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototypeGetterFormat):
(JSC::IntlDateTimeFormatPrototypeFuncResolvedOptions):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::callIntlNumberFormat):
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatPrototypeGetterFormat):
(JSC::IntlNumberFormatPrototypeFuncResolvedOptions):

LayoutTests:

Add tests for Object.create + contructor.call initialization of NumberFormat
and DateTimeFormat objects.

* js/intl-datetimeformat-expected.txt:
* js/intl-numberformat-expected.txt:
* js/script-tests/intl-datetimeformat.js:
* js/script-tests/intl-numberformat.js:

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

5 years agoExtract EventPath.h/cpp out of EventDispatcher.cpp
rniwa@webkit.org [Thu, 10 Mar 2016 05:27:07 +0000 (05:27 +0000)]
Extract EventPath.h/cpp out of EventDispatcher.cpp
https://bugs.webkit.org/show_bug.cgi?id=155285

Reviewed by Chris Dumez.

Extracted EventPath.h/cpp out of EventDispatcher.cpp to add the support for Event.deepPath()
in webkit.org/b/153538. The new file defines member functions of EventPath and RelatedNodeRetargeter.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchScopedEvent):
(WebCore::EventDispatcher::dispatchEvent):
(WebCore::EventPath): Moved to EventPath.cpp.
(WebCore::eventTargetRespectingTargetRules): Moved to EventPath.h.
(WebCore::shouldEventCrossShadowBoundary): Moved to EventPath.cpp.
(WebCore::nodeOrHostIfPseudoElement): Ditto.
(WebCore::RelatedNodeRetargeter): Moved to EventPath.cpp.
* dom/EventPath.cpp: Added.
(WebCore::shouldEventCrossShadowBoundary): Moved from EventDispatcher.cpp.
(WebCore::nodeOrHostIfPseudoElement): Ditto.
(WebCore::EventPath::EventPath): Ditto.
(WebCore::RelatedNodeRetargeter): Ditto.
* dom/EventPath.h: Added.
(WebCore::EventPath::isEmpty):
(WebCore::EventPath::size):
(WebCore::EventPath::contextAt):
(WebCore::EventPath::lastContextIfExists):
(WebCore::EventPath::eventTargetRespectingTargetRules): Moved from EventDispatcher.cpp.

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

5 years agoFont antialiasing (smoothing) changes when elements are rendered into compositing...
simon.fraser@apple.com [Thu, 10 Mar 2016 05:26:25 +0000 (05:26 +0000)]
Font antialiasing (smoothing) changes when elements are rendered into compositing layers
https://bugs.webkit.org/show_bug.cgi?id=23364
rdar://problem/7288429

Reviewed by Tim Horton.
Source/WebCore:

Improve the appearance of subpixel-antialiased ("smoothed") text in non-opaque layers
by opting in to a new CALayer backing store format.

GraphicsLayer now has setSupportsSmoothedFonts(), which is called by RenderLayerBacking
when the platform has support for the new feature. Ideally this would only be set when
we know a layer has smoothed text drawn into it, but, for now, enable this for all
layers. The right thing happens with opaque layers under the hood.

setSupportsSmoothedFonts() is turned into a PlatformCALayer contentsFormat flag, which
is ultimately passed to setBackingStoreFormat().

We also need to propagate this flag to TileController tiles.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::supportsSmoothedFontsInNonOpaqueLayers):
(WebCore::GraphicsLayer::GraphicsLayer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::supportsSmoothedFonts):
(WebCore::GraphicsLayer::setSupportsSmoothedFonts):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::supportsSmoothedFontsInNonOpaqueLayers):
(WebCore::GraphicsLayerCA::setSupportsSmoothedFonts):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateContentsFormat):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator): Give the number a "shadow" when
the contents format says we support smoothed fonts.
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setTileContentsFormatFlags):
(WebCore::TileController::createTileLayer):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::updateTileLayerProperties):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::setBackingStoreFormat):
(PlatformCALayerCocoa::commonInit):
(PlatformCALayerCocoa::setContentsFormat):
(PlatformCALayer::drawLayerContents): Previously, we turned off font smoothing in
non-opaque layers to improve text appearance. We no longer need to do that when
the contents format has "SmoothedFonts".
* platform/ios/LegacyTileGridTile.mm:
(WebCore::setBackingStoreFormat):
(WebCore::LegacyTileGridTile::LegacyTileGridTile):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):

Source/WebKit2:

Send the ContentsFormat to the UI process (but nothing happens to it there yet).

* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setContentsFormat):
(WebKit::PlatformCALayerRemote::contentsFormat):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

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

5 years agoWebKit should adopt journal_mode=wal for all SQLite databases.
barraclough@apple.com [Thu, 10 Mar 2016 05:17:58 +0000 (05:17 +0000)]
WebKit should adopt journal_mode=wal for all SQLite databases.
https://bugs.webkit.org/show_bug.cgi?id=133496

Reviewed by Brady Eidson & Darin Adler.

The statement intended to enable WAL mode is always failing because it is missing a
prepare(). Fix this. We were also previously permitting SQLITE_OK results - this
was in error (we were only getting these because stepping the unprepared statement
returned SQLITE_OK). Also set the SQLITE_OPEN_AUTOPROXY flag when opening the
database - this will improve perfomance when the database is accessed via an AFP
mount.

* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
    - call prepareAndStep(), only check for SQLITE_ROW result.
* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::openDatabase):
    - should set SQLITE_OPEN_AUTOPROXY flag when opening database.

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

5 years agoAdd runtime flags for shadow DOM and custom elements
rniwa@webkit.org [Thu, 10 Mar 2016 04:43:14 +0000 (04:43 +0000)]
Add runtime flags for shadow DOM and custom elements
https://bugs.webkit.org/show_bug.cgi?id=155213

Reviewed by Dean Jackson.

Source/WebCore:

Added new runtime flags for shadow DOM and custom elements.

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setShadowDOMEnabled): Added.
(WebCore::RuntimeEnabledFeatures::shadowDOMEnabled): Added.
(WebCore::RuntimeEnabledFeatures::setCustomElementsEnabled): Added.
(WebCore::RuntimeEnabledFeatures::customElementsEnabled): Added.
* dom/Document.idl:
* dom/Element.idl:
* dom/Node.idl:
* dom/NonDocumentTypeChildNode.idl:
* dom/ShadowRoot.idl:
* html/HTMLSlotElement.idl:

Source/WebKit/mac:

Set the runtime flag based on preferences. Enable shadow DOM and disable custom elements by default.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences shadowDOMEnabled]):
(-[WebPreferences setShadowDOMEnabled:]):
(-[WebPreferences customElementsEnabled]):
(-[WebPreferences setCustomElementsEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Set the runtime flag based on preferences. Enable shadow DOM and disable custom elements by default.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShadowDOMEnabled):
(WKPreferencesGetShadowDOMEnabled):
(WKPreferencesSetCustomElementsEnabled):
(WKPreferencesGetCustomElementsEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WTF:

Removed the manual overrides of ENABLE_SHADOW_DOM and ENABLE_CUSTOM_ELEMENTS as they were
making --no-shadow-dom and --no-custom-elements flags on build-webkit useless.

* wtf/FeatureDefines.h:

Tools:

Always enable shadow DOM and custom elements during testing.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setShadowDOMEnabled): Added.
* WebKitTestRunner/InjectedBundle/TestRunner.h:

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

5 years agoHandling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test...
bfulgham@apple.com [Thu, 10 Mar 2016 04:06:51 +0000 (04:06 +0000)]
Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
https://bugs.webkit.org/show_bug.cgi?id=155265
<rdar://problem/11101440>

Reviewed by Andy Estes.

Source/WebKit2:

We require "AllowUniversalAccessFromFileURLs" to permit file URLs from accessing
localStorage. However, this setting is not available on the Cocoa WKPreference (by design).
Instead, you need to set this value on the WKWebViewConfiguration.

Back out the work-around landed in r197889,

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]): Remove test workaround.
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCreateInspectorPage): Set the correct flag on
the WKWebViewConfiguration.

Tools:

WK2 localStorage tests need the 'AllowUniversalAccessFromFileURLs' preference set by default.
Tests that confirm blocking localStorage manually set the flag to "False" in the test.

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration): Set the default state to the correct value.

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

5 years agoWeb Inspector: LayoutTimelineView path components should reflect grid row nesting
mattbaker@apple.com [Thu, 10 Mar 2016 03:16:44 +0000 (03:16 +0000)]
Web Inspector: LayoutTimelineView path components should reflect grid row nesting
https://bugs.webkit.org/show_bug.cgi?id=155279
<rdar://problem/25075355>

Reviewed by Timothy Hatcher.

* UserInterface/Views/LayoutTimelineView.js:
(WebInspector.LayoutTimelineView.prototype.get selectionPathComponents):
Walk grid nodes to build path component array.

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

5 years agoAdd proper JSON.stringify support for Proxy when the target is an array
sbarati@apple.com [Thu, 10 Mar 2016 02:41:34 +0000 (02:41 +0000)]
Add proper JSON.stringify support for Proxy when the target is an array
https://bugs.webkit.org/show_bug.cgi?id=155180

Reviewed by Darin Adler.

This patch makes the following type of program true:
`JSON.stringify(new Proxy([25], {})) === "[25]"`

We need to change the JSON stringifier to use the IsArray test
in section 7.2.2 of ES6 spec instead of the JSC inherits(JSArray::info())
test.

This patch also adds tests for general JSON.stringify support
of Proxy.

* runtime/ArrayConstructor.cpp:
(JSC::arrayConstructorIsArray):
(JSC::arrayConstructorPrivateFuncIsArrayConstructor):
* runtime/ArrayConstructor.h:
(JSC::isArray):
* runtime/JSONObject.cpp:
(JSC::Stringifier::Holder::object):
(JSC::Stringifier::appendStringifiedValue):
(JSC::Stringifier::startNewLine):
(JSC::Stringifier::Holder::Holder):
* tests/es6.yaml:
* tests/stress/proxy-json.js: Added.
(assert):
(test):

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

5 years agodefineElement should upgrade existing unresolved custom elements
rniwa@webkit.org [Thu, 10 Mar 2016 02:33:12 +0000 (02:33 +0000)]
defineElement should upgrade existing unresolved custom elements
https://bugs.webkit.org/show_bug.cgi?id=155107

Reviewed by Darin Adler.

Source/WebCore:

Added the support for upgrading existing unresolved custom elements when defineElement is called.

The current implementation upgrades elements in the order they were created and has the issue that
it keeps accumulating all elements with a hyphen in its name until defineElement is called as
documented in https://github.com/w3c/webcomponents/issues/419

This patch re-purposes IsEditingTextFlag to indicate that the node is an unresolved custom element.
Since isEditingText() is only called in textRendererIsNeeded only on Text nodes, it's mutually
exclusive with isUnresolvedCustomElement().

The list of unresolved custom elements is kept in m_upgradeCandidatesMap, a hash map of element names
to the list of unresolved elements with that name.

In addition, added the logic to use HTMLElement as the interface for unresolved custom element instead
of HTMLUnknownElement.

Test: fast/custom-elements/upgrading/upgrading-parser-created-element.html

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement): Clear the flag.
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::defineElement): Set the unique private name to keep the interface alive before
calling addElementDefinition as the call can now invoke author scripts.
* dom/CustomElementDefinitions.cpp:
(WebCore::CustomElementDefinitions::addElementDefinition): Upgrade existing unresolved elements kept
in m_upgradeCandidatesMap.
(WebCore::CustomElementDefinitions::addUpgradeCandidate): Added.
* dom/CustomElementDefinitions.h:
* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation): Added the code to add the unresolved custom elements
to the upgrade candidates map. Also instantiate it as HTMLElement instead of HTMLUnknownElement.
(WebCore::createFallbackHTMLElement): Ditto.
* dom/Node.h:
(WebCore::Node::setIsCustomElement):
(WebCore::Node::isUnresolvedCustomElement): Added.
(WebCore::Node::setIsUnresolvedCustomElement): Added.
(WebCore::Node::setCustomElementIsResolved): Added. Clears IsEditingTextOrUnresolvedCustomElementFlag
and sets IsCustomElement.
(WebCore::Node::isEditingText): Check both IsEditingTextOrUnresolvedCustomElementFlag and IsTextFlag
for safety even though it's currently only used in textRendererIsNeeded which takes Text&.
* dom/make_names.pl:
(defaultParametersHash): Added customElementInterfaceName as a parameter.
(printWrapperFactoryCppFile): Generate the code to use customElementInterfaceName when the element
for which the wrapper is created has isUnresolvedCustomElement flag set.
* html/HTMLTagNames.in: Use HTMLElement for unresolved custom elements.
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Added the code to add
the unresolved custom elements to the upgrade candidates map. Also instantiate it as HTMLElement instead
of HTMLUnknownElement.

LayoutTests:

Added W3C style testharness.js tests for asynchronously defining custom elements.

* fast/custom-elements/upgrading/Node-cloneNode.html:
* fast/custom-elements/upgrading/upgrading-parser-created-element-expected.txt: Added.
* fast/custom-elements/upgrading/upgrading-parser-created-element.html: Added.

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

5 years agoRetrieve additional context for some data detector link for preview and action menu.
enrica@apple.com [Thu, 10 Mar 2016 02:05:49 +0000 (02:05 +0000)]
Retrieve additional context for some data detector link for preview and action menu.
https://bugs.webkit.org/show_bug.cgi?id=155278
rdar://problem/24884951

Reviewed by Tim Horton.

Source/WebCore:

Adding helper function to compute a range by moving by a number of characters
from a given position and direction.
Adding function to check if the given data detector link element requires
an extended context.

* editing/VisibleUnits.cpp:
(WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary):
* editing/VisibleUnits.h:
* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::requiresExtendedContext):

Source/WebKit2:

Data detector results for items like calendar events, can be augmented
retrieving the text surrounding the link.

* Platform/spi/ios/DataDetectorsUISPI.h:
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showDataDetectorsSheet]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

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

5 years agoES6: Implement lexical scoping for function definitions in strict mode
sbarati@apple.com [Thu, 10 Mar 2016 02:04:20 +0000 (02:04 +0000)]
ES6: Implement lexical scoping for function definitions in strict mode
https://bugs.webkit.org/show_bug.cgi?id=152844

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch implements block scoping for function definitions
in strict mode. The implementation works as follows:

- If we're in sloppy mode, function declarations work exactly
  as they did before this patch. I.e, function declarations are hoisted
  and declared like "var" variables.

- If you're in strict mode and at the top of a function scope or program
  scope, function declarations still work like they used to. They are defined
  like "var" variables. This is necessary for backwards compatibility
  because ES5 strict mode allowed duplicate function declarations at the
  top-most scope of a program/function.

- If you're in strict mode and inside a block statement or a switch statement,
  function declarations are now block scoped. All function declarations within
  a block are hoisted to the beginning of the block. They are not hoisted out of the
  block like they are in sloppy mode. This allows for the following types of
  programs:
  ```
  function foo() {
      function bar() { return 20; }
      {
          function bar() { return 30; }
          bar(); // 30
      }
      bar(); // 20
  }
  ```

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::instantiateLexicalVariables):
(JSC::BytecodeGenerator::emitPrefillStackTDZVariables):
(JSC::BytecodeGenerator::pushLexicalScope):
(JSC::BytecodeGenerator::pushLexicalScopeInternal):
(JSC::BytecodeGenerator::initializeBlockScopedFunctions):
(JSC::BytecodeGenerator::popLexicalScope):
(JSC::BytecodeGenerator::liftTDZCheckIfPossible):
(JSC::BytecodeGenerator::pushTDZVariables):
(JSC::BytecodeGenerator::getVariablesUnderTDZ):
(JSC::BytecodeGenerator::emitNewRegExp):
(JSC::BytecodeGenerator::emitNewFunctionExpressionCommon):
(JSC::BytecodeGenerator::emitNewFunctionExpression):
(JSC::BytecodeGenerator::emitNewArrowFunctionExpression):
* bytecompiler/BytecodeGenerator.h:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createSourceElements):
(JSC::ASTBuilder::features):
(JSC::ASTBuilder::numConstants):
(JSC::ASTBuilder::createFuncDeclStatement):
(JSC::ASTBuilder::createClassDeclStatement):
(JSC::ASTBuilder::createBlockStatement):
(JSC::ASTBuilder::createTryStatement):
(JSC::ASTBuilder::createSwitchStatement):
(JSC::ASTBuilder::Scope::Scope):
(JSC::ASTBuilder::funcDeclarations): Deleted.
* parser/NodeConstructors.h:
(JSC::CaseBlockNode::CaseBlockNode):
(JSC::SwitchNode::SwitchNode):
(JSC::BlockNode::BlockNode):
* parser/Nodes.cpp:
(JSC::ScopeNode::ScopeNode):
(JSC::ScopeNode::singleStatement):
(JSC::ProgramNode::ProgramNode):
(JSC::ModuleProgramNode::ModuleProgramNode):
(JSC::EvalNode::EvalNode):
(JSC::FunctionNode::FunctionNode):
(JSC::VariableEnvironmentNode::VariableEnvironmentNode):
* parser/Nodes.h:
(JSC::VariableEnvironmentNode::VariableEnvironmentNode):
(JSC::VariableEnvironmentNode::lexicalVariables):
(JSC::VariableEnvironmentNode::functionStack):
(JSC::ScopeNode::captures):
(JSC::ScopeNode::varDeclarations):
(JSC::ScopeNode::neededConstants):
(JSC::ProgramNode::startColumn):
(JSC::ProgramNode::endColumn):
(JSC::EvalNode::startColumn):
(JSC::EvalNode::endColumn):
(JSC::ModuleProgramNode::startColumn):
(JSC::ModuleProgramNode::endColumn):
(JSC::ScopeNode::functionStack): Deleted.
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::didFinishParsing):
(JSC::Parser<LexerType>::parseStatementListItem):
(JSC::Parser<LexerType>::parseSwitchStatement):
(JSC::Parser<LexerType>::parseBlockStatement):
(JSC::Parser<LexerType>::parseStatement):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::getMetadata):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseExportDeclaration):
* parser/Parser.h:
(JSC::Scope::declareVariable):
(JSC::Scope::declareFunction):
(JSC::Scope::appendFunction):
(JSC::Scope::takeFunctionDeclarations):
(JSC::Scope::declareLexicalVariable):
(JSC::Parser::currentVariableScope):
(JSC::Parser::currentLexicalDeclarationScope):
(JSC::Parser::currentFunctionScope):
(JSC::Parser::pushScope):
(JSC::Parser::popScopeInternal):
(JSC::Parser::declareVariable):
(JSC::Parser::declareFunction):
(JSC::Parser::hasDeclaredVariable):
(JSC::Parser::isFunctionMetadataNode):
(JSC::Parser<LexerType>::parse):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createFuncDeclStatement):
(JSC::SyntaxChecker::createClassDeclStatement):
(JSC::SyntaxChecker::createBlockStatement):
(JSC::SyntaxChecker::createExprStatement):
(JSC::SyntaxChecker::createIfStatement):
(JSC::SyntaxChecker::createContinueStatement):
(JSC::SyntaxChecker::createTryStatement):
(JSC::SyntaxChecker::createSwitchStatement):
(JSC::SyntaxChecker::createWhileStatement):
(JSC::SyntaxChecker::createWithStatement):
(JSC::SyntaxChecker::createDoWhileStatement):
* parser/VariableEnvironment.h:
(JSC::VariableEnvironmentEntry::isExported):
(JSC::VariableEnvironmentEntry::isImported):
(JSC::VariableEnvironmentEntry::isImportedNamespace):
(JSC::VariableEnvironmentEntry::isFunction):
(JSC::VariableEnvironmentEntry::setIsCaptured):
(JSC::VariableEnvironmentEntry::setIsConst):
(JSC::VariableEnvironmentEntry::setIsExported):
(JSC::VariableEnvironmentEntry::setIsImported):
(JSC::VariableEnvironmentEntry::setIsImportedNamespace):
(JSC::VariableEnvironmentEntry::setIsFunction):
(JSC::VariableEnvironmentEntry::clearIsVar):
(JSC::VariableEnvironment::VariableEnvironment):
(JSC::VariableEnvironment::begin):
(JSC::VariableEnvironment::end):
* tests/es6.yaml:
* tests/stress/block-scoped-function-declarations.js: Added.
(assert):
(test):
(f.foo.bar):
(f.foo.):
(f.foo):
(f):
(assert.foo.):
(assert.foo):
(assert.foo.foo):
(assert.foo.bar):
(assert.foo.switch.case.1):
(assert.foo.switch.case.2):
(assert.foo.switch.foo):
(assert.foo.switch.bar):

LayoutTests:

* js/let-syntax-expected.txt:
* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:
(testFailed):
(runTest):

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

5 years agoLast opened tab does not receive SetHiddenPageTimerThrottlingIncreaseLimit message
barraclough@apple.com [Thu, 10 Mar 2016 01:55:34 +0000 (01:55 +0000)]
Last opened tab does not receive SetHiddenPageTimerThrottlingIncreaseLimit message
https://bugs.webkit.org/show_bug.cgi?id=155126

Reviewed by Anders Carlson.

WebPageProxy will increment the hidden page throttling counter from within its constructor,
which currently causes the WebProcessPool to try to synchronously message all processes.
The web page triggering the increment then fails to receive the message, since it was
still being constructed. Make the update of the limit async, such that the page is fully
constructed before the WebProcessPool processes the update.

* UIProcess/WebProcessPool.cpp:
(WebKit::m_hiddenPageThrottlingAutoIncreasesCounter):
    - This now schedules a zero-delay timer to handle the update.
(WebKit::m_hiddenPageThrottlingTimer):
    - This is now responsible for calling updateHiddenPageThrottlingAutoIncreaseLimit.
* UIProcess/WebProcessPool.h:
    - Added m_hiddenPageThrottlingTimer.

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

5 years agocheck-webkit-style: fix false-positive warnings about @try/@catch blocks in Objective...
ddkilzer@apple.com [Thu, 10 Mar 2016 01:53:43 +0000 (01:53 +0000)]
check-webkit-style: fix false-positive warnings about @try/@catch blocks in Objective-C++ source files
<http://webkit.org/b/155273>

Reviewed by Andy Estes.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing_for_function_call): Ignore @catch lines.
(check_braces): Ditto.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_brace_at_begin_of_line): Add test case.

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

5 years agoFix the Windows build after <https://trac.webkit.org/changeset/197905>
dbates@webkit.org [Thu, 10 Mar 2016 01:46:40 +0000 (01:46 +0000)]
Fix the Windows build after <https://trac.webkit.org/changeset/197905>
(https://bugs.webkit.org/show_bug.cgi?id=155247)

We need to call the std::unique_ptr<CryptoDigest>() constructor directly
instead of using the convenience function std::make_unique<CryptoDigest>()
because std::make_unique<CryptoDigest>() cannot access the private constructor
CryptoDigest().

* platform/crypto/win/CryptoDigestWin.cpp:
(WebCore::CryptoDigest::create):

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

5 years agoEnhance existing Animometer tests
jonlee@apple.com [Thu, 10 Mar 2016 01:38:50 +0000 (01:38 +0000)]
Enhance existing Animometer tests
https://bugs.webkit.org/show_bug.cgi?id=155261

Reviewed by Simon Fraser.

* Animometer/tests/master/resources/canvas-tests.js: Add a gradient to
the filled circles. To expose more of the gradient, add another circle.
(SimpleCanvasStage.call.animate): For each frame, create a gradient with
undulating stop points and colors. Fill the circles twice; once with
the solid color, and once with the gradient.

* Animometer/tests/master/resources/dom-particles.js: Refactor the
emission variables into a separate stage for this test. Add a colorOffset
variable to make the colors of each particle slightly different, since
the ramp controller can add large numbers of particles all at once, which
would otherwise get all the same color.
* Animometer/tests/master/resources/particles.js:
(initialize): Remove the code specific to the SVG mask test.

* Animometer/tests/master/resources/image-data.js:
(initialize): Remove unused local variable.
* Animometer/tests/master/resources/multiply.js:
(initialize): Make the test harder by adding more total particles.

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

5 years agoWeb Inspector: Timelines UI redesign: use DataGridNode for TimelineView selection...
mattbaker@apple.com [Thu, 10 Mar 2016 01:38:03 +0000 (01:38 +0000)]
Web Inspector: Timelines UI redesign: use DataGridNode for TimelineView selection path components
https://bugs.webkit.org/show_bug.cgi?id=154954
<rdar://problem/24947939>

Reviewed by Timothy Hatcher.

This patch adds a new path component, TimelineDataGridNodePathComponent,
for creating a path component from the current grid selection. This is
needed since TimelineViews will no longer have an associated content tree
outline once the navigation sidebar is removed.

TimelineDataGridNode has new protected methods, "displayName" and
"iconClassNames", which are used to populate hierarchical path components,
create grid node data, and create cell content.

TimelineView subclasses share a certain amount of boilerplate code for
getting selection path components and handling path component selection.
In the future we may be able to reduce this code by introducing a new
DataGridTimelineView base class.

* UserInterface/Main.html:
Added/removed files.

* UserInterface/Views/LayoutTimelineDataGridNode.js:
(WebInspector.LayoutTimelineDataGridNode.prototype.get data):
(WebInspector.LayoutTimelineDataGridNode.prototype.createCellContent):
(WebInspector.LayoutTimelineDataGridNode):
(WebInspector.LayoutTimelineDataGridNode.prototype.get record): Deleted.
Moved to base class.

* UserInterface/Views/LayoutTimelineView.js:
(WebInspector.LayoutTimelineView.prototype.get selectionPathComponents):
(WebInspector.LayoutTimelineView.prototype.dataGridNodePathComponentSelected):
(WebInspector.LayoutTimelineView.prototype.treeElementPathComponentSelected): Deleted.
TimelineView tree outlines are going away.

* UserInterface/Views/MemoryTimelineView.js:
(WebInspector.MemoryTimelineView.prototype.treeElementPathComponentSelected): Deleted.
TimelineView tree outlines are going away.

* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype.get selectionPathComponents):
(WebInspector.NetworkTimelineView.prototype.dataGridNodePathComponentSelected):
(WebInspector.NetworkTimelineView.prototype.treeElementPathComponentSelected): Deleted.
TimelineView tree outlines are going away.

* UserInterface/Views/ProfileNodeDataGridNode.js:
(WebInspector.ProfileNodeDataGridNode.prototype.get data):
(WebInspector.ProfileNodeDataGridNode.prototype.createCellContent):
(WebInspector.ProfileNodeDataGridNode.prototype.displayName):
(WebInspector.ProfileNodeDataGridNode.prototype.iconClassNames):
(WebInspector.ProfileNodeDataGridNode):
(WebInspector.ProfileNodeDataGridNode.prototype._iconClassNameForProfileNode): Deleted.
(WebInspector.ProfileNodeDataGridNode.prototype._titleForProfileNode): Deleted.
Re-implemented as overrides of the base class methods "iconClassNames"
and "displayName".

* UserInterface/Views/RenderingFrameTimelineDataGridNode.js:
(WebInspector.RenderingFrameTimelineDataGridNode.prototype.createCellContent):
(WebInspector.RenderingFrameTimelineDataGridNode):
(WebInspector.RenderingFrameTimelineDataGridNode.prototype.get record): Deleted.
Moved to base class.

* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype.createCellContent):
(WebInspector.ResourceTimelineDataGridNode.prototype.displayName):
(WebInspector.ResourceTimelineDataGridNode.prototype.iconClassNames):
Override base class methods, making it possible to remove ResourceTimelineDataGridNodePathComponent,
and treat all TimelineDataGridNodes in a uniform manner.

(WebInspector.ResourceTimelineDataGridNode.prototype._createNameCellDocumentFragment):
Replace duplicated code with call to "displayName".

* UserInterface/Views/ResourceTimelineDataGridNodePathComponent.js: Removed.
Replaced by more generic solution, TimelineDataGridNodePathComponent.

* UserInterface/Views/ScriptDetailsTimelineView.js:
(WebInspector.ScriptDetailsTimelineView.prototype.get selectionPathComponents):
(WebInspector.ScriptDetailsTimelineView.prototype.dataGridNodePathComponentSelected):
(WebInspector.ScriptDetailsTimelineView.prototype.treeElementPathComponentSelected): Deleted.
TimelineView tree outlines are going away.

* UserInterface/Views/ScriptTimelineDataGridNode.js:
(WebInspector.ScriptTimelineDataGridNode.prototype.createCellContent):
(WebInspector.ScriptTimelineDataGridNode.prototype._createNameCellDocumentFragment):
Replace duplicated code with call to "displayName".

(WebInspector.ScriptTimelineDataGridNode):
(WebInspector.ScriptTimelineDataGridNode.prototype.get record): Deleted.
Moved to base class.

* UserInterface/Views/SourceCodeTimelineTimelineDataGridNode.js:
(WebInspector.SourceCodeTimelineTimelineDataGridNode.prototype.createCellContent):
(WebInspector.SourceCodeTimelineTimelineDataGridNode.prototype._createNameCellContent):
Replace duplicated code with call to "displayName".

* UserInterface/Views/TimelineDataGridNode.js:
(WebInspector.TimelineDataGridNode.prototype.get record):
Implemented in terms of the "records" getter, since all subclasses simply returned the
node's first (or only) record.

(WebInspector.TimelineDataGridNode.prototype.displayName):
(WebInspector.TimelineDataGridNode.prototype.iconClassNames):
Base class implementations, using utility methods in TimelineTabContentView
to get display data based on the node's timeline record. Can be overridden
by nodes that either don't have a timeline record (ProfileNodeDataGridNode)

* UserInterface/Views/TimelineDataGridNodePathComponent.js:
(WebInspector.TimelineDataGridNodePathComponent):
(WebInspector.TimelineDataGridNodePathComponent.prototype.get timelineDataGridNode):
(WebInspector.TimelineDataGridNodePathComponent.prototype.get previousSibling):
(WebInspector.TimelineDataGridNodePathComponent.prototype.get nextSibling):

* UserInterface/Views/TimelineView.js:
(WebInspector.TimelineView):
(WebInspector.TimelineView.prototype.get selectionPathComponents):
Must be implemented by subclasses since not all TimelineViews use a DataGrid.

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

5 years agoAdd text tests
jonlee@apple.com [Thu, 10 Mar 2016 01:37:35 +0000 (01:37 +0000)]
Add text tests
https://bugs.webkit.org/show_bug.cgi?id=155257

Reviewed by Simon Fraser.

* Animometer/resources/extensions.js:
(UnitBezier.Utilities.createClass): Add a class that computes Bezier points
assuming that two of the control points are at (0,0) and (1,1). Taken from
WebCore/platform/graphics/UnitBezier.h
* Animometer/resources/runner/tests.js: Add a test for English text and one
for international text.
* Animometer/tests/master/international.html: Added.
* Animometer/tests/master/resources/text.js: Added. The test assumes there is
#template div which it will copy. The copies are placed behind the template, and
are set with different colors each frame. They are moved around with CSS transform.
* Animometer/tests/master/text.html: Added.

Remove the other text tests, since these ones cover the same techniques.
* Animometer/tests/text/layering-text.html: Removed.
* Animometer/tests/text/resources/layering-text.js: Removed.
* Animometer/tests/text/resources/text-boxes.js: Removed.
* Animometer/tests/text/text-boxes.html: Removed.
* Animometer/resources/debug-runner/tests.js:

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

5 years agoAdd a new image test
jonlee@apple.com [Thu, 10 Mar 2016 01:35:18 +0000 (01:35 +0000)]
Add a new image test
https://bugs.webkit.org/show_bug.cgi?id=155232

Reviewed by Dean Jackson.
Provisionally reviewed by Said Abou-Hallawa.

The image test renders PNGs and moves them with translate and rotate
transforms. Each particle has a lifetime, and when the lifetime ends or
the particle goes offscreen, it resets itself somewhere on the stage.

* Animometer/resources/debug-runner/tests.js: Remove the CSS bouncing PNG
images test, because this one tests the same technique.
* Animometer/resources/runner/tests.js: Added here as "Leaves".
* Animometer/tests/master/leaves.html: Added.
* Animometer/tests/master/resources/particles.js: Refactor out the parts
specific to the DOM particles test. Consequently make velocity a public
member.
(initialize): The options parameter is never used, so remove it.
(animate): Remove unused local variable.
* Animometer/tests/master/resources/leaves.js: Maintains a focal point that
moves back and forth across the canvas. That point affects the velocity
of the particles. When the focal point is on the leftmost side, it is
between [-6, -2], and set in reset(). When the focal point is on the rightmost
side, it will be from [2, 6].
* Animometer/tests/master/resources/dom-particles.js: Move JS specific to
this test here from particles.js.

New images.
* Animometer/tests/master/resources/compass100.png: Added.
* Animometer/tests/master/resources/console100.png: Added.
* Animometer/tests/master/resources/contribute100.png: Added.
* Animometer/tests/master/resources/debugger100.png: Added.
* Animometer/tests/master/resources/inspector100.png: Added.
* Animometer/tests/master/resources/layout100.png: Added.
* Animometer/tests/master/resources/performance100.png: Added.
* Animometer/tests/master/resources/script100.png: Added.
* Animometer/tests/master/resources/shortcuts100.png: Added.
* Animometer/tests/master/resources/standards100.png: Added.
* Animometer/tests/master/resources/storage100.png: Added.
* Animometer/tests/master/resources/styles100.png: Added.
* Animometer/tests/master/resources/timeline100.png: Added.

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

5 years agoWeb Inspector: Nodes in Computed Styles > Container Regions formatted incorrectly.
mattbaker@apple.com [Thu, 10 Mar 2016 01:10:09 +0000 (01:10 +0000)]
Web Inspector: Nodes in Computed Styles > Container Regions formatted incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=155277
<rdar://problem/25072711>

Reviewed by Timothy Hatcher.

* UserInterface/Views/DOMTreeDataGrid.js:
(WebInspector.DOMTreeDataGrid):
Enable icon column property.

* UserInterface/Views/DOMTreeDataGridNode.js:
(WebInspector.DOMTreeDataGridNode):
Removed calls to unused methods.

(WebInspector.DOMTreeDataGridNode.prototype.createCellContent):
(WebInspector.DOMTreeDataGridNode.prototype._createNameCellDocumentFragment):
Simplified cell content creation.

(WebInspector.DOMTreeDataGridNode.prototype._updateNodeName): Deleted.
(WebInspector.DOMTreeDataGridNode.prototype._makeNameCell): Deleted.
Renamed _createNameCellDocumentFragment to be consistent with similar
methods in other data grid node classes.

(WebInspector.DOMTreeDataGridNode.prototype._updateNameCellData): Deleted.
No longer needed.

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

5 years ago[Win] Implement CryptoDigest
dbates@webkit.org [Thu, 10 Mar 2016 01:09:03 +0000 (01:09 +0000)]
[Win] Implement CryptoDigest
https://bugs.webkit.org/show_bug.cgi?id=155247
<rdar://problem/25065843>

Reviewed by Brent Fulgham.

Implement the CryptoDigest abstraction for Windows so that we can compute cryptographically
secure hashes. This will allow us to support Content Security Policy inline script and inline
stylesheet hashes on Windows.

* PlatformWin.cmake: Add file CryptoDigestWin.cpp.
* PlatformWinCairo.cmake: Ditto.
* platform/crypto/win/CryptoDigestWin.cpp: Added.
(WebCore::CryptoDigest::CryptoDigest): Instantiate a CryptoDigestContext object.
(WebCore::CryptoDigest::~CryptoDigest): Destroy the cryptographic service provider and hash
object if non-null.
(WebCore::CryptoDigest::create): Acquire a handle to a cryptographic service provider (HCRYPTPROV)
and a handle to a hash object (HCRYPTHASH).
(WebCore::CryptoDigest::addBytes): Add the contents of the specified buffer to the hash object.
(WebCore::CryptoDigest::computeHash): Compute and return a Vector of bytes that represent the digest.

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

5 years agoBuild fix after r196870.
rniwa@webkit.org [Thu, 10 Mar 2016 01:02:35 +0000 (01:02 +0000)]
Build fix after r196870.

* public/include/report-processor.php:

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

5 years agoAdd Size metric to perf dashboard
rniwa@webkit.org [Thu, 10 Mar 2016 01:00:14 +0000 (01:00 +0000)]
Add Size metric to perf dashboard
https://bugs.webkit.org/show_bug.cgi?id=155266

Reviewed by Chris Dumez.

Added the "Size" metric and use bytes as its unit.

* public/js/helper-classes.js:
(PerfTestRuns):
* public/v2/data.js:
(RunsData.unitFromMetricName):

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

5 years agoREGRESSION (r197149): Missing availability checks when soft-linking DataDetectors...
ddkilzer@apple.com [Thu, 10 Mar 2016 00:56:31 +0000 (00:56 +0000)]
REGRESSION (r197149): Missing availability checks when soft-linking DataDetectors.framework
<http://webkit.org/b/155258>

Reviewed by Andy Estes.

Source/WebCore:

* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::setDDHighlight):
(WebCore::ServicesOverlayController::Highlight::paintContents):
(WebCore::ServicesOverlayController::mouseIsOverHighlight):
- Add check that returns early if DataDetectors.framework is not
  available.

* platform/spi/mac/DataDetectorsSPI.h:
- Mark Objective-C classses as optional.

Source/WebKit/mac:

* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _clearImmediateActionState]):
(-[WebImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
(-[WebImmediateActionController _animationControllerForDataDetectedText]):
(-[WebImmediateActionController _animationControllerForDataDetectedLink]):
- Add check that returns early if DataDetectors.framework is not
  available.

Source/WebKit2:

* Platform/mac/MenuUtilities.mm:
(WebKit::menuItemForTelephoneNumber):
(WebKit::menuForTelephoneNumber):
- Add check that returns early if DataDetectors.framework is not
  available.

* Shared/mac/WebHitTestResultData.mm:
(WebKit::WebHitTestResultData::platformDecode):
- Add Debug assertion.  The soft-linked code should never be
  called if there was no actionContext passed in.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly):
- Protect calls to DDActionsManager with availability check.

* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _clearImmediateActionState]):
(-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
- Protect calls to DDActionsManager with availability check.
(-[WKImmediateActionController _animationControllerForDataDetectedText]):
(-[WKImmediateActionController _animationControllerForDataDetectedLink]):
- Add check that returns early if DataDetectors.framework is not
  available.

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

5 years agoAdd state dumping facility
commit-queue@webkit.org [Thu, 10 Mar 2016 00:45:35 +0000 (00:45 +0000)]
Add state dumping facility
https://bugs.webkit.org/show_bug.cgi?id=154930
<rdar://problem/24939135>

Patch by Keith Rollin <krollin@apple.com> on 2016-03-09
Reviewed by Anders Carlsson.

Source/WebKit2:

Collect the times at which pages are loaded. Dump them when an OS
state dump is triggered.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::lastPageLoadTime):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::registerWithStateDumper):
(WebKit::WebProcess::platformInitializeProcess):

Source/WTF:

Add an OS_STATE flag to control the inclusion of process state dumping
functionality.

* wtf/Platform.h:

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

5 years agoRemoving reference to Dashboard.Repository.Internal.trac from open source unit tests.
jmarcell@apple.com [Thu, 10 Mar 2016 00:40:30 +0000 (00:40 +0000)]
Removing reference to Dashboard.Repository.Internal.trac from open source unit tests.
https://bugs.webkit.org/show_bug.cgi?id=155274

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js:
(setup): Deleted. In bug 154180 we removed Dashboard.Repository.Internal which was causing an
error in the unit tests.

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

5 years agoArray.isArray support for Proxy
sbarati@apple.com [Thu, 10 Mar 2016 00:36:06 +0000 (00:36 +0000)]
Array.isArray support for Proxy
https://bugs.webkit.org/show_bug.cgi?id=155179

Reviewed by Mark Lam.

This patch implements Array.isArray to be compliant
with the ES6 spec. Specifically, it needs to interface
properly with Proxy arguments.
https://tc39.github.io/ecma262/#sec-isarray

* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::getCallData):
(JSC::arrayConstructorIsArray):
(JSC::arrayConstructorPrivateFuncIsArrayConstructor):
* runtime/ArrayPrototype.cpp:
(JSC::speciesConstructArray):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::revoke):
(JSC::ProxyObject::isRevoked):
(JSC::ProxyObject::visitChildren):
* runtime/ProxyObject.h:
(JSC::ProxyObject::target):
(JSC::ProxyObject::handler):
* tests/es6.yaml:
* tests/stress/proxy-is-array.js: Added.
(assert):
(test):

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

5 years agoAdd heuristic for "main content" videos which override user gesture requirements
jer.noble@apple.com [Thu, 10 Mar 2016 00:22:12 +0000 (00:22 +0000)]
Add heuristic for "main content" videos which override user gesture requirements
https://bugs.webkit.org/show_bug.cgi?id=155224

Reviewed by Eric Carlson.

Source/WebCore:

Tests: media/video-main-content-allow-then-deny.html
       media/video-main-content-allow.html
       media/video-main-content-deny-display-none.html
       media/video-main-content-deny-not-in-dom.html
       media/video-main-content-deny-not-visible.html
       media/video-main-content-deny-obscured.html
       media/video-main-content-deny-too-small.html

Add a new behavior "restriction" to MediaElementSession that allows media elements
to optionally overriding their own user gesture requirements if the session determines
that the media element is the page's "main content".

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didAttachRenderers):
(WebCore::HTMLMediaElement::updateShouldPlay):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::restrictionName):
(WebCore::MediaElementSession::MediaElementSession):
(WebCore::MediaElementSession::addBehaviorRestriction):
(WebCore::MediaElementSession::playbackPermitted):
(WebCore::MediaElementSession::dataLoadingPermitted):
(WebCore::isMainContent):
(WebCore::MediaElementSession::mainContentCheckTimerFired):
(WebCore::MediaElementSession::updateIsMainContent):
* html/MediaElementSession.h:
* testing/Internals.cpp:
(WebCore::Internals::setMediaElementRestrictions):

LayoutTests:

* media/video-main-content-allow-expected.txt: Added.
* media/video-main-content-allow-then-deny-expected.txt: Added.
* media/video-main-content-allow-then-deny.html: Added.
* media/video-main-content-allow.html: Added.
* media/video-main-content-deny-display-none-expected.txt: Added.
* media/video-main-content-deny-display-none.html: Added.
* media/video-main-content-deny-not-in-dom-expected.txt: Added.
* media/video-main-content-deny-not-in-dom.html: Added.
* media/video-main-content-deny-not-visible-expected.txt: Added.
* media/video-main-content-deny-not-visible.html: Added.
* media/video-main-content-deny-obscured-expected.txt: Added.
* media/video-main-content-deny-obscured.html: Added.
* media/video-main-content-deny-too-small-expected.txt: Added.
* media/video-main-content-deny-too-small.html: Added.

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

5 years agoAdded missing #if(SOUP) after r197591.
commit-queue@webkit.org [Thu, 10 Mar 2016 00:14:07 +0000 (00:14 +0000)]
Added missing #if(SOUP) after r197591.
https://bugs.webkit.org/show_bug.cgi?id=155259

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-03-09
Reviewed by Alex Christensen.

No new tests needed.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:

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

5 years ago_WKWebsiteDataSize.h should be an SPI header.
andersca@apple.com [Thu, 10 Mar 2016 00:03:04 +0000 (00:03 +0000)]
_WKWebsiteDataSize.h should be an SPI header.

Rubber-stamped by Tim Horton.

* WebKit2.xcodeproj/project.pbxproj:

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

5 years ago[JSC] Fix the ARM64 MacroAssembler after r197816
commit-queue@webkit.org [Wed, 9 Mar 2016 23:57:30 +0000 (23:57 +0000)]
[JSC] Fix the ARM64 MacroAssembler after r197816
https://bugs.webkit.org/show_bug.cgi?id=155268

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

The patch tries to generate instructions that do not exist,
causing quite fun stuff at runtime.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::load8):
(JSC::MacroAssemblerARM64::store16):
(JSC::MacroAssemblerARM64::store8):

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

5 years agoSkipping js/regress/getter-richards-try-catch.html on ios-simulator debug
ryanhaddad@apple.com [Wed, 9 Mar 2016 23:47:57 +0000 (23:47 +0000)]
Skipping js/regress/getter-richards-try-catch.html on ios-simulator debug
https://bugs.webkit.org/show_bug.cgi?id=155271

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

5 years agoAdd a getter for WebVideoFullscreenInterfaceObjC and update its rate property
adachan@apple.com [Wed, 9 Mar 2016 23:36:22 +0000 (23:36 +0000)]
Add a getter for WebVideoFullscreenInterfaceObjC and update its rate property
https://bugs.webkit.org/show_bug.cgi?id=155239

Reviewed by Eric Carlson.

* platform/mac/WebVideoFullscreenInterfaceMac.h:
Move the stub implementation of setVideoDimensions() to the mm file.
Declare a getter to WebVideoFullscreenInterfaceMacObjC.
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::setRate):
Also update the rate property of WebVideoFullscreenInterfaceMacObjC.
(WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions):
Stub implementation of setVideoDimensions() has been moved to here.

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

5 years agoFix Mac build without video enabled after r197633.
achristensen@apple.com [Wed, 9 Mar 2016 23:33:55 +0000 (23:33 +0000)]
Fix Mac build without video enabled after r197633.

* bindings/objc/DOM.mm:

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

5 years agouse ulimit command to check process limit in webkitpy
aakash_jain@apple.com [Wed, 9 Mar 2016 23:07:49 +0000 (23:07 +0000)]
use ulimit command to check process limit in webkitpy
https://bugs.webkit.org/show_bug.cgi?id=155260

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort.default_child_processes): Use ulimit command output instead of
launchctl limit maxproc command.

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

5 years agoSkip two flaky tests on mac-wk1
ryanhaddad@apple.com [Wed, 9 Mar 2016 23:02:57 +0000 (23:02 +0000)]
Skip two flaky tests on mac-wk1
https://bugs.webkit.org/show_bug.cgi?id=155196

Unreviewed test gardening.

media/video-with-blob-url-allowed-by-csp-media-src-star.html and media/video-with-data-url-allowed-by-csp-media-src-star.html
are flaky on mac-wk1. Skipping to get bots to green during investigation.

* platform/mac-wk1/TestExpectations:

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

5 years agoHandling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test...
bfulgham@apple.com [Wed, 9 Mar 2016 23:00:57 +0000 (23:00 +0000)]
Handling 'allowUniversalAccessFromFileURLs' on WKWebViewConfiguration causes test breakage
https://bugs.webkit.org/show_bug.cgi?id=155265

Unreviewed work-around to allow testing to continue.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]): Workaround build break.

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

5 years agoUnreviewed, rolling out r197873.
commit-queue@webkit.org [Wed, 9 Mar 2016 22:34:08 +0000 (22:34 +0000)]
Unreviewed, rolling out r197873.
https://bugs.webkit.org/show_bug.cgi?id=155262

"Crashes some JSC tests" (Requested by mlam on #webkit).

Reverted changeset:

"Add dumping of function expression names in CodeBlock
bytecode dump."
https://bugs.webkit.org/show_bug.cgi?id=155248
http://trac.webkit.org/changeset/197873

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

5 years agoRename Node.treeRoot to rootNode and turn it on by default
rniwa@webkit.org [Wed, 9 Mar 2016 22:29:33 +0000 (22:29 +0000)]
Rename Node.treeRoot to rootNode and turn it on by default
https://bugs.webkit.org/show_bug.cgi?id=155226

Reviewed by Antonio Gomes.
Source/WebCore:

Node.prototype.treeRoot has been merged into DOM spec from Shadow DOM spec and renamed to rootNode:
https://dom.spec.whatwg.org/#dom-node-rootnode

Rename the method and expose it unconditionally on Node.prototype.

Tests: fast/dom/Node/rootNode.html
       fast/shadow-dom/Node-interface-rootNode.html

* dom/ContainerNode.h:
(WebCore::Node::highestAncestor): Deleted. There is no need for this function to be inlined.
* dom/Document.h: Now that both TreeScope and Node defines rootNode, we need to pick either.
Here, we pick TreeScope's definition since Document is by definition always in a document so there is
no need to even check inTreeScope().
* dom/Node.cpp:
(WebCore::Node::rootNode): Moved here. Also added a fast path for when "this" node is in a document
or a shadow root since TreeScope stores its root node as a member variable (m_rootNode).
* dom/Node.h:
* dom/Node.idl: Renamed the method and removed Conditional=SHADOW_DOM.
* dom/ShadowRoot.h: Similar to the change in Document.h. See above.
* editing/Editor.cpp:
(WebCore::correctSpellcheckingPreservingTextCheckingParagraph): Use rootNode instead of free function
defined in htmlediting.cpp, which was removed in this patch.
* editing/htmlediting.cpp:
(WebCore::highestAncestor): Deleted.
* editing/htmlediting.h:
* html/FormAssociatedElement.cpp:
(WebCore::computeRootNode): Added.
(WebCore::FormAssociatedElement::removedFrom): We can't use Node::rootNode here because this function
is called in the middle of removing a subtree, and some associated form element's inDocument flag may
not have been updated yet. So use computeRootNode to manually find the highest ancestor.
(WebCore::FormAssociatedElement::formRemovedFromTree): Ditto.
* xml/XPathPath.cpp:
(WebCore::XPath::LocationPath::evaluate):

LayoutTests:

Split Node-interface-treeRoot.html into two pieces, the one that doesn't invoke shadow DOM and the other that tests
shadow DOM related cases. I intend to upstream these tests to W3C at some point so keep them in testharness.js form.

* fast/dom/Node/rootNode-expected.txt: Added.
* fast/dom/Node/rootNode.html: Copied from LayoutTests/fast/shadow-dom/Node-interface-treeRoot.html.
* fast/shadow-dom/Node-interface-rootNode-expected.txt: Renamed from Node-interface-treeRoot-expected.txt.
* fast/shadow-dom/Node-interface-rootNode.html: Renamed from LayoutTests/fast/shadow-dom/Node-interface-treeRoot.html.
* js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/efl/js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/gtk/js/dom/dom-static-property-for-in-iteration-expected.txt:

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

5 years ago[cmake] Fixed All-in-One build.
commit-queue@webkit.org [Wed, 9 Mar 2016 21:50:04 +0000 (21:50 +0000)]
[cmake] Fixed All-in-One build.
https://bugs.webkit.org/show_bug.cgi?id=155241

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

.:

* Source/cmake/WebKitMacros.cmake: Last item of WebCore_SOURCES was
not removed in PROCESS_ALLINONE_FILE.

Source/WebCore:

No new tests needed.

* bindings/js/JSBindingsAllInOne.cpp: Should not include generated
file.

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

5 years agoFix use-after-free when cancelling synchronous XHR when using NetworkSession
achristensen@apple.com [Wed, 9 Mar 2016 21:49:59 +0000 (21:49 +0000)]
Fix use-after-free when cancelling synchronous XHR when using NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=155253

Reviewed by Brady Eidson.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::continueWillSendRequest):
Store the completion handler on the stack before calling didFail, which deletes the
NetworkLoad, so we don't access m_redirectCompletionHandler after deleting the NetworkLoad.

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

5 years agoUnreviewed, rebaseline bindings tests after r197874.
cdumez@apple.com [Wed, 9 Mar 2016 21:48:19 +0000 (21:48 +0000)]
Unreviewed, rebaseline bindings tests after r197874.

* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::JSattribute::getOwnPropertySlot):
* bindings/scripts/test/JS/JSattribute.h:

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

5 years agoStop building armv7 on iOS device builders
ap@apple.com [Wed, 9 Mar 2016 21:44:00 +0000 (21:44 +0000)]
Stop building armv7 on iOS device builders
https://bugs.webkit.org/show_bug.cgi?id=155246

Reviewed by David Kilzer.

* BuildSlaveSupport/build.webkit.org-config/config.json: Building both armv7 and
armv7s makes the bots unnecessarily slow. We can catch super rare v7-only regressions
elsewhere.

* Scripts/webkitpy/common/config/ews.json: Changed EWS to match, as we always want
EWS configuration to be verified by buildbot queues.

* Scripts/webkitdirs.pm:
* Scripts/webkitpy/port/ios.py:
Changed default to arm64. I think that the default is probably not used in any
practical scenarios, but it's nice to make it more sensible.

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

5 years agoUnreviewed, rolling out r197698.
commit-queue@webkit.org [Wed, 9 Mar 2016 21:31:03 +0000 (21:31 +0000)]
Unreviewed, rolling out r197698.
https://bugs.webkit.org/show_bug.cgi?id=155252

Caused assertions, and wasn't reviewed by a WK2 owner
(Requested by andersca on #webkit).

Reverted changeset:

"Last opened tab does not receive
SetHiddenPageTimerThrottlingIncreaseLimit message"
https://bugs.webkit.org/show_bug.cgi?id=155126
http://trac.webkit.org/changeset/197698

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

5 years agoWebsiteDataStore::Configuration::legacyWebsiteDataStoreConfiguration() should respect...
conrad_shultz@apple.com [Wed, 9 Mar 2016 21:30:45 +0000 (21:30 +0000)]
WebsiteDataStore::Configuration::legacyWebsiteDataStoreConfiguration() should respect the passed-in configuration
https://bugs.webkit.org/show_bug.cgi?id=155250

Reviewed by Anders Carlsson.

Note that the legacy directories are already set by default in ProcessPoolConfiguration::createWithLegacyOptions(),
which is also where the shouldHaveLegacyDataStore flag, which will cause this code path to be reached, is set.

* UIProcess/WebProcessPool.cpp:
(WebKit::legacyWebsiteDataStoreConfiguration):
Use the passed-in configuration to set the application cache, network cache, and media keys storage directories.

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

5 years agoFor RSS feeds, convert image and link relative URIs to absolute URIs
jond@apple.com [Wed, 9 Mar 2016 21:30:07 +0000 (21:30 +0000)]
For RSS feeds, convert image and link relative URIs to absolute URIs
https://bugs.webkit.org/show_bug.cgi?id=155237

Reviewed by Timothy Hatcher.

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

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

5 years agoSpeculative disk cache resource revalidations are sometimes wasted
cdumez@apple.com [Wed, 9 Mar 2016 21:22:36 +0000 (21:22 +0000)]
Speculative disk cache resource revalidations are sometimes wasted
https://bugs.webkit.org/show_bug.cgi?id=155187
<rdar://problem/25032905>

Reviewed by Antti Koivisto.

Speculative disk cache resource revalidations were sometimes wasted.

We would sometimes correctly revalidate a resource but the
NetworkResourceLoader then either:
1. Fail to reuse the speculatively validated entry
2. Reuse the speculatively validated entry but then validate it again

Bug 1 was caused by the revalidated entry key sometimes being
different from the cached entry key. This could happen when
revalidation fails (the server did not send back a 304) in
which case we call NetworkCache::store() which creates a new
cache Entry, generating a cache key from our revalidation
request. If the original request has a cache partition or a
range, then the keys would not match because we did not set
the cache partition or the range on the revalidation request.
This has been addressed by setting the cache partition on the
revalidation request in constructRevalidationRequest() and by
not doing revalidation if the original request had a 'range'
header.

Bug 2 was caused by us marking a speculatively revalidated entry
as "not needing revalidating" only in Cache::update(). Cache::update()
is only called in the case the revalidation was successful (server
returned a 304). If revalidation was not successful, Cache::store()
would be called instead was we would fail to update the
needsRevalidation flag. NetworkResourceLoader would then validate
again the resource that was already speculatively revalidated.
To address the problem, we now update the 'needsRevalidation' flag
as soon as the speculative revalidation completes, in
SpeculativeLoad::didComplete().

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::makeCacheKey):
(WebKit::NetworkCache::Cache::update):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::setNeedsValidation):
* NetworkProcess/cache/NetworkCacheEntry.h:
* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::noPartitionString):
(WebKit::NetworkCache::Key::Key):
(WebKit::NetworkCache::Key::hasPartition):
* NetworkProcess/cache/NetworkCacheKey.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::didComplete):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::constructRevalidationRequest):
(WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
(WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):

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

5 years agoFix old iOS
oliver@apple.com [Wed, 9 Mar 2016 21:15:00 +0000 (21:15 +0000)]
Fix old iOS

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

5 years agoWeb Inspector: Remove unnecessary constructor
commit-queue@webkit.org [Wed, 9 Mar 2016 21:13:51 +0000 (21:13 +0000)]
Web Inspector: Remove unnecessary constructor
https://bugs.webkit.org/show_bug.cgi?id=155249

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

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

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

5 years agoWincairo buildfix
oliver@apple.com [Wed, 9 Mar 2016 21:09:51 +0000 (21:09 +0000)]
Wincairo buildfix
https://bugs.webkit.org/show_bug.cgi?id=155245

Reviewed by Mark Lam.

Fix up exports for a few symbols

* jit/ExecutableAllocator.h:
* jit/ExecutableAllocatorFixedVMPool.cpp:

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

5 years agofocus() / blur() should be on HTMLElement / SVGElement, not Element
cdumez@apple.com [Wed, 9 Mar 2016 20:55:28 +0000 (20:55 +0000)]
focus() / blur() should be on HTMLElement / SVGElement, not Element
https://bugs.webkit.org/show_bug.cgi?id=155216

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

focus() / blur() should be on HTMLElement / SVGElement, not Element:
- https://html.spec.whatwg.org/multipage/dom.html#htmlelement
- https://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement

Chrome and Firefox match the specification.

Note that after this change, focus() / blur() is no longer exposed
on MathMLElement. This matches the MathML specification and is
consistent with Firefox and Chrome.

* dom/Element.idl:
* html/HTMLElement.idl:
* svg/SVGElement.idl:

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

5 years agoMove attributes to the instance for most interfaces that have "Error" in their name
cdumez@apple.com [Wed, 9 Mar 2016 20:37:36 +0000 (20:37 +0000)]
Move attributes to the instance for most interfaces that have "Error" in their name
https://bugs.webkit.org/show_bug.cgi?id=155231

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Our bindings generator was keeping attributes on the instances for
interfaces having "Error" or "Exception" in their name. The reason is
that interfaces that have "Error" in their prototype would not behave
correctly otherwise because "Error" incorrectly has its attributes on
the instance at the moment. However, in our bindings generator, the
condition to decide if an interface's prototype should be "Error" is
if $interface->isException. Therefore, we should use the same condition
to decide if we should keep attributes on the instance until "Error"
is updated to have its attributes on the prototype. Doing this for any
interface having "Error" or "Exception" in their name is overkill.

No new tests, already covered by existing test.

* bindings/scripts/CodeGeneratorJS.pm:
(InterfaceRequiresAttributesOnInstance):

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

5 years agoAdd dumping of function expression names in CodeBlock bytecode dump.
mark.lam@apple.com [Wed, 9 Mar 2016 20:36:40 +0000 (20:36 +0000)]
Add dumping of function expression names in CodeBlock bytecode dump.
https://bugs.webkit.org/show_bug.cgi?id=155248

Reviewed by Filip Pizlo.

Because ...
[  19] new_func_exp      loc5, loc3, f0:foo

... is more informative than
[  19] new_func_exp      loc5, loc3, f0

Anonymous functions will be dumped as <anon>.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpFunctionExpr):
(JSC::CodeBlock::dumpBytecode):
* bytecode/CodeBlock.h:

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

5 years agoAdd iOS Simulator EWS to bot watcher's dashboard
ap@apple.com [Wed, 9 Mar 2016 20:36:35 +0000 (20:36 +0000)]
Add iOS Simulator EWS to bot watcher's dashboard
https://bugs.webkit.org/show_bug.cgi?id=155220

Reviewed by Lucas Forschler.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:

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

5 years agoRename WebCore/platform/crypto/mac/CryptoDigestMac.cpp to WebCore/platform/crypto...
dbates@webkit.org [Wed, 9 Mar 2016 20:25:25 +0000 (20:25 +0000)]
Rename WebCore/platform/crypto/mac/CryptoDigestMac.cpp to WebCore/platform/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
https://bugs.webkit.org/show_bug.cgi?id=155244

Reviewed by Alexey Proskuryakov.

The file WebCore/platform/crypto/mac/CryptoDigestMac.cpp is applicable to both iOS and OS X.
We should move and rename this file to reflect that is applicable to both of these platforms.

* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp: Renamed from Source/WebCore/platform/crypto/mac/CryptoDigestMac.cpp.

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

5 years agoLocal HTML should be blocked from localStorage access unless "Disable Local File...
bfulgham@apple.com [Wed, 9 Mar 2016 20:22:28 +0000 (20:22 +0000)]
Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
https://bugs.webkit.org/show_bug.cgi?id=155185
Source/WebKit2:

Reviewed by Anders Carlsson.
<rdar://problem/11101440>

Tested by TestWebKitAPI tests IndexedDB.IndexedDBMultiProcess and IndexedDB.IndexedDBPersistence.

Allow Cocoa WKWebViewConfiguration access to the 'allowUniversalAccessFromFileURLs' setting.

* UIProcess/API/Cocoa/WKWebView.mm:
(- [WKWebView _initializeWithConfiguration]): Set 'allowUniversalAccessFromFileURLsKey' in
page configuration.
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _allowUniversalAccessFromFileURLs]): Added,
(-[WKWebViewConfiguration _setAllowUniversalAccessFromFileURLs:]): Added.
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

Tools:

<rdar://problem/11101440>

Reviewed by Anders Carlsson.

* TestWebKitAPI/Tests/WebKit2/CloseFromWithinCreatePage.cpp:
(TestWebKitAPI::TEST): Allow local file accesss to run test.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBMultiProcess.mm:
(TEST): Ditto.
* TestWebKitAPI/Tests/WebKit2Cocoa/IndexedDBPersistence.mm:
(TEST): Ditto.

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

5 years ago[ES6] Implement RegExp sticky flag and related functionality
msaboff@apple.com [Wed, 9 Mar 2016 20:11:46 +0000 (20:11 +0000)]
[ES6] Implement RegExp sticky flag and related functionality
https://bugs.webkit.org/show_bug.cgi?id=155177

Reviewed by Saam Barati.

Source/JavaScriptCore:

Implemented the ES6 RegExp sticky functionality.

There are two main behavior changes when the sticky flag is specified.
1) Matching starts at lastIndex and lastIndex is updated after the match.
2) The regular expression is only matched from the start position in the string.
See ES6 section 21.2.5.2.2 for details.

Changed both the Yarr interpreter and jit to not loop to the next character for sticky RegExp's.
Updated RegExp exec and match, and stringProtoFuncMatch to handle lastIndex changes.

Restructured the way flags are passed to and through YarrPatterns to use RegExpFlags instead of
individual bools.

Updated tests for 'y' flag and new behavior.

* bytecode/CodeBlock.cpp:
(JSC::regexpToSourceString):
* inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::findMagicComment):
* runtime/CommonIdentifiers.h:
* runtime/RegExp.cpp:
(JSC::regExpFlags):
(JSC::RegExpFunctionalTestCollector::outputOneTest):
(JSC::RegExp::finishCreation):
(JSC::RegExp::compile):
(JSC::RegExp::compileMatchOnly):
* runtime/RegExp.h:
* runtime/RegExpKey.h:
* runtime/RegExpObjectInlines.h:
(JSC::RegExpObject::execInline):
(JSC::RegExpObject::matchInline):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncCompile):
(JSC::flagsString):
(JSC::regExpProtoGetterMultiline):
(JSC::regExpProtoGetterSticky):
(JSC::regExpProtoGetterUnicode):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncMatch):
* tests/es6.yaml:
* tests/stress/static-getter-in-names.js:
(shouldBe):
* yarr/RegularExpression.cpp:
(JSC::Yarr::RegularExpression::Private::compile):
* yarr/YarrInterpreter.cpp:
(JSC::Yarr::Interpreter::tryConsumeBackReference):
(JSC::Yarr::Interpreter::matchAssertionBOL):
(JSC::Yarr::Interpreter::matchAssertionEOL):
(JSC::Yarr::Interpreter::matchAssertionWordBoundary):
(JSC::Yarr::Interpreter::matchDotStarEnclosure):
(JSC::Yarr::Interpreter::matchDisjunction):
(JSC::Yarr::Interpreter::Interpreter):
(JSC::Yarr::ByteCompiler::atomPatternCharacter):
* yarr/YarrInterpreter.h:
(JSC::Yarr::BytecodePattern::BytecodePattern):
(JSC::Yarr::BytecodePattern::estimatedSizeInBytes):
(JSC::Yarr::BytecodePattern::ignoreCase):
(JSC::Yarr::BytecodePattern::multiline):
(JSC::Yarr::BytecodePattern::sticky):
(JSC::Yarr::BytecodePattern::unicode):
* yarr/YarrJIT.cpp:
(JSC::Yarr::YarrGenerator::matchCharacterClass):
(JSC::Yarr::YarrGenerator::jumpIfCharNotEquals):
(JSC::Yarr::YarrGenerator::generateAssertionBOL):
(JSC::Yarr::YarrGenerator::generateAssertionEOL):
(JSC::Yarr::YarrGenerator::generatePatternCharacterOnce):
(JSC::Yarr::YarrGenerator::generatePatternCharacterFixed):
(JSC::Yarr::YarrGenerator::generateDotStarEnclosure):
(JSC::Yarr::YarrGenerator::backtrack):
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::YarrPatternConstructor):
(JSC::Yarr::YarrPatternConstructor::atomPatternCharacter):
(JSC::Yarr::YarrPatternConstructor::setupAlternativeOffsets):
(JSC::Yarr::YarrPatternConstructor::optimizeBOL):
(JSC::Yarr::YarrPattern::compile):
(JSC::Yarr::YarrPattern::YarrPattern):
* yarr/YarrPattern.h:
(JSC::Yarr::YarrPattern::reset):
(JSC::Yarr::YarrPattern::nonwordcharCharacterClass):
(JSC::Yarr::YarrPattern::ignoreCase):
(JSC::Yarr::YarrPattern::multiline):
(JSC::Yarr::YarrPattern::sticky):
(JSC::Yarr::YarrPattern::unicode):

LayoutTests:

New and updated tests.

* js/Object-getOwnPropertyNames-expected.txt:
* js/regexp-flags-expected.txt:
* js/regexp-sticky-expected.txt: Added.
* js/regexp-sticky.html: Added.
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/regexp-flags.js:
(RegExp.prototype.hasOwnProperty): Deleted check for sticky property.
* js/script-tests/regexp-sticky.js: New test.
(asString):
(testStickyExec):
(testStickyMatch):

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

5 years agoRemoving and re-adding a script message handler with the same name results in an...
timothy_horton@apple.com [Wed, 9 Mar 2016 19:56:41 +0000 (19:56 +0000)]
Removing and re-adding a script message handler with the same name results in an unusable message handler
https://bugs.webkit.org/show_bug.cgi?id=155223

Reviewed by Sam Weinig.
Source/WebCore:

New API test: WKUserContentController.ScriptMessageHandlerReplaceWithSameName.

* page/UserMessageHandler.h:
(WebCore::UserMessageHandler::descriptor):
* page/UserMessageHandlersNamespace.cpp:
(WebCore::UserMessageHandlersNamespace::handler):
This lazy removal mechanism combined with the fact that we only compare
handler name and world makes it such that m_messageHandlers could have
a stale UserMessageHandler with a UserMessageHandlerDescriptor that differed
only in client.

It is safe to compare the descriptors by pointer instead because m_messageHandler
holds a strong reference to its UserMessageHandlerDescriptors, and this will ensure
that the add-remove-add path (with identical name and world) causes a new
UserContentController to be created.

We also now clean up any stale UserMessageHandlers whenever we're about to
add a new one, by removing any which the UserContentController no longer knows about.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/UserContentController.mm:
(TEST):
Add a test ensuring that it is possible to remove and re-add a script message handler
with the same name and still dispatch messages to it.

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

5 years agoFunctionExecutable::ecmaName() should not be based on inferredName().
mark.lam@apple.com [Wed, 9 Mar 2016 19:36:21 +0000 (19:36 +0000)]
FunctionExecutable::ecmaName() should not be based on inferredName().
https://bugs.webkit.org/show_bug.cgi?id=155203

Reviewed by Michael Saboff.

Source/JavaScriptCore:

The ES6 rules for how a function name should be inferred closely matches JSC's
implementation with one exception:
    var o = {}
    o.foo = function() {}

JSC's inferredName for o.foo would be "foo".
ES6 specifies that o.foo.name is "".

The fix is to add a distinct FunctionExecutable::ecmaName() which applies the ES6
rules for inferring the initial value of Function.name.

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedFunctionExecutable.h:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createAssignResolve):
(JSC::ASTBuilder::createGetterOrSetterProperty):
(JSC::ASTBuilder::createProperty):
(JSC::ASTBuilder::makeAssignNode):
* parser/Nodes.h:
* runtime/Executable.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::reifyName):
* tests/es6.yaml:

LayoutTests:

* js/script-tests/function-toString-vs-name.js:
- Fixed up object property test section and added new test cases.
* platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt:

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

5 years agoAdd two finger tap on links.
enrica@apple.com [Wed, 9 Mar 2016 19:29:29 +0000 (19:29 +0000)]
Add two finger tap on links.
https://bugs.webkit.org/show_bug.cgi?id=155205
rdar://problem/22937516

Reviewed by Sam Weinig.

Adds two finger tap gesture recognizer. When performed
on a link, it calls the delegate.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _removeDefaultGestureRecognizers]):
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleTwoFingerTapAtPoint):

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

5 years agoAlways call NSURLSession completion handlers
commit-queue@webkit.org [Wed, 9 Mar 2016 19:04:07 +0000 (19:04 +0000)]
Always call NSURLSession completion handlers
https://bugs.webkit.org/show_bug.cgi?id=155137

Patch by Alex Christensen <achristensen@webkit.org> on 2016-03-09
Reviewed by Darin Adler.

There are some edge cases which should not be hit, but if they are they would cause the
network process to hang and network resources to be leaked.  This can be avoided.
There are also a few release asserts that do not need to crash release builds.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTask::NetworkDataTask):
(WebKit::NetworkDataTask::didReceiveChallenge):
(WebKit::NetworkDataTask::didCompleteWithError):
(WebKit::NetworkDataTask::didReceiveResponse):
(WebKit::NetworkDataTask::didReceiveData):
(WebKit::NetworkDataTask::willPerformHTTPRedirection):
(WebKit::NetworkDataTask::scheduleFailure):
(WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):

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

5 years agoAlign HTMLKeygenElement.keytype with the specification
cdumez@apple.com [Wed, 9 Mar 2016 18:45:18 +0000 (18:45 +0000)]
Align HTMLKeygenElement.keytype with the specification
https://bugs.webkit.org/show_bug.cgi?id=155214

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/reflection-forms-expected.txt:

Source/WebCore:

Align HTMLKeygenElement.keytype with the specification:
- https://html.spec.whatwg.org/#dom-keygen-keytype
- https://html.spec.whatwg.org/#attr-keygen-keytype

In particular, the following changes were made:
1. Return "rsa" by default (i.e. when the corresponding content attribute is missing)
2. Only return known values

Test: fast/dom/HTMLKeygenElement/keygen-keytype.html

* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::setKeytype):
(WebCore::HTMLKeygenElement::keytype):
(WebCore::HTMLKeygenElement::appendFormData):
* html/HTMLKeygenElement.h:
* html/HTMLKeygenElement.idl:

LayoutTests:

Add test coverage for HTMLKeygenElement.keytype.

* fast/dom/HTMLKeygenElement/keygen-keytype-expected.txt: Added.
* fast/dom/HTMLKeygenElement/keygen-keytype.html: Added.

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

5 years ago[GStreamer] Fix MediaPlayerPrivate conflicts
philn@webkit.org [Wed, 9 Mar 2016 18:26:38 +0000 (18:26 +0000)]
[GStreamer] Fix MediaPlayerPrivate conflicts
https://bugs.webkit.org/show_bug.cgi?id=155236

Reviewed by Martin Robinson.

In some cases the mediastream player would be used to play
non-mediastream videos or MSE streams. The OWR player should be
used only for mediastreams and the MediaPlayerPrivateGStreamer
player should be used only for normal <video> elements and
MediaSource support.

This patch intends to fix the massive tests timeouts currently
happening on the GTK bots after r197752.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType): Bail out if
the type checked represents a mediastream.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Prevent signal disconnection on possible NULL GObjects.
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::MediaPlayerPrivateGStreamerOwr):
Simplify constructor to the bare minimum.
(WebCore::MediaPlayerPrivateGStreamerOwr::load): Create sinks only
if needed from the load method.
(WebCore::MediaPlayerPrivateGStreamerOwr::getSupportedTypes):
Initialize the type cache to an empty static hashset.
(WebCore::MediaPlayerPrivateGStreamerOwr::supportsType): This
player does support mediastreams and nothing else.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:

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

5 years agoHarden JSC Root element functions from bad values
msaboff@apple.com [Wed, 9 Mar 2016 18:10:59 +0000 (18:10 +0000)]
Harden JSC Root element functions from bad values
https://bugs.webkit.org/show_bug.cgi?id=155234

Reviewed by Saam Barati.

Changed jsCast() to jsDynamicCast() in Root related function to protect against being
called with non-Root arguments.

* jsc.cpp:
(functionCreateElement):
(functionGetElement):
(functionSetElementRoot):

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

5 years ago[JSC] Pick how to OSR Enter to FTL at runtime instead of compile time
benjamin@webkit.org [Wed, 9 Mar 2016 17:51:38 +0000 (17:51 +0000)]
[JSC] Pick how to OSR Enter to FTL at runtime instead of compile time
https://bugs.webkit.org/show_bug.cgi?id=155217

Reviewed by Filip Pizlo.

This patch addresses 2 types of problems with tiering up to FTL
with OSR Entry in a loop:
-When there are nested loops, it is generally valuable to enter
 an outer loop rather than an inner loop.
-When tiering up at a point that cannot OSR Enter, we are at
 the mercy of the outer loop frequency to compile the right
 entry point.

The first case is significant in the test "gaussian-blur".
That test has 4 nested loops. When we have an OSR Entry,
the analysis phases have to be pesimistic where we enter:
we do not really know what constraint can be proven from
the DFG code that was running.

In "gaussian-blur", integer-range analysis removes pretty
much all overflow checks in the inner loops of where we entered.
The more outside we enter, the better code we generate.

Since we spend the most iterations in the inner loop, we naturally
tend to OSR Enter into the 2 most inner loops, making the most
pessimistic assumptions.

To avoid such problems, I changed how we decide where to OSR Enter.
Previously, the last CheckTierUpAndOSREnter to cross the threshold
was where we take the entry point for FTL.

What happens now is that the entry point is not decied when
compiling the CheckTierUp variants. Instead, all the information
we need is gathered during compilation and keept on the JITCode
to be used at runtime.

When we try to tier up and decide to OSR Enter, we use the information
we have to pick a good outer loop for OSR Entry.

Now the problem is outer loop do not CheckTierUpAndOSREnter often,
wasting several miliseconds before entering the newly compiled FTL code.

To solve that, every CheckTierUpAndOSREnter has its own trigger that
bypass the counter. When the FTL Code is compiled, the trigger is set
and we enter through the right CheckTierUpAndOSREnter immediately.

---

This new mechanism also solves a problem of ai-astar.
When we try to tier up in ai-astar, we had nothing to compile until
the outer loop is reached.

To make sure we reached the CheckTierUpAndOSREnter in a reasonable time,
we had CheckTierUpWithNestedTriggerAndOSREnter with a special trigger.

With the new mechanism, we can do much better:
-When we keep hitting CheckTierUpInLoop, we now have all the information
 we need to already start compiling the outer loop.
 Instead of waiting for the outer loop to be reached a few times, we compile
 it as soon as the inner loop is hammering CheckTierUpInLoop.
-With the new triggers, the very next time we hit the outer loop, we OSR Enter.

This allow us to compile what we need sooner and enter sooner.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): Deleted.
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize): Deleted.
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC): Deleted.
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode): Deleted.
* dfg/DFGJITCode.h:
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::JITCompiler):
(JSC::DFG::JITCompiler::compileEntryExecutionFlag):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPlan.h:
(JSC::DFG::Plan::canTierUpAndOSREnter):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate): Deleted.
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute): Deleted.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGTierUpCheckInjectionPhase.cpp:
(JSC::DFG::TierUpCheckInjectionPhase::run):
(JSC::DFG::TierUpCheckInjectionPhase::buildNaturalLoopToLoopHintMap):
(JSC::DFG::TierUpCheckInjectionPhase::findLoopsContainingLoopHintWithoutOSREnter): Deleted.
* dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp:
(JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::ToFTLForOSREntryDeferredCompilationCallback):
(JSC::DFG::Ref<ToFTLForOSREntryDeferredCompilationCallback>ToFTLForOSREntryDeferredCompilationCallback::create):
(JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously):
(JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::compilationDidComplete):
* dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h:

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

5 years agoCleaning up TestExpectations files to remove deleted tests and duplicate entries...
ryanhaddad@apple.com [Wed, 9 Mar 2016 17:44:24 +0000 (17:44 +0000)]
Cleaning up TestExpectations files to remove deleted tests and duplicate entries for ios-simulator.

Unreviewed test gardening.

* TestExpectations:
* platform/ios-simulator/TestExpectations:

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

5 years agoSkipping fast/events/max-tabindex-focus.html on ios-simulator
ryanhaddad@apple.com [Wed, 9 Mar 2016 17:25:23 +0000 (17:25 +0000)]
Skipping fast/events/max-tabindex-focus.html on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=155233

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

5 years agoLocal HTML should be blocked from localStorage access unless "Disable Local File...
bfulgham@apple.com [Wed, 9 Mar 2016 17:06:56 +0000 (17:06 +0000)]
Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked..
https://bugs.webkit.org/show_bug.cgi?id=155185
<rdar://problem/11101440>

Reviewed by Zalan Bujtas.

Source/WebCore:

Tested by storage/domstorage/localstorage/blocked-file-access.html.

* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canAccessStorage): If the origin is a local file, and we have not been granted
universal file access, prevent access to DOM localStorage.

LayoutTests:

* storage/domstorage/localstorage/blocked-file-access-expected.txt: Added.
* storage/domstorage/localstorage/blocked-file-access.html: Added.
* storage/domstorage/localstorage/resources/blocked-example.html: Added.

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

5 years ago[css-grid] Allow to place positioned grid items on the padding
rego@igalia.com [Wed, 9 Mar 2016 14:26:39 +0000 (14:26 +0000)]
[css-grid] Allow to place positioned grid items on the padding
https://bugs.webkit.org/show_bug.cgi?id=155199

Reviewed by Sergio Villar Senin.

Source/WebCore:

According to the following discussion on the CSS WG mailing list,
we should be able to place positioned grid items on the padding directly:
https://lists.w3.org/Archives/Public/www-style/2015Nov/0070.html

This means that a positioned grid item can be placed on the padding itself.
The "auto" value resolves to the padding edges (0th and -0th lines).
So if a positioned item is placed with: grid-column: auto / 1;
it'd be placed on the padding, from line 0th to 1st line.

On top of that, we've to detect properly the first and last explicit
grid lines during the layout of positioned grid items.
We have to consider that the grid can have implicit tracks created
previously by regular grid items.

Tests: fast/css-grid-layout/grid-positioned-items-padding.html
       fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html

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

LayoutTests:

Add new tests and updated results in a current one.

* fast/css-grid-layout/grid-positioned-items-implicit-grid.html:
* fast/css-grid-layout/grid-positioned-items-padding-expected.txt: Added.
* fast/css-grid-layout/grid-positioned-items-padding.html: Added.
* fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt: Added.
* fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html: Added.

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

5 years agoImageDocuments leak their world.
akling@apple.com [Wed, 9 Mar 2016 12:00:32 +0000 (12:00 +0000)]
ImageDocuments leak their world.
<https://webkit.org/b/155167>
<rdar://problem/24987363>

Reviewed by Antti Koivisto.

Source/WebCore:

ImageDocument uses a special code path in ImageLoader in order to manually
control how the image is loaded. It has to do this because the ImageDocument
is really just a synthetic wrapper around a main resource that's an image.

This custom loading code had a bug where it would create a new CachedImage
and neglect to set its CachedResource::m_state flag to Pending (which is
normally set by CachedResource::load(), but we don't call that for these.)

This meant that when ImageDocument called CachedImage::finishLoading() to
trigger the notifyFinished() callback path, the image would look at its
loading state and see that it was Unknown (not Pending), and conclude that
it hadn't loaded yet. So we never got the notifyFinished() signal.

The world leaks here because ImageLoader slaps a ref on its <img> element
while it waits for the loading operation to complete. Once finished, whether
successfully or with an error, it derefs the <img>.

Since we never fired notifyFinished(), we ended up with an extra ref on
these <img> forever, and then the element kept its document alive too.

Test: fast/dom/ImageDocument-world-leak.html

* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):

LayoutTests:

Made a little test that loads an image into an <iframe> 10 times and then
triggers a garbage collection and checks that all the documents got destroyed.

Prior to this change, all 10 ImageDocuments would remain alive at the end.

This got rolled out the first time because it failed on bots. It failed due
to expecting a specific number of documents to be live at the start of the
test, which was not reliable on bots since we appear to have more leaks(!)

Tweaked the test to check the delta in live document count instead.

* fast/dom/ImageDocument-world-leak-expected.txt: Added.
* fast/dom/ImageDocument-world-leak.html: Added.

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

5 years ago[css-grid] Fix auto-track sizing with min-size:auto and specific sizes
svillar@igalia.com [Wed, 9 Mar 2016 11:02:40 +0000 (11:02 +0000)]
[css-grid] Fix auto-track sizing with min-size:auto and specific sizes
https://bugs.webkit.org/show_bug.cgi?id=155165

Reviewed by Darin Adler.

Source/WebCore:

Specs recently changed the way auto tracks are sized. In the
previous versions, when sizing auto minimums, only the
min-width|height of the items spanning through the auto tracks
were used to size them. The new text specifies that for items
with a specified minimum size of auto, the behavior is
equivalent to a min-content minimum.

This means that from now on, auto tracks with min-size:auto
will no longer be smaller than min-content tracks (which was
pretty weird from the user POV).

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::minSizeForChild): use grid items
min-content contributions whenever the specified size is not
auto or when min-size is auto.

LayoutTests:

* fast/css-grid-layout/grid-automatic-minimum-for-auto-columns-expected.txt:
* fast/css-grid-layout/grid-automatic-minimum-for-auto-columns.html:
* fast/css-grid-layout/grid-automatic-minimum-for-auto-rows-expected.txt:
* fast/css-grid-layout/grid-automatic-minimum-for-auto-rows.html:

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

5 years ago[css-grid] Initial support for implicit grid before explicit grid
rego@igalia.com [Wed, 9 Mar 2016 10:15:23 +0000 (10:15 +0000)]
[css-grid] Initial support for implicit grid before explicit grid
https://bugs.webkit.org/show_bug.cgi?id=155014

Reviewed by Darin Adler.

Source/WebCore:

Change GridSpan to store int instead of unsigned. This allows us to
resolve positions before the explicit grid with negative values.

This patch adds a new type of GridSpan called "Untranslated".
This type is only used in populateExplicitGridAndOrderIterator().
Where we store the smallest negative position in both axis.

Then the GridSpans are translated into positive values, using the offset
calculated before. This is done in placeItemsOnGrid() and from that
moment the rest of the code uses "Definite" GridSpans, which returns
only positive positions (unsigned instead of int).
This allows us to don't have to modify the rest of the code, as it keeps
using GridSpans as before.

Let's use an example to explain how it works. Imagine that we've a 2
columns grid and 2 items placed like:
* Item A: grid-column: -5;
* Item B: grid-column: 1;

Initially we'll use "Unstranslated" GridSpans with the following values:
* Item A: GridSpan(-2, -1)
* Item B: GridSpan(0, 1)

Then we'll translate them using the smallest position as offset (-2)
so we've "Definite" GridSpans:
* Item A: GridSpan(0, 1)
* Item B: GridSpan(2, 3)

Test: fast/css-grid-layout/implicit-tracks-before-explicit.html

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTemplateAreasRow):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::gridTrackSize):
(WebCore::RenderGrid::insertItemIntoGrid):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Deleted.
(WebCore::RenderGrid::layoutPositionedObject): Deleted.
* rendering/RenderGrid.h:
* rendering/style/GridCoordinate.h:
(WebCore::GridSpan::untranslatedDefiniteGridSpan):
(WebCore::GridSpan::translatedDefiniteGridSpan):
(WebCore::GridSpan::integerSpan):
(WebCore::GridSpan::untranslatedResolvedInitialPosition):
(WebCore::GridSpan::untranslatedResolvedFinalPosition):
(WebCore::GridSpan::resolvedInitialPosition):
(WebCore::GridSpan::resolvedFinalPosition):
(WebCore::GridSpan::begin):
(WebCore::GridSpan::end):
(WebCore::GridSpan::isTranslatedDefinite):
(WebCore::GridSpan::isIndefinite):
(WebCore::GridSpan::translate):
(WebCore::GridSpan::GridSpan):
(WebCore::GridSpan::operator==): Deleted.
(WebCore::GridSpan::GridSpanIterator::GridSpanIterator): Deleted.
(WebCore::GridSpan::GridSpanIterator::operator unsigned&): Deleted.
* rendering/style/GridResolvedPosition.cpp:
(WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
(WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
(WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
(WebCore::resolveGridPositionAgainstOppositePosition):
(WebCore::resolveGridPositionFromStyle):
(WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
(WebCore::GridResolvedPosition::spanSizeForAutoPlacedItem): Deleted.

LayoutTests:

Updated results in current tests and added specific test for this.

* fast/css-grid-layout/grid-auto-flow-resolution.html:
* fast/css-grid-layout/grid-item-negative-position-resolution.html:
* fast/css-grid-layout/grid-item-spanning-resolution.html:
* fast/css-grid-layout/implicit-tracks-before-explicit-expected.txt: Added.
* fast/css-grid-layout/implicit-tracks-before-explicit.html: Added.

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

5 years ago[iOS] Arabic text on Wikipedia is shown as boxes
mmaxfield@apple.com [Wed, 9 Mar 2016 08:54:56 +0000 (08:54 +0000)]
[iOS] Arabic text on Wikipedia is shown as boxes
https://bugs.webkit.org/show_bug.cgi?id=155129
<rdar://problem/24919902>

Reviewed by Darin Adler.

Source/WebCore:

GeezaPro is the PostScript name, not the family name.

Test: fast/text/arabic-blacklisted.html

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformLookupFallbackFont):

LayoutTests:

This test is iOS-specific.

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* fast/text/arabic-blacklisted-expected.html: Added.
* fast/text/arabic-blacklisted.html: Added.

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

5 years agoUnreviewed, rolling out r197825.
commit-queue@webkit.org [Wed, 9 Mar 2016 07:45:19 +0000 (07:45 +0000)]
Unreviewed, rolling out r197825.
https://bugs.webkit.org/show_bug.cgi?id=155222

It broke the EFL build. It is not dead code. (Requested by
gyuyoung on #webkit).

Reverted changeset:

"Delete dead scrolling code"
https://bugs.webkit.org/show_bug.cgi?id=155210
http://trac.webkit.org/changeset/197825

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

5 years agoRemove failing assertion. There are strings that claim to be atomic but that the
fpizlo@apple.com [Wed, 9 Mar 2016 07:29:43 +0000 (07:29 +0000)]
Remove failing assertion. There are strings that claim to be atomic but that the
compiler thread can totally deal with, like the empty string.

Rubber stamped by Mark Lam.

* wtf/text/StringImpl.h:
(WTF::StringImpl::ref):
(WTF::StringImpl::deref):

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

5 years agoElement with maximum tabIndex cannot be returned by nextElementWithGreaterTabIndex()
cdumez@apple.com [Wed, 9 Mar 2016 06:27:54 +0000 (06:27 +0000)]
Element with maximum tabIndex cannot be returned by nextElementWithGreaterTabIndex()
https://bugs.webkit.org/show_bug.cgi?id=155215

Reviewed by Ryosuke Niwa.

Source/WebCore:

Element with maximum tabIndex cannot be returned by nextElementWithGreaterTabIndex()
due to a bug in r197726. This patch fixes the issue by only comparing
candidate.tabIndex to winningTabIndex if winner is non-null.

Test: fast/events/max-tabindex-focus.html

* page/FocusController.cpp:
(WebCore::nextElementWithGreaterTabIndex):

LayoutTests:

Add test to make sure that an Element with a tabIndex equal to
2147483647 (maximum tabIndex) can be focused.

* fast/events/max-tabindex-focus-expected.txt: Added.
* fast/events/max-tabindex-focus.html: Added.

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

5 years agoFix iOS Simulator EWS.
ap@apple.com [Wed, 9 Mar 2016 05:53:54 +0000 (05:53 +0000)]
Fix iOS Simulator EWS.

Unreviewed build fix.

* Scripts/webkitpy/common/config/ports.py:

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

5 years agoDFG should be able to constant-fold strings
fpizlo@apple.com [Wed, 9 Mar 2016 05:16:47 +0000 (05:16 +0000)]
DFG should be able to constant-fold strings
https://bugs.webkit.org/show_bug.cgi?id=155200

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This adds constant-folding of string1 + string2 and string.length. The actual folding
rule is easy, but there are some gotchas.

The problem is that the DFG cannot allocate new JSString objects until we are on the
main thread. So, DFG IR must have a node for a JSValue string constant that hasn't been
created yet - i.e. it doesn't have any concrete JSValue bits yet.

We have the ability to speak of such things, using LazyJSValue. But that's a class, not
a node type. This patch now adds a node type, LazyJSConstant, which is a Node that holds
a LazyJSValue.

This puts us in a weird situation: AI uses JSValue to represent constants. It would take
a lot of work to change it to use LazyJSValue. So, this implements the constant folding
in StrengthReductionPhase. I created a bug and put a FIXME about moving these rules into
AI.

OTOH, our experience in B3 shows that constant folding in strength reduction is quite
nice. It would totally make sense to have strength reduction have constant folding rules
that mirror the rules in AI, or to factor out the AI constant folding rules, the same
way that B3 factors out those rules into Value methods.

Another issue is how to represent the cumulative result of possibly many foldings. I
initially considered adding LazyJSValue kinds that represented concatenation. Folding
the concatenation to a constant meand that this constant was actually a LazyJSValue that
represented the concatenation of two other things. But this would get super messy if we
wanted to fold an operation that uses the results of another folded operation.

So, the JIT thread folds string operations by creating a WTF::String that contains the
result. The DFG::Graph holds a +1 on the underlying StringImpl, so we can pass the
StringImpl* around without reference counting. The LazyJSValue now has a special kind
that means: we created this StringImpl* on the JIT thread, and once the JIT is done, we
will relinquish ownership of it. LazyJSValue has some magic to emit code for these
to-be-created-JSStrings while also transferring ownership of the StringImpl from the JIT
thread to the main thread and registering the JSString with the GC.

This just implements folding for concatenation and GetArrayLength. It's just a proof of
concept for evil things I want to do later.

This change is a 2.5x speed-up on the string concatenation microbenchmarks I added in
this patch.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGFrozenValue.cpp:
(JSC::DFG::FrozenValue::emptySingleton):
(JSC::DFG::FrozenValue::tryGetString):
(JSC::DFG::FrozenValue::dumpInContext):
* dfg/DFGFrozenValue.h:
(JSC::DFG::FrozenValue::strength):
* dfg/DFGGraph.h:
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::newString):
(JSC::DFG::LazyJSValue::getValue):
(JSC::DFG::equalToStringImpl):
(JSC::DFG::LazyJSValue::tryGetStringImpl):
(JSC::DFG::LazyJSValue::tryGetString):
(JSC::DFG::LazyJSValue::strictEqual):
(JSC::DFG::LazyJSValue::switchLookupValue):
(JSC::DFG::LazyJSValue::emit):
(JSC::DFG::LazyJSValue::dumpInContext):
* dfg/DFGLazyJSValue.h:
(JSC::DFG::LazyJSValue::LazyJSValue):
(JSC::DFG::LazyJSValue::knownStringImpl):
(JSC::DFG::LazyJSValue::kind):
(JSC::DFG::LazyJSValue::tryGetValue):
(JSC::DFG::LazyJSValue::character):
(JSC::DFG::LazyJSValue::stringImpl):
* dfg/DFGMayExit.cpp:
(JSC::DFG::mayExit):
* dfg/DFGNode.cpp:
(JSC::DFG::Node::convertToIdentityOn):
(JSC::DFG::Node::convertToLazyJSConstant):
(JSC::DFG::Node::convertToPutHint):
(JSC::DFG::Node::convertToPutClosureVarHint):
(JSC::DFG::Node::tryGetString):
(JSC::DFG::Node::promotedLocationDescriptor):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToConstant):
(JSC::DFG::Node::convertToConstantStoragePointer):
(JSC::DFG::Node::castConstant):
(JSC::DFG::Node::hasLazyJSValue):
(JSC::DFG::Node::lazyJSValue):
(JSC::DFG::Node::initializationValueForActivation):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileSetRegExpObjectLastIndex):
(JSC::DFG::SpeculativeJIT::compileLazyJSConstant):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileInt52Constant):
(JSC::FTL::DFG::LowerDFGToB3::compileLazyJSConstant):
(JSC::FTL::DFG::LowerDFGToB3::compileDoubleRep):

Source/WTF:

Also disable assertions about reference counting strings on the JIT thread. We will do
that now and it's OK.

* wtf/text/StringImpl.h:
(WTF::StringImpl::ref):
(WTF::StringImpl::deref):

LayoutTests:

* js/regress/script-tests/strcat-const.js: Added.
(foo):
(bar):
* js/regress/script-tests/strcat-length-const.js: Added.
(foo):
(bar):
* js/regress/strcat-const-expected.txt: Added.
* js/regress/strcat-const.html: Added.
* js/regress/strcat-length-const-expected.txt: Added.
* js/regress/strcat-length-const.html: Added.

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

5 years agoWeb Inspector: Timelines keeps switching to overview instead of keeping the selected...
commit-queue@webkit.org [Wed, 9 Mar 2016 05:02:15 +0000 (05:02 +0000)]
Web Inspector: Timelines keeps switching to overview instead of keeping the selected timeline
https://bugs.webkit.org/show_bug.cgi?id=155212
<rdar://problem/25052504>

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

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype.saveStateToCookie):
The sidebar was using out of date information in its tree outline causing it to
switch to the wrong sidebar. Use the up to date information from the recording view.

* UserInterface/Views/TimelineTabContentView.js:
(WebInspector.TimelineTabContentView.prototype._recordingSelected):
Fix typo not getting the right timeline type.

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

5 years agoStop using the UserContentController for injecting the override style sheet from...
weinig@apple.com [Wed, 9 Mar 2016 04:39:49 +0000 (04:39 +0000)]
Stop using the UserContentController for injecting the override style sheet from CaptionUserPreferences
https://bugs.webkit.org/show_bug.cgi?id=155211

Reviewed by Dan Bernstein.

The UserContentController is going to become read only from WebCore's perspective. The CaptionUserPreferences
was relying on being able to set a UserStyleSheet on it, but this was really unnecessary complexity. Simplify
things by storing the style sheet's source directly on the Page and teaching ExtensionStyleSheets about it
explicitly.

* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
If there is a captionUserPreferencesStyleSheet on the page, inject it.

* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride):
Greatly simplify the code. Now, all this does is set the style sheet on each page.

* page/Page.cpp:
(WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
Extract this out from UserContentController.

(WebCore::Page::setUserContentController):
Call the newly extracted invalidateInjectedStyleSheetCacheInAllFrames().

(WebCore::Page::captionUserPreferencesStyleSheet):
(WebCore::Page::setCaptionUserPreferencesStyleSheet):
Add getter/setter. When setting, invalidate the style sheet cache.

* page/Page.h:
Add new members and functions.

* page/UserContentController.cpp:
(WebCore::UserContentController::addUserStyleSheet):
(WebCore::UserContentController::removeUserStyleSheet):
(WebCore::UserContentController::removeUserStyleSheets):
(WebCore::UserContentController::removeAllUserContent):
Switch to calling invalidateInjectedStyleSheetCacheInAllFramesInAllPages().

(WebCore::UserContentController::invalidateInjectedStyleSheetCacheInAllFramesInAllPages):
Rename and implement in terms of Page::invalidateInjectedStyleSheetCacheInAllFrames().

* page/UserContentController.h:
Rename function.

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

5 years agoBooting multiple iOS simulator parallely fails sometimes
aakash_jain@apple.com [Wed, 9 Mar 2016 02:50:22 +0000 (02:50 +0000)]
Booting multiple iOS simulator parallely fails sometimes
https://bugs.webkit.org/show_bug.cgi?id=155208
<rdar://problem/25019651>

Reviewed by Darin Adler.

* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort.setup_test_run): Increase the time delay between subsequent
simulator boot.

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

5 years agoRoll r197632 back in now that the bots have caught up.
weinig@apple.com [Wed, 9 Mar 2016 02:27:18 +0000 (02:27 +0000)]
Roll r197632 back in now that the bots have caught up.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView textInputTraits]):

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

5 years agoAdd iOS debug testers to flakiness dashboard
ap@apple.com [Wed, 9 Mar 2016 02:17:49 +0000 (02:17 +0000)]
Add iOS debug testers to flakiness dashboard
https://bugs.webkit.org/show_bug.cgi?id=155206

Reviewed by Darin Adler.

* TestResultServer/static-dashboards/builders.jsonp:

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

5 years agoWeb Inspector: Memory Timeline should show MemoryPressure events
joepeck@webkit.org [Wed, 9 Mar 2016 02:06:55 +0000 (02:06 +0000)]
Web Inspector: Memory Timeline should show MemoryPressure events
https://bugs.webkit.org/show_bug.cgi?id=155158
<rdar://problem/25026610>

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/protocol/Memory.json:

Source/WebCore:

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseMemory):
When responding to memory pressure, notify page inspectors.

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
Remove unused includes.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didHandleMemoryPressureImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::playbackStarted):
(WebCore::InspectorInstrumentation::playbackPaused):
(WebCore::InspectorInstrumentation::playbackFinished):
(WebCore::InspectorInstrumentation::playbackHitPosition):
(WebCore::InspectorInstrumentation::didHandleMemoryPressure):
* inspector/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::didCreateFrontendAndBackend):
(WebCore::InspectorMemoryAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorMemoryAgent::enable):
(WebCore::InspectorMemoryAgent::disable):
(WebCore::InspectorMemoryAgent::didHandleMemoryPressure):
* inspector/InspectorMemoryAgent.h:
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorMemoryAgent):
(WebCore::InstrumentingAgents::setInspectorMemoryAgent):
Plumbing to notify the right active inspector.

Source/WebInspectorUI:

* UserInterface/Main.html:
New resources.

* UserInterface/Base/Main.js:
(WebInspector.loaded):
* UserInterface/Controllers/MemoryManager.js:
(WebInspector.MemoryManager):
(WebInspector.MemoryManager.prototype.memoryPressure):
* UserInterface/Protocol/MemoryObserver.js:
(WebInspector.MemoryObserver.prototype.memoryPressure):
New manager for Memory domain events.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager):
(WebInspector.TimelineManager.defaultInstruments):
(WebInspector.TimelineManager.prototype._memoryPressure):
* UserInterface/Models/TimelineRecording.js:
(WebInspector.TimelineRecording.prototype.addMemoryPressureEvent):
Add events to the Memory Timeline of the active recording.

* UserInterface/Models/MemoryTimeline.js:
(WebInspector.MemoryTimeline.prototype.get memoryPressureEvents):
(WebInspector.MemoryTimeline.prototype.addMemoryPressureEvent):
(WebInspector.MemoryTimeline.prototype.reset):
(WebInspector.MemoryTimeline):
* UserInterface/Models/Timeline.js:
(WebInspector.Timeline.create):
Create a specific MemoryTimeline to hold records and memory pressure events.

* UserInterface/Models/MemoryPressureEvent.js:
(WebInspector.MemoryPressureEvent):
(WebInspector.MemoryPressureEvent.fromPayload):
(WebInspector.MemoryPressureEvent.prototype.get timestamp):
(WebInspector.MemoryPressureEvent.prototype.get severity):
Model object for a memory pressure event.

* UserInterface/Views/MemoryTimelineOverviewGraph.css:
(.timeline-overview-graph.memory .memory-pressure-event):
* UserInterface/Views/MemoryTimelineOverviewGraph.js:
(WebInspector.MemoryTimelineOverviewGraph):
(WebInspector.MemoryTimelineOverviewGraph.prototype.reset):
(WebInspector.MemoryTimelineOverviewGraph.prototype._visibleMemoryPressureEvents):
(WebInspector.MemoryTimelineOverviewGraph.prototype._memoryTimelineMemoryPressureEventAdded):
Include markers for memory pressure events.

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

5 years agoWeb Inspector: Add Heap domain start/stop tracking commands
joepeck@webkit.org [Wed, 9 Mar 2016 02:06:45 +0000 (02:06 +0000)]
Web Inspector: Add Heap domain start/stop tracking commands
https://bugs.webkit.org/show_bug.cgi?id=155190

Reviewed by Brian Burg.

Source/JavaScriptCore:

* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::willDestroyFrontendAndBackend):
(Inspector::InspectorHeapAgent::startTracking):
(Inspector::InspectorHeapAgent::stopTracking):
* inspector/agents/InspectorHeapAgent.h:
* inspector/protocol/Heap.json:

Source/WebInspectorUI:

* UserInterface/Protocol/HeapObserver.js:
(WebInspector.HeapObserver.prototype.trackingStart):
(WebInspector.HeapObserver.prototype.trackingComplete):
To be used when we have a HeapAllocationsInstrument and timeline.

LayoutTests:

* inspector/heap/tracking-expected.txt: Added.
* inspector/heap/tracking.html: Added.

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

5 years agoDelete dead scrolling code
mmaxfield@apple.com [Wed, 9 Mar 2016 02:05:13 +0000 (02:05 +0000)]
Delete dead scrolling code
https://bugs.webkit.org/show_bug.cgi?id=155210

Reviewed by Simon Fraser.

No new tests because there is no behavior change.

* page/FrameView.cpp:
(WebCore::FrameView::layerForScrolling): Deleted.
* page/FrameView.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::scrollLayerForScrollableArea): Deleted.
* page/scrolling/ScrollingCoordinator.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::horizontalScrollbar):
(WebCore::ScrollableArea::verticalScrollbar):
(WebCore::ScrollableArea::tiledBacking):
(WebCore::ScrollableArea::layerForHorizontalScrollbar):
(WebCore::ScrollableArea::layerForVerticalScrollbar):
(WebCore::ScrollableArea::layerForScrollCorner):
(WebCore::ScrollableArea::layerForOverhangAreas):
(WebCore::ScrollableArea::layerForScrolling): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects): Deleted.
* rendering/RenderLayer.h:

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

5 years agoWeb Inspector: Make debugging Test.html easier
commit-queue@webkit.org [Wed, 9 Mar 2016 01:44:47 +0000 (01:44 +0000)]
Web Inspector: Make debugging Test.html easier
https://bugs.webkit.org/show_bug.cgi?id=155207

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

* UserInterface/Base/InspectorFrontendHostStub.js: Renamed from Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendHostStub.js.
(window.InspectorFrontendHost.WebInspector.InspectorFrontendHostStub.prototype.unbufferedLog):
Add new stub for test function.

* UserInterface/Main.html:
* UserInterface/Test.html:
Move the stub to the Base directory.

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

5 years ago[EFL] Enable the SVG -> OTF Font Converter
mmaxfield@apple.com [Wed, 9 Mar 2016 01:40:33 +0000 (01:40 +0000)]
[EFL] Enable the SVG -> OTF Font Converter
https://bugs.webkit.org/show_bug.cgi?id=155192

Reviewed by Gyuyoung Kim.

* Source/cmake/OptionsEfl.cmake:

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

5 years agoWeb Inspector: Add a way to create a Heap Snapshot
commit-queue@webkit.org [Wed, 9 Mar 2016 01:38:41 +0000 (01:38 +0000)]
Web Inspector: Add a way to create a Heap Snapshot
https://bugs.webkit.org/show_bug.cgi?id=155188

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

Source/JavaScriptCore:

* inspector/agents/InspectorHeapAgent.h:
* inspector/protocol/Heap.json:
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::snapshot):
Take a heap snapshot and return the JSON string result.

* inspector/protocol/Debugger.json:
Remove unused optional inferredName. Our displayName would be inferred.

Source/WebInspectorUI:

* UserInterface/Main.html:
* UserInterface/Test.html:
Add new Model resources.

* UserInterface/Models/HeapSnapshot.js: Added.
(WebInspector.HeapSnapshotClassCategory):
(WebInspector.HeapSnapshot):
(WebInspector.HeapSnapshot.fromPayload):
(WebInspector.HeapSnapshot.prototype.get rootNode):
(WebInspector.HeapSnapshot.prototype.get nodes):
(WebInspector.HeapSnapshot.prototype.get identifier):
(WebInspector.HeapSnapshot.prototype.get instances):
(WebInspector.HeapSnapshot.prototype.get categories):
(WebInspector.HeapSnapshot.prototype.get totalSize):
(WebInspector.HeapSnapshot.prototype.get totalObjectCount):
(WebInspector.HeapSnapshot.prototype.instancesWithClassName):
(WebInspector.HeapSnapshot.prototype.nodeWithObjectIdentifier):
* UserInterface/Models/HeapSnapshotEdge.js: Added.
(WebInspector.HeapSnapshotEdge):
(WebInspector.HeapSnapshotEdge.prototype.stringify):
* UserInterface/Models/HeapSnapshotNode.js: Added.
(WebInspector.HeapSnapshotNode):
Data structures for a HeapSnapshot.

LayoutTests:

* inspector/heap/snapshot-expected.txt: Added.
* inspector/heap/snapshot.html: Added.

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

5 years agoFix ios bot build.
oliver@apple.com [Wed, 9 Mar 2016 01:05:53 +0000 (01:05 +0000)]
Fix ios bot build.

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

5 years agoMove two indexeddb test skips out of wk2/TestExpectations and in to TestExpectations.
ryanhaddad@apple.com [Wed, 9 Mar 2016 01:00:34 +0000 (01:00 +0000)]
Move two indexeddb test skips out of wk2/TestExpectations and in to TestExpectations.

Unreviewed test gardening.

* TestExpectations:
* platform/wk2/TestExpectations:

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

5 years agoFix AppKitCompatibilityDeclarations build.
andersca@apple.com [Wed, 9 Mar 2016 00:40:03 +0000 (00:40 +0000)]
Fix AppKitCompatibilityDeclarations build.

* wtf/mac/AppKitCompatibilityDeclarations.h:
Remove duplicate declarations, conditionally define NSTextAlignment and
add a NSWindowStyleMask typedef.

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

5 years agoBuild fix
oliver@apple.com [Wed, 9 Mar 2016 00:25:48 +0000 (00:25 +0000)]
Build fix

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

5 years agoImplement Function.name support for getters/setters and inferring name of function...
mark.lam@apple.com [Wed, 9 Mar 2016 00:21:26 +0000 (00:21 +0000)]
Implement Function.name support for getters/setters and inferring name of function properties.
https://bugs.webkit.org/show_bug.cgi?id=154865

Rubber-stamped by Joseph Pecoraro.

Follow up to the fix for this bug: adding a few small clean-ups for issues Joe
pointed out in the bug.

* runtime/JSBoundSlotBaseFunction.cpp:
(JSC::JSBoundSlotBaseFunction::create):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitiveByIndex):

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

5 years agoStart moving to separated writable and executable mappings in the JIT
oliver@apple.com [Wed, 9 Mar 2016 00:08:53 +0000 (00:08 +0000)]
Start moving to separated writable and executable mappings in the JIT
https://bugs.webkit.org/show_bug.cgi?id=155178

Reviewed by Fil Pizlo.

Source/JavaScriptCore:

Start moving to a separate writable and executable heap for the various
JITs.

As part of our work to harden the JIT against various attacks, we're
moving away from our current RWX heap and on to using separate RW and X
mappings. This means that simply leaking the location of the executable
mapping is not sufficient to compromise JSC, so we can continue to
use direct executable pointers in our GC objects (which we need for
performance), but keep the writable pointer in only a single location
so that we are less likely to leak the address. To further obscure the
address of the writable region we place it in an execute only region
of memory so that it is not possible to read the location from
anywhere. That means an attacker must have at least partial control
of PC (to call jitMemCopy) before they can start to attack the JIT.

This work is initially ARM64 only, as we use as the jitMemCopy is
currently specific to that platform's calling conventions and layout.
We're just landing it in the current form so that we can at least
ensure it doesn't regress.

* Configurations/FeatureDefines.xcconfig:
* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::ldp):
(JSC::ARM64Assembler::ldnp):
(JSC::ARM64Assembler::fillNops):
(JSC::ARM64Assembler::stp):
(JSC::ARM64Assembler::stnp):
(JSC::ARM64Assembler::replaceWithJump):
(JSC::ARM64Assembler::replaceWithLoad):
(JSC::ARM64Assembler::replaceWithAddressComputation):
(JSC::ARM64Assembler::setPointer):
(JSC::ARM64Assembler::repatchInt32):
(JSC::ARM64Assembler::repatchCompact):
(JSC::ARM64Assembler::linkJumpOrCall):
(JSC::ARM64Assembler::linkCompareAndBranch):
(JSC::ARM64Assembler::linkConditionalBranch):
(JSC::ARM64Assembler::linkTestAndBranch):
(JSC::ARM64Assembler::loadStoreRegisterPairOffset):
(JSC::ARM64Assembler::loadStoreRegisterPairNonTemporal):
* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::copyCompactAndLinkCode):
(JSC::LinkBuffer::allocate):
* assembler/LinkBuffer.h:
(JSC::LinkBuffer::LinkBuffer):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::sub64):
(JSC::MacroAssemblerARM64::load64):
(JSC::MacroAssemblerARM64::loadPair64):
(JSC::MacroAssemblerARM64::loadPair64WithNonTemporalAccess):
(JSC::MacroAssemblerARM64::load8):
(JSC::MacroAssemblerARM64::store64):
(JSC::MacroAssemblerARM64::storePair64):
(JSC::MacroAssemblerARM64::storePair64WithNonTemporalAccess):
(JSC::MacroAssemblerARM64::store8):
(JSC::MacroAssemblerARM64::branchAdd64):
(JSC::MacroAssemblerARM64::branchSub64):
* jit/ExecutableAllocator.h:
(JSC::performJITMemcpy):
* jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
(JSC::FixedVMPoolExecutableAllocator::initializeSeparatedWXHeaps):
(JSC::FixedVMPoolExecutableAllocator::jitWriteThunkGenerator):
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:

Source/WebCore:

Update feature defines.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

Update feature defines.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Update feature defines.

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

Update feature defines.

* wtf/FeatureDefines.h:
* wtf/Platform.h: ARM64 for now.

Tools:

Making run-jsc-benchmarks slightly happier on my machine.

* Scripts/run-jsc-benchmarks:

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