WebKit-https.git
3 years agoMove parsing of mpadded attributes to a MathMLPaddedElement class
fred.wang@free.fr [Wed, 13 Jul 2016 04:47:00 +0000 (04:47 +0000)]
Move parsing of mpadded attributes to a MathMLPaddedElement class
https://bugs.webkit.org/show_bug.cgi?id=159620

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-12
Reviewed by Brent Fulgham.

No new tests, behavior is unchanged.

* CMakeLists.txt: Add MathMLPaddedElement files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* mathml/MathMLAllInOne.cpp: Ditto.
* mathml/MathMLInlineContainerElement.cpp: Remove handling of mpadded.
* mathml/MathMLPaddedElement.cpp: Added.
(WebCore::MathMLPaddedElement::MathMLPaddedElement):
(WebCore::MathMLPaddedElement::create):
(WebCore::MathMLPaddedElement::width): Expose width attribute as a MathMLLength until mpadded
pseudo-units are supported.
(WebCore::MathMLPaddedElement::height): Ditto.
(WebCore::MathMLPaddedElement::depth): Ditto
(WebCore::MathMLPaddedElement::lspace): Ditto.
(WebCore::MathMLPaddedElement::voffset): Ditto.
(WebCore::MathMLPaddedElement::parseAttribute): Make length attribute dirty.
(WebCore::MathMLPaddedElement::createElementRenderer): Moved code from MathMLInlineContainerElement.
* mathml/MathMLPaddedElement.h: Added.
* mathml/mathtags.in: Map mapdded to MathMLPaddedElement.
* rendering/mathml/RenderMathMLPadded.cpp:
(WebCore::RenderMathMLPadded::resolveWidth): Helper function to resolve width.
(WebCore::RenderMathMLPadded::resolveAttributes): Helper function to resolve all attributes.
(WebCore::RenderMathMLPadded::computePreferredLogicalWidths): Use resolveWidth.
(WebCore::RenderMathMLPadded::layoutBlock): Use resolveAttributes.
* rendering/mathml/RenderMathMLPadded.h: Add new helper functions to access attributes from
the MathMLPaddedElement class.

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

3 years ago[Cocoa] Simulated memory warning doesn't trigger libcache purge.
akling@apple.com [Wed, 13 Jul 2016 04:05:06 +0000 (04:05 +0000)]
[Cocoa] Simulated memory warning doesn't trigger libcache purge.
<https://webkit.org/b/159688>

Reviewed by Chris Dumez.

Since simulated memory warnings will have the "is under memory pressure" flag set,
we were skipping the libcache purge call.

Add a separate flag that tracks whether we're under simulated pressure, and always
prod libcache in that case.

* platform/MemoryPressureHandler.h:
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):
(WebCore::MemoryPressureHandler::install):

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

3 years ago<rdar://problem/22524456> Mitigate performance degradation of the flakiness dashboard
lforschler@apple.com [Wed, 13 Jul 2016 03:30:00 +0000 (03:30 +0000)]
<rdar://problem/22524456> Mitigate performance degradation of the flakiness dashboard

Rubber-stamped by Dean Johnson.

* init-database.sql:
    Rewrite the init-database.sql file to allow for table partitioning, based on insert date.
    Some important things to note:
        The main results table is unchanged, but will no longer contain any rows.
        Partitioned tables will be generated on demand, and will inherit from 'results'
        It is possible to query the 'results' table directly, and that will get data from all child tables.
        This should keep us from requiring any client side code changes.

* public_partition_maintenance: Added.
    Maintenance script which will be called on a nightly schedule to purge expired data.
    This data will be exported and compressed to a sub-folder, then dropped from the database.
    I'm not sure how big it will be, so we'll likely need to keep an eye on it.

* test-database.sql: Added.
    Simple helper function to test that results partitions are created/deleted correctly.

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

3 years ago[JSC] Array.prototype.join() fails some conformance tests
benjamin@webkit.org [Wed, 13 Jul 2016 01:25:25 +0000 (01:25 +0000)]
[JSC] Array.prototype.join() fails some conformance tests
https://bugs.webkit.org/show_bug.cgi?id=159657

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-07-12
Reviewed by Saam Barati.

Source/JavaScriptCore:

There were a couple of failures:
-separator.toString() was called *before* we get the length
 and process ToLength() on it.
-We were using toUInt32() on length instead of ToLength(),
 failing on big integers and various negative numbers.

Additionally, I replaced the "fast" ArrayStorage path
by a fully generic implementation that does not depends on StringJoiner.

The reason is StringJoiner was doing poorly on sparse objects
in certain cases.
If you have a sparse object with a length > INT_MAX but very few
indices defined, and you join on the empty string, it should be possible
to join the array (albeit very slowly). With StringJoiner, we fail
because we try to allocate > INT_MAX empty strings in a contiguous vector.

* runtime/ArrayPrototype.cpp:
(JSC::slowJoin):
(JSC::canUseFastJoin):
(JSC::fastJoin):
(JSC::arrayProtoFuncJoin):
(JSC::join): Deleted.
* runtime/JSArray.h:
(JSC::toLength):

Source/WTF:

* wtf/text/AtomicString.cpp:
(WTF::AtomicString::number):
* wtf/text/AtomicString.h:

LayoutTests:

I removed 3 sputnik tests that are incorrect in the latest spec.
In ES5, Array.prototype.join() was using ToUint32 on the argument:
    https://es5.github.io/#x15.4.4.5
In ES6, the function uses ToLength:
    https://tc39.github.io/ecma262/#sec-array.prototype.join

The test use Infinity and very large integer as the length.
They are guaranteed to time out or run out of memory.
Even if we waited the hours it takes to run this, the results would be different
from what the tests expect.

* js/array-join-expected.txt: Added.
* js/array-join.html: Added.
* js/script-tests/array-join.js: Added.

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

3 years agoPurge PassRefPtr in Modules/webdatabase
gyuyoung.kim@webkit.org [Wed, 13 Jul 2016 01:24:22 +0000 (01:24 +0000)]
Purge PassRefPtr in Modules/webdatabase
https://bugs.webkit.org/show_bug.cgi?id=159255

Reviewed by Benjamin Poulain.

As a step to remove PassRefPtr use, this patch cleans it up in Modules/webdatabase.

Additionally unnecessary spaces and tabs are removed too.

* Modules/webdatabase/ChangeVersionWrapper.cpp:
* Modules/webdatabase/DOMWindowWebDatabase.h:
* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::Database::~Database):
(WebCore::Database::scheduleTransaction):
(WebCore::Database::runTransaction):
* Modules/webdatabase/Database.h:
* Modules/webdatabase/DatabaseAuthorizer.cpp:
(WebCore::DatabaseAuthorizer::allowRead):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::openDatabase):
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/DatabaseTask.cpp:
(WebCore::DatabaseTransactionTask::DatabaseTransactionTask):
* Modules/webdatabase/DatabaseTask.h:
* Modules/webdatabase/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::SQLCallbackWrapper):
* Modules/webdatabase/SQLResultSetRowList.h:
* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::SQLStatement):
(WebCore::SQLStatement::sqlError):
(WebCore::SQLStatement::sqlResultSet):
* Modules/webdatabase/SQLStatement.h:
* Modules/webdatabase/SQLTransaction.h:
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::create):
(WebCore::SQLTransactionBackend::SQLTransactionBackend):
(WebCore::SQLTransactionBackend::transactionError):
* Modules/webdatabase/SQLTransactionBackend.h:

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

3 years ago[iOS WK2] After zooming and when under memory pressure, page tiles sometimes don...
simon.fraser@apple.com [Wed, 13 Jul 2016 00:55:47 +0000 (00:55 +0000)]
[iOS WK2] After zooming and when under memory pressure, page tiles sometimes don't redraw while panning
https://bugs.webkit.org/show_bug.cgi?id=159697
rdar://problem/26314075

Reviewed by Benjamin Poulain.

When under memory pressure, and after pinching back to minimum scale, WebPage::updateVisibleContentRects()
would sometimes always bail under the "boundedScale != currentScale..." condition.

This happened because the visibleContentRectUpdateInfo.scale() is a double, but m_page->pageScaleFactor()
is a float, and the constraining between min and max scale (which are doubles) caused boundedScale
to be always different from currentScale.

Fix by using floats throughout.

No test because there's no way to simulate memory pressure for testing.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

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

3 years agoGardening: C Loop build fix after r203142.
mark.lam@apple.com [Wed, 13 Jul 2016 00:45:11 +0000 (00:45 +0000)]
Gardening: C Loop build fix after r203142.

Not reviewed.

* interpreter/CLoopStackInlines.h:
(JSC::CLoopStack::isSafeToRecurse):

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

3 years agoUnreviewed, rolling out r203131.
ryanhaddad@apple.com [Wed, 13 Jul 2016 00:20:43 +0000 (00:20 +0000)]
Unreviewed, rolling out r203131.
https://bugs.webkit.org/show_bug.cgi?id=159698

This change caused an existing LayoutTest to time out on debug
testers (Requested by ryanhaddad on #webkit).

Reverted changeset:

"[JSC] Array.prototype.join() fails some conformance tests"
https://bugs.webkit.org/show_bug.cgi?id=159657
http://trac.webkit.org/changeset/203131

Patch by Commit Queue <commit-queue@webkit.org> on 2016-07-12

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

3 years agoWe should use different stack limits for stack checks from JS and host code.
mark.lam@apple.com [Wed, 13 Jul 2016 00:19:15 +0000 (00:19 +0000)]
We should use different stack limits for stack checks from JS and host code.
https://bugs.webkit.org/show_bug.cgi?id=159442
<rdar://problem/26889188>

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

We have 2 stack reservedZoneSizes:
1. Options::softReservedZoneSize()
2. Options::reservedZoneSize()

Respectively, there are used to define 2 stack limits based on these reserved
zone sizes:
1. VM::m_softStackLimit
2. VM::m_stackLimit

Options::reservedZoneSize() is the amount of the stack space that JSC guarantees
to the VM and client host code for it's use.  Host code that has well known
stack usage characteristics (i.e. doesn't call arbitrary code) may do stack
checks against the VM::m_stackLimit limit (which is computed using
Options::reservedZoneSize()).

Options::softReservedZoneSize() is a more conservative amount of reserved stack
space.  This is used to compute the VM::m_softStackLimit limit.  Any code that
is difficult to have its stack usage characterized (i.e. may call arbitrary code)
may need more stack space for its work.  Hence, these should do stack checks
against the VM::m_softStackLimit limit.

JS code and host code that may call into JS code falls into the category of code
that may call arbitrary code.  Hence, they should do stack checks against the
VM::m_softStackLimit limit.

Accordingly, the VM now provides 2 recursion check functions:

1. VM::isSafeToRecurseSoft() will do a stack check against VM::m_softStackLimit.
   In addition, for C Loop builds, VM::isSafeToRecurseSoft() will also
   check the CLoopStack against VM::m_cloopStackLimit.

2. VM::isSafeToRecurse() will do a stack check against VM::m_stackLimit.

Also added a promise-infinite-recursion-should-not-crash.js test.

* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitNodeInTailPosition):
(JSC::BytecodeGenerator::emitNodeInConditionContext):
* interpreter/CLoopStack.cpp:
(JSC::CLoopStack::grow):
* interpreter/CLoopStack.h:
(JSC::CLoopStack::size):
* interpreter/CLoopStackInlines.h:
(JSC::CLoopStack::ensureCapacityFor):
(JSC::CLoopStack::isSafeToRecurse):
(JSC::CLoopStack::topOfFrameFor):
* interpreter/CachedCall.h:
(JSC::CachedCall::CachedCall):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* parser/Parser.cpp:
* runtime/Options.h:
* runtime/ProxyObject.cpp:
(JSC::performProxyGet):
(JSC::ProxyObject::performInternalMethodGetOwnProperty):
(JSC::ProxyObject::performHasProperty):
(JSC::ProxyObject::getOwnPropertySlotCommon):
(JSC::ProxyObject::performPut):
(JSC::performProxyCall):
(JSC::performProxyConstruct):
(JSC::ProxyObject::performDelete):
(JSC::ProxyObject::performPreventExtensions):
(JSC::ProxyObject::performIsExtensible):
(JSC::ProxyObject::performDefineOwnProperty):
(JSC::ProxyObject::performGetOwnPropertyNames):
(JSC::ProxyObject::performSetPrototype):
(JSC::ProxyObject::performGetPrototype):
* runtime/RegExp.cpp:
(JSC::RegExp::finishCreation):
(JSC::RegExp::compile):
(JSC::RegExp::compileMatchOnly):
* runtime/StringRecursionChecker.h:
(JSC::StringRecursionChecker::performCheck):
* runtime/VM.cpp:
(JSC::VM::setStackPointerAtVMEntry):
(JSC::VM::updateSoftReservedZoneSize):
(JSC::preCommitStackMemory):
(JSC::VM::updateStackLimits):
(JSC::VM::updateStackLimit): Deleted.
* runtime/VM.h:
(JSC::VM::stackLimit):
(JSC::VM::softStackLimit):
(JSC::VM::addressOfSoftStackLimit):
(JSC::VM::setCLoopStackLimit):
(JSC::VM::isSafeToRecurse):
(JSC::VM::lastStackTop):
(JSC::VM::setException):
* runtime/VMInlines.h:
(JSC::VM::ensureStackCapacityFor):
(JSC::VM::isSafeToRecurseSoft):
(JSC::VM::shouldTriggerTermination):
* tests/stress/promise-infinite-recursion-should-not-crash.js: Added.
(testPromise):
(promiseFunc):
* yarr/YarrPattern.cpp:

Tools:

In http://trac.webkit.org/r203067, we limited the amount of stack that tests will
run with to keep stack overflow tests sane.  Turns out, we also need to teach the
LayoutTestRelay to pass env vars over to the iOS simulator.  This is needed in
order to keep the js/regress-139548.html test happy with this patch.

Also fixed up run_webkit_tests.py to explicitly pass an int size value for the
JSC_maxPerThreadStackUsage option.  Otherwise, it will pass a float value.

* LayoutTestRelay/LayoutTestRelay/LTRelayController.m:
(-[LTRelayController _environmentVariables]):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(main):

LayoutTests:

* js/regress-141098-expected.txt:
* js/script-tests/regress-141098.js:
(testEval):
(probeAndRecurse):
- Gave all the test constants names.
- Tweaked the constants to allow the test to run in the least amount of time, and
  also to behave consistently across all test configurations.
- Re-enable eager tests now that the test should finish quickly.

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

3 years agoplatformUserPreferredLanguages on Mac should not try to put the region into the language
fpizlo@apple.com [Wed, 13 Jul 2016 00:05:25 +0000 (00:05 +0000)]
platformUserPreferredLanguages on Mac should not try to put the region into the language
https://bugs.webkit.org/show_bug.cgi?id=159693

Rubber stamped by Alexey Proskuryakov.

Source/WTF:

Currently, navigator.language is the thing that we use as the BCP-47 tag in our Intl code
when certain APIs are called without a locale argument.  That mostly makes sense, and is
deeply wired into our engine.

In r200105, we made Intl aware of the region as a separate thing from the language by having
platformUserPreferredLanguages() return something like a BCP-47 tag that was
<language>-<region>.  For example, if I told System Preferences that I want to speak English
but live in Poland then we'd get "en-pl".  This had the effect of making Intl APIs format
dates using Polish formatting, for example.

But this is an odd change, since that same function also feeds into navigator.language.
"en-pl" isn't what we want there, since my System Preferences settings aren't supposed to
mean that I want to speak Polish-style English.  There's no such thing.

It may be worthwhile to wire the region settings more elegantly into Intl, but if we do that,
it should be via a mechanism that is separate from navigator.language. So, this change simply
reverts r200105.

* wtf/PlatformUserPreferredLanguagesMac.mm:
(WTF::httpStyleLanguageCode):
(WTF::platformUserPreferredLanguages):
(WTF::isValidICUCountryCode): Deleted.

Tools:

Revert the test change in r200105.

* TestWebKitAPI/Tests/mac/NavigatorLanguage.mm:
(TestWebKitAPI::languageForSystemLanguage):

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

3 years agoREGRESSION (202694): Audio and Video playback controls: Cannot find a position slider...
dino@apple.com [Tue, 12 Jul 2016 23:49:21 +0000 (23:49 +0000)]
REGRESSION (202694): Audio and Video playback controls: Cannot find a position slider to adjust playback position using VO.
https://bugs.webkit.org/show_bug.cgi?id=159661
<rdar://problem/27285135>

Unreviewed. Slight tweak to test to hopefully avoid flakiness.

* media/controls/default-size-should-show-scrubber-expected.txt:
* media/controls/default-size-should-show-scrubber.html:

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

3 years agoMarking fast/css/ancestor-of-hovered-element-detached.html as flaky on Mac
ryanhaddad@apple.com [Tue, 12 Jul 2016 23:20:25 +0000 (23:20 +0000)]
Marking fast/css/ancestor-of-hovered-element-detached.html as flaky on Mac
https://bugs.webkit.org/show_bug.cgi?id=159173

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoREGRESSION(r192789): Web Inspector: Log Value context menu appears twice
commit-queue@webkit.org [Tue, 12 Jul 2016 23:16:12 +0000 (23:16 +0000)]
REGRESSION(r192789): Web Inspector: Log Value context menu appears twice
https://bugs.webkit.org/show_bug.cgi?id=159681
<rdar://problem/27304804>

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

In r192789 contextmenu events may bubble up so that multiple handlers
may append ContextMenuItems. In nested ObjectTrees / ObjectPreviews
this could result in duplicate items. Add a flag on the bubbling event
so that we only include Object Tree context menu items for the deepest
part of the Object Tree, but still allow bubbling up to the root.

* UserInterface/Views/ObjectPreviewView.js:
(WebInspector.ObjectPreviewView.prototype._contextMenuHandler):
(WebInspector.ObjectPreviewView):
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype._contextMenuHandler):

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

3 years ago[Win] Fix for build error when trying to version stamp dll.
pvollan@apple.com [Tue, 12 Jul 2016 23:14:11 +0000 (23:14 +0000)]
[Win] Fix for build error when trying to version stamp dll.
https://bugs.webkit.org/show_bug.cgi?id=159692

Reviewed by Brent Fulgham.

Use correct path to version stamp script.

Source/JavaScriptCore:

* CMakeLists.txt:

Source/WebKit:

* CMakeLists.txt:

Source/WTF:

* wtf/CMakeLists.txt:

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

3 years ago[WK2][NetworkSession] Fix unsafe RunLoop::dispatch() in NetworkLoad constructor
cdumez@apple.com [Tue, 12 Jul 2016 22:43:20 +0000 (22:43 +0000)]
[WK2][NetworkSession] Fix unsafe RunLoop::dispatch() in NetworkLoad constructor
https://bugs.webkit.org/show_bug.cgi?id=159691

Reviewed by Brady Eidson.

Remove unsafe RunLoop::dispatch() in NetworkLoad constructor. It captured |this| but there
was no guarantee the NetworkLoad would still be alive by the time the lambda gets executed.

Instead, the constructor now takes a NetworkSession& parameter so that the call sites
have to retrieve the NetworkSession for a given SessionID and deal with the fact that
there may be no such NetworkSession before constructing the NetworkLoad.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::PendingDownload):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):

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

3 years agoWeb Inspector: ER: Copy as cURL
commit-queue@webkit.org [Tue, 12 Jul 2016 22:21:33 +0000 (22:21 +0000)]
Web Inspector: ER: Copy as cURL
https://bugs.webkit.org/show_bug.cgi?id=159380

Patch by Johan K. Jensen <johan_jensen@apple.com> on 2016-07-12
Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Inspired by https://chromium.googlesource.com/chromium/src/+/b7c1115dbae65030ad96e773d9a270465a05f5c4/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js

This "Copy as cURL" feature only approximates the original request as only some parts of
that request is known to the frontend.

* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.generateCURLCommand.escapeStringPosix.escapeCharacter):
(WebInspector.Resource.prototype.generateCURLCommand.escapeStringPosix):
(WebInspector.Resource.prototype.generateCURLCommand):
(WebInspector.Resource):
* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode.prototype.appendContextMenuItems):

LayoutTests:

* http/tests/inspector/network/copy-as-curl-expected.txt: Added.
* http/tests/inspector/network/copy-as-curl.html: Added.

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

3 years ago[JSC] Array.prototype.join() fails some conformance tests
commit-queue@webkit.org [Tue, 12 Jul 2016 22:08:31 +0000 (22:08 +0000)]
[JSC] Array.prototype.join() fails some conformance tests
https://bugs.webkit.org/show_bug.cgi?id=159657

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-07-12
Reviewed by Saam Barati.

Source/JavaScriptCore:

There were a couple of failures:
-separator.toString() was called *before* we get the length
 and process ToLength() on it.
-We were using toUInt32() on length instead of ToLength(),
 failing on big integers and various negative numbers.

Additionally, I replaced the "fast" ArrayStorage path
by a fully generic implementation that does not depends on StringJoiner.

The reason is StringJoiner was doing poorly on sparse objects
in certain cases.
If you have a sparse object with a length > INT_MAX but very few
indices defined, and you join on the empty string, it should be possible
to join the array (albeit very slowly). With StringJoiner, we fail
because we try to allocate > INT_MAX empty strings in a contiguous vector.

* runtime/ArrayPrototype.cpp:
(JSC::slowJoin):
(JSC::canUseFastJoin):
(JSC::fastJoin):
(JSC::arrayProtoFuncJoin):
(JSC::join): Deleted.
* runtime/JSArray.h:
(JSC::toLength):

Source/WTF:

* wtf/text/AtomicString.cpp:
(WTF::AtomicString::number):
* wtf/text/AtomicString.h:

LayoutTests:

I removed 3 sputnik tests that are incorrect in the latest spec.
In ES5, Array.prototype.join() was using ToUint32 on the argument:
    https://es5.github.io/#x15.4.4.5
In ES6, the function uses ToLength:
    https://tc39.github.io/ecma262/#sec-array.prototype.join

The test use Infinity and very large integer as the length.
They are guaranteed to time out or run out of memory.
Even if we waited the hours it takes to run this, the results would be different
from what the tests expect.

* js/array-join-expected.txt: Added.
* js/array-join.html: Added.
* js/script-tests/array-join.js: Added.

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

3 years agoMore stack limit and reserved zone renaming.
mark.lam@apple.com [Tue, 12 Jul 2016 22:06:20 +0000 (22:06 +0000)]
More stack limit and reserved zone renaming.
https://bugs.webkit.org/show_bug.cgi?id=159690

Rubber-stamped by Geoffrey Garen.

We should rename the following:
    osStackLimitWithReserve => softStackLimit
    reservedZoneSize => softReservedZoneSize
    errorModeReservedZoneSize => reservedZoneSize

* API/tests/PingPongStackOverflowTest.cpp:
(testPingPongStackOverflow):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
* interpreter/CLoopStack.cpp:
(JSC::CLoopStack::CLoopStack):
(JSC::CLoopStack::grow):
(JSC::CLoopStack::releaseExcessCapacity):
(JSC::CLoopStack::addToCommittedByteCount):
(JSC::CLoopStack::setSoftReservedZoneSize):
(JSC::CLoopStack::setReservedZoneSize): Deleted.
* interpreter/CLoopStack.h:
(JSC::CLoopStack::size):
* interpreter/CLoopStackInlines.h:
(JSC::CLoopStack::shrink):
* jit/JIT.cpp:
(JSC::JIT::compileWithoutLinking):
* jit/SetupVarargsFrame.cpp:
(JSC::emitSetupVarargsFrameFastCase):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/ErrorHandlingScope.cpp:
(JSC::ErrorHandlingScope::ErrorHandlingScope):
(JSC::ErrorHandlingScope::~ErrorHandlingScope):
* runtime/ErrorHandlingScope.h:
* runtime/Options.h:
* runtime/RegExp.cpp:
(JSC::RegExp::finishCreation):
(JSC::RegExp::compile):
(JSC::RegExp::compileMatchOnly):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::setStackPointerAtVMEntry):
(JSC::VM::updateSoftReservedZoneSize):
(JSC::VM::updateStackLimit):
(JSC::VM::updateReservedZoneSize): Deleted.
* runtime/VM.h:
(JSC::VM::stackPointerAtVMEntry):
(JSC::VM::softReservedZoneSize):
(JSC::VM::softStackLimit):
(JSC::VM::addressOfSoftStackLimit):
(JSC::VM::cloopStackLimit):
(JSC::VM::setCLoopStackLimit):
(JSC::VM::isSafeToRecurse):
(JSC::VM::reservedZoneSize): Deleted.
(JSC::VM::osStackLimitWithReserve): Deleted.
(JSC::VM::addressOfOSStackLimitWithReserve): Deleted.
* runtime/VMInlines.h:
(JSC::VM::ensureStackCapacityFor):
* wasm/WASMFunctionCompiler.h:
(JSC::WASMFunctionCompiler::startFunction):

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

3 years ago[WK2] Protect against bad database data in LocalStorageDatabase::importItems()
cdumez@apple.com [Tue, 12 Jul 2016 21:51:19 +0000 (21:51 +0000)]
[WK2] Protect against bad database data in LocalStorageDatabase::importItems()
https://bugs.webkit.org/show_bug.cgi?id=159663
<rdar://problem/18995873>

Reviewed by Benjamin Poulain.

Source/WebKit2:

Protect against bad database data in LocalStorageDatabase::importItems(). We
crash if the database contains a null key or a null value so protect against
it given that we have evidence it can happen.

With this change, I can no longer reproduce the UIProcess crash on evernote.com
that is documented at <rdar://problem/18995873>.

* UIProcess/Storage/LocalStorageDatabase.cpp:
(WebKit::LocalStorageDatabase::importItems):

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.localstorage: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.localstorage-shm: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageNullEntries.mm: Added.
(-[LocalStorageNullEntriesMessageHandler userContentController:didReceiveScriptMessage:]):
(TEST):

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

3 years agoMarking storage/indexeddb/database-close-private.html as flaky on Mac
ryanhaddad@apple.com [Tue, 12 Jul 2016 21:09:35 +0000 (21:09 +0000)]
Marking storage/indexeddb/database-close-private.html as flaky on Mac
https://bugs.webkit.org/show_bug.cgi?id=158500

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMarking storage/indexeddb/modern/handle-user-delete.html as flaky on Yosemite Release
ryanhaddad@apple.com [Tue, 12 Jul 2016 20:48:07 +0000 (20:48 +0000)]
Marking storage/indexeddb/modern/handle-user-delete.html as flaky on Yosemite Release
https://bugs.webkit.org/show_bug.cgi?id=158741

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoMarking inspector/indexeddb/deleteDatabaseNamesWithSpace.html as a flaky timeout...
ryanhaddad@apple.com [Tue, 12 Jul 2016 19:40:25 +0000 (19:40 +0000)]
Marking inspector/indexeddb/deleteDatabaseNamesWithSpace.html as a flaky timeout on Mac debug.
https://bugs.webkit.org/show_bug.cgi?id=159684

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoUpdate test expectations for rdar://problem/26590623 after r203117.
ryanhaddad@apple.com [Tue, 12 Jul 2016 19:40:23 +0000 (19:40 +0000)]
Update test expectations for rdar://problem/26590623 after r203117.

* platform/mac/TestExpectations:

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

3 years agoMarking imported/w3c/web-platform-tests/fetch/api/request/request-cache.html as flaky...
ryanhaddad@apple.com [Tue, 12 Jul 2016 19:12:14 +0000 (19:12 +0000)]
Marking imported/w3c/web-platform-tests/fetch/api/request/request-cache.html as flaky on Mac and ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=159683

Unreviewed test gardening.

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

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

3 years agoREGRESSION (202694): Audio and Video playback controls: Cannot find a position slider...
dino@apple.com [Tue, 12 Jul 2016 18:50:19 +0000 (18:50 +0000)]
REGRESSION (202694): Audio and Video playback controls: Cannot find a position slider to adjust playback position using VO.
https://bugs.webkit.org/show_bug.cgi?id=159661
<rdar://problem/27285135>

Reviewed by Eric Carlson.

Source/WebCore:

The change in r202694 caused MediaDocuments to not always
show their scrubber. The fix is to reduce the minimum amount
of size needed to show the scrubber.

Test: media/controls/default-size-should-show-scrubber.html

* Modules/mediacontrols/mediaControlsApple.js: 80 pixels is enough
to show the scrubber.

LayoutTests:

Add a test that checks the scrubber is visible on a default media element.
Unfortunately this isn't quite an accurate test, since we really want to
examine a Media Document, but it's close enough.

* media/controls/default-size-should-show-scrubber-expected.txt: Added.
* media/controls/default-size-should-show-scrubber.html: Added.

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

3 years agoRelax ordering requirements on StringView::CodePoints iterator
mmaxfield@apple.com [Tue, 12 Jul 2016 18:48:04 +0000 (18:48 +0000)]
Relax ordering requirements on StringView::CodePoints iterator
https://bugs.webkit.org/show_bug.cgi?id=159609

Reviewed by Darin Adler.

Source/WTF:

Previously, there was a requirement where if you use a CodePoints
iterator, you couldn't dereference twice in a row or increment
twice in a row. This restriction is unnecessary.

* wtf/text/StringView.h:
(WTF::StringView::CodePoints::Iterator::Iterator):
(WTF::StringView::CodePoints::Iterator::advanceCurrentCodePoint):
(WTF::StringView::CodePoints::Iterator::operator*):
(WTF::StringView::CodePoints::Iterator::operator==):

Tools:

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

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

3 years agoFixing Tools/Scripts/run-builtins-generator-tests after https://trac.webkit.org/chang...
commit-queue@webkit.org [Tue, 12 Jul 2016 17:43:28 +0000 (17:43 +0000)]
Fixing Tools/Scripts/run-builtins-generator-tests after https://trac.webkit.org/changeset/202975
https://bugs.webkit.org/show_bug.cgi?id=159564

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-12
Reviewed by Brian Burg.

* Scripts/webkitpy/codegen/main.py:
(BuiltinsGeneratorTests.generate_from_js_builtins): Changing --with-wrapper-files option to --wrappers.

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

3 years agoMarking http/tests/preload/single_download_preload_runner.html as a timeout
ryanhaddad@apple.com [Tue, 12 Jul 2016 17:17:16 +0000 (17:17 +0000)]
Marking http/tests/preload/single_download_preload_runner.html as a timeout
https://bugs.webkit.org/show_bug.cgi?id=159678

Unreviewed test gardening.

* TestExpectations:

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

3 years agoMove MathMLOperatorDictionary from rendering to DOM
fred.wang@free.fr [Tue, 12 Jul 2016 16:43:04 +0000 (16:43 +0000)]
Move MathMLOperatorDictionary from rendering to DOM
https://bugs.webkit.org/show_bug.cgi?id=159619

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-12
Reviewed by Brent Fulgham.

No new tests, behavior is unchanged.

* CMakeLists.txt: Use the new location of MathMLOperatorDictionary files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* mathml/MathMLAllInOne.cpp: Add MathMLOperatorDictionary.cpp
* mathml/MathMLOperatorDictionary.cpp: Renamed from Source/WebCore/rendering/mathml/MathMLOperatorDictionary.cpp.
* mathml/MathMLOperatorDictionary.h: Renamed from Source/WebCore/rendering/mathml/MathMLOperatorDictionary.h.

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

3 years agoRemove ENABLE_CSS3_TEXT_LINE_BREAK flag
gyuyoung.kim@webkit.org [Tue, 12 Jul 2016 14:36:34 +0000 (14:36 +0000)]
Remove ENABLE_CSS3_TEXT_LINE_BREAK flag
https://bugs.webkit.org/show_bug.cgi?id=159671

Reviewed by Csaba Osztrogonác.

ENABLE_CSS3_TEXT_LINE_BREAK feature was implemented without guards.
https://bugs.webkit.org/show_bug.cgi?id=89235

So this guard can be removed in build scripts.

.:

* Source/cmake/OptionsMac.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

3 years agoWeb Inspector: Use separate files for TreeOutline/TreeElement and DataGrid/DataGridNode
commit-queue@webkit.org [Tue, 12 Jul 2016 13:05:13 +0000 (13:05 +0000)]
Web Inspector: Use separate files for TreeOutline/TreeElement and DataGrid/DataGridNode
https://bugs.webkit.org/show_bug.cgi?id=159659

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

* UserInterface/Main.html:
* UserInterface/Views/DataGrid.js:
* UserInterface/Views/DataGridNode.js: Added.
* UserInterface/Views/TreeElement.js: Added.
* UserInterface/Views/TreeOutline.js:
Extra the component classes to their own file.

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

3 years agoUnreviewed, rolling out r203059.
commit-queue@webkit.org [Tue, 12 Jul 2016 13:04:38 +0000 (13:04 +0000)]
Unreviewed, rolling out r203059.
https://bugs.webkit.org/show_bug.cgi?id=159673

B and R channels now swapped on desktop GL builds (Requested
by philn on #webkit).

Reverted changeset:

"Red and blue colors are swapped in video rendered through
WebGL when GSTREAMER_GL is enabled"
https://bugs.webkit.org/show_bug.cgi?id=159621
http://trac.webkit.org/changeset/203059

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

3 years agoJSCOnly bulidfix after r203078
ossy@webkit.org [Tue, 12 Jul 2016 11:29:16 +0000 (11:29 +0000)]
JSCOnly bulidfix after r203078
https://bugs.webkit.org/show_bug.cgi?id=159669

Reviewed by Yusuke Suzuki.

* wtf/PlatformJSCOnly.cmake:
* wtf/text/jsconly/TextBreakIteratorInternalICUJSCOnly.cpp: Added.
(WTF::currentSearchLocaleID):
(WTF::currentTextBreakLocaleID):

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

3 years ago[Win] DLLs are missing version information.
pvollan@apple.com [Tue, 12 Jul 2016 11:14:43 +0000 (11:14 +0000)]
[Win] DLLs are missing version information.
https://bugs.webkit.org/show_bug.cgi?id=159349

Reviewed by Brent Fulgham.

.:

The version stamping will fail if the target path has forward slashes.

* Source/cmake/tools/scripts/version-stamp.pl: Replace forward slashes with backslashes.

Source/JavaScriptCore:

Generate autoversion.h and run perl version stamp utility.

* CMakeLists.txt:

Source/WebKit:

Run perl version stamp utility.

* CMakeLists.txt:

Source/WTF:

Generate autoversion.h and run perl version stamp utility.

* wtf/CMakeLists.txt:

WebKitLibraries:

The version stamping will fail if the target path has forward slashes.

* win/tools/scripts/version-stamp.pl: Replace forward slashes with backslashes.

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

3 years agojs/dom/global-constructors-attributes.html is flaky: ResourceTiming runtime feature...
yoav@yoav.ws [Tue, 12 Jul 2016 09:04:49 +0000 (09:04 +0000)]
js/dom/global-constructors-attributes.html is flaky: ResourceTiming runtime feature leaks between tests
https://bugs.webkit.org/show_bug.cgi?id=158902

Reviewed by Benjamin Poulain.

Adds a new reset() mechanism to RuntimeEnabledFeatures so that they could be brought back to the initial state.
This reset() is then called from DumpRenderTree and WebKitTestRunner.

No new tests but hopefully current tests will be less flaky.

* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
(WebCore::RuntimeEnabledFeatures::reset):
* bindings/generic/RuntimeEnabledFeatures.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): reset RuntimeEnabledFeatures.

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

3 years agoPurge PassRefPtr in platform/efl and platform/mac
gyuyoung.kim@webkit.org [Tue, 12 Jul 2016 06:24:30 +0000 (06:24 +0000)]
Purge PassRefPtr in platform/efl and platform/mac
https://bugs.webkit.org/show_bug.cgi?id=159548

Reviewed by Alex Christensen.

Remove all use of PassRefPtr and clean up unnecessary tabs and spaces.
Source/WebCore:

WebKit2 codes are also changed because of setBufferForType()'s modification.

No new tests, no behavior changes.

* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/PlatformSpeechSynthesizer.h:
* platform/SerializedPlatformRepresentation.h:
* platform/efl/PlatformSpeechSynthesisProviderEfl.cpp:
(WebCore::PlatformSpeechSynthesisProviderEfl::speak):
* platform/efl/PlatformSpeechSynthesisProviderEfl.h:
* platform/efl/PlatformSpeechSynthesizerEfl.cpp:
(WebCore::PlatformSpeechSynthesizer::speak):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::setBufferForType):
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
(SOFT_LINK_CONSTANT):
(-[WebSpeechSynthesisWrapper initWithSpeechSynthesizer:]):
(-[WebSpeechSynthesisWrapper mapSpeechRateToPlatformRate:]):
(-[WebSpeechSynthesisWrapper speakUtterance:]):
(-[WebSpeechSynthesisWrapper pause]):
(-[WebSpeechSynthesisWrapper resume]):
(-[WebSpeechSynthesisWrapper cancel]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didStartSpeechUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeechUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didPauseSpeechUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didContinueSpeechUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didCancelSpeechUtterance:]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]):
(WebCore::PlatformSpeechSynthesizer::speak):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write):
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::getTypes):
(WebCore::PlatformPasteboard::getPathnamesForType):
(WebCore::PlatformPasteboard::color):
(WebCore::PlatformPasteboard::copy):
(WebCore::PlatformPasteboard::setBufferForType):
(WebCore::PlatformPasteboard::setPathnamesForType):
* platform/mac/PlatformSpeechSynthesizerMac.mm:
(-[WebSpeechSynthesisWrapper initWithSpeechSynthesizer:]):
(-[WebSpeechSynthesisWrapper speakUtterance:]):
(-[WebSpeechSynthesisWrapper pause]):
(-[WebSpeechSynthesisWrapper resume]):
(-[WebSpeechSynthesisWrapper cancel]):
(-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeaking:]):
(WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
(WebCore::PlatformSpeechSynthesizer::speak):
* platform/mac/SerializedPlatformRepresentationMac.h:
* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::SerializedPlatformRepresentationMac::data):
(WebCore::jsValueWithValueInContext):
* platform/mock/PlatformSpeechSynthesizerMock.cpp:
(WebCore::PlatformSpeechSynthesizerMock::speakingFinished):
(WebCore::PlatformSpeechSynthesizerMock::speak):
(WebCore::PlatformSpeechSynthesizerMock::cancel):
* platform/mock/PlatformSpeechSynthesizerMock.h:

Source/WebKit/mac:

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::setBufferForType):

Source/WebKit2:

WebKit2 codes are also changed because of setBufferForType()'s modification.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::setPasteboardBufferForType):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::setBufferForType):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

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

3 years agoMove parsing of mspace attributes to a MathMLSpaceElement class
fred.wang@free.fr [Tue, 12 Jul 2016 05:59:55 +0000 (05:59 +0000)]
Move parsing of mspace attributes to a MathMLSpaceElement class
https://bugs.webkit.org/show_bug.cgi?id=156795

Patch by Frederic Wang <fwang@igalia.org> on 2016-07-11
Reviewed by Brent Fulgham.

No new tests, already covered by existing tests.

* CMakeLists.txt: Add MathMLSpaceElement to the build system.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::cachedMathMLLength): Helper function to returned the cached parsed
value of a MathML length and parsing the corresponding attribute value if the cache is dirty.
* mathml/MathMLElement.h: Add a dirty boolean to MathML Length structure. Declare cachedMathMLLength.
* mathml/MathMLSpaceElement.cpp: New class for the <mspace> element.
(WebCore::MathMLSpaceElement::MathMLSpaceElement):
(WebCore::MathMLSpaceElement::create):
(WebCore::MathMLSpaceElement::parseAttribute): Make width, height, depth attributes dirty.
(WebCore::MathMLSpaceElement::createElementRenderer):
* mathml/MathMLSpaceElement.h: New class for the <mspace> element.
We define MathML lengths for width, height and depth attributes are on the class and expose
with the corresponding helper functions via memoization.
* mathml/MathMLTextElement.cpp: Remove handling of mspace from this class.
(WebCore::MathMLTextElement::createElementRenderer):
* mathml/mathtags.in: Change the interface for mspace to use the new class.
* rendering/mathml/RenderMathMLSpace.cpp: Do not store width/height/depth values on the
renderer and instead just use the corresponding MathML lengths on the element class.
(WebCore::RenderMathMLSpace::RenderMathMLSpace): Use MathMLSpaceElement and remove member
initialization.
(WebCore::RenderMathMLSpace::computePreferredLogicalWidths): Use spaceWidth().
(WebCore::RenderMathMLSpace::spaceWidth): Helper function to resolve the width attribute value.
(WebCore::RenderMathMLSpace::getSpaceHeightAndDepth): Ditto for height and depth.
(WebCore::RenderMathMLSpace::layoutBlock): Use the helper functions to get the mspace metrics.
(WebCore::RenderMathMLSpace::firstLineBaseline): Ditto.
(WebCore::RenderMathMLSpace::updateFromElement): Deleted.
(WebCore::RenderMathMLSpace::styleDidChange): Deleted.
* rendering/mathml/RenderMathMLSpace.h: Use MathMLSpaceElement, replace members with helper
functions and and make element() usable from a const instance.

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

3 years agoECMAScript 2016: %TypedArray%.prototype.includes implementation
commit-queue@webkit.org [Tue, 12 Jul 2016 05:06:25 +0000 (05:06 +0000)]
ECMAScript 2016: %TypedArray%.prototype.includes implementation
https://bugs.webkit.org/show_bug.cgi?id=159385

Patch by Caio Lima <ticaiolima@gmail.com> on 2016-07-11
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

This patch implements the ECMAScript 2016:
%TypedArray%.prototype.includes
following spec 22.2.3.14
https://tc39.github.io/ecma262/2016/#sec-%typedarray%.prototype.includes

* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncIncludes):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewProtoFuncIncludes):
(JSC::JSTypedArrayViewPrototype::finishCreation):

LayoutTests:

This patch implements test case to ECMAScript 2016:
%TypedArray%.prototype.includes implementation
following spec 22.2.3.14
https://tc39.github.io/ecma262/2016/#sec-%typedarray%.prototype.includes

* js/regress/script-tests/typed-array-includes.js: Added.
(assertProperError):
(testIntTypedArray):
(testFloatTypedArray):
* js/typed-array-includes-expected.txt: Added.
* js/typed-array-includes.html: Added.

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

3 years agoCreate a MathMLLength struct to handle the parsing of MathML length.
fred.wang@free.fr [Tue, 12 Jul 2016 04:47:02 +0000 (04:47 +0000)]
Create a MathMLLength struct to handle the parsing of MathML length.
https://bugs.webkit.org/show_bug.cgi?id=156792

Patch by Frederic Wang <fwang@igalia.org> on 2016-07-11
Reviewed by Brent Fulgham.

We introduce a structure for MathML lengths that will be used in the future to store the
parsed values in the MathElement class. We also rewrite the parsing function for MathML
lengths in order to improve efficiency and code reuse. This function is moved into the
MathElement class and only the conversion to LayoutUnit remains in the renderer classes.

No new tests, already covered by existing tests.

* mathml/MathMLElement.cpp:
(WebCore::parseNamedSpace): Helper function to parse a named space.
(WebCore::MathMLElement::parseMathMLLength): Parsing function for MathML lengths.
* mathml/MathMLElement.h: Declare new function and structure to handle MathML lengths.
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::toUserUnits): Helper function to resolve a MathML length.
(WebCore::parseMathMLLength): Remove the old parsing code and just use MathMLElement::parseMathMLLength and toUserUnits instead.
(WebCore::parseMathMLNamedSpace): Deleted.
* rendering/mathml/RenderMathMLBlock.h: Remove unused function.

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

3 years agoDisable some a failing test.
fred.wang@free.fr [Tue, 12 Jul 2016 04:34:25 +0000 (04:34 +0000)]
Disable some a failing test.

Unreviewed test gardening.

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-11

* imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1.html:

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

3 years agoAdd support for @href attribute in MathML
fred.wang@free.fr [Tue, 12 Jul 2016 04:28:16 +0000 (04:28 +0000)]
Add support for @href attribute in MathML
https://bugs.webkit.org/show_bug.cgi?id=85733

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-11
Reviewed by Brent Fulgham.

Source/WebCore:

We add support for the href attribute from MathML 3 but ignore the deprecated XLink version.
We also use the code from HTMLAnchorElement SVGAElement to make MathMLElement with a href
attribute behave as a link.
Finally, we adjust mathml.css based on rules from the html and svg user agent stylesheets.

Tests: mathml/mathml-in-html5/href-click-1.html
       mathml/mathml-in-html5/href-click-2.html
       mathml/presentation/href-enter.html
       mathml/presentation/href-style.html
       mathml/presentation/maction-toggle-href.html
       mathml/presentation/semantics-href.html

* css/mathml.css:
(:any-link): Set color and mouse cursor of links.
(:any-link:active): Set color of active links.
(:focus): Set outline of focused links.
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::parseAttribute): Parse the href attribute.
(WebCore::MathMLElement::willRespondToMouseClickEvents): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::defaultEventHandler): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::canStartSelection): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::isFocusable): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::isKeyboardFocusable): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::isMouseFocusable): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::isURLAttribute): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::supportsFocus): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::tabIndex): Based on HTMLAnchorElement/SVGAElement.
* mathml/MathMLElement.h: Define new members.
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::willRespondToMouseClickEvents): We also verify whether
the parent class will respond.
* mathml/mathattrs.in: Add href attribute.

LayoutTests:

We import some tests from the MathML in HTML5 test suite to
test clicks on href attributes and write similar tests.
We also test tab/enter keys and user agent style with links.

* mathml/mathml-in-html5/href-click-1.html: Added. Verify mouse click on a MathML link.
* mathml/mathml-in-html5/href-click-1-expected.html: Added.
* mathml/mathml-in-html5/href-click-2.html: Added.
Verify mouse click on a descendant of a MathML link.
* mathml/mathml-in-html5/href-click-2-expected.html: Added.
* mathml/presentation/href-enter.html: Added.
Verify tab navigation and activing link with enter.
* mathml/presentation/href-enter-expected.html: Added.
* mathml/presentation/href-style.html: Added.
Verify default style of links and of focused links.
* mathml/presentation/href-style-expected.html: Added.
* mathml/presentation/maction-toggle-href.html: Added.
Verify conflicts between maction toggle and href link.
* mathml/presentation/maction-toggle-href-expected.html: Added.
* mathml/presentation/semantics-href.html: Added. Verify mouse click on a <semantics> link.
* mathml/presentation/semantics-href-expected.html: Added.
* platform/mac/TestExpectations: Disable MathML link tests that rely on keyboard events.
* platform/ios-simulator/TestExpectations: Ditto.

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

3 years agoReplace reftest mathml/presentation/fractions-positions.html with script tests
fred.wang@free.fr [Tue, 12 Jul 2016 04:03:43 +0000 (04:03 +0000)]
Replace reftest mathml/presentation/fractions-positions.html with script tests
https://bugs.webkit.org/show_bug.cgi?id=159558

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-11
Reviewed by Martin Robinson.

* TestExpectations: Remove fractions-positions.html
* imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1.html: Added.
* mathml/presentation/fractions-positions-expected.html: Removed.
* mathml/presentation/fractions-positions.html: Removed.

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

3 years agoWeb Inspector: ProfileView sometimes shows Top Functions data despite Top Functions...
commit-queue@webkit.org [Tue, 12 Jul 2016 03:30:05 +0000 (03:30 +0000)]
Web Inspector: ProfileView sometimes shows Top Functions data despite Top Functions being disabled
https://bugs.webkit.org/show_bug.cgi?id=159660
<rdar://problem/27291647>

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

* UserInterface/Views/ScriptProfileTimelineView.js:
(WebInspector.ScriptProfileTimelineView.prototype._profileOrientationButtonClicked):
Pass the value of the setting, not the setting itself.

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

3 years ago[JSC] Array.from() and Array.of() try to build objects even if "this" is not a constr...
benjamin@webkit.org [Tue, 12 Jul 2016 00:57:35 +0000 (00:57 +0000)]
[JSC] Array.from() and Array.of() try to build objects even if "this" is not a constructor
https://bugs.webkit.org/show_bug.cgi?id=159604

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

The spec says IsConstructor(), we were just checking if "this"
is any function.

* builtins/ArrayConstructor.js:
(of):
(from):

LayoutTests:

* js/array-from-expected.txt:
* js/array-of-expected.txt:
* js/script-tests/array-from.js:
* js/script-tests/array-of.js:

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

3 years agoCrash due to abort() calling libc++.1.dylib: std::__1::thread::detach()
ggaren@apple.com [Tue, 12 Jul 2016 00:16:19 +0000 (00:16 +0000)]
Crash due to abort() calling libc++.1.dylib: std::__1::thread::detach()
https://bugs.webkit.org/show_bug.cgi?id=159655

Reviewed by Sam Weinig.

It's not entirely clear what was happening in these crashes, but our
use of detach() was 100% forward-looking, so we can just remove it for
now.

This patch removes the ability for the scavenger owner to die before
the scavenger thread dies (which was unused) and also removes the
ability for the scavenger thread to exit (which was used, but we
messed up and did thread joining lazily, so we never got any benefit
from thread exit.)

We can add these features back when we need them, and make them work then.

* bmalloc/AsyncTask.h:
(bmalloc::Function>::AsyncTask): We start out in the running state now
because we know that starting our thread will run it.

(bmalloc::Function>::~AsyncTask): We don't support destruction anymore.

(bmalloc::Function>::runSlowCase): I removed the Exited state.

(bmalloc::Function>::threadRunLoop): I removed the Exited and
ExitRequested states.

* bmalloc/Heap.h:

* bmalloc/VMHeap.h:

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

3 years agoSpeech Synthesis: getting list of voices no longer works
weinig@apple.com [Mon, 11 Jul 2016 23:53:42 +0000 (23:53 +0000)]
Speech Synthesis: getting list of voices no longer works
<rdar://problem/22954120>
https://bugs.webkit.org/show_bug.cgi?id=159656

Reviewed by Tim Horton.

* platform/PlatformSpeechSynthesizer.h:
* platform/mac/PlatformSpeechSynthesizerMac.mm:
Default initialize m_voiceListIsInitialized to false so it is
initialized on both Mac and iOS. Remove the explicit initialization
from the Mac.

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

3 years ago<rdar://problem/27285599> REGRESSION: Assertion under CertificateInfo::trust() every...
simon.fraser@apple.com [Mon, 11 Jul 2016 23:44:48 +0000 (23:44 +0000)]
<rdar://problem/27285599> REGRESSION: Assertion under CertificateInfo::trust() every time I focus a text field

Reviewed by Sam Weinig.

The assertion added to CertificateInfo::trust() in r203040 is wrong, and is triggered when
focusing a form field via calls to -[WKWebProcessPlugInFrame _serverTrust], so remove it.

* platform/network/cf/CertificateInfo.h:
(WebCore::CertificateInfo::trust):

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

3 years agoDeleting in a text input inside an iframe causes the page to scroll incorrectly
simon.fraser@apple.com [Mon, 11 Jul 2016 23:44:44 +0000 (23:44 +0000)]
Deleting in a text input inside an iframe causes the page to scroll incorrectly
https://bugs.webkit.org/show_bug.cgi?id=159654
rdar://problem/26805722

Reviewed by Zalan Bujtas.

Source/WebCore:

Editor::revealSelectionAfterEditingOperation() needs the same iOS-specific reveal
behavior as was added for typing in r202295.

Test: fast/forms/ios/delete-in-input-in-iframe.html

* editing/Editor.cpp:
(WebCore::Editor::revealSelectionAfterEditingOperation):

LayoutTests:

* fast/forms/ios/delete-in-input-in-iframe-expected.txt: Added.
* fast/forms/ios/delete-in-input-in-iframe.html: Added.

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

3 years agodefineProperty on a index of a TypedArray should throw if configurable
keith_miller@apple.com [Mon, 11 Jul 2016 23:39:29 +0000 (23:39 +0000)]
defineProperty on a index of a TypedArray should throw if configurable
https://bugs.webkit.org/show_bug.cgi?id=159653

Reviewed by Saam Barati.

When I fixed this before I misread the spec and thought it said we
should throw if the descriptor said the proprety is not
configurable. This is the opposite. We should throw if the
descriptor says the property is configurable.

* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty):
* tests/stress/typedarray-access-monomorphic-neutered.js:
* tests/stress/typedarray-access-neutered.js:
* tests/stress/typedarray-configure-index.js: Added.
(assert):
(assertThrows):
(makeDescriptor):
(test):

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

3 years agoSVN.create_patch should find svn-create-patch relative to the WebKit root.
jmarcell@apple.com [Mon, 11 Jul 2016 23:34:22 +0000 (23:34 +0000)]
SVN.create_patch should find svn-create-patch relative to the WebKit root.
https://bugs.webkit.org/show_bug.cgi?id=159652

Reviewed by Daniel Bates.

* Scripts/webkitpy/common/checkout/scm/svn.py:
(SVN.create_patch): Use WebKitFinder to find the WebKit checkout so that we can find svn-create-patch relative to it.

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

3 years ago[WK2][iOS] Intermittent crash in [UIApplication beginBackgroundTaskWithName] expirati...
cdumez@apple.com [Mon, 11 Jul 2016 23:29:23 +0000 (23:29 +0000)]
[WK2][iOS] Intermittent crash in [UIApplication beginBackgroundTaskWithName] expiration handler
https://bugs.webkit.org/show_bug.cgi?id=159648
<rdar://problem/27219361>

Reviewed by Anders Carlsson.

We see an intermittent crash in [UIApplication beginBackgroundTaskWithName] expiration handler.
From the traces, we noticed the expiration handler can get called on a non-main thread under
certain conditions, which our code is designed to deal with.

In particular, we get called on a non-main thread when UIKit fails to acquire the assertion.
Update our expiration handler to always notify the clients on the main thread.

* UIProcess/ios/ProcessAssertionIOS.mm:
(-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):

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

3 years agoFix indentation in FrameLoaderTypes.h
aestes@apple.com [Mon, 11 Jul 2016 23:25:40 +0000 (23:25 +0000)]
Fix indentation in FrameLoaderTypes.h
https://bugs.webkit.org/show_bug.cgi?id=159650

Reviewed by Brady Eidson.

* loader/FrameLoaderTypes.h:

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

3 years agoHonor the second argument to FontFaceSet.load and FontFaceSet.check
mmaxfield@apple.com [Mon, 11 Jul 2016 23:23:56 +0000 (23:23 +0000)]
Honor the second argument to FontFaceSet.load and FontFaceSet.check
https://bugs.webkit.org/show_bug.cgi?id=159607
<rdar://problem/27284902>

Reviewed by Zalan Bujtas.

Source/WebCore:

This second argument is used in conjunction with the unicode-range CSS property, so that
loading from a FontFaceSet only loads the fonts which actually match the characters given.
Previously, we hadn't implemented proper support for this unicode-range property, but now
that we have implemented it, we should honor this second argument.

Test: fast/text/unicode-range-javascript.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::rangesMatchCodePoint):
* css/CSSFontFace.h:
* css/CSSFontFaceSet.cpp:
(WebCore::codePointsFromString):
(WebCore::CSSFontFaceSet::matchingFaces):

LayoutTests:

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

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

3 years agoUnable to edit fields or drag to select text in Dashboard widgets.
zalan@apple.com [Mon, 11 Jul 2016 23:18:41 +0000 (23:18 +0000)]
Unable to edit fields or drag to select text in Dashboard widgets.
https://bugs.webkit.org/show_bug.cgi?id=159647
<rdar://problem/26941698>

Reviewed by Brent Fulgham.

RenderObject::computeAbsoluteRepaintRect's first paramenter is no longer in/out. Use the return
value to set the clip on the dashboard region.

Not testable.

* rendering/RenderInline.cpp:
(WebCore::RenderInline::addAnnotatedRegions):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addAnnotatedRegions):

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

3 years agoBuild fix.
enrica@apple.com [Mon, 11 Jul 2016 23:05:10 +0000 (23:05 +0000)]
Build fix.

Unreviewed.

* WebDropSource.cpp:
(generateMouseEvent):

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

3 years agoTried to fix the macOS build.
mitz@apple.com [Mon, 11 Jul 2016 22:51:24 +0000 (22:51 +0000)]
Tried to fix the macOS build.

* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction description]):

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

3 years agoPotential null dereference under DocumentLoader::mainReceivedError()
cdumez@apple.com [Mon, 11 Jul 2016 22:35:51 +0000 (22:35 +0000)]
Potential null dereference under DocumentLoader::mainReceivedError()
https://bugs.webkit.org/show_bug.cgi?id=159640
<rdar://problem/27283372>

Reviewed by Brady Eidson.

Move frameLoader() null check a bit earlier in DocumentLoader::mainReceivedError()
as it was dereferenced before the check.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::mainReceivedError):

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

3 years agosome paths in Array.prototype.splice don't account for the array not having certain...
sbarati@apple.com [Mon, 11 Jul 2016 22:08:40 +0000 (22:08 +0000)]
some paths in Array.prototype.splice don't account for the array not having certain indexed properties
https://bugs.webkit.org/show_bug.cgi?id=159641
<rdar://problem/27171999>

Reviewed by Filip Pizlo and Keith Miller.

Array.prototype.splice was incorrectly putting properties on
the result array even if the |this| array didn't have those
properties. This is not the behavior of the spec. However, this
could also cause a crash because we can construct a program where
we would putByIndex on a typed array where the value we are
putting is JSValue(). This is bad because the typed array will
try to convert JSValue() into an integer.

* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncSplice):
* tests/stress/array-prototype-splice-making-typed-array.js: Added.
(assert):
(test):

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

3 years agoCleaned up API availability.
mitz@apple.com [Mon, 11 Jul 2016 22:02:38 +0000 (22:02 +0000)]
Cleaned up API availability.

Requested by Tim Horton.

* UIProcess/API/Cocoa/WKNavigationAction.mm:
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:

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

3 years agoAdd synthetic click origin to WKNavigationAction.
enrica@apple.com [Mon, 11 Jul 2016 21:34:36 +0000 (21:34 +0000)]
Add synthetic click origin to WKNavigationAction.
https://bugs.webkit.org/show_bug.cgi?id=159584
rdar://problem/25610422

Reviewed by Tim Horton.

Source/WebCore:

Adding plumbing code to pass synthetic click type
through WebCore.

* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent):
(WebCore::Element::dispatchMouseForceWillBegin):
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
(WebCore::MouseEvent::MouseEvent):
(WebCore::MouseEvent::initMouseEvent):
(WebCore::MouseEvent::cloneFor):
* dom/MouseEvent.h:
(WebCore::MouseEvent::createForBindings):
(WebCore::MouseEvent::button):
(WebCore::MouseEvent::syntheticClickType):
(WebCore::MouseEvent::buttonDown):
(WebCore::MouseEvent::setRelatedTarget):
* dom/SimulatedClick.cpp:
* dom/WheelEvent.cpp:
(WebCore::WheelEvent::WheelEvent):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::showContextMenuAt):
* page/DragController.cpp:
(WebCore::createMouseEvent):
(WebCore::DragController::DragController):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchDragEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::fakeMouseMoveEventTimerFired):
* platform/PlatformMouseEvent.h:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
(WebCore::PlatformMouseEvent::clickCount):
(WebCore::PlatformMouseEvent::modifierFlags):
(WebCore::PlatformMouseEvent::force):
(WebCore::PlatformMouseEvent::syntheticClickType):
* replay/SerializationMethods.cpp:
(JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):

Source/WebKit/ios:

* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _dragSourceEndedAt:operation:]):
* WebView/WebPDFView.mm:
(-[WebPDFView PDFViewWillClickOnLink:withURL:]):

Source/WebKit/win:

* WebDropSource.cpp:
(generateMouseEvent):

Source/WebKit2:

Adds a private property to WKNavigationAction to retrieve
the origin of the synthetic click.

* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* Shared/WebEvent.h:
(WebKit::WebMouseEvent::button):
(WebKit::WebMouseEvent::menuTypeForEvent):
(WebKit::WebMouseEvent::force):
(WebKit::WebMouseEvent::syntheticClickType):
* Shared/WebMouseEvent.cpp:
(WebKit::WebMouseEvent::WebMouseEvent):
(WebKit::WebMouseEvent::encode):
(WebKit::WebMouseEvent::decode):
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
* UIProcess/API/APINavigationAction.h:
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(toWKNavigationType):
(toWKSyntheticClickType):
(-[WKNavigationAction description]):
(-[WKNavigationAction sourceFrame]):
(-[WKNavigationAction request]):
(-[WKNavigationAction _syntheticClickType]):
(-[WKNavigationAction modifierFlags]):
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _twoFingerSingleTapGestureRecognized:]):
(-[WKContentView _longPressRecognized:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::getSelectionContext):
(WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
(WebKit::WebPageProxy::selectWithTwoTouches):
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::mouseButtonForMouseEvent):
(WebKit::syntheticClickTypeForMouseEvent):
(WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
(WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
(WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
(WebKit::InjectedBundleNavigationAction::create):
(WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
* WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
(WebKit::InjectedBundleNavigationAction::navigationType):
(WebKit::InjectedBundleNavigationAction::modifiers):
(WebKit::InjectedBundleNavigationAction::mouseButton):
(WebKit::InjectedBundleNavigationAction::hitTestResult):
(WebKit::InjectedBundleNavigationAction::formElement):
(WebKit::InjectedBundleNavigationAction::syntheticClickType):
(WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs):
(WebKit::InjectedBundleNavigationAction::shouldTryAppLinks):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
(WebKit::WebPage::contextMenuAtPointInWindow):
(WebKit::WebPage::dragEnded):
(WebKit::WebPage::simulateMouseDown):
(WebKit::WebPage::simulateMouseUp):
(WebKit::WebPage::simulateMouseMotion):
(WebKit::WebPage::setCompositionForTesting):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleSyntheticClick):
(WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
(WebKit::WebPage::completeSyntheticClick):
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
(WebKit::WebPage::handleTwoFingerTapAtPoint):
(WebKit::WebPage::potentialTapAtPosition):
(WebKit::WebPage::inspectorNodeSearchMovedToPosition):

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

3 years agoAble to open multiple payment sheets in Safari at the same time
andersca@apple.com [Mon, 11 Jul 2016 21:10:29 +0000 (21:10 +0000)]
Able to open multiple payment sheets in Safari at the same time
https://bugs.webkit.org/show_bug.cgi?id=159637
rdar://problem/26411339

Reviewed by Beth Dakin.

Source/WebCore:

Fold PaymentCoordinator::showPaymentUI into PaymentCoordinator::beginPaymentSession and
change the return value of the latter member function to a bool to indicate whether the
payment UI could be shown (or whether it's already showing).

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::begin):
Check the return value of beginPaymentSession.

* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::beginPaymentSession):
This now takes a payment session and returns a boolean.
(WebCore::PaymentCoordinator::showPaymentUI): Deleted.

* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* loader/EmptyClients.cpp:
The showPaymentUI client function now returns a bool.

Source/WebKit/mac:

Update for WebCore changes.

* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::showPaymentUI):

Source/WebKit2:

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
Add result out parameter. Set the result to false if isShowingPaymentUI is true, otherwise set isShowingPaymentUI to true.

(WebKit::WebPaymentCoordinatorProxy::didReachFinalState):
Set isShowingPaymentUI to false.

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::showPaymentUI):
* WebProcess/ApplePay/WebPaymentCoordinator.h:
The showPaymentUI message and client functions now return booleans.

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

3 years agoAX: Crash when backspacing in number field with spin button
n_wang@apple.com [Mon, 11 Jul 2016 21:04:28 +0000 (21:04 +0000)]
AX: Crash when backspacing in number field with spin button
https://bugs.webkit.org/show_bug.cgi?id=157830

Reviewed by Chris Fleizach.

Source/WebCore:

It's possible to access spin button parts after they've been detached from their parent, which can lead to crashes.
This adds in a number of redundant safeguards to prevent this and other cases in the future.

Test: accessibility/spinbutton-crash.html

* accessibility/AccessibilitySpinButton.cpp:
(WebCore::AccessibilitySpinButton::incrementButton):
(WebCore::AccessibilitySpinButton::decrementButton):
(WebCore::AccessibilitySpinButton::addChildren):

LayoutTests:

* accessibility/spinbutton-crash-expected.txt: Added.
* accessibility/spinbutton-crash.html: Added.

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

3 years agoPossible null dereference under EventHandler::dispatchMouseEvent()
cdumez@apple.com [Mon, 11 Jul 2016 20:53:48 +0000 (20:53 +0000)]
Possible null dereference under EventHandler::dispatchMouseEvent()
https://bugs.webkit.org/show_bug.cgi?id=159632
<rdar://problem/27247619>

Reviewed by Andreas Kling.

FrameSelection::toNormalizedRange() can return null even when FrameSelection::isRange()
returns true so add a null check.

* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent):

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

3 years agoRefactor JSStack to only be the stack data structure for the C Loop.
mark.lam@apple.com [Mon, 11 Jul 2016 20:48:15 +0000 (20:48 +0000)]
Refactor JSStack to only be the stack data structure for the C Loop.
https://bugs.webkit.org/show_bug.cgi?id=159545

Reviewed by Geoffrey Garen.

Changes made:
1. Renamed JSStack to CLoopStack.
2. Made all of CLoopStack code to conditional on #if !ENABLE(JIT) i.e. they will
   only be in effect for the C Loop build.
3. Changed clients of JSStack to use new equivalent VM APIs:
    a. JSStack::ensureCapacityFor() => VM::ensureStackCapacityFor()
    b. JSStack::committedByteCount() => VM::committedStackByteCount()
4. Made VM::updateReservedZoneSize() call CLoopStack::setReservedZoneSize()
   instead of calling it from all the clients of VM::updateReservedZoneSize().
5. Removed all unnecessary references to JSStack.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MaxFrameExtentForSlowPathCall.h:
* bytecode/BytecodeConventions.h:
* dfg/DFGGraph.h:
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* heap/Heap.cpp:
(JSC::Heap::finalizeUnconditionalFinalizers):
(JSC::Heap::willStartIterating):
(JSC::Heap::gatherJSStackRoots):
(JSC::Heap::stack): Deleted.
* heap/Heap.h:
* interpreter/CLoopStack.cpp: Copied from Source/JavaScriptCore/interpreter/JSStack.cpp.
(JSC::commitSize):
(JSC::CLoopStack::CLoopStack):
(JSC::CLoopStack::~CLoopStack):
(JSC::CLoopStack::grow):
(JSC::CLoopStack::gatherConservativeRoots):
(JSC::CLoopStack::sanitizeStack):
(JSC::CLoopStack::releaseExcessCapacity):
(JSC::CLoopStack::addToCommittedByteCount):
(JSC::CLoopStack::setReservedZoneSize):
(JSC::CLoopStack::committedByteCount):
(JSC::JSStack::JSStack): Deleted.
(JSC::JSStack::~JSStack): Deleted.
(JSC::JSStack::growSlowCase): Deleted.
(JSC::JSStack::gatherConservativeRoots): Deleted.
(JSC::JSStack::sanitizeStack): Deleted.
(JSC::JSStack::releaseExcessCapacity): Deleted.
(JSC::JSStack::addToCommittedByteCount): Deleted.
(JSC::JSStack::setReservedZoneSize): Deleted.
(JSC::JSStack::lowAddress): Deleted.
(JSC::JSStack::highAddress): Deleted.
(JSC::JSStack::committedByteCount): Deleted.
* interpreter/CLoopStack.h: Copied from Source/JavaScriptCore/interpreter/JSStack.h.
(JSC::CLoopStack::containsAddress):
(JSC::CLoopStack::lowAddress):
(JSC::CLoopStack::highAddress):
(JSC::CLoopStack::reservationTop):
(JSC::JSStack::containsAddress): Deleted.
(JSC::JSStack::lowAddress): Deleted.
(JSC::JSStack::highAddress): Deleted.
(JSC::JSStack::reservationTop): Deleted.
* interpreter/CLoopStackInlines.h: Copied from Source/JavaScriptCore/interpreter/JSStackInlines.h.
(JSC::CLoopStack::ensureCapacityFor):
(JSC::CLoopStack::topOfFrameFor):
(JSC::CLoopStack::topOfStack):
(JSC::CLoopStack::shrink):
(JSC::CLoopStack::setCLoopStackLimit):
(JSC::JSStack::ensureCapacityFor): Deleted.
(JSC::JSStack::topOfFrameFor): Deleted.
(JSC::JSStack::topOfStack): Deleted.
(JSC::JSStack::shrink): Deleted.
(JSC::JSStack::grow): Deleted.
(JSC::JSStack::setCLoopStackLimit): Deleted.
* interpreter/CallFrame.cpp:
(JSC::CallFrame::unsafeCallSiteIndex):
(JSC::CallFrame::currentVPC):
(JSC::CallFrame::stack): Deleted.
* interpreter/CallFrame.h:
(JSC::ExecState::callerFrameAndPC):
(JSC::ExecState::unsafeCallerFrameAndPC):
* interpreter/Interpreter.cpp:
(JSC::sizeOfVarargs):
(JSC::sizeFrameForForwardArguments):
(JSC::sizeFrameForVarargs):
(JSC::Interpreter::Interpreter):
* interpreter/Interpreter.h:
(JSC::Interpreter::cloopStack):
(JSC::Interpreter::getOpcode):
(JSC::Interpreter::isCallBytecode):
(JSC::Interpreter::stack): Deleted.
* interpreter/JSStack.cpp: Removed.
* interpreter/JSStack.h: Removed.
* interpreter/JSStackInlines.h: Removed.
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::dump):
* jit/JIT.h:
* jit/JITOperations.cpp:
* jit/JSInterfaceJIT.h:
* jit/SpecializedThunkJIT.h:
* jit/ThunkGenerators.cpp:
* llint/LLIntOffsetsExtractor.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::llint_stack_check_at_vm_entry):
* llint/LLIntThunks.cpp:
* llint/LowLevelInterpreter.cpp:
(JSC::CLoop::execute):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::arityCheckFor):
* runtime/ErrorHandlingScope.cpp:
(JSC::ErrorHandlingScope::ErrorHandlingScope):
(JSC::ErrorHandlingScope::~ErrorHandlingScope):
* runtime/JSGlobalObject.h:
* runtime/MemoryStatistics.cpp:
(JSC::globalMemoryStatistics):
* runtime/StackAlignment.h:
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::updateReservedZoneSize):
(JSC::sanitizeStackForVM):
(JSC::VM::committedStackByteCount):
* runtime/VM.h:
(JSC::VM::reservedZoneSize):
(JSC::VM::osStackLimitWithReserve):
(JSC::VM::addressOfOSStackLimitWithReserve):
* runtime/VMInlines.h:
(JSC::VM::ensureStackCapacityFor):
(JSC::VM::shouldTriggerTermination):

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

3 years agoWeb Inspector: Transition and Animation sections in Visual Styles sidebar should...
nvasilyev@apple.com [Mon, 11 Jul 2016 20:22:56 +0000 (20:22 +0000)]
Web Inspector: Transition and Animation sections in Visual Styles sidebar should have more spacing to their left
https://bugs.webkit.org/show_bug.cgi?id=159633
<rdar://problem/27281805>

Reviewed by Timothy Hatcher.

* UserInterface/Views/VisualStyleDetailsPanel.css:
(.visual-style-property-container.animation):

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

3 years agoUnreviewed, rolling out r203064.
ryanhaddad@apple.com [Mon, 11 Jul 2016 20:11:03 +0000 (20:11 +0000)]
Unreviewed, rolling out r203064.
https://bugs.webkit.org/show_bug.cgi?id=159642

This change causes LayoutTest crashes on WK1 ASan (Requested
by ryanhaddad on #webkit).

Reverted changeset:

"Use refs for ResourceLoaders"
https://bugs.webkit.org/show_bug.cgi?id=159592
http://trac.webkit.org/changeset/203064

Patch by Commit Queue <commit-queue@webkit.org> on 2016-07-11

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

3 years agoImplement grapheme cluster iterator on StringView
mmaxfield@apple.com [Mon, 11 Jul 2016 19:50:40 +0000 (19:50 +0000)]
Implement grapheme cluster iterator on StringView
https://bugs.webkit.org/show_bug.cgi?id=159598

Reviewed by Anders Carlsson.

This is in preparation for honoring the second argument to FontFaceSet.load().

Source/WTF:

* wtf/text/StringView.cpp:
(WTF::StringView::GraphemeClusters::Iterator::Impl::Impl):
(WTF::StringView::GraphemeClusters::Iterator::Impl::operator++):
(WTF::StringView::GraphemeClusters::Iterator::Impl::operator*):
(WTF::StringView::GraphemeClusters::Iterator::Impl::operator==):
(WTF::StringView::GraphemeClusters::Iterator::Impl::computeIndexEnd):
(WTF::StringView::GraphemeClusters::Iterator::Iterator):
(WTF::StringView::GraphemeClusters::Iterator::~Iterator):
(WTF::StringView::GraphemeClusters::Iterator::operator*):
(WTF::StringView::GraphemeClusters::Iterator::operator==):
(WTF::StringView::GraphemeClusters::Iterator::operator!=):
* wtf/text/StringView.h:
(WTF::StringView::GraphemeClusters::GraphemeClusters):
* text/TextBreakIterator.cpp:
(WebCore::NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator):
* text/TextBreakIterator.h:

Tools:

* TestWebKitAPI/Tests/WTF/StringView.cpp:
(TestWebKitAPI::compareLoopIterations):
(TestWebKitAPI::TEST):

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

3 years ago[WebGL] Check for existing buffer exists for enabled vertex array attributes before...
bfulgham@apple.com [Mon, 11 Jul 2016 19:43:19 +0000 (19:43 +0000)]
[WebGL] Check for existing buffer exists for enabled vertex array attributes before permitting glDrawArrays to execute
https://bugs.webkit.org/show_bug.cgi?id=159590
<rdar://problem/26865535>

Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/canvas/webgl/webgl-drawarrays-crash-2.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateVertexAttributes): If enabled array buffer attributes exist,
ensure that an array buffer has been bound.

LayoutTests:

* fast/canvas/webgl/webgl-drawarrays-crash-2-expected.txt: Added.
* fast/canvas/webgl/webgl-drawarrays-crash-2.html: Added.

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

3 years agoSTP TypedArray.subarray 5x slowdown compared to 9.1
keith_miller@apple.com [Mon, 11 Jul 2016 19:13:05 +0000 (19:13 +0000)]
STP TypedArray.subarray 5x slowdown compared to 9.1
https://bugs.webkit.org/show_bug.cgi?id=156404
Source/JavaScriptCore:

<rdar://problem/26493032>

Reviewed by Geoffrey Garen.

This patch moves the species constructor work for
%TypedArray%.prototype.subarray to a js wrapper. By moving the
species constructor work to JS we are able to completely optimize
it out in DFG. The actual work of creating a TypedArray is still
done in C++ since we are able to avoid calling into the
constructor, which is expensive. This patch also changes the error
message when a %TypedArray%.prototype function is passed a non-typed
array this value. Finally, we used to check that the this value
had not been detached, however, this behavior was incorrect.

* builtins/BuiltinNames.h:
* builtins/TypedArrayPrototype.js:
(globalPrivate.typedArraySpeciesConstructor):
(subarray):
* runtime/ConstructData.cpp:
(JSC::construct):
* runtime/ConstructData.h:
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):
(JSC::genericTypedArrayViewProtoFuncSubarray): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewPrivateFuncLength):
(JSC::typedArrayViewPrivateFuncSubarrayCreate):
(JSC::JSTypedArrayViewPrototype::finishCreation):
(JSC::typedArrayViewProtoFuncSubarray): Deleted.
* runtime/JSTypedArrayViewPrototype.h:

LayoutTests:

Reviewed by Geoffrey Garen.

Add new micro-benchmark for testing subarray performance with small subarray sizes.

* js/regress/script-tests/typed-array-subarray.js: Added.
(createManySubs):
(go):
* js/regress/typed-array-subarray-expected.txt: Added.
* js/regress/typed-array-subarray.html: Added.

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

3 years agoAX: WKWebView should have API to prevent pinch-to-zoom always being allowed
n_wang@apple.com [Mon, 11 Jul 2016 19:08:24 +0000 (19:08 +0000)]
AX: WKWebView should have API to prevent pinch-to-zoom always being allowed
https://bugs.webkit.org/show_bug.cgi?id=158364

Reviewed by Anders Carlsson.

Source/WebCore:

Removed the internals settings for viewport force always user scalable.

Changes are covered in modified tests.

* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::Internals):
(WebCore::Internals::composedTreeAsText):
(WebCore::Internals::setLinkPreloadSupport):
(WebCore::Internals::setViewportForceAlwaysUserScalable): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Added a property in WKWebViewConfiguration so that developers can toggle the ignoring
viewport scale limits setting.

Changes are covered in modified tests.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetResourceCachingDisabled):
(WKPageSetIgnoresViewportScaleLimits):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(shouldAllowPictureInPictureMediaPlayback):
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _navigationGestureDidEnd]):
(forceAlwaysUserScalableChangedCallback): Deleted.
(-[WKWebView _updateForceAlwaysUserScalable]): Deleted.
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
(WebKit::WebPageProxy::setForceAlwaysUserScalable):
(WebKit::WebPageProxy::setMaximumUnobscuredSize):
(WebKit::WebPageProxy::updateForceAlwaysUserScalable): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::disableInspectorNodeSearch):
(WebKit::WebPage::setForceAlwaysUserScalable):
(WebKit::innerFrameQuad):
(WebKit::WebPage::updateForceAlwaysUserScalable): Deleted.

Tools:

Added a function in TestRunner so that we can toggle the ignoring viewport
scale limits setting. Also added a test option for that in order to change the
configuration of the webview in test.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setNavigationGesturesEnabled):
(WTR::TestRunner::setIgnoresViewportScaleLimits):
(WTR::nextUIScriptCallbackID):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::shouldDecideNavigationPolicyAfterDelay):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
(WTR::TestController::setNavigationGesturesEnabled):
(WTR::TestController::setIgnoresViewportScaleLimits):
(WTR::TestController::platformWillRunTest):
* WebKitTestRunner/TestController.h:
(WTR::TestController::setShouldDecideNavigationPolicyAfterDelay):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
* WebKitTestRunner/TestOptions.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):

LayoutTests:

* fast/viewport/ios/force-always-user-scalable.html:
* fast/viewport/ios/user-scalable-does-not-scale-for-keyboard-focus-with-author-defined-scale.html:
* fast/viewport/ios/user-scalable-scales-for-keyboard-focus-with-no-author-defined-scale.html:

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

3 years agoUse parameters from the OpenType MATH table for <munderover>
fred.wang@free.fr [Mon, 11 Jul 2016 18:46:10 +0000 (18:46 +0000)]
Use parameters from the OpenType MATH table for <munderover>
https://bugs.webkit.org/show_bug.cgi?id=155756

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-11
Reviewed by Brent Fulgham.

Source/WebCore:

We follow the description from the MathML in HTML5 implementation
to improve the layout of <munderover> using some constants from the MATH table.

Tests: imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-1.html
       imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-2.html
       imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-3.html
       imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-4.html
       mathml/presentation/attributes-accent-accentunder-dynamic.html

* mathml/mathattrs.in: Add accentunder attribute.
* rendering/mathml/MathMLOperatorDictionary.h: Remove FIXME comment.
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::hasAccent): Helper function to determine whether
the over/under script should be treated as an accent.
(WebCore::RenderMathMLUnderOver::getVerticalParameters): Helper function to read
some vertical parameters from the MATH table.
(WebCore::RenderMathMLUnderOver::layoutBlock): Take into account the new vertical
parameters for the layout of <munderover>.
* rendering/mathml/RenderMathMLUnderOver.h: Define new helper functions.

LayoutTests:

Import some tests from the MathML in HTML5 test suite to verify
the layout of the <munderover> element. We also write a test to
verify dynamic change of accent/accentunder attributes and adjust
other tests.

* imported/mathml-in-html5/fonts/math/limits-lowerlimitbaselinedropmin3000.woff: Added.
* imported/mathml-in-html5/fonts/math/limits-lowerlimitgapmin11000.woff: Added.
* imported/mathml-in-html5/fonts/math/limits-upperlimitbaselinerisemin5000.woff: Added.
* imported/mathml-in-html5/fonts/math/limits-upperlimitgapmin7000.woff: Added.
* imported/mathml-in-html5/fonts/math/stretchstack-bottomshiftdown3000.woff: Added.
* imported/mathml-in-html5/fonts/math/stretchstack-gapabovemin7000.woff: Added.
* imported/mathml-in-html5/fonts/math/stretchstack-gapbelowmin11000.woff: Added.
* imported/mathml-in-html5/fonts/math/stretchstack-topshiftup5000.woff: Added.
* imported/mathml-in-html5/fonts/math/underover-accentbaseheight4000-overbarextraascender3000.woff: Added.
* imported/mathml-in-html5/fonts/math/underover-accentbaseheight4000-overbarverticalgap11000.woff: Added.
* imported/mathml-in-html5/fonts/math/underover-accentbaseheight4000-underbarextradescender5000.woff: Added.
* imported/mathml-in-html5/fonts/math/underover-accentbaseheight4000-underbarverticalgap7000.woff: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-1-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-1.html: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-2-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-2.html: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-3-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-3.html: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-4-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/underover-parameters-4.html: Added.
* mathml/presentation/attributes-accent-accentunder-dynamic.html: Added.
Test dynamic changes of accent and accentunder.
* mathml/presentation/attributes-accent-accentunder-dynamic-expected.html: Added.
* mathml/presentation/scripts-underover.html: Remove one of the test since munderover
with an empty script is no longer equivalent to munder or mover.
* mathml/presentation/scripts-underover-expected.html: Ditto.
* platform/gtk/mathml/opentype/horizontal-expected.png: Updated due to change in
vertical metrics of scripts.
* platform/gtk/mathml/opentype/horizontal-expected.txt: Ditto.
* platform/gtk/mathml/opentype/horizontal-munderover-expected.png: Ditto.
* platform/gtk/mathml/opentype/horizontal-munderover-expected.txt: Ditto.
* platform/gtk/mathml/presentation/roots-expected.txt: Udapted due to script baseline fix.
* platform/gtk/mathml/presentation/roots-expected.png: ditto.
* mathml/presentation/underover-nonstretchy-or-vertical.html: Prevent the <mo> to be treated
as an accent so that we always get the same spacing as the reference. We also use the Ahem
font to make the result more reliable.

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

3 years agoUse Stack* parameters from the OpenType MATH table
fred.wang@free.fr [Mon, 11 Jul 2016 18:42:22 +0000 (18:42 +0000)]
Use Stack* parameters from the OpenType MATH table
https://bugs.webkit.org/show_bug.cgi?id=155714

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-11
Reviewed by Brent Fulgham.

Source/WebCore:

Test: mathml/mathml-in-html5/frac-parameters-2.html

* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::updateFromElement): Set the stack parameters when
the line thickness is zero.
(WebCore::RenderMathMLFraction::layoutBlock): Correctly set the <mfrac> ascent and
the denominator vertical offset when the line thickness is zero.
(WebCore::RenderMathMLFraction::paint): Early return when we actually do not need to
paint any fraction bar.
* rendering/mathml/RenderMathMLFraction.h: Define an isStack helper function and define
members corresponding to stack parameters.

LayoutTests:

We import a test from the MathML in HTML5 test suite to verify Stack* parameters.

* imported/mathml-in-html5/fonts/math/stack-axisheight7000.woff: Added.
* imported/mathml-in-html5/fonts/math/stack-bottomdisplaystyleshiftdown5000.woff: Added.
* imported/mathml-in-html5/fonts/math/stack-bottomshiftdown6000.woff: Added.
* imported/mathml-in-html5/fonts/math/stack-displaystylegapmin4000.woff: Added.
* imported/mathml-in-html5/fonts/math/stack-gapmin8000.woff: Added.
* imported/mathml-in-html5/fonts/math/stack-topdisplaystyleshiftup3000.woff: Added.
* imported/mathml-in-html5/fonts/math/stack-topshiftup9000.woff: Added.
* imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-parameters-2-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-parameters-2.html: Added.

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

3 years agoAdd support for mathvariants that cannot be emulated via CSS.
fred.wang@free.fr [Mon, 11 Jul 2016 18:38:36 +0000 (18:38 +0000)]
Add support for mathvariants that cannot be emulated via CSS.
https://bugs.webkit.org/show_bug.cgi?id=108778

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-11
Reviewed by Brent Fulgham.

Source/WebCore:

Tests: mathml/mathml-in-html5/mathvariant-transforms-1.html
       mathml/mathml-in-html5/mathvariant-transforms-2.html
       mathml/presentation/mathvariant-inheritance.html
       mathml/presentation/mathvariant-tokens.html

We remove the old code to emulate partial mathvariant support via CSS and add support
for all mathvariant values using the technique used for implicit italic on <mi> element.
We also rely on the MathMLStyle class introduced earlier to support custome MathML style
and manage inheritance of mathvariant values.
The function that tries and converts one base character into a transformed mathvariant
character is based on similar code from Gecko:
http://hg.mozilla.org/mozilla-central/file/tip/layout/generic/MathMLTextRunFactory.cpp
Note that we only support transform on token elements with a single character, which
should cover the most important use cases.

* css/mathml.css: Remove the CSS rules to emulate some mathvariant values.
(math[mathvariant="normal"], mstyle[mathvariant="normal"], mo[mathvariant="normal"], mn[mathvariant="normal"], mi[mathvariant="normal"], mtext[mathvariant="normal"], mspace[mathvariant="normal"], ms[mathvariant="normal"]): Deleted.
(math[mathvariant="bold"], mstyle[mathvariant="bold"], mo[mathvariant="bold"], mn[mathvariant="bold"], mi[mathvariant="bold"], mtext[mathvariant="bold"], mspace[mathvariant="bold"], ms[mathvariant="bold"]): Deleted.
(math[mathvariant="italic"], mstyle[mathvariant="italic"], mo[mathvariant="italic"], mn[mathvariant="italic"], mi[mathvariant="italic"], mtext[mathvariant="italic"], mspace[mathvariant="italic"], ms[mathvariant="italic"]): Deleted.
(math[mathvariant="bold-italic"], mstyle[mathvariant="bold-italic"], mo[mathvariant="bold-italic"], mn[mathvariant="bold-italic"], mi[mathvariant="bold-italic"], mtext[mathvariant="bold-italic"], mspace[mathvariant="bold-italic"], ms[mathvariant="bold-italic"]): Deleted.
* mathml/MathMLInlineContainerElement.cpp: We resolve mathml style when mathvariant changes.
(WebCore::MathMLInlineContainerElement::parseAttribute):
* mathml/MathMLMathElement.cpp: ditto.
(WebCore::MathMLMathElement::parseAttribute):
* mathml/MathMLTextElement.cpp: ditto.
(WebCore::MathMLTextElement::parseAttribute):
* rendering/mathml/MathMLStyle.cpp: Add mathvariant property to the MathML style.
(WebCore::MathMLStyle::MathMLStyle): Init mathvariant to none.
(WebCore::MathMLStyle::getMathMLStyle): Helper function to retrieve the MathML style on a renderer.
(WebCore::MathMLStyle::updateStyleIfNeeded): Take into account change of mathvariant.
(WebCore::MathMLStyle::parseMathVariant): Helper function to parse a mathvariant attribute.
(WebCore::MathMLStyle::resolveMathMLStyle): Take into account mathvariant value: it is None
by default, inherited and can be modified via an attribute on <math>, <mstyle> or token
elements. We also refactor a bit to share logic between displaystyle and mathvariant.
(WebCore::MathMLStyle::setDisplayStyle): Deleted.
* rendering/mathml/MathMLStyle.h: Add mathvariant members and update declarations.
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::updateTokenContent): Call the function from the parent class
to consider mathvariant on <mo>.
* rendering/mathml/RenderMathMLToken.cpp:
We implement a mathVariant function to transform a base character into its transformed mathvariant:
- There are some regularity that allows to perform this via simple linear transforms.
- However, there are also many exceptions and we rely on some sorted MathVariantMapping
tables to handle these cases.
(WebCore::ExtractKey): Helper function to perform binary searches on MathVariant tables.
(WebCore::MathVariantMappingSearch): ditto.
(WebCore::mathVariant): New function to perform mathvariant transforms.
(WebCore::RenderMathMLToken::updateMathVariantGlyph): Use the mathVariant function to
perform all transformations, not just the italic one.
(WebCore::transformToItalic): Deleted. Replaced with the more general mathVariant function.

LayoutTests:

Import a test from the MathML in HTML5 test suite to perform an exhaustive
verification of all the mathvariant transforms allowed.
We also add some tests to verify inheritance of the mathvariant style, the
effect on each token element and dynamic modification of mathvariant.
Finally, we modify one test now that mathvariant is no longer emulated via CSS.

* mathml/mathml-in-html5/fonts/mathvariant-transforms.woff: Added.
* mathml/mathml-in-html5/mathvariant-transforms-1-expected.html: Added.
* mathml/mathml-in-html5/mathvariant-transforms-1.html: Added.
* mathml/mathml-in-html5/mathvariant-transforms-2-expected.html: Added.
* mathml/mathml-in-html5/mathvariant-transforms-2.html: Added.
* mathml/presentation/attributes-mathvariant-expected.html: Update this test now that
mathvariant is correctly implemented using character transforms.
* mathml/presentation/mathvariant-inheritance-expected.html: Added.
* mathml/presentation/mathvariant-inheritance.html: Added.
* mathml/presentation/mathvariant-tokens-expected.html: Added.
* mathml/presentation/mathvariant-tokens.html: Added.
* mathml/presentation/mathvariant-dynamic.html: Added.
* mathml/presentation/mathvariant-dynamic-expected.html: Added.

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

3 years agoMarking media/controls/inline-elements-dropoff-order.html as failing on El Capitan
ryanhaddad@apple.com [Mon, 11 Jul 2016 18:31:50 +0000 (18:31 +0000)]
Marking media/controls/inline-elements-dropoff-order.html as failing on El Capitan
https://bugs.webkit.org/show_bug.cgi?id=151287

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years ago[GTK] install-dependencies should not install packages built by jhbuild.
annulen@yandex.ru [Mon, 11 Jul 2016 18:08:53 +0000 (18:08 +0000)]
[GTK] install-dependencies should not install packages built by jhbuild.
https://bugs.webkit.org/show_bug.cgi?id=159628

Reviewed by Michael Catanzaro.

* gtk/install-dependencies:
Don't install icu, harfbuzz, orc, llvm, freetype, fontconfig.

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

3 years agoSystem proxy settings not used when building deps with jhbuild
commit-queue@webkit.org [Mon, 11 Jul 2016 18:05:05 +0000 (18:05 +0000)]
System proxy settings not used when building deps with jhbuild
https://bugs.webkit.org/show_bug.cgi?id=159567

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-07-11
Reviewed by Michael Catanzaro.

This adds the gsettings-desktop-schemas-devel build dep to enable
the libgiognomeproxy.so gio module in glib-networking, which uses
GSettings on org.gnome.system.proxy.
This is needed to query system proxy settings for Gnome desktops.

dconf can be manually added to jhbuild to build the
libdconfsettings.so gio module for GSettings, so that
libgiognomeproxy.so can access system settings.
  https://trac.webkit.org/wiki/WebKitGTK/StartHacking#Workingbehindaproxy

As an alternative to dconf settings, this commit also adds the
libproxy-devel build dep to enable the libgiolibproxy.so module in
glib-networking (suggested by Fujii Hironori).

It is useful to read proxy settings from environment variables.
From a Gnome desktop, one may unset the GNOME_DESKTOP_SESSION_ID
environment variable to force using the envvar module in libproxy.

* gtk/install-dependencies:

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

3 years agoAdd a test for media control dropoff
eric.carlson@apple.com [Mon, 11 Jul 2016 17:46:52 +0000 (17:46 +0000)]
Add a test for media control dropoff
https://bugs.webkit.org/show_bug.cgi?id=151287
<rdar://problem/23544666>

Unreviewed El Capitan-specific test results after r203057.

* platform/mac-elcapitan/media/controls: Added.
* platform/mac-elcapitan/media/controls/inline-elements-dropoff-order-expected.txt: Added.
* platform/mac-yosemite/media/controls: Added.

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

3 years agoChange run-webkit-tests.py and run-jsc-stress-tests to use a smaller JS stack size...
mark.lam@apple.com [Mon, 11 Jul 2016 17:04:14 +0000 (17:04 +0000)]
Change run-webkit-tests.py and run-jsc-stress-tests to use a smaller JS stack size for testing.
https://bugs.webkit.org/show_bug.cgi?id=159524

Reviewed by Michael Saboff.

Tools:

Forced tests to run with only a 1.5M JS stack size instead of the default 4M.
Also fixed up some tests to behave better to work with this new limit.  This
should make stack overflow tests complete sooner.

* Scripts/run-jsc-stress-tests:
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(main):

LayoutTests:

* js/dom/deep-recursion-test.html:
* js/script-tests/stack-overflow-arrity-catch.js:
(funcWith20Args):

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

3 years agoPause small video elements when returning to inline.
commit-queue@webkit.org [Mon, 11 Jul 2016 16:33:53 +0000 (16:33 +0000)]
Pause small video elements when returning to inline.
https://bugs.webkit.org/show_bug.cgi?id=159535

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-07-11
Reviewed by Jer Noble.

Will add a test in a later commit.

When exiting fullscreen, don't allow playback to continue inline if video is too small.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isVideoTooSmallForInlinePlayback): Added.
(WebCore::HTMLMediaElement::exitFullscreen): Pause if video is too small.
* html/HTMLMediaElement.h:

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

3 years agotoNative functions in JSDOMBinding.h should take an ExecState reference instead of...
nael.ouedraogo@crf.canon.fr [Mon, 11 Jul 2016 16:26:00 +0000 (16:26 +0000)]
toNative functions in JSDOMBinding.h should take an ExecState reference instead of pointer
https://bugs.webkit.org/show_bug.cgi?id=159298

Reviewed by Youenn Fablet.

Pass ExecState by reference instead of pointer.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::idbKeyPathFromValue):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSDOMBinding.h: Pass ExecState by reference instead of pointer.
(WebCore::toJSSequence):
(WebCore::NativeValueTraits<String>::nativeValue):
(WebCore::NativeValueTraits<unsigned>::nativeValue):
(WebCore::NativeValueTraits<float>::nativeValue):
(WebCore::NativeValueTraits<double>::nativeValue):
(WebCore::toNativeArray):
(WebCore::toNativeArguments):
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<Vector<T>>::convert):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::fillMessagePortArray):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
(JSValueToNative):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArray):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArrayIsEmpty):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
(WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
(WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
(WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
(WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence2):
(WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
(WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
(WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors5):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionFunc):
(WebCore::jsTestTypedefsPrototypeFunctionNullableArrayArg):
(WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction):
(WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction2):

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

3 years agoUse refs for ResourceLoaders
achristensen@apple.com [Mon, 11 Jul 2016 16:01:04 +0000 (16:01 +0000)]
Use refs for ResourceLoaders
https://bugs.webkit.org/show_bug.cgi?id=159592

Reviewed by Chris Dumez.

Source/WebCore:

No new tests.  No change in behavior except a fixed memory leak in WebKit1.

* loader/LoaderStrategy.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::finishNetworkLoad):
(WebCore::ResourceLoader::setDefersLoading):
(WebCore::ResourceLoader::frameLoader):
(WebCore::ResourceLoader::willSwitchToSubstituteResource):
(WebCore::ResourceLoader::willSendRequestInternal):

Source/WebKit:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(webResourceLoadScheduler):
(WebResourceLoadScheduler::hostForURL):
(WebResourceLoadScheduler::WebResourceLoadScheduler):
(WebResourceLoadScheduler::loadResource):
(WebResourceLoadScheduler::schedulePluginStreamLoad):
(WebResourceLoadScheduler::scheduleLoad):
(WebResourceLoadScheduler::remove):
(WebResourceLoadScheduler::setDefersLoading):
(WebResourceLoadScheduler::crossOriginRedirectReceived):
(WebResourceLoadScheduler::servePendingRequests):
(WebResourceLoadScheduler::resumePendingRequests):
(WebResourceLoadScheduler::HostInformation::priorityToIndex):
(WebResourceLoadScheduler::HostInformation::schedule):
(WebResourceLoadScheduler::HostInformation::addLoadInProgress):
(WebResourceLoadScheduler::HostInformation::remove):
* WebCoreSupport/WebResourceLoadScheduler.h:
(WebResourceLoadScheduler::HostInformation::name):
(WebResourceLoadScheduler::HostInformation::requestsPending):
m_nonHTTPProtocolHost used to be a leaked pointer, and now it's a member variable.

Source/WebKit2:

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
(WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):
(WebKit::WebLoaderStrategy::startLocalLoad):
(WebKit::WebLoaderStrategy::remove):
(WebKit::WebLoaderStrategy::setDefersLoading):
(WebKit::WebLoaderStrategy::crossOriginRedirectReceived):
* WebProcess/Network/WebLoaderStrategy.h:

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

3 years ago[GTK] Whitespace fixes in install-dependencies script
mcatanzaro@igalia.com [Mon, 11 Jul 2016 15:55:57 +0000 (15:55 +0000)]
[GTK] Whitespace fixes in install-dependencies script

Unreviewed.

* gtk/install-dependencies:

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

3 years ago[GTK] Install missing Fedora dependencies
mcatanzaro@igalia.com [Mon, 11 Jul 2016 15:54:43 +0000 (15:54 +0000)]
[GTK] Install missing Fedora dependencies

Unreviewed.

* gtk/install-dependencies:

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

3 years agoUpdate stable cache version in NetworkCache::Storage::deleteOldVersions()
antti@apple.com [Mon, 11 Jul 2016 15:25:37 +0000 (15:25 +0000)]
Update stable cache version in NetworkCache::Storage::deleteOldVersions()
https://bugs.webkit.org/show_bug.cgi?id=159618
rdar://problem/26715745

Reviewed by Chris Dumez.

NetworkCache::Storage::deleteOldVersions() keeps the previous shipped cache version (4) for Mac around so
development WebKit doesn’t clobber system Safari cache. Update this to the current version so old caches
go away in customer systems.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::deleteOldVersions):
* NetworkProcess/cache/NetworkCacheStorage.h:

    Move lastStableVersion to header next to the current version.

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

3 years agoUsing dpi unit in sizes attribute raises SIGSEGV
commit-queue@webkit.org [Mon, 11 Jul 2016 15:08:46 +0000 (15:08 +0000)]
Using dpi unit in sizes attribute raises SIGSEGV
https://bugs.webkit.org/show_bug.cgi?id=159412

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-07-11
Reviewed by Darin Adler.

Source/WebCore:

CSSParser::sourceSize returns a invalid CSSParser::SourceSize
whose length is a null value for a dpi unit value.  Because
CSSParserValue::createCSSValue returns null for a dpi value.

Tests:
    fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html
    imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html

* css/CSSParser.cpp:
(WebCore::CSSParser::sourceSize): Create a CSSPrimitiveValue of
CSS_UNKNOWN if CSSParserValue::createCSSValue returns null.

LayoutTests:

* TestExpectations: Unskip fast/dom/HTMLImageElement/sizes.
* fast/dom/HTMLImageElement/sizes/image-sizes-invalids-expected.txt: Updated.
* fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html: Added a dpi unit test case.
Renumbering element IDs.

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

3 years agoRed and blue colors are swapped in video rendered through WebGL when GSTREAMER_GL...
commit-queue@webkit.org [Mon, 11 Jul 2016 14:44:35 +0000 (14:44 +0000)]
Red and blue colors are swapped in video rendered through WebGL when GSTREAMER_GL is enabled
https://bugs.webkit.org/show_bug.cgi?id=159621

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-07-11
Reviewed by Philippe Normand.

When a video is rendered through WebGL, and GSTREAMER_GL is enabled, red and blue colors are swapped.
This occurs for example with the following videos:
http://www.scirra.com/labs/bugs/webglvideo/
http://www.dailymotion.com/embed/video/x4jiicp?autoplay=1

This is because ImageGStreamerCairo expects video frames in either
BGRA or ARGB, while when GSTREAMER_GL is enabled,
createVideoSinkGL() forces a RGBA format.

Without GSTREAMER_GL, the rendering is fine since
VideoSinkGStreamer uses either BGRA or ARGB.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):

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

3 years ago[GStreamer] remove WEBKIT_DEBUG support
philn@webkit.org [Mon, 11 Jul 2016 14:41:42 +0000 (14:41 +0000)]
[GStreamer] remove WEBKIT_DEBUG support
https://bugs.webkit.org/show_bug.cgi?id=159553

Reviewed by Xabier Rodriguez-Calvar.

Remove the *_MEDIA_MESSAGE macros specific to the GStreamer
platform code and replace them with standard GST_DEBUG macros. In
Debug builds the WEBKIT_DEBUG=Media logs now only contain logs
related with the cross-platform Media element code. If GStreamer
logs are needed, the GST_DEBUG=webkit*:5 environment variable can
be used.

* platform/graphics/gstreamer/GStreamerUtilities.h:
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfStreamChanged):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::commitLoad):
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::pause):
(WebCore::MediaPlayerPrivateGStreamer::duration):
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamer::paused):
(WebCore::MediaPlayerPrivateGStreamer::newTextSample):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable):
(WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded):
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
(WebCore::MediaPlayerPrivateGStreamer::totalBytes):
(WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
(WebCore::MediaPlayerPrivateGStreamerBase::setVolume):
(WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
(WebCore::MediaPlayerPrivateGStreamerOwr::play):
(WebCore::MediaPlayerPrivateGStreamerOwr::pause):
(WebCore::MediaPlayerPrivateGStreamerOwr::currentTime):
(WebCore::MediaPlayerPrivateGStreamerOwr::load):
(WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad):
(WebCore::MediaPlayerPrivateGStreamerOwr::stop):
(WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded):
(WebCore::MediaPlayerPrivateGStreamerOwr::trackMutedChanged):
(WebCore::MediaPlayerPrivateGStreamerOwr::trackSettingsChanged):
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::getLanguageCode):
(WebCore::TrackPrivateBaseGStreamer::getTag):

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

3 years agoAdd a test for media control dropoff
eric.carlson@apple.com [Mon, 11 Jul 2016 14:37:32 +0000 (14:37 +0000)]
Add a test for media control dropoff
https://bugs.webkit.org/show_bug.cgi?id=151287
<rdar://problem/23544666>

Reviewed by Antoine Quint.

Source/WebCore:

Test: media/controls/inline-elements-dropoff-order.html

* Modules/mediacontrols/mediaControlsApple.js: Expose more state to testing.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setAllowsAirPlayForMediaPlayback): Renamed from setWirelessPlaybackDisabled.
(WebCore::InternalSettings::setWirelessPlaybackDisabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests:

* media/controls/inline-elements-dropoff-order-expected.txt: Added.
* media/controls/inline-elements-dropoff-order.html: Added.
* platform/mac-yosemite/media/controls: Added.
* platform/mac-yosemite/media/controls/inline-elements-dropoff-order-expected.txt: Added.
* platform/mac-elcapitan/media/controls: Added.
* platform/mac-elcapitan/media/controls/inline-elements-dropoff-order-expected.txt: Added.

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

3 years ago[GStreamer][GL] crash within triggerRepaint
philn@webkit.org [Mon, 11 Jul 2016 14:35:54 +0000 (14:35 +0000)]
[GStreamer][GL] crash within triggerRepaint
https://bugs.webkit.org/show_bug.cgi?id=159552

Reviewed by Xabier Rodriguez-Calvar.

Ensure the sizeChanged notification is emitted from the main
thread. When GStreamer-GL rendering is enabled the appsink draw
callbacks are fired in a non-main thread.

The WeakPtr support was moved to the player base class so that it
can be used there as well as in the MediaPlayerPrivateGStreamer
sub-class.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(WebCore::MediaPlayerPrivateGStreamer::createWeakPtr): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::createWeakPtr):

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

3 years agoUpdate expectations for some MathML pixel tests on Windows.
fred.wang@free.fr [Mon, 11 Jul 2016 09:47:33 +0000 (09:47 +0000)]
Update expectations for some MathML pixel tests on Windows.

Unreviewed test gardening.

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-11

* platform/win/mathml/opentype/vertical-expected.txt:
* platform/win/mathml/presentation/mo-stretch-expected.txt:
* platform/win/mathml/presentation/roots-expected.txt:
* platform/win/mathml/radical-fallback-expected.txt:

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

3 years agoUpdate expectations for some MathML pixel tests on EFL.
fred.wang@free.fr [Mon, 11 Jul 2016 09:43:14 +0000 (09:43 +0000)]
Update expectations for some MathML pixel tests on EFL.

Unreviewed test gardening.

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-11

* platform/efl/mathml/opentype/vertical-expected.txt:
* platform/efl/mathml/presentation/mo-stretch-expected.txt:
* platform/efl/mathml/presentation/roots-expected.txt:
* platform/efl/mathml/radical-fallback-expected.txt:

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

3 years agoREGRESSION(r202992): JSC varargs tests are broken
utatane.tea@gmail.com [Mon, 11 Jul 2016 09:28:54 +0000 (09:28 +0000)]
REGRESSION(r202992): JSC varargs tests are broken
https://bugs.webkit.org/show_bug.cgi?id=159616

Reviewed by Csaba Osztrogonác.

The substitution miss in r202992 causes varargs tests failures in GTK port.

* jit/SetupVarargsFrame.cpp:
(JSC::emitSetupVarargsFrameFastCase):

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

3 years ago[ES6] Promise.{all,race} no longer use @@species
utatane.tea@gmail.com [Mon, 11 Jul 2016 07:26:34 +0000 (07:26 +0000)]
[ES6] Promise.{all,race} no longer use @@species
https://bugs.webkit.org/show_bug.cgi?id=159615

Reviewed by Keith Miller.

As per the latest ES draft, Promise.{all,race} no longer use @@species.
So, this patch drops FIXMEs.

* builtins/PromiseConstructor.js:
(all):
(race):
* tests/stress/ignore-promise-species.js: Added.
(shouldBe):
(DerivedPromise.prototype.get Symbol):
(DerivedPromise):

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

3 years agoSetting document.title reuses <title>'s textnode child
cdumez@apple.com [Mon, 11 Jul 2016 05:06:24 +0000 (05:06 +0000)]
Setting document.title reuses <title>'s textnode child
https://bugs.webkit.org/show_bug.cgi?id=28864
<rdar://problem/7186473>

Reviewed by Benjamin Poulain.

Source/WebCore:

Setting document.title should be equivalent to setting the 'textContent'
IDL attribute of the <title> element:
- https://html.spec.whatwg.org/multipage/dom.html#document.title

In particular, this means we should always create a new Text node and
replace all the <title>'s children with this new Node, as per:
- https://dom.spec.whatwg.org/#dom-node-textcontent

Previously, WebKit would in some cases reuse the existing <title>'s
Text node and merely update its data.

Firefox and Chrome behave as per the specification so this aligns our
behavior with other major browsers as well.

Test: fast/dom/title-setter-new-text-node.html

* dom/Document.cpp:
(WebCore::Document::setTitle):
- Call Node::setTextContent() instead of HTMLTitleElement::setText(),
  as per the specification.
- Take an ExceptionCode parameter and pass it to Node::setTextContent()
  as it may throw.

* dom/Document.h:
* dom/Document.idl:

* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText):
Update implementation of HTMLTitleElement::setText() to call
setTextContent() as per the specification:
- https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text

* html/HTMLTitleElement.h:
* html/HTMLTitleElement.idl:

* html/ImageDocument.cpp:
(WebCore::ImageDocument::finishedParsing):

* svg/SVGTitleElement.cpp:
* svg/SVGTitleElement.h:
Drop setText() setter which was duplicated from HTMLTitleElement::setText()
now that Document::setTitle() calls SVGTitleElement::setTextContent()
instead.

LayoutTests:

* fast/dom/title-setter-new-text-node-expected.txt: Added.
* fast/dom/title-setter-new-text-node.html: Added.
Add test coverage.

* fast/dom/title-text-property-2-expected.txt:
* fast/dom/title-text-property-expected.txt:
* http/tests/globalhistory/history-delegate-basic-title-expected.txt:
Rebaseline a few tests now that we do not reuse the <title>'s text
node child.

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

3 years agoUnreviewed, rolling out r203037.
commit-queue@webkit.org [Mon, 11 Jul 2016 04:28:03 +0000 (04:28 +0000)]
Unreviewed, rolling out r203037.
https://bugs.webkit.org/show_bug.cgi?id=159614

The JSC tests are breaking in elcapitan-debug-tests-jsc and
elcapitan-release-tests-jsc (Requested by caiolima on
#webkit).

Reverted changeset:

"ECMAScript 2016: %TypedArray%.prototype.includes
implementation"
https://bugs.webkit.org/show_bug.cgi?id=159385
http://trac.webkit.org/changeset/203037

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

3 years agoFix LogicalSelectionOffsetCaches to work with detached render tree.
zalan@apple.com [Mon, 11 Jul 2016 03:58:49 +0000 (03:58 +0000)]
Fix LogicalSelectionOffsetCaches to work with detached render tree.
https://bugs.webkit.org/show_bug.cgi?id=159605
<rdar://problem/27248845>

Reviewed by Brent Fulgham.

Source/WebCore:

When the renderer that is being destroyed is on a selection boundary,
we need to ensure that all its cached pointers across the selection code (e.g. SelectionSubtreeData)
are getting reset. In order to do that, we call clearSelection() on the RenderView.
One of the last steps of clearing selection is to collect the selection gaps. Selection gaps uses this
LogicalSelectionOffsetCaches helper class to collect selection information across blocks.
LogicalSelectionOffsetCaches normally operates on rooted renderers. However we need to ensure sure that
it can also handle renderers that are no longer part of the render tree.

Test: fast/text/selection-on-a-detached-tree.html

* rendering/LogicalSelectionOffsetCaches.h:
(WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock):
(WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::logicalLeftSelectionOffset):
(WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::logicalRightSelectionOffset):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::logicalLeftSelectionOffset):
(WebCore::RenderBlock::logicalRightSelectionOffset):

LayoutTests:

* fast/text/selection-on-a-detached-tree-expected.txt: Added.
* fast/text/selection-on-a-detached-tree.html: Added.

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

3 years agoUpdate mediaIcon.pdf
bdakin@apple.com [Mon, 11 Jul 2016 02:52:07 +0000 (02:52 +0000)]
Update mediaIcon.pdf
https://bugs.webkit.org/show_bug.cgi?id=159613
-and corresponding-
rdar://problem/27268111

Reviewed by Sam Weinig.

* Resources/mediaIcon.pdf: Replaced.

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

3 years agoadoptNode() changes css class to lowercase for document loaded with XHR responseType...
cdumez@apple.com [Sun, 10 Jul 2016 23:28:06 +0000 (23:28 +0000)]
adoptNode() changes css class to lowercase for document loaded with XHR responseType = "document"
https://bugs.webkit.org/show_bug.cgi?id=159555
<rdar://problem/27252541>

Reviewed by Benjamin Poulain.

Source/WebCore:

Follow-up on r203018 which was incomplete. We need to update ElementData's
m_classNames / m_idForStyleResolution when the source document is in strict
mode and the destination document is in quirks mode as well.

Test: fast/dom/Document/adoptNode-quirks-mismatch2.html

* dom/Element.cpp:
(WebCore::Element::didMoveToNewDocument):

LayoutTests:

Add test coverage.

* fast/dom/Document/adoptNode-quirks-mismatch2-expected.txt: Added.
* fast/dom/Document/adoptNode-quirks-mismatch2.html: Added.
* fast/dom/Document/resources/document-noquirks-class.html: Added.
* fast/dom/Document/resources/document-noquirks-id.html: Added.

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

3 years agoRename isEmojiModifier to isEmojiFitzpatrickModifier to better capture its function
weinig@apple.com [Sun, 10 Jul 2016 21:46:34 +0000 (21:46 +0000)]
Rename isEmojiModifier to isEmojiFitzpatrickModifier to better capture its function
https://bugs.webkit.org/show_bug.cgi?id=159610

Reviewed by Dan Bernstein.

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::characterRangeCodePath):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::advanceByCombiningCharacterSequence):
Update for rename.

* platform/text/CharacterProperties.h:
(WebCore::isEmojiGroupCandidate):
(WebCore::isEmojiFitzpatrickModifier):
(WebCore::isVariationSelector):
Rename isEmojiModifier -> isEmojiFitzpatrickModifier. Also add some comments
explaining what the characters these predicate act on to demystify them a bit.

* rendering/RenderText.cpp:
(WebCore::RenderText::previousOffsetForBackwardDeletion):
Update for rename and rename a related variable.

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

3 years agoAdd self to WebKit2 Owners
commit-queue@webkit.org [Sun, 10 Jul 2016 18:50:59 +0000 (18:50 +0000)]
Add self to WebKit2 Owners
https://bugs.webkit.org/show_bug.cgi?id=159499

Patch by Alex Christensen <achristensen@webkit.org> on 2016-07-10
Reviewed by Sam Weinig.

* Owners:

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