WebKit-https.git
4 years ago[CMake] Remove meaningless conditional statements in CMakeLists.txt
jh718.park@samsung.com [Thu, 18 Feb 2016 08:28:44 +0000 (08:28 +0000)]
[CMake] Remove meaningless conditional statements in CMakeLists.txt
https://bugs.webkit.org/show_bug.cgi?id=153778

Reviewed by Csaba Osztrogon√°c.

* CMakeLists.txt:
Use CMAKE_FOO_OUTPUT_DIRECTORY located in CMakeLists.txt as default value.
And remove conditional statements which has enclosed these one
because they don't have meaning anymore.

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

4 years ago[Font Loading] Implement FontFaceSet
mmaxfield@apple.com [Thu, 18 Feb 2016 07:25:56 +0000 (07:25 +0000)]
[Font Loading] Implement FontFaceSet
https://bugs.webkit.org/show_bug.cgi?id=153348

Reviewed by Simon Fraser.

Source/WebCore:

The CSS Font Loading spec includes a FontFaceSet object which represents
a collection of FontFaces. This patch implements such an object, and
backs it with a vector of FontFaces. Similarly to the FontFace object,
FontFaceSet is separated into a FontFaceSet frontend object and a
CSSFontFaceSet backend object, which actually owns the FontFace objects.
All the interaction with Promises is performed in the frontend object.

This patch does not implement the EventTarget part of the FontFaceSet
API, so the only way to know when a font is finished loading is by using
the associated Promise objects.

The CSS Font Loading spec describes how the Document should vend an
instance of FontFaceSet which represents the font faces currently
associated with the Document. However, that functionality is
forthcoming. Currently, the only way to get a FontFaceSet is to create
one yourself (using the constructor). Therefore, this patch does not
implement the spec's notion of a "CSS-connected font face."

Test: fast/text/font-face-set-javascript.html

* CMakeLists.txt: Add new files.
* DerivedSources.make: Ditto.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/JSFontFaceSetCustom.cpp: Added.
(WebCore::JSFontFaceSet::ready): Use the Promise member.
(WebCore::JSFontFaceSet::entries): Use existing iterator code.
(WebCore::JSFontFaceSet::keys):
(WebCore::JSFontFaceSet::values):
* css/CSSAllInOne.cpp: Add new files.
* css/CSSFontFace.cpp: We now have a collection of clients (instead of
just one). Also, we need to keep a pointer to our FontFace wrapper.
(WebCore::CSSFontFace::CSSFontFace):
(WebCore::CSSFontFace::addClient):
(WebCore::CSSFontFace::removeClient):
(WebCore::CSSFontFace::setStatus): Rename the delegate callback to be
more clear.
(WebCore::CSSFontFace::fontLoaded):
(WebCore::CSSFontFace::addedToSegmentedFontFace): Deleted.
(WebCore::CSSFontFace::removedFromSegmentedFontFace): Deleted.
* css/CSSFontFace.h: Same as above.
(WebCore::CSSFontFace::create):
(WebCore::CSSFontFace::Client::~Client):
(WebCore::CSSFontFace::Client::kick):
(WebCore::CSSFontFace::Client::stateChanged):
(WebCore::CSSFontFace::wrapper):
(WebCore::CSSFontFaceClient::~CSSFontFaceClient): Deleted.
* css/CSSFontFaceSet.cpp: Added. Initial imlementation.
(WebCore::CSSFontFaceSet::CSSFontFaceSet):
(WebCore::CSSFontFaceSet::~CSSFontFaceSet):
(WebCore::CSSFontFaceSet::incrementActiveCount):
(WebCore::CSSFontFaceSet::decrementActiveCount):
(WebCore::CSSFontFaceSet::has):
(WebCore::CSSFontFaceSet::add):
(WebCore::CSSFontFaceSet::remove):
(WebCore::extractFamilies):
(WebCore::familiesIntersect): Because this is an initial imlementation,
this function is not optimized. A subsequent patch (which implements
Document.fonts) will optimize this.
(WebCore::CSSFontFaceSet::matchingFaces):
(WebCore::CSSFontFaceSet::load):
(WebCore::CSSFontFaceSet::check):
(WebCore::CSSFontFaceSet::stateChanged):
* css/CSSFontFaceSet.h: Added.
(WebCore::CSSFontFaceSetClient::~CSSFontFaceSetClient):
(WebCore::CSSFontFaceSet::size):
(WebCore::CSSFontFaceSet::operator[]):
(WebCore::CSSFontFaceSet::status):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::familyNameFromPrimitive):
(WebCore::CSSFontSelector::registerLocalFontFacesForFamily):
(WebCore::CSSFontSelector::addFontFaceRule):
(WebCore::familyNameFromPrimitive): Deleted.
(WebCore::CSSFontSelector::kick): Deleted.
* css/CSSFontSelector.h:
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::~CSSSegmentedFontFace):
(WebCore::CSSSegmentedFontFace::appendFontFace):
(WebCore::CSSSegmentedFontFace::kick):
(WebCore::CSSSegmentedFontFace::fontLoaded): Deleted.
* css/CSSSegmentedFontFace.h:
* css/FontFace.cpp:
(WebCore::FontFace::FontFace):
(WebCore::FontFace::~FontFace):
(WebCore::FontFace::stateChanged): Renamed to make its purpose clearer.
(WebCore::FontFace::kick): Deleted.
* css/FontFace.h:
* css/FontFaceSet.cpp: Added.
(WebCore::createPromise):
(WebCore::FontFaceSet::FontFaceSet):
(WebCore::FontFaceSet::~FontFaceSet):
(WebCore::FontFaceSet::Iterator::Iterator):
(WebCore::FontFaceSet::Iterator::next):
(WebCore::FontFaceSet::PendingPromise::PendingPromise):
(WebCore::FontFaceSet::PendingPromise::~PendingPromise):
(WebCore::FontFaceSet::has):
(WebCore::FontFaceSet::size):
(WebCore::FontFaceSet::add):
(WebCore::FontFaceSet::remove):
(WebCore::FontFaceSet::clear):
(WebCore::FontFaceSet::load): Most of the complexity of loading is
due to the promises involved. Rather than use the Javascript function
Promise.all(), this patch builds a data structure to represent the
promises which need to be resolved. When fonts finish loading, we look
at the data structure to determine which promises to resolve.
(WebCore::FontFaceSet::check):
(WebCore::FontFaceSet::status):
(WebCore::FontFaceSet::canSuspendForDocumentSuspension):
(WebCore::FontFaceSet::startedLoading):
(WebCore::FontFaceSet::completedLoading):
(WebCore::FontFaceSet::fulfillPromise): Keep the promise alive.
(WebCore::FontFaceSet::faceFinished):
* css/FontFaceSet.h: Added.
(WebCore::FontFaceSet::create):
(WebCore::FontFaceSet::load):
(WebCore::FontFaceSet::check):
(WebCore::FontFaceSet::createIterator):
(WebCore::FontFaceSet::PendingPromise::create):
* css/FontFaceSet.idl: Added.
* dom/EventNames.h:
* dom/EventTargetFactory.in:

LayoutTests:

* fast/text/font-face-set-javascript-expected.txt: Added.
* fast/text/font-face-set-javascript.html: Added.

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

4 years agoWeb Inspector: In the styles sidebar, Option-clicking on --css-variable should jump...
commit-queue@webkit.org [Thu, 18 Feb 2016 06:37:45 +0000 (06:37 +0000)]
Web Inspector: In the styles sidebar, Option-clicking on --css-variable should jump to its definition
https://bugs.webkit.org/show_bug.cgi?id=154082
<rdar://problem/24593361>

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-02-17
Reviewed by Timothy Hatcher.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked.showRangeInSourceCode):
(WebInspector.CSSStyleDeclarationTextEditor.prototype.tokenTrackingControllerHighlightedRangeWasClicked):
Now tests to see if the highlighted token was a CSS variable and if
so, attempts to show the declaration of the CSS variable instead of
the location where it is used.

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

4 years agoCallers of JSString::value() should check for exceptions thereafter.
mark.lam@apple.com [Thu, 18 Feb 2016 06:28:26 +0000 (06:28 +0000)]
Callers of JSString::value() should check for exceptions thereafter.
https://bugs.webkit.org/show_bug.cgi?id=154346

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

JSString::value() can throw an exception if the JS string is a rope and value()
needs to resolve the rope but encounters an OutOfMemory error.  If value() is not
able to resolve the rope, it will return a null string (in addition to throwing
the exception).  If a caller does not check for exceptions after calling
JSString::value(), they may eventually use the returned null string and crash the
VM.

The fix is to add all the necessary exception checks, and do the appropriate
handling if needed.

* jsc.cpp:
(functionRun):
(functionLoad):
(functionReadFile):
(functionCheckSyntax):
(functionLoadWebAssembly):
(functionLoadModule):
(functionCheckModuleSyntax):
* runtime/DateConstructor.cpp:
(JSC::dateParse):
(JSC::dateNow):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval):
* tools/JSDollarVMPrototype.cpp:
(JSC::functionPrint):

Source/WebCore:

No new tests.  The crash that results from this issue is dependent on a race
condition where an OutOfMemory error occurs precisely at the point where the
JSString::value() function is called on a rope JSString.

* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::putDelegate):
- Added a comment at the site of the exception check to clarify the meaning of
  the return value.

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

4 years ago[Cocoa] Always check the return value of dlopen() and dlsym() in Release builds
ddkilzer@apple.com [Thu, 18 Feb 2016 06:13:15 +0000 (06:13 +0000)]
[Cocoa] Always check the return value of dlopen() and dlsym() in Release builds
<http://webkit.org/b/154364>

Reviewed by Alexey Proskuryakov.

* platform/mac/SoftLinking.h:
(SOFT_LINK_LIBRARY): Change ASSERT_WITH_MESSAGE() to
RELEASE_ASSERT_WITH_MESSAGE().
(SOFT_LINK_FRAMEWORK): Ditto.
(SOFT_LINK_PRIVATE_FRAMEWORK): Ditto.
(SOFT_LINK_STAGED_FRAMEWORK): Ditto.
(SOFT_LINK_FRAMEWORK_IN_UMBRELLA): Ditto.
(SOFT_LINK): Ditto.
(SOFT_LINK_POINTER): Ditto.
(SOFT_LINK_CONSTANT): Ditto.
(SOFT_LINK_FRAMEWORK_FOR_SOURCE): Add
RELEASE_ASSERT_WITH_MESSAGE() when soft-link is not
optional.

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

4 years agoREGRESSION (r196620): Web Inspector: DataGrid headers and resizers are misaligned...
nvasilyev@apple.com [Thu, 18 Feb 2016 06:03:30 +0000 (06:03 +0000)]
REGRESSION (r196620): Web Inspector: DataGrid headers and resizers are misaligned when the scrollbar is visible
https://bugs.webkit.org/show_bug.cgi?id=154280
<rdar://problem/24670567>

Reviewed by Timothy Hatcher.

Revert back to "overflow-y: overlay".

* UserInterface/Views/DataGrid.css:
(.data-grid .data-container):
* UserInterface/Views/DatabaseContentView.css:
(.storage-view.query):

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

4 years agoRegression(r196648): http://w3c-test.org/html/dom/interfaces.html redirects at the...
cdumez@apple.com [Thu, 18 Feb 2016 05:44:10 +0000 (05:44 +0000)]
Regression(r196648): w3c-test.org/html/dom/interfaces.html redirects at the end of the test
https://bugs.webkit.org/show_bug.cgi?id=154357

Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

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

Source/WebCore:

Make location.assign() / location.replace()'s parameter mandatory,
as per the specification:
https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface

Previously, calling location.assign() / location.replace() without
parameter would be identical to calling location.assign("undefined") /
location.replace("undefined"), which is not useful.

After r196648, http://w3c-test.org/html/dom/interfaces.html was able to
test location.assign() / location.replace() further because they are now
on the instance (where they should be) instead of the prototype. One of
these tests calls these functions without parameter, expecting them to
throw an exception. However, in WebKit, it would not throw and it would
redirect us to http://w3c-test.org/html/dom/undefined.

Firefox and Chrome both follow the specification already and throw in
this case.

No new tests, already covered by existing test.

* page/Location.idl:
Make location.assign() / location.replace()'s parameter mandatory,
as per the specification.

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

4 years agoREGRESSION (r196620): Web Inspector: When the scrollbars are always visible, the...
nvasilyev@apple.com [Thu, 18 Feb 2016 05:27:31 +0000 (05:27 +0000)]
REGRESSION (r196620): Web Inspector: When the scrollbars are always visible, the console prompt is 1px taller
https://bugs.webkit.org/show_bug.cgi?id=154328
<rdar://problem/24692996>

Introduce a CSS variable to ensure that the quick console is the
same height as the bottom right section of the styles sidebar.

Reviewed by Timothy Hatcher.

* UserInterface/Views/CSSStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style > .content ~ .options-container):
(.sidebar > .panel.details.css-style > .content ~ .class-list-container):
* UserInterface/Views/QuickConsole.css:
(.quick-console):
* UserInterface/Views/Variables.css:
(:root):

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

4 years agoUnreviewed, rolling out r196738.
commit-queue@webkit.org [Thu, 18 Feb 2016 05:16:54 +0000 (05:16 +0000)]
Unreviewed, rolling out r196738.
https://bugs.webkit.org/show_bug.cgi?id=154380

broke css3/calc/transforms-translate.html (Requested by
alexchristensen on #webkit).

Reverted changeset:

"WebKitCSSMatrix transformList with calculated relative length
crashes Safari."
https://bugs.webkit.org/show_bug.cgi?id=153333
http://trac.webkit.org/changeset/196738

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

4 years agoWeb Inspector: Add Context menu separators to Styles sidebar
commit-queue@webkit.org [Thu, 18 Feb 2016 03:57:23 +0000 (03:57 +0000)]
Web Inspector: Add Context menu separators to Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=154360

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-02-17
Reviewed by Joseph Pecoraro.

In the Styles sidebar, there are three main sections for the context menu:
- Copy and Duplicate/Show-source
- Add pseudo-class rules
- Add/Select pseudo-element rules
These three sections were all put together in the same context menu, which
was very crowded as a result. Separators have been added to make it so that
these three sections are now separated and clearly show their different uses.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste):

* UserInterface/Views/VisualStyleSelectorTreeItem.js:
(WebInspector.VisualStyleSelectorTreeItem.prototype._handleContextMenuEvent):

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

4 years agoWebKitCSSMatrix transformList with calculated relative length crashes Safari.
dino@apple.com [Thu, 18 Feb 2016 02:13:37 +0000 (02:13 +0000)]
WebKitCSSMatrix transformList with calculated relative length crashes Safari.
https://bugs.webkit.org/show_bug.cgi?id=153333
<rdar://problem/17198383>

Reviewed by Simon Fraser.

Source/WebCore:

WebKitCSSMatrix objects should fail to construct when not
using absolute lengths.

Updated existing tests:
- transforms/cssmatrix-2d-interface.xhtml
- transforms/cssmatrix-3d-interface.xhtml

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTransform): Tell transformsForValue
that we don't require absolute lengths.
* css/TransformFunctions.cpp:
(WebCore::convertToFloatLength): Add an optional parameter that will
cause the conversion to fail if the primitive value has a non-absolute
length.
(WebCore::transformsForValue): Pass the parameter for requiring an
absolute length on to convertToFloatLength when necessary.
* css/TransformFunctions.h:
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue): In this case we do
require all transform strings to have absolute lengths, not ones
that depend on the font size or are calculated.

LayoutTests:

Update existing tests to exercise the non-absolute lengths for translation
and perspective functions.

* transforms/cssmatrix-2d-interface-expected.txt:
* transforms/cssmatrix-2d-interface.xhtml:
* transforms/cssmatrix-3d-interface-expected.txt:
* transforms/cssmatrix-3d-interface.xhtml:

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

4 years agoUnreviewed, rolling out r196712.
ryanhaddad@apple.com [Thu, 18 Feb 2016 02:04:40 +0000 (02:04 +0000)]
Unreviewed, rolling out r196712.
https://bugs.webkit.org/show_bug.cgi?id=154371

This change caused 5 API test failures on ios-simulator
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"[iOS] Purge GraphicsServices font cache on memory warning."
https://bugs.webkit.org/show_bug.cgi?id=154343
http://trac.webkit.org/changeset/196712

Patch by Commit Queue <commit-queue@webkit.org> on 2016-02-17

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

4 years ago[JSC] ARM64: Support the immediate format used for bit operations in Air
commit-queue@webkit.org [Thu, 18 Feb 2016 01:38:40 +0000 (01:38 +0000)]
[JSC] ARM64: Support the immediate format used for bit operations in Air
https://bugs.webkit.org/show_bug.cgi?id=154327

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-02-17
Reviewed by Filip Pizlo.

ARM64 supports a pretty rich form of immediates for bit operation.
There are two formats used to encode repeating patterns and common
input in a dense form.

In this patch, I add 2 new type of Arg: BitImm32 and BitImm64.
Those represents the valid immediate forms for bit operation.
On x86, any 32bits value is valid. On ARM64, all the encoding
form are tried and the immediate is used when possible.

The arg type Imm64 is renamed to BigImm to better represent what
it is: an immediate that does not fit into Imm.

* assembler/ARM64Assembler.h:
(JSC::LogicalImmediate::create32): Deleted.
(JSC::LogicalImmediate::create64): Deleted.
(JSC::LogicalImmediate::value): Deleted.
(JSC::LogicalImmediate::isValid): Deleted.
(JSC::LogicalImmediate::is64bit): Deleted.
(JSC::LogicalImmediate::LogicalImmediate): Deleted.
(JSC::LogicalImmediate::mask): Deleted.
(JSC::LogicalImmediate::partialHSB): Deleted.
(JSC::LogicalImmediate::highestSetBit): Deleted.
(JSC::LogicalImmediate::findBitRange): Deleted.
(JSC::LogicalImmediate::encodeLogicalImmediate): Deleted.
* assembler/AssemblerCommon.h:
(JSC::ARM64LogicalImmediate::create32):
(JSC::ARM64LogicalImmediate::create64):
(JSC::ARM64LogicalImmediate::value):
(JSC::ARM64LogicalImmediate::isValid):
(JSC::ARM64LogicalImmediate::is64bit):
(JSC::ARM64LogicalImmediate::ARM64LogicalImmediate):
(JSC::ARM64LogicalImmediate::mask):
(JSC::ARM64LogicalImmediate::partialHSB):
(JSC::ARM64LogicalImmediate::highestSetBit):
(JSC::ARM64LogicalImmediate::findBitRange):
(JSC::ARM64LogicalImmediate::encodeLogicalImmediate):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::and64):
(JSC::MacroAssemblerARM64::or64):
(JSC::MacroAssemblerARM64::xor64):
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::bitImm):
(JSC::B3::Air::LowerToAir::bitImm64):
(JSC::B3::Air::LowerToAir::appendBinOp):
* b3/air/AirArg.cpp:
(JSC::B3::Air::Arg::dump):
(WTF::printInternal):
* b3/air/AirArg.h:
(JSC::B3::Air::Arg::bitImm):
(JSC::B3::Air::Arg::bitImm64):
(JSC::B3::Air::Arg::isBitImm):
(JSC::B3::Air::Arg::isBitImm64):
(JSC::B3::Air::Arg::isSomeImm):
(JSC::B3::Air::Arg::value):
(JSC::B3::Air::Arg::isGP):
(JSC::B3::Air::Arg::isFP):
(JSC::B3::Air::Arg::hasType):
(JSC::B3::Air::Arg::isValidBitImmForm):
(JSC::B3::Air::Arg::isValidBitImm64Form):
(JSC::B3::Air::Arg::isValidForm):
(JSC::B3::Air::Arg::asTrustedImm32):
(JSC::B3::Air::Arg::asTrustedImm64):
* b3/air/AirOpcode.opcodes:
* b3/air/opcode_generator.rb:

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

4 years agoModern IDB: Rename some "UniqueIDBDatabase" classes that conflict with new classes...
beidson@apple.com [Thu, 18 Feb 2016 01:25:21 +0000 (01:25 +0000)]
Modern IDB: Rename some "UniqueIDBDatabase" classes that conflict with new classes in WebCore.
https://bugs.webkit.org/show_bug.cgi?id=154363.

Reviewed by Alex Christensen.

Adding "Legacy" to the front of the name fixes problems for now.

And all of this gunk will go away after Modern IDB is done, anyways.

* CMakeLists.txt:
* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::getOrCreateLegacyUniqueIDBDatabase):
(WebKit::DatabaseProcess::removeLegacyUniqueIDBDatabase):
(WebKit::DatabaseProcess::getOrCreateUniqueIDBDatabase): Deleted.
(WebKit::DatabaseProcess::removeUniqueIDBDatabase): Deleted.
* DatabaseProcess/DatabaseProcess.h:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::establishConnection):
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
* DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.cpp: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp.
(WebKit::LegacyUniqueIDBDatabase::calculateAbsoluteDatabaseFilename):
(WebKit::LegacyUniqueIDBDatabase::LegacyUniqueIDBDatabase):
(WebKit::LegacyUniqueIDBDatabase::~LegacyUniqueIDBDatabase):
(WebKit::LegacyUniqueIDBDatabase::filenameForDatabaseName):
(WebKit::LegacyUniqueIDBDatabase::databaseFilenameIdentifier):
(WebKit::LegacyUniqueIDBDatabase::canShareDatabases):
(WebKit::LegacyUniqueIDBDatabase::registerConnection):
(WebKit::LegacyUniqueIDBDatabase::unregisterConnection):
(WebKit::LegacyUniqueIDBDatabase::shutdown):
(WebKit::LegacyUniqueIDBDatabase::shutdownBackingStore):
(WebKit::LegacyUniqueIDBDatabase::didShutdownBackingStore):
(WebKit::LegacyUniqueIDBDatabase::deleteDatabase):
(WebKit::LegacyUniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata):
(WebKit::LegacyUniqueIDBDatabase::openBackingStoreAndReadMetadata):
(WebKit::LegacyUniqueIDBDatabase::didOpenBackingStoreAndReadMetadata):
(WebKit::LegacyUniqueIDBDatabase::openTransaction):
(WebKit::LegacyUniqueIDBDatabase::beginTransaction):
(WebKit::LegacyUniqueIDBDatabase::commitTransaction):
(WebKit::LegacyUniqueIDBDatabase::resetTransaction):
(WebKit::LegacyUniqueIDBDatabase::rollbackTransaction):
(WebKit::LegacyUniqueIDBDatabase::postTransactionOperation):
(WebKit::LegacyUniqueIDBDatabase::didCompleteTransactionOperation):
(WebKit::LegacyUniqueIDBDatabase::changeDatabaseVersion):
(WebKit::LegacyUniqueIDBDatabase::didChangeDatabaseVersion):
(WebKit::LegacyUniqueIDBDatabase::didCreateObjectStore):
(WebKit::LegacyUniqueIDBDatabase::didDeleteObjectStore):
(WebKit::LegacyUniqueIDBDatabase::didClearObjectStore):
(WebKit::LegacyUniqueIDBDatabase::didCreateIndex):
(WebKit::LegacyUniqueIDBDatabase::didDeleteIndex):
(WebKit::LegacyUniqueIDBDatabase::didCompleteBoolRequest):
(WebKit::LegacyUniqueIDBDatabase::createObjectStore):
(WebKit::LegacyUniqueIDBDatabase::deleteObjectStore):
(WebKit::LegacyUniqueIDBDatabase::clearObjectStore):
(WebKit::LegacyUniqueIDBDatabase::createIndex):
(WebKit::LegacyUniqueIDBDatabase::deleteIndex):
(WebKit::LegacyUniqueIDBDatabase::putRecord):
(WebKit::LegacyUniqueIDBDatabase::getRecord):
(WebKit::LegacyUniqueIDBDatabase::openCursor):
(WebKit::LegacyUniqueIDBDatabase::cursorAdvance):
(WebKit::LegacyUniqueIDBDatabase::cursorIterate):
(WebKit::LegacyUniqueIDBDatabase::count):
(WebKit::LegacyUniqueIDBDatabase::deleteRange):
(WebKit::LegacyUniqueIDBDatabase::openBackingStoreTransaction):
(WebKit::LegacyUniqueIDBDatabase::beginBackingStoreTransaction):
(WebKit::LegacyUniqueIDBDatabase::commitBackingStoreTransaction):
(WebKit::LegacyUniqueIDBDatabase::resetBackingStoreTransaction):
(WebKit::LegacyUniqueIDBDatabase::rollbackBackingStoreTransaction):
(WebKit::LegacyUniqueIDBDatabase::changeDatabaseVersionInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::createObjectStoreInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::deleteObjectStoreInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::clearObjectStoreInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::createIndexInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::deleteIndexInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::putRecordInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::didPutRecordInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::getRecordFromBackingStore):
(WebKit::LegacyUniqueIDBDatabase::didGetRecordFromBackingStore):
(WebKit::LegacyUniqueIDBDatabase::openCursorInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::didOpenCursorInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::advanceCursorInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::didAdvanceCursorInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::iterateCursorInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::didIterateCursorInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::countInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::didCountInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::deleteRangeInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::didDeleteRangeInBackingStore):
(WebKit::LegacyUniqueIDBDatabase::didEstablishTransaction):
(WebKit::LegacyUniqueIDBDatabase::didResetTransaction):
(WebKit::LegacyUniqueIDBDatabase::resetAllTransactions):
(WebKit::LegacyUniqueIDBDatabase::finalizeRollback):
(WebKit::LegacyUniqueIDBDatabase::absoluteDatabaseDirectory):
(WebKit::LegacyUniqueIDBDatabase::postMainThreadTask):
(WebKit::LegacyUniqueIDBDatabase::performNextMainThreadTask):
(WebKit::LegacyUniqueIDBDatabase::postDatabaseTask):
(WebKit::LegacyUniqueIDBDatabase::performNextDatabaseTask):
* DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabase.h: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h.
(WebKit::LegacyUniqueIDBDatabase::create):
(WebKit::LegacyUniqueIDBDatabase::identifier):
* DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.cpp: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp.
(WebKit::LegacyUniqueIDBDatabaseIdentifier::LegacyUniqueIDBDatabaseIdentifier):
(WebKit::LegacyUniqueIDBDatabaseIdentifier::isHashTableDeletedValue):
(WebKit::LegacyUniqueIDBDatabaseIdentifier::hash):
(WebKit::LegacyUniqueIDBDatabaseIdentifier::isNull):
(WebKit::LegacyUniqueIDBDatabaseIdentifier::isolatedCopy):
(WebKit::operator==):
* DatabaseProcess/IndexedDB/LegacyUniqueIDBDatabaseIdentifier.h: Renamed from Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h.
(WebKit::LegacyUniqueIDBDatabaseIdentifier::databaseName):
(WebKit::LegacyUniqueIDBDatabaseIdentifier::openingOrigin):
(WebKit::LegacyUniqueIDBDatabaseIdentifier::mainFrameOrigin):
(WebKit::LegacyUniqueIDBDatabaseIdentifierHash::hash):
(WebKit::LegacyUniqueIDBDatabaseIdentifierHash::equal):
(WebKit::LegacyUniqueIDBDatabaseIdentifierHashTraits::isEmptyValue):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
* Shared/WebCrossThreadCopier.cpp:
(WebCore::LegacyUniqueIDBDatabaseIdentifier>::copy):
(WebCore::UniqueIDBDatabaseIdentifier>::copy): Deleted.
* Shared/WebCrossThreadCopier.h:
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoSpread operator should be allowed when not the first argument of parameter list
keith_miller@apple.com [Thu, 18 Feb 2016 01:17:36 +0000 (01:17 +0000)]
Spread operator should be allowed when not the first argument of parameter list
https://bugs.webkit.org/show_bug.cgi?id=152721

Reviewed by Saam Barati.

Source/JavaScriptCore:

Spread arguments to functions should now be ES6 compliant. Before we
would only take a spread operator if it was the sole argument to a
function. Additionally, we would not use the Symbol.iterator on the
object to generate the arguments. Instead we would do a loop up to the
length mapping indexed properties to the corresponding argument. We fix
both these issues by doing an AST transformation from foo(...a, b, ...c, d)
to foo(...[...a, b, ...c, d]) (where the spread on the rhs uses the
old spread semantics). This solution has the downside of requiring the
allocation of another object and copying each element twice but avoids a
large change to the vm calling convention.

* interpreter/Interpreter.cpp:
(JSC::loadVarargs):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createElementList):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseArguments):
(JSC::Parser<LexerType>::parseArgument):
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/Parser.h:
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createElementList):
* tests/es6.yaml:
* tests/stress/spread-calling.js: Added.
(testFunction):
(testEmpty):
(makeObject):
(otherIterator.return.next):
(otherIterator):
(totalIter):
(throwingIter.return.next):
(throwingIter):
(i.catch):

LayoutTests:

Update tests with new semantics of spread calling. Additionally,
adjust benchmarks to run in a more reasonable time now that
spread is implemented correctly.

* js/basic-spread-expected.txt:
* js/parser-syntax-check-expected.txt:
* js/regress/script-tests/deltablue-varargs.js:
(deltaBlue):
* js/regress/script-tests/varargs-construct.js:
* js/script-tests/basic-spread.js:
* js/script-tests/parser-syntax-check.js:

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

4 years agoRemove a wrong cast in RemoteInspector::receivedSetupMessage
bburg@apple.com [Thu, 18 Feb 2016 01:05:56 +0000 (01:05 +0000)]
Remove a wrong cast in RemoteInspector::receivedSetupMessage
https://bugs.webkit.org/show_bug.cgi?id=154361
<rdar://problem/24709281>

Reviewed by Joseph Pecoraro.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::receivedSetupMessage):
Not only is this cast unnecessary (the constructor accepts the base class),
but it is wrong since the target could be an automation target. Remove it.

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

4 years agoRemove WebContextSupplement::shouldTerminate, it's no longer used
andersca@apple.com [Thu, 18 Feb 2016 01:03:28 +0000 (01:03 +0000)]
Remove WebContextSupplement::shouldTerminate, it's no longer used
https://bugs.webkit.org/show_bug.cgi?id=154367

Reviewed by Sam Weinig.

* UIProcess/WebContextSupplement.h:
(WebKit::WebContextSupplement::shouldTerminate): Deleted.
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::shouldTerminate): Deleted.
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::shouldTerminate): Deleted.

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

4 years agoRename FTLB3Blah to FTLBlah
fpizlo@apple.com [Thu, 18 Feb 2016 00:42:36 +0000 (00:42 +0000)]
Rename FTLB3Blah to FTLBlah
https://bugs.webkit.org/show_bug.cgi?id=154365

Rubber stamped by Geoffrey Garen, Benjamin Poulain, Awesome Kling, and Saam Barati.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* ftl/FTLB3Compile.cpp: Removed.
* ftl/FTLB3Output.cpp: Removed.
* ftl/FTLB3Output.h: Removed.
* ftl/FTLCompile.cpp: Copied from Source/JavaScriptCore/ftl/FTLB3Compile.cpp.
* ftl/FTLOutput.cpp: Copied from Source/JavaScriptCore/ftl/FTLB3Output.cpp.
* ftl/FTLOutput.h: Copied from Source/JavaScriptCore/ftl/FTLB3Output.h.

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

4 years agoRemoteInspector deadlocks if _WKAutomationDelegate creates/registers a target synchro...
bburg@apple.com [Thu, 18 Feb 2016 00:37:50 +0000 (00:37 +0000)]
RemoteInspector deadlocks if _WKAutomationDelegate creates/registers a target synchronously
https://bugs.webkit.org/show_bug.cgi?id=154359
<rdar://problem/24708897>

Reviewed by Joseph Pecoraro.

RemoteInspector always grabs a lock whenever receiving or sending XPC messages. If it
forwards a new session request via _WKAutomationDelegate, and the client synchronously
creates and registers a session, then RemoteInspector will try to grab the lock again
while adding the session to its registry, causing a deadlock.

* UIProcess/Cocoa/AutomationClient.mm:
(WebKit::AutomationClient::requestAutomationSession): Add a dispatch_async() to
protect clients from accidentally deadlocking. They shouldn't have to care about
RemoteInspector's locking mechanisms.

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

4 years agoRemove LLVM dependencies from WebKit
fpizlo@apple.com [Thu, 18 Feb 2016 00:11:21 +0000 (00:11 +0000)]
Remove LLVM dependencies from WebKit
https://bugs.webkit.org/show_bug.cgi?id=154323

Reviewed by Antti Koivisto and Benjamin Poulain.

Source/JavaScriptCore:

We have switched all ports that use the FTL JIT to using B3 as the backend. This renders all
LLVM-related code dead, including the disassembler, which was only reachable when you were on
a platform that already had an in-tree disassembler.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGCommon.h:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThread):
(JSC::DFG::Plan::compileInThreadImpl):
(JSC::DFG::Plan::compileTimeStats):
* disassembler/ARM64Disassembler.cpp:
(JSC::tryToDisassemble):
* disassembler/ARMv7Disassembler.cpp:
(JSC::tryToDisassemble):
* disassembler/Disassembler.cpp:
(JSC::disassemble):
(JSC::disassembleAsynchronously):
* disassembler/Disassembler.h:
(JSC::tryToDisassemble):
* disassembler/LLVMDisassembler.cpp: Removed.
* disassembler/LLVMDisassembler.h: Removed.
* disassembler/UDis86Disassembler.cpp:
(JSC::tryToDisassembleWithUDis86):
* disassembler/UDis86Disassembler.h:
(JSC::tryToDisassembleWithUDis86):
* disassembler/X86Disassembler.cpp:
(JSC::tryToDisassemble):
* ftl/FTLAbbreviatedTypes.h:
* ftl/FTLAbbreviations.h: Removed.
* ftl/FTLAbstractHeap.cpp:
(JSC::FTL::AbstractHeap::decorateInstruction):
(JSC::FTL::AbstractHeap::dump):
(JSC::FTL::AbstractField::dump):
(JSC::FTL::IndexedAbstractHeap::IndexedAbstractHeap):
(JSC::FTL::IndexedAbstractHeap::~IndexedAbstractHeap):
(JSC::FTL::IndexedAbstractHeap::baseIndex):
(JSC::FTL::IndexedAbstractHeap::dump):
(JSC::FTL::NumberedAbstractHeap::NumberedAbstractHeap):
(JSC::FTL::NumberedAbstractHeap::dump):
(JSC::FTL::AbsoluteAbstractHeap::AbsoluteAbstractHeap):
(JSC::FTL::AbstractHeap::tbaaMetadataSlow): Deleted.
* ftl/FTLAbstractHeap.h:
(JSC::FTL::AbstractHeap::AbstractHeap):
(JSC::FTL::AbstractHeap::heapName):
(JSC::FTL::IndexedAbstractHeap::atAnyIndex):
(JSC::FTL::NumberedAbstractHeap::atAnyNumber):
(JSC::FTL::AbsoluteAbstractHeap::atAnyAddress):
(JSC::FTL::AbstractHeap::tbaaMetadata): Deleted.
* ftl/FTLAbstractHeapRepository.cpp:
(JSC::FTL::AbstractHeapRepository::AbstractHeapRepository):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLB3Compile.cpp:
* ftl/FTLB3Output.cpp:
(JSC::FTL::Output::Output):
(JSC::FTL::Output::check):
(JSC::FTL::Output::load):
(JSC::FTL::Output::store):
* ftl/FTLB3Output.h:
* ftl/FTLCommonValues.cpp:
(JSC::FTL::CommonValues::CommonValues):
(JSC::FTL::CommonValues::initializeConstants):
* ftl/FTLCommonValues.h:
(JSC::FTL::CommonValues::initialize): Deleted.
* ftl/FTLCompile.cpp: Removed.
* ftl/FTLCompileBinaryOp.cpp: Removed.
* ftl/FTLCompileBinaryOp.h: Removed.
* ftl/FTLDWARFDebugLineInfo.cpp: Removed.
* ftl/FTLDWARFDebugLineInfo.h: Removed.
* ftl/FTLDWARFRegister.cpp: Removed.
* ftl/FTLDWARFRegister.h: Removed.
* ftl/FTLDataSection.cpp: Removed.
* ftl/FTLDataSection.h: Removed.
* ftl/FTLExceptionHandlerManager.cpp: Removed.
* ftl/FTLExceptionHandlerManager.h: Removed.
* ftl/FTLExceptionTarget.cpp:
* ftl/FTLExceptionTarget.h:
* ftl/FTLExitThunkGenerator.cpp: Removed.
* ftl/FTLExitThunkGenerator.h: Removed.
* ftl/FTLFail.cpp:
(JSC::FTL::fail):
* ftl/FTLInlineCacheDescriptor.h: Removed.
* ftl/FTLInlineCacheSize.cpp: Removed.
* ftl/FTLInlineCacheSize.h: Removed.
* ftl/FTLIntrinsicRepository.cpp: Removed.
* ftl/FTLIntrinsicRepository.h: Removed.
* ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::~JITCode):
(JSC::FTL::JITCode::initializeB3Code):
(JSC::FTL::JITCode::initializeB3Byproducts):
(JSC::FTL::JITCode::initializeAddressForCall):
(JSC::FTL::JITCode::contains):
(JSC::FTL::JITCode::ftl):
(JSC::FTL::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite):
(JSC::FTL::JITCode::initializeExitThunks): Deleted.
(JSC::FTL::JITCode::addHandle): Deleted.
(JSC::FTL::JITCode::addDataSection): Deleted.
(JSC::FTL::JITCode::exitThunks): Deleted.
* ftl/FTLJITCode.h:
(JSC::FTL::JITCode::b3Code):
(JSC::FTL::JITCode::handles): Deleted.
(JSC::FTL::JITCode::dataSections): Deleted.
* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::codeSize):
(JSC::FTL::JITFinalizer::finalizeFunction):
* ftl/FTLJITFinalizer.h:
* ftl/FTLJSCall.cpp: Removed.
* ftl/FTLJSCall.h: Removed.
* ftl/FTLJSCallBase.cpp: Removed.
* ftl/FTLJSCallBase.h: Removed.
* ftl/FTLJSCallVarargs.cpp: Removed.
* ftl/FTLJSCallVarargs.h: Removed.
* ftl/FTLJSTailCall.cpp: Removed.
* ftl/FTLJSTailCall.h: Removed.
* ftl/FTLLazySlowPath.cpp:
(JSC::FTL::LazySlowPath::LazySlowPath):
(JSC::FTL::LazySlowPath::generate):
* ftl/FTLLazySlowPath.h:
(JSC::FTL::LazySlowPath::createGenerator):
(JSC::FTL::LazySlowPath::patchableJump):
(JSC::FTL::LazySlowPath::done):
(JSC::FTL::LazySlowPath::usedRegisters):
(JSC::FTL::LazySlowPath::callSiteIndex):
(JSC::FTL::LazySlowPath::stub):
(JSC::FTL::LazySlowPath::patchpoint): Deleted.
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLocation.cpp:
(JSC::FTL::Location::forValueRep):
(JSC::FTL::Location::dump):
(JSC::FTL::Location::forStackmaps): Deleted.
* ftl/FTLLocation.h:
(JSC::FTL::Location::forRegister):
(JSC::FTL::Location::forIndirect):
(JSC::FTL::Location::forConstant):
(JSC::FTL::Location::kind):
(JSC::FTL::Location::hasReg):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::LowerDFGToLLVM):
(JSC::FTL::DFG::LowerDFGToLLVM::lower):
(JSC::FTL::DFG::LowerDFGToLLVM::createPhiVariables):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compileUpsilon):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePhi):
(JSC::FTL::DFG::LowerDFGToLLVM::compileDoubleConstant):
(JSC::FTL::DFG::LowerDFGToLLVM::compileValueAdd):
(JSC::FTL::DFG::LowerDFGToLLVM::compileStrCat):
(JSC::FTL::DFG::LowerDFGToLLVM::compileArithAddOrSub):
(JSC::FTL::DFG::LowerDFGToLLVM::compileArithMul):
(JSC::FTL::DFG::LowerDFGToLLVM::compileArithDiv):
(JSC::FTL::DFG::LowerDFGToLLVM::compileArithNegate):
(JSC::FTL::DFG::LowerDFGToLLVM::compileBitAnd):
(JSC::FTL::DFG::LowerDFGToLLVM::compileBitOr):
(JSC::FTL::DFG::LowerDFGToLLVM::compileBitXor):
(JSC::FTL::DFG::LowerDFGToLLVM::compileBitRShift):
(JSC::FTL::DFG::LowerDFGToLLVM::compileBitLShift):
(JSC::FTL::DFG::LowerDFGToLLVM::compileBitURShift):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePutById):
(JSC::FTL::DFG::LowerDFGToLLVM::compileGetButterfly):
(JSC::FTL::DFG::LowerDFGToLLVM::compileMakeRope):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToLLVM::compileTailCall):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToLLVM::compileLoadVarargs):
(JSC::FTL::DFG::LowerDFGToLLVM::compileInvalidationPoint):
(JSC::FTL::DFG::LowerDFGToLLVM::compileIsUndefined):
(JSC::FTL::DFG::LowerDFGToLLVM::compileIn):
(JSC::FTL::DFG::LowerDFGToLLVM::getById):
(JSC::FTL::DFG::LowerDFGToLLVM::loadButterflyWithBarrier):
(JSC::FTL::DFG::LowerDFGToLLVM::stringsEqual):
(JSC::FTL::DFG::LowerDFGToLLVM::emitRightShiftSnippet):
(JSC::FTL::DFG::LowerDFGToLLVM::allocateCell):
(JSC::FTL::DFG::LowerDFGToLLVM::lazySlowPath):
(JSC::FTL::DFG::LowerDFGToLLVM::speculate):
(JSC::FTL::DFG::LowerDFGToLLVM::callCheck):
(JSC::FTL::DFG::LowerDFGToLLVM::preparePatchpointForExceptions):
(JSC::FTL::DFG::LowerDFGToLLVM::lowBlock):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExitDescriptor):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExit):
(JSC::FTL::DFG::LowerDFGToLLVM::blessSpeculation):
(JSC::FTL::DFG::LowerDFGToLLVM::buildExitArguments):
(JSC::FTL::DFG::LowerDFGToLLVM::exitValueForAvailability):
(JSC::FTL::DFG::LowerDFGToLLVM::exitValueForNode):
(JSC::FTL::DFG::LowerDFGToLLVM::probe):
(JSC::FTL::DFG::LowerDFGToLLVM::crash):
(JSC::FTL::DFG::LowerDFGToLLVM::compileUntypedBinaryOp): Deleted.
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExitArgumentsForPatchpointIfWillCatchException): Deleted.
(JSC::FTL::DFG::LowerDFGToLLVM::emitOSRExitCall): Deleted.
(JSC::FTL::DFG::LowerDFGToLLVM::callStackmap): Deleted.
* ftl/FTLOSRExit.cpp:
(JSC::FTL::OSRExitDescriptor::OSRExitDescriptor):
(JSC::FTL::OSRExitDescriptor::validateReferences):
(JSC::FTL::OSRExitDescriptor::emitOSRExit):
(JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle):
(JSC::FTL::OSRExit::OSRExit):
(JSC::FTL::OSRExit::codeLocationForRepatch):
(JSC::FTL::OSRExit::gatherRegistersToSpillForCallIfException): Deleted.
(JSC::FTL::OSRExit::spillRegistersToSpillSlot): Deleted.
(JSC::FTL::OSRExit::recoverRegistersFromSpillSlot): Deleted.
(JSC::FTL::OSRExit::willArriveAtExitFromIndirectExceptionCheck): Deleted.
(JSC::FTL::OSRExit::willArriveAtOSRExitFromCallOperation): Deleted.
(JSC::FTL::OSRExit::needsRegisterRecoveryOnGenericUnwindOSRExitPath): Deleted.
* ftl/FTLOSRExit.h:
(JSC::FTL::OSRExit::considerAddingAsFrequentExitSite):
(JSC::FTL::OSRExitDescriptorImpl::OSRExitDescriptorImpl): Deleted.
* ftl/FTLOSRExitCompilationInfo.h: Removed.
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileRecovery):
(JSC::FTL::compileStub):
(JSC::FTL::compileFTLOSRExit):
* ftl/FTLOSRExitHandle.cpp:
* ftl/FTLOSRExitHandle.h:
* ftl/FTLOutput.cpp: Removed.
* ftl/FTLOutput.h: Removed.
* ftl/FTLPatchpointExceptionHandle.cpp:
* ftl/FTLPatchpointExceptionHandle.h:
* ftl/FTLStackMaps.cpp: Removed.
* ftl/FTLStackMaps.h: Removed.
* ftl/FTLState.cpp:
(JSC::FTL::State::State):
(JSC::FTL::State::~State):
(JSC::FTL::State::dumpState): Deleted.
* ftl/FTLState.h:
* ftl/FTLUnwindInfo.cpp: Removed.
* ftl/FTLUnwindInfo.h: Removed.
* ftl/FTLValueRange.cpp:
(JSC::FTL::ValueRange::decorateInstruction):
* ftl/FTLValueRange.h:
(JSC::FTL::ValueRange::ValueRange):
(JSC::FTL::ValueRange::begin):
(JSC::FTL::ValueRange::end):
* ftl/FTLWeight.h:
(JSC::FTL::Weight::value):
(JSC::FTL::Weight::frequencyClass):
(JSC::FTL::Weight::scaleToTotal):
* llvm/InitializeLLVM.cpp: Removed.
* llvm/InitializeLLVM.h: Removed.
* llvm/InitializeLLVMMac.cpp: Removed.
* llvm/InitializeLLVMPOSIX.cpp: Removed.
* llvm/InitializeLLVMPOSIX.h: Removed.
* llvm/LLVMAPI.cpp: Removed.
* llvm/LLVMAPI.h: Removed.
* llvm/LLVMAPIFunctions.h: Removed.
* llvm/LLVMHeaders.h: Removed.
* llvm/library/LLVMAnchor.cpp: Removed.
* llvm/library/LLVMExports.cpp: Removed.
* llvm/library/LLVMOverrides.cpp: Removed.
* llvm/library/config_llvm.h: Removed.

Source/WTF:

* wtf/Platform.h:

Tools:

* Scripts/copy-webkitlibraries-to-product-directory:
(isContentOfFileEqualToString):
(fileContains): Deleted.
(buildLLVM): Deleted.
(symlinkLLVMLibrariesIfNeeded): Deleted.

WebKitLibraries:

* LLVMIncludesElCapitan.tar.bz2: Removed.
* LLVMIncludesIOS9.tar.bz2: Removed.
* LLVMIncludesMavericks.tar.bz2: Removed.
* LLVMIncludesYosemite.tar.bz2: Removed.
* LLVMLibrariesElCapitan.tar.bz2: Removed.
* LLVMLibrariesIOS9.tar.bz2: Removed.
* LLVMLibrariesMavericks.tar.bz2: Removed.
* LLVMLibrariesYosemite.tar.bz2: Removed.

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

4 years agoRemove an unused function
andersca@apple.com [Wed, 17 Feb 2016 23:45:01 +0000 (23:45 +0000)]
Remove an unused function
https://bugs.webkit.org/show_bug.cgi?id=154358

Reviewed by Sam Weinig.

* Platform/cg/CGUtilities.cpp:
(WebKit::paintBitmapContext): Deleted.
* Platform/cg/CGUtilities.h:

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

4 years agoAdd ios-simulator baseline for new W3C HTML tests added with r196710
ryanhaddad@apple.com [Wed, 17 Feb 2016 23:36:31 +0000 (23:36 +0000)]
Add ios-simulator baseline for new W3C HTML tests added with r196710

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt: Added.
* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt: Added.

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

4 years ago[JSC] Remove the overflow check on ArithAbs when possible
commit-queue@webkit.org [Wed, 17 Feb 2016 23:35:11 +0000 (23:35 +0000)]
[JSC] Remove the overflow check on ArithAbs when possible
https://bugs.webkit.org/show_bug.cgi?id=154325

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-02-17
Reviewed by Filip Pizlo.

This patch adds support for ArithMode for ArithAbs.

It is useful for kraken tests where Math.abs() is used
on values for which the range is known.

For example, imaging-gaussian-blur has two Math.abs() with
integers that are always in a small range around zero.
The IntegerRangeOptimizationPhase detects the range correctly
so we can just update the ArithMode depending on the input.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGIntegerRangeOptimizationPhase.cpp:
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToArithNegate):
(JSC::DFG::Node::hasArithMode):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileArithAbs):
* tests/stress/arith-abs-integer-range-optimization.js: Added.
(negativeRange):
(negativeRangeIncludingZero):
(negativeRangeWithOverflow):
(positiveRange):
(positiveRangeIncludingZero):
(rangeWithoutOverflow):
* tests/stress/arith-abs-with-bitwise-or-zero.js: Added.
(opaqueAbs):

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

4 years agoModern IDB: More Encoder/Decoder/Messaging scaffolding for WK2 IPC.
beidson@apple.com [Wed, 17 Feb 2016 23:25:20 +0000 (23:25 +0000)]
Modern IDB: More Encoder/Decoder/Messaging scaffolding for WK2 IPC.
https://bugs.webkit.org/show_bug.cgi?id=154356

Reviewed by Alex Christensen.

No change in behavior yet; Just laying the groundwork.

Source/WebCore:

* Modules/indexeddb/shared/IDBDatabaseInfo.h:
(WebCore::IDBDatabaseInfo::encode):
(WebCore::IDBDatabaseInfo::decode):

* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::encode):
(WebCore::IDBError::decode):

* Modules/indexeddb/shared/IDBRequestData.h:
(WebCore::IDBRequestData::decode):

* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::encode):
(WebCore::IDBResultData::decode):

Source/WebKit2:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::didDeleteDatabase):
(WebKit::WebIDBConnectionToClient::didOpenDatabase):
(WebKit::WebIDBConnectionToClient::didAbortTransaction):
(WebKit::WebIDBConnectionToClient::didCommitTransaction):
(WebKit::WebIDBConnectionToClient::didCreateObjectStore):
(WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
(WebKit::WebIDBConnectionToClient::didClearObjectStore):
(WebKit::WebIDBConnectionToClient::didCreateIndex):
(WebKit::WebIDBConnectionToClient::didDeleteIndex):
(WebKit::WebIDBConnectionToClient::didPutOrAdd):
(WebKit::WebIDBConnectionToClient::didGetRecord):
(WebKit::WebIDBConnectionToClient::didGetCount):
(WebKit::WebIDBConnectionToClient::didDeleteRecord):
(WebKit::WebIDBConnectionToClient::didOpenCursor):
(WebKit::WebIDBConnectionToClient::didIterateCursor):
(WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::didStartTransaction):
(WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

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

4 years agoFix GTK build after r196720.
achristensen@apple.com [Wed, 17 Feb 2016 23:11:59 +0000 (23:11 +0000)]
Fix GTK build after r196720.

* UIProcess/API/gtk/WebKitUIClient.cpp:

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

4 years agoSES selftest page crashes on nightly r196694
cdumez@apple.com [Wed, 17 Feb 2016 22:59:59 +0000 (22:59 +0000)]
SES selftest page crashes on nightly r196694
https://bugs.webkit.org/show_bug.cgi?id=154350
<rdar://problem/24704334>

Reviewed by Mark Lam.

Source/JavaScriptCore:

SES selftest page crashes after r196001 / r196145 when calling
Object.getOwnPropertyDescriptor(window, "length") after the window
has been reified and "length" has been shadowed by a value property.

It was crashing in JSObject::getOwnPropertyDescriptor() because
we are getting a slot that has attribute "CustomAccessor" but
the property is not a CustomGetterSetter. In this case, since
window.length is [Replaceable] and has been set to a numeric value,
it makes that the property is not a CustomGetterSetter. However,
the "CustomAccessor" attribute should have been dropped from the
slot when window.length was shadowed. Therefore, this code path
should not be exercised at all when calling
getOwnPropertyDescriptor().

The issue was that putDirectInternal() was updating the slot
attributes only if the "Accessor" flag has changed, but not
the "customAccessor" flag. This patch fixes the issue.

* runtime/JSObject.h:
(JSC::JSObject::putDirectInternal):

LayoutTests:

Add test coverage for the crash which happens when shadowing window.length
with a value after the window property and then calling
Object.getOwnPropertyDescriptor(window, "length").

* js/window-length-getOwnPropertyDescriptor-crash-expected.txt: Added.
* js/window-length-getOwnPropertyDescriptor-crash.html: Added.

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

4 years agoImplement Proxy [[Get]]
sbarati@apple.com [Wed, 17 Feb 2016 22:11:39 +0000 (22:11 +0000)]
Implement Proxy [[Get]]
https://bugs.webkit.org/show_bug.cgi?id=154081

Reviewed by Michael Saboff.

Source/JavaScriptCore:

This patch implements ProxyObject and ProxyConstructor. Their
implementations are straight forward and follow the spec.
The largest change in this patch is adding a second parameter
to PropertySlot's constructor that specifies the internal method type of
the getOwnPropertySlot inquiry. We use getOwnPropertySlot to
implement more than one Internal Method in the spec. Because
of this, we need InternalMethodType to give us context about
which Internal Method we're executing. Specifically, Proxy will
call into different handlers based on this information.

InternalMethodType is an enum with the following values:
- Get
  This corresponds to [[Get]] internal method in the spec.
- GetOwnProperty
  This corresponds to [[GetOwnProperty]] internal method in the spec.
- HasProperty
  This corresponds to [[HasProperty]] internal method in the spec.
- VMInquiry
  This is basically everything else that isn't one of the above
  types. This value also mandates that getOwnPropertySlot does
  not perform any user observable effects. I.e, it can't call
  a JS function.

The other non-VMInquiry InternalMethodTypes are allowed to perform user
observable effects. I.e, in future patches, ProxyObject will implement
InternalMethodType::HasProperty and InternalMethodType::GetOwnProperty, which will both be defined
to call user defined JS functions, which clearly have the right to perform
user observable effects.

This patch implements getOwnPropertySlot of ProxyObject under
InternalMethodType::Get.

* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::put):
(JSC::JSCallbackObject<Parent>::staticFunctionGetter):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::caughtValue):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/ArrayPrototype.cpp:
(JSC::getProperty):
* runtime/CommonIdentifiers.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::get):
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnNonIndexPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::defineOwnProperty):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewWithArguments):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::defineOwnProperty):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::regExpMatchesArrayStructure):
(JSC::JSGlobalObject::moduleRecordStructure):
(JSC::JSGlobalObject::moduleNamespaceObjectStructure):
(JSC::JSGlobalObject::proxyObjectStructure):
(JSC::JSGlobalObject::wasmModuleStructure):
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::getOwnPropertySlot):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::callbackGetter):
* runtime/JSONObject.cpp:
(JSC::Stringifier::Holder::appendNextProperty):
(JSC::Walker::walk):
* runtime/JSObject.cpp:
(JSC::JSObject::calculatedClassName):
(JSC::JSObject::putDirectNonIndexAccessor):
(JSC::JSObject::hasProperty):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::hasOwnProperty):
(JSC::JSObject::getOwnPropertyDescriptor):
* runtime/JSObject.h:
(JSC::JSObject::getDirectIndex):
(JSC::JSObject::get):
* runtime/JSScope.cpp:
(JSC::abstractAccess):
* runtime/ObjectConstructor.cpp:
(JSC::toPropertyDescriptor):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncLookupGetter):
(JSC::objectProtoFuncLookupSetter):
(JSC::objectProtoFuncToString):
* runtime/PropertySlot.h:
(JSC::attributesForStructure):
(JSC::PropertySlot::PropertySlot):
(JSC::PropertySlot::isCacheableGetter):
(JSC::PropertySlot::isCacheableCustom):
(JSC::PropertySlot::internalMethodType):
(JSC::PropertySlot::disableCaching):
(JSC::PropertySlot::getValue):
* runtime/ProxyConstructor.cpp: Added.
(JSC::ProxyConstructor::create):
(JSC::ProxyConstructor::ProxyConstructor):
(JSC::ProxyConstructor::finishCreation):
(JSC::constructProxyObject):
(JSC::ProxyConstructor::getConstructData):
(JSC::ProxyConstructor::getCallData):
* runtime/ProxyConstructor.h: Added.
(JSC::ProxyConstructor::createStructure):
* runtime/ProxyObject.cpp: Added.
(JSC::ProxyObject::ProxyObject):
(JSC::ProxyObject::finishCreation):
(JSC::performProxyGet):
(JSC::ProxyObject::getOwnPropertySlotCommon):
(JSC::ProxyObject::getOwnPropertySlot):
(JSC::ProxyObject::getOwnPropertySlotByIndex):
(JSC::ProxyObject::visitChildren):
* runtime/ProxyObject.h: Added.
(JSC::ProxyObject::create):
(JSC::ProxyObject::createStructure):
(JSC::ProxyObject::target):
(JSC::ProxyObject::handler):
* runtime/ReflectObject.cpp:
(JSC::reflectObjectGet):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::StackFrame::nameFromCallee):
* tests/es6.yaml:
* tests/stress/proxy-basic.js: Added.
(assert):
(let.handler.get null):
(get let):
(let.handler.get switch):
(let.handler):
(let.theTarget.get x):
* tests/stress/proxy-in-proto-chain.js: Added.
(assert):
* tests/stress/proxy-of-a-proxy.js: Added.
(assert):
(throw.new.Error.):
* tests/stress/proxy-property-descriptor.js: Added.
(assert):
(set Object):
* wasm/WASMModuleParser.cpp:
(JSC::WASMModuleParser::getImportedValue):

Source/WebCore:

Tests are in JavaScriptCore.

* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::getProperty):
(WebCore::getHashAlgorithm):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::getJSArrayFromJSON):
(WebCore::getStringFromJSON):
(WebCore::getBooleanFromJSON):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::DialogHandler::returnValue):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::tryGetProperty):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::deleteProperty):
(WebCore::JSStorage::deletePropertyByIndex):
(WebCore::JSStorage::putDelegate):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::getProperty):
* testing/Internals.cpp:
(WebCore::Internals::isReadableStreamDisturbed):

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

4 years agoStringPrototype functions should check for exceptions after calling JSString::value().
mark.lam@apple.com [Wed, 17 Feb 2016 22:03:56 +0000 (22:03 +0000)]
StringPrototype functions should check for exceptions after calling JSString::value().
https://bugs.webkit.org/show_bug.cgi?id=154340

Reviewed by Filip Pizlo.

JSString::value() can throw an exception if the JS string is a rope and value()
needs to resolve the rope but encounters an OutOfMemory error.  If value() is not
able to resolve the rope, it will return a null string (in addition to throwing
the exception).  If StringPrototype functions do not check for exceptions after
calling JSString::value(), they may eventually use the returned null string and
crash the VM.

The fix is to add all the necessary exception checks, and do the appropriate
handling if needed.

Also in a few place where when an exception is detected, we return JSValue(), I
changed it to return jsUndefined() instead to be consistent with the rest of the
file.

* runtime/StringPrototype.cpp:
(JSC::replaceUsingRegExpSearch):
(JSC::stringProtoFuncMatch):
(JSC::stringProtoFuncSlice):
(JSC::stringProtoFuncSplit):
(JSC::stringProtoFuncLocaleCompare):
(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):
(JSC::stringProtoFuncLink):
(JSC::trimString):

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

4 years agoNeed listener-based version of runBeforeUnloadConfirmPanel
andersca@apple.com [Wed, 17 Feb 2016 21:46:12 +0000 (21:46 +0000)]
Need listener-based version of runBeforeUnloadConfirmPanel
https://bugs.webkit.org/show_bug.cgi?id=154354
rdar://problem/23736691

Reviewed by Sam Weinig.

* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* UIProcess/API/APIUIClient.h:
(API::UIClient::runBeforeUnloadConfirmPanel):
* UIProcess/API/C/WKPage.cpp:
(fixUpBotchedPageUIClient):
(WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
(WebKit::RunBeforeUnloadConfirmPanelResultListener::~RunBeforeUnloadConfirmPanelResultListener):
(WebKit::RunBeforeUnloadConfirmPanelResultListener::call):
(WKPageRunBeforeUnloadConfirmPanelResultListenerGetTypeID):
(WKPageRunBeforeUnloadConfirmPanelResultListenerCall):
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

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

4 years agoAdd tests for iframe and overflow scrollability after navigating back
simon.fraser@apple.com [Wed, 17 Feb 2016 21:44:02 +0000 (21:44 +0000)]
Add tests for iframe and overflow scrollability after navigating back
https://bugs.webkit.org/show_bug.cgi?id=154300

Fix the tests added in r196665 to be agnostic about how many pixels a wheel event scrolls.

* fast/scrolling/iframe-scrollable-after-back-expected.txt:
* fast/scrolling/iframe-scrollable-after-back.html:
* fast/scrolling/overflow-scrollable-after-back-expected.txt:
* fast/scrolling/overflow-scrollable-after-back.html:

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

4 years ago[ES6] Arrow function. Arrow function should raise exception ReferenceError only when...
commit-queue@webkit.org [Wed, 17 Feb 2016 21:33:34 +0000 (21:33 +0000)]
[ES6] Arrow function. Arrow function should raise exception ReferenceError only when access to 'arguments'  on top level
https://bugs.webkit.org/show_bug.cgi?id=152570

Patch by Skachkov Oleksandr <gskachkov@gmail.com> on 2016-02-17
Reviewed by Saam Barati.

Add tests to ensure that arrrow function return error when it binds arguments on top level

* js/arrowfunction-lexical-bind-arguments-top-level-expected.txt: Added.
* js/arrowfunction-lexical-bind-arguments-top-level.html: Added.
* js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js: Added.

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

4 years agoPDFPlugin's scrollableArea container is not properly unregistered when page is going...
simon.fraser@apple.com [Wed, 17 Feb 2016 21:27:02 +0000 (21:27 +0000)]
PDFPlugin's scrollableArea container is not properly unregistered when page is going into the PageCache
https://bugs.webkit.org/show_bug.cgi?id=148182

Reviewed by Brent Fulgham.
Source/WebCore:

When handling Command-arrow key while showing a scrollable PDF, the timing of PDFPlugin
teardown and navigation could result in PDFPlugin::destroy() getting the wrong FrameView,
so the old FrameView was left with a stale pointer in its scrollableAreaSet.

Fix this by adding an explicit willDetatchRenderer() which is called on the plugin
before the Frame gets a new FrameView.

Also narrow the scope of the RefPtr<Widget> in HTMLPlugInElement::defaultEventHandler()
so that the Widget is not kept alive over a possible navigation.

I was unable to make an automated test, because reproducing the bug requires handling
a Command-arrow key event in a way that the last ref to a Widget is held over the event
handling, and this wasn't possible in an iframe.

* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::defaultEventHandler):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::willDetachRenderers):
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::willDetatchRenderer):
* style/StyleTreeResolver.cpp:
(WebCore::Style::detachRenderTree): Drive-by nullptr.

Source/WebKit2:

When handling Command-arrow key while showing a scrollable PDF, the timing of PDFPlugin
teardown and navigation could result in PDFPlugin::destroy() getting the wrong FrameView,
so the old FrameView was left with a stale pointer in its scrollableAreaSet.

Fix this by adding an explicit willDetatchRenderer() which is called on the plugin
before the Frame gets a new FrameView.

Also narrow the scope of the RefPtr<Widget> in HTMLPlugInElement::defaultEventHandler()
so that the Widget is not kept alive over a possible navigation.

I was unable to make an automated test, because reproducing the bug requires handling
a Command-arrow key event in a way that the last ref to a Widget is held over the event
handling, and this wasn't possible in an iframe.

* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::willDetatchRenderer):
* WebProcess/Plugins/Plugin.h:
(WebKit::Plugin::willDetatchRenderer):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::willDetatchRenderer):
* WebProcess/Plugins/PluginView.h:

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

4 years agoAdd an ensure function on HashMap that takes a key and a function to make the lazy...
weinig@apple.com [Wed, 17 Feb 2016 21:17:00 +0000 (21:17 +0000)]
Add an ensure function on HashMap that takes a key and a function to make the lazy value initialization idiom easier
https://bugs.webkit.org/show_bug.cgi?id=134857

Reviewed by Geoffrey Garen.

Source/WTF:

The current idiom for adding a value to a HashMap if the key is not already present, to allow for not
unnecessarily constructing the new value if it won't be used, is:

{
    auto result = map.add(key, Value());
    if (!result.isNewEntry)
        return result.iterator->value;

    result.iterator->value = createNewValue();
    return result.iterator->value;
}

or sometimes

{
    auto& value = map.add(key, Value()).iterator->value;
    if (!value)
        value = createNewValue();
    return value;
}

With this patch, you can now use the new function HashMap::ensure(key, functor). This will allow us to
change to using the following idiom:

{
    return map.ensure(key, [] { return createNewValue(); });
}

The passed in functor will only be called if the key is not already present in the HashMap.

* wtf/HashMap.h:
(WTF::HashMapTranslator::translate):
(WTF::HashMapEnsureTranslator::hash):
(WTF::HashMapEnsureTranslator::equal):
(WTF::HashMapEnsureTranslator::translate):
(WTF::HashMapTranslatorAdapter::hash):

Tools:

* TestWebKitAPI/Tests/WTF/HashMap.cpp:
Add tests for HashMap::ensure.

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

4 years agoModern IDB: Encoder/Decoder/Messaging scaffolding for WK2 IPC.
beidson@apple.com [Wed, 17 Feb 2016 20:42:55 +0000 (20:42 +0000)]
Modern IDB: Encoder/Decoder/Messaging scaffolding for WK2 IPC.
https://bugs.webkit.org/show_bug.cgi?id=154351

Reviewed by Alex Christensen.

No change in behavior yet; Just laying the groundwork.

Source/WebCore:

* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::encode):
(WebCore::IDBDatabaseIdentifier::decode):

* Modules/indexeddb/shared/IDBCursorInfo.h:
(WebCore::IDBCursorInfo::encode):
(WebCore::IDBCursorInfo::decode):

* Modules/indexeddb/shared/IDBIndexInfo.h:
(WebCore::IDBIndexInfo::encode):
(WebCore::IDBIndexInfo::decode):

* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
(WebCore::IDBObjectStoreInfo::encode):
(WebCore::IDBObjectStoreInfo::decode):

* Modules/indexeddb/shared/IDBRequestData.h:
(WebCore::IDBRequestData::encode):
(WebCore::IDBRequestData::decode):

* Modules/indexeddb/shared/IDBResourceIdentifier.h:
(WebCore::IDBResourceIdentifier::encode):
(WebCore::IDBResourceIdentifier::decode):

* Modules/indexeddb/shared/IDBTransactionInfo.h:
(WebCore::IDBTransactionInfo::encode):
(WebCore::IDBTransactionInfo::decode):

Source/WebKit2:

Implement in all of the client->server message sends, requiring many Encoder/Decoders for
IDB objects to also be implemented:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::deleteDatabase):
(WebKit::WebIDBConnectionToServer::openDatabase):
(WebKit::WebIDBConnectionToServer::abortTransaction):
(WebKit::WebIDBConnectionToServer::commitTransaction):
(WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToServer::createObjectStore):
(WebKit::WebIDBConnectionToServer::deleteObjectStore):
(WebKit::WebIDBConnectionToServer::clearObjectStore):
(WebKit::WebIDBConnectionToServer::createIndex):
(WebKit::WebIDBConnectionToServer::deleteIndex):
(WebKit::WebIDBConnectionToServer::putOrAdd):
(WebKit::WebIDBConnectionToServer::getRecord):
(WebKit::WebIDBConnectionToServer::getCount):
(WebKit::WebIDBConnectionToServer::deleteRecord):
(WebKit::WebIDBConnectionToServer::openCursor):
(WebKit::WebIDBConnectionToServer::iterateCursor):
(WebKit::WebIDBConnectionToServer::establishTransaction):
(WebKit::WebIDBConnectionToServer::databaseConnectionClosed):
(WebKit::WebIDBConnectionToServer::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent):

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

4 years ago[iOS WK1] NSTimer in WebGeolocationProviderIOS.mm fires on the main thread without...
ddkilzer@apple.com [Wed, 17 Feb 2016 20:40:28 +0000 (20:40 +0000)]
[iOS WK1] NSTimer in WebGeolocationProviderIOS.mm fires on the main thread without the WebThreadLock
<http://webkit.org/b/154347>
<rdar://problem/19360382>

Reviewed by Andy Estes.

This isn't testable because the GeolocationClientMock in WebCore
bypasses this code in WebKit1.

* Misc/WebGeolocationProviderIOS.mm:
(-[WebGeolocationProviderIOS _handlePendingInitialPosition:]):
Assert that this is always called on the WebThread.
(-[WebGeolocationProviderIOS registerWebView:]): Register the
NSTimer on the WebThread NSRunLoop.

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

4 years agoWeb Inspector: add CSS variables for common border/background colors
mattbaker@apple.com [Wed, 17 Feb 2016 20:29:50 +0000 (20:29 +0000)]
Web Inspector: add CSS variables for common border/background colors
https://bugs.webkit.org/show_bug.cgi?id=154302
<rdar://problem/24680944>

Reviewed by Timothy Hatcher.

Added CSS variables for commonly used border and background colors, and removed
duplicate CSS variables with less generic names. Inactive border colors declared in
rules with a body.window-inactive selector have been removed. A new rule using this
selector in Variables.css sets "--border-color" to the inactive color.

* UserInterface/Views/CSSStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style > .content > .pseudo-classes):
(.sidebar > .panel.details.css-style > .content ~ :matches(.options-container, .class-list-container)):
(.sidebar > .panel.details.css-style > .content.filter-in-progress .style-declaration-section:not(.filter-section-has-label)):
* UserInterface/Views/DataGrid.css:
(.data-grid.inline):
(.data-grid th):
(.data-grid :matches(th, td):not(:last-child)):
(body.window-inactive .data-grid th): Deleted.
(body.window-inactive .data-grid :matches(th, td):not(:last-child)): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger.paused .details-section.scripts):
* UserInterface/Views/DetailsSection.css:
(.details-section):
(.details-section .details-section:first-child):
(.details-section > .header):
(.details-section > .content > .group):
(.details-section > .content > .group:nth-child(even) > .row:matches(.simple:first-child > *, :not(.simple):first-child)):
* UserInterface/Views/FilterBar.css:
(.filter-bar):
* UserInterface/Views/FindBanner.css:
(.find-banner):
(body.window-inactive .find-banner): Deleted.
* UserInterface/Views/LayerTreeDetailsSidebarPanel.css:
(.panel.details.layer-tree .bottom-bar):
* UserInterface/Views/Main.css:
(body.docked.bottom):
(body.docked.right):
(#split-content-browser):
(#split-content-browser > .navigation-bar):
(body.window-inactive.docked.bottom): Deleted.
(body.window-inactive.docked.right): Deleted.
(body.window-inactive #split-content-browser): Deleted.
* UserInterface/Views/MemoryCategoryView.css:
(.memory-category-view):
(.memory-category-view > .details):
(body.window-inactive .memory-category-view): Deleted.
(body.window-inactive .memory-category-view > .details): Deleted.
* UserInterface/Views/MemoryTimelineView.css:
(.timeline-view.memory):
(.timeline-view.memory > .content > .overview):
(.timeline-view.memory > .content > .details > .subtitle):
(.timeline-view.memory > .content > .overview > .divider):
(body.window-inactive .timeline-view.memory): Deleted.
(body.window-inactive .timeline-view.memory > .content > .overview): Deleted.
(body.window-inactive .timeline-view.memory > .content > .details > .subtitle): Deleted.
(body.window-inactive .timeline-view.memory > .content > .overview > .divider): Deleted.
* UserInterface/Views/NavigationBar.css:
(.navigation-bar):
(body.window-inactive .navigation-bar): Deleted.
* UserInterface/Views/NavigationSidebarPanel.css:
(.sidebar > .panel.navigation > .overflow-shadow):
(body.window-inactive .sidebar > .panel.navigation > .overflow-shadow): Deleted.
* UserInterface/Views/NetworkSidebarPanel.css:
(.sidebar > .panel.navigation.network > .title-bar):
(body.window-inactive .sidebar > .panel.navigation.network > .title-bar): Deleted.
* UserInterface/Views/OverviewTimelineView.css:
(.timeline-view.overview > .timeline-ruler > .header):
(body.window-inactive .timeline-view.overview > .timeline-ruler > .header): Deleted.
* UserInterface/Views/QuickConsole.css:
(.quick-console):
(body.window-inactive .quick-console): Deleted.
* UserInterface/Views/Sidebar.css:
(.sidebar):
(.sidebar.left):
(.sidebar.right):
(body.window-inactive .sidebar.left): Deleted.
(body.window-inactive .sidebar.right): Deleted.
* UserInterface/Views/TimelineDataGrid.css:
(.data-grid.timeline th):
(body.window-inactive .data-grid.timeline th): Deleted.
* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .header):
(body.window-inactive .timeline-ruler > .header): Deleted.
* UserInterface/Views/TimelineSidebarPanel.css:
(.sidebar > .panel.navigation.timeline > .title-bar):
(.sidebar > .panel.navigation.timeline > .title-bar.timeline-events):
(body.window-inactive .sidebar > .panel.navigation.timeline > .title-bar): Deleted.
(body.window-inactive .sidebar > .panel.navigation.timeline > .title-bar.timeline-events): Deleted.
* UserInterface/Views/Toolbar.css:
(body.latest-mac .toolbar .dashboard-container):
* UserInterface/Views/Variables.css:
(:root):
(body.window-inactive *):
* UserInterface/Views/VisualStyleSelectorSection.css:
(.details-section.visual-style-selector-section:not(.collapsed) > .header):
(.details-section.visual-style-selector-section > .content > .selectors > .selector-list > .section-divider):

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

4 years ago[iOS] Purge GraphicsServices font cache on memory warning.
akling@apple.com [Wed, 17 Feb 2016 20:27:56 +0000 (20:27 +0000)]
[iOS] Purge GraphicsServices font cache on memory warning.
<https://webkit.org/b/154343>

Reviewed by Antti Koivisto.

The GS font cache was holding on to the last retain on CSS fonts after they stop being used.
Call SPI to purge it on memory pressure.

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):
* platform/spi/ios/GraphicsServicesSPI.h:

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

4 years agoRevert accidentally committed ChangeLogs
beidson@apple.com [Wed, 17 Feb 2016 20:22:23 +0000 (20:22 +0000)]
Revert accidentally committed ChangeLogs

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

4 years agoImport W3C HTML reflection tests
cdumez@apple.com [Wed, 17 Feb 2016 20:19:32 +0000 (20:19 +0000)]
Import W3C HTML reflection tests
https://bugs.webkit.org/show_bug.cgi?id=154310
<rdar://problem/24685826>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Import W3C HTML reflection tests from:
https://github.com/w3c/web-platform-tests/tree/master/html/dom

This improves our test coverage.

* web-platform-tests/html/dom/reflection-embedded-expected.txt: Added.
* web-platform-tests/html/dom/reflection-embedded.html: Added.
* web-platform-tests/html/dom/reflection-forms-expected.txt: Added.
* web-platform-tests/html/dom/reflection-forms.html: Added.
* web-platform-tests/html/dom/reflection-grouping-expected.txt: Added.
* web-platform-tests/html/dom/reflection-grouping.html: Added.
* web-platform-tests/html/dom/reflection-metadata-expected.txt: Added.
* web-platform-tests/html/dom/reflection-metadata.html: Added.
* web-platform-tests/html/dom/reflection-misc-expected.txt: Added.
* web-platform-tests/html/dom/reflection-misc.html: Added.
* web-platform-tests/html/dom/reflection-obsolete-expected.txt: Added.
* web-platform-tests/html/dom/reflection-obsolete.html: Added.
* web-platform-tests/html/dom/reflection-sections-expected.txt: Added.
* web-platform-tests/html/dom/reflection-sections.html: Added.
* web-platform-tests/html/dom/reflection-tabular-expected.txt: Added.
* web-platform-tests/html/dom/reflection-tabular.html: Added.
* web-platform-tests/html/dom/reflection-text-expected.txt: Added.
* web-platform-tests/html/dom/reflection-text.html: Added.

LayoutTests:

Skip newly imported tests in Debug builds because they are slow.

* TestExpectations:

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

4 years agoModern IDB: More WK2 IPC Scaffolding.
beidson@apple.com [Wed, 17 Feb 2016 20:19:20 +0000 (20:19 +0000)]
Modern IDB: More WK2 IPC Scaffolding.
https://bugs.webkit.org/show_bug.cgi?id=154317

Reviewed by Alex Christensen.

No change in behavior yet; Just laying the groundwork.

Source/WebCore:

* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::IDBCursorInfo):
* Modules/indexeddb/shared/IDBCursorInfo.h:
(WebCore::IDBCursorInfo::decode):
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::decode):
* Modules/indexeddb/shared/IDBIndexInfo.h:
(WebCore::IDBIndexInfo::decode):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
(WebCore::IDBObjectStoreInfo::decode):
* Modules/indexeddb/shared/IDBRequestData.cpp:
(WebCore::IDBRequestData::IDBRequestData):
* Modules/indexeddb/shared/IDBRequestData.h:
(WebCore::IDBRequestData::decode):
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
* Modules/indexeddb/shared/IDBResourceIdentifier.h:
(WebCore::IDBResourceIdentifier::decode):
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::IDBResultData):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::decode):
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::IDBTransactionInfo):
* Modules/indexeddb/shared/IDBTransactionInfo.h:
(WebCore::IDBTransactionInfo::decode):
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

* CMakeLists.txt:
* DerivedSources.make:
* WebKit2.xcodeproj/project.pbxproj:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::deleteDatabase):
(WebKit::WebIDBConnectionToClient::openDatabase):
(WebKit::WebIDBConnectionToClient::abortTransaction):
(WebKit::WebIDBConnectionToClient::commitTransaction):
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::createObjectStore):
(WebKit::WebIDBConnectionToClient::deleteObjectStore):
(WebKit::WebIDBConnectionToClient::clearObjectStore):
(WebKit::WebIDBConnectionToClient::createIndex):
(WebKit::WebIDBConnectionToClient::deleteIndex):
(WebKit::WebIDBConnectionToClient::putOrAdd):
(WebKit::WebIDBConnectionToClient::getRecord):
(WebKit::WebIDBConnectionToClient::getCount):
(WebKit::WebIDBConnectionToClient::deleteRecord):
(WebKit::WebIDBConnectionToClient::openCursor):
(WebKit::WebIDBConnectionToClient::iterateCursor):
(WebKit::WebIDBConnectionToClient::establishTransaction):
(WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
(WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Added.

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::didDeleteDatabase):
(WebKit::WebIDBConnectionToServer::didOpenDatabase):
(WebKit::WebIDBConnectionToServer::didAbortTransaction):
(WebKit::WebIDBConnectionToServer::didCommitTransaction):
(WebKit::WebIDBConnectionToServer::didCreateObjectStore):
(WebKit::WebIDBConnectionToServer::didDeleteObjectStore):
(WebKit::WebIDBConnectionToServer::didClearObjectStore):
(WebKit::WebIDBConnectionToServer::didCreateIndex):
(WebKit::WebIDBConnectionToServer::didDeleteIndex):
(WebKit::WebIDBConnectionToServer::didPutOrAdd):
(WebKit::WebIDBConnectionToServer::didGetRecord):
(WebKit::WebIDBConnectionToServer::didGetCount):
(WebKit::WebIDBConnectionToServer::didDeleteRecord):
(WebKit::WebIDBConnectionToServer::didOpenCursor):
(WebKit::WebIDBConnectionToServer::didIterateCursor):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in: Added.

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

4 years agov3 UI has the capability to schedule an A/B testing in a specific range
rniwa@webkit.org [Wed, 17 Feb 2016 20:18:05 +0000 (20:18 +0000)]
v3 UI has the capability to schedule an A/B testing in a specific range
https://bugs.webkit.org/show_bug.cgi?id=154329

Reviewed by Chris Dumez.

Extended AnalysisTaskChartPane and ResultsTable so that users can select a range of points in either
the overview chart pane and the results viewer table. Extracted TestGroupForm out of the analysis task
page and used right below those two components in the analysis task page.

* public/v3/components/results-table.js:
(ResultsTable):
(ResultsTable.prototype.setRangeSelectorLabels): Added.
(ResultsTable.prototype.setRangeSelectorCallback): Added.
(ResultsTable.prototype.selectedRange): Added.
(ResultsTable.prototype._rangeSelectorClicked): Added.
(ResultsTable.prototype.render): Generate radio boxes to select a range.

* public/v3/components/test-group-form.js:
(TestGroupForm):
(TestGroupForm.prototype.setStartCallback): Added.
(TestGroupForm.prototype.setNeedsName): Added.
(TestGroupForm.prototype.setDisabled): Added.
(TestGroupForm.prototype.setLabel): Added.
(TestGroupForm.prototype.setRepetitionCount): Added.
(TestGroupForm.prototype._submitted): Added.
(TestGroupForm.htmlTemplate): Extracted from AnalysisTaskPage.htmlTemplate.

* public/v3/index.html:

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskChartPane.prototype._mainSelectionDidChange): Added. Delegates the work to AnalysisTaskPage.
(AnalysisTaskChartPane.prototype.selectedPoints): Added.
(AnalysisTaskPage):
(AnalysisTaskPage.prototype.title):
(AnalysisTaskPage.prototype.render):
(AnalysisTaskPage.prototype._renderTestGroupDetails): Use TestGroupForm's methods instead of mutating DOM.
(AnalysisTaskPage.prototype._retryCurrentTestGroup):
(AnalysisTaskPage.prototype._chartSelectionDidChange): Added.
(AnalysisTaskPage.prototype._createNewTestGroupFromChart): Added.
(AnalysisTaskPage.prototype._selectedRowInAnalysisResultsViewer): Added.
(AnalysisTaskPage.prototype._createNewTestGroupFromViewer): Added.
(AnalysisTaskPage.prototype._createRetryNameForTestGroup):
(AnalysisTaskPage.prototype._createTestGroupAfterVerifyingRootSetList): Extracted from _retryCurrentTestGroup
so that we can call it in _createNewTestGroupFromChart and _createNewTestGroupFromViewer.
(AnalysisTaskPage.htmlTemplate):

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

4 years agoCopy http body when being redirected with 308 with NetworkSession
achristensen@apple.com [Wed, 17 Feb 2016 20:11:05 +0000 (20:11 +0000)]
Copy http body when being redirected with 308 with NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=154348

Reviewed by Brady Eidson.
Source/WebKit2:

This fixes http/tests/security/cors-post-redirect-308.html
which used to assert in ResourceRequest::doUpdateResourceHTTPBody

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTask::willPerformHTTPRedirection):

LayoutTests:

* http/tests/navigation/post-308-response-expected.txt: Copied from LayoutTests/http/tests/navigation/post-307-response-expected.txt.
* http/tests/navigation/post-308-response.html: Copied from LayoutTests/http/tests/navigation/post-307-response.html.
* http/tests/navigation/resources/redirection-response.php:
Added a test verifying data is being sent with post requests after being redirected with an http status code of 308.
We already had non-CORS tests for 301, 302, 303, and 307, and we already had CORS tests for 301, 302, 303, 307, and 308.
This fills in the missing non-CORS test.

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

4 years agoRegression(r196648): window.showModalDialog is no longer undefined if the client...
cdumez@apple.com [Wed, 17 Feb 2016 19:31:10 +0000 (19:31 +0000)]
Regression(r196648): window.showModalDialog is no longer undefined if the client does not allow showing modal dialog
https://bugs.webkit.org/show_bug.cgi?id=154330

Reviewed by Gavin Barraclough.

Source/WebCore:

window.showModalDialog is no longer undefined if the client does not
allow showing modal dialog after r196648. This patch fixes the issue
and add test coverage for this.

Test: fast/dom/Window/forbid-showModalDialog.html

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
- Move the DOMWindow::canShowModalDialog() check *before* checking
  for static properties as showModalDialog is now in the static
  property table after r196648.
- Add check for Base::getOwnPropertySlot() first to support overriding
  window.showModalDialog (This behavior matches Firefox).
- Return false if DOMWindow::canShowModalDialog() returns false as this
  seems cleaner than claiming that the property is there but undefined.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::canShowModalDialogNow): Deleted.
This was indentical to canShowModalDialog().

(WebCore::DOMWindow::canShowModalDialog):
(WebCore::DOMWindow::setCanShowModalDialogOverride):
(WebCore::DOMWindow::showModalDialog):
* page/DOMWindow.h:
* testing/Internals.cpp:
(WebCore::Internals::setCanShowModalDialogOverride):
* testing/Internals.h:
* testing/Internals.idl:
Add support for overriding the ChromeClient's canShowModalDialog
decision and hook it up to Internals to add layout test coverage.

LayoutTests:

Add layout test to make sure that window.showModalDialog is undefined
when the client does not allow showing modal dialog and to check that
window.showModalDialog can be shadowed.

* fast/dom/Window/forbid-showModalDialog-expected.txt: Added.
* fast/dom/Window/forbid-showModalDialog.html: Added.

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

4 years agoModern IDB: More WK2 IPC Scaffolding.
beidson@apple.com [Wed, 17 Feb 2016 19:21:59 +0000 (19:21 +0000)]
Modern IDB: More WK2 IPC Scaffolding.
https://bugs.webkit.org/show_bug.cgi?id=154317

Reviewed by Alex Christensen.

No change in behavior yet; Just laying the groundwork.

Source/WebCore:

* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::IDBCursorInfo):
* Modules/indexeddb/shared/IDBCursorInfo.h:
(WebCore::IDBCursorInfo::decode):
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::decode):
* Modules/indexeddb/shared/IDBIndexInfo.h:
(WebCore::IDBIndexInfo::decode):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
(WebCore::IDBObjectStoreInfo::decode):
* Modules/indexeddb/shared/IDBRequestData.cpp:
(WebCore::IDBRequestData::IDBRequestData):
* Modules/indexeddb/shared/IDBRequestData.h:
(WebCore::IDBRequestData::decode):
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
* Modules/indexeddb/shared/IDBResourceIdentifier.h:
(WebCore::IDBResourceIdentifier::decode):
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::IDBResultData):
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::decode):
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::IDBTransactionInfo):
* Modules/indexeddb/shared/IDBTransactionInfo.h:
(WebCore::IDBTransactionInfo::decode):
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit2:

* CMakeLists.txt:
* DerivedSources.make:
* WebKit2.xcodeproj/project.pbxproj:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::deleteDatabase):
(WebKit::WebIDBConnectionToClient::openDatabase):
(WebKit::WebIDBConnectionToClient::abortTransaction):
(WebKit::WebIDBConnectionToClient::commitTransaction):
(WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToClient::createObjectStore):
(WebKit::WebIDBConnectionToClient::deleteObjectStore):
(WebKit::WebIDBConnectionToClient::clearObjectStore):
(WebKit::WebIDBConnectionToClient::createIndex):
(WebKit::WebIDBConnectionToClient::deleteIndex):
(WebKit::WebIDBConnectionToClient::putOrAdd):
(WebKit::WebIDBConnectionToClient::getRecord):
(WebKit::WebIDBConnectionToClient::getCount):
(WebKit::WebIDBConnectionToClient::deleteRecord):
(WebKit::WebIDBConnectionToClient::openCursor):
(WebKit::WebIDBConnectionToClient::iterateCursor):
(WebKit::WebIDBConnectionToClient::establishTransaction):
(WebKit::WebIDBConnectionToClient::databaseConnectionClosed):
(WebKit::WebIDBConnectionToClient::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToClient::didFireVersionChangeEvent):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in: Added.

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::didDeleteDatabase):
(WebKit::WebIDBConnectionToServer::didOpenDatabase):
(WebKit::WebIDBConnectionToServer::didAbortTransaction):
(WebKit::WebIDBConnectionToServer::didCommitTransaction):
(WebKit::WebIDBConnectionToServer::didCreateObjectStore):
(WebKit::WebIDBConnectionToServer::didDeleteObjectStore):
(WebKit::WebIDBConnectionToServer::didClearObjectStore):
(WebKit::WebIDBConnectionToServer::didCreateIndex):
(WebKit::WebIDBConnectionToServer::didDeleteIndex):
(WebKit::WebIDBConnectionToServer::didPutOrAdd):
(WebKit::WebIDBConnectionToServer::didGetRecord):
(WebKit::WebIDBConnectionToServer::didGetCount):
(WebKit::WebIDBConnectionToServer::didDeleteRecord):
(WebKit::WebIDBConnectionToServer::didOpenCursor):
(WebKit::WebIDBConnectionToServer::didIterateCursor):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in: Added.

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

4 years agoUnreviewed, rolling out r196675.
commit-queue@webkit.org [Wed, 17 Feb 2016 19:18:12 +0000 (19:18 +0000)]
Unreviewed, rolling out r196675.
https://bugs.webkit.org/show_bug.cgi?id=154344

 "Causes major slowdowns on deltablue-varargs" (Requested by
keith_miller on #webkit).

Reverted changeset:

"Spread operator should be allowed when not the first argument
of parameter list"
https://bugs.webkit.org/show_bug.cgi?id=152721
http://trac.webkit.org/changeset/196675

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

4 years ago[Win] Allow ports to disable automatic text track selection
eric.carlson@apple.com [Wed, 17 Feb 2016 19:17:09 +0000 (19:17 +0000)]
[Win] Allow ports to disable automatic text track selection
https://bugs.webkit.org/show_bug.cgi?id=154322
<rdar://problem/24623986>

Reviewed by Brent Fulgham.

* page/CaptionUserPreferencesMediaAF.cpp:
(MTEnableCaption2015BehaviorPtr): Implement for Windows.

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

4 years agoJSDOMWindow::put should not do the same thing twice
barraclough@apple.com [Wed, 17 Feb 2016 19:04:11 +0000 (19:04 +0000)]
JSDOMWindow::put should not do the same thing twice
https://bugs.webkit.org/show_bug.cgi?id=154334

Reviewed by Chris Dumez.

It either calls JSGlobalObject::put or Base::put. Hint: these are basically the same thing.
In the latter case it might call lookupPut. That's redundant; JSObject::put handles static
table entries.

Source/JavaScriptCore:

* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::hasOwnPropertyForWrite): Deleted.
    - no longer needed.

Source/WebCore:

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::put):
    - just call Base::put.
(WebCore::JSDOMWindow::putByIndex):
    - just call Base::putByIndex.

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

4 years agoCMake build fix after r196698.
achristensen@apple.com [Wed, 17 Feb 2016 19:03:47 +0000 (19:03 +0000)]
CMake build fix after r196698.

* PlatformMac.cmake:

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

4 years agoCMake build fix after r196698.
achristensen@apple.com [Wed, 17 Feb 2016 18:50:42 +0000 (18:50 +0000)]
CMake build fix after r196698.

* CMakeLists.txt:

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

4 years agoAX: Implement sentence related text marker functions using TextIterator
n_wang@apple.com [Wed, 17 Feb 2016 18:16:50 +0000 (18:16 +0000)]
AX: Implement sentence related text marker functions using TextIterator
https://bugs.webkit.org/show_bug.cgi?id=154312

Reviewed by Chris Fleizach.

Source/WebCore:

Using CharacterOffset to implement sentence related text marker calls. Reused
logic from VisibleUnits class. Also fixed an issue where paragraph navigation
should skip preceding and following BR nodes.

Test: accessibility/mac/text-marker-sentence-nav.html

* accessibility/AXObjectCache.cpp:
(WebCore::resetNodeAndOffsetForReplacedNode):
(WebCore::setRangeStartOrEndWithCharacterOffset):
(WebCore::AXObjectCache::characterOffsetForNodeAndOffset):
(WebCore::AXObjectCache::previousCharacterOffset):
(WebCore::AXObjectCache::startCharacterOffsetOfWord):
(WebCore::AXObjectCache::endCharacterOffsetOfWord):
(WebCore::AXObjectCache::previousWordStartCharacterOffset):
(WebCore::AXObjectCache::leftWordRange):
(WebCore::AXObjectCache::rightWordRange):
(WebCore::AXObjectCache::characterBefore):
(WebCore::characterOffsetNodeIsBR):
(WebCore::parentEditingBoundary):
(WebCore::AXObjectCache::nextBoundary):
(WebCore::AXObjectCache::previousBoundary):
(WebCore::AXObjectCache::paragraphForCharacterOffset):
(WebCore::AXObjectCache::nextParagraphEndCharacterOffset):
(WebCore::AXObjectCache::previousParagraphStartCharacterOffset):
(WebCore::AXObjectCache::startCharacterOffsetOfSentence):
(WebCore::AXObjectCache::endCharacterOffsetOfSentence):
(WebCore::AXObjectCache::sentenceForCharacterOffset):
(WebCore::AXObjectCache::nextSentenceEndCharacterOffset):
(WebCore::AXObjectCache::previousSentenceStartCharacterOffset):
(WebCore::AXObjectCache::rootAXEditableElement):
(WebCore::startWordBoundary): Deleted.
(WebCore::endWordBoundary): Deleted.
(WebCore::AXObjectCache::nextWordBoundary): Deleted.
(WebCore::AXObjectCache::previousWordBoundary): Deleted.
* accessibility/AXObjectCache.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
* editing/VisibleUnits.cpp:
(WebCore::startWordBoundary):
(WebCore::startOfWord):
(WebCore::endWordBoundary):
(WebCore::startSentenceBoundary):
(WebCore::startOfSentence):
(WebCore::endSentenceBoundary):
* editing/VisibleUnits.h:

Tools:

* DumpRenderTree/AccessibilityUIElement.cpp:
(nextParagraphEndTextMarkerForTextMarkerCallback):
(sentenceTextMarkerRangeForTextMarkerCallback):
(previousSentenceStartTextMarkerForTextMarkerCallback):
(nextSentenceEndTextMarkerForTextMarkerCallback):
(setSelectedVisibleTextRangeCallback):
(AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
(AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker):
(AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker):
(AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
(AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker):
(AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker):
(AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
(AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker):
(AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker):
(AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker):
(AccessibilityUIElement::supportedActions):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker):
(WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker):
(WTR::AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker):
(WTR::AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::mathPostscriptsDescription):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::sentenceTextMarkerRangeForTextMarker):
(WTR::AccessibilityUIElement::previousSentenceStartTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::nextSentenceEndTextMarkerForTextMarker):
(WTR::_convertMathMultiscriptPairsToString):

LayoutTests:

* accessibility/mac/text-marker-paragraph-nav-expected.txt:
* accessibility/mac/text-marker-paragraph-nav.html:
* accessibility/mac/text-marker-sentence-nav-expected.txt: Added.
* accessibility/mac/text-marker-sentence-nav.html: Added.

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

4 years agoRemove unused media cache manager code
andersca@apple.com [Wed, 17 Feb 2016 18:15:57 +0000 (18:15 +0000)]
Remove unused media cache manager code
https://bugs.webkit.org/show_bug.cgi?id=154339

Reviewed by Tim Horton.

* DerivedSources.make:
* Shared/API/c/WKBase.h:
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextGetMediaCacheManager): Deleted.
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKMediaCacheManager.cpp: Removed.
(WKMediaCacheManagerGetTypeID): Deleted.
(WKMediaCacheManagerGetHostnamesWithMediaCache): Deleted.
(WKMediaCacheManagerClearCacheForHostname): Deleted.
(WKMediaCacheManagerClearCacheForAllHostnames): Deleted.
* UIProcess/API/C/WKMediaCacheManager.h: Removed.
* UIProcess/WebMediaCacheManagerProxy.cpp: Removed.
(WebKit::WebMediaCacheManagerProxy::supplementName): Deleted.
(WebKit::WebMediaCacheManagerProxy::create): Deleted.
(WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy): Deleted.
(WebKit::WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy): Deleted.
(WebKit::WebMediaCacheManagerProxy::processPoolDestroyed): Deleted.
(WebKit::WebMediaCacheManagerProxy::processDidClose): Deleted.
(WebKit::WebMediaCacheManagerProxy::shouldTerminate): Deleted.
(WebKit::WebMediaCacheManagerProxy::refWebContextSupplement): Deleted.
(WebKit::WebMediaCacheManagerProxy::derefWebContextSupplement): Deleted.
(WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache): Deleted.
(WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache): Deleted.
(WebKit::WebMediaCacheManagerProxy::clearCacheForHostname): Deleted.
(WebKit::WebMediaCacheManagerProxy::clearCacheForAllHostnames): Deleted.
* UIProcess/WebMediaCacheManagerProxy.h: Removed.
* UIProcess/WebMediaCacheManagerProxy.messages.in: Removed.
* UIProcess/WebProcessPool.cpp:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/MediaCache/WebMediaCacheManager.cpp: Removed.
(WebKit::WebMediaCacheManager::supplementName): Deleted.
(WebKit::WebMediaCacheManager::WebMediaCacheManager): Deleted.
(WebKit::WebMediaCacheManager::getHostnamesWithMediaCache): Deleted.
(WebKit::WebMediaCacheManager::clearCacheForHostname): Deleted.
(WebKit::WebMediaCacheManager::clearCacheForAllHostnames): Deleted.
* WebProcess/MediaCache/WebMediaCacheManager.h: Removed.
* WebProcess/MediaCache/WebMediaCacheManager.messages.in: Removed.
* WebProcess/WebProcess.cpp:
(WebKit::m_webSQLiteDatabaseTracker): Deleted.

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

4 years agoAdding an ios-specific baseline for accessibility/ios-simulator/centerpoint.html...
ryanhaddad@apple.com [Wed, 17 Feb 2016 17:46:00 +0000 (17:46 +0000)]
Adding an ios-specific baseline for accessibility/ios-simulator/centerpoint.html during failure investigation
https://bugs.webkit.org/show_bug.cgi?id=154137

Unreviewed test gardening.

* platform/ios-simulator/accessibility/ios-simulator/centerpoint-expected.txt: Added.

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

4 years agoRebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html for ios-simulator
ryanhaddad@apple.com [Wed, 17 Feb 2016 17:32:50 +0000 (17:32 +0000)]
Rebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html for ios-simulator

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:

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

4 years agoSkipping tests added with r196688 on ios-simulator due to reliance on unsupported...
ryanhaddad@apple.com [Wed, 17 Feb 2016 17:25:03 +0000 (17:25 +0000)]
Skipping tests added with r196688 on ios-simulator due to reliance on unsupported mouse events.

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years agoVersioning.
bshafiei@apple.com [Wed, 17 Feb 2016 16:50:02 +0000 (16:50 +0000)]
Versioning.

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

4 years agoWeb Inspector: Add singular and plural cases for "Ignore n times before stopping...
mattbaker@apple.com [Wed, 17 Feb 2016 16:01:23 +0000 (16:01 +0000)]
Web Inspector: Add singular and plural cases for "Ignore n times before stopping" label in breakpoint editor
https://bugs.webkit.org/show_bug.cgi?id=154335
<rdar://problem/24655491>

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
Added string for singular ignore count.

* UserInterface/Controllers/BreakpointPopoverController.js:
(WebInspector.BreakpointPopoverController.prototype._createPopoverContent):
Remove unused variable "this._ignoreCount" and update ignore count text.

(WebInspector.BreakpointPopoverController.prototype._popoverIgnoreInputChanged):
Update ignore count text as value changes.

(WebInspector.BreakpointPopoverController.prototype._updateIgnoreCountText):
Set singular text when count === 1, otherwise set plural text.

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

4 years ago[css-grid] GridSpan refactoring
rego@igalia.com [Wed, 17 Feb 2016 11:45:30 +0000 (11:45 +0000)]
[css-grid] GridSpan refactoring
https://bugs.webkit.org/show_bug.cgi?id=153868

Reviewed by Sergio Villar Senin.

Add new enum to know if a GridSpan is definite or indefinite.
That way we don't need GridUnresolvedSpan class (which is removed).
We can always have two GridSpans in GridCoordinate,
if the position is "auto" the GridSpan will be marked as indefinite.
This will allow in a follow-up patch to avoid repeated calls
to methods that resolve positions.

Most operations in GridSpan are restricted to definite GridSpans (access
to positions, iterator, etc.). For indefinite GridSpans we only need to
know that they're indefinite, we shouldn't use the rest of the data.

No new tests, no change of behavior.

* css/CSSGridTemplateAreasValue.cpp:
(WebCore::stringForPosition):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTemplateAreasRow):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
(WebCore::RenderGrid::insertItemIntoGrid):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
(WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
(WebCore::RenderGrid::columnAxisOffsetForChild):
(WebCore::RenderGrid::rowAxisOffsetForChild):
(WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Deleted.
(WebCore::RenderGrid::autoPlacementMinorAxisDirection): Deleted.
(WebCore::RenderGrid::populateGridPositions): Deleted.
* rendering/style/GridCoordinate.h:
(WebCore::GridSpan::definiteGridSpan):
(WebCore::GridSpan::indefiniteGridSpan):
(WebCore::GridSpan::operator==):
(WebCore::GridSpan::integerSpan):
(WebCore::GridSpan::resolvedInitialPosition):
(WebCore::GridSpan::resolvedFinalPosition):
(WebCore::GridSpan::begin):
(WebCore::GridSpan::end):
(WebCore::GridSpan::isDefinite):
(WebCore::GridSpan::GridSpan):
(WebCore::GridCoordinate::GridCoordinate):
* rendering/style/GridResolvedPosition.cpp:
(WebCore::initialPositionSide):
(WebCore::finalPositionSide):
(WebCore::adjustGridPositionsFromStyle):
(WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
(WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
(WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
(WebCore::resolveGridPositionAgainstOppositePosition):
(WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
(WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
(WebCore::implicitNamedGridLineForSide): Deleted.
(WebCore::GridResolvedPosition::isNonExistentNamedLineOrArea): Deleted.
(WebCore::resolveNamedGridLinePositionFromStyle): Deleted.
(WebCore::resolveGridPositionFromStyle): Deleted.
* rendering/style/GridResolvedPosition.h:
(WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
(WebCore::GridResolvedPosition::operator*): Deleted.
(WebCore::GridResolvedPosition::operator++): Deleted.
(WebCore::GridResolvedPosition::operator==): Deleted.

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

4 years agoWindow should have its 'constructor' property on the prototype
cdumez@apple.com [Wed, 17 Feb 2016 08:38:27 +0000 (08:38 +0000)]
Window should have its 'constructor' property on the prototype
https://bugs.webkit.org/show_bug.cgi?id=154037
<rdar://problem/24689078>

Reviewed by Gavin Barraclough.

LayoutTests/imported/w3c:

Rebaseline W3C test now that one more check is passing.

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

Source/WebCore:

Window should have its 'constructor' property on the prototype as per
the Web IDL specification:
http://heycam.github.io/webidl/#interface-prototype-object

Firefox and Chrome already match the specification.

No new tests, covered by:
- fast/dom/Window/window-constructor-settable.html
- fast/dom/Window/window-constructor.html
- http/tests/security/cross-origin-window-property-access.html
- imported/w3c/web-platform-tests/html/dom/interfaces.html

* bindings/scripts/CodeGeneratorJS.pm:
(ConstructorShouldBeOnInstance): Deleted.
Drop this routine as all constructors are now on the prototype.

(InstancePropertyCount):
Do not account for constructor properties as these can only be
on the prototype now.

(PrototypePropertyCount):
Increment the property count by 1 if the interface has a constructor
property (e.g. [NoInterfaceObject] interfaces do not have one).

(GeneratePropertiesHashTable):
Stop calling ConstructorShouldBeOnInstance() as it no longer exists.
Always generated the "constructor" property if:
1. We are generating the prototype hash table.
and
2. The interface needs a constructor (i.e. not marked as
   [NoInterfaceObject]).

(GenerateImplementation):
- Drop code handling the case where ConstructorShouldBeOnInstance()
  returns true as constructors are not always on the prototype and
  the ConstructorShouldBeOnInstance() routine has been dropped.
- Drop code handling [CustomProxyToJSObject]. Now that the constructor
  is always on the prototype, we never need to cast thisValue to a
  JSDOMWindow (by calling toJSDOMWindow). In the Window case, thisValue
  is now casted to a JSDOMWindowPrototype*, similarly to other interfaces
  so we don't need a special casting function anymore.
- Stop generating security checks. This only impacts Window as it is the
  only interface marked as [CheckSecurity]. The cross-origin checking code
  as it was would not work when "constructor" is on the prototype because
  thisValue is a JSDOMWindowPrototype, not a JSDOMWindow and we have no
  way of getting the wrapped window. Also, the security check is no longer
  needed because:
  1. Accessing crossOriginWindow.constructor will not work now that
     constructor is on the prototype because
     JSDOMWindow::getOwnPropertySlot() already prevents access to the
     prototype in the cross-origin case.
  2. "constructor" is a value property, not a getter/setter. Therefore,
     it is no possible to use the getter/setter from a same origin window
     instance and call it on a cross origin window.

LayoutTests:

* http/tests/security/cross-origin-window-property-access-expected.txt:
* http/tests/security/cross-origin-window-property-access.html:
Add checks to make sure it still is not possible to access
window.constructor cross-origin.

* js/getOwnPropertyDescriptor-window-attributes-expected.txt:
* js/getOwnPropertyDescriptor-window-attributes.html:
Update test now that window has it's "constructor" attribute
on the prototype.

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

4 years agoREGRESSION (r196620): Web Inspector: Selecting last message in the console makes...
nvasilyev@apple.com [Wed, 17 Feb 2016 07:18:34 +0000 (07:18 +0000)]
REGRESSION (r196620): Web Inspector: Selecting last message in the console makes the scrollbar visible
https://bugs.webkit.org/show_bug.cgi?id=154326
<rdar://problem/24692717>

Reviewed by Timothy Hatcher.

* UserInterface/Views/LogContentView.css:
(.console-item.selected::after):
Make sure the selected message marker (blue vertical line) doesn't
go over the content view.

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

4 years agoAdd a way to test ScrollAnimator
carlosgc@webkit.org [Wed, 17 Feb 2016 07:16:40 +0000 (07:16 +0000)]
Add a way to test ScrollAnimator
https://bugs.webkit.org/show_bug.cgi?id=153479

Reviewed by Michael Catanzaro.

Source/WebCore:

Tests: fast/scrolling/overlay-scrollbars-scroll-corner.html
       fast/scrolling/scroll-animator-basic-events.html
       fast/scrolling/scroll-animator-overlay-scrollbars-hovered.html
       fast/scrolling/scroll-animator-select-list-events.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/FrameView.cpp:
(WebCore::FrameView::usesMockScrollAnimator):
(WebCore::FrameView::logMockScrollAnimatorMessage):
* page/FrameView.h:
* page/Settings.cpp:
(WebCore::Settings::setUsesMockScrollAnimator):
(WebCore::Settings::usesMockScrollAnimator):
* page/Settings.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::scrollAnimator):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::usesMockScrollAnimator):
(WebCore::ScrollableArea::logMockScrollAnimatorMessage):
* platform/mock/ScrollAnimatorMock.cpp: Added.
(WebCore::ScrollAnimatorMock::create):
(WebCore::ScrollAnimatorMock::ScrollAnimatorMock):
(WebCore::ScrollAnimatorMock::~ScrollAnimatorMock):
(WebCore::ScrollAnimatorMock::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorMock::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorMock::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorMock::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorMock::mouseEnteredContentArea):
(WebCore::ScrollAnimatorMock::mouseMovedInContentArea):
(WebCore::ScrollAnimatorMock::mouseExitedContentArea):
(WebCore::ScrollAnimatorMock::mouseEnteredScrollbar):
(WebCore::ScrollAnimatorMock::mouseExitedScrollbar):
(WebCore::ScrollAnimatorMock::mouseIsDownInScrollbar):
* platform/mock/ScrollAnimatorMock.h: Added.
* platform/mock/ScrollbarThemeMock.cpp:
(WebCore::ScrollbarThemeMock::usesOverlayScrollbars):
* platform/mock/ScrollbarThemeMock.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::usesMockScrollAnimator):
(WebCore::RenderLayer::logMockScrollAnimatorMessage):
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::usesMockScrollAnimator):
(WebCore::RenderListBox::logMockScrollAnimatorMessage):
* rendering/RenderListBox.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setUsesMockScrollAnimator):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* compositing/overflow/overflow-scrollbar-layer-positions-expected.txt:
* fast/scrolling/overlay-scrollbars-scroll-corner-expected.html: Added.
* fast/scrolling/overlay-scrollbars-scroll-corner.html: Added.
* fast/scrolling/scroll-animator-basic-events-expected.txt: Added.
* fast/scrolling/scroll-animator-basic-events.html: Added.
* fast/scrolling/scroll-animator-overlay-scrollbars-hovered-expected.txt: Added.
* fast/scrolling/scroll-animator-overlay-scrollbars-hovered.html: Added.
* fast/scrolling/scroll-animator-select-list-events-expected.txt: Added.
* fast/scrolling/scroll-animator-select-list-events.html: Added.
* fast/scrolling/scrollbar-tickmarks-hittest.html:
* platform/mac-wk1/TestExpectations:
* platform/mac-wk1/fast/scrolling/scroll-animator-basic-events-expected.txt: Added.
* platform/mac-wk1/fast/scrolling/scroll-animator-select-list-events-expected.txt: Added.

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

4 years agoUnreviewed. Enable overlay scrollbars in GTK+ after r196641.
carlosgc@webkit.org [Wed, 17 Feb 2016 06:54:03 +0000 (06:54 +0000)]
Unreviewed. Enable overlay scrollbars in GTK+ after r196641.

This was blocked by bug #153404, but the commit that introduced
the regression was rolled out in r196641.

* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):

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

4 years agoFTL_USES_B3 should be unconditionally true
fpizlo@apple.com [Wed, 17 Feb 2016 06:13:24 +0000 (06:13 +0000)]
FTL_USES_B3 should be unconditionally true
https://bugs.webkit.org/show_bug.cgi?id=154324

Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

* dfg/DFGCommon.h:

Source/WTF:

* wtf/Platform.h:

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

4 years agoFTL should support CompareEq(String:, String:)
fpizlo@apple.com [Wed, 17 Feb 2016 05:29:34 +0000 (05:29 +0000)]
FTL should support CompareEq(String:, String:)
https://bugs.webkit.org/show_bug.cgi?id=154269
rdar://problem/24499921

Reviewed by Benjamin Poulain.

Looks like a slight pdfjs slow-down, probably because we're having some recompilations. I
think we should land the increased coverage first and fix the issues after, especially since
the regression is so small and doesn't have a statistically significant effect on the overall
score.

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileCompareEq):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCompareStrictEq):
(JSC::FTL::DFG::LowerDFGToLLVM::nonSpeculativeCompare):
(JSC::FTL::DFG::LowerDFGToLLVM::stringsEqual):
* tests/stress/ftl-string-equality.js: Added.
* tests/stress/ftl-string-ident-equality.js: Added.
* tests/stress/ftl-string-strict-equality.js: Added.

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

4 years agoFTL should support NewTypedArray
fpizlo@apple.com [Wed, 17 Feb 2016 04:25:57 +0000 (04:25 +0000)]
FTL should support NewTypedArray
https://bugs.webkit.org/show_bug.cgi?id=154268

Reviewed by Saam Barati.

3% speed-up on pdfjs. This was already covered by many different tests.

Rolling this back in after fixing the butterfly argument.

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNewArrayWithSize):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNewTypedArray):
(JSC::FTL::DFG::LowerDFGToLLVM::compileAllocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToLLVM::allocateBasicStorageAndGetEnd):
(JSC::FTL::DFG::LowerDFGToLLVM::allocateBasicStorage):
(JSC::FTL::DFG::LowerDFGToLLVM::allocateObject):

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

4 years agoAllow double tap to zoom in fast-click pages
dino@apple.com [Wed, 17 Feb 2016 03:27:05 +0000 (03:27 +0000)]
Allow double tap to zoom in fast-click pages
https://bugs.webkit.org/show_bug.cgi?id=154318
<rdar://problem/24223767>

Reviewed by Simon Fraser and Benjamin Poulain.

Most of the patch comes from Jon Lee.

Our fast-click algorithm exposed a number of cases where
people missed the double-tap-to-zoom behaviour. In particular,
when you double tap on a large body of text, typical in
blogs and articles.

This patch enhances the algorithm to have a parallel
double-tap gesture recognizer in the situations where
fast-click is enabled. This new gesture recongizer does
not cause the single tap to block for 350ms, so clicks
are still dispatched fast. If it fires, we already have
some information about whether we have a pending double
tap, based on the first tap.

* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::disableDoubleTapGesturesDuringTapIfNecessary): Remove the optimization
that only told the content view to disable on pages that allowed double taps. We now allow
them even on fast click pages.

* UIProcess/ios/WKContentViewInteraction.h: Add the new UITapGestureRecognizer for double taps
in fast click pages. This is called nonBlockingDoubleTapGestureRecognizer because, unlike
the existing DoubleTapGestureRecognizer, this one does not force the singleTapRecognizer
to wait.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]): Set up the new UITapGestureRecognizer.
(-[WKContentView cleanupInteraction]): And remove it when we're done.
(-[WKContentView _removeDefaultGestureRecognizers]): Ditto.
(-[WKContentView _addDefaultGestureRecognizers]):
(-[WKContentView _inspectorNodeSearchRecognized:]): Something happened, we are no longer in
a potential double tap situation.
(-[WKContentView _disableDoubleTapGesturesDuringTapIfNecessary:]): Remove the check
for potential tap in progress.
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _highlightLongPressRecognized:]): Again, something happened, so we are
no longer in a double tap situation.
(-[WKContentView _longPressRecognized:]): Ditto.
(-[WKContentView _singleTapRecognized:]): Ditto.
(-[WKContentView _doubleTapRecognized:]): Ditto.
(-[WKContentView _resetIsDoubleTapPending]):
(-[WKContentView _fastDoubleTapRecognized:]): We're now pending a double tap.
(-[WKContentView _twoFingerDoubleTapRecognized:]):
(-[WKContentView _didNotHandleTapAsClick:]): If we get here and we have a pending
double tap, then trigger a zoom operation.
(-[WKContentView _setDoubleTapGesturesEnabled:]):

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

4 years agoJSDOMWindow::getOwnPropertySlot should just call getStaticPropertySlot
cdumez@apple.com [Wed, 17 Feb 2016 02:34:36 +0000 (02:34 +0000)]
JSDOMWindow::getOwnPropertySlot should just call getStaticPropertySlot
https://bugs.webkit.org/show_bug.cgi?id=154257

Patch by Gavin Barraclough <barraclough@apple.com> on 2016-02-16
Reviewed by Chris Dumez.

Source/JavaScriptCore:

* runtime/Lookup.h:
(JSC::getStaticPropertySlot):
(JSC::getStaticFunctionSlot):
(JSC::getStaticValueSlot):
    - this could all do with a little more love.
      But enforce the basic precedence:
        (1) regular storage properties always win over static table properties.
        (2) if properties have been reified, don't consult the static tables.
        (3) only if the property is not present on the object & not reified
            should the static hashtable be consulted.

Source/WebCore:

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
    - JSDOMWindow::getOwnPropertySlot should just call getStaticPropertySlot

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

4 years agoJSDOMWindow::getOwnPropertySlot should not search photo chain
barraclough@apple.com [Wed, 17 Feb 2016 01:37:56 +0000 (01:37 +0000)]
JSDOMWindow::getOwnPropertySlot should not search photo chain
https://bugs.webkit.org/show_bug.cgi?id=154102

Reviewed by Chris Dumez.

Should only return *own* properties.

Source/JavaScriptCore:

* runtime/JSObject.cpp:
(JSC::JSObject::getOwnPropertyDescriptor):
    - remove hack/special-case for DOMWindow; we no longer need this.

Source/WebCore:

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotNamedItemGetter):

LayoutTests:

* fast/dom/Window/es52-globals-expected.txt:
* http/tests/security/window-named-valueOf-expected.txt:
* imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:
    - update test results.

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

4 years agoSpread operator should be allowed when not the first argument of parameter list
keith_miller@apple.com [Wed, 17 Feb 2016 01:29:37 +0000 (01:29 +0000)]
Spread operator should be allowed when not the first argument of parameter list
https://bugs.webkit.org/show_bug.cgi?id=152721

Reviewed by Saam Barati.

Source/JavaScriptCore:

Spread arguments to functions should now be ES6 compliant. Before we
would only take a spread operator if it was the sole argument to a
function. Additionally, we would not use the Symbol.iterator on the
object to generate the arguments. Instead we would do a loop up to the
length mapping indexed properties to the corresponding argument. We fix
both these issues by doing an AST transformation from foo(...a, b, ...c, d)
to foo(...[...a, b, ...c, d]) (where the spread on the rhs uses the
old spread semantics). This solution has the downside of requiring the
allocation of another object and copying each element twice but avoids a
large change to the vm calling convention.

* interpreter/Interpreter.cpp:
(JSC::loadVarargs):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createElementList):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseArguments):
(JSC::Parser<LexerType>::parseArgument):
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/Parser.h:
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createElementList):
* tests/es6.yaml:
* tests/stress/spread-calling.js: Added.
(testFunction):
(testEmpty):
(makeObject):
(otherIterator.return.next):
(otherIterator):
(totalIter):
(throwingIter.return.next):
(throwingIter):
(i.catch):

LayoutTests:

Update tests with new semantics of spread calling.

* js/basic-spread-expected.txt:
* js/parser-syntax-check-expected.txt:
* js/script-tests/basic-spread.js:
* js/script-tests/parser-syntax-check.js:

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

4 years agoCMake build fix.
achristensen@apple.com [Wed, 17 Feb 2016 01:14:13 +0000 (01:14 +0000)]
CMake build fix.

* PlatformMac.cmake:

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

4 years agoNavigator.geolocation should not be marked a [Replaceable] and should be on the prototype
cdumez@apple.com [Wed, 17 Feb 2016 01:11:29 +0000 (01:11 +0000)]
Navigator.geolocation should not be marked a [Replaceable] and should be on the prototype
https://bugs.webkit.org/show_bug.cgi?id=154304
<rdar://problem/24685092>

Reviewed by Gavin Barraclough.

LayoutTests/imported/w3c:

Rebaseline test now that more checks are passing.

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

Source/WebCore:

1. Drop the [Replaceable] IDL extended attribute for navigator.geolocation
   as this does not match other browsers or the specification:
   - https://dev.w3.org/geo/api/spec-source.html#geolocation_interface
2. Move Navigator attributes to the prototype, where they should be as
   per the Web IDL specification.

The previous behavior was meant as a workaround for a bug in the Amazon
iOS app (rdar://problem/16332749). However, I have confirmed that the
latest Amazon App no longer has any issue with those changes.

Test: js/navigator-set-geolocation.html

* Modules/geolocation/NavigatorGeolocation.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(InterfaceRequiresAttributesOnInstanceForCompatibility): Deleted.

LayoutTests:

* fast/dom/Geolocation/enabled-expected.txt:
* fast/dom/Geolocation/script-tests/enabled.js:
* js/dom/delete-syntax-expected.txt:
* js/dom/script-tests/delete-syntax.js:
Update tests as they expected the navigator properties to be on the
instance rather than the prototype.

* js/dom/script-tests/shadow-navigator-geolocation-in-strict-mode-does-not-throw.js: Removed.
* js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt: Removed.
* js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw.html: Removed.
Drop outdated test.

* js/navigator-set-geolocation-expected.txt: Added.
* js/navigator-set-geolocation.html: Added.
Add test to make sure that Navigator.geolocation cannot be set. I verified that
this test passes in both Firefox and Chrome.

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

4 years ago[JSC] Enable B3 on ARM64
commit-queue@webkit.org [Wed, 17 Feb 2016 00:45:51 +0000 (00:45 +0000)]
[JSC] Enable B3 on ARM64
https://bugs.webkit.org/show_bug.cgi?id=154275

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

The port passes more tests than LLVM now, let's use it by default.

* dfg/DFGCommon.h:

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

4 years agoUse NSURLCredential from serverTrust when evaluating server trust AuthenticationChall...
achristensen@apple.com [Wed, 17 Feb 2016 00:30:39 +0000 (00:30 +0000)]
Use NSURLCredential from serverTrust when evaluating server trust AuthenticationChallenges with NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=154316

Reviewed by Brady Eidson.

This fixes http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame.html
and many other layout tests that use https because it allows https connections with servers
with self-signed certificates when TestController::canAuthenticateAgainstProtectionSpace in
WebKitTestRunner says it's OK, or when any other WKPageNavigationClient says it's ok.

* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::serverTrustCredential):

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

4 years agoREGRESSION(r196268): WTFCrashWithSecurityImplication on SVG path animation tests
said@apple.com [Wed, 17 Feb 2016 00:00:54 +0000 (00:00 +0000)]
REGRESSION(r196268): WTFCrashWithSecurityImplication on SVG path animation tests
https://bugs.webkit.org/show_bug.cgi?id=154221

Reviewed by Brent Fulgham.

In r196268, a destructor was added to SVGListPropertyTearOff that notifies
its wrapper (the SVGAnimatedListPropertyTearoff) about its deletion. This
allows the wrapper to nullify any references to the wrapped content.

We needed to do the same thing for SVGPathSegListPropertyTearOff. Both
SVGPathSegListPropertyTearOff and SVGListPropertyTearOff inherit from
SVGListProperty and both hold pointers to SVGAnimatedListPropertyTearOff
which needs to be notified.

Tests: exiting svg path animation tests should not crash.

* svg/properties/SVGPathSegListPropertyTearOff.h:
(WebCore::SVGPathSegListPropertyTearOff::~SVGPathSegListPropertyTearOff):

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

4 years agoREGRESSION (r190430): WTFCrashWithSecurityImplication in:void SVGRootInlineBox::layou...
said@apple.com [Tue, 16 Feb 2016 23:59:25 +0000 (23:59 +0000)]
REGRESSION (r190430): WTFCrashWithSecurityImplication in:void SVGRootInlineBox::layoutCharactersInTextBoxes()
https://bugs.webkit.org/show_bug.cgi?id=154185

Reviewed by Ryosuke Niwa.
Source/WebCore:

This is a regression caused by adding support for HTMLSlotElement. The
crash happens when adding an HTMLSlotElement to anther element which should
not have it as a child like SVGTextElement for example. In this case, we
were creating a RenderText which should not be happen inside an SVG document.
The RenderText::createTextBox() was creating InlineTextBox for the slot's
text and attach it to the SVGRootInlineBox. In layoutCharactersInTextBoxes(),
the assumption is the inline box is either SVGInlineTextBox or SVGInlineFlowBox.
But since we have an InlineTextBox instead, the crash happens when casting
the InlineTextBox to SVGInlineFlowBox.

The fix is for createRenderTreeForSlotAssignees() to not create a renderer
when the parent element should not have a renderer for the this element.
This is the same thing we do for createRenderer() which handles the non
HTMLSlotElement case and which is called also from createRenderTreeRecursively().

Test: fast/shadow-dom/text-slot-child-crash.svg

* style/StyleTreeResolver.cpp:
(WebCore::Style::moveToFlowThreadIfNeeded):
(WebCore::Style::TreeResolver::createRenderer): Delete the check for
shouldCreateRenderer() and handling the case when resolvedStyle is null
since these are handled by the caller createRenderTreeRecursively().

(WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees):
Assert shouldCreateRenderer() is true for this element.

(WebCore::Style::TreeResolver::createRenderTreeRecursively): Don't create
the renderer if shouldCreateRenderer() returns false. Also handle the case
when resolvedStyle is null and pass the new style to createRenderer().

* style/StyleTreeResolver.h:

LayoutTests:

Ensure that adding an HTMLSlotElement with text to an SVGTextElement will
not create a renderer and we won't crash.

* fast/shadow-dom/text-slot-child-crash-expected.txt: Added.
* fast/shadow-dom/text-slot-child-crash.svg: Added.

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

4 years agoUnreviewed, rolling out r196652.
commit-queue@webkit.org [Tue, 16 Feb 2016 23:47:06 +0000 (23:47 +0000)]
Unreviewed, rolling out r196652.
https://bugs.webkit.org/show_bug.cgi?id=154315

This change caused LayoutTest crashes (Requested by ryanhaddad
on #webkit).

Reverted changeset:

"FTL should support NewTypedArray"
https://bugs.webkit.org/show_bug.cgi?id=154268
http://trac.webkit.org/changeset/196652

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

4 years agoRemoteInspector should forward new automation session requests to its client
bburg@apple.com [Tue, 16 Feb 2016 23:45:27 +0000 (23:45 +0000)]
RemoteInspector should forward new automation session requests to its client
https://bugs.webkit.org/show_bug.cgi?id=154260
<rdar://problem/24663313>

Reviewed by Timothy Hatcher.

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::xpcConnectionReceivedMessage):
(Inspector::RemoteInspector::listingForAutomationTarget):
Use the correct key for the session identifier in the listing. The name()
override for RemoteAutomationTarget is actually the session identifier.

(Inspector::RemoteInspector::receivedAutomationSessionRequestMessage):
* inspector/remote/RemoteInspectorConstants.h: Add new constants.

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

4 years agoEvery RenderLayer should not have to remove itself from the scrollableArea set
simon.fraser@apple.com [Tue, 16 Feb 2016 23:24:14 +0000 (23:24 +0000)]
Every RenderLayer should not have to remove itself from the scrollableArea set
https://bugs.webkit.org/show_bug.cgi?id=154311

Reviewed by Zalan Bujtas.

A subset of RenderLayers are are scrollable, and get registered on the FrameView,
but we pay the cost of a hash lookup for removal on every RenderLayer, which is a waste.

Store a bit that tells RenderLayer that it's in the set and needs to be removed.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:

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

4 years agoAdd tests for iframe and overflow scrollability after navigating back
simon.fraser@apple.com [Tue, 16 Feb 2016 23:24:11 +0000 (23:24 +0000)]
Add tests for iframe and overflow scrollability after navigating back
https://bugs.webkit.org/show_bug.cgi?id=154300

Reviewed by Brent Fulgham.

Test that sends mousewheel events to overflow and iframe, before and after navigating
forward then back.

These tests detect the regression caused by r188659.

* fast/scrolling/iframe-scrollable-after-back-expected.txt: Added.
* fast/scrolling/iframe-scrollable-after-back.html: Added.
* fast/scrolling/overflow-scrollable-after-back-expected.txt: Added.
* fast/scrolling/overflow-scrollable-after-back.html: Added.
* fast/scrolling/resources/scroll-notifying-page.html: Added.
* platform/ios-simulator/TestExpectations: Skip on iOS.

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

4 years agoCSP: Update violation report 'Content-Type' header
dbates@webkit.org [Tue, 16 Feb 2016 23:22:19 +0000 (23:22 +0000)]
CSP: Update violation report 'Content-Type' header
https://bugs.webkit.org/show_bug.cgi?id=153166
<rdar://problem/24383327>

Reviewed by Brent Fulgham.

Source/WebCore:

Inspired by Blink patch:
<https://src.chromium.org/viewvc/blink?view=rev&revision=154215>

Post the Content Security Policy violation report with Content-Type application/csp-report as
per section Reporting of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.

Currently we post CSP violation reports with Content-Type application/json.

* html/parser/XSSAuditorDelegate.cpp:
(WebCore::XSSAuditorDelegate::didBlockScript): Use report type ViolationReportType::XSSAuditor to PingLoader.
* loader/PingLoader.cpp:
(WebCore::PingLoader::sendViolationReport): Modified to take argument of type ViolationReportType
to determine the appropriate Content-Type header to use for the report. For a XSS Auditor violation report
we use Content-Type application/json. For a Content Security Policy violation report we use Content-Type
application/csp-report. Additionally, pass a ASCIILiteral() to ResourceRequestBase::setHTTPMethod()
as opposed to a constant string literal to avoid a copy of a constant string literal.
* loader/PingLoader.h: Add enum class ViolationReportType.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation): Use report type ViolationReportType::ContentSecurityPolicy.

LayoutTests:

Update expected results now that we post the Content Security Policy violation report with
Content-Type application/csp-report.

* TestExpectations: Update associated bugs for entries that still fail.
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-from-child-frame-expected.txt: Fix up HTTP_REFERER and csp-report
to reflect the correct value for HTTP_REFERER and the correct values for the report-uri and document-uri keys in the CSP
report JSON object.

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

4 years agoExtract the code specific to v2 UI out of shared statistics.js
rniwa@webkit.org [Tue, 16 Feb 2016 23:16:25 +0000 (23:16 +0000)]
Extract the code specific to v2 UI out of shared statistics.js
https://bugs.webkit.org/show_bug.cgi?id=154277

Reviewed by Chris Dumez.

Extracted statistics-strategies.js out of statistics.js for v2 UI and detect-changes.js. The intent is to
deprecate this file once we implement refined statistics tools in v3 UI and adopt it in detect-changes.js.

* public/shared/statistics.js:
(Statistics.movingAverage): Extracted from the "Simple Moving Average" strategy.
(Statistics.cumultaiveMovingAverage): Extracted from the "Cumulative Moving Average" strategy.
(Statistics.exponentialMovingAverage): Extracted from the "Exponential Moving Average" strategy.
Use a temporary "movingAverage" to keep the last moving average instead of relying on the previous
entry in "averages" array to avoid special casing an array of length 1 and starting the loop at i = 1.
(Statistics.segmentTimeSeriesGreedyWithStudentsTTest): Extracted from "Segmentation: Recursive t-test"
strategy. Don't create the list of averages to match segmentTimeSeriesByMaximizingSchwarzCriterion here.
It's done in newly added averagesFromSegments.
(Statistics.segmentTimeSeriesByMaximizingSchwarzCriterion): Extracted from
"Segmentation: Schwarz criterion" strategy.
(.recursivelySplitIntoTwoSegmentsAtMaxTIfSignificantlyDifferent): Just store the start index to match
* public/v2/app.js:
(App.Pane.updateStatisticsTools):
(App.Pane._computeMovingAverageAndOutliers):
* public/v2/data.js:
* public/v2/index.html:
* public/v2/statistics-strategies.js: Added.
(StatisticsStrategies.MovingAverageStrategies): Added.
(averagesFromSegments): Extracted from "Segmentation: Schwarz criterion" strategy. Now used by both
"Segmentation: Recursive t-test" and "Segmentation: Schwarz criterion" strategies.
(StatisticsStrategies.EnvelopingStrategies): Moved from Statistics.EnvelopingStrategies.
(StatisticsStrategies.TestRangeSelectionStrategies): Moved from Statistics.TestRangeSelectionStrategies.
(createWesternElectricRule): Moved from statistics.js.
(countValuesOnSameSide): Ditto.
(StatisticsStrategies.executeStrategy): Moved from Statistics.executeStrategy.
* tools/detect-changes.js:
(computeRangesForTesting):

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

4 years agoMarking pageoverlay/overlay-installation.html as flaky on ios-simulator
ryanhaddad@apple.com [Tue, 16 Feb 2016 23:13:18 +0000 (23:13 +0000)]
Marking pageoverlay/overlay-installation.html  as flaky on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=153337

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

4 years agoUse pid_t everywhere, instead of PlatformProcessIdentifier
andersca@apple.com [Tue, 16 Feb 2016 22:57:01 +0000 (22:57 +0000)]
Use pid_t everywhere, instead of PlatformProcessIdentifier
https://bugs.webkit.org/show_bug.cgi?id=154306

Reviewed by Sam Weinig.

* Platform/IPC/Connection.h:
* Platform/PlatformProcessIdentifier.h: Removed.
* UIProcess/API/efl/tests/test_ewk2_context.cpp:
(TEST_F):
* UIProcess/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::processIdentifier):
* UIProcess/Launcher/ProcessLauncher.cpp:
(WebKit::ProcessLauncher::didFinishLaunchingProcess):
* UIProcess/Launcher/ProcessLauncher.h:
(WebKit::ProcessLauncher::processIdentifier):
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processIdentifier):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::networkProcessIdentifier):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.h:
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoRemove WebKit2 header cruft
andersca@apple.com [Tue, 16 Feb 2016 22:54:26 +0000 (22:54 +0000)]
Remove WebKit2 header cruft
https://bugs.webkit.org/show_bug.cgi?id=154309

Reviewed by Sam Weinig.

* WebKit2.xcodeproj/project.pbxproj:
* mac/WKError.h: Removed.
* mac/WKPreferences.h: Removed.

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

4 years agoRemove unused environment variable classes
andersca@apple.com [Tue, 16 Feb 2016 22:43:19 +0000 (22:43 +0000)]
Remove unused environment variable classes
https://bugs.webkit.org/show_bug.cgi?id=154308

Reviewed by Tim Horton.

* UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.h: Removed.
* UIProcess/Launcher/mac/DynamicLinkerEnvironmentExtractor.mm: Removed.
(WebKit::DynamicLinkerEnvironmentExtractor::DynamicLinkerEnvironmentExtractor): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::processEnvironmentVariable): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::processLoadCommand): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::processLoadCommands): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::processSingleArchitecture): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::processFatFile): Deleted.
(WebKit::DynamicLinkerEnvironmentExtractor::getExtractedEnvironmentVariables): Deleted.
* UIProcess/Launcher/mac/EnvironmentVariables.cpp: Removed.
(WebKit::EnvironmentVariables::EnvironmentVariables): Deleted.
(WebKit::EnvironmentVariables::~EnvironmentVariables): Deleted.
(WebKit::EnvironmentVariables::set): Deleted.
(WebKit::EnvironmentVariables::get): Deleted.
(WebKit::EnvironmentVariables::appendValue): Deleted.
(WebKit::EnvironmentVariables::valueIfVariableHasName): Deleted.
(WebKit::EnvironmentVariables::createStringForVariable): Deleted.
(WebKit::EnvironmentVariables::copyEnvironmentVariables): Deleted.
(WebKit::EnvironmentVariables::dump): Deleted.
* UIProcess/Launcher/mac/EnvironmentVariables.h: Removed.
(WebKit::EnvironmentVariables::environmentPointer): Deleted.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoSamplingProfiler still fails with ASan enabled
sbarati@apple.com [Tue, 16 Feb 2016 22:01:37 +0000 (22:01 +0000)]
SamplingProfiler still fails with ASan enabled
https://bugs.webkit.org/show_bug.cgi?id=154301
<rdar://problem/24679502>

Reviewed by Filip Pizlo.

To fix this issue, I've come up with unsafe versions
of all operations that load memory from the thread's call
frame. All these new unsafe methods are marked with SUPPRESS_ASAN.

* interpreter/CallFrame.cpp:
(JSC::CallFrame::callSiteAsRawBits):
(JSC::CallFrame::unsafeCallSiteAsRawBits):
(JSC::CallFrame::callSiteIndex):
(JSC::CallFrame::unsafeCallSiteIndex):
(JSC::CallFrame::stack):
(JSC::CallFrame::callerFrame):
(JSC::CallFrame::unsafeCallerFrame):
(JSC::CallFrame::friendlyFunctionName):
* interpreter/CallFrame.h:
(JSC::ExecState::calleeAsValue):
(JSC::ExecState::callee):
(JSC::ExecState::unsafeCallee):
(JSC::ExecState::codeBlock):
(JSC::ExecState::unsafeCodeBlock):
(JSC::ExecState::scope):
(JSC::ExecState::callerFrame):
(JSC::ExecState::callerFrameOrVMEntryFrame):
(JSC::ExecState::unsafeCallerFrameOrVMEntryFrame):
(JSC::ExecState::callerFrameOffset):
(JSC::ExecState::callerFrameAndPC):
(JSC::ExecState::unsafeCallerFrameAndPC):
* interpreter/Register.h:
(JSC::Register::codeBlock):
(JSC::Register::asanUnsafeCodeBlock):
(JSC::Register::unboxedInt32):
(JSC::Register::tag):
(JSC::Register::unsafeTag):
(JSC::Register::payload):
* interpreter/VMEntryRecord.h:
(JSC::VMEntryRecord::prevTopCallFrame):
(JSC::VMEntryRecord::unsafePrevTopCallFrame):
(JSC::VMEntryRecord::prevTopVMEntryFrame):
(JSC::VMEntryRecord::unsafePrevTopVMEntryFrame):
* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::walk):
(JSC::FrameWalker::advanceToParentFrame):
(JSC::FrameWalker::isAtTop):
(JSC::FrameWalker::resetAtMachineFrame):

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

4 years agoRebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html for ios-simulator...
ryanhaddad@apple.com [Tue, 16 Feb 2016 21:42:26 +0000 (21:42 +0000)]
Rebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html for ios-simulator after r196648

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:

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

4 years agoAdd checks before redirecting with NetworkSession
achristensen@apple.com [Tue, 16 Feb 2016 21:25:30 +0000 (21:25 +0000)]
Add checks before redirecting with NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=154298

Reviewed by Andy Estes.

Source/WebCore:

This fixes http/tests/security/cors-post-redirect-307.html and
http/tests/navigation/post-307-response.html when using NetworkSession.

* platform/network/ResourceRequestBase.h:
WEBCORE_EXPORT some functions newly used in WebKit2.

Source/WebKit2:

* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::create):
(WebKit::NetworkDataTask::setPendingDownload):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTask::NetworkDataTask):
(WebKit::NetworkDataTask::~NetworkDataTask):
(WebKit::NetworkDataTask::willPerformHTTPRedirection):
Implemented based on ResourceHandle::willSendRequest but with two notable exceptions:
1. When using NSURLConnection, the last http method and the current http method are not always equal, and this
check needs to change the current http method to match the last http method when being redirected with an http
status code 307.  When using NSURLSession, the current http method is already updated properly.
2. I did not copy the part of ResourceHandle::willSendRequest that uses a CredentialStorage.  I'm trying to avoid
using CredentialStorages with NSURLSession.
(WebKit::NetworkDataTask::scheduleFailure):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):

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

4 years agoCSP: Fix parsing of 'host/path' source expressions
dbates@webkit.org [Tue, 16 Feb 2016 21:18:19 +0000 (21:18 +0000)]
CSP: Fix parsing of 'host/path' source expressions
https://bugs.webkit.org/show_bug.cgi?id=153170
<rdar://problem/24383407>

Reviewed by Brent Fulgham.

Source/WebCore:

Merged from Blink (patch by Mike West):
<https://src.chromium.org/viewvc/blink?revision=154875&view=revision>

Fixes an issue where a source of the form example.com/A/ was incorrectly considered
invalid and hence such a requested resource would be blocked. A source of this form
is valid by the definition of host-source in section Source List Syntax of the Content
Security Policy 2.0 spec., <http://www.w3.org/TR/2015/CR-CSP2-20150721/>.

* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::parseSource):

LayoutTests:

Remove entry for test http/tests/security/contentSecurityPolicy/source-list-parsing-paths-03.html
as it now passes.

* TestExpectations:

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

4 years agoJSContext Inspector: Support for inline source maps
commit-queue@webkit.org [Tue, 16 Feb 2016 21:17:31 +0000 (21:17 +0000)]
JSContext Inspector: Support for inline source maps
https://bugs.webkit.org/show_bug.cgi?id=154303
<rdar://problem/24670392>

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

Source/WebInspectorUI:

* UserInterface/Base/URLUtilities.js:
(parseDataURL):
Break a data URL into components.

* UserInterface/Controllers/SourceMapManager.js:
(WebInspector.SourceMapManager.prototype._loadAndParseSourceMap):
Handle a data URL without using NetworkAgent. Also move references
to a main frame after checking for NetworkAgent.

* UserInterface/Models/SourceMap.js:
(WebInspector.SourceMap.prototype.get sourceMappingBasePathURLComponents):
* UserInterface/Models/SourceMapResource.js:
(WebInspector.SourceMapResource.prototype.get sourceMapDisplaySubpath):
Handle JavaScript debuggable script URLs which may not be complete URLs.

(WebInspector.SourceMapResource.prototype.requestContentFromBackend):
Also handle if NetworkAgent does not exist.

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
When connected to a JavaScript debuggable we were hiding disclosure
triangles as we did not expect resources to have subresources. If
a SourceMap is added, show them again.

LayoutTests:

* inspector/unit-tests/url-utilities-expected.txt: Added.
* inspector/unit-tests/url-utilities.html: Added.

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

4 years agoCSP: Disallow an empty host in a host-source source expression
dbates@webkit.org [Tue, 16 Feb 2016 21:16:18 +0000 (21:16 +0000)]
CSP: Disallow an empty host in a host-source source expression
https://bugs.webkit.org/show_bug.cgi?id=153168
<rdar://problem/24383366>

Reviewed by Brent Fulgham.

Source/WebCore:

Merged from Blink (patch by rob@robwu.nl):
<https://src.chromium.org/viewvc/blink?revision=180407&view=revision>

* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::parseSource):

LayoutTests:

Remove entry for test http/tests/security/contentSecurityPolicy/source-list-parsing-07.html
as it now passes.

* TestExpectations:

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

4 years agoFTL should support NewTypedArray
fpizlo@apple.com [Tue, 16 Feb 2016 21:12:04 +0000 (21:12 +0000)]
FTL should support NewTypedArray
https://bugs.webkit.org/show_bug.cgi?id=154268

Reviewed by Saam Barati.

3% speed-up on pdfjs. This was already covered by many different tests.

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNewArrayWithSize):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNewTypedArray):
(JSC::FTL::DFG::LowerDFGToLLVM::compileAllocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToLLVM::allocateBasicStorageAndGetEnd):
(JSC::FTL::DFG::LowerDFGToLLVM::allocateBasicStorage):
(JSC::FTL::DFG::LowerDFGToLLVM::allocateObject):

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

4 years agoModern IDB: WK2 IPC Scaffolding.
beidson@apple.com [Tue, 16 Feb 2016 20:58:56 +0000 (20:58 +0000)]
Modern IDB: WK2 IPC Scaffolding.
https://bugs.webkit.org/show_bug.cgi?id=154296

Reviewed by Alex Christensen.

No change in behavior yet; Just laying the groundwork.

Source/WebCore:

* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/shared/IDBResourceIdentifier.h:

Source/WebKit2:

* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:

* DatabaseProcess/DatabaseToWebProcessConnection.cpp:
(WebKit::DatabaseToWebProcessConnection::establishIDBConnectionToServer):
(WebKit::DatabaseToWebProcessConnection::removeIDBConnectionToServer):
* DatabaseProcess/DatabaseToWebProcessConnection.h:
* DatabaseProcess/DatabaseToWebProcessConnection.messages.in:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp: Added.
(WebKit::WebIDBConnectionToClient::create):
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::~WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::disconnectedFromWebProcess):
(WebKit::WebIDBConnectionToClient::messageSenderConnection):
(WebKit::WebIDBConnectionToClient::connectionToClient):
(WebKit::WebIDBConnectionToClient::didDeleteDatabase):
(WebKit::WebIDBConnectionToClient::didOpenDatabase):
(WebKit::WebIDBConnectionToClient::didAbortTransaction):
(WebKit::WebIDBConnectionToClient::didCommitTransaction):
(WebKit::WebIDBConnectionToClient::didCreateObjectStore):
(WebKit::WebIDBConnectionToClient::didDeleteObjectStore):
(WebKit::WebIDBConnectionToClient::didClearObjectStore):
(WebKit::WebIDBConnectionToClient::didCreateIndex):
(WebKit::WebIDBConnectionToClient::didDeleteIndex):
(WebKit::WebIDBConnectionToClient::didPutOrAdd):
(WebKit::WebIDBConnectionToClient::didGetRecord):
(WebKit::WebIDBConnectionToClient::didGetCount):
(WebKit::WebIDBConnectionToClient::didDeleteRecord):
(WebKit::WebIDBConnectionToClient::didOpenCursor):
(WebKit::WebIDBConnectionToClient::didIterateCursor):
(WebKit::WebIDBConnectionToClient::fireVersionChangeEvent):
(WebKit::WebIDBConnectionToClient::didStartTransaction):
(WebKit::WebIDBConnectionToClient::notifyOpenDBRequestBlocked):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h: Added.

* Platform/Logging.h:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp: Added.
(WebKit::generateConnectionToServerIdentifier):
(WebKit::WebIDBConnectionToServer::create):
(WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::~WebIDBConnectionToServer):
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
(WebKit::WebIDBConnectionToServer::coreConnectionToServer):
(WebKit::WebIDBConnectionToServer::deleteDatabase):
(WebKit::WebIDBConnectionToServer::openDatabase):
(WebKit::WebIDBConnectionToServer::abortTransaction):
(WebKit::WebIDBConnectionToServer::commitTransaction):
(WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
(WebKit::WebIDBConnectionToServer::createObjectStore):
(WebKit::WebIDBConnectionToServer::deleteObjectStore):
(WebKit::WebIDBConnectionToServer::clearObjectStore):
(WebKit::WebIDBConnectionToServer::createIndex):
(WebKit::WebIDBConnectionToServer::deleteIndex):
(WebKit::WebIDBConnectionToServer::putOrAdd):
(WebKit::WebIDBConnectionToServer::getRecord):
(WebKit::WebIDBConnectionToServer::getCount):
(WebKit::WebIDBConnectionToServer::deleteRecord):
(WebKit::WebIDBConnectionToServer::openCursor):
(WebKit::WebIDBConnectionToServer::iterateCursor):
(WebKit::WebIDBConnectionToServer::establishTransaction):
(WebKit::WebIDBConnectionToServer::databaseConnectionClosed):
(WebKit::WebIDBConnectionToServer::abortOpenAndUpgradeNeeded):
(WebKit::WebIDBConnectionToServer::didFireVersionChangeEvent):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h: Added.

* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
* WebProcess/Databases/WebDatabaseProvider.h:

* WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
(WebKit::WebToDatabaseProcessConnection::idbConnectionToServerForSession):
* WebProcess/Databases/WebToDatabaseProcessConnection.h:

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

4 years agostress/sampling-profiler-deep-stack.js fails on ARM 32bit
sbarati@apple.com [Tue, 16 Feb 2016 20:50:46 +0000 (20:50 +0000)]
stress/sampling-profiler-deep-stack.js fails on ARM 32bit
https://bugs.webkit.org/show_bug.cgi?id=154255
<rdar://problem/24662996>

Reviewed by Mark Lam.

The bug here wasn't in the implementation of the sampling profiler
itself. Rather, it was a bug in the test. JSC wasn't spending a lot
of time in a function that the test assumed a lot of time was spent in.
That's because the DFG was doing a good job at optimizing the function
at the leaf of the recursion. Because of that, we often wouldn't sample it.
I fixed this by making the leaf function do more work.

* tests/stress/sampling-profiler-deep-stack.js:
(platformSupportsSamplingProfiler.foo):

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

4 years ago[Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
cdumez@apple.com [Tue, 16 Feb 2016 20:23:02 +0000 (20:23 +0000)]
[Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
https://bugs.webkit.org/show_bug.cgi?id=154120
<rdar://problem/24613231>

Reviewed by Gavin Barraclough.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

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

Source/JavaScriptCore:

Have putEntry() take a thisValue parameter in addition to the base,
instead of relying on PropertySlot::thisValue() because this did not
always do the right thing. In particular, when JSDOMWindow::put() was
called to set a function, it would end up setting the new value on the
JSDOMWindowShell instead of the actual JSDOMWindow.
JSDOMWindow::getOwnPropertySlot() would then not be able to find it.
Therefore the following would fail:
$ window.open = "test"
$ console.log(window.open) // prints the native function instead of "test"

* runtime/JSObject.cpp:
(JSC::JSObject::putInlineSlow):
* runtime/Lookup.h:
(JSC::putEntry):
(JSC::lookupPut):

Source/WebCore:

Operations should be on the instance for global objects or if
[Unforgeable] as per the Web IDL specification:
- http://heycam.github.io/webidl/#es-operations
- http://heycam.github.io/webidl/#dfn-unforgeable-on-an-interface

This patch implements this behavior in order to align
with the specification and other browsers.

No new tests, already covered by existing tests.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
Update function names now that they have "Instance" in their
name instead of "Prototype".

(WebCore::JSDOMWindow::getOwnPropertySlot):
- Update function names now that they have "Instance" in their
  name instead of "Prototype".
- Move the functions hard-coding *before* the static table check
  now that these functions are in the static table to maintain
  the previous behavior.

* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertySlotDelegate):
Update function names now that they have "Instance" in their
name instead of "Prototype".

* bindings/scripts/CodeGeneratorJS.pm:
- Move functions to the instance if their interface is a global
  object or if they are marked as [Unforgeable]. Operations are
  now treated more like attributes, as they can now be either on
  the instance or the prototype. In a lot of places, I now use
  the naming "properties" instead of "attributes" as "properties"
  refer both "attributes" and "operations" / "functions".

* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
Rebaseline bindings tests.

LayoutTests:

* inspector/model/remote-object-get-properties-expected.txt:
Rebaseline test because the order of static properties has changed:
functions are now before constants instead of after.

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

4 years agoAdd a redirect for B3 documentation
jond@apple.com [Tue, 16 Feb 2016 20:18:11 +0000 (20:18 +0000)]
Add a redirect for B3 documentation
https://bugs.webkit.org/show_bug.cgi?id=154293

Reviewed by Timothy Hatcher.

* .htaccess:

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

4 years agoMarking webarchive/loading/missing-data.html as flaky on ios-simulator-wk2
ryanhaddad@apple.com [Tue, 16 Feb 2016 19:53:10 +0000 (19:53 +0000)]
Marking webarchive/loading/missing-data.html as flaky on ios-simulator-wk2
https://bugs.webkit.org/show_bug.cgi?id=153380

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoRevert r195826.
weinig@apple.com [Tue, 16 Feb 2016 19:33:54 +0000 (19:33 +0000)]
Revert r195826.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
(-[WKContentView _singleTapCommited:]):

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

4 years agoClonedArguments should not materialize its special properties unless they are being...
keith_miller@apple.com [Tue, 16 Feb 2016 19:28:09 +0000 (19:28 +0000)]
ClonedArguments should not materialize its special properties unless they are being changed or deleted
https://bugs.webkit.org/show_bug.cgi?id=154128

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Before we would materialize ClonedArguments whenever they were being accessed.
However this would cause the IC to miss every time as the structure for
the arguments object would change as we went to IC it. Thus on the next
function call we would miss the cache since the new arguments object
would not have materialized the value.

* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
* tests/stress/cloned-arguments-modification.js: Added.
(foo):

LayoutTests:

Have argumnets-strict-mode test the speed of spreading the arguments object.

* js/regress/script-tests/arguments-strict-mode.js:
(foo):

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

4 years agoMarking fast/events/keydown-1.html as flaky on mac-wk1 debug
ryanhaddad@apple.com [Tue, 16 Feb 2016 19:13:17 +0000 (19:13 +0000)]
Marking fast/events/keydown-1.html as flaky on mac-wk1 debug
https://bugs.webkit.org/show_bug.cgi?id=154297

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

4 years agoFTL should support StringFromCharCode
fpizlo@apple.com [Tue, 16 Feb 2016 19:12:36 +0000 (19:12 +0000)]
FTL should support StringFromCharCode
https://bugs.webkit.org/show_bug.cgi?id=154267
Source/JavaScriptCore:

rdar://problem/24192536

Reviewed by Mark Lam.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode): Fix a bug preventing the UntypedUse from being effective.
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compileStringFromCharCode): Implement the opcode.
* tests/stress/string-from-char-code-slow.js: Added.

LayoutTests:

Reviewed by Mark Lam.

* js/regress/script-tests/string-from-char-code.js: Added.
(result):
* js/regress/script-tests/untyped-string-from-char-code.js: Added.
(result):
* js/regress/string-from-char-code-expected.txt: Added.
* js/regress/string-from-char-code.html: Added.
* js/regress/untyped-string-from-char-code-expected.txt: Added.
* js/regress/untyped-string-from-char-code.html: Added.

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