WebKit-https.git
4 years ago[JSC] re-implement String#padStart and String#padEnd in JavaScript
caitp@igalia.com [Thu, 28 Apr 2016 21:39:34 +0000 (21:39 +0000)]
[JSC] re-implement String#padStart and String#padEnd in JavaScript
https://bugs.webkit.org/show_bug.cgi?id=157146

Reviewed by Saam Barati.

* builtins/StringPrototype.js:
(repeatCharactersSlowPath):
(padStart):
(padEnd):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation): Deleted.
(JSC::repeatStringPattern): Deleted.
(JSC::padString): Deleted.
(JSC::stringProtoFuncPadEnd): Deleted.
(JSC::stringProtoFuncPadStart): Deleted.

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

4 years agoWeb Inspector: Tweak auto attach initialization on some platforms
commit-queue@webkit.org [Thu, 28 Apr 2016 21:28:10 +0000 (21:28 +0000)]
Web Inspector: Tweak auto attach initialization on some platforms
https://bugs.webkit.org/show_bug.cgi?id=157150
<rdar://problem/21222045>

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

* inspector/EventLoop.cpp:
(Inspector::EventLoop::cycle):
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::updateAutomaticInspectionCandidate):

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

4 years ago[JSC] Unify Math.pow() accross all tiers
benjamin@webkit.org [Thu, 28 Apr 2016 20:50:08 +0000 (20:50 +0000)]
[JSC] Unify Math.pow() accross all tiers
https://bugs.webkit.org/show_bug.cgi?id=157121

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-04-28
Reviewed by Geoffrey Garen.

My previous optimizations of DFG compile time have slowly
regressed Sunspider's math-partial-sums.

What is happenning is baseline used a thunk for Math.pow()
that has a special case for an exponent of -0.5, while
DFG/FTL have other special cases for other exponents.
The faster we get to DFG, the less time we spend in that fast
case for -0.5.

While looking into this, I discovered some correctness issues. Baseline
optimizes y=-0.5 by turning it into 1/sqrt(). DFG/FTL optimize constant
y=0.5 by turning it into sqrt(). The problem is sqrt() behaves differently
for -0 and -Infinity. With sqrt(), negative numbers are undefined,
and the result is NaN. With pow(), they have a result.

Something else that has bothered me for a while is that Math.pow()
with the same arguments give you different results in LLINT, Baseline,
and DFG/FTL. This seems a bit dangerous for numerical stability.

With this patch, I unify the behaviors for all tiers while keeping
the "special cases".

We have pow() that is super slow, but most callers don't need the
full power. We have:
-pow() with an exponent between 0 and 1000 is a fast path implemented
 by multiplication only.
-pow(x, 0.5) is sqrt with special checks for negative values.
-pow(x, -0.5) is sqrt with special checks for negative values.

The C++ implementation handles all those optimizations too. This ensure
you get the same results from LLINT to FTL.

The thunk is eliminated, it was producing incorrect results and only
optimized Sunspider's partial-sums.

DFG gets the optimized integer, 0.5 and -0.5 cases since those are important
for somewhat-hot code. DFG falls back to the C++ code for any non-obvious case.

FTL gets the full C++ implementation inlined in B3. B3 knows how to eliminate
all the dead cases so you get the best if your code is hot enough to reach FTL.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode): Deleted.
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToArithSqrt): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::compileArithPowIntegerFastPath):
(JSC::DFG::SpeculativeJIT::compileArithPow):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArithPow):
* jit/ThunkGenerators.cpp:
(JSC::powThunkGenerator): Deleted.
* jit/ThunkGenerators.h:
* runtime/MathCommon.cpp:
(JSC::operationMathPow):
* runtime/MathCommon.h:
* runtime/VM.cpp:
(JSC::thunkGeneratorForIntrinsic): Deleted.
* tests/stress/math-pow-stable-results.js: Added.
Getting consistent results when tiering up is new.
This test verify that results always remains the same as LLINT.

* tests/stress/math-pow-with-constants.js:
(testPowUsedAsSqrt):
(powUsedAsOneOverSqrt):
(testPowUsedAsOneOverSqrt):
(powUsedAsSquare):
(testPowUsedAsSquare):

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

4 years agoAdd ios-simulator baseline for fast/forms/select-non-native-rendering-direction.html
ryanhaddad@apple.com [Thu, 28 Apr 2016 20:31:12 +0000 (20:31 +0000)]
Add ios-simulator baseline for fast/forms/select-non-native-rendering-direction.html
https://bugs.webkit.org/show_bug.cgi?id=157112

Unreviewed test gardening.

* platform/ios-simulator/fast/forms/select-non-native-rendering-direction-expected.txt: Added.

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

4 years ago<rdar://problem/25986324> WebKit build broken with error: undeclared selector 'childV...
mitz@apple.com [Thu, 28 Apr 2016 19:52:16 +0000 (19:52 +0000)]
<rdar://problem/25986324> WebKit build broken with error: undeclared selector 'childViewControllerForWhitePointAdaptivityStyle'

Fixed the build by removing use of API that no longer does anything.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::setupFullscreen): Revert to using a plain UIViewController.
(createFullScreenVideoRootViewControllerClass): Deleted.
(allocWebFullScreenVideoRootViewControllerInstance): Deleted.

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

4 years agoimported/w3c/web-platform-tests/fetch/nosniff/stylesheet.html is failing on some...
youenn.fablet@crf.canon.fr [Thu, 28 Apr 2016 19:35:30 +0000 (19:35 +0000)]
imported/w3c/web-platform-tests/fetch/nosniff/stylesheet.html is failing on some bots
https://bugs.webkit.org/show_bug.cgi?id=157145

Unreviewed.

* TestExpectations: Marking imported/w3c/web-platform-tests/fetch/nosniff/stylesheet.html as failing and passing.

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

4 years agoREGRESSION(r200163): inspector/indexeddb/requestDatabaseNames.html is flaky on Mac.
beidson@apple.com [Thu, 28 Apr 2016 19:22:21 +0000 (19:22 +0000)]
REGRESSION(r200163): inspector/indexeddb/requestDatabaseNames.html is flaky on Mac.
https://bugs.webkit.org/show_bug.cgi?id=157141

Unreviewed.

Add one more chunk of logging here to add even more supporting evidence to our theory.

* inspector/indexeddb/requestDatabaseNames-expected.txt:
* inspector/indexeddb/requestDatabaseNames.html:

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

4 years agoModern IDB: Reimplement Web Inspector code that was tied to Legacy IDB.
beidson@apple.com [Thu, 28 Apr 2016 18:47:20 +0000 (18:47 +0000)]
Modern IDB: Reimplement Web Inspector code that was tied to Legacy IDB.
https://bugs.webkit.org/show_bug.cgi?id=154686

Reviewed by Alex Christensen.

No new tests (Inspector folks will have to write them if they're possible).

* inspector/InspectorIndexedDBAgent.cpp: Reimplement missing functionality mostly with code that was
  removed in http://trac.webkit.org/changeset/197131/trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp

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

4 years agoFix the Apple Internal OS X build
dbates@webkit.org [Thu, 28 Apr 2016 18:41:50 +0000 (18:41 +0000)]
Fix the Apple Internal OS X build

Source/WebCore:

* platform/graphics/mac/PDFDocumentImageMac.mm:
(WebCore::PDFDocumentImage::drawPDFPage): Ignore deprecation warning for -[PDFPage drawWithBox:].

Source/WebKit/mac:

* WebView/WebPDFView.h: Import PDFKit for definition of protocol PDFViewDelegate.
Forward declare protocol PDFViewDelegate as appropriate. Mark WebPDFView as implementing
protocol PDFViewDelegate.
* WebView/WebPDFView.mm: Move import of PDFKit from here to the header.

Source/WebKit2:

* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _drawPDFDocument:page:atPoint:]): Ignore deprecation warning for -[PDFPage drawWithBox:].
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::drawPDFPage): Ditto.

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

4 years agoDebuggerScope::className() should not assert scope->isValid().
mark.lam@apple.com [Thu, 28 Apr 2016 18:18:58 +0000 (18:18 +0000)]
DebuggerScope::className() should not assert scope->isValid().
https://bugs.webkit.org/show_bug.cgi?id=157143

Reviewed by Keith Miller.

DebuggerScope::className() should not assert scope->isValid() because the
TypeProfiler logs objects it encounters, and may indirectly call
JSObject::calculatedClassName() on those objects later, thereby calling
DebuggerScope::className() on an invalidated DebuggerScope.

The existing handling in DebuggerScope::className() for an invalidated scope
(that returns a null string) is sufficient.

* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::className):

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

4 years agoSkipping media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSec...
ryanhaddad@apple.com [Thu, 28 Apr 2016 17:58:12 +0000 (17:58 +0000)]
Skipping media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html
https://bugs.webkit.org/show_bug.cgi?id=155196

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:

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

4 years agoDrop [UsePointersEvenForNonNullableObjectArguments] from MediaSource interfaces
youenn.fablet@crf.canon.fr [Thu, 28 Apr 2016 17:36:33 +0000 (17:36 +0000)]
Drop [UsePointersEvenForNonNullableObjectArguments] from MediaSource interfaces
https://bugs.webkit.org/show_bug.cgi?id=156904

Reviewed by Darin Adler.

Source/WebCore:

MediaSource::addSourceBuffer will now throw a TypeError if a null parameter is passed.
MediaSource::removeSourceBuffer will now throw a TypeError if a null parameter is passed.
SourceBuffer::appendBuffer will now throw a TypeError if a null parameter is passed.

Did some refactoring to use more references.

Covered by updated test.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::endOfStream):
(WebCore::MediaSource::addSourceBuffer):
(WebCore::MediaSource::removeSourceBuffer):
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/MediaSource.idl:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBuffer):
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBuffer.idl:
* Modules/mediasource/SourceBufferList.cpp:
(WebCore::SourceBufferList::add):
(WebCore::SourceBufferList::remove):
* Modules/mediasource/SourceBufferList.h:

LayoutTests:

* http/tests/media/media-source/mediasource-addsourcebuffer.html: Changing expected exception to TypeError.
* http/tests/media/media-source/mediasource-append-buffer-expected.txt:
* http/tests/media/media-source/mediasource-append-buffer.html: Checking passing null or undefined to
appendBuffer, addSourceBuffer and removeSourceBuffer.
* media/media-source/media-source-addsourcebuffer-expected.txt:
* media/media-source/media-source-addsourcebuffer.html: Removing redundant test.

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

4 years agoDrop [UsePointersEvenForNonNullableObjectArguments] from Node
youenn.fablet@crf.canon.fr [Thu, 28 Apr 2016 17:35:45 +0000 (17:35 +0000)]
Drop [UsePointersEvenForNonNullableObjectArguments] from Node
https://bugs.webkit.org/show_bug.cgi?id=156978

Reviewed by Chris Dumez.

No change of behavior.

* dom/Node.idl: Marking some parameters nullable.

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

4 years agoSet overflow: hidden on ::-webkit-media-controls in mediaControlsApple.css
adachan@apple.com [Thu, 28 Apr 2016 17:34:24 +0000 (17:34 +0000)]
Set overflow: hidden on ::-webkit-media-controls in mediaControlsApple.css
https://bugs.webkit.org/show_bug.cgi?id=157110

Reviewed by Eric Carlson.

Source/WebCore:

Test: fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls.html

This matches what we do in mediaControlsiOS.css.

* Modules/mediacontrols/mediaControlsApple.css:
(::-webkit-media-controls):

LayoutTests:

The style change caused an image only failure for fast/regions/inline-block-inside-anonymous-overflow.html.
Mark that test as image-failure-only and add a new test that's basically a copy of inline-block-inside-anonymous-overflow.html
with the default controls covered so we can still catch layout regressions related to flowing content from region to region.

* fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls-expected.html: Added.
* fast/regions/inline-block-inside-anonymous-overflow-with-covered-controls.html: Added.
* platform/ios-simulator/TestExpectations:
fast/regions/inline-block-inside-anonymous-overflow.html is already marked as image-failure-only
so this new test needs to be marked too.
* platform/mac/TestExpectations:
* platform/mac/media/media-document-audio-repaint-expected.txt:
* platform/mac/media/video-zoom-controls-expected.txt:
Rebaseline test due to style change in mediaControlsApple.css.

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

4 years ago[Fetch API] Import remaining fetch tests
youenn.fablet@crf.canon.fr [Thu, 28 Apr 2016 17:12:42 +0000 (17:12 +0000)]
[Fetch API] Import remaining fetch tests
https://bugs.webkit.org/show_bug.cgi?id=156914

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* resources/ImportExpectations:
* web-platform-tests/fetch/api/cors/cors-basic-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-basic-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-basic-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-basic.html: Added.
* web-platform-tests/fetch/api/cors/cors-basic.js: Added.
* web-platform-tests/fetch/api/cors/cors-cookies-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-cookies-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-cookies.html: Added.
* web-platform-tests/fetch/api/cors/cors-cookies.js: Added.
* web-platform-tests/fetch/api/cors/cors-filtering-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-filtering-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-filtering-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-filtering.html: Added.
* web-platform-tests/fetch/api/cors/cors-filtering.js: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins.html: Added.
* web-platform-tests/fetch/api/cors/cors-multiple-origins.js: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight.html: Added.
* web-platform-tests/fetch/api/cors/cors-no-preflight.js: Added.
* web-platform-tests/fetch/api/cors/cors-origin-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-origin-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-origin-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-origin.html: Added.
* web-platform-tests/fetch/api/cors/cors-origin.js: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.js: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.js: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-status.js: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-preflight-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight.html: Added.
* web-platform-tests/fetch/api/cors/cors-preflight.js: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.html: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.js: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-worker-expected.txt: Added.
* web-platform-tests/fetch/api/cors/cors-redirect-worker.html: Added.
* web-platform-tests/fetch/api/cors/cors-redirect.html: Added.
* web-platform-tests/fetch/api/cors/cors-redirect.js: Added.
* web-platform-tests/fetch/api/cors/w3c-import.log: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic-worker-expected.txt: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic-worker.html: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic.html: Added.
* web-platform-tests/fetch/api/credentials/authentication-basic.js: Added.
* web-platform-tests/fetch/api/credentials/cookies-expected.txt: Added.
* web-platform-tests/fetch/api/credentials/cookies-worker-expected.txt: Added.
* web-platform-tests/fetch/api/credentials/cookies-worker.html: Added.
* web-platform-tests/fetch/api/credentials/cookies.html: Added.
* web-platform-tests/fetch/api/credentials/cookies.js: Added.
* web-platform-tests/fetch/api/credentials/w3c-import.log: Added.
* web-platform-tests/fetch/api/policies/csp-blocked-expected.txt: Added.
* web-platform-tests/fetch/api/policies/csp-blocked-worker-expected.txt: Added.
* web-platform-tests/fetch/api/policies/csp-blocked-worker.html: Added.
* web-platform-tests/fetch/api/policies/csp-blocked.html: Added.
* web-platform-tests/fetch/api/policies/csp-blocked.html.headers: Added.
* web-platform-tests/fetch/api/policies/csp-blocked.js: Added.
* web-platform-tests/fetch/api/policies/csp-blocked.js.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer-worker-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer-worker.html: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer.html: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer.html.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer.js: Added.
* web-platform-tests/fetch/api/policies/referrer-no-referrer.js.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-origin-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-origin-worker-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-origin-worker.html: Added.
* web-platform-tests/fetch/api/policies/referrer-origin.html: Added.
* web-platform-tests/fetch/api/policies/referrer-origin.html.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-origin.js: Added.
* web-platform-tests/fetch/api/policies/referrer-origin.js.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker-expected.txt: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url-worker.html: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url.html: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url.html.headers: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url.js: Added.
* web-platform-tests/fetch/api/policies/referrer-unsafe-url.js.headers: Added.
* web-platform-tests/fetch/api/policies/w3c-import.log: Added.
* web-platform-tests/fetch/api/redirect/redirect-count-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-count-worker.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-count.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-count.js: Added.
* web-platform-tests/fetch/api/redirect/redirect-location-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-location-worker-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-location-worker.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-location.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-location.js: Added.
* web-platform-tests/fetch/api/redirect/redirect-method-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-method-worker.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-method.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-method.js: Added.
* web-platform-tests/fetch/api/redirect/redirect-mode-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt: Added.
* web-platform-tests/fetch/api/redirect/redirect-mode-worker.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-mode.html: Added.
* web-platform-tests/fetch/api/redirect/redirect-mode.js: Added.
* web-platform-tests/fetch/api/redirect/w3c-import.log: Added.
* web-platform-tests/fetch/nosniff/image-expected.txt: Added.
* web-platform-tests/fetch/nosniff/image.html: Added.
* web-platform-tests/fetch/nosniff/importscripts-expected.txt: Added.
* web-platform-tests/fetch/nosniff/importscripts.html: Added.
* web-platform-tests/fetch/nosniff/importscripts.js: Added.
* web-platform-tests/fetch/nosniff/parsing-nosniff-expected.txt: Added.
* web-platform-tests/fetch/nosniff/parsing-nosniff.html: Added.
* web-platform-tests/fetch/nosniff/resources/css.py: Added.
* web-platform-tests/fetch/nosniff/resources/image.py: Added.
* web-platform-tests/fetch/nosniff/resources/js.py: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-first.asis: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-last.asis: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-no-x.asis: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-quoted-single.asis: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-quoted.asis: Added.
* web-platform-tests/fetch/nosniff/resources/nosniff-uppercase.asis: Added.
* web-platform-tests/fetch/nosniff/resources/w3c-import.log: Added.
* web-platform-tests/fetch/nosniff/resources/worker.py: Added.
* web-platform-tests/fetch/nosniff/script-expected.txt: Added.
* web-platform-tests/fetch/nosniff/script.html: Added.
* web-platform-tests/fetch/nosniff/stylesheet-expected.txt: Added.
* web-platform-tests/fetch/nosniff/stylesheet.html: Added.
* web-platform-tests/fetch/nosniff/w3c-import.log: Added.
* web-platform-tests/fetch/nosniff/worker.html: Added.

LayoutTests:

* TestExpectations: Skipping new fetch worker tests as they are
causing other tests to crash (see bug 156737 and bug 157068).
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/fetch/nosniff/stylesheet-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/credentials/authentication-basic-expected.txt: Added.

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

4 years ago[JSC] implement spec changes for String#padStart and String#padEnd
caitp@igalia.com [Thu, 28 Apr 2016 17:05:17 +0000 (17:05 +0000)]
[JSC] implement spec changes for String#padStart and String#padEnd
https://bugs.webkit.org/show_bug.cgi?id=157139

Reviewed by Keith Miller.

Previously, if the fill string was the empty string, it was treated as a
single U+0020 SPACE character. Now, if this occurs, the original string
is returned instead.

Change was discussed at TC39 in March [1], and is reflected in new
test262 tests for the feature.

[1] https://github.com/tc39/tc39-notes/blob/master/es7/2016-03/march-29.md#stringprototypepadstartpadend

* runtime/StringPrototype.cpp:
(JSC::padString):
* tests/es6/String.prototype_methods_String.prototype.padEnd.js:
(TestFillerToString):
(TestFillerEmptyString):
* tests/es6/String.prototype_methods_String.prototype.padStart.js:
(TestFillerToString):
(TestFillerEmptyString):

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

4 years agoFix mistake in custom elements runtime flag
rego@igalia.com [Thu, 28 Apr 2016 17:03:14 +0000 (17:03 +0000)]
Fix mistake in custom elements runtime flag
https://bugs.webkit.org/show_bug.cgi?id=157130

Reviewed by Chris Dumez.

The methods for the custom elements runtime flag were using
the Shadow DOM flag instead.
These methods were introduced in r197921,
it seems it was just a copy&paste mistake.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetCustomElementsEnabled):
(WKPreferencesGetCustomElementsEnabled):

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

4 years ago[Web IDL] Specify default values for optional parameters of type 'DOMString'
cdumez@apple.com [Thu, 28 Apr 2016 15:41:46 +0000 (15:41 +0000)]
[Web IDL] Specify default values for optional parameters of type 'DOMString'
https://bugs.webkit.org/show_bug.cgi?id=157116

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/addTextTrack-expected.txt:

Source/WebCore:

Specify default values for optional parameters of type 'DOMString' so
that this default value is used if the parameter is either omitted or
undefined. For parameters of type DOMString and that are not nullable,
the bindings generator now uses the null string as implicit default
value (unless explicitely specified otherwise in the IDL). This
simplifies the IDL a little and makes it a bit less confusing (it is
a bit weird to see something like "optional DOMString param = null",
considering the parameter is not nullable). I also think it makes
more sense to use the null String() rather than Optional<String> in
this case.

No new tests, existing tests were rebaselined.

* Modules/encryptedmedia/MediaKeys.idl:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor): Deleted.
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/speech/SpeechSynthesisUtterance.idl:
* Modules/websockets/WebSocket.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
(CanUseWTFOptionalForParameter): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue): Deleted.
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
* bindings/scripts/test/TestNamedConstructor.idl:
* css/FontFaceSet.cpp:
* css/FontFaceSet.h:
* css/FontFaceSet.idl:
* css/WebKitCSSMatrix.idl:
* dom/Comment.idl:
* dom/DOMImplementation.idl:
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::clearData):
(WebCore::DataTransfer::getData): Deleted.
* dom/DataTransfer.h:
* dom/Document.idl:
* dom/Text.idl:
* fileapi/FileReader.cpp:
(WebCore::FileReader::readAsDataURL): Deleted.
* fileapi/FileReader.h:
* fileapi/FileReaderSync.h:
* fileapi/FileReaderSync.idl:
* html/HTMLAudioElement.idl:
* html/HTMLInputElement.idl:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addTextTrack):
Throw a TypeError if the 'kind' parameter is not a valid string in the
TextTrackKind enum:
https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement

We previously threw a SYNTAX_ERR instead of a TypeError in such case,
which was not correct as per Web IDL specification.

* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* html/HTMLOptionElement.idl:
* html/HTMLTextAreaElement.idl:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setShadow):
* html/canvas/CanvasRenderingContext2D.h:
* page/Performance.idl:

LayoutTests:

* media/track/w3c/interfaces/HTMLMediaElement/addTextTrack.html:
Resync test from upstream so that it expects a TypeError to be thrown if a
wrong 'kind' parameter is passed, and so that it expects the label / language
parameter to have the empty string as default value.

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

4 years agoCrash for non-static super property call in derived class constructor
gskachkov@gmail.com [Thu, 28 Apr 2016 15:12:10 +0000 (15:12 +0000)]
Crash for non-static super property call in derived class constructor
https://bugs.webkit.org/show_bug.cgi?id=157089

Reviewed by Darin Adler.
Source/JavaScriptCore:

Added tdz check of the 'this' before access to the 'super' for FunctionCallBracketNode,
the same as it was done for FunctionCallDotNode.

* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionCallBracketNode::emitBytecode):

LayoutTests:

* js/class-syntax-super-expected.txt:
* js/script-tests/class-syntax-super.js:

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

4 years agoFactor out the "paint item" logic in RenderListBox into a helper
tonikitoo@webkit.org [Thu, 28 Apr 2016 14:35:24 +0000 (14:35 +0000)]
Factor out the "paint item" logic in RenderListBox into a helper
https://bugs.webkit.org/show_bug.cgi?id=157117

Reviewed by Daniel Bates.

Patch factors out the duplicated painting logic in RenderListBox::paintObject()
into a member function named paintItem.

This is in preparation for bug 156590.
No new tests, since there is no behavior change.

* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItem):
(WebCore::RenderListBox::paintObject):
* rendering/RenderListBox.h:

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

4 years ago[css-grid] Fix typo in CSS class for layout tests
rego@igalia.com [Thu, 28 Apr 2016 14:02:02 +0000 (14:02 +0000)]
[css-grid] Fix typo in CSS class for layout tests
https://bugs.webkit.org/show_bug.cgi?id=157129

Reviewed by Sergio Villar Senin.

CSS class "secondRowFourthColumn" was not actually setting
the second row due to a typo.

The change doesn't affect any test just by chance,
as the auto-placement algorithm is already positioning
those items on the second row.

* fast/css-grid-layout/resources/grid.css:
(.secondRowFourthColumn):

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

4 years agoAX: [ATK] We need to be smarter about flattening and the accessible text implementation
jdiggs@igalia.com [Thu, 28 Apr 2016 13:12:44 +0000 (13:12 +0000)]
AX: [ATK] We need to be smarter about flattening and the accessible text implementation
https://bugs.webkit.org/show_bug.cgi?id=144639

Reviewed by Chris Fleizach.

Source/WebCore:

Defer to WebCore Accessibility more regarding when to include anonymous blocks in the
accessibility tree. Explicitly flatten menu items, headings, list items, and paragraphs
in order to preserve the expected platform behavior for backwards compatibility. Also
map anonymous table parts to DivRole rather than GroupRole for GTK and EFL because ATK
has separate roles for generic text block elements and other generic containers.

Tests: accessibility/gtk/nested-block-element-children.html
       accessibility/gtk/spans-paragraphs-and-divs-tree.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/atk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):

LayoutTests:

Added two new tests and updated three existing tests to reflect the new behavior
regarding inclusion of elements in the accessibility tree and the text value of
included elements.

* accessibility/gtk/nested-block-element-children-expected.txt: Added.
* accessibility/gtk/nested-block-element-children.html: Added.
* accessibility/gtk/spans-paragraphs-and-divs-expected.txt: Updated for new behavior.
* accessibility/gtk/spans-paragraphs-and-divs-tree-expected.txt: Added.
* accessibility/gtk/spans-paragraphs-and-divs-tree.html: Added.
* accessibility/gtk/spans-paragraphs-and-divs.html: Updated for new behavior.
* platform/gtk/accessibility/generated-content-with-display-table-crash-expected.txt: Updated for new behavior.
* platform/gtk/accessibility/gtk/replaced-objects-in-anonymous-blocks-expected.txt: Updated for new behavior.

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

4 years agoRenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from...
fred.wang@free.fr [Thu, 28 Apr 2016 12:20:51 +0000 (12:20 +0000)]
RenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from getDisplayStyleLargeOperator
https://bugs.webkit.org/show_bug.cgi?id=156910

Reviewed by Alejandro G. Castro.

No new tests, the behavior is not changed.

* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::italicCorrection): We do not need to pass m_textContent to
getDisplayStyleLargeOperator.
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths): We use getBaseGlyph and do
not pass m_textContent to getDisplayStyleLargeOperator or findStretchyData.
(WebCore::RenderMathMLOperator::getBaseGlyph): Introduce a helper function to retrieve the
base glyph and do some validity checks.
(WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): We remove the character
parameter as it is always m_textContent.
We use getBaseGlyph and replace primaryFont with baseGlyph.font.
(WebCore::RenderMathMLOperator::findStretchyData): Ditto.
(WebCore::RenderMathMLOperator::updateStyle): We do not pass m_textContent to
getDisplayStyleLargeOperator or findStretchyData.
* rendering/mathml/RenderMathMLOperator.h: Declare getBaseGlyph and remove the parameter
from getDisplayStyleLargeOperator and findStretchyData.

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

4 years agoUnreviewed, rolling out r200185.
commit-queue@webkit.org [Thu, 28 Apr 2016 12:18:23 +0000 (12:18 +0000)]
Unreviewed, rolling out r200185.
https://bugs.webkit.org/show_bug.cgi?id=157131

Bad temporary file added unintentionally (Requested by fredw
on #webkit).

Reverted changeset:

"RenderMathMLOperator refactoring: introduce getBaseGlyph and
remove parameter from getDisplayStyleLargeOperator"
https://bugs.webkit.org/show_bug.cgi?id=156910
http://trac.webkit.org/changeset/200185

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

4 years agoRenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from...
fred.wang@free.fr [Thu, 28 Apr 2016 12:09:38 +0000 (12:09 +0000)]
RenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from getDisplayStyleLargeOperator
https://bugs.webkit.org/show_bug.cgi?id=156910

Reviewed by Alejandro G. Castro.

No new tests, the behavior is not changed.

* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::italicCorrection): We do not need to pass m_textContent
to getDisplayStyleLargeOperator.
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths): We use getBaseGlyph and do
not pass m_textContent to getDisplayStyleLargeOperator or findStretchyData.
(WebCore::RenderMathMLOperator::getBaseGlyph): Introduce a helper function to retrieve the
base glyph and do some validity checks.
(WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): We remove the character
parameter as it is always m_textContent.
We use getBaseGlyph and replace primaryFont with baseGlyph.font.
(WebCore::RenderMathMLOperator::findStretchyData): Ditto.
(WebCore::RenderMathMLOperator::updateStyle): We do not pass m_textContent to
getDisplayStyleLargeOperator or findStretchyData.
* rendering/mathml/RenderMathMLOperator.h: Declare getBaseGlyph and remove the parameter
from getDisplayStyleLargeOperator and findStretchyData.

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

4 years agoREGRESSION(r199659): Web Process crash when RenderTheme::adjustMenuListStyle is calle...
carlosgc@webkit.org [Thu, 28 Apr 2016 10:07:22 +0000 (10:07 +0000)]
REGRESSION(r199659): Web Process crash when RenderTheme::adjustMenuListStyle is called with a null element
https://bugs.webkit.org/show_bug.cgi?id=157127

Reviewed by Sergio Villar Senin.

This happens for example with tests fast/css/appearance-with-pseudo-elements-in-quirks-mode.html and
fast/css/appearance-with-pseudo-elements.html.

* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::adjustMenuListStyle): Do not change the style color if the given element is nullptr.

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

4 years agoUnreviewed. Add missing files to the compilation of GTK+ inspector.
carlosgc@webkit.org [Thu, 28 Apr 2016 10:01:20 +0000 (10:01 +0000)]
Unreviewed. Add missing files to the compilation of GTK+ inspector.

* PlatformGTK.cmake:

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

4 years ago[css-grid] Store auto-repeat information in style
svillar@igalia.com [Thu, 28 Apr 2016 09:27:55 +0000 (09:27 +0000)]
[css-grid] Store auto-repeat information in style
https://bugs.webkit.org/show_bug.cgi?id=157097

Reviewed by Darin Adler.

This is the second step to implement auto-repeat. This patch provides the necessary
machinery to store the auto-repeat data extracted by the parser in the RenderStyle class. We
are not doing anything with that information yet, it will be used later to compute the
number of auto-repeat tracks in a follow up patch.

No new tests required as there is no change in behavior yet (we're just storing the info we
already get from the parser).

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridTrackList): Check also that the auto-repeat list of tracks is empty.
* css/StyleBuilderConverter.h:
(WebCore::createGridLineNamesList): Refactored from createGridTrackList.
(WebCore::StyleBuilderConverter::createGridTrackList): Extract auto-repeat data from the
parser. Also gathered all the out arguments in a single new struct called TracksData.
* css/StyleBuilderCustom.h: Added new macro SET_TRACKS_DATA which properly sets the info
from TracksData struct into style.
(WebCore::StyleBuilderCustom::applyValueWebkitGridTemplateColumns): Store auto-repeat data
in RenderStyle.
(WebCore::StyleBuilderCustom::applyValueWebkitGridTemplateRows): Ditto.
* rendering/style/RenderStyle.h: Add methods and attributes for auto-repeat data.
* rendering/style/RenderStyleConstants.h: New AutoRepeatType enumerated type.
* rendering/style/StyleGridData.cpp:
(WebCore::StyleGridData::StyleGridData): Add auto-repeat data.
* rendering/style/StyleGridData.h:
(WebCore::StyleGridData::operator==): Check also auto-repeat data.

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

4 years ago[css-grid] Fix alignment with content distribution
rego@igalia.com [Thu, 28 Apr 2016 08:54:33 +0000 (08:54 +0000)]
[css-grid] Fix alignment with content distribution
https://bugs.webkit.org/show_bug.cgi?id=156623

Reviewed by Sergio Villar Senin.

Source/WebCore:

We were only subtracting the distribution offset for items spanning
several tracks, but not for items in a single cell.
We should actually subtract the offset in that situation too,
the same that we do for the grid gaps.

Test: fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisOffsetForChild): Subtract distribution
offset like we do for gaps.
(WebCore::RenderGrid::rowAxisOffsetForChild): Ditto.

LayoutTests:

Created new test and renamed the old one as it was only testing
items spanning several cells.

* fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt:
* fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning-expected.txt:
Renamed from fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt.
* fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html:
Renamed from fast/css-grid-layout/grid-content-alignment-and-self-alignment.html.
* fast/css-grid-layout/grid-content-alignment-and-self-alignment.html:

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

4 years agoSkip test LayoutTests/media/video-with-file-url-allowed-by-csp-media-src-star-with...
dbates@webkit.org [Thu, 28 Apr 2016 08:03:24 +0000 (08:03 +0000)]
Skip test LayoutTests/media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html
as it is flaky on the WebKit1 bots.

For completeness, the test video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html
was added in r200155 (<https://bugs.webkit.org/show_bug.cgi?id=157100>). We will look to fix this test in <https://bugs.webkit.org/show_bug.cgi?id=155196>.

* platform/mac-wk1/TestExpectations:

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

4 years agoThe GetterSetter structure needs a globalObject.
mark.lam@apple.com [Thu, 28 Apr 2016 06:54:54 +0000 (06:54 +0000)]
The GetterSetter structure needs a globalObject.
https://bugs.webkit.org/show_bug.cgi?id=157120

Reviewed by Filip Pizlo.

In r199170: <http://trac.webkit.org/r199170>, GetterSetter was promoted from
being a JSCell to a JSObject.  JSObject methods expect their structure to have a
globalObject.  For example, see JSObject::calculatedClassName().  GetterSetter
was previously using a singleton getterSetterStructure owned by the VM.  That
singleton getterSetterStructure is not associated with any globalObjects.  As a
result, JSObject::calculatedClassName() will run into a null globalObject when it
is called on a GetterSetter object.

This patch removes the VM singleton getterSetterStructure, and instead, creates
a getterSetterStructure for each JSGlobalObject.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGStructureRegistrationPhase.cpp:
(JSC::DFG::StructureRegistrationPhase::run):
* runtime/GetterSetter.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::functionStructure):
(JSC::JSGlobalObject::boundFunctionStructure):
(JSC::JSGlobalObject::boundSlotBaseFunctionStructure):
(JSC::JSGlobalObject::getterSetterStructure):
(JSC::JSGlobalObject::nativeStdFunctionStructure):
(JSC::JSGlobalObject::namedFunctionStructure):
(JSC::JSGlobalObject::functionNameOffset):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

4 years agoDon't throttle GuardMalloc on 8-core Macs
ap@apple.com [Thu, 28 Apr 2016 06:46:49 +0000 (06:46 +0000)]
Don't throttle GuardMalloc on 8-core Macs
https://bugs.webkit.org/show_bug.cgi?id=157108

Reviewed by Alex Christensen.

This was making them slower unnecessarily.

* Scripts/webkitpy/port/mac.py: (MacPort.default_child_processes):

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

4 years ago[GTK] Overlay scrollbars with steppers enabled render incorrectly
carlosgc@webkit.org [Thu, 28 Apr 2016 06:20:10 +0000 (06:20 +0000)]
[GTK] Overlay scrollbars with steppers enabled render incorrectly
https://bugs.webkit.org/show_bug.cgi?id=156988

Reviewed by Michael Catanzaro.

Fix rendering of scrollbars when using GTK+ themes having stepper buttons.

* platform/gtk/RenderThemeGadget.cpp:
(WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget): Receive the box orientation as constructor parameter.
(WebCore::RenderThemeBoxGadget::preferredSize): Fix the preferred size calculation taking into account the box orientation.
(WebCore::RenderThemeScrollbarGadget::renderStepper): New method to render scrollbar steppers.
* platform/gtk/RenderThemeGadget.h:
(WebCore::RenderThemeGadget::context): Make this public instead of protected.
* platform/gtk/ScrollAnimatorGtk.cpp:
(WebCore::ScrollAnimatorGtk::updateOverlayScrollbarsOpacity): Invalidate the whole scrollbars instead of just
the thumb when opacity changes, because themes can actually render the trough or even stepper buttons when in
indicator mode too.
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::hasButtons): Properly implement this method instead of returning true unconditionally.
(WebCore::contentsGadgetForLayout): Pass orientation to RenderThemeBoxGadget constructor.
(WebCore::ScrollbarThemeGtk::trackRect): Fix the calculation of the track rect taking stepper buttons into account.
(WebCore::ScrollbarThemeGtk::backButtonRect): Fix the calculation of the stepper button rectangle.
(WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
(WebCore::ScrollbarThemeGtk::paint): Use RenderThemeScrollbarGadget::renderStepper() to render the stepper
buttons, and fix the calculation of the steppers button rectangle.
(WebCore::ScrollbarThemeGtk::handleMousePressEvent): Handle clicks on stepper buttons.
(WebCore::ScrollbarThemeGtk::scrollbarThickness): Fix the calculation of the scrollbar thickness.
(WebCore::ScrollbarThemeGtk::minimumThumbLength): Pass orientation to RenderThemeBoxGadget constructor.
* platform/gtk/ScrollbarThemeGtk.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::menuListColor): Ditto.
(WebCore::RenderThemeGtk::popupInternalPaddingBox): Ditto.
(WebCore::RenderThemeGtk::paintMenuList): Ditto.

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

4 years ago<rdar://problem/25915253> REGRESSION (r199628): Netflix playback fails in Safari...
mitz@apple.com [Thu, 28 Apr 2016 05:41:54 +0000 (05:41 +0000)]
<rdar://problem/25915253> REGRESSION (r199628): Netflix playback fails in Safari Technology Preview with error code S7363-1260-FFFF58D8

Rubber-stamped by Tim Horton.

Reverted r199628.

* Configurations/WebContentService.xcconfig:

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

4 years agoSVG SMIL animations run at less than 60fps
simon.fraser@apple.com [Thu, 28 Apr 2016 05:27:01 +0000 (05:27 +0000)]
SVG SMIL animations run at less than 60fps
https://bugs.webkit.org/show_bug.cgi?id=157119
rdar://problem/25971304

Reviewed by Tim Horton.

If you re-fetch current time while doing animation computations you're gonna have
a bad time.

More specifically, SMILTimeContainer::startTimer() re-fetched elapsedTime() when
computing the delay for the next timer fire, then clamped to 16.667ms, so the timer
would actually be scheduled at intervals greater than desired, causing a ~54fps framerate.

Fix by using the elapsedTime fetched at the start of animation processing.

Tested by iOS content-animation performance tests.

* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::SVGSVGElement): Just cleanup.
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::notifyIntervalsChanged):
(WebCore::SMILTimeContainer::resume):
(WebCore::SMILTimeContainer::startTimer):
(WebCore::SMILTimeContainer::updateAnimations):
* svg/animation/SMILTimeContainer.h:

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

4 years agoBuild fix followup to r200163
beidson@apple.com [Thu, 28 Apr 2016 03:33:45 +0000 (03:33 +0000)]
Build fix followup to r200163

Unreviewed.

* platform/efl/FileSystemEfl.cpp:
(WebCore::stringFromFileSystemRepresentation): At least stub this out for now until EFL folks can do better.

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

4 years agoAssertion failure in bmalloc::vmRevokePermissions(void*, unsigned long).
ggaren@apple.com [Thu, 28 Apr 2016 02:11:18 +0000 (02:11 +0000)]
Assertion failure in bmalloc::vmRevokePermissions(void*, unsigned long).
https://bugs.webkit.org/show_bug.cgi?id=157047

Reviewed by Darin Adler.

* bmalloc/Chunk.h:
(bmalloc::Chunk::Chunk):
(bmalloc::Chunk::get):
(bmalloc::Chunk::offset):
(bmalloc::Chunk::address):
(bmalloc::Object::Object):
(bmalloc::Object::address):
(bmalloc::Object::line):
(bmalloc::Chunk::object): Deleted.
(bmalloc::Object::begin): Deleted.
* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateSmallBumpRangesByObject):
* bmalloc/Object.h:
(bmalloc::Object::chunk):
(bmalloc::Object::offset): Renamed begin() to address() because this is
not an iterator.

* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::allocateSmallChunk): Round up pageSize to a vmPageSize
multiple because pageSize might be smaller than vmPageSize, but we
think the VM system requires vmPageSize-aligned values.

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

4 years agoMove the implementation of Settings::globalConstRedeclarationShouldThrow into the...
sbarati@apple.com [Thu, 28 Apr 2016 01:54:12 +0000 (01:54 +0000)]
Move the implementation of Settings::globalConstRedeclarationShouldThrow into the cpp file
https://bugs.webkit.org/show_bug.cgi?id=157109

Rubber-stamped by Geoffrey Garen.

* page/Settings.cpp:
(WebCore::Settings::networkInterfaceName):
(WebCore::Settings::globalConstRedeclarationShouldThrow):
* page/Settings.h:
(WebCore::Settings::shouldUseHighResolutionTimers):
(WebCore::Settings::backgroundShouldExtendBeyondPage):
(WebCore::Settings::globalConstRedeclarationShouldThrow): Deleted.

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

4 years agoRTL non-native <select> buttons should have arrows on the left
dino@apple.com [Thu, 28 Apr 2016 01:53:31 +0000 (01:53 +0000)]
RTL non-native <select> buttons should have arrows on the left
https://bugs.webkit.org/show_bug.cgi?id=157112
<rdar://problem/25894441>

Reviewed by Simon Fraser.

Source/WebCore:

The <select> elements that are completely rendered by WebCore
(i.e. not the native controls) always assumed that they
were left-to-right.

This change allows the button to handle both directions,
swapping the side the little arrows are rendered on, as
well as the padding of the text label.

Test: fast/forms/select-non-native-rendering-direction.html

* rendering/RenderMenuList.cpp:
(RenderMenuList::clientPaddingLeft): This must take into account
the direction of the element.
(RenderMenuList::clientPaddingRight): Ditto.
* rendering/RenderThemeMac.mm: Change the left and right constants
to use the terms before and after.
(WebCore::RenderThemeMac::paintMenuListButtonDecorations): The left
and right positions must take the direction into account, which
means different calculations.
(WebCore::RenderThemeMac::popupInternalPaddingBox): Similarly for
the padding that is used to position the text label.

LayoutTests:

New test that checks the layout of WebCore-drawn <select>
elements in right-to-left mode.

* fast/forms/select-non-native-rendering-direction.html: Added.
* platform/mac/fast/forms/select-non-native-rendering-direction-expected.png: Added.
* platform/mac/fast/forms/select-non-native-rendering-direction-expected.txt: Added.

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

4 years agoCSS and SVG animations should run at 60fps
simon.fraser@apple.com [Thu, 28 Apr 2016 01:33:14 +0000 (01:33 +0000)]
CSS and SVG animations should run at 60fps
https://bugs.webkit.org/show_bug.cgi?id=157113
rdar://problem/24337280
rdar://problem/24337328

Reviewed by Dean Jackson.

For both CSS and SVG animations we used a 0.025s frame interval, which translates to
40fps. That caused these animations to look extra janky compared with accelerated
animations.

So use a 16.667ms frame interval for both.

Tested by content-animation benchmark tests.

* page/animation/AnimationController.cpp:
* svg/animation/SMILTime.h:
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::updateAnimations):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::calculateNextProgressTime):

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

4 years agoModern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.
beidson@apple.com [Thu, 28 Apr 2016 01:16:28 +0000 (01:16 +0000)]
Modern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.
https://bugs.webkit.org/show_bug.cgi?id=157072

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by changes to existing test).

Implement a new "getAllDatabaseNames" call on IDBFactory.

It is not exposed to the DOM, and is meant solely for internal WebInspector use.

* Modules/indexeddb/DOMWindowIndexedDatabase.h: Export some stuff to WebCoreTestSupport

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):

* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
* Modules/indexeddb/IDBDatabaseIdentifier.h:

* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::getAllDatabaseNames):
* Modules/indexeddb/IDBFactory.h:

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::getAllDatabaseNames):
* Modules/indexeddb/client/IDBConnectionProxy.h:

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
(WebCore::IDBClient::IDBConnectionToServer::didGetAllDatabaseNames):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::getAllDatabaseNames):
(WebCore::IDBServer::IDBServer::performGetAllDatabaseNames): Do the actual work of getting
  the appropriate directory listing and converting the paths to database names.
(WebCore::IDBServer::IDBServer::didGetAllDatabaseNames):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromEncodedFilename): Helper for IDBServer.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::getAllDatabaseNames):
(WebCore::InProcessIDBServer::didGetAllDatabaseNames):
* Modules/indexeddb/shared/InProcessIDBServer.h:

* inspector/InspectorIndexedDBAgent.cpp:
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames): Use the new IDBFactory API to
  asynchronously get the list of database names.

* platform/CrossThreadCopier.cpp:
(WebCore::SecurityOriginData>::copy):
(WebCore::Vector<String>>::copy):
* platform/CrossThreadCopier.h:

* platform/FileSystem.cpp:
(WebCore::decodeFromFilename): Perform the reverse of encodeForFilename.
* platform/FileSystem.h:

* platform/cf/FileSystemCF.cpp:
(WebCore::stringFromFileSystemRepresentation):

* platform/glib/FileSystemGlib.cpp:
(WebCore::stringFromFileSystemRepresentation):

* platform/posix/FileSystemPOSIX.cpp:
(WebCore::lastComponentOfPathIgnoringTrailingSlash): Utility for peeling off the last component
  of a multi-component path.
(WebCore::listDirectory): This was broken when returning filenames with UTF in them. Fix it.

* platform/mac/WebCoreNSURLExtras.mm: Move the static hex digit utility functions to WTF.
(WebCore::userVisibleString):
(WebCore::isUserVisibleURL):
(WebCore::isHexDigit): Deleted.
(WebCore::hexDigit): Deleted.
(WebCore::hexDigitValue): Deleted.

Source/WebKit2:

Handle the process hop for the new getAllDatabaseNames call.

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
(WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:

* Shared/WebCrossThreadCopier.cpp:
(WebCore::SecurityOriginData>::copy): Deleted, as its in WebCore now.
* Shared/WebCrossThreadCopier.h:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::getAllDatabaseNames):
(WebKit::WebIDBConnectionToServer::didGetAllDatabaseNames):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

Source/WTF:

Moved these Hex Digit utilities from WebCore URL code (???),
and add a checked version of getting the hex digit value.

* wtf/HexNumber.h:
(WTF::isHexDigit):
(WTF::uncheckedHexDigit):
(WTF::hexDigitValue):
(WTF::uncheckedHexDigitValue):

LayoutTests:

Add more to this test and re-enable it.

* TestExpectations:
* inspector/indexeddb/requestDatabaseNames-expected.txt:
* inspector/indexeddb/requestDatabaseNames.html:

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

4 years agoRefactor findExplodedTextNodeAtPoint to move core functionality in RenderBlockFlow.
enrica@apple.com [Wed, 27 Apr 2016 23:53:08 +0000 (23:53 +0000)]
Refactor findExplodedTextNodeAtPoint to move core functionality in RenderBlockFlow.
https://bugs.webkit.org/show_bug.cgi?id=157076

Reviewed by Simon Fraser.

* bindings/objc/DOMUIKitExtensions.mm:
(-[DOMNode findExplodedTextNodeAtPoint:]):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::findClosestTextAtAbsolutePoint):
* rendering/RenderBlockFlow.h:
* rendering/RenderText.h:

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

4 years ago[iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actual...
simon.fraser@apple.com [Wed, 27 Apr 2016 23:51:40 +0000 (23:51 +0000)]
[iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable
https://bugs.webkit.org/show_bug.cgi?id=157107
rdar://problem/25943577

Reviewed by Tim Horton.
Source/WebCore:

Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.

* page/FrameView.cpp:
(WebCore::FrameView::adjustTiledBackingScrollability):
* page/Page.h:
(WebCore::Page::enclosedInScrollableAncestorView):
(WebCore::Page::setEnclosedInScrollableAncestorView):
(WebCore::Page::enclosedInScrollView): Deleted.
(WebCore::Page::setEnclosedInScrollView): Deleted.

Source/WebKit2:

We should only fall back to 512x512 tiles if the WKWebView has a UIScrollView ancestor,
and that UIScrollView actually scrolls. This avoids falling back to small tiles in
MobileSafari.

Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.

* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::encode):
(WebKit::VisibleContentRectUpdateInfo::decode):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
(WebKit::operator==):
(WebKit::VisibleContentRectUpdateInfo::enclosedInScrollView): Deleted.
* UIProcess/API/Cocoa/WKWebView.mm:
(scrollViewCanScroll):
(-[WKWebView _updateContentRectsWithState:]):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollView:]): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):

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

4 years agoTest gardening; update results of tests that are marked as flakey.
simon.fraser@apple.com [Wed, 27 Apr 2016 23:51:35 +0000 (23:51 +0000)]
Test gardening; update results of tests that are marked as flakey.

* TestExpectations:
* platform/mac/transitions/cross-fade-background-image-expected.png:
* platform/mac/transitions/cross-fade-background-image-expected.txt: Added.
* platform/mac/transitions/cross-fade-border-image-expected.png:
* platform/mac/transitions/cross-fade-border-image-expected.txt:
* platform/mac/transitions/move-after-transition-expected.png:
* platform/mac/transitions/move-after-transition-expected.txt:

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

4 years ago[SOUP] Implement PlatformCookieJar::addCookie
mcatanzaro@igalia.com [Wed, 27 Apr 2016 23:32:13 +0000 (23:32 +0000)]
[SOUP] Implement PlatformCookieJar::addCookie
https://bugs.webkit.org/show_bug.cgi?id=156295

Reviewed by Carlos Garcia Campos.

* platform/network/soup/CookieJarSoup.cpp:
(WebCore::msToSoupDate):
(WebCore::toSoupCookie):
(WebCore::addCookie):

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

4 years agoLet the bindings generator use WTF::Optional for optional parameters using [Clamp]
cdumez@apple.com [Wed, 27 Apr 2016 23:31:39 +0000 (23:31 +0000)]
Let the bindings generator use WTF::Optional for optional parameters using [Clamp]
https://bugs.webkit.org/show_bug.cgi?id=157077

Reviewed by Darin Adler.

Let the bindings generator use WTF::Optional for optional parameters using [Clamp],
if they do not have a default value.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::close):
* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocket.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(CanUseWTFOptionalForParameter): Deleted.

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

4 years agoSet WebVideoFullscreenInterfaceMac up as a client of WebPlaybackSessionInterfaceMac...
adachan@apple.com [Wed, 27 Apr 2016 23:24:36 +0000 (23:24 +0000)]
Set WebVideoFullscreenInterfaceMac up as a client of WebPlaybackSessionInterfaceMac to listen for playback state changes
https://bugs.webkit.org/show_bug.cgi?id=157008

Reviewed by Jer Noble.

Source/WebCore:

For WebVideoFullscreenInterfaceMac to be notified when the playback rate changes in
WebPlaybackSessionInterfaceMac, add a new WebPlaybackSessionInterfaceMacClient base
class that WebVideoFullscreenInterfaceMac implements, similar to the WebPlaybackSessionInterfaceAVKitClient
on iOS. WebVideoFullscreenInterfaceMac sets itself as a client of WebPlaybackSessionInterfaceMac
so WebPlaybackSessionInterfaceMac can notify WebVideoFullscreenInterfaceMac whenever the
playback rate changes.

* platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface):
We should not change the WebPlaybackSessionModelMediaElement's interface here since WebPlaybackSessionManager
has already set that up when creating the context for this media element.
(WebVideoFullscreenModelVideoElement::setVideoElement):
We should not change the WebPlaybackSessionModelMediaElement's media element here because
this will be called with NULL when the fullscreen context is cleaned up, but the
WebPlaybackSessionModelMediaElement might still need to stay around. We'll make sure the
WebPlaybackSessionModelMediaElement's media element is set when setting up the fullscreen
context in WebVideoFullscreenManager::enterVideoFullscreenForVideoElement().

* platform/mac/WebPlaybackSessionInterfaceMac.h:
(WebCore::WebPlaybackSessionInterfaceMacClient::~WebPlaybackSessionInterfaceMacClient):

* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::setClient):
Set the client. Notify the client about the current playback state.
(WebCore::WebPlaybackSessionInterfaceMac::setRate):
If a client is set, let that client know about the change in playback rate.

* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
Set itself as a client of WebPlaybackSessionInterfaceMac.
(WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac):
Make sure WebPlaybackSessionInterfaceMac won't hold onto a stale pointer to itself.
(WebCore::WebVideoFullscreenInterfaceMac::setRate):
We don't have to update the WebVideoFullscreenInterfaceMac's rate here anymore. The change
in playback rate in WebPlaybackSessionInterfaceMac should trigger
WebVideoFullscreenInterfaceMac::rateChanged() to be called.
(WebCore::WebVideoFullscreenInterfaceMac::rateChanged):
Pass in both the isPlaying state and the playback rate to WebVideoFullscreenInterfaceMacObjC.

Source/WebKit2:

Since WebVideoFullscreenInterfaceMac holds onto WebPlaybackSessionInterfaceMac, we can't let
WebPlaybackSessionManagerProxy unregister the context for that media element while
WebVideoFullscreenInterfaceMac is still using it. WebVideoFullscreenInterfaceMac should add
to the client count for that WebPlaybackSession context.

* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
When the context for the media element is created with the WebVideoFullscreenManagerProxy, it should
add one to the client count for the media element context in WebPlaybackSessionManagerProxy.
(WebKit::WebVideoFullscreenManagerProxy::removeClientForContext):
When WebVideoFullscreenManagerProxy unregisters the context for this media element, it should
subtract one from the client count for the media element context in WebPlaybackSessionManagerProxy.

* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
Bail early if m_controlsManagerContextId is zero. Otherwise, we'd end up sending a
ClearPlaybackControlsManager message to the UI process inadvertently.
(WebKit::WebPlaybackSessionManager::contextIdForMediaElement):
Make sure the model element for the context ID is set to the media element.

* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::createModelAndInterface):
When the context for the media element is created with the WebVideoFullscreenManager, it should
add one to the client count for the media element context in WebPlaybackSessionManager.
(WebKit::WebVideoFullscreenManager::removeContext):
When WebVideoFullscreenManager unregisters the context for this media element, it should
subtract one from the client count for the media element context in WebPlaybackSessionManager.

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

4 years agoModernize platform/CrossThreadCopier.h style.
beidson@apple.com [Wed, 27 Apr 2016 22:53:52 +0000 (22:53 +0000)]
Modernize platform/CrossThreadCopier.h style.
https://bugs.webkit.org/show_bug.cgi?id=157106

Reviewed by Alex Christensen.

No new tests (No change in behavior).

* platform/CrossThreadCopier.h:
(WebCore::CrossThreadCopierPassThrough::copy):
(WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper):
(WebCore::AllowCrossThreadAccessWrapper::value):
(WebCore::AllowCrossThreadAccess):
(WebCore::AllowAccessLaterWrapper::AllowAccessLaterWrapper):
(WebCore::AllowAccessLaterWrapper::value):
(WebCore::AllowAccessLater):

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

4 years agoCSP: Add tests for setting allowContentSecurityPolicySourceStarToMatchAnyProtocol
dbates@webkit.org [Wed, 27 Apr 2016 22:50:02 +0000 (22:50 +0000)]
CSP: Add tests for setting allowContentSecurityPolicySourceStarToMatchAnyProtocol
https://bugs.webkit.org/show_bug.cgi?id=157100

Reviewed by Brent Fulgham.

Add tests to ensure that we do not regress the behavior of setting allowContentSecurityPolicySourceStarToMatchAnyProtocol.
For completeness, this setting was added in r200130 (https://bugs.webkit.org/show_bug.cgi?id=157005) to enable or disable
whether source * can match any protocol as part of a workaround for the iOS apps Ecobee and Quora.

* fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
* fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
* fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
* fast/dom/HTMLImageElement/image-with-file-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
* fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
* fast/dom/HTMLLinkElement/link-with-blob-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
* fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
* fast/dom/HTMLLinkElement/link-with-data-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
* fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Added.
* fast/dom/HTMLLinkElement/link-with-file-url-allowed-by-csp-style-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Added.
* fast/dom/HTMLLinkElement/resources/green-background-color.css: Added.
(#test):
* media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled-expected.html: Copied from LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html.
* media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html: Copied from LayoutTests/media/video-with-file-url-blocked-by-csp-media-src-star.html.
* media/video-with-file-url-blocked-by-csp-media-src-star-expected.html: Substitute "blocked" for "allowed" since the purpose of the corresponding
test is to ensure that we block loading a file URL video.
* media/video-with-file-url-blocked-by-csp-media-src-star.html: Substitute "blocked" for "allowed" since the purpose of this test is to ensure
that we block loading a file URL video. Additionally, register an oncanplaythrough handler instead of an onloadedmetadata handler and call testFinished()
to signal test completion on a zero timer as a means to help ensure that the first frame of the video is drawn should we regress the blocking of a video file URL.
* platform/wk2/TestExpectations: Skip test LayoutTests/fast/dom/HTMLImageElement/image-with-blob-url-allowed-by-csp-img-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html
when using WebKitTestRunner because WebKitTestRunner does not support eventSender.beginDragWithFiles(). See need to fix
<https://bugs.webkit.org/show_bug.cgi?id=64285>.

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

4 years agoWeb Inspector: Missing CSS autocompletion suggestions for -webkit-user-select
commit-queue@webkit.org [Wed, 27 Apr 2016 22:48:23 +0000 (22:48 +0000)]
Web Inspector: Missing CSS autocompletion suggestions for -webkit-user-select
https://bugs.webkit.org/show_bug.cgi?id=157104

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

* UserInterface/Models/CSSKeywordCompletions.js:

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

4 years agoMarking compositing/contents-scale/incremental-change.html as a flaky failure on...
ryanhaddad@apple.com [Wed, 27 Apr 2016 22:36:41 +0000 (22:36 +0000)]
Marking compositing/contents-scale/incremental-change.html as a flaky failure on ios-simulator-wk2
https://bugs.webkit.org/show_bug.cgi?id=157105

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoRemove download message receiver when NetworkProcess crashes
achristensen@apple.com [Wed, 27 Apr 2016 21:39:10 +0000 (21:39 +0000)]
Remove download message receiver when NetworkProcess crashes
https://bugs.webkit.org/show_bug.cgi?id=157102
<rdar://problem/25550106>

Reviewed by Anders Carlsson.

* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::processDidClose):
When the NetworkProcess crashes during a download, we want to remove the message receiver from the map
so we don't get an assertion in ~MessageReceiver in the UIProcess so we do not have a freed
message receiver in the map.

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

4 years agoSpeculative fix for null pointer dereference.
fpizlo@apple.com [Wed, 27 Apr 2016 21:25:15 +0000 (21:25 +0000)]
Speculative fix for null pointer dereference.
rdar://problem/25964854

Reviewed by Michael Saboff.

* platform/mac/Language.mm:
(WebCore::isValidICUCountryCode):

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

4 years agoClean up Font::removeFromSystemFallbackCache()
mmaxfield@apple.com [Wed, 27 Apr 2016 21:07:06 +0000 (21:07 +0000)]
Clean up Font::removeFromSystemFallbackCache()
https://bugs.webkit.org/show_bug.cgi?id=157093

Reviewed by Darin Adler.

Fonts have a bit which represents whether or not the system fallback cache references them.
This bit gets set to 1 when they are inserted into the system fallback cache, but was not
being reset back to 0 when it was removed.

This is benign, since the old codepath has no effect. However, we can speed up the function
by properly updating this bit.

No new tests because there is no behavior change.

* platform/graphics/Font.cpp:
(WebCore::Font::removeFromSystemFallbackCache):

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

4 years agoUnreviewed, Revert r199397 due to PLT regressions
keith_miller@apple.com [Wed, 27 Apr 2016 20:54:37 +0000 (20:54 +0000)]
Unreviewed, Revert r199397 due to PLT regressions

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/ArrayPrototype.js:
(concatSlowPath): Deleted.
(concat): Deleted.
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry): Deleted.
* bytecode/BytecodeIntrinsicRegistry.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
(JSC::DFG::ByteCodeParser::handleIntrinsicCall): Deleted.
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC): Deleted.
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute): Deleted.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
(JSC::DFG::SpeculativeJIT::compileIsJSArray): Deleted.
(JSC::DFG::SpeculativeJIT::compileIsArrayObject): Deleted.
(JSC::DFG::SpeculativeJIT::compileIsArrayConstructor): Deleted.
(JSC::DFG::SpeculativeJIT::compileCallObjectConstructor): Deleted.
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation): Deleted.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile): Deleted.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::compileCallObjectConstructor): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::compileIsArrayObject): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::compileIsJSArray): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::compileIsArrayConstructor): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::isArray): Deleted.
* jit/JITOperations.h:
* jsc.cpp:
(GlobalObject::finishCreation):
(functionDataLogValue): Deleted.
* runtime/ArrayConstructor.cpp:
(JSC::ArrayConstructor::finishCreation):
(JSC::arrayConstructorPrivateFuncIsArrayConstructor):
* runtime/ArrayConstructor.h:
(JSC::isArrayConstructor): Deleted.
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):
(JSC::arrayProtoFuncConcat):
(JSC::arrayProtoPrivateFuncIsJSArray): Deleted.
(JSC::moveElements): Deleted.
(JSC::arrayProtoPrivateFuncConcatMemcpy): Deleted.
(JSC::arrayProtoPrivateFuncAppendMemcpy): Deleted.
* runtime/ArrayPrototype.h:
* runtime/CommonIdentifiers.h:
* runtime/Intrinsic.h:
* runtime/JSArray.cpp:
(JSC::JSArray::fastConcatWith):
(JSC::JSArray::appendMemcpy): Deleted.
* runtime/JSArray.h:
(JSC::JSArray::fastConcatType):
(JSC::JSArray::createStructure):
(JSC::isJSArray):
* runtime/JSArrayInlines.h: Removed.
(JSC::JSArray::memCopyWithIndexingType): Deleted.
(JSC::JSArray::canFastCopy): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSType.h:
* runtime/ObjectConstructor.h:
(JSC::constructObject): Deleted.
* tests/es6.yaml:
* tests/stress/array-concat-spread-object.js: Removed.
(arrayEq): Deleted.
* tests/stress/array-concat-spread-proxy-exception-check.js: Removed.
(arrayEq): Deleted.
* tests/stress/array-concat-spread-proxy.js: Removed.
(arrayEq): Deleted.
* tests/stress/array-concat-with-slow-indexingtypes.js: Removed.
(arrayEq): Deleted.
* tests/stress/array-species-config-array-constructor.js:

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/dom/array-prototype-properties-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:

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

4 years agoFix client certificate authentication with NSURLSession on iOS
commit-queue@webkit.org [Wed, 27 Apr 2016 20:49:14 +0000 (20:49 +0000)]
Fix client certificate authentication with NSURLSession on iOS
https://bugs.webkit.org/show_bug.cgi?id=157094
<rdar://problem/25946859>

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

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
We only want to create a non-persistent credential with the given user and password
and store the user and password in the CredentialStorage if there is a user and password.
We previously only skipped this if we were doing server trust evaluation, in which case
we will have a credential from serverTrustCredential which has no user or password.
When doing client certificate authentication on iOS, this completion handler is called with
a credential with session persistence and also no user or password, so we need to do the same thing.
The reason this was never hit on Mac was because the credential came from tryUseCertificateInfoForChallenge,
which always had persistence none.

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

4 years agoREGRESSION(r200117): Crash in lowerDFGToB3::compileStringReplace()
msaboff@apple.com [Wed, 27 Apr 2016 20:37:49 +0000 (20:37 +0000)]
REGRESSION(r200117): Crash in lowerDFGToB3::compileStringReplace()
https://bugs.webkit.org/show_bug.cgi?id=157099

Reviewed by Saam Barati.

Given that the DFGFixupPhase could mark the edge of child2 as StringUse,
we need to lower that edge appropriately.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringReplace):

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

4 years agoRemove failure expectation for tests that now pass on ios-simulator.
ryanhaddad@apple.com [Wed, 27 Apr 2016 20:11:48 +0000 (20:11 +0000)]
Remove failure expectation for tests that now pass on ios-simulator.

Unreviewed test gardening.

I evaluated all of the unexpected passes from ios-simulator-wk2 and removed failure
expectations where appropriate. Some of the tests only pass on wk2, so some expectations
were moved to the ios-simulator-wk1 file.

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

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

4 years agoAdd layout tests for legacy HTTP headers in WebSockets
commit-queue@webkit.org [Wed, 27 Apr 2016 19:45:17 +0000 (19:45 +0000)]
Add layout tests for legacy HTTP headers in WebSockets
https://bugs.webkit.org/show_bug.cgi?id=157095

Patch by John Wilander <wilander@apple.com> on 2016-04-27
Reviewed by Alexey Proskuryakov.

* http/tests/websocket/tests/hybi/handshake-ok-with-legacy-sec-websocket-response-headers-expected.txt: Added.
* http/tests/websocket/tests/hybi/handshake-ok-with-legacy-sec-websocket-response-headers.html: Added.
* http/tests/websocket/tests/hybi/handshake-ok-with-legacy-sec-websocket-response-headers_wsh.py: Added.
(web_socket_do_extra_handshake):
(web_socket_transfer_data):
    Test for legacy response headers 'Sec-WebSocket-Location' and 'Sec-WebSocket-Origin'.
* http/tests/websocket/tests/hybi/handshake-ok-with-legacy-websocket-response-headers-expected.txt: Added.
* http/tests/websocket/tests/hybi/handshake-ok-with-legacy-websocket-response-headers.html: Added.
* http/tests/websocket/tests/hybi/handshake-ok-with-legacy-websocket-response-headers_wsh.py: Added.
(web_socket_do_extra_handshake):
(web_socket_transfer_data):
    Test for legacy response headers 'WebSocket-Location' and 'WebSocket-Origin'.

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

4 years agoWebRTC: RTCIceCandidate don't need a custom bindings
adam.bergkvist@ericsson.com [Wed, 27 Apr 2016 19:40:52 +0000 (19:40 +0000)]
WebRTC: RTCIceCandidate don't need a custom bindings
https://bugs.webkit.org/show_bug.cgi?id=157074

Reviewed by Eric Carlson.

Source/WebCore:

Removed custom constructor and replaced custom attribute getters with
nullable types. Removed custom binding from builds.

Testing: Updated existing test.

* CMakeLists.txt:
* Modules/mediastream/RTCIceCandidate.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSRTCIceCandidateCustom.cpp: Removed.
(WebCore::constructJSRTCIceCandidate): Deleted.
(WebCore::JSRTCIceCandidate::sdpMid): Deleted.
(WebCore::JSRTCIceCandidate::sdpMLineIndex): Deleted.

LayoutTests:

* fast/mediastream/RTCIceCandidate-expected.txt:
Updated with error messages from generated constructor binding.

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

4 years ago[GTK][EFL] Move WK2 platform code to a common place
csaavedra@igalia.com [Wed, 27 Apr 2016 19:39:35 +0000 (19:39 +0000)]
[GTK][EFL] Move WK2 platform code to a common place
https://bugs.webkit.org/show_bug.cgi?id=157069

Reviewed by Carlos Garcia Campos.

Logging implementation can be shared between EFL and GTK, so move it to unix.
The GTK Module implementation doesn't depend on GTK anyhow so move it to glib.

* Platform/efl/LoggingEfl.cpp: Removed.
(WebKit::logLevelString): Deleted.
* Platform/glib/ModuleGlib.cpp: Renamed from Source/WebKit2/Platform/gtk/ModuleGtk.cpp.
(WebKit::Module::load):
(WebKit::Module::unload):
(WebKit::Module::platformFunctionPointer):
* Platform/gtk/LoggingGtk.cpp:
(WebKit::logLevelString): Deleted.
* Platform/gtk/ModuleGtk.cpp:
(WebKit::Module::load): Deleted.
(WebKit::Module::unload): Deleted.
(WebKit::Module::platformFunctionPointer): Deleted.
* Platform/unix/LoggingUnix.cpp: Renamed from Source/WebKit2/Platform/gtk/LoggingGtk.cpp.
(WebKit::logLevelString):
* PlatformEfl.cmake: Update.
* PlatformGTK.cmake: Update

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

4 years agoFix assertion when downloading with NSURLSession after r198955
commit-queue@webkit.org [Wed, 27 Apr 2016 19:30:01 +0000 (19:30 +0000)]
Fix assertion when downloading with NSURLSession after r198955
https://bugs.webkit.org/show_bug.cgi?id=157051

Patch by Alex Christensen <achristensen@webkit.org> on 2016-04-27
Reviewed by Brady Eidson.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::continueDecidePendingDownloadDestination):

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

4 years agoUnreviewed, rolling out r199383.
cdumez@apple.com [Wed, 27 Apr 2016 19:01:21 +0000 (19:01 +0000)]
Unreviewed, rolling out r199383.

Seems to have caused a 0.5% PLT regression on iOS

Reverted changeset:

"[iOS] do not exit AirPlay when the screen locks"
https://bugs.webkit.org/show_bug.cgi?id=156502
http://trac.webkit.org/changeset/199383

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

4 years agoRemove unnecessary HashMap from Font
mmaxfield@apple.com [Wed, 27 Apr 2016 19:00:38 +0000 (19:00 +0000)]
Remove unnecessary HashMap from Font
https://bugs.webkit.org/show_bug.cgi?id=157090

Reviewed by Darin Adler.

There were only ever a maximum of 2 keys in the hashmap.

No new tests because there is no behavior change.

* platform/graphics/Font.h:
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
(WebCore::Font::getCFStringAttributes):

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

4 years agoAddress feedback from https://bugs.webkit.org/show_bug.cgi?id=157048#c5.
mark.lam@apple.com [Wed, 27 Apr 2016 19:00:22 +0000 (19:00 +0000)]
Address feedback from https://bugs.webkit.org/show_bug.cgi?id=157048#c5.
https://bugs.webkit.org/show_bug.cgi?id=157096

Reviewed by Geoffrey Garen.

1. Check for USE(APPLE_INTERNAL_SDK) instead of __has_include(<mach-o/dyld_priv.h>).
2. Rename webkitFirstSDKVersionWithInitConstructorSupport to
   firstSDKVersionWithInitConstructorSupport.

* API/JSWrapperMap.mm:
(supportsInitMethodConstructors):

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

4 years agoRename DerivedFontData to DerivedFonts
mmaxfield@apple.com [Wed, 27 Apr 2016 18:59:52 +0000 (18:59 +0000)]
Rename DerivedFontData to DerivedFonts
https://bugs.webkit.org/show_bug.cgi?id=157092

Reviewed by Darin Adler.

This is a follow-up to r178510 where we named SimpleFontData to Font.
This patch didn't include renaming DerivedFontData to DerivedFonts.

No new tests because there is no behavior change.

* platform/graphics/Font.cpp:
(WebCore::Font::verticalRightOrientationFont):
(WebCore::Font::uprightOrientationFont):
(WebCore::Font::smallCapsFont):
(WebCore::Font::noSynthesizableFeaturesFont):
(WebCore::Font::emphasisMarkFont):
(WebCore::Font::brokenIdeographFont):
(WebCore::Font::nonSyntheticItalicFont):
(WebCore::Font::DerivedFonts::~DerivedFonts):
(WebCore::Font::DerivedFontData::~DerivedFontData): Deleted.
* platform/graphics/Font.h:
(WebCore::Font::DerivedFonts::DerivedFonts):
(WebCore::Font::DerivedFontData::DerivedFontData): Deleted.

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

4 years agomedia/video-fullscreen-restriction-removed.html is flaky on Mac
eric.carlson@apple.com [Wed, 27 Apr 2016 18:57:56 +0000 (18:57 +0000)]
media/video-fullscreen-restriction-removed.html is flaky on Mac
https://bugs.webkit.org/show_bug.cgi?id=156983

Reviewed by Darin Adler.

* media/video-fullscreen-restriction-removed-expected.txt:
* media/video-fullscreen-restriction-removed.html: Start the test on 'canplaythrough' instead
  of 'loadedmetadata' so playback can begin immediately.

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

4 years agoRestrict the availability of some JSC options to local debug builds only.
mark.lam@apple.com [Wed, 27 Apr 2016 18:36:17 +0000 (18:36 +0000)]
Restrict the availability of some JSC options to local debug builds only.
https://bugs.webkit.org/show_bug.cgi?id=157058

Reviewed by Geoffrey Garen.

1. Each option will be given an availability flag.
2. The functionOverrides and useDollarVM (along with its alias, enableDollarVM)
   will have "Restricted" availability.
3. All other options will have “Normal” availability.
4. Any options with "Restricted" availability will only be accessible if function
   allowRestrictedOptions() returns true.
5. For now, allowRestrictedOptions() always returns false for release builds, and
   true for debug builds.

If an option is "Restricted" and restricted options are not allowed, the VM will
behave semantically as if that option does not exist at all:
1. Option dumps will not show the option.
2. Attempts to set the option will fail as if the option does not exist.

Behind the scene, the option does exist, and is set to its default value
(whatever that may be) once and only once on options initialization.

* runtime/Options.cpp:
(JSC::allowRestrictedOptions):
(JSC::parse):
(JSC::overrideOptionWithHeuristic):
(JSC::Options::initialize):
(JSC::Options::setOptionWithoutAlias):
(JSC::Options::dumpOption):
* runtime/Options.h:
(JSC::Option::type):
(JSC::Option::availability):
(JSC::Option::isOverridden):

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

4 years agoAdd ios-simulator baseline for LayoutTest fast/text/hyphenate-avoid-orphaned-word...
ryanhaddad@apple.com [Wed, 27 Apr 2016 18:21:33 +0000 (18:21 +0000)]
Add ios-simulator baseline for LayoutTest fast/text/hyphenate-avoid-orphaned-word.html

Unreviewed test gardening.

* platform/ios-simulator/fast/text/hyphenate-avoid-orphaned-word-expected.txt: Added.

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

4 years agoEnable separated heap by default on ios
barraclough@apple.com [Wed, 27 Apr 2016 18:03:44 +0000 (18:03 +0000)]
Enable separated heap by default on ios
https://bugs.webkit.org/show_bug.cgi?id=156720
<rdar://problem/25841790>

Unreviewed rollout - caused memory regression.

* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

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

4 years agoFollow up for r200113 on 32bit
benjamin@webkit.org [Wed, 27 Apr 2016 17:58:14 +0000 (17:58 +0000)]
Follow up for r200113 on 32bit

I forgot to do the 32bit counterpart of r200113.
The test fails on the bots.

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-04-27

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

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

4 years agoAdd Caitlin Potter (:caitp) as a committer.
caitp@igalia.com [Wed, 27 Apr 2016 17:53:45 +0000 (17:53 +0000)]
Add Caitlin Potter (:caitp) as a committer.

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

4 years ago[Web IDL] Clean up support for [Clamp] IDL extended attribute
cdumez@apple.com [Wed, 27 Apr 2016 17:05:40 +0000 (17:05 +0000)]
[Web IDL] Clean up support for [Clamp] IDL extended attribute
https://bugs.webkit.org/show_bug.cgi?id=157060

Reviewed by Darin Adler.

Clean up support for [Clamp] IDL extended attribute:
1.  Move [Clamp] handling in the bindings generator from the parameter
    conversion to JSValueToNative(). This has the benefit of
    simplifying the parameter conversion code, adding support for [Clamp]
    on non-readonly attributes, and improving consistency by handling
    this in the same place as [EnforceRange].
2.  Add 'Clamp' to the IntegerConversionConfiguration enumeration in
    JSDOMbindings.h and add support for it to the various toInt*() /
    toUInt*() functions, similary to [EnforceRange]. Call these from
    the generated bindings.

* bindings/js/JSDOMBinding.cpp:
(WebCore::toSmallerInt):
(WebCore::toSmallerUInt):
(WebCore::toInt32EnforceRange):
(WebCore::toInt32Clamp):
(WebCore::toUInt32Clamp):
(WebCore::toUInt32EnforceRange):
(WebCore::toInt64):
(WebCore::toUInt64):
(WebCore::toUInt8): Deleted.
(WebCore::toUInt16): Deleted.
* bindings/js/JSDOMBinding.h:
(WebCore::toInt32):
(WebCore::toUInt32):
* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
(GenerateParametersCheck): Deleted.
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_set_property):
(webkit_dom_test_obj_get_property):
(webkit_dom_test_obj_class_init):
(webkit_dom_test_obj_class_method_with_enforce_range):
(webkit_dom_test_obj_get_clamped_short_attr):
(webkit_dom_test_obj_set_clamped_short_attr):
(webkit_dom_test_obj_get_enforce_range_short_attr):
(webkit_dom_test_obj_set_enforce_range_short_attr):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjClampedShortAttr):
(WebCore::jsTestObjEnforceRangeShortAttr):
(WebCore::setJSTestObjClampedShortAttr):
(WebCore::setJSTestObjEnforceRangeShortAttr):
(WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
(WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
(WebCore::jsTestObjConstructorFunctionClassMethodWithOptional): Deleted.
(WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted.
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
(WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction): Deleted.
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj clampedShortAttr]):
(-[DOMTestObj setClampedShortAttr:]):
(-[DOMTestObj enforceRangeShortAttr]):
(-[DOMTestObj setEnforceRangeShortAttr:]):
(-[DOMTestObj classMethodWithEnforceRange:objArgsLong:]):
* bindings/scripts/test/TestObj.idl:

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

4 years agoCSP: Add app-specific workaround for Ecobee and Quora
dbates@webkit.org [Wed, 27 Apr 2016 16:48:59 +0000 (16:48 +0000)]
CSP: Add app-specific workaround for Ecobee and Quora
https://bugs.webkit.org/show_bug.cgi?id=157005
<rdar://problem/25560776>

Reviewed by Brent Fulgham.

Source/WebCore:

* page/Settings.in: Add setting allowContentSecurityPolicySourceStarToMatchAnyProtocol (disabled by default).
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol): Added.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar): Modified to return true
if ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol() evaluates to true.
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isEcobee): Added.
(WebCore::IOSApplication::isQuora): Added.

Source/WebKit/mac:

* Misc/WebKitVersionChecks.h:
* WebView/WebView.mm:
(shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol): Added.
(-[WebView _preferencesChanged:]): Enable setting allowContentSecurityPolicySourceStarToMatchAnyProtocol
if applicable.

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

4 years agoREGRESSION(r200094): [FreeType] Vertical text is broken after r200094
carlosgc@webkit.org [Wed, 27 Apr 2016 16:47:13 +0000 (16:47 +0000)]
REGRESSION(r200094): [FreeType] Vertical text is broken after r200094
https://bugs.webkit.org/show_bug.cgi?id=157066

Reviewed by Martin Robinson.

Source/WebCore:

The problem is that Freetype implementation needs to call buildScaledFont() when orientation, SyntheticOblique
or size change, but the new static clone methods don't do that. I think it's the time to stop using our own
header for FontPlatformData for the FreeType implementation to make cross-platform changes easier and prevent
regressions like this in the future.

* CMakeLists.txt: Compile FontPlatformData.cpp for all ports.
* PlatformMac.cmake: Remove FontPlatformData.cpp.
* PlatformWin.cmake: Ditto.
* platform/graphics/FontPlatformData.cpp: We need our own clone methods in the FreeType backend.
* platform/graphics/FontPlatformData.h: Move FreeType specific methods and members from the old header file.
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Move CairoFtFaceLocker implementation here from
HarfBuzzFaceCairo.cpp to make it available to other classes, and make it handle the case of
cairo_ft_scaled_font_lock_face() returning nullptr.
(WebCore::CairoFtFaceLocker::~CairoFtFaceLocker):
* platform/graphics/cairo/CairoUtilities.h:
(WebCore::CairoFtFaceLocker::ftFace):
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::findBestFontGivenFallbacks): Move the fallbacks implementation to FontPlatformData where it belongs
and here simply use FontPlatformData::fallbacks().
* platform/graphics/freetype/FontPlatformData.h: Removed.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::FontPlatformData): Remove members already initialized in the header.
(WebCore::FontPlatformData::operator=): Add missing members to be copied.
(WebCore::FontPlatformData::~FontPlatformData): Do not free m_scaledFont manually since we are now using a smart pointer.
(WebCore::FontPlatformData::cloneWithOrientation): Call buildScaledFont() like setOrientation() did.
(WebCore::FontPlatformData::cloneWithSyntheticOblique): Call buildScaledFont() like setSyntheticOblique() did.
(WebCore::FontPlatformData::cloneWithSize): Call buildScaledFont().
(WebCore::FontPlatformData::fallbacks): Lazily initialize fallbacks if needed and return it.
(WebCore::FontPlatformData::platformIsEqual): Only compare FreeType specific members.
(WebCore::FontPlatformData::buildScaledFont): Use RefPtr for m_scaledFont.
(WebCore::FontPlatformData::hasCompatibleCharmap): Use CairoFtFaceLocker.
(WebCore::FontPlatformData::openTypeTable): Update to return RefPtr instead of PassRefPtr and use CairoFtFaceLocker.
(WebCore::FontPlatformData::operator==): Deleted.
(WebCore::FontPlatformData::setOrientation): Deleted.
(WebCore::FontPlatformData::setSyntheticOblique): Deleted.
* platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
(WebCore::GlyphPage::fill): Use CairoFtFaceLocker.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformInit): Ditto.
(WebCore::Font::canRenderCombiningCharacterSequence): Ditto.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::harfBuzzCairoGetTable): Ditto.
(WebCore::CairoFtFaceLocker::CairoFtFaceLocker): Deleted.
(WebCore::CairoFtFaceLocker::lock): Deleted.
(WebCore::CairoFtFaceLocker::~CairoFtFaceLocker): Deleted.

Source/WebKit2:

Add Source/WebCore/platform/graphics/freetype to the list of include dirs, because now FontPlatformData.h
includes FcUniquePtr.h.

* PlatformEfl.cmake:
* PlatformGTK.cmake:

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

4 years agoVersioning.
bshafiei@apple.com [Wed, 27 Apr 2016 15:58:44 +0000 (15:58 +0000)]
Versioning.

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

4 years ago[EFL][GTK] Volume slider only changes volume when thumb is released, not while dragging
hs85.jeong@samsung.com [Wed, 27 Apr 2016 13:14:05 +0000 (13:14 +0000)]
[EFL][GTK] Volume slider only changes volume when thumb is released, not while dragging
https://bugs.webkit.org/show_bug.cgi?id=156970

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Volume slider have to change the volume while dragging the thumb.

Test: media/video-volume-slider-drag.html

* Modules/mediacontrols/mediaControlsBase.js:
(Controller.prototype.createControls): Use the 'input' event instead of the 'change' to
check the changed value correctly.
(Controller.prototype.handleMaxButtonClicked):
(Controller.prototype.handleVolumeSliderInput): Renamed from handleVolumeSliderChange.
(Controller.prototype.handleVolumeSliderChange): Deleted.

LayoutTests:

Removed the passed test.

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:

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

4 years ago[GTK] Fails to build randomly when generating LLIntDesiredOffsets.h
berto@igalia.com [Wed, 27 Apr 2016 11:12:33 +0000 (11:12 +0000)]
[GTK] Fails to build randomly when generating LLIntDesiredOffsets.h
https://bugs.webkit.org/show_bug.cgi?id=155427

Reviewed by Carlos Garcia Campos.

If the build directory contains the -I string, the script that
generates LLIntDesiredOffsets.h will confuse it with an option to
declare an include directory.

In order to avoid that we should only use the arguments that start
with -I when extracting the list of include directories, instead
of using the ones that simply contain that string.

* offlineasm/parser.rb:

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

4 years ago[Fetch API] Remove FetchResponse::redirect overload
youenn.fablet@crf.canon.fr [Wed, 27 Apr 2016 09:37:40 +0000 (09:37 +0000)]
[Fetch API] Remove FetchResponse::redirect overload
https://bugs.webkit.org/show_bug.cgi?id=157034

Reviewed by Darin Adler.

No change of behavior.

* Modules/fetch/FetchResponse.h:

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

4 years ago[Mac][cmake] Unreviewed speculative buildfix after r200116, just for fun.
ossy@webkit.org [Wed, 27 Apr 2016 08:35:24 +0000 (08:35 +0000)]
[Mac][cmake] Unreviewed speculative buildfix after r200116, just for fun.

* PlatformMac.cmake:

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

4 years agoJSC should have an option to allow global const redeclarations
sbarati@apple.com [Wed, 27 Apr 2016 07:12:06 +0000 (07:12 +0000)]
JSC should have an option to allow global const redeclarations
https://bugs.webkit.org/show_bug.cgi?id=157006

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch implements an option that dictates whether
const redeclarations at the program level will throw.
This option defaults to true but allows users of JSC
to set it to false. This option is per VM. This is needed
for backwards compatibility with our old const implementation.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionShadowChickenFunctionsOnStack):
(functionSetGlobalConstRedeclarationShouldNotThrow):
(functionReadline):
* runtime/Executable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
* runtime/JSGlobalLexicalEnvironment.cpp:
(JSC::JSGlobalLexicalEnvironment::put):
(JSC::JSGlobalLexicalEnvironment::isConstVariable):
* runtime/JSGlobalLexicalEnvironment.h:
(JSC::JSGlobalLexicalEnvironment::isEmpty):
* runtime/VM.h:
(JSC::VM::setGlobalConstRedeclarationShouldThrow):
(JSC::VM::globalConstRedeclarationShouldThrow):
* tests/stress/global-const-redeclaration-setting: Added.
* tests/stress/global-const-redeclaration-setting-2.js: Added.
(assert):
* tests/stress/global-const-redeclaration-setting-3.js: Added.
(assert):
(catch):
* tests/stress/global-const-redeclaration-setting-4.js: Added.
(assert):
(catch):
* tests/stress/global-const-redeclaration-setting-5.js: Added.
(assert):
(catch):
* tests/stress/global-const-redeclaration-setting.js: Added.
(assert):
* tests/stress/global-const-redeclaration-setting/first.js: Added.
* tests/stress/global-const-redeclaration-setting/let.js: Added.
* tests/stress/global-const-redeclaration-setting/second.js: Added.
* tests/stress/global-const-redeclaration-setting/strict.js: Added.

Source/WebCore:

This patch makes the JS VM not throw global const redeclaration
errors when the application is iBooks.

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM):
* page/Settings.h:
(WebCore::Settings::shouldUseHighResolutionTimers):
(WebCore::Settings::globalConstRedeclarationShouldThrow):
(WebCore::Settings::backgroundShouldExtendBeyondPage):

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

4 years agoSupport legacy HTTP headers in WebSockets
commit-queue@webkit.org [Wed, 27 Apr 2016 03:21:58 +0000 (03:21 +0000)]
Support legacy HTTP headers in WebSockets
https://bugs.webkit.org/show_bug.cgi?id=157057

Patch by John Wilander <wilander@apple.com> on 2016-04-26
Reviewed by Brent Fulgham.

No new tests since these headers are not officially supported and should not be used.

* platform/network/HTTPHeaderNames.in:
    Added four legacy headers needed to support older WebSockets servers.
    Two of them are in the draft from August 2010: https://whatwg.org/specs/web-socket-protocol/

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

4 years agoUncaught Exception: SecurityError: DOM Exception 18: An attempt was made to break...
commit-queue@webkit.org [Wed, 27 Apr 2016 02:14:35 +0000 (02:14 +0000)]
Uncaught Exception: SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
https://bugs.webkit.org/show_bug.cgi?id=156991
<rdar://problem/25913475>

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

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController init]):
Apply the same universal file access to WebKit1 Web Inspector views that
we apply to WebKit2 views. Explicitly always allow access to storage
for Web Inspector content just in case as we already allow universal
file access.

Source/WebKit2:

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
Explicitly always allow access to storage for Web Inspector content just
in case, as we already allow universal file access.

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

4 years agoRTL native <select> buttons should have arrows on left
dino@apple.com [Wed, 27 Apr 2016 02:02:28 +0000 (02:02 +0000)]
RTL native <select> buttons should have arrows on left
https://bugs.webkit.org/show_bug.cgi?id=157055
<rdar://problem/25894428>

Source/WebCore:

Reviewed by Myles Maxfield.

If the text direction is right-to-left, the select popup
buttons should have the arrows on the left side.

Test: fast/forms/select-writing-direction-natural.html

* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::popupButtonPadding): Takes a direction parameter.
(WebCore::RenderThemeMac::popupInternalPaddingBox): Checks the direction for the padding.
(WebCore::RenderThemeMac::setPopupButtonCellState): Tell the button to put the
arrows on the correct side.
(WebCore::RenderThemeMac::popupButton): Deleted an unnecessary comment.

LayoutTests:

Reviewed by Myles Maxfield.

* fast/forms/select-writing-direction-natural.html: Removed some incorrect
text in the test.
* platform/ios-simulator/fast/forms/select-writing-direction-natural-expected.txt:
* platform/mac/fast/forms/select-writing-direction-natural-expected.png:
* platform/mac/fast/forms/select-writing-direction-natural-expected.txt:
* platform/mac/fast/text/international/bidi-menulist-expected.png:
* platform/mac/fast/text/international/bidi-menulist-expected.txt:
* platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png:
* platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt:

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

4 years ago[ES] Implement RegExp.prototype.@@replace and use it for String.prototype.replace
msaboff@apple.com [Wed, 27 Apr 2016 01:28:03 +0000 (01:28 +0000)]
[ES] Implement RegExp.prototype.@@replace and use it for String.prototype.replace
https://bugs.webkit.org/show_bug.cgi?id=156562

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Added builtins for String.prototype.replace as well as RegExp.prototype[Symbol.replace].

The String.prototype.replace also has an intrinsic, StringPrototypeReplaceIntrinsic.
This original intrinsic was copied to make StringPrototypeReplaceRegExpIntrinsic.
The difference between the two intrinsics is that StringPrototypeReplaceIntrinsic has
the same checks found in the new builtin hasObservableSideEffectsForStringReplace.
We implement these primordial checks for StringPrototypeReplaceIntrinsic in two places.
First, we do a trial check during ByteCode parsing time to see if the current
RegExp.prototype properties have changed from the original.  If they have, we don't
inline the intrinsic.  Later, in the fixup phase, we add nodes to the IR to emit the
checks at runtime.

The new intrinsic StringPrototypeReplaceRegExpIntrinsic is only available via the
private @replaceUsingRegExp, which is called in the String.prototype.replace builtin.
It is only called after hasObservableSideEffectsForStringReplace has been called

Both of these intrinsics are needed, because the JS code containing String.replace() calls
runs initially in the LLint and then the baseline JIT.  Even after the function tiers up
to the DFG JIT, the inlining budget may not allow StringPrototypeReplaceIntrinsic to be inlined.
Having StringPrototypeReplaceRegExpIntrinsic allows for the String.prototype.replace builtin to
get reasonable performance before the other intrinsic is inlined or when it can't.

* builtins/RegExpPrototype.js:
(match):
(getSubstitution):
(replace):
(search):
(split):
* builtins/StringPrototype.js:
(repeat):
(hasObservableSideEffectsForStringReplace):
(intrinsic.StringPrototypeReplaceIntrinsic.replace):
(localeCompare):
New builtins for String.prototype.replace and RegExp.prototype[Symbol.replace].

* bytecode/BytecodeIntrinsicRegistry.cpp:
* bytecode/BytecodeIntrinsicRegistry.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupGetAndSetLocalsInBlock):
(JSC::DFG::FixupPhase::tryAddStringReplacePrimordialChecks):
(JSC::DFG::FixupPhase::checkArray):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::getRegExpPrototypeProperty):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::getRegExpPrototypeProperty):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
* runtime/CommonIdentifiers.h:
* runtime/Intrinsic.h:
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
(JSC::replace):
(JSC::stringProtoFuncReplaceUsingRegExp):
(JSC::stringProtoFuncReplaceUsingStringSearch):
(JSC::operationStringProtoFuncReplaceGeneric):
(JSC::stringProtoFuncReplace): Deleted.
Added StringReplaceRegExp intrinsic.  Added checks for RegExp profiled arguments to StringReplace
that mirror what is in hasObservableSideEffectsForStringReplace().  If we aren't able to add the
checks, we OSR exit.  Add Graph::getPrimordialRegExpPrototypeProperty() as a helper to get the
primordial values from RegExp.prototype.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): Added @regExpPrototypeSymbolReplace and
@hasObservableSideEffectsForStringReplace here instead og String.prototype so that we reduce the
number of objects we have to traverse.

* tests/es6.yaml: Changed expectations for the various replace related tests to passing.

* tests/stress/regexp-replace-proxy.js:
(assert):
(let.getProxyNullExec.new.Proxy):
(let.getSetProxyNullExec.new.Proxy):
(get resetTracking):
(let.getSetProxyMatches_comma.new.Proxy):
(set get getSetProxyNullExec):
(let.getSetProxyReplace_phoneNumber.new.Proxy):
(set get getSetProxyMatches_comma):
(let.getSetProxyReplaceUnicode_digit_nonGreedy.new.Proxy):
(set get resetTracking):
* tests/stress/string-replace-proxy.js:
(assert):
(let.getSetProxyReplace.new.Proxy.replace):
New tests.

LayoutTests:

Updated tests.  Needed to update js/regress-141098.js test, because builtins are
only compilied when called.  This test checks behavior at or near running out of
stack space.  It turns out that String.replace is used by the -pre.js test harness
and I was running out of stack space when compiling the String.prototype.replace
builting.  Therefore, I added a call to testPassed() to precompile String.replace.

* js/Object-getOwnPropertyNames-expected.txt:
* js/regress-141098-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/regress-141098.js:
(probeAndRecurse):
* fast/profiler/nested-start-and-stop-profiler-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/dom/string-prototype-properties-expected.txt:
* js/regress-141098-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/regress-141098.js:
(probeAndRecurse):
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.11_String.prototype.replace/S15.5.4.11_A1_T3-expected.txt:

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

4 years ago[WK2] [OS X] Create API for switching RTL scrollbar policy
mmaxfield@apple.com [Wed, 27 Apr 2016 01:25:26 +0000 (01:25 +0000)]
[WK2] [OS X] Create API for switching RTL scrollbar policy
https://bugs.webkit.org/show_bug.cgi?id=156948
<rdar://problem/25707757>

Reviewed by Darin Adler.

Source/WebCore:

There are two schools of thought for where to put scrollbars in RTL environments.
The first is that we should obey the content's "dir" attribute, specified on each
element. The second is that we should be consistent with the platform (AppKit's)
behavior.

There are some situations where the placement should be done according to the
content. For example, this policy would be used in web browsers.

However, there are also places where web content is designed to fit seamlessly
amongst native content. In this situation, the placement of the scrollbars should
be done according to the view.

Because WebKit doesn't know which of these situations it is operating within, this
patch adds a new API property, userInterfaceDirectionPolicy, to
WKWebViewConfigurationPolicy. This allows clients to instruct us which policy to
abide by. It is plumbed to the web process inside the WebPreferencesStore and is
ultimately held inside the Page's Settings object.

This Setting is consulted by RenderLayerModelObject, which serves as a good
centralized place for this policy implementation. This is the class which decides
if we should be consulting its RenderStyle or the platform itself when we decide
where to put the scrollbars.

Putting this decision inside the renderer is important because ScrollableArea
often needs to know if scrollbars should be put on the left, but ScrollableArea
doesn't know anything about RenderStyles. Therefore, the renderer must be the
intermediary between ScrollableArea and the RenderStyle. (ScrollableArea also
doesn't directly know anything about renderers either; however, each of the
subclasses knows about an appropriate renderer.) Therefore, ScrollableArea gets
a new virtual method which is implemented by the RenderLayerModelObject.

Tests: fast/scrolling/rtl-scrollbars*.html

* WebCore.xcodeproj/project.pbxproj: ScrollableAreaMac.mm is no longer necessary.
* page/FrameView.cpp:
(WebCore::FrameView::shouldPlaceBlockDirectionScrollbarOnLeft): Overridden
ScrollableArea function.
* page/FrameView.h:
* page/Settings.h:
* page/Settings.in:
* platform/ScrollView.cpp: Adding two new settings: One to know if we should
consult with the RenderStyle or the platform, and the other is whether or not
the platform considers itself to be RTL.
(WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin): Update to
use new mechanism.
(WebCore::ScrollView::updateScrollbars): Ditto.
(WebCore::ScrollView::scrollCornerRect): Ditto.
(WebCore::ScrollView::locationOfContents): Ditto.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted. This was the old
mechanism.
(WebCore::ScrollableArea::systemLanguageIsRTL): Deleted. Ditto.
* platform/ScrollableArea.h:
* platform/mac/ScrollableAreaMac.mm: Removed.
(WebCore::ScrollableArea::verticalScrollbarIsOnLeft): Deleted.
(WebCore::ScrollableArea::systemLanguageIsRTL): Deleted.
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::didCreateScrollerImp): Update to use new
mechanism.
* platform/text/WritingMode.h: These enums should match what's in WebKit2.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::logicalLeftOffsetForContent): Update to use new mechanism.
(WebCore::RenderBlock::logicalRightOffsetForContent): Ditto.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild): Ditto.
* rendering/RenderBox.cpp: Ditto.
(WebCore::RenderBox::contentBoxRect):
(WebCore::RenderBox::overflowClipRect):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::layoutOverflowRectForPropagation):
* rendering/RenderBoxModelObject.cpp: Ditto.
(WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize): Ditto.
(WebCore::cornerStart): Migrate to use references.
(WebCore::cornerRect): Ditto.
(WebCore::RenderLayer::scrollCornerRect): Ditto.
(WebCore::resizerCornerRect): Ditto.
(WebCore::RenderLayer::scrollCornerAndResizerRect): Ditto.
(WebCore::RenderLayer::verticalScrollbarStart): Update to use new mechanism.
(WebCore::RenderLayer::horizontalScrollbarStart): Ditto.
(WebCore::RenderLayer::offsetFromResizeCorner): Ditto.
(WebCore::RenderLayer::positionOverflowControls): Migrate to use references.
(WebCore::RenderLayer::computeScrollDimensions): Ditto.
(WebCore::RenderLayer::overflowControlsIntersectRect): Ditto.
(WebCore::RenderLayer::drawPlatformResizerImage): Update to use new mechanism.
(WebCore::RenderLayer::paintResizer): Migrate to use references.
(WebCore::RenderLayer::isPointInResizeControl): Ditto.
(WebCore::RenderLayer::hitTestOverflowControls): Ditto.
(WebCore::RenderLayer::hitTestResizerInFragments): Ditto.
* rendering/RenderLayer.h: ScrollableArea override
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::positionForClipLayer): Update to use new
mechanism.
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft):
This is the meat of this patch. This is where we decide if we should be
interrogating the RenderStyle or the underlying platform.
* rendering/RenderLayerModelObject.h:
* rendering/RenderListBox.cpp: Update to use new mechanism.
(WebCore::RenderListBox::itemBoundingBoxRect):
(WebCore::RenderListBox::paintScrollbar):
(WebCore::RenderListBox::isPointInOverflowControl):
(WebCore::RenderListBox::listIndexAtOffset):
(WebCore::RenderListBox::controlClipRect):
(WebCore::RenderListBox::invalidateScrollbarRect):
(WebCore::RenderListBox::convertFromScrollbarToContainingView):
(WebCore::RenderListBox::convertFromContainingViewToScrollbar):
* rendering/RenderListBox.h:
* rendering/RenderView.cpp: Ditto.
(WebCore::RenderView::repaintViewRectangle):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLeft): This
function is now much dumber. It just inspects its own style.
* testing/InternalSettings.cpp: Allow mocking.
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::verticalScrollbarLocationPolicy):
(WebCore::InternalSettings::setVerticalScrollbarLocationPolicy):
(WebCore::InternalSettings::systemLayoutDirection):
(WebCore::InternalSettings::setSystemLayoutDirection):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit2:

Add the new API.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):
* UIProcess/WebPageProxy.cpp:
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

Update tests to use new RTL scrollbar mechanism.

* fast/scrolling/rtl-scrollbars-animation-property.html:
* fast/scrolling/rtl-scrollbars-elementFromPoint-static.html:
* fast/scrolling/rtl-scrollbars-elementFromPoint.html:
* fast/scrolling/rtl-scrollbars-expected.html:
* fast/scrolling/rtl-scrollbars-iframe-offset-expected.html:
* fast/scrolling/rtl-scrollbars-iframe-offset.html:
* fast/scrolling/rtl-scrollbars-iframe-position-absolute.html:
* fast/scrolling/rtl-scrollbars-iframe-scrolled-expected.html:
* fast/scrolling/rtl-scrollbars-iframe-scrolled.html:
* fast/scrolling/rtl-scrollbars-iframe.html:
* fast/scrolling/rtl-scrollbars-listbox-expected.html:
* fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html:
* fast/scrolling/rtl-scrollbars-listbox-scroll.html:
* fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html:
* fast/scrolling/rtl-scrollbars-listbox-select-left.html:
* fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html:
* fast/scrolling/rtl-scrollbars-listbox-select-right.html:
* fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html:
* fast/scrolling/rtl-scrollbars-listbox-simple.html:
* fast/scrolling/rtl-scrollbars-listbox.html:
* fast/scrolling/rtl-scrollbars-overflow-contents-expected.html:
* fast/scrolling/rtl-scrollbars-overflow-contents.html:
* fast/scrolling/rtl-scrollbars-overflow-dir-rtl-expected.html:
* fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html:
* fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html:
* fast/scrolling/rtl-scrollbars-overflow-expected.html:
* fast/scrolling/rtl-scrollbars-overflow-padding-expected.html:
* fast/scrolling/rtl-scrollbars-overflow-padding.html:
* fast/scrolling/rtl-scrollbars-overflow-position-absolute-expected.html:
* fast/scrolling/rtl-scrollbars-overflow-position-absolute.html:
* fast/scrolling/rtl-scrollbars-overflow-simple-expected-mismatch.html:
* fast/scrolling/rtl-scrollbars-overflow-simple.html:
* fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled-expected.html:
* fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html:
* fast/scrolling/rtl-scrollbars-overflow.html:
* fast/scrolling/rtl-scrollbars-overlay-no-push-contents-expected.html:
* fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html:
* fast/scrolling/rtl-scrollbars-position-absolute-expected.html:
* fast/scrolling/rtl-scrollbars-position-absolute.html:
* fast/scrolling/rtl-scrollbars-position-fixed-expected.html:
* fast/scrolling/rtl-scrollbars-position-fixed.html:
* fast/scrolling/rtl-scrollbars-positioning-expected.html:
* fast/scrolling/rtl-scrollbars-positioning.html:
* fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html:
* fast/scrolling/rtl-scrollbars-simple.html:
* fast/scrolling/rtl-scrollbars-sticky-document-2-expected.html:
* fast/scrolling/rtl-scrollbars-sticky-document-2.html:
* fast/scrolling/rtl-scrollbars-sticky-document-expected.html:
* fast/scrolling/rtl-scrollbars-sticky-document.html:
* fast/scrolling/rtl-scrollbars-sticky-iframe-2-expected.html:
* fast/scrolling/rtl-scrollbars-sticky-iframe-2.html:
* fast/scrolling/rtl-scrollbars-sticky-iframe-expected.html:
* fast/scrolling/rtl-scrollbars-sticky-iframe.html:
* fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2-expected.html:
* fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-2.html:
* fast/scrolling/rtl-scrollbars-sticky-overflow-scroll-expected.html:
* fast/scrolling/rtl-scrollbars-sticky-overflow-scroll.html:
* fast/scrolling/rtl-scrollbars-text-selection-expected.html:
* fast/scrolling/rtl-scrollbars-text-selection-scrolled-expected.html:
* fast/scrolling/rtl-scrollbars-text-selection-scrolled.html:
* fast/scrolling/rtl-scrollbars-text-selection.html:
* fast/scrolling/rtl-scrollbars.html:
* platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.png: Added.

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

4 years agoGardening: speculative build fix.
mark.lam@apple.com [Wed, 27 Apr 2016 00:47:45 +0000 (00:47 +0000)]
Gardening: speculative build fix.

Not reviewed.

* API/JSWrapperMap.mm:

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

4 years agoUpdate the compatibility version check for the ObjC API's InitConstructorSupport...
mark.lam@apple.com [Wed, 27 Apr 2016 00:30:18 +0000 (00:30 +0000)]
Update the compatibility version check for the ObjC API's InitConstructorSupport to use dyld_get_program_sdk_version().
https://bugs.webkit.org/show_bug.cgi?id=157048

Reviewed by Geoffrey Garen.

* API/JSWrapperMap.mm:
(supportsInitMethodConstructors):
(getJSExportProtocol):

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

4 years ago[JSC] GetByVal on Undecided use its children before its OSR Exit
commit-queue@webkit.org [Tue, 26 Apr 2016 23:26:19 +0000 (23:26 +0000)]
[JSC] GetByVal on Undecided use its children before its OSR Exit
https://bugs.webkit.org/show_bug.cgi?id=157046

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

Very silly bug: GetByVal on Undecided uses its children before
the speculationCheck(). If we fail the speculation, we have already
lost how to recover the values.

The existing tests did not catch this because we tier up to B3
before such Exits happen. B3 has explicit liveness and did not suffer
from this bug.
The new test has a smaller warmup to exercise the OSR Exit in DFG
instead of FTL.

* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* tests/stress/get-by-val-on-undecided-out-of-bounds.js: Added.
(string_appeared_here.opaqueGetByValKnownArray):

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

4 years agoUnreviewed: add myself to the committers list.
annulen@yandex.ru [Tue, 26 Apr 2016 23:09:57 +0000 (23:09 +0000)]
Unreviewed: add myself to the committers list.

* Scripts/webkitpy/common/config/contributors.json:

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

4 years agoUpdate tests in web-platform-tests/html/semantics/scripting-1/
rniwa@webkit.org [Tue, 26 Apr 2016 23:03:13 +0000 (23:03 +0000)]
Update tests in web-platform-tests/html/semantics/scripting-1/
https://bugs.webkit.org/show_bug.cgi?id=157026

Reviewed by Darin Adler.

Reimported tests under web-platform-tests/html/semantics/scripting-1/ as of d5a4c5bdf8a1837b4fcf50bbd2efd4150ddafa99.

* web-platform-tests/html/semantics/scripting-1/the-script-element/async_001-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_001.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_002-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_002.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_003-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_003.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_004-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_004.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_005-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_005.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_006-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_006.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_007-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_007.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_008-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_008.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_009-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_009.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_010-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_010.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_011-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/async_011.htm: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/external-script-utf8.js: Added.
(window.getSomeString):
* web-platform-tests/html/semantics/scripting-1/the-script-element/external-script-windows1250.js: Added.
(window.getSomeString):
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/base-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/base.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/test.js: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/alpha/w3c-import.log: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/beta: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/beta/test.js: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/beta/w3c-import.log: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/empty.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/failure-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/failure.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/unreachable.js: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/fetch-src/w3c-import.log: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-01-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-01.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-02-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-charset-02.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-2.py: Added.
(main):
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed-expected.txt: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.html: Added.
* web-platform-tests/html/semantics/scripting-1/the-script-element/script-not-found-not-executed.py: Added.
(main):
* web-platform-tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py: Added.
(main):
* web-platform-tests/html/semantics/scripting-1/the-script-element/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document-expected.txt:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/node-document.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/template-child-nodes.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-parsing-xhtml-documents/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-serializing-xhtml-documents/outerhtml.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-serializing-xhtml-documents/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-css-user-agent-style-sheet/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/template-clone-children.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/templates-copy-document-owner.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/additions-to-the-steps-to-clone-a-node/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-document-type.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-001.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents-owner-test-002.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/template-contents.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/definitions/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/innerhtml-on-templates/innerhtml.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/innerhtml-on-templates/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/resources/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/serializing-html-templates/outerhtml.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/serializing-html-templates/w3c-import.log:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/content-attribute.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/node-document-changes.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant-expected.txt:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-content-node-document.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-content.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-body.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-head.html:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/w3c-import.log:

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

4 years ago[Web IDL] Specify default values for optional parameters of type 'unsigned long'
cdumez@apple.com [Tue, 26 Apr 2016 22:53:54 +0000 (22:53 +0000)]
[Web IDL] Specify default values for optional parameters of type 'unsigned long'
https://bugs.webkit.org/show_bug.cgi?id=157043

Reviewed by Alex Christensen.

Specify default values for optional parameters of type 'unsigned long' and let
the bindings generator use WTF::Optional<> for the parameters that do not have
such default value.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::createScriptProcessor): Deleted.
(WebCore::AudioContext::createChannelSplitter): Deleted.
(WebCore::AudioContext::createChannelMerger): Deleted.
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/AudioContext.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(CanUseWTFOptionalForParameter): Deleted.
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::addRule):
* css/CSSStyleSheet.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::addRule):

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

4 years agoFix text in log files autogenerated by import-w3c-tests
rniwa@webkit.org [Tue, 26 Apr 2016 22:16:00 +0000 (22:16 +0000)]
Fix text in log files autogenerated by import-w3c-tests
https://bugs.webkit.org/show_bug.cgi?id=157021

Unreviewed. Fixing the second typo.

* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.write_import_log):

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

4 years agoASSERTION FAILED: m_templateInsertionModes.isEmpty() in WebCore::HTMLTreeBuilder...
rniwa@webkit.org [Tue, 26 Apr 2016 22:07:27 +0000 (22:07 +0000)]
ASSERTION FAILED: m_templateInsertionModes.isEmpty() in WebCore::HTMLTreeBuilder::finished
https://bugs.webkit.org/show_bug.cgi?id=143519

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaselined the tests.

* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant-expected.txt:
* web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset-expected.txt:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/end-tag-frameset-expected.txt:

Source/WebCore:

The assertion failure was caused by our parser inconsistently following the spec. Fixed it by making our HTML parser
match the latest HTML5 specification. See inline comments below.

Tests: fast/dom/HTMLTemplateElement/parsing-template-with-frameset.html
       html5lib/generated/run-template-data.html
       html5lib/generated/run-template-write.html
       imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-as-a-descendant.html
       imported/w3c/web-platform-tests/html/semantics/scripting-1/the-template-element/template-element/template-descendant-frameset.html
       imported/w3c/web-platform-tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/end-tag-frameset.html

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody): When parsing a template element for 'in body' insertion mode,
we process the token using the rules for 'in head' insertion mode, which sets the frameset-ok flag to "not ok".
In addition, 'in template' insertion mode should not special case a start tag whose tag name is "frame". Instead,
fallback to using 'in body' insertion mode.
https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
(WebCore::HTMLTreeBuilder::processStartTag): 'in frameset' insertion mode should not special case a start tag whose
tag name is "template": https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inframeset
(WebCore::HTMLTreeBuilder::processEndTag): Ditto for an end tag whose name is "template".
(WebCore::HTMLTreeBuilder::processStartTagForInHead): When parsing a template element in 'in head' inserting mode,
we set the frameset-ok flag to "not ok": https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead

LayoutTests:

Rebaselined the html5lib tests (now passes all the test cases!) and added a regression test for an assertion.

* fast/dom/HTMLTemplateElement/parsing-template-with-frameset-expected.txt: Added.
* fast/dom/HTMLTemplateElement/parsing-template-with-frameset.html: Added.
* html5lib/generated/run-template-data-expected.txt:
* html5lib/generated/run-template-write-expected.txt:

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

4 years ago[WinCairo][ANGLE] Display object is not created.
peavo@outlook.com [Tue, 26 Apr 2016 21:47:20 +0000 (21:47 +0000)]
[WinCairo][ANGLE] Display object is not created.
https://bugs.webkit.org/show_bug.cgi?id=157042

Reviewed by Alex Christensen.

The CreateDisplayFromAttribs function will not create a DisplayD3D object when the requested
type is EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE, because ANGLE_ENABLE_OPENGL is not defined.
We should be able to create a DisplayD3D object without defining ANGLE_ENABLE_OPENGL.

* src/libANGLE/Display.cpp:

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

4 years agoCheck to make sure shouldRequestCandidates() before requesting candidates
bdakin@apple.com [Tue, 26 Apr 2016 20:09:32 +0000 (20:09 +0000)]
Check to make sure shouldRequestCandidates() before requesting candidates
https://bugs.webkit.org/show_bug.cgi?id=157038
-and corresponding-
rdar://problem/25910418

Reviewed by Tim Horton.

This patch limits requesting and showing candidates to cases where
shouldRequestCandidates() is true. This patch also caches the sequence number
returned by [NSSpellChecker requestCandidatesForSelectedRange:] to make sure
it is equal to the sequence number sent to the callback handler so that we do
not show candidates for old requests.

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::requestCandidatesForSelection):
(WebEditorClient::handleRequestedCandidates):
* WebView/WebView.mm:
(-[WebView showCandidates:forString:inRect:forSelectedRange:view:completionHandler:]):
(-[WebView shouldRequestCandidates]):
* WebView/WebViewInternal.h:

Source/WebKit2:

* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateWebViewImplAdditions):
(WebKit::WebViewImpl::shouldRequestCandidates):
(WebKit::WebViewImpl::showCandidates):
(WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
(WebKit::WebViewImpl::handleRequestedCandidates):

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

4 years agoWebCore on Mac ignores the user's preferred region (country) while getting the language
fpizlo@apple.com [Tue, 26 Apr 2016 20:01:13 +0000 (20:01 +0000)]
WebCore on Mac ignores the user's preferred region (country) while getting the language
https://bugs.webkit.org/show_bug.cgi?id=156993

Reviewed by Geoffrey Garen.

Source/WebCore:

This is tested by the NavigatorLanguage API test.

WebCore was previously getting the list of preferred languages, and for each one, deducing
the default region. That's wrong, since for example it doesn't respect the user's choice (in
System Preferences) to display dates/calenders/etc according to a different region (like how
I have my machine set to en-pl right now).

It might be possible for the country code we get via kCFLocaleCountryCode to be something
that our ICU doesn't handle. To defend against this, we search for the resulting country
code in ICU's ISO countries list. If it doesn't appear in that list, we fall back on old
behavior.

* platform/mac/Language.mm:
(WebCore::httpStyleLanguageCode):
(WebCore::isValidICUCountryCode):
(WebCore::platformUserPreferredLanguages):

Tools:

Change the test expectations for this test. If the variant is not explicitly specified in
the AppleLanguage, then we use the locale's country code, which this test assumes is US.

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

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

4 years agoUse auto-generated operators in FontPlatformData
mmaxfield@apple.com [Tue, 26 Apr 2016 19:49:19 +0000 (19:49 +0000)]
Use auto-generated operators in FontPlatformData
https://bugs.webkit.org/show_bug.cgi?id=157037

Reviewed by Geoffrey Garen.

The only reason why they weren't used before is because Cairo was
using a raw pointer. However, RefPtr supports Cairo types, so this
patch migrates that pointer to a RefPtr. Therefore, we can remove
our custom operators (because they work the same way as auto-
generated ones do).

No new tests because there is no behavior change.

* platform/graphics/FontPlatformData.cpp:
(WebCore::FontPlatformData::FontPlatformData): Deleted.
(WebCore::FontPlatformData::operator=): Deleted.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::scaledFont):
(WebCore::FontPlatformData::hash):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::~FontPlatformData): Deleted.
(WebCore::FontPlatformData::platformDataInit): Deleted.
(WebCore::FontPlatformData::platformDataAssign): Deleted.
* platform/graphics/win/FontPlatformDataCGWin.cpp:
(WebCore::FontPlatformData::~FontPlatformData): Deleted.
(WebCore::FontPlatformData::platformDataInit): Deleted.
(WebCore::FontPlatformData::platformDataAssign): Deleted.
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
(WebCore::FontPlatformData::platformDataInit):
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::~FontPlatformData): Deleted.
(WebCore::FontPlatformData::platformDataAssign): Deleted.
* platform/graphics/win/FontPlatformDataWin.cpp:
(WebCore::FontPlatformData::FontPlatformData): Deleted.

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

4 years agoAdd renderer address and needslayout state to inlineboxtree dump.
zalan@apple.com [Tue, 26 Apr 2016 19:07:14 +0000 (19:07 +0000)]
Add renderer address and needslayout state to inlineboxtree dump.
https://bugs.webkit.org/show_bug.cgi?id=157035

Reviewed by Simon Fraser.

* rendering/InlineBox.cpp:
(WebCore::InlineBox::showLineBox):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::showLineBox):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::printPrefix):

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

4 years agocalling super() a second time in a constructor should throw
gskachkov@gmail.com [Tue, 26 Apr 2016 18:40:41 +0000 (18:40 +0000)]
calling super() a second time in a constructor should throw
https://bugs.webkit.org/show_bug.cgi?id=151113

Reviewed by Saam Barati and Keith Miller.

Source/JavaScriptCore:

Currently, our implementation checks if 'super()' was called in a constructor more
than once and raises a RuntimeError before the second call. According to the spec
we need to raise an error just after the second super() is finished and before
the new 'this' is assigned https://esdiscuss.org/topic/duplicate-super-call-behaviour.
To implement this behavior this patch adds a new op code, op_is_empty, that is used
to check if 'this' is empty.

* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitIsEmpty):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionCallValueNode::emitBytecode):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileIsEmpty):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_is_empty):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_is_empty):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* tests/stress/class-syntax-double-constructor.js: Added.

LayoutTests:

* js/class-syntax-super-expected.txt:
* js/script-tests/class-syntax-super.js:

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