WebKit-https.git
4 years ago[ES7] Introduce exponentiation expression
utatane.tea@gmail.com [Thu, 21 Jul 2016 07:33:28 +0000 (07:33 +0000)]
[ES7] Introduce exponentiation expression
https://bugs.webkit.org/show_bug.cgi?id=159969

Reviewed by Saam Barati.

This patch implements the exponentiation expression, e.g. `x ** y`.
The exponentiation expression is introduced in ECMA262 2016 and ECMA262 2016
is already released. So this is not the draft spec.

The exponentiation expression has 2 interesting points.

1. Right associative

    To follow the Math expression, ** operator is right associative.
    When we execute `x ** y ** z`, this is handled as `x ** (y ** z)`, not `(x ** y) ** z`.
    This patch introduces the right associativity to the binary operator and handles it
    in the operator precedence parser in Parser.cpp.

2. LHS of the exponentiation expression is UpdateExpression

    ExponentiationExpression[Yield]:
        UnaryExpression[?Yield]
        UpdateExpression[?Yield] ** ExponentiationExpression[?Yield]

    As we can see, the left hand side of the ExponentiationExpression is UpdateExpression, not UnaryExpression.
    It means that `+x ** y` becomes a syntax error. This is intentional. Without superscript in JS,
    `-x**y` is confusing between `-(x ** y)` and `(-x) ** y`. So ECMA262 intentionally avoids UnaryExpression here.
    If we need to use a negated value, we need to write parentheses explicitly e.g. `(-x) ** y`.
    In this patch, we ensure that the left hand side is not an unary expression by checking an operator in
    parseBinaryExpression. This works since `**` has the highest operator precedence in the binary operators.

We introduce a new bytecode, op_pow. That simply works as similar as the other binary operators.
And it is converted to ArithPow in DFG and handled in DFG and FTL.
In this patch, we take the approach just introducing a new bytecode instead of calling Math.pow.
This is because we would like to execute ToNumber in the caller side, not in the callee (Math.pow) side.
And we don't want to compile ** into the following.

    lhsNumber = to_number (lhs)
    rhsNumber = to_number (rhs)
    call Math.pow(lhsNumber, rhsNumber)

We ensure that this patch passes all the test262 tests related to the exponentiation expression.

The only sensitive part to the performance is the parser changes.
So we measured the code-load performance and it is neutral in my x64 Linux box (hanayamata).

    Collected 30 samples per benchmark/VM, with 30 VM invocations per benchmark. Emitted a call to
    gc() between sample measurements. Used 1 benchmark iteration per VM invocation for warm-up. Used
    the jsc-specific preciseTime() function to get microsecond-level timing. Reporting benchmark
    execution times with 95% confidence intervals in milliseconds.

                             baseline                  patched

    closure              0.60499+-0.00250          0.60180+-0.00244
    jquery               7.89175+-0.02433    ?     7.91287+-0.04759       ?

    <geometric>          2.18499+-0.00523          2.18207+-0.00689         might be 1.0013x faster

* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecompiler/NodesCodegen.cpp:
(JSC::emitReadModifyAssignment):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_pow):
* llint/LowLevelInterpreter.asm:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::operatorStackShouldReduce):
(JSC::ASTBuilder::makePowNode):
(JSC::ASTBuilder::makeMultNode):
(JSC::ASTBuilder::makeDivNode):
(JSC::ASTBuilder::makeModNode):
(JSC::ASTBuilder::makeSubNode):
(JSC::ASTBuilder::makeBinaryNode):
(JSC::ASTBuilder::operatorStackHasHigherPrecedence): Deleted.
* parser/Lexer.cpp:
(JSC::Lexer<T>::lex):
* parser/NodeConstructors.h:
(JSC::PowNode::PowNode):
* parser/Nodes.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::isUnaryOpExcludingUpdateOp):
(JSC::Parser<LexerType>::parseBinaryExpression):
(JSC::isUnaryOp): Deleted.
* parser/ParserTokens.h:
(JSC::isUpdateOp):
(JSC::isUnaryOp):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::operatorStackPop):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
* tests/stress/pow-basics.js: Added.
(valuesAreClose):
(mathPowDoubleDouble1):
(mathPowDoubleInt1):
(test1):
(mathPowDoubleDouble2):
(mathPowDoubleInt2):
(test2):
(mathPowDoubleDouble3):
(mathPowDoubleInt3):
(test3):
(mathPowDoubleDouble4):
(mathPowDoubleInt4):
(test4):
(mathPowDoubleDouble5):
(mathPowDoubleInt5):
(test5):
(mathPowDoubleDouble6):
(mathPowDoubleInt6):
(test6):
(mathPowDoubleDouble7):
(mathPowDoubleInt7):
(test7):
(mathPowDoubleDouble8):
(mathPowDoubleInt8):
(test8):
(mathPowDoubleDouble9):
(mathPowDoubleInt9):
(test9):
(mathPowDoubleDouble10):
(mathPowDoubleInt10):
(test10):
(mathPowDoubleDouble11):
(mathPowDoubleInt11):
(test11):
* tests/stress/pow-coherency.js: Added.
(pow42):
(build42AsDouble.opaqueAdd):
(build42AsDouble):
(powDouble42):
(clobber):
(pow42NoConstantFolding):
(powDouble42NoConstantFolding):
* tests/stress/pow-evaluation-order.js: Added.
(shouldBe):
(throw.new.Error):
* tests/stress/pow-expects-update-expression-on-lhs.js: Added.
(testSyntax):
(testSyntaxError):
(throw.new.Error):
(let.token.of.tokens.testSyntax.pow):
(testSyntax.pow):
* tests/stress/pow-integer-exponent-fastpath.js: Added.
(valuesAreClose):
(mathPowDoubleDoubleTestExponentFifty):
(mathPowDoubleIntTestExponentFifty):
(testExponentFifty):
(mathPowDoubleDoubleTestExponentTenThousands):
(mathPowDoubleIntTestExponentTenThousands):
(testExponentTenThousands):
* tests/stress/pow-nan-behaviors.js: Added.
(testIntegerBaseWithNaNExponentStatic):
(mathPowIntegerBaseWithNaNExponentDynamic):
(testIntegerBaseWithNaNExponentDynamic):
(testFloatingPointBaseWithNaNExponentStatic):
(mathPowFloatingPointBaseWithNaNExponentDynamic):
(testFloatingPointBaseWithNaNExponentDynamic):
(testNaNBaseStatic):
(mathPowNaNBaseDynamic1):
(mathPowNaNBaseDynamic2):
(mathPowNaNBaseDynamic3):
(mathPowNaNBaseDynamic4):
(testNaNBaseDynamic):
(infiniteExponentsStatic):
(mathPowInfiniteExponentsDynamic1):
(mathPowInfiniteExponentsDynamic2):
(mathPowInfiniteExponentsDynamic3):
(mathPowInfiniteExponentsDynamic4):
(infiniteExponentsDynamic):
* tests/stress/pow-simple.js: Added.
(shouldBe):
(throw.new.Error):
* tests/stress/pow-stable-results.js: Added.
(opaquePow):
(isIdentical):
* tests/stress/pow-to-number-should-be-executed-in-code-side.js: Added.
(shouldBe):
(throw.new.Error):
* tests/stress/pow-with-constants.js: Added.
(exponentIsZero):
(testExponentIsZero):
(exponentIsOne):
(testExponentIsOne):
(powUsedAsSqrt):
(testPowUsedAsSqrt):
(powUsedAsOneOverSqrt):
(testPowUsedAsOneOverSqrt):
(powUsedAsSquare):
(testPowUsedAsSquare):
(intIntConstantsSmallNumbers):
(intIntConstantsLargeNumbers):
(intIntSmallConstants):
(intDoubleConstants):
(doubleDoubleConstants):
(doubleIntConstants):
(testBaseAndExponentConstantLiterals):
(exponentIsIntegerConstant):
(testExponentIsIntegerConstant):
(exponentIsDoubleConstant):
(testExponentIsDoubleConstant):
(exponentIsInfinityConstant):
(testExponentIsInfinityConstant):
(exponentIsNegativeInfinityConstant):
(testExponentIsNegativeInfinityConstant):
* tests/stress/pow-with-never-NaN-exponent.js: Added.
(exponentIsNonNanDouble1):
(exponentIsNonNanDouble2):
(testExponentIsDoubleConstant):
* tests/test262.yaml:

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

4 years ago[Threaded Compositor] Flickering when zooming in/out in maps.google.com
commit-queue@webkit.org [Thu, 21 Jul 2016 07:29:39 +0000 (07:29 +0000)]
[Threaded Compositor] Flickering when zooming in/out in maps.google.com
https://bugs.webkit.org/show_bug.cgi?id=154069

Patch by Miguel Gomez <magomez@igalia.com> on 2016-07-21
Reviewed by Carlos Garcia Campos.

Add a new extra buffer to GraphicsContext3D when using the Threaded Compositor,
so it doesn't have to reuse the buffers that are still waiting for composition.

Covered by existing tests.

* platform/graphics/GraphicsContext3D.h:
Add a new texture to use for the rendering. Remove the compositor fbo we were using.
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
Initialize the new texture and remove the previous fbo related code.
(WebCore::GraphicsContext3D::~GraphicsContext3D):
Properly destroy the new texture and remove the previous fbo related code.
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
Allocate the new texture and remove the previous fbo allocation.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::prepareTexture):
Use a single fbo with three textures instead of two fbos with a texture each.
Rotate the three textures usage so:
- m_texture becomes m_compositorTexture to be pushed to the compositor.
- m_intermediateTexture becomes m_texture to receive the next rendering.
- m_compositorTexture becomes m_intermediateTexture.
And add a glFlush() to ensure that the gl commands are sent to the pipeline.
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
Allocate the new texture.

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

4 years ago[GTK][Threaded Compositor] Web view background colors don't work
carlosgc@webkit.org [Thu, 21 Jul 2016 07:25:26 +0000 (07:25 +0000)]
[GTK][Threaded Compositor] Web view background colors don't work
https://bugs.webkit.org/show_bug.cgi?id=159465

Reviewed by Michael Catanzaro.

Source/WebCore:

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Initialize frame view layer opacity for platforms not
using the tiled cache layer.

Source/WebKit2:

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::setDrawsBackground): Set m_drawsBackground in compositing thread and schedule a
layer flush.
(WebKit::ThreadedCompositor::renderLayerTree): Clear the area when not rendering backgrounds.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Notify the compositor.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:

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

4 years ago[GTK] Web view background colors don't work in accelerated compositing mode
carlosgc@webkit.org [Thu, 21 Jul 2016 07:18:03 +0000 (07:18 +0000)]
[GTK] Web view background colors don't work in accelerated compositing mode
https://bugs.webkit.org/show_bug.cgi?id=159455

Reviewed by Michael Catanzaro.

Source/WebKit2:

In non AC mode it's the drawing area backing store the one drawing the background, and the web process just
renders into a transparent bitmap. In AC mode we need to make the redirected window pixmap transparent for the
web process to render there, and let the web view fill the background color before rendering the redirected
window pixmap on top. To be able to make the redirected window surface transparent, we need to ensure the parent
window has an RGBA visual, even when setting a fully opaque background, because we still need the web process
to render on the transparent xwindow.

* UIProcess/API/gtk/WebKitWebView.cpp: Update documentation of webkit_web_view_set_background_color() since now
it's required to set the RGBA visual even for opaque colors in case AC mode is enabled.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewRenderAcceleratedCompositingResults): When a background color has been set, fill it before
rendering the redirected window surface.
* UIProcess/gtk/RedirectedXCompositeWindow.cpp:
(WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow): Mark the surface as dirty after every damage
event, since the web process has modified it.
(WebKit::RedirectedXCompositeWindow::surface): Initialize the surface after creating it, to avoid flickering and
rendering artifacts when waiting for the first damage event from the web process.
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::compositeLayersToContext): Use a fully transparent color to clear the context when the page
is resized or when a view background color has been set.

Tools:

Set always RGBA visual to the view widget when setting a background color.

* MiniBrowser/gtk/BrowserWindow.c:
(browser_window_set_background_color):

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

4 years ago[GTK] Avoid the redirected window resize when the view is realized in AC mode
carlosgc@webkit.org [Thu, 21 Jul 2016 07:04:59 +0000 (07:04 +0000)]
[GTK] Avoid the redirected window resize when the view is realized in AC mode
https://bugs.webkit.org/show_bug.cgi?id=159463

Reviewed by Michael Catanzaro.

We are always creating the redirected window at 1x1 and then resizing it if we are in AC mode. When the view is
realized and AC mode is already enabled, which happens for example when AC mode is forced, or when the threaded
compositor is enabled, we could just pass the initial size to the redirected window constructor to create the
XWindow at the right size.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseResizeRedirectedWindow): We no longer need to pass the device scale factor, since the
RedirectedXCompositeWindow already knows it.
(webkitWebViewBaseRealize): Pass the WebPageProxy and an initial size to the RedirectedXCompositeWindow
constructor instead of the parent GdkWindow. If AC mode is disabled, the initial size will be empty. With the
WebPageProxy the redirected window has access to the device scale factor and view widget to get the parent
GdkWindow.
(deviceScaleFactorChanged): Resize the redirected window when device scale factor changes.
* UIProcess/gtk/RedirectedXCompositeWindow.cpp:
(WebKit::RedirectedXCompositeWindow::create):
(WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
(WebKit::RedirectedXCompositeWindow::resize):
(WebKit::RedirectedXCompositeWindow::surface):
(WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow):
* UIProcess/gtk/RedirectedXCompositeWindow.h:

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

4 years ago[XHR] Cache response JS object in case of arraybuffer and blob response types
commit-queue@webkit.org [Thu, 21 Jul 2016 06:51:05 +0000 (06:51 +0000)]
[XHR] Cache response JS object in case of arraybuffer and blob response types
https://bugs.webkit.org/show_bug.cgi?id=128903

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-20
Reviewed by Alex Christensen.

Source/WebCore:

Covered by existing and modified tests.

Making response getter a JS builtin that caches response in @response private slot.
Handling invalidation of cached response with @responseCacheIsValid new private method.
Handling creation of cached response with @retrieveResponse new private method which reuses most of
JSXMLHttpRequest::response previous code.

Caching of responses is activated whenever load ended without any error for blob and arraybuffer response types.

Caching of response for document is also activated in case the response getter is used but not if responseXML getter is used.

* CMakeLists.txt: Adding XMLHttpRequest.js.
* DerivedSources.make: Ditto.
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::retrieveResponse): Implements creation of to-be-cached response.
(WebCore::JSXMLHttpRequest::response): Deleted.
* bindings/js/WebCoreBuiltinNames.h: Adding new private names.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didCacheResponse): Renamed from didCacheResponseJSON as all response types are now cached.
(WebCore::XMLHttpRequest::didCacheResponseJSON): Deleted.
* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.idl:

LayoutTests:

* http/tests/xmlhttprequest/onabort-response-getters-expected.txt:
* http/tests/xmlhttprequest/onabort-response-getters.html:

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

4 years ago[GTK][Threaded Compositor] Web Process crash when the page is closed before the web...
carlosgc@webkit.org [Thu, 21 Jul 2016 06:41:43 +0000 (06:41 +0000)]
[GTK][Threaded Compositor] Web Process crash when the page is closed before the web view is realized
https://bugs.webkit.org/show_bug.cgi?id=159918

Reviewed by Michael Catanzaro.

When the web view is unrealized, we send a sync message to the web process to destroy the native surface handle
for compositing, and then we actually destroy the redirected window. But if the page is closed explicitly before
the web view is unrealized, the drawing area proxy is destroyed so that when the web view is unrealized we can't
notify the web process that keeps trying to render to a now deleted window handle. That produces a BadDrawable
X error and the web process crashes.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::pageClosed): Call webkitWebViewBasePageClosed().
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBasePageClosed): If the web view is still realized, destroy the native surface handle and the
redirected window.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Add webkitWebViewBasePageClosed().

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

4 years agoUnreviewed, new demo files for an up-coming blog post.
fred.wang@free.fr [Thu, 21 Jul 2016 06:38:32 +0000 (06:38 +0000)]
Unreviewed, new demo files for an up-coming blog post.

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

* demos/mathml/demo2016/LICENSE-amiri.txt: Added.
* demos/mathml/demo2016/LICENSE-latinmodern-math.txt: Added.
* demos/mathml/demo2016/LICENSE-libertinusmath.txt: Added.
* demos/mathml/demo2016/README.txt: Added.
* demos/mathml/demo2016/amiri-regular.woff: Added.
* demos/mathml/demo2016/index.html: Added.
* demos/mathml/demo2016/latinmodern-math.woff: Added.
* demos/mathml/demo2016/libertinusmath-regular.woff: Added.
* demos/mathml/demo2016/webfonts.css: Added.
(@namespace url('http://www.w3.org/1999/xhtml');):
(@font-face):
(m|math, m|mtext):
(m|math.libertinus):
(m|math.arabic):

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

4 years agoSwitching on symbols should be fast
fpizlo@apple.com [Thu, 21 Jul 2016 06:23:10 +0000 (06:23 +0000)]
Switching on symbols should be fast
https://bugs.webkit.org/show_bug.cgi?id=158892

Reviewed by Keith Miller.
Source/JavaScriptCore:

This does two things: fixes some goofs in our lowering of symbol equality and adds a new phase
to B3 to infer switch statements from linear chains of branches.

This changes how we compile equality to Symbols to constant-fold the load of the Symbol's UID.
This is necessary for making switches on Symbols inferrable. This also gives us the ability to
efficiently compile strict equality comparisons of SymbolUse and UntypedUse.

This adds a new phase to B3, which finds chains of branches that test for (in)equality on the
same value and constants, and turns them into a Switch. This can turn O(n) code into
O(log n) code, or even O(1) code if the switch cases are dense.

This can make a big difference in JS. Say you write a switch in which the case statements are
variable resolutions. The bytecode generator cannot use a bytecode switch in this case, since
we're required to evaluate the resolutions in order. But in DFG IR, we will often turn those
variable resolutions into constants, since we do that for any immutable singleton. This means
that B3 will see a chain of Branches: the else case of one Branch will point to a basic block
that does nothing but Branch on equality on the same value as the first Branch.

The inference algorithm is quite simple. The basic building block is the ability to summarize
a block's switch behavior. For a block that ends in a switch, this is just the collection of
switch cases. For a block that ends in a branch, we recognize Branch(Equal(value, const)),
Branch(NotEqual(value, const)), and Branch(value). Each of these are summarized as if they
were one-case switches. We infer a new switch if both some block and its sole predecessor
can be described as switches on the same value, nothing shady is going on (like loops), and
the block in question does no work other than this switch. In that case, the block is killed
and its cases (which we get from the summary) are added to the predecessor's switch. This
algorithm runs to fixpoint.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* b3/B3InferSwitches.cpp: Added.
(JSC::B3::inferSwitches):
* b3/B3InferSwitches.h: Added.
* b3/B3Procedure.h:
(JSC::B3::Procedure::cfg):
* b3/B3ReduceStrength.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::performSubstitution):
(JSC::B3::Value::isFree):
(JSC::B3::Value::dumpMeta):
* b3/B3Value.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCheckIdent):
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
(JSC::FTL::DFG::LowerDFGToB3::lowSymbol):
(JSC::FTL::DFG::LowerDFGToB3::lowSymbolUID):
(JSC::FTL::DFG::LowerDFGToB3::lowNonNullObject):

LayoutTests:

* js/regress/bigswitch-indirect-expected.txt: Added.
* js/regress/bigswitch-indirect-symbol-expected.txt: Added.
* js/regress/bigswitch-indirect-symbol-or-undefined-expected.txt: Added.
* js/regress/bigswitch-indirect-symbol-or-undefined.html: Added.
* js/regress/bigswitch-indirect-symbol.html: Added.
* js/regress/bigswitch-indirect.html: Added.
* js/regress/implicit-bigswitch-indirect-symbol-expected.txt: Added.
* js/regress/implicit-bigswitch-indirect-symbol.html: Added.
* js/regress/script-tests/bigswitch-indirect-symbol-or-undefined.js: Added.
(foo):
* js/regress/script-tests/bigswitch-indirect-symbol.js: Added.
(foo):
* js/regress/script-tests/bigswitch-indirect.js: Added.
(foo):
* js/regress/script-tests/implicit-bigswitch-indirect-symbol.js: Added.
(foo):

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

4 years agoRemove crossOriginRequestPolicy from ThreadableLoaderOptions
commit-queue@webkit.org [Thu, 21 Jul 2016 06:12:13 +0000 (06:12 +0000)]
Remove crossOriginRequestPolicy from ThreadableLoaderOptions
https://bugs.webkit.org/show_bug.cgi?id=159417

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-20
Reviewed by Alex Christensen.

No observable change.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start): DenyCrossOriginRequests -> FetchOptions::Mode::SameOrigin.
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::start): DenyCrossOriginRequests -> FetchOptions::Mode::SameOrigin.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::loadResource): AllowCrossOriginRequests -> FetchOptions::Mode::NoCors.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Ditto.
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest): UseAccessControl -> FetchOptions::Mode::Cors.
(WebCore::DocumentThreadableLoader::redirectReceived): Ditto.
(WebCore::DocumentThreadableLoader::didReceiveResponse): Ditto.
(WebCore::DocumentThreadableLoader::loadRequest): Use NoCors as option passed to ResourceLoader. This allows
desactivating ResourceLoader CORS checks as they are done in DocumentThreadableLoader right now. In the future,
these checks should be moved to ResourceLoader and DocumentThreadableLoader should directly pass the fetch mode
option.
(WebCore::DocumentThreadableLoader::isAllowedRedirect): AllowCrossOriginRequests -> FetchOptions::Mode::NoCors.
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Removing CrossOriginRequestPolicy.
* loader/ThreadableLoader.h: Ditto.
* loader/WorkerThreadableLoader.cpp:
(WebCore::LoaderTaskOptions::LoaderTaskOptions): Ditto.
* page/EventSource.cpp:
(WebCore::EventSource::connect): UseAccessControl -> FetchOptions::Mode::Cors.
* workers/Worker.cpp:
(WebCore::Worker::create): DenyCrossOriginRequests -> FetchOptions::Mode::SameOrigin.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts): AllowCrossOriginRequests -> FetchOptions::Mode::NoCors.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
* workers/WorkerScriptLoader.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):

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

4 years agoBots should run built-ins generator tests
commit-queue@webkit.org [Thu, 21 Jul 2016 06:09:56 +0000 (06:09 +0000)]
Bots should run built-ins generator tests
https://bugs.webkit.org/show_bug.cgi?id=159971

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-20
Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunBuiltinsTests): New step to run built-in generator tests.
(TestFactory.__init__): Adding an additional step for bultin generator tests.
* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py: Rebasing expectations.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotIteration.js: Adding additional step for proper display.

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

4 years agoFTL snippet generators should be able to request a different register for output...
fpizlo@apple.com [Thu, 21 Jul 2016 05:24:54 +0000 (05:24 +0000)]
FTL snippet generators should be able to request a different register for output and input
https://bugs.webkit.org/show_bug.cgi?id=160010
rdar://problem/27439330

Reviewed by Saam Barati.

The BitOr and BitXor snippet generators have problems if the register for the right input is
the same as the register for the result. We could fix those generators, but I'm not convinced
that the other snippet generators don't have this bug. So, the approach that this patch takes
is to teach the FTL to request that B3 to use a different register for the result than for
any input to the snippet patchpoint.

Air already has the ability to let any instruction do an EarlyDef, which means exactly this.
But B3 did not expose this via ValueRep. This patch exposes this in ValueRep as
SomeEarlyRegister. That's most of the change.

This adds a testb3 test for SomeEarlyRegister and a regression test for this particular
problem. The regression test failed on trunk JSC before this.

* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower):
* b3/B3PatchpointSpecial.cpp:
(JSC::B3::PatchpointSpecial::forEachArg):
(JSC::B3::PatchpointSpecial::admitsStack):
* b3/B3StackmapSpecial.cpp:
(JSC::B3::StackmapSpecial::forEachArgImpl):
(JSC::B3::StackmapSpecial::isArgValidForRep):
* b3/B3Validate.cpp:
* b3/B3ValueRep.cpp:
(JSC::B3::ValueRep::addUsedRegistersTo):
(JSC::B3::ValueRep::dump):
(WTF::printInternal):
* b3/B3ValueRep.h:
(JSC::B3::ValueRep::ValueRep):
(JSC::B3::ValueRep::reg):
(JSC::B3::ValueRep::isAny):
(JSC::B3::ValueRep::isReg):
(JSC::B3::ValueRep::isSomeRegister): Deleted.
* b3/testb3.cpp:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::emitBinarySnippet):
(JSC::FTL::DFG::LowerDFGToB3::emitBinaryBitOpSnippet):
(JSC::FTL::DFG::LowerDFGToB3::emitRightShiftSnippet):
* tests/stress/ftl-bit-xor-right-result-interference.js: Added.

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

4 years agoFix null handling of several Document attributes
cdumez@apple.com [Thu, 21 Jul 2016 03:30:48 +0000 (03:30 +0000)]
Fix null handling of several Document attributes
https://bugs.webkit.org/show_bug.cgi?id=159997

Reviewed by Ryosuke Niwa.

Source/WebCore:

Fix null handling of the following Document attributes: title, cookie
and domain.

In WebKit, they were all marked as [TreatNullAs=EmptyString], which
does not match the specification:
- https://html.spec.whatwg.org/multipage/dom.html#document

Details for each attribute:
- title: null is now treated as the string "null", thus setting the
  document title to "null". This matches Firefox and Chrome.
- cookie: adds a "null" cookie instead of being a no-op. This matches
          both Firefox and Chrome.
- domain: Calls setDomain(String("null")) instead of
          setDomain(String()). This throws an exception because "null"
          is not a suffix of the effective domain name. The behavior
          is the same in Firefox and Chrome. Previously, we were
          already throwing an exception since setting the domain to
          the empty string throws, as per the specification.

Test: http/tests//dom/document-attributes-null-handling.html

* dom/Document.idl:

LayoutTests:

Add test coverage.

* http/tests/dom/document-attributes-null-handling-expected.txt: Added.
* http/tests/dom/document-attributes-null-handling.html: Added.
* fast/dom/document-attribute-js-null-expected.txt:
* fast/dom/document-attribute-js-null.html:

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

4 years agoPerf dashboard always re-generate measurement set JSON
rniwa@webkit.org [Thu, 21 Jul 2016 03:25:59 +0000 (03:25 +0000)]
Perf dashboard always re-generate measurement set JSON
https://bugs.webkit.org/show_bug.cgi?id=159951

Reviewed by Chris Dumez.

The bug was caused by manifest.json reporting the last modified date of a measurement set in floating point,
and a measurement set JSON reporting it as an integer. Fixed the bug by always using an integer.

* public/api/measurement-set.php:
(main): Return 404 when the results is empty.
(MeasurementSetFetcher::execute_query): Use "extract(epoch from commit_time)" like ManifestGenerator to improve
the generation speed. This is ~10% runtime improvement.
(MeasurementSetFetcher::format_map): Updated to reflect the above change.
(MeasurementSetFetcher::parse_revisions_array): Ditto.

* public/include/manifest.php:
(ManifestGenerator::platforms): Fixed the bug by coercing lastModified to integer (instead of float).

* server-tests/api-measurement-set-tests.js: Added a test case for returning empty results, and a test case for
making sure lastModified dates in manifest.json and measurement sets match.

* tools/js/remote.js:
(RemoteAPI.prototype.sendHttpRequest): Reject the promise when HTTP status code is not 200.

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

4 years agoRevert temporary fix r203417
aakash_jain@apple.com [Thu, 21 Jul 2016 02:09:51 +0000 (02:09 +0000)]
Revert temporary fix r203417
https://bugs.webkit.org/show_bug.cgi?id=160001

Reviewed by Alexey Proskuryakov.

* EWSTools/start-queue-mac.sh: Revert the temporary fix.

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

4 years agoUnreviewed, rolling out r203471.
commit-queue@webkit.org [Thu, 21 Jul 2016 00:45:39 +0000 (00:45 +0000)]
Unreviewed, rolling out r203471.
https://bugs.webkit.org/show_bug.cgi?id=160003

many iOS-simulator tests are failing (Requested by litherum on
#webkit).

Reverted changeset:

"[iPhone] Playing a video on tudou.com plays only sound, no
video"
https://bugs.webkit.org/show_bug.cgi?id=159967
http://trac.webkit.org/changeset/203471

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

4 years agoREGRESSION (r203189): Webpage snapshots are partially or fully blank when edge swipin...
simon.fraser@apple.com [Thu, 21 Jul 2016 00:36:12 +0000 (00:36 +0000)]
REGRESSION (r203189): Webpage snapshots are partially or fully blank when edge swiping back
https://bugs.webkit.org/show_bug.cgi?id=160000
rdar://problem/27455589

Reviewed by Zalan Bujtas.

r203189 triggered a call to -_updateContentRectsWithState: in the middle of a swipe,
during which we'd compute the visible rect of the view as having zero width, causing us
to not create tiles.

-_navigationGestureDidBegin already snapshots the visibleContentRect in _frozenVisibleContentRect,
but -_visibleContentRect then clipped that with ancestor views, causing the issue.

Fix by having -_visibleContentRect just return _frozenVisibleContentRect if we have one.

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

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

4 years agoiOS: Cannot paste images in RTF content
rniwa@webkit.org [Thu, 21 Jul 2016 00:23:19 +0000 (00:23 +0000)]
iOS: Cannot paste images in RTF content
https://bugs.webkit.org/show_bug.cgi?id=159964
<rdar://problem/27442806>

Reviewed by Enrica Casucci.

The bug was caused by setDefersLoading(true) not deferring image loading for the parsed fragment.
Worked around this bug by disabling image loading while parsing the document fragment.

* editing/ios/EditorIOS.mm:
(WebCore::Editor::createFragmentAndAddResources):

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

4 years agoAddress a small FIXME in IDB code.
beidson@apple.com [Thu, 21 Jul 2016 00:15:58 +0000 (00:15 +0000)]
Address a small FIXME in IDB code.
https://bugs.webkit.org/show_bug.cgi?id=159999

Reviewed by Andy Estes.

No new tests (No behavior change).

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):

* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::IDBResourceIdentifier): Deleted.
* Modules/indexeddb/shared/IDBResourceIdentifier.h:

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

4 years agoRemove some "modernFoo"s from IndexedDB code.
beidson@apple.com [Wed, 20 Jul 2016 23:28:33 +0000 (23:28 +0000)]
Remove some "modernFoo"s from IndexedDB code.
https://bugs.webkit.org/show_bug.cgi?id=159985

Reviewed by Andy Estes.

No new tests (No known behavior change).

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::IDBCursor):
(WebCore::IDBCursor::~IDBCursor):
(WebCore::IDBCursor::sourcesDeleted):
(WebCore::IDBCursor::effectiveObjectStore):
(WebCore::IDBCursor::transaction):
(WebCore::IDBCursor::direction):
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::uncheckedIterateCursor):
(WebCore::IDBCursor::deleteFunction):
(WebCore::IDBCursor::setGetResult):

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::IDBIndex):
(WebCore::IDBIndex::~IDBIndex):
(WebCore::IDBIndex::hasPendingActivity):
(WebCore::IDBIndex::name):
(WebCore::IDBIndex::objectStore):
(WebCore::IDBIndex::keyPath):
(WebCore::IDBIndex::unique):
(WebCore::IDBIndex::multiEntry):
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::doCount):
(WebCore::IDBIndex::openKeyCursor):
(WebCore::IDBIndex::doGet):
(WebCore::IDBIndex::doGetKey):
(WebCore::IDBIndex::markAsDeleted):
* Modules/indexeddb/IDBIndex.h:

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::transaction):
(WebCore::IDBObjectStore::deleteFunction): Deleted.
(WebCore::IDBObjectStore::modernDelete): Deleted.
* Modules/indexeddb/IDBObjectStore.h:

* bindings/js/JSIDBIndexCustom.cpp:
(WebCore::JSIDBIndex::visitAdditionalChildren):

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

4 years agoREGRESSION(r148588): ews classes might get garbage collected
aakash_jain@apple.com [Wed, 20 Jul 2016 23:28:22 +0000 (23:28 +0000)]
REGRESSION(r148588): ews classes might get garbage collected
https://bugs.webkit.org/show_bug.cgi?id=159990

Reviewed by Ryosuke Niwa.

* Scripts/webkitpy/tool/commands/__init__.py: Store the loaded ews classes
in a variable so that they do not get garbage collected.

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

4 years agoAdd API test for layout constraints after exit fullscreen
commit-queue@webkit.org [Wed, 20 Jul 2016 23:24:15 +0000 (23:24 +0000)]
Add API test for layout constraints after exit fullscreen
https://bugs.webkit.org/show_bug.cgi?id=159900

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-07-20
Reviewed by Jon Lee.

Added Fullscreen.LaytoutConstraints API test.
Tests fix from https://bugs.webkit.org/show_bug.cgi?id=159731

This test compares layout constraints on the web view before and after fullscreen to make sure
they are preserved.

* TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenLayoutConstraints.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/FullscreenLayoutConstraints.mm: Added.
(-[FullscreenStateChangeMessageHandler userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::TEST):

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

4 years agoDisable two failing API tests.
ryanhaddad@apple.com [Wed, 20 Jul 2016 23:23:56 +0000 (23:23 +0000)]
Disable two failing API tests.

Unreviewed test gardening.

* TestWebKitAPI/Tests/mac/CandidateTests.mm:
(TestWebKitAPI::TEST):

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

4 years agoFix timeout of imported/w3c/WebCryptoAPI/idlharness.html
jiewen_tan@apple.com [Wed, 20 Jul 2016 23:14:39 +0000 (23:14 +0000)]
Fix timeout of imported/w3c/WebCryptoAPI/idlharness.html
https://bugs.webkit.org/show_bug.cgi?id=159979

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Add missing resources.

* WebCryptoAPI/idlharness-expected.txt:
* WebCryptoAPI/idlharness.html:
* resources/WebIDLParser.js: Added.
(tokenise):
(WebIDLParseError):
(WebIDLParseError.prototype.toString):
(error):
(consume):
(ws):
(all_ws):
(integer_type):
(float_type):
(primitive_type):
(const_value):
(type_suffix):
(single_type):
(union_type):
(type):
(argument):
(argument_list):
(type_pair):
(simple_extended_attr):
(extended_attrs):
(default_):
(const_):
(inheritance):
(operation_rest):
(callback):
(attribute):
(return_type):
(operation):
(identifiers):
(serialiser):
(iterable_type):
(readonly_iterable_type):
(iterable):
(interface_):
(partial):
(dictionary):
(exception):
(enum_):
(parse):
* resources/idlharness.js: Added.
(constValue):
(minOverloadLength):
(throwOrReject):
(awaitNCallbacks):
(return.fround):
(fround):
(self.IdlArray):
(IdlArray.prototype.add_idls):
(IdlArray.prototype.add_untested_idls):
(IdlArray.prototype.internal_add_idls):
(IdlArray.prototype.add_objects):
(IdlArray.prototype.prevent_multiple_testing):
(IdlArray.prototype.recursively_get_implements):
(exposed_in):
(IdlArray.prototype.test):
(IdlArray.prototype.assert_type_is):
(IdlObject):
(IdlObject.prototype.test):
(IdlObject.prototype.has_extended_attribute):
(IdlInterface):
(IdlInterface.prototype.is_callback):
(IdlInterface.prototype.has_constants):
(IdlInterface.prototype.is_global):
(IdlInterface.prototype.test):
(IdlInterface.prototype.test_self):
(IdlInterface.prototype.test_member_const):
(IdlInterface.prototype.test_member_attribute):
(IdlInterface.prototype.test_member_operation):
(IdlInterface.prototype.do_member_operation_asserts):
(IdlInterface.prototype.test_member_stringifier):
(IdlInterface.prototype.test_members):
(IdlInterface.prototype.test_object):
(IdlInterface.prototype.test_primary_interface_of):
(IdlInterface.prototype.test_interface_of):
(IdlInterface.prototype.has_stringifier):
(IdlInterface.prototype.do_interface_attribute_asserts):
(IdlInterfaceMember):
(create_suitable_object):
(IdlEnum):
(IdlTypedef):

LayoutTests:

* TestExpectations:
Remove the skip tuple of the test.

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

4 years agoStop using valueToStringWithNullCheck() in JSCSSStyleDeclaration::putDelegate()
cdumez@apple.com [Wed, 20 Jul 2016 23:07:30 +0000 (23:07 +0000)]
Stop using valueToStringWithNullCheck() in JSCSSStyleDeclaration::putDelegate()
https://bugs.webkit.org/show_bug.cgi?id=159982

Reviewed by Ryosuke Niwa.

Source/WebCore:

valueToStringWithNullCheck() treats null as the null String() which is
legacy / non standard behavior. The specification says we should treat
null as the empty string:
- https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute

Therefore, we should be using valueToStringTreatingNullAsEmptyString() instead.

In practice, there is no web-exposed behavior change because
MutableStyleProperties::setProperty() removes the property wether the
value is the null String or the empty String.

This behavior is correct since the specification says that we should
remove the property if the value is the empty string:
- https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty (step 4)

I added test coverage to make sure we behave according to specification.
This test is passing in Firefox, Chrome and in WebKit (before and after
my change).

Test: fast/css/CSSStyleDeclaration-property-setter.html

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate):

LayoutTests:

Add layout test coverage for JSCSSStyleDeclaration::putDelegate(),
covering cases like setting to null or the empty String, to make
sure we behave according to specification.

* fast/css/CSSStyleDeclaration-property-setter-expected.txt: Added.
* fast/css/CSSStyleDeclaration-property-setter.html: Added.

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

4 years agoFix null handling of HTMLFrameElement.marginWidth / marginHeight
cdumez@apple.com [Wed, 20 Jul 2016 23:06:35 +0000 (23:06 +0000)]
Fix null handling of HTMLFrameElement.marginWidth / marginHeight
https://bugs.webkit.org/show_bug.cgi?id=159987

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

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

Source/WebCore:

Fix null handling of HTMLFrameElement.marginWidth / marginHeight:
- https://html.spec.whatwg.org/multipage/obsolete.html#htmlframeelement

We are supposed to treat null as the empty string but we treat it as
the string "null".

Firefox and Chrome both match the specification.

No new tests, updated existing tests.

* html/HTMLFrameElement.idl:

LayoutTests:

Update existing test to reflect the expected behavior change.

* fast/dom/element-attribute-js-null-expected.txt:
* fast/dom/element-attribute-js-null.html:

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

4 years agoPausing autoplayed media should not remove all restrictions for that media element
wenson_hsieh@apple.com [Wed, 20 Jul 2016 22:56:08 +0000 (22:56 +0000)]
Pausing autoplayed media should not remove all restrictions for that media element
https://bugs.webkit.org/show_bug.cgi?id=159988

Reviewed by Jon Lee.

Localizes the removal of behavior restrictions introduced in r203464 upon pausing an
autoplaying video to just affect the hiding or showing of the media controller. This
prevents pages from using Javascript to start playing autoplaying videos that have
been paused by the user.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::pause):

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

4 years ago[iPhone] Playing a video on tudou.com plays only sound, no video
mmaxfield@apple.com [Wed, 20 Jul 2016 22:41:57 +0000 (22:41 +0000)]
[iPhone] Playing a video on tudou.com plays only sound, no video
https://bugs.webkit.org/show_bug.cgi?id=159967
<rdar://problem/26964090>

Reviewed by Jon Lee.

Source/WebCore:

WebKit recently starting honoring the playsinline and webkit-playsinline
attribute on iPhones. However, because these attributes previously did
nothing, some sites (such as Todou) were setting them on their content
and expecting that they are not honored. In this specific case, the
video is absolutely positioned to be 1 pixel x 1 pixel.

Previously, with iOS 9, apps could set the allowsInlineMediaPlayback
property on their WKWebView, which would honor the webkit-playsinline
attribute. Safari on iPhones didn't do this.

In order to not break these existing apps, it's important that the
allowsInlineMediaPlayback preference still allows webkit-playsinline
videos to play inline in apps using WKWebView. However, in Safari, these
videos should play fullscreen. (Todou videos have webkit-playsinline
but not playsinline.)

Therefore, in Safari, videos with playsinline should be inline, but
videos with webkit-playsinline should be fullscreen. In apps using
WKWebViews, if the app sets allowsInlineMediaPlayback, then videos with
playsinline should be inline, and videos with webkit-playsinline should
also be inline. Videos on iPad and Mac should all be inline by default.

We can create some truth tables for the cases which need to be covered:

All apps on Mac / iPad:
Presence of playsinline | Presence of webkit-playsinline | Result
========================|================================|===========
Not present             | Not present                    | Inline
Present                 | Not present                    | Inline
Not Present             | Present                        | Inline
Present                 | Present                        | Inline

Safari on iPhone:
Presence of playsinline | Presence of webkit-playsinline | Result
========================|================================|===========
Not present             | Not present                    | Fullscreen
Present                 | Not present                    | Inline
Not Present             | Present                        | Fullscreen
Present                 | Present                        | Inline

App on iPhone which sets allowsInlineMediaPlayback:
Presence of playsinline | Presence of webkit-playsinline | Result
========================|================================|===========
Not present             | Not present                    | Fullscreen
Present                 | Not present                    | Inline
Not Present             | Present                        | Inline
Present                 | Present                        | Inline

The way to distinguish Safari from another app is to create an SPI
boolean preference which Safari can set. This is already how the
iPhone and iPad are differentiated using the requiresPlayInlineAttribute
which Safari sets but other apps don't. However, this preference is
no longer sufficient because Safari should now be discriminating
between the playsinline and webkit-playsinline attributes. Therefore,
this preference should be extended to two boolean preferences, which
this patch adds:

allowsInlineMediaPlaybackWithPlaysInlineAttribute
allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute

Safari on iPhone will set
allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute to true,
and allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute to
false. Other apps on iPhone will get their defaults values (because they
are SPI) which means they will both be true. On iPad and Mac, apps will
use the defaults values where both are false.

This patch adds support for these two preferences, but does not remove
the existing inlineMediaPlaybackRequiresPlaysInlineAttribute preference.
I will remove the exising preference as soon as I update Safari to migrate
off of it.

Test: media/video-playsinline.html

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
* page/Settings.cpp:
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithPlaysInlineAttribute):
(WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

Source/WebKit/mac:

Add the two preferences to WebPreferences.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences allowsInlineMediaPlaybackWithPlaysInlineAttribute]):
(-[WebPreferences setAllowsInlineMediaPlaybackWithPlaysInlineAttribute:]):
(-[WebPreferences allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute]):
(-[WebPreferences setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Add the two preferences to WKWebViewConfiguration and WKPreferences to cover both
the Obj-C API and the C SPI.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetAllowsInlineMediaPlaybackWithPlaysInlineAttribute):
(WKPreferencesGetAllowsInlineMediaPlaybackWithPlaysInlineAttribute):
(WKPreferencesSetAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute):
(WKPreferencesGetAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _allowsInlineMediaPlaybackWithPlaysInlineAttribute]):
(-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackWithPlaysInlineAttribute:]):
(-[WKWebViewConfiguration _allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute]):
(-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

* media/video-playsinline.html: Updated.
* media/video-webkit-playsinline-expected.txt: Removed.
* media/video-webkit-playsinline.html: Removed.

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

4 years agoGet rid of custom bindings code for XMLHttpRequest.open()
cdumez@apple.com [Wed, 20 Jul 2016 22:03:36 +0000 (22:03 +0000)]
Get rid of custom bindings code for XMLHttpRequest.open()
https://bugs.webkit.org/show_bug.cgi?id=159984

Reviewed by Ryosuke Niwa.

Get rid of custom bindings code for XMLHttpRequest.open() as the
bindings generator is able to generate it.

Relevant specification:
- https://xhr.spec.whatwg.org/#xmlhttprequest

The issue is that legacy content prevents treating the 'async' argument
being undefined identical from it being omitted. However, this can be
achieved by using overloading in IDL, like in the specification.

No new tests, already covered by the following tests:
- http/tests/xmlhttprequest/basic-auth.html
- http/tests/xmlhttprequest/open-async-overload.html

* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::SendFunctor::SendFunctor): Deleted.
(WebCore::SendFunctor::line): Deleted.
(WebCore::SendFunctor::column): Deleted.
(WebCore::SendFunctor::url): Deleted.
(WebCore::SendFunctor::operator()): Deleted.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.idl:

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

4 years agoMark overriden methods in WebCore/svg final classes as final
commit-queue@webkit.org [Wed, 20 Jul 2016 21:21:21 +0000 (21:21 +0000)]
Mark overriden methods in WebCore/svg final classes as final
https://bugs.webkit.org/show_bug.cgi?id=159966

Patch by Rawinder Singh <rawinder.singh-webkit@cisra.canon.com.au> on 2016-07-20
Reviewed by Michael Catanzaro.

Update WebCore/svg classes so that overriden methods in final classes are marked final.

* svg/SVGAElement.h:
* svg/SVGAltGlyphDefElement.h:
* svg/SVGAltGlyphItemElement.h:
* svg/SVGAnimateTransformElement.h:
* svg/SVGAnimatedColor.h:
* svg/SVGCircleElement.h:
* svg/SVGClipPathElement.h:
* svg/SVGCursorElement.h:
* svg/SVGDefsElement.h:
* svg/SVGDescElement.h:
* svg/SVGEllipseElement.h:
* svg/SVGFEMergeNodeElement.h:
* svg/SVGFilterElement.h:
* svg/SVGFontElement.h:
* svg/SVGFontFaceElement.h:
* svg/SVGFontFaceFormatElement.h:
* svg/SVGFontFaceNameElement.h:
* svg/SVGFontFaceSrcElement.h:
* svg/SVGFontFaceUriElement.h:
* svg/SVGForeignObjectElement.h:
* svg/SVGGElement.h:
* svg/SVGGlyphElement.h:
* svg/SVGGlyphRefElement.h:
* svg/SVGHKernElement.h:
* svg/SVGImageElement.h:
* svg/SVGLineElement.h:
* svg/SVGMPathElement.h:
* svg/SVGMaskElement.h:
* svg/SVGMetadataElement.h:
* svg/SVGMissingGlyphElement.h:
* svg/SVGPathBuilder.h:
* svg/SVGPathByteStreamBuilder.h:
* svg/SVGPathByteStreamSource.h:
* svg/SVGPathElement.h:
* svg/SVGPathSegArcAbs.h:
* svg/SVGPathSegArcRel.h:
* svg/SVGPathSegClosePath.h:
* svg/SVGPathSegCurvetoCubicAbs.h:
* svg/SVGPathSegCurvetoCubicRel.h:
* svg/SVGPathSegCurvetoCubicSmoothAbs.h:
* svg/SVGPathSegCurvetoCubicSmoothRel.h:
* svg/SVGPathSegCurvetoQuadraticAbs.h:
* svg/SVGPathSegCurvetoQuadraticRel.h:
* svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
* svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
* svg/SVGPathSegLinetoAbs.h:
* svg/SVGPathSegLinetoHorizontalAbs.h:
* svg/SVGPathSegLinetoHorizontalRel.h:
* svg/SVGPathSegLinetoRel.h:
* svg/SVGPathSegLinetoVerticalAbs.h:
* svg/SVGPathSegLinetoVerticalRel.h:
* svg/SVGPathSegListBuilder.h:
* svg/SVGPathSegListSource.h:
* svg/SVGPathSegMovetoAbs.h:
* svg/SVGPathSegMovetoRel.h:
* svg/SVGPathStringSource.h:
* svg/SVGPathTraversalStateBuilder.h:
* svg/SVGPatternElement.h:
* svg/SVGRectElement.h:
* svg/SVGScriptElement.h:
* svg/SVGStopElement.h:
* svg/SVGStyleElement.h:
* svg/SVGSwitchElement.h:
* svg/SVGTRefElement.cpp:
* svg/SVGTitleElement.h:
* svg/SVGToOTFFontConversion.cpp:
* svg/SVGUnknownElement.h:
* svg/SVGVKernElement.h:
* svg/SVGViewElement.h:
* svg/SVGZoomEvent.h:
* svg/animation/SVGSMILElement.cpp:
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageClients.h:
* svg/graphics/SVGImageForContainer.h:
* svg/graphics/filters/SVGFEImage.h:
* svg/graphics/filters/SVGFilter.h:
* svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
* svg/properties/SVGMatrixTearOff.h:
* svg/properties/SVGPathSegListPropertyTearOff.h:

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

4 years agoFix the build after 41dade3
wenson_hsieh@apple.com [Wed, 20 Jul 2016 20:28:44 +0000 (20:28 +0000)]
Fix the build after 41dade3

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

4 years agoFix a linking failure caused by NetworkCache::Data::~Data()
changseok@webkit.org [Wed, 20 Jul 2016 20:03:06 +0000 (20:03 +0000)]
Fix a linking failure caused by NetworkCache::Data::~Data()
https://bugs.webkit.org/show_bug.cgi?id=159931

Linking is failed with clang 3.6. It says WebKit::NetworkCache::Data::~Data is undefined.
It is fixed by adding a destructor for NetworkCache::Data.

Reviewed by Alex Christensen.

* NetworkProcess/cache/NetworkCacheData.h:
(WebKit::NetworkCache::Data::~Data):

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

4 years agoRemove unnecessary if check from ParkingLot.cpp
commit-queue@webkit.org [Wed, 20 Jul 2016 20:00:04 +0000 (20:00 +0000)]
Remove unnecessary if check from ParkingLot.cpp
https://bugs.webkit.org/show_bug.cgi?id=159961

Patch by Rajeev Misra <rajeevmisraforapple@gmail.com> on 2016-07-20
Reviewed by Alex Christensen.

A good practice is to have as less conditional statement
or special cases as possible in code. This change
simply removes a unnecessary "if" statement for
condition which was already evaluated by switch/case
and thus there was no need to evaluate again.

* wtf/ParkingLot.cpp:

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

4 years agoTransition most IDB interfaces from ScriptExecutionContext to ExecState.
beidson@apple.com [Wed, 20 Jul 2016 19:42:53 +0000 (19:42 +0000)]
Transition most IDB interfaces from ScriptExecutionContext to ExecState.
https://bugs.webkit.org/show_bug.cgi?id=159975

Reviewed by Alex Christensen.

No new tests (No known behavior change).

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::deleteFunction):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursor.idl:

* Modules/indexeddb/IDBDatabase.idl:

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

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::count):
(WebCore::IDBIndex::doCount):
(WebCore::IDBIndex::openKeyCursor):
(WebCore::IDBIndex::get):
(WebCore::IDBIndex::doGet):
(WebCore::IDBIndex::getKey):
(WebCore::IDBIndex::doGetKey):
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBIndex.idl:

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::only): Deleted.
* Modules/indexeddb/IDBKeyRange.h:

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::deleteFunction):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::modernDelete):
(WebCore::IDBObjectStore::clear):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::count):
(WebCore::IDBObjectStore::doCount):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestOpenCursor):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestGetValue):
(WebCore::IDBTransaction::requestGetKey):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::requestPutOrAdd):
* Modules/indexeddb/IDBTransaction.h:

* inspector/InspectorIndexedDBAgent.cpp:

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

4 years agoMedia controls don't appear when pausing a small autoplaying video
wenson_hsieh@apple.com [Wed, 20 Jul 2016 19:25:16 +0000 (19:25 +0000)]
Media controls don't appear when pausing a small autoplaying video
https://bugs.webkit.org/show_bug.cgi?id=159972
<rdar://problem/27180657>

Reviewed by Beth Dakin.

Source/WebCore:

When pausing an autoplaying video, remove behavior restrictions for the
initial user gesture and show media controls.

New WebKit API test. See VideoControlsManagerSingleSmallAutoplayingVideo.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::pause):

Tools:

Adds a new test that verifies media controls show up when pausing a small autoplayed video. Also adds mechanisms
for simulating basic user interaction in VideoControlsManager.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:
(-[WKWebView mouseDownAtPoint:]):
(-[DidPlayMessageHandler userContentController:didReceiveScriptMessage:]):
(-[OnLoadMessageHandler initWithWKWebView:handler:]):
(-[OnLoadMessageHandler userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/autoplaying-video-with-audio.html: Added.

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

4 years agoFix null handling of HTMLMediaElement.mediaGroup
cdumez@apple.com [Wed, 20 Jul 2016 19:21:51 +0000 (19:21 +0000)]
Fix null handling of HTMLMediaElement.mediaGroup
https://bugs.webkit.org/show_bug.cgi?id=159974

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

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

Source/WebCore:

Fix null handling of HTMLMediaElement.mediaGroup to match the specification:
- https://www.w3.org/TR/html5/embedded-content-0.html#media-elements

null is supposed to be treated as the String "null". This patch aligns
our behavior with the specification. I tested Firefox and Chrome but both
do not have this attribute on HTMLMediaElement.

Also remove support for [TreatNullAs=LegacyNullString] from our bindings
generator as HTMLMediaElement.mediaGroup was the last user.

No new tests, rebaselined existing test.

* bindings/scripts/CodeGeneratorJS.pm:
(JSValueToNative):
* bindings/scripts/IDLAttributes.txt:
* html/HTMLMediaElement.idl:

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

4 years agoExplain the default value of WKWebViewConfiguration's ignoresViewportScaleLimits
timothy_horton@apple.com [Wed, 20 Jul 2016 18:59:22 +0000 (18:59 +0000)]
Explain the default value of WKWebViewConfiguration's ignoresViewportScaleLimits
https://bugs.webkit.org/show_bug.cgi?id=159978
<rdar://problem/27453189>

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
This defaults to NO.

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

4 years agoCSSStyleDeclaration.setProperty() should be able to unset "important" on a property
cdumez@apple.com [Wed, 20 Jul 2016 18:01:26 +0000 (18:01 +0000)]
CSSStyleDeclaration.setProperty() should be able to unset "important" on a property
https://bugs.webkit.org/show_bug.cgi?id=159959

Reviewed by Alexey Proskuryakov.

Source/WebCore:

CSSStyleDeclaration.setProperty() should be able to unsert "important"
on a property as per the latest specification:
- https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty
- https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute

Firefox and Chrome match the specification here but WebKit was ignoring calls
to setProperty() if there is already an "important" property wit this name
and if the new property does not have the "important" flag set.

This behavior was added a long time ago via Bug 60007. However, it does not
match the latest specification or other browsers.

Test: fast/css/CSSStyleDeclaration-setProperty-unset-important.html

* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::addParsedProperty):
Drop code that was added via Bug 60007 as this behavior no longer matches the
specification or other browsers. The layout test added in Bug 60007 fails in
other browsers and was updated in this patch to match the specification.

LayoutTests:

* fast/css/CSSStyleDeclaration-setProperty-unset-important-expected.txt: Added.
* fast/css/CSSStyleDeclaration-setProperty-unset-important.html: Added.
Add layout test coverage.

* fast/css/important-js-override.html:
The test covered our 'wrong' behavior and was failing in Firefox / Chrome.
I updated the test to match the behavior in the specification. The test
now passed in Chrome and Firefox.

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

4 years agoUnreviewed, rolling out r203423.
ryanhaddad@apple.com [Wed, 20 Jul 2016 17:55:53 +0000 (17:55 +0000)]
Unreviewed, rolling out r203423.
https://bugs.webkit.org/show_bug.cgi?id=159977

The test for this change is failing on Mac Release WK2
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"HTMLVideoElement frames do not update on iOS when src is a
MediaStream blob"
https://bugs.webkit.org/show_bug.cgi?id=159833
http://trac.webkit.org/changeset/203423

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

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

4 years agoLand test expectations for rdar://problem/27434307.
ryanhaddad@apple.com [Wed, 20 Jul 2016 17:54:19 +0000 (17:54 +0000)]
Land test expectations for rdar://problem/27434307.

* platform/mac/TestExpectations:

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

4 years ago[Win] MathML fonts are not found.
pvollan@apple.com [Wed, 20 Jul 2016 17:18:35 +0000 (17:18 +0000)]
[Win] MathML fonts are not found.
https://bugs.webkit.org/show_bug.cgi?id=159920

Reviewed by Alex Christensen.

When looking up a font in the registry, use the /v option of the Windows 'reg query' command to query
for a specific registry key value.

* Scripts/webkitdirs.pm:
(fontExists):

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

4 years agoFix null handling of HTMLSelectElement.value attribute
cdumez@apple.com [Wed, 20 Jul 2016 16:37:40 +0000 (16:37 +0000)]
Fix null handling of HTMLSelectElement.value attribute
https://bugs.webkit.org/show_bug.cgi?id=159925

Reviewed by Benjamin Poulain.

Source/WebCore:

Fix null handling of HTMLSelectElement.value attribute:
- https://html.spec.whatwg.org/multipage/forms.html#htmlselectelement

We were treating null as the null String which would end up setting
selectedIndex to -1. However, we should treat null as the String "null"
which would set the selectedIndex to the index of the <option> element
whose value is "null".

Firefox and Chrome match the specification.

Test: fast/dom/HTMLSelectElement/value-null-handling.html

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setValue):
* html/HTMLSelectElement.idl:

LayoutTests:

Add layout test coverage. I have verified that this test is passing in
both Firefox and Chrome.

* fast/dom/HTMLSelectElement/value-null-handling-expected.txt: Added.
* fast/dom/HTMLSelectElement/value-null-handling.html: Added.

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

4 years agoConsolidating duplicate TestExpectations for fast/images/animated-png.html.
ryanhaddad@apple.com [Wed, 20 Jul 2016 15:50:45 +0000 (15:50 +0000)]
Consolidating duplicate TestExpectations for fast/images/animated-png.html.

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoWeb Inspector: Pausing when Debugger tab is closed opens tab in wrong state
commit-queue@webkit.org [Wed, 20 Jul 2016 15:41:04 +0000 (15:41 +0000)]
Web Inspector: Pausing when Debugger tab is closed opens tab in wrong state
https://bugs.webkit.org/show_bug.cgi?id=159946
<rdar://problem/27429886>

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

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
At the end of construction, update the UI to match the current state
of the world. Such as updating the UI if we are paused, or if the
Timeline is capturing and we are temporarily disabling breakpoints.

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

4 years agoImprove prepare-ChangeLog for @media blocks
commit-queue@webkit.org [Wed, 20 Jul 2016 15:40:05 +0000 (15:40 +0000)]
Improve prepare-ChangeLog for @media blocks
https://bugs.webkit.org/show_bug.cgi?id=159907

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

* Scripts/prepare-ChangeLog:
(get_selector_line_ranges_for_css):
Get a range for @media blocks just like a selector.
    Start Line = line with '{'
    End line = line with '}'
    Name = "@media ..."

* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests_warning-expected.txt:
Improved error messages for unbalanced portions.

* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests-expected.txt:
* Scripts/webkitperl/prepare-ChangeLog_unittest/resources/css_unittests.css:
(.media-query::before):
(@media only screen and (max-width: 980px)):
(.media-query a):
(@media (-webkit-min-device-pixel-ratio: 2)):
(.both a):
(.both b):
(.media-query b):
(.media-query::after):

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

4 years agoCrashOnOverflow in JSC::Yarr::YarrPatternConstructor::setupAlternativeOffsets
msaboff@apple.com [Wed, 20 Jul 2016 14:50:32 +0000 (14:50 +0000)]
CrashOnOverflow in JSC::Yarr::YarrPatternConstructor::setupAlternativeOffsets
https://bugs.webkit.org/show_bug.cgi?id=159954

Reviewed by Benjamin Poulain.

YarrPatternConstructor::setupAlternativeOffsets() is using the checked arithmetic class
Checked<>, for offset calculations.  However the default use will just crash on
overflow.  Instead we should stop processing and propagate the error up the call stack.

Consolidated explicit error string with the common RegExp parsing error logic.
Moved that logic to YarrPattern as that seems like a better common place to put it.

* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* tests/stress/regress-159954.js: New test.
* yarr/YarrParser.h:
(JSC::Yarr::Parser::CharacterClassParserDelegate::CharacterClassParserDelegate):
(JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
(JSC::Yarr::Parser::Parser):
(JSC::Yarr::Parser::isIdentityEscapeAnError):
(JSC::Yarr::Parser::parseEscape):
(JSC::Yarr::Parser::parseCharacterClass):
(JSC::Yarr::Parser::parseParenthesesBegin):
(JSC::Yarr::Parser::parseParenthesesEnd):
(JSC::Yarr::Parser::parseQuantifier):
(JSC::Yarr::Parser::parseTokens):
(JSC::Yarr::Parser::parse):
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPatternConstructor::disjunction):
(JSC::Yarr::YarrPatternConstructor::setupDisjunctionOffsets):
(JSC::Yarr::YarrPatternConstructor::setupOffsets):
(JSC::Yarr::YarrPattern::errorMessage):
(JSC::Yarr::YarrPattern::compile):
* yarr/YarrPattern.h:
(JSC::Yarr::YarrPattern::reset):

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

4 years ago[Linux] MemoryPressureMonitor fallback code to get memory available in older linux...
carlosgc@webkit.org [Wed, 20 Jul 2016 13:07:05 +0000 (13:07 +0000)]
[Linux] MemoryPressureMonitor fallback code to get memory available in older linux kernels doesn't work
https://bugs.webkit.org/show_bug.cgi?id=159970

Reviewed by Antonio Gomes.

We are failing to detect zones when parsing /proc/zoneinfo.

* UIProcess/linux/MemoryPressureMonitor.cpp:
(WebKit::lowWatermarkPages): Use strncmp since we want to know whether the line starts with "Node".
(WebKit::MemoryPressureMonitor::MemoryPressureMonitor): Stop the polling if we fail to get the memory available,
because that means it's not sopported in the system for whatever reason.

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

4 years agoPostResolutionCallbackDisabler can resume pending requests while a ResourceLoadSuspen...
cdumez@apple.com [Wed, 20 Jul 2016 13:02:30 +0000 (13:02 +0000)]
PostResolutionCallbackDisabler can resume pending requests while a ResourceLoadSuspender is alive
https://bugs.webkit.org/show_bug.cgi?id=159962
<rdar://problem/21439264>

Reviewed by David Kilzer.

PostResolutionCallbackDisabler can resume pending requests while a ResourceLoadSuspender
is alive. We have both PostResolutionCallbackDisabler and ResourceLoadSuspender that
call LoaderStrategy::suspendPendingRequests() / LoaderStrategy::resumePendingRequests().
However, PostResolutionCallbackDisabler and ResourceLoadSuspender are not aware of each
other. It is therefore possible for a PostResolutionCallbackDisabler object to get
destroyed, causing LoaderStrategy::resumePendingRequests() to be called while a
ResourceLoadSuspender object is alive.

This leads to hard to investigate crashes where we end up re-entering WebKit and killing
the style resolver.

This patch drops ResourceLoadSuspender and uses PostResolutionCallbackDisabler instead.
There was only one user of ResourceLoadSuspender and PostResolutionCallbackDisabler
is better because it manages a resolutionNestingDepth counter internally to make sure
it only calls LoaderStrategy::resumePendingRequests() once all
PostResolutionCallbackDisabler instances are destroyed.

No new tests, there is no easy way to reproduce the crashes.

* dom/Document.cpp:
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
* loader/LoaderStrategy.cpp:
(WebCore::ResourceLoadSuspender::ResourceLoadSuspender): Deleted.
(WebCore::ResourceLoadSuspender::~ResourceLoadSuspender): Deleted.
* loader/LoaderStrategy.h:

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

4 years ago[Threaded Compositor] Web Process crash when the layer tree host is destroyed
carlosgc@webkit.org [Wed, 20 Jul 2016 12:17:37 +0000 (12:17 +0000)]
[Threaded Compositor] Web Process crash when the layer tree host is destroyed
https://bugs.webkit.org/show_bug.cgi?id=159922

Reviewed by Sergio Villar Senin.

It happens when the layer tree host is destroyed after the didChangeVisibleRect is scheduled to be run in the
main thread, but before it's actually dispatched. In that case the threaded compositor client points to a
deleted object and crashes when trying to dereference it.

* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::~ThreadedCompositor): Add an assert to ensure invalidate is always called before
the object is deleted.
(WebKit::ThreadedCompositor::invalidate): Terminate the compositing thread and nullify the client.
(WebKit::ThreadedCompositor::didChangeVisibleRect): Return early if the client is null when the task is
dispatched in the main thread.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: Add invalidate().
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::invalidate): Invalidate the ThreadedCompositor and chain up.
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:

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

4 years agoFix expectedFailErrorHandler in run-jsc-stress-tests
ossy@webkit.org [Wed, 20 Jul 2016 08:50:16 +0000 (08:50 +0000)]
Fix expectedFailErrorHandler in run-jsc-stress-tests
https://bugs.webkit.org/show_bug.cgi?id=159811

Reviewed by Yusuke Suzuki.

* Scripts/run-jsc-stress-tests:

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

4 years agoUnreviewed Mac cmake buildfix after r203426. Just for fun.
ossy@webkit.org [Wed, 20 Jul 2016 08:49:49 +0000 (08:49 +0000)]
Unreviewed Mac cmake buildfix after r203426. Just for fun.

* TestWebKitAPI/PlatformMac.cmake:

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

4 years agoJSC JIT Broken on ARMv7 Traditional (without Thumb2)
ossy@webkit.org [Wed, 20 Jul 2016 07:30:51 +0000 (07:30 +0000)]
JSC JIT Broken on ARMv7 Traditional (without Thumb2)
https://bugs.webkit.org/show_bug.cgi?id=159880

Reviewed by Carlos Garcia Campos.

* Source/cmake/OptionsCommon.cmake: Use the BFD linker on ARM traditional because of a gold linker bug.

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

4 years ago[Fetch API] Add a JS builtin to implement https://fetch.spec.whatwg.org/#concept...
commit-queue@webkit.org [Wed, 20 Jul 2016 06:23:13 +0000 (06:23 +0000)]
[Fetch API] Add a JS builtin to implement https://fetch.spec.whatwg.org/#concept-headers-fill
https://bugs.webkit.org/show_bug.cgi?id=159932

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-19
Reviewed by Alex Christensen.

Covered by existing tests.

Refactoring Headers initializeWith to use the new built-in internal that implements
https://fetch.spec.whatwg.org/#concept-headers-fill.

Refactoring Response constructor to put more checks in the JS builtin fucntion called within constructor.
Making use of the new built-in internal that implements https://fetch.spec.whatwg.org/#concept-headers-fill.

* CMakeLists.txt: Adding FetchHeadersInternals.js
* DerivedSources.make: Ditto.
* Modules/fetch/FetchHeaders.js:
(initializeFetchHeaders): Using fillFetchHeaders new built-in internal.
* Modules/fetch/FetchInternals.js: Added.
(fillFetchHeaders):
* Modules/fetch/FetchResponse.cpp: Refactoring to do more in the JS built-in. Splitting of initializeWith so
that the checks are done in the order defined by the spec.
(WebCore::FetchResponse::setStatus):
(WebCore::FetchResponse::initializeWith):
(WebCore::isNullBodyStatus): Deleted.
* Modules/fetch/FetchResponse.h:
* Modules/fetch/FetchResponse.idl:
* Modules/fetch/FetchResponse.js:
(initializeFetchResponse): New built-in internal.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

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

4 years agoFix null handling of SVGScriptElement.type attribute
cdumez@apple.com [Wed, 20 Jul 2016 05:13:06 +0000 (05:13 +0000)]
Fix null handling of SVGScriptElement.type attribute
https://bugs.webkit.org/show_bug.cgi?id=159927

Reviewed by Benjamin Poulain.

Source/WebCore:

Fix null handling of SVGScriptElement.type attribute:
- https://www.w3.org/TR/SVG2/interact.html#InterfaceSVGScriptElement

We were treating null as the null String which would end up removing
the 'type' content attribute. However, we should treat null as the
String "null".

Firefox and Chrome match the specification.

No new tests, updated existing test.

* svg/SVGScriptElement.idl:

LayoutTests:

Rebaseline existing test to reflect the behavior change.

* svg/dom/svg-element-attribute-js-null-expected.txt:
* svg/dom/svg-element-attribute-js-null.xhtml:

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

4 years agoFix null handling of several HTMLDocument attributes
cdumez@apple.com [Wed, 20 Jul 2016 05:09:51 +0000 (05:09 +0000)]
Fix null handling of several HTMLDocument attributes
https://bugs.webkit.org/show_bug.cgi?id=159923

Reviewed by Benjamin Poulain.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

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

Source/WebCore:

Fix null handling of several HTMLDocument attributes:
- https://html.spec.whatwg.org/multipage/dom.html#document
- https://html.spec.whatwg.org/multipage/obsolete.html#document-partial

In particular, null handling was incorrect in WebKit for 'dir',
'bgColor', 'fgColor', 'alinkColor', 'linkColor' and 'vlinkColor'.

Firefox and Chrome match the specification.

Test: fast/dom/HTMLDocument/null-handling.html

* html/HTMLDocument.idl:

LayoutTests:

Add layout test coverage. I have verified that this test is passing in
both Firefox and Chrome.

* fast/dom/HTMLDocument/null-handling-expected.txt: Added.
* fast/dom/HTMLDocument/null-handling.html: Added.

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

4 years agoWeb Automation: WebAutomationSessionProxy's HashMaps should support '0' as valid...
bburg@apple.com [Wed, 20 Jul 2016 03:23:18 +0000 (03:23 +0000)]
Web Automation: WebAutomationSessionProxy's HashMaps should support '0' as valid keys
https://bugs.webkit.org/show_bug.cgi?id=159957
<rdar://problem/27376446>

Reviewed by Joseph Pecoraro.

* WebProcess/Automation/WebAutomationSessionProxy.h:
Use UnsignedWithZeroKeyHashTraits to avoid problems with zero as a key.

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

4 years agoDocument.createElementNS() / createAttributeNS() parameters should be mandatory
cdumez@apple.com [Wed, 20 Jul 2016 01:45:51 +0000 (01:45 +0000)]
Document.createElementNS() / createAttributeNS() parameters should be mandatory
https://bugs.webkit.org/show_bug.cgi?id=159938

Reviewed by Benjamin Poulain.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

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

Source/WebCore:

Document.createElementNS() / createAttributeNS() parameters should be mandatory:
- https://dom.spec.whatwg.org/#document

They were optional in WebKit. However, Firefox and Chrome both match the
specification.

No new tests, rebaselined existing tests.

* dom/Document.idl:

LayoutTests:

Update / rebaseline existing tests to reflect the behavior change.

* fast/dom/Document/createAttributeNS-namespace-err-expected.txt:
* fast/dom/Document/createElementNS-namespace-err-expected.txt:
* fast/dom/Document/script-tests/createAttributeNS-namespace-err.js:
* fast/dom/Document/script-tests/createElementNS-namespace-err.js:
* fast/dom/attribute-downcast-right.html:

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

4 years agoThe default testing mode should not involve disabling the FTL JIT
fpizlo@apple.com [Wed, 20 Jul 2016 01:45:25 +0000 (01:45 +0000)]
The default testing mode should not involve disabling the FTL JIT
https://bugs.webkit.org/show_bug.cgi?id=159929

Rubber stamped by Mark Lam and Saam Barati.

Source/JavaScriptCore:

Use the new powers to make some tests run only in the default configuration (i.e. FTL,
concurrent JIT).

* tests/mozilla/mozilla-tests.yaml:

Tools:

It used to be the case that most actively maintained ports did not have the FTL JIT enabled.
Heck, for most of the FTL's initial development, it wasn't enabled anywhere. So, testing the
FTL was not the default. You had to enable it with an option.

For some reason we have kept this arrangement even though the FTL JIT is now the default on
all of the major ports. This has become a serious pain. For example, it's useful to be able
to say that a test should only run in the default config that is representative of what a
normal user would see if they ran JSC. Clearly, this would be a config that does not
explicitly disable the FTL JIT on the command line. However, if you try to specify this then
your test won't run at all if the --ftl-jit option is not passed. That's dangerous!

So, this change gets rid of all of this logic. I think it's better to get rid of it then to
try to fix it, because:

- I don't know what the fix would look like. Presumably it would ensure that ports that don't
  have the FTL enabled never run any tests that explicitly disable the FTL, since that
  doesn't do anything. The code is not really structured to allow this.

- It benefits a minority of clients. Three build bots run tests in a config that has the FTL
  disabled in testing. On the other hand there are already build bots that do FTL tests
  despite having the FTL disabled by virtue of being a 32-bit platform. So, maybe rather than
  preserving this broken feature, we should create something that (a) acknowledges the fact
  that the FTL is the default on those platforms that support it and (b) avoids running
  no-ftl tests on precisely those platforms that don't have FTL.

- To the extent that some bots benefited from disabling FTL tests, they were doing it by
  relying on a feature that was never meant to stick around. The FTL JIT is meant to be the
  default configuration. Disabling the FTL JIT is the non-default. So, we shouldn't be
  pretending that the FTL JIT is not the default just because some bots used that as an
  optimization.

This change allows me to speed up some debug tests and paint some bots green.

* Scripts/run-javascriptcore-tests:
(runJSCStressTests):
* Scripts/run-jsc-stress-tests:

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

4 years agoUse getElementById for attribute matching if the attribute name is html's id
benjamin@webkit.org [Wed, 20 Jul 2016 01:29:25 +0000 (01:29 +0000)]
Use getElementById for attribute matching if the attribute name is html's id
https://bugs.webkit.org/show_bug.cgi?id=159960

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-07-19
Reviewed by Chris Dumez.

Source/WebCore:

Elliott Sprehn discovered YUI makes heavy uses of querySelector with [id=value]
(https://bugs.chromium.org/p/chromium/issues/detail?id=627242).

If we are not in quirks mode, IdForStyleResolution has the same value
as the Id attribute. We can use the same optimization for both cases.

Tests: fast/selectors/id-attribute-querySelector-used-as-id-selector-quirks.html
       fast/selectors/id-attribute-querySelector-used-as-id-selector.html

* dom/SelectorQuery.cpp:
(WebCore::canBeUsedForIdFastPath):
(WebCore::findIdMatchingType):
(WebCore::SelectorDataList::SelectorDataList):
(WebCore::selectorForIdLookup):
(WebCore::filterRootById):

LayoutTests:

* fast/selectors/id-attribute-querySelector-used-as-id-selector-expected.txt: Added.
* fast/selectors/id-attribute-querySelector-used-as-id-selector-quirks-expected.txt: Added.
* fast/selectors/id-attribute-querySelector-used-as-id-selector-quirks.html: Added.
* fast/selectors/id-attribute-querySelector-used-as-id-selector.html: Added.

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

4 years agoDrop SVGElement.xmlbase attribute
cdumez@apple.com [Wed, 20 Jul 2016 01:27:24 +0000 (01:27 +0000)]
Drop SVGElement.xmlbase attribute
https://bugs.webkit.org/show_bug.cgi?id=159926

Reviewed by Benjamin Poulain.

Source/WebCore:

Drop SVGElement.xmlbase attribute as it is no longer part of the
specification:
- https://www.w3.org/TR/SVG2/types.html#InterfaceSVGElement

Both Firefox and Chrome have already dropped support for
SVGElement.xmlbase.

Chrome's intent to remove:
https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/TfwMq4d25hk/C-v_iC_wKfAJ

Test: svg/dom/SVGElement-xmlbase.html

* svg/SVGElement.cpp:
(WebCore::SVGElement::removedFrom): Deleted.
* svg/SVGElement.h:
* svg/SVGElement.idl:

LayoutTests:

* svg/dom/SVGElement-xmlbase-expected.txt: Added.
* svg/dom/SVGElement-xmlbase.html: Added.
Check that SVGElement.xmlbase does not exist.

* svg/dom/svg-element-attribute-js-null-expected.txt:
* svg/dom/svg-element-attribute-js-null.xhtml:
Drop obsolete testing for SVGElement.xmlbase.

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

4 years agoAlign CSSStyleDeclaration.setProperty() with the specification
cdumez@apple.com [Wed, 20 Jul 2016 01:20:23 +0000 (01:20 +0000)]
Align CSSStyleDeclaration.setProperty() with the specification
https://bugs.webkit.org/show_bug.cgi?id=159955

Reviewed by Benjamin Poulain.

Source/WebCore:

Align CSSStyleDeclaration.setProperty() with the specification:
- https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface

In particular, the following changes were needed:
1. The 'value' parameter should not be optional
2. The 'priority' parameter should treat null as the empty string
   rather than the string "null".
3. The 'priority' parameter's default value should be the empty string,
   not the string "undefined".
4. CSSStyleDeclaration.setProperty() should return early if 'priority'
   is not the empty string and is not an ASCII case-insensitive match
   for the string "important".

Chrome matches the specification entirely.
Firefox matches the specification with the exception that it does a
case-sensitive match for "important".

Test: fast/css/CSSStyleDeclaration-setProperty.html

* css/CSSStyleDeclaration.idl:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):

LayoutTests:

Add layout test coverage.

* fast/css/CSSStyleDeclaration-setProperty-expected.txt: Added.
* fast/css/CSSStyleDeclaration-setProperty.html: Added.
* fast/css/shorthand-priority.html:

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

4 years agoFix API test after r203426.
achristensen@apple.com [Wed, 20 Jul 2016 00:29:21 +0000 (00:29 +0000)]
Fix API test after r203426.
https://bugs.webkit.org/show_bug.cgi?id=159949

* TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm:
(TEST):
If there is website data already on disk, the initial count after putting the AppCache data in place will not be exactly 1.
This is no problem.  We want to verify that it is a nonzero number and that it decrements by one when we remove the 1 AppCache data.

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

4 years agoMove WebKitErrorFrameLoadBlockedByContentFilter from WebKitErrors.h to WebKitErrorsPr...
aestes@apple.com [Wed, 20 Jul 2016 00:09:52 +0000 (00:09 +0000)]
Move WebKitErrorFrameLoadBlockedByContentFilter from WebKitErrors.h to WebKitErrorsPrivate.h
https://bugs.webkit.org/show_bug.cgi?id=159956

Reviewed by Dan Bernstein.

Source/WebKit/mac:

* Misc/WebKitErrors.h: Moved definition of WebKitErrorFrameLoadBlockedByContentFilter from here ...
* Misc/WebKitErrorsPrivate.h: to here.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/ContentFiltering.mm: Included WKErrorRef.h.
(-[LoadAlternateNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
Used kWKErrorCodeFrameLoadBlockedByContentFilter instead of WebKitErrorFrameLoadBlockedByContentFilter.
* TestWebKitAPI/Tests/mac/ContentFiltering.mm: Included WebKitErrorsPrivate.h instead of WebKitErrors.h.

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

4 years agoCSP: Improve support for multiple policies to more closely conform to the CSP Level...
dbates@webkit.org [Tue, 19 Jul 2016 23:38:26 +0000 (23:38 +0000)]
CSP: Improve support for multiple policies to more closely conform to the CSP Level 2 spec.
https://bugs.webkit.org/show_bug.cgi?id=159841
<rdar://problem/27381684>

Reviewed by Brent Fulgham.

Source/WebCore:

Implement a first pass at sending multiple violation reports so as to more closely
conform to section Enforcing multiple policies of the Content Security Policy Level 2 spec.,
<https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 25 April 2016).

Tests: http/tests/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy2.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
       http/tests/security/contentSecurityPolicy/1.1/scripthash-in-enforced-policy-and-not-in-report-only.html
       http/tests/security/contentSecurityPolicy/1.1/scripthash-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy.html
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy.php
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy2.php
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.php
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy.php
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy2.php
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-enforced-policy-and-not-in-report-only.html
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy.html
       http/tests/security/contentSecurityPolicy/1.1/scriptnonce-multiple-policies.html

* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allPoliciesWithDispositionAllow): Added. Returns whether the resource
is allowed by all of the policies with the specified disposition.
(WebCore::ContentSecurityPolicy::allPoliciesAllow): Added. Returns whether the resource is allowed by
all of the enforced policies.
(WebCore::ContentSecurityPolicy::findHashOfContentInPolicies): Formerly named foundHashOfContentInAllPolicies.
Modified to return a ("has found hash in all enforced policies, "has found hash in all report-only policies)-pair
so that we can differentiate whether the hash violated an enforced policy or a report-only policy.
(WebCore::ContentSecurityPolicy::allowJavaScriptURLs): Write in terms of ContentSecurityPolicy::allPoliciesAllow().
(WebCore::ContentSecurityPolicy::allowInlineEventHandlers): Ditto.
(WebCore::ContentSecurityPolicy::allowScriptWithNonce): For now only accept a nonce if it is allowed by
all enforced policies. As a side effect of this change is that we only send a CSP violation report when a
nonce violates a report-only policy only if the nonce also violates one or more enforced policies. We will
address this limitation in <https://bugs.webkit.org/show_bug.cgi?id=159830>.
(WebCore::ContentSecurityPolicy::allowStyleWithNonce): Ditto.
(WebCore::ContentSecurityPolicy::allowInlineScript): Differentiate between a hash/'unsafe-inline' that
matches/is contained in all enforce policies and a hash/'unsafe-inline' that matches/is contained in all
report-only policies so that we only allow the resource for the former. As a side effect of this change
we may report that a resource violated a policy even if it contained the hash. See <https://bugs.webkit.org/show_bug.cgi?id=159832>
for more details.
(WebCore::ContentSecurityPolicy::allowInlineStyle): Ditto.
(WebCore::ContentSecurityPolicy::allowEval): Write in terms of ContentSecurityPolicy::allPoliciesAllow().
(WebCore::ContentSecurityPolicy::allowFrameAncestors): Ditto.
(WebCore::ContentSecurityPolicy::allowPluginType): Ditto.
(WebCore::ContentSecurityPolicy::allowScriptFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowChildContextFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
(WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
(WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
(WebCore::ContentSecurityPolicy::allowBaseURI): Ditto.
(WebCore::ContentSecurityPolicy::foundHashOfContentInAllPolicies): Deleted.
* page/csp/ContentSecurityPolicy.h:
(WebCore::ContentSecurityPolicy::violatedDirectiveInAnyPolicy): Deleted.

LayoutTests:

* http/tests/security/contentSecurityPolicy/1.1/resources/scripthash-in-enforced-policy-and-not-in-report-only.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/resources/scripthash-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/resources/scriptnonce-in-enforced-policy-and-not-in-report-only.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/resources/scriptnonce-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/script-blocked-sends-multiple-reports.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-enforced-policy-and-blocked-by-report-policy2.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-enforced-policy-and-allowed-by-report-policy2.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-in-enforced-policy-and-not-in-report-only-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-in-enforced-policy-and-not-in-report-only.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/scripthash-multiple-policies-expected.txt: Update expected result to reflect additional console
messages. We will remove these extraneous console messages as part of the fix for <https://bugs.webkit.org/show_bug.cgi?id=159832>.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-enforced-policy-and-blocked-by-report-policy2.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-allowed-by-legacy-enforced-policy-and-blocked-by-report-policy2.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-enforced-policy-and-allowed-by-report-policy2.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-allowed-by-report-policy2.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-blocked-by-legacy-enforced-policy-and-blocked-by-report-policy2.php: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-enforced-policy-and-not-in-report-only-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-enforced-policy-and-not-in-report-only.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-in-one-enforced-policy-neither-in-another-enforced-policy-nor-report-policy.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-multiple-policies-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/scriptnonce-multiple-policies.html: Added.

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

4 years agoAdd regression test for r203392
achristensen@apple.com [Tue, 19 Jul 2016 23:06:42 +0000 (23:06 +0000)]
Add regression test for r203392
https://bugs.webkit.org/show_bug.cgi?id=159949

Reviewed by Brady Eidson.

* TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm:
(fileSize):
(swizzledBundleIdentifierWebBookmarksD):
(defaultApplicationCacheDirectory):
(TEST):
(swizzledBundleIdentifierMobileSafari): Deleted.
This actually tests that webbookmarksd uses the path quirk in WebsiteDataStore::defaultApplicationCacheDirectory.
I wanted to verify that it uses the same path as MobileSafari, but swizzling out the bundleIdentifier twice caused
problems with the static bools that are set once in RuntimeApplicationChecks.mm.

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

4 years agoFix null handling of HTMLScriptElement.text attribute
cdumez@apple.com [Tue, 19 Jul 2016 22:55:50 +0000 (22:55 +0000)]
Fix null handling of HTMLScriptElement.text attribute
https://bugs.webkit.org/show_bug.cgi?id=159943

Reviewed by Benjamin Poulain.

LayoutTests/imported/w3c:

Rebaseline W3C test now that one more check is passing.

* web-platform-tests/html/semantics/scripting-1/the-script-element/script-text-expected.txt:

Source/WebCore:

Fix null handling of HTMLScriptElement.text attribute:
- https://html.spec.whatwg.org/multipage/scripting.html#the-script-element

We should treat null as the "null" String but we were treating it as
the empty string.

Firefox and Chrome match the specification.

No new tests, rebaselined existing test.

* html/HTMLScriptElement.idl:

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

4 years agoautocapitalize attribute should not use [TreatNullAs=LegacyNullString]
cdumez@apple.com [Tue, 19 Jul 2016 22:55:21 +0000 (22:55 +0000)]
autocapitalize attribute should not use [TreatNullAs=LegacyNullString]
https://bugs.webkit.org/show_bug.cgi?id=159934

Reviewed by Benjamin Poulain.

Source/WebCore:

autocapitalize attribute should not use [TreatNullAs=LegacyNullString]. This is
non-standard and we want to drop support for it from the bindings generator.

Instead, use [TreatNullAs=EmptyString] in order to maintain existing behavior
given that both a missing/empty attribute result in using the default
autocapitalization mode and that autocapitalize returns the empty string by
default.

Test: platform/ios-simulator/ios/fast/forms/autocapitalize-null.html

* html/HTMLFormElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLTextAreaElement.idl:

LayoutTests:

Add layout test coverage.

* platform/ios-simulator/ios/fast/forms/autocapitalize-null-expected.txt: Added.
* platform/ios-simulator/ios/fast/forms/autocapitalize-null.html: Added.

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

4 years agoAdd regression test for r203392
achristensen@apple.com [Tue, 19 Jul 2016 22:51:13 +0000 (22:51 +0000)]
Add regression test for r203392
https://bugs.webkit.org/show_bug.cgi?id=159949

Reviewed by Brady Eidson.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-shm: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/ApplicationCache.db-wal: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/LocalStorageClear.mm:
(TEST):
(fileSize):
(swizzledBundleIdentifierMobileSafari):
(swizzledBundleIdentifierWebBookmarksD):
(defaultApplicationCacheDirectory):
* TestWebKitAPI/cocoa/InstanceMethodSwizzler.h: Copied from TestWebKitAPI/mac/InstanceMethodSwizzler.h.
* TestWebKitAPI/cocoa/InstanceMethodSwizzler.mm: Copied from TestWebKitAPI/mac/InstanceMethodSwizzler.mm.
* TestWebKitAPI/mac/InstanceMethodSwizzler.h: Removed.
* TestWebKitAPI/mac/InstanceMethodSwizzler.mm: Removed.

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

4 years agoREGRESSION(r203415): ASSERTION FAILED: !m_layoutRoot->container() || !m_layoutRoot...
zalan@apple.com [Tue, 19 Jul 2016 22:50:10 +0000 (22:50 +0000)]
REGRESSION(r203415): ASSERTION FAILED: !m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout()
https://bugs.webkit.org/show_bug.cgi?id=159952

Reviewed by Simon Fraser.

Update ASSERTs to reflect new functionality, that is, now we can end up in a state
where the container (RenderView) of one of the dirty subtrees is dirty.
See r203415.

Covered by editing/pasteboard/drag-drop-input-in-svg.svg

* page/FrameView.cpp:
(WebCore::FrameView::scheduleRelayoutOfSubtree):

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

4 years agoREGRESSION(202927): The first slide is the only displayed slide when Quicklooking...
dino@apple.com [Tue, 19 Jul 2016 22:43:41 +0000 (22:43 +0000)]
REGRESSION(202927): The first slide is the only displayed slide when Quicklooking a Keynote file
https://bugs.webkit.org/show_bug.cgi?id=159948
<rdar://problem/27391012>

Reviewed by Simon Fraser.

There is an iOS bug (<rdar://problem/27416744>) that is causing us
to not always get a color space on CGContextRefs. Investigation of this
exposed some optimizations we can take when we are creating ImageBuffers.
In particular, if we have a bitmap context or an IOSurfaceContext we
can simply copy their color space using API. Otherwise we stick with
the existing CGContextCopyDeviceColorSpace.

Lastly, if for some reason we are unable to copy the device color space,
we should fall back to sRGB.

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
* platform/spi/cg/CoreGraphicsSPI.h: Add some SPI and enums.

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

4 years agoHTMLVideoElement frames do not update on iOS when src is a MediaStream blob
commit-queue@webkit.org [Tue, 19 Jul 2016 22:35:51 +0000 (22:35 +0000)]
HTMLVideoElement frames do not update on iOS when src is a MediaStream blob
https://bugs.webkit.org/show_bug.cgi?id=159833
<rdar://problem/27379487>

Patch by George Ruan <gruan@apple.com> on 2016-07-19
Reviewed by Eric Carlson.

Source/WebCore:

Test: fast/mediastream/MediaStream-video-element-displays-buffer.html

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/avfoundation/MediaSampleAVFObjC.h: Change create to return a Ref<T> instead
of RefPtr<T>
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Make observer of
MediaStreamTrackPrivate and make MediaPlayer use an AVSampleBufferDisplayLayer instead of CALayer.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Clean up
observers and AVSampleBufferDisplayLayer
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Ensures AVSampleBufferDisplayLayer
is available.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Placeholder.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Responsible
for enqueuing sample buffers to the active video track.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Ensures that an AVSampleBufferDisplayLayer
exists.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Destroys the AVSampleBufferDisplayLayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Replace CALayer with AVSampleBufferDisplayLayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Called from MediaStreamTrackPrivate when a
new SampleBuffer is available.
(WebCore::updateTracksOfType): Manage adding and removing self as observer from tracks.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Replace CALayer with AVSampleBufferDisplayLayer
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::acceleratedRenderingStateChanged): Copied from
MediaPlayerPrivateMediaSourceAVFObjC.mm
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Deleted CALayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Deleted process of updating CALayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize): Deleted CALayer.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Deleted.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::updateActiveVideoTrack): Remove redundant check.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::sourceHasMoreMediaData): Called from RealtimeMediaSource when a new SampleBuffer
is available.
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated): Relays to MediaPlayerPrivateMediaStream that
a new SampleBuffer is available to enqueue to the AVSampleBufferDisplayLayer.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::mediaDataUpdated): Relays to all observers that a new SampleBuffer is available.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame): Calls mediaDataUpdated when a new SampleBuffer is captured.

LayoutTests:

* fast/mediastream/MediaStream-video-element-displays-buffer-expected.txt: Added.
* fast/mediastream/MediaStream-video-element-displays-buffer.html: Added. Checks that
a video element with a mediastream source displays frames that are neither black or transparent.
* fast/mediastream/resources/getUserMedia-helper.js:
(setupVideoElementWithStream): Sets up video element with global variable mediastream.

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

4 years agoGet rid of a #define private public hack in WebCore
andersca@apple.com [Tue, 19 Jul 2016 21:55:51 +0000 (21:55 +0000)]
Get rid of a #define private public hack in WebCore
https://bugs.webkit.org/show_bug.cgi?id=159953

Reviewed by Dan Bernstein.

Use @package instead.

* bindings/objc/DOMInternal.h:
* bindings/objc/DOMObject.h:

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

4 years agoTest262 should have a file with the revision and url
keith_miller@apple.com [Tue, 19 Jul 2016 21:27:01 +0000 (21:27 +0000)]
Test262 should have a file with the revision and url
https://bugs.webkit.org/show_bug.cgi?id=159937

Reviewed by Mark Lam.

Source/JavaScriptCore:

The file.

* tests/test262/test262-Revision.txt: Added.

Tools:

The import script should update the information from
the path to the test262 repository it gets.

* Scripts/import-test262-tests:

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

4 years agoFix SharedBuffer leak in MockContentFilter::replacementData().
akling@apple.com [Tue, 19 Jul 2016 21:14:04 +0000 (21:14 +0000)]
Fix SharedBuffer leak in MockContentFilter::replacementData().
<https://webkit.org/b/159945>

Reviewed by Andy Estes.

Spotted on leaks bot. This code was pretty explicit about how it's going to leak.
Since this is in the mock filter, it only affected layout tests.

* testing/MockContentFilter.cpp:
(WebCore::MockContentFilter::replacementData):

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

4 years agoWebCore-7602.1.42 fails to build: error: private field 'm_vm' is not used
andersca@apple.com [Tue, 19 Jul 2016 20:52:48 +0000 (20:52 +0000)]
WebCore-7602.1.42 fails to build: error: private field 'm_vm' is not used
https://bugs.webkit.org/show_bug.cgi?id=159944
rdar://problem/27420308

Reviewed by Dan Bernstein.

Wrap the m_vm declaration and initialization in conditional guards.

* Scripts/builtins/builtins_generate_internals_wrapper_header.py:
(generate_members):
* Scripts/builtins/builtins_generate_internals_wrapper_implementation.py:
(BuiltinsInternalsWrapperImplementationGenerator.generate_constructor):
Add guards.

* Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:
Update expected results.

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

4 years agoLand test expectations for rdar://problem/27356144.
ryanhaddad@apple.com [Tue, 19 Jul 2016 20:43:49 +0000 (20:43 +0000)]
Land test expectations for rdar://problem/27356144.

* platform/mac/TestExpectations:

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

4 years agoTemporary workaround for iOS EWS failing after the fix for bug 159539.
ap@apple.com [Tue, 19 Jul 2016 20:32:29 +0000 (20:32 +0000)]
Temporary workaround for iOS EWS failing after the fix for bug 159539.
To be deleted once the root cause is found and addressed.

* EWSTools/start-queue-mac.sh:

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

4 years agoREGRESSION (r203348-r203368): ASSERTION FAILED: from.isCell() && from.asCell()->JSCel...
fpizlo@apple.com [Tue, 19 Jul 2016 20:15:51 +0000 (20:15 +0000)]
REGRESSION (r203348-r203368): ASSERTION FAILED: from.isCell() && from.asCell()->JSCell::inherits(std::remove_pointer<To>::type::info())
https://bugs.webkit.org/show_bug.cgi?id=159930

Reviewed by Geoffrey Garen.

The problem is that the 32-bit DFG can flush the scope register as an unboxed cell, but the
Register::scope() method was causing us to assert that it's a JSValue with proper cell
boxing. We could have forced the DFG to flush it as a boxed JSValue, but I don't think that
would have made anything better. This fixes the issue by teaching Register::scope() that it
might see unboxed cells.

* runtime/JSScope.h:
(JSC::Register::scope):
(JSC::ExecState::lexicalGlobalObject):

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

4 years agotheguardian.co.uk crossword puzzles are sometimes not displaying text
zalan@apple.com [Tue, 19 Jul 2016 20:10:02 +0000 (20:10 +0000)]
theguardian.co.uk crossword puzzles are sometimes not displaying text
https://bugs.webkit.org/show_bug.cgi?id=159924
<rdar://problem/27409483>

Reviewed by Simon Fraser.

Source/WebCore:

This patch fixes the case when
- 2 disjoint subtrees are dirty
- RenderView is also dirty.
and we end up not laying out one of the 2 subtrees.

In FrameView::scheduleRelayoutOfSubtree, we assume that when the RenderView is dirty
we already have a pending full layout which means that any previous subtree layouts have already been
converted to full layouts.
However this assumption is incorrect. RenderView can get dirty without checking if there's
already a pending subtree layout.
One option to solve this problem would be to override RenderObject::setNeedsLayout in RenderView
so that when the RenderView gets dirty, we could also convert any pending subtree layout to full layout.
However RenderObject::setNeedsLayout is a hot function and making it virtual would impact performance.
The other option is to always normalize subtree layouts in FrameView::scheduleRelayoutOfSubtree().
This patch implements the second option.

Test: fast/misc/subtree-layouts.html

* page/FrameView.cpp:
(WebCore::FrameView::scheduleRelayoutOfSubtree):

LayoutTests:

* fast/misc/subtree-layouts-expected.html: Added.
* fast/misc/subtree-layouts.html: Added.

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

4 years agoSome payment authorization status values should keep the sheet active
andersca@apple.com [Tue, 19 Jul 2016 20:07:38 +0000 (20:07 +0000)]
Some payment authorization status values should keep the sheet active
https://bugs.webkit.org/show_bug.cgi?id=159936
rdar://problem/26756701

Reviewed by Tim Horton.

Source/WebCore:

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completePayment):
Keep the sheet active if the status isn't a final state status.

* Modules/applepay/PaymentAuthorizationStatus.h:
(WebCore::isFinalStateStatus):
Add a new helper function that returns whether a given payment authorization status is "final",
meaning that once that status has been passed to completePayment, the session is finished.

Source/WebKit2:

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
If the status isn't a final state status, bounce the current state back to active.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
Rename the _authorized ivar to _didReachFinalState.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
Set _didReachFinalState based on the return value of isFinalStateStatus.

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

4 years agoB3 methods that mutate the successors array should take FrequentedBlock by value
fpizlo@apple.com [Tue, 19 Jul 2016 19:20:02 +0000 (19:20 +0000)]
B3 methods that mutate the successors array should take FrequentedBlock by value
https://bugs.webkit.org/show_bug.cgi?id=159935

Reviewed by Michael Saboff.

This bug was found by ASan testing. setSuccessors() takes a const FrequentedBlock&, and the
caller that caused the ASan crash was doing:

block->setSuccessors(block->notTaken())

So, inside setSuccessors(), after we resize() the successors array, the const
FrequentedBlock& points to nonsense.

The fix is to pass FrequentedBlock by value in all of these kinds of methods.

No new tests, but ASan testing catches this instantly for anything that triggers CFG
simplification in B3. So like half of our tests.

* b3/B3BasicBlock.cpp:
(JSC::B3::BasicBlock::clearSuccessors):
(JSC::B3::BasicBlock::appendSuccessor):
(JSC::B3::BasicBlock::setSuccessors):
* b3/B3BasicBlock.h:
(JSC::B3::BasicBlock::successors):
(JSC::B3::BasicBlock::successorBlock):
* b3/B3Value.cpp:
(JSC::B3::Value::replaceWithPhi):
(JSC::B3::Value::replaceWithJump):
(JSC::B3::Value::replaceWithOops):
* b3/B3Value.h:

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

4 years agoAX: Incorrect behavior for word related text marker functions when there's collapsed...
n_wang@apple.com [Tue, 19 Jul 2016 18:14:02 +0000 (18:14 +0000)]
AX: Incorrect behavior for word related text marker functions when there's collapsed whitespace
https://bugs.webkit.org/show_bug.cgi?id=159910

Reviewed by Chris Fleizach.

Source/WebCore:

We are getting a bad CharacterOffset when there's collapsed whitespace. Added a TraverseOptionValidateOffset
option to make sure we are getting the correct CharacterOffset based on the corresponding Range offset. And
fixed a word navigation issue based on that.

Test: accessibility/mac/text-marker-word-nav-collapsed-whitespace.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::traverseToOffsetInRange):
(WebCore::AXObjectCache::rangeForNodeContents):
(WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
(WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
(WebCore::AXObjectCache::rightWordRange):
(WebCore::AXObjectCache::previousBoundary):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::isNodeInUse):

LayoutTests:

* accessibility/mac/text-marker-word-nav-collapsed-whitespace-expected.txt: Added.
* accessibility/mac/text-marker-word-nav-collapsed-whitespace.html: Added.

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

4 years ago[Streams API] ReadableStreamController methods should throw if its stream is not...
commit-queue@webkit.org [Tue, 19 Jul 2016 17:27:32 +0000 (17:27 +0000)]
[Streams API] ReadableStreamController methods should throw if its stream is not readable
https://bugs.webkit.org/show_bug.cgi?id=159871

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-19
Reviewed by Xabier Rodriguez-Calvar.

LayoutTests/imported/w3c:

* web-platform-tests/streams/readable-streams/bad-underlying-sources.https-expected.txt:

Source/WebCore:

Spec now mandates close and enqueue to throw if ReadableStream is not readable.
Covered by rebased and/or modified tests.

* Modules/streams/ReadableStreamController.js:
(enqueue): Throwing a TypeError if controlled stream is not readable.
(close): Ditto.

LayoutTests:

* streams/reference-implementation/pipe-to-options.html: Updated test case according whatwg original test.
* streams/reference-implementation/readable-stream-templated.html: Ditto.

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

4 years agoAdjust margins for first-line floating elements and add preset floating video sizing
jond@apple.com [Tue, 19 Jul 2016 17:23:59 +0000 (17:23 +0000)]
Adjust margins for first-line floating elements and add preset floating video sizing
https://bugs.webkit.org/show_bug.cgi?id=159898

Reviewed by Benjamin Poulain.

* wp-content/themes/webkit/style.css:
(article video.alignright):
(article .alignright:first-child):
(@media only screen and (max-width: 690px)):
    (article .alignright:first-child):
(@media only screen and (max-width: 415px)):
    (article video.alignright):
    (article .alignright:first-child):

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

4 years agoBubbles appear split for a brief moment in Messages
simon.fraser@apple.com [Tue, 19 Jul 2016 16:10:40 +0000 (16:10 +0000)]
Bubbles appear split for a brief moment in Messages
https://bugs.webkit.org/show_bug.cgi?id=159915
rdar://problem/27182267

Reviewed by David Hyatt.

Source/WebCore:

RenderView::repaintRootContents() had a long-standing bug in WebView when the
view is scrolled. repaint() uses visualOverflowRect() but, for the
RenderView, the visualOverflowRect() is the initial containing block
which is anchored at 0,0. When the view is scrolled it's clipped out and
calls to repaintRootContents() have no effect.

Change repaintRootContents() to use layoutOverflowRect(). ScrollView::repaintContentRectangle()
will clip it to the view if necessary.

Test: fast/repaint/scrolled-view-full-repaint.html

* rendering/RenderView.cpp:
(WebCore::RenderView::repaintRootContents):

LayoutTests:

* fast/repaint/scrolled-view-full-repaint-expected.txt: Added.
* fast/repaint/scrolled-view-full-repaint.html: Added.
* platform/ios-simulator-wk1/fast/repaint/scrolled-view-full-repaint-expected.txt: Added.
* platform/mac-wk1/fast/repaint/scrolled-view-full-repaint-expected.txt: Added.

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

4 years agoRefresh WPT tests up to 98ec1ad
commit-queue@webkit.org [Tue, 19 Jul 2016 16:08:56 +0000 (16:08 +0000)]
Refresh WPT tests up to 98ec1ad
https://bugs.webkit.org/show_bug.cgi?id=159879

Patch by Youenn Fablet <youennf@gmail.com> on 2016-07-19
Reviewed by Alex Christensen.

This refresh concerns fetch API tests with a number of test fixes.
Rebasing both window and worker expectations.

* resources/TestRepositories:
* web-platform-tests/fetch/api/basic/mode-same-origin-expected.txt:
* web-platform-tests/fetch/api/basic/mode-same-origin-worker-expected.txt:
* web-platform-tests/fetch/api/basic/mode-same-origin-worker.html:
* web-platform-tests/fetch/api/basic/mode-same-origin.html:
* web-platform-tests/fetch/api/basic/mode-same-origin.js:
* web-platform-tests/fetch/api/cors/cors-basic-worker.html:
* web-platform-tests/fetch/api/cors/cors-basic.html:
* web-platform-tests/fetch/api/cors/cors-basic.js:
(cors):
* web-platform-tests/fetch/api/cors/cors-cookies-expected.txt:
* web-platform-tests/fetch/api/cors/cors-cookies-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-cookies-worker.html:
* web-platform-tests/fetch/api/cors/cors-cookies.html:
* web-platform-tests/fetch/api/cors/cors-cookies.js:
(corsCookies):
* web-platform-tests/fetch/api/cors/cors-no-preflight-worker.html:
* web-platform-tests/fetch/api/cors/cors-no-preflight.html:
* web-platform-tests/fetch/api/cors/cors-no-preflight.js:
(corsNoPreflight):
* web-platform-tests/fetch/api/cors/cors-origin-worker.html:
* web-platform-tests/fetch/api/cors/cors-origin.html:
* web-platform-tests/fetch/api/cors/cors-origin.js:
(corsOrigin):
* web-platform-tests/fetch/api/cors/cors-preflight-redirect-worker.html:
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.html:
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.js:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer-worker.html:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.html:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.js:
(corsPreflightReferrer):
* web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html:
* web-platform-tests/fetch/api/cors/cors-preflight-status.html:
* web-platform-tests/fetch/api/cors/cors-preflight-status.js:
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.html:
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.js:
* web-platform-tests/fetch/api/cors/cors-redirect-worker.html:
* web-platform-tests/fetch/api/cors/cors-redirect.html:
* web-platform-tests/fetch/api/cors/cors-redirect.js:
* web-platform-tests/fetch/api/request/request-cache.html:
* web-platform-tests/fetch/api/request/resources/w3c-import.log:
* web-platform-tests/fetch/api/resources/get-host-info.sub.js: Added.
(get_host_info):
* web-platform-tests/fetch/api/resources/utils.js:
(validateBufferFromString):
* web-platform-tests/fetch/api/resources/w3c-import.log:
* web-platform-tests/fetch/api/response/response-clone-expected.txt:
* web-platform-tests/fetch/api/response/response-clone.html:
* web-platform-tests/fetch/api/response/response-consume-stream-expected.txt:

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

4 years ago[win] Fixup the register name for STIX Math and Latin Modern Math
fred.wang@free.fr [Tue, 19 Jul 2016 14:33:16 +0000 (14:33 +0000)]
[win] Fixup the register name for STIX Math and Latin Modern Math

Unreviewed follow-up of r203406

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

* Scripts/webkitdirs.pm:
(checkInstalledTools):

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

4 years ago[win] Update the list of MathML fonts
fred.wang@free.fr [Tue, 19 Jul 2016 14:18:19 +0000 (14:18 +0000)]
[win] Update the list of MathML fonts
https://bugs.webkit.org/show_bug.cgi?id=156838

The set of recommended math fonts is now described at
https://trac.webkit.org/wiki/MathML/Fonts
We update the Perl script to use the latest list of fonts.

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

* Scripts/webkitdirs.pm:
(checkInstalledTools):

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

4 years ago[Release WK2] LayoutTest imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect...
commit-queue@webkit.org [Tue, 19 Jul 2016 14:12:58 +0000 (14:12 +0000)]
[Release WK2] LayoutTest imported/w3c/web-platform-tests/XMLHttpRequest/send-redirect-post-upload.htm failing
https://bugs.webkit.org/show_bug.cgi?id=159724

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-19

* TestExpectations: Marking test as failure,passs,crash.
* platform/ios-simulator-wk2/TestExpectations: Removing specific expectation.
* platform/mac-wk2/TestExpectations: Ditto.

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

4 years ago<rdar://problem/27420308> WebCore-7602.1.42 fails to build: error: unused parameter...
mitz@apple.com [Tue, 19 Jul 2016 14:12:22 +0000 (14:12 +0000)]
<rdar://problem/27420308> WebCore-7602.1.42 fails to build: error: unused parameter 'vm'

* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals): Fixed the !ENABLE(STREAMS_API) build.

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

4 years ago[Win] The test fast/scrolling/overflow-scroll-past-max.html is timing out.
pvollan@apple.com [Tue, 19 Jul 2016 10:56:09 +0000 (10:56 +0000)]
[Win] The test fast/scrolling/overflow-scroll-past-max.html is timing out.
https://bugs.webkit.org/show_bug.cgi?id=159342

Reviewed by Darin Adler.

Source/WebKit/win:

* WebFrame.h: Link fix.

Tools:

Implement required functions in event sender.

* DumpRenderTree/PlatformWin.cmake:
* DumpRenderTree/win/EventSender.cpp:
(monitorWheelEvents): Added.
(callAfterScrollingCompletes): Added.

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

4 years ago[Streams API] Make ReadableStream properties not enumerable
commit-queue@webkit.org [Tue, 19 Jul 2016 07:59:05 +0000 (07:59 +0000)]
[Streams API] Make ReadableStream properties not enumerable
https://bugs.webkit.org/show_bug.cgi?id=159868

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-19
Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/streams/readable-streams/general.https-expected.txt:
* web-platform-tests/streams/readable-streams/readable-stream-reader.https-expected.txt:

Source/WebCore:

Covered by rebased tests.

Uopdating IDL definitions to mark all functions/attributes as not enumerable.
Updating IDL constructor definitions to correctly compute constructor length.
Updating built-in implementation to correctly compute pipeTo length to 1 (second parameter being optional).

* Modules/streams/ReadableStream.idl:
* Modules/streams/ReadableStream.js:
* Modules/streams/ReadableStreamController.idl:
* Modules/streams/ReadableStreamReader.idl:

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

4 years agoform.enctype / encoding / method should treat null as "null" string
cdumez@apple.com [Tue, 19 Jul 2016 07:41:21 +0000 (07:41 +0000)]
form.enctype / encoding / method should treat null as "null" string
https://bugs.webkit.org/show_bug.cgi?id=159916

Reviewed by Ryosuke Niwa.

Source/WebCore:

form.enctype / encoding / method should treat null as "null" string:
- https://html.spec.whatwg.org/multipage/forms.html#htmlformelement

Previously, WebKit would treat null as the null String, which would
end up removing the existing attribute.

Firefox and Chrome match the specification.

Test: fast/dom/HTMLFormElement/null-handling.html

* html/HTMLFormElement.h:
* html/HTMLFormElement.idl:

LayoutTests:

Add layout test coverage.

* fast/dom/HTMLFormElement/null-handling-expected.txt: Added.
* fast/dom/HTMLFormElement/null-handling.html: Added.

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

4 years agoAdd new aliases to http test server
commit-queue@webkit.org [Tue, 19 Jul 2016 07:38:55 +0000 (07:38 +0000)]
Add new aliases to http test server
https://bugs.webkit.org/show_bug.cgi?id=159878

Patch by Youenn Fablet <youenn@apple.com> on 2016-07-19
Reviewed by Darin Adler.

Tools:

Adding testharness.css, testharness.js and testharnessreport.js new aliases to http test servers.
Adding explicitly these links to perl script.
Extracting default alias in an aliases.json file.
Reading that file from python scripts to initialize aliases from that file.

Python script changes covered by unit tests and changed layout test.

* Scripts/webkitperl/httpd.pm:
(getDefaultConfigForTestDirectory): Adding 3 new aliases
* Scripts/webkitpy/layout_tests/servers/aliases.json: Added.
* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd.__init__): Setting upper class tests_dir member if needed and according constructor parameter.
Adding -c directives for each alias.
* Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py:
(TestLayoutTestApacheHttpd.test_start_cmd): Adding aliases.json mock-up file.
* Scripts/webkitpy/layout_tests/servers/http_server.py:
(Lighttpd.__init__): Setting upper class tests_dir member if needed and according constructor parameter.
Adding alias directive for each alias.
(Lighttpd._prepare_config):
* Scripts/webkitpy/layout_tests/servers/http_server_base.py:
(HttpServerBase.__init__): Adding tests_dir member with a default value being layout tests directory.
(HttpServerBase.aliases): Computing of alias from the json file, paths to the real files being relative to
layout tests directory.
* Scripts/webkitpy/layout_tests/servers/http_server_unittest.py:
(TestHttpServer.test_start_cmd): Adding aliases.json mock-up file and updating test expectation.
(TestHttpServer.test_win32_start_and_stop): Adding aliases.json mock-up file.

LayoutTests:

* http/tests/xmlhttprequest/set-bad-headervalue.html: Updating testharness.js and testharnessreport.js links to
ensure these new links are working on test servers.

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

4 years agoAll-in-one buildfix after r202439
ossy@webkit.org [Tue, 19 Jul 2016 06:50:49 +0000 (06:50 +0000)]
All-in-one buildfix after r202439
https://bugs.webkit.org/show_bug.cgi?id=159877

Reviewed by Chris Dumez.

* Modules/webaudio/AudioDestinationNode.h:
(WebCore::AudioDestinationNode::resume):
(WebCore::AudioDestinationNode::suspend):
(WebCore::AudioDestinationNode::close):

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

4 years agoFix the --minimal build fail in InjectedBundle.cpp
ossy@webkit.org [Tue, 19 Jul 2016 06:50:02 +0000 (06:50 +0000)]
Fix the --minimal build fail in InjectedBundle.cpp
https://bugs.webkit.org/show_bug.cgi?id=159770

Reviewed by Benjamin Poulain.

* WebProcess/InjectedBundle/InjectedBundle.cpp:

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

4 years agoMove parsing of subscriptshift and superscriptshift from rendering to element classes
fred.wang@free.fr [Tue, 19 Jul 2016 05:42:46 +0000 (05:42 +0000)]
Move parsing of subscriptshift and superscriptshift from rendering to element classes
https://bugs.webkit.org/show_bug.cgi?id=159622

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-18
Reviewed by Darin Adler.

We introduce a new MathMLScriptsElement that is used for elements msub, msup, msubsup and
mmultiscripts in order to create RenderMathMLScripts and parse and expose the values of the
subscriptshift and superscriptshift attributes. This is one more step toward moving MathML
attribute parsing to the DOM (bug 156536).

No new tests, rendering is unchanged.

* CMakeLists.txt: Add MathMLScriptsElement files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* mathml/MathMLAllInOne.cpp: Ditto.
* mathml/MathMLInlineContainerElement.cpp: Remove handling of scripts.
(WebCore::MathMLInlineContainerElement::createElementRenderer): Deleted.
* mathml/MathMLScriptsElement.cpp: Added. New class to handle scripted elements supporting
parsing for the subscriptshift and superscriptshift MathML lengths.
(WebCore::MathMLScriptsElement::MathMLScriptsElement):
(WebCore::MathMLScriptsElement::create):
(WebCore::MathMLScriptsElement::subscriptShift): Expose the cached length for the shift,
parsing the attribute again if necessary.
(WebCore::MathMLScriptsElement::superscriptShift): Ditto.
(WebCore::MathMLScriptsElement::parseAttribute): Mark attributes dirty.
(WebCore::MathMLScriptsElement::createElementRenderer): Create RenderMathMLScripts.
* mathml/MathMLScriptsElement.h: Ditto.
* mathml/mathtags.in: Map msub, msup, msubsup and mmultiscripts to MathMLScriptsElement.
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::scriptsElement): Helper function to cast the node to a
MathMLScriptsElement.
(WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Resolve the attributes
using the functions from the MathMLScriptsElement class.
* rendering/mathml/RenderMathMLScripts.h: Declare scriptsElement.

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

4 years agoDo not store gap and shift parameters on RenderMathMLFraction
fred.wang@free.fr [Tue, 19 Jul 2016 05:36:16 +0000 (05:36 +0000)]
Do not store gap and shift parameters on RenderMathMLFraction
https://bugs.webkit.org/show_bug.cgi?id=159876

Patch by Frederic Wang <fwang@igalia.com> on 2016-07-18
Reviewed by Darin Adler.

After r203285, the stack and fraction layout parameters are only used in layoutBlock so we
do not need to store them on the class. We remove them and split updateLayoutParameters into
three functions: one to update the linethickness and two others to retrieve the fraction and
stack respectively.

No new tests, rendering is unchanged.

* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::updateLineThickness): Move code to update thickness members here.
(WebCore::RenderMathMLFraction::getFractionParameters): Move code to retrieve fraction parameters here.
(WebCore::RenderMathMLFraction::getStackParameters): Move code to retrieve stack parameters here.
(WebCore::RenderMathMLFraction::layoutBlock): Use the new helper functions and local variables
for fraction and stack parameters.
(WebCore::RenderMathMLFraction::updateLayoutParameters): Deleted.
* rendering/mathml/RenderMathMLFraction.h: Declare new helper functions and remove members
for stack and fraction parameters.

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

4 years agoinput.formEnctype / formMethod and button.formEnctype / formMethod / type should...
cdumez@apple.com [Tue, 19 Jul 2016 04:45:53 +0000 (04:45 +0000)]
input.formEnctype / formMethod and button.formEnctype / formMethod / type should treat null as "null"
https://bugs.webkit.org/show_bug.cgi?id=159908

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

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

Source/WebCore:

input.formEnctype / formMethod and button.formEnctype / formMethod / type
should treat null as "null" String:
- https://html.spec.whatwg.org/multipage/forms.html#htmlinputelement
- https://html.spec.whatwg.org/multipage/forms.html#htmlbuttonelement

In WebKit, we would treat null as a null String which would end up
removing the corresponding attribute. This does not match the
specification. Firefox and Chrome match the specification here.

Tests:
- fast/dom/HTMLButtonElement/null-handling.html
- fast/dom/HTMLInputElement/null-handling.html

* html/HTMLButtonElement.idl:
* html/HTMLInputElement.idl:

LayoutTests:

Add layout test coverage.

* fast/dom/HTMLButtonElement/change-type-expected.txt:
* fast/dom/HTMLButtonElement/change-type.html:
* fast/dom/HTMLButtonElement/null-handling-expected.txt: Added.
* fast/dom/HTMLButtonElement/null-handling.html: Added.
* fast/dom/HTMLInputElement/null-handling-expected.txt: Added.
* fast/dom/HTMLInputElement/null-handling.html: Added.
* fast/forms/submit-form-attributes-expected.txt:
* fast/forms/submit-form-attributes.html:

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

4 years agoMake builtin TypeErrors consistent
commit-queue@webkit.org [Tue, 19 Jul 2016 02:45:35 +0000 (02:45 +0000)]
Make builtin TypeErrors consistent
https://bugs.webkit.org/show_bug.cgi?id=159899

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-07-18
Reviewed by Keith Miller.

Source/JavaScriptCore:

Converge on the single TypeError for non-coercible this objects in builtins.
Also update some other style to be more consistent with-in builtins.

* builtins/ArrayIteratorPrototype.js:
(next):
* builtins/ArrayPrototype.js:
(values):
(keys):
(entries):
(reduce):
(reduceRight):
(every):
(forEach):
(filter):
(map):
(some):
(fill):
(find):
(findIndex):
(includes):
(sort):
(concatSlowPath):
(copyWithin):
* builtins/StringPrototype.js:
(match):
(repeat):
(padStart):
(padEnd):
(intrinsic.StringPrototypeReplaceIntrinsic.replace):
(localeCompare):
(search):
(split):
* tests/es6/String.prototype_methods_String.prototype.padEnd.js:
* tests/es6/String.prototype_methods_String.prototype.padStart.js:
* tests/stress/array-iterators-next-error-messages.js:
(catch):
* tests/stress/array-iterators-next-with-call.js:
* tests/stress/regexp-match.js:
(shouldThrow):
* tests/stress/regexp-search.js:
(shouldThrow):

LayoutTests:

* js/array-find-expected.txt:
* js/array-findIndex-expected.txt:
* js/array-includes-expected.txt:
* js/dom/array-prototype-properties-expected.txt:
* js/dom/script-tests/string-prototype-properties.js:
* js/dom/string-prototype-properties-expected.txt:
* js/script-tests/array-find.js:
* js/script-tests/array-findIndex.js:
* js/script-tests/string-localeCompare.js:
* js/string-localeCompare-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.10_String.prototype.match/S15.5.4.10_A1_T3-expected.txt:
* 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:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A1_T3-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T3-expected.txt:

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