WebKit-https.git
5 years agoResurrect CMake build on Windows.
achristensen@apple.com [Mon, 20 Jul 2015 15:55:03 +0000 (15:55 +0000)]
Resurrect CMake build on Windows.
https://bugs.webkit.org/show_bug.cgi?id=147083

Reviewed by Gyuyoung Kim.

.:

* Source/cmake/OptionsCommon.cmake:
* Source/cmake/OptionsWindows.cmake:
Change features to get it to compile.  Still not a complete feature set.

Source/WebCore:

* CMakeLists.txt:
* PlatformWin.cmake:
* dom/Document.cpp:
(WebCore::Document::~Document):
* dom/Range.cpp:
* dom/Text.cpp:
* editing/CompositeEditCommand.cpp:
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::createTexture):
* platform/win/WindowsTouch.h:
* rendering/RenderThemeWin.h:
Fixed some including and compiling quirks needed for different configurations.

Source/WebKit:

* PlatformWin.cmake: Added.
Based on original work by Patrick Gansterer and Mark Salisbury
in https://bugs.webkit.org/show_bug.cgi?id=72816

Source/WTF:

* wtf/PlatformWin.cmake:

Tools:

* DumpRenderTree/CMakeLists.txt:
* DumpRenderTree/PlatformWin.cmake: Added.
* WinLauncher/CMakeLists.txt:

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

5 years agoUnreviewed debug build fix after r187020.
peavo@outlook.com [Mon, 20 Jul 2015 12:04:20 +0000 (12:04 +0000)]
Unreviewed debug build fix after r187020.

* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::addCurrentThread):
VM::exclusiveThread() has changed return type to ThreadIdentifier.

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

5 years agoJavaScriptCore performance is very bad on Windows
peavo@outlook.com [Mon, 20 Jul 2015 09:14:10 +0000 (09:14 +0000)]
JavaScriptCore performance is very bad on Windows
https://bugs.webkit.org/show_bug.cgi?id=146448

Reviewed by Mark Lam.

Source/JavaScriptCore:

Profiling shows that std::this_thread::get_id() is slow on Windows.
Use WTF::currentThread() instead, which calls GetCurrentThreadId().
This is faster on Windows. The issue has been reported to Microsoft,
https://connect.microsoft.com/VisualStudio/feedback/details/1558211.

* runtime/JSLock.cpp:
(JSC::JSLockHolder::~JSLockHolder):
(JSC::JSLock::JSLock):
(JSC::JSLock::willDestroyVM):
(JSC::JSLock::setExclusiveThread):
(JSC::JSLock::lock):
(JSC::JSLock::unlock):
(JSC::JSLock::currentThreadIsHoldingLock):
* runtime/JSLock.h:
(JSC::JSLock::vm):
(JSC::JSLock::hasExclusiveThread):
(JSC::JSLock::exclusiveThread):
* runtime/VM.h:
(JSC::VM::hasExclusiveThread):
(JSC::VM::exclusiveThread):
(JSC::VM::setExclusiveThread):

Source/WebCore:

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM): Compile fix.

Source/WTF:

Updating the stack bounds is time consuming.
Only update the stack bounds when a new fiber is running.

* wtf/WTFThreadData.cpp:
(WTF::WTFThreadData::WTFThreadData):
* wtf/WTFThreadData.h:
(WTF::WTFThreadData::stack):

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

5 years agoUse isnan from std namespace in Stopwatch.h.
julien.brianceau@gmail.com [Mon, 20 Jul 2015 07:19:11 +0000 (07:19 +0000)]
Use isnan from std namespace in Stopwatch.h.
https://bugs.webkit.org/show_bug.cgi?id=146911

Reviewed by Žan Doberšek.

* wtf/Stopwatch.h:
(WTF::Stopwatch::isActive):
(WTF::Stopwatch::start):
(WTF::Stopwatch::stop):
(WTF::Stopwatch::elapsedTime):

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

5 years agoMake shrink-wrapping test a ref-test instead of pixel-test
timothy_horton@apple.com [Mon, 20 Jul 2015 06:38:40 +0000 (06:38 +0000)]
Make shrink-wrapping test a ref-test instead of pixel-test
https://bugs.webkit.org/show_bug.cgi?id=147081

Reviewed by Sam Weinig.

Source/WebCore:

Nobody runs pixel tests.

* svg/SVGPathUtilities.cpp:
(WebCore::pathIteratorForBuildingString):
(WebCore::buildStringFromPath):
* svg/SVGPathUtilities.h:
Add a helper that turns a Path into a SVG path string.

* testing/Internals.cpp:
(WebCore::Internals::pathStringWithShrinkWrappedRects):
* testing/Internals.h:
* testing/Internals.idl:
Have the internals shrink-wrap method return an SVG path instead of a DOMPath.

LayoutTests:

* fast/shrink-wrap/rect-shrink-wrap-expected.html: Added.
* fast/shrink-wrap/rect-shrink-wrap-expected.png: Removed.
* fast/shrink-wrap/rect-shrink-wrap-expected.txt: Removed.
* fast/shrink-wrap/rect-shrink-wrap.html:
SVG all the things.

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

5 years agoIn strict mode, `Object.keys(arguments)` includes "length"
utatane.tea@gmail.com [Sun, 19 Jul 2015 23:37:45 +0000 (23:37 +0000)]
In strict mode, `Object.keys(arguments)` includes "length"
https://bugs.webkit.org/show_bug.cgi?id=147071

Reviewed by Darin Adler.

ClonedAguments didn't set the "length" with DontEnum.

* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::createWithInlineFrame):
(JSC::ClonedArguments::createByCopyingFrom):
* tests/stress/arguments-length-always-dont-enum.js: Added.
(shouldBe):
(argsSloppy):
(argsStrict):

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

5 years agonew Date(NaN).toJSON() must return null instead of throwing a TypeError
commit-queue@webkit.org [Sun, 19 Jul 2015 23:10:07 +0000 (23:10 +0000)]
new Date(NaN).toJSON() must return null instead of throwing a TypeError
https://bugs.webkit.org/show_bug.cgi?id=141115

Patch by Jordan Harband <ljharb@gmail.com> on 2015-07-19
Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToJSON):

LayoutTests:

* js/dom/JSON-stringify-expected.txt:
* js/resources/JSON-stringify.js:

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

5 years ago[GTK] Enable seccomp filter API tests
mcatanzaro@igalia.com [Sun, 19 Jul 2015 22:27:00 +0000 (22:27 +0000)]
[GTK] Enable seccomp filter API tests
https://bugs.webkit.org/show_bug.cgi?id=140071

Reviewed by Žan Doberšek.

These tests will now be run by the run-gtk-tests script.

* TestWebKitAPI/PlatformGTK.cmake:

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

5 years agoParser::parseFunctionInfo hits RELEASE_ASSERT for Arrow Functions
saambarati1@gmail.com [Sun, 19 Jul 2015 19:31:36 +0000 (19:31 +0000)]
Parser::parseFunctionInfo hits RELEASE_ASSERT for Arrow Functions
https://bugs.webkit.org/show_bug.cgi?id=147090

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

ArrowFunction's have there ParserFunctionInfo "name" field to
be a non-null pointer. This is obviously allowed and valid except we
had a RELEASE_ASSERT that claimed otherwise. This is a mistake.

Note: ArrowFunction's will never actually have a function name;
there ParserFunctionInfo "name" field will be the empty string.
This is not be mistaken with the name field being a null pointer.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionInfo):

LayoutTests:

* js/arrowfunction-strict-mode-expected.txt: Added.
* js/arrowfunction-strict-mode.html: Added.
* js/script-tests/arrowfunction-strict-mode.js: Added.
(foo):

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

5 years agoUnreviewed, placate -Wmismatched-tags after r187011
mcatanzaro@igalia.com [Sun, 19 Jul 2015 19:14:44 +0000 (19:14 +0000)]
Unreviewed, placate -Wmismatched-tags after r187011

It's basically bug #146990 again. Oops.

* WebProcess/gtk/SeccompFiltersWebProcessGtk.h:

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

5 years ago[ES6] Add support for block scope const
saambarati1@gmail.com [Sun, 19 Jul 2015 16:57:44 +0000 (16:57 +0000)]
[ES6] Add support for block scope const
https://bugs.webkit.org/show_bug.cgi?id=31813

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

'const' is now implemented in an ES6 spec compliant manner.
'const' variables are always block scoped and always live
either on the stack or in a JSLexicalEnvironment. 'const'
variables never live on the global object.

Inside the BytecodeGenerator, when assigning to a stack
'const' variable or a LocalClosureVar 'const' variable,
we will emit code that just throws a type error.
When assigning to a ClosureVar const variable, CodeBlock linking
will ensure that we perform a dynamic lookup of that variable so
that put_to_scope's slow path throws a type error.

The old 'const' implementation has been removed in this patch.

* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::pushLexicalScope):
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
(JSC::BytecodeGenerator::variable):
(JSC::BytecodeGenerator::variableForLocalEntry):
(JSC::BytecodeGenerator::createVariable):
(JSC::BytecodeGenerator::emitResolveScope):
(JSC::BytecodeGenerator::emitInstanceOf):
(JSC::BytecodeGenerator::emitGetById):
(JSC::BytecodeGenerator::isArgumentNumber):
(JSC::BytecodeGenerator::emitReadOnlyExceptionIfNeeded):
(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::variablePerSymbolTable): Deleted.
(JSC::BytecodeGenerator::emitInitGlobalConst): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::Variable::Variable):
(JSC::Variable::isReadOnly):
(JSC::Variable::isSpecial):
(JSC::Variable::isConst):
(JSC::BytecodeGenerator::thisRegister):
(JSC::BytecodeGenerator::emitTypeOf):
(JSC::BytecodeGenerator::emitIn):
* bytecompiler/NodesCodegen.cpp:
(JSC::PostfixNode::emitResolve):
(JSC::PrefixNode::emitResolve):
(JSC::ReadModifyResolveNode::emitBytecode):
(JSC::AssignResolveNode::emitBytecode):
(JSC::CommaNode::emitBytecode):
(JSC::BindingNode::bindValue):
(JSC::ConstDeclNode::emitCodeSingle): Deleted.
(JSC::ConstDeclNode::emitBytecode): Deleted.
(JSC::ConstStatementNode::emitBytecode): Deleted.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_to_arguments):
(JSC::JIT::emit_op_init_global_const): Deleted.
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_to_arguments):
(JSC::JIT::emit_op_init_global_const): Deleted.
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createDeclarationStatement):
(JSC::ASTBuilder::createEmptyVarExpression):
(JSC::ASTBuilder::createDebugger):
(JSC::ASTBuilder::appendStatement):
(JSC::ASTBuilder::createVarStatement): Deleted.
(JSC::ASTBuilder::createLetStatement): Deleted.
(JSC::ASTBuilder::createConstStatement): Deleted.
(JSC::ASTBuilder::appendConstDecl): Deleted.
* parser/NodeConstructors.h:
(JSC::CommaNode::CommaNode):
(JSC::SourceElements::SourceElements):
(JSC::SwitchNode::SwitchNode):
(JSC::BlockNode::BlockNode):
(JSC::ConstStatementNode::ConstStatementNode): Deleted.
(JSC::ConstDeclNode::ConstDeclNode): Deleted.
* parser/Nodes.h:
(JSC::ConstDeclNode::hasInitializer): Deleted.
(JSC::ConstDeclNode::ident): Deleted.
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseStatementListItem):
(JSC::Parser<LexerType>::parseVariableDeclaration):
(JSC::Parser<LexerType>::parseWhileStatement):
(JSC::Parser<LexerType>::parseVariableDeclarationList):
(JSC::Parser<LexerType>::createBindingPattern):
(JSC::Parser<LexerType>::parseDestructuringPattern):
(JSC::Parser<LexerType>::parseDefaultValueForDestructuringPattern):
(JSC::Parser<LexerType>::parseForStatement):
(JSC::Parser<LexerType>::parseTryStatement):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseConstDeclaration): Deleted.
(JSC::Parser<LexerType>::parseConstDeclarationList): Deleted.
* parser/Parser.h:
(JSC::isEvalNode):
(JSC::isEvalNode<EvalNode>):
(JSC::isArguments):
(JSC::isEval):
(JSC::isEvalOrArgumentsIdentifier):
(JSC::Scope::Scope):
(JSC::Scope::declareCallee):
(JSC::Scope::declareVariable):
(JSC::Scope::declareLexicalVariable):
(JSC::Scope::hasDeclaredVariable):
(JSC::Scope::allowsVarDeclarations):
(JSC::Scope::allowsLexicalDeclarations):
(JSC::Scope::declareParameter):
(JSC::Scope::declareBoundParameter):
(JSC::Parser::destructuringKindFromDeclarationType):
(JSC::Parser::assignmentContextFromDeclarationType):
(JSC::Parser::isEvalOrArguments):
(JSC::Parser::currentScope):
(JSC::Parser::popScope):
(JSC::Parser::declareVariable):
(JSC::Parser::hasDeclaredVariable):
(JSC::Parser::setStrictMode):
(JSC::Parser::strictMode):
(JSC::Parser::isValidStrictMode):
(JSC::Parser::declareParameter):
(JSC::Parser::declareBoundParameter):
(JSC::Parser::breakIsValid):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createForInLoop):
(JSC::SyntaxChecker::createForOfLoop):
(JSC::SyntaxChecker::createEmptyStatement):
(JSC::SyntaxChecker::createDeclarationStatement):
(JSC::SyntaxChecker::createReturnStatement):
(JSC::SyntaxChecker::createBreakStatement):
(JSC::SyntaxChecker::createVarStatement): Deleted.
(JSC::SyntaxChecker::createLetStatement): Deleted.
* parser/VariableEnvironment.h:
(JSC::VariableEnvironmentEntry::isCaptured):
(JSC::VariableEnvironmentEntry::isConst):
(JSC::VariableEnvironmentEntry::isVar):
(JSC::VariableEnvironmentEntry::isLet):
(JSC::VariableEnvironmentEntry::setIsCaptured):
(JSC::VariableEnvironmentEntry::setIsConst):
(JSC::VariableEnvironmentEntry::setIsVar):
(JSC::VariableEnvironmentEntry::setIsLet):
(JSC::VariableEnvironmentEntry::isConstant): Deleted.
(JSC::VariableEnvironmentEntry::setIsConstant): Deleted.
* runtime/Executable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::defineOwnProperty):
(JSC::JSGlobalObject::addGlobalVar):
(JSC::JSGlobalObject::addFunction):
(JSC::lastInPrototypeChain):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::finishCreation):
(JSC::JSGlobalObject::addVar):
(JSC::JSGlobalObject::addConst): Deleted.
* runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::symbolTablePut):
* tests/stress/const-and-with-statement.js: Added.
(truth):
(assert):
(shouldThrowInvalidConstAssignment):
(.):
* tests/stress/const-exception-handling.js: Added.
(truth):
(assert):
(.):
* tests/stress/const-loop-semantics.js: Added.
(truth):
(assert):
(shouldThrowInvalidConstAssignment):
(.):
* tests/stress/const-not-strict-mode.js: Added.
(truth):
(assert):
(shouldThrowTDZ):
(.):
* tests/stress/const-semantics.js: Added.
(truth):
(assert):
(shouldThrowInvalidConstAssignment):
(.):
* tests/stress/const-tdz.js: Added.
(truth):
(assert):
(shouldThrowTDZ):
(.):

Source/WebInspectorUI:

"const" variables do not live on the global object and are only
accessible within the "Program" they're defined in. Therefore,
the WebInspector global must be defined as "var" and not "const".

* UserInterface/Base/WebInspector.js:

LayoutTests:

"const" variables do not live on the global object. They
are only available in the "Program" (read: JavaScript file or
script tag) that they're defined in. Tests have been updated
accordingly to switch the "const" variables assumed to be globals
into "var"s. "var" declared variables in the top level scope
of a program do live on the global object.

* fast/canvas/webgl/compressed-tex-image.html:
* fast/dom/event-handler-attributes.html:
* fast/forms/listbox-visible-size.html:
* js/arguments-expected.txt:
* js/arrowfunction-syntax-errors-expected.txt:
* js/const-expected.txt:
* js/const-without-initializer-expected.txt:
* js/constant-count-expected.txt:
* js/dom/inc-const-valueOf-expected.txt:
* js/dom/script-tests/inc-const-valueOf.js:
(testPreIncConstVarWithAssign):
* js/function-toString-parentheses-expected.txt:
* js/kde/const-expected.txt:
* js/kde/resources/const.js:
* js/parser-syntax-check-expected.txt:
* js/script-tests/arguments.js:
(argumentsVarUndefined):
(argumentsConst):
(argumentCalleeInException):
(argumentsConstUndefined): Deleted.
* js/script-tests/class-syntax-declaration.js:
(A):
* js/script-tests/class-syntax-expression.js:
* js/script-tests/const-without-initializer.js:
* js/script-tests/const.js:
(shouldThrowInvalidConstAssignment):
(assert):
(f):
(tryCatch1):
(tryCatch2):
(with1):
(with2):
(.):
* js/script-tests/constant-count.js:
(f):
* js/script-tests/function-dot-arguments.js:
(assignConstInitTest2.g):
(assignConstInitTest2):
* js/script-tests/function-toString-parentheses.js:
* js/script-tests/parser-syntax-check.js:
* sputnik/Conformance/07_Lexical_Conventions/7.5_Tokens/7.5.3_Future_Reserved_Words/S7.5.3_A1.6-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A3.1_T7-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A3.1_T8-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.8_Literals/7.8.5_Regular_Expression_Literals/S7.8.5_A3.1_T9-expected.txt:
* sputnik/Conformance/08_Types/8.4_The_String_Type/S8.4_A13_T3-expected.txt:
* sputnik/Conformance/08_Types/8.4_The_String_Type/S8.4_A14_T3-expected.txt:
* sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T1-expected.txt:
* sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T2-expected.txt:
* sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T3-expected.txt:
* sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T4-expected.txt:
* sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T6-expected.txt:
* sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T7-expected.txt:
* sputnik/Conformance/12_Statement/12.2_Variable_Statement/S12.2_A8_T8-expected.txt:
* transforms/3d/hit-testing/composited-hit-test.html:
* transforms/3d/hit-testing/coplanar-with-camera.html:
* transforms/3d/hit-testing/hover-rotated-negative-z.html:
* transforms/3d/hit-testing/hover-rotated-with-children-negative-z.html:
* transforms/3d/hit-testing/negative-zoffset-hit-test.html:
* transforms/3d/hit-testing/overlapping-layers-hit-test.html:
* transforms/3d/hit-testing/perspective-clipped.html:
* transforms/3d/hit-testing/rotated-hit-test-with-child.html:
* transforms/3d/hit-testing/rotated-hit-test.html:
* transforms/3d/hit-testing/rotated-hit-test2.html:
* transitions/resources/transition-test-helpers.js:
(roundNumber):

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

5 years ago[GTK] Add seccomp filters support
mcatanzaro@igalia.com [Sun, 19 Jul 2015 16:32:58 +0000 (16:32 +0000)]
[GTK] Add seccomp filters support
https://bugs.webkit.org/show_bug.cgi?id=110014

Reviewed by Žan Doberšek.

.:

Find needed compiler and linker flags for libseccomp.

* Source/cmake/OptionsGTK.cmake:

Source/WebKit2:

Allow building with ENABLE_SECCOMP_FILTERS=ON. Based on work by Thiago Marcos P. Santos.

* PlatformGTK.cmake: Support ENABLE_SECCOMP_FILTERS build option.
* WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Added.
(WebKit::SeccompFiltersWebProcessGtk::SeccompFiltersWebProcessGtk):
(WebKit::SeccompFiltersWebProcessGtk::platformInitialize):
* WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Added.
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformInitializeWebProcess): Initialize default
GTK+ web process seccomp filters.

Tools:

Add libseccomp to jhbuild modulesets.

* gtk/jhbuild.modules:

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

5 years agoREGRESSION (r187002): Broke the Windows build: Reduce PassRefPtr in WebKit2 - 3
ddkilzer@apple.com [Sun, 19 Jul 2015 13:16:54 +0000 (13:16 +0000)]
REGRESSION (r187002): Broke the Windows build: Reduce PassRefPtr in WebKit2 - 3
<https://bugs.webkit.org/show_bug.cgi?id=146995>

Attempt to fix the Windows build.

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::createDocumentLoader):
(WebFrameLoaderClient::createFrame):
(WebFrameLoaderClient::createPlugin):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebDocumentLoader.cpp:
(WebDocumentLoader::create):
* WebDocumentLoader.h:

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

5 years agoREGRESSION (r187008): CGPathCreateMutableCopyByTransformingPath() is not available...
ddkilzer@apple.com [Sun, 19 Jul 2015 12:35:12 +0000 (12:35 +0000)]
REGRESSION (r187008): CGPathCreateMutableCopyByTransformingPath() is not available on Windows
<https://bugs.webkit.org/show_bug.cgi?id=147077>

* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::transform): Restore less efficient code path
for Windows.

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

5 years agoSimplify Path(CG)::transform/translate
timothy_horton@apple.com [Sun, 19 Jul 2015 04:38:46 +0000 (04:38 +0000)]
Simplify Path(CG)::transform/translate
https://bugs.webkit.org/show_bug.cgi?id=147077

Reviewed by Simon Fraser.

No new tests; no behavior change.

* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::translate):
(WebCore::Path::transform):
Use CGPathCreateMutableCopyByTransformingPath to do the copy and transform
in a single call instead of two.

Make use of transform() to implement translate() instead of duplicating the code.
Move the two functions near each other.

(WebCore::Path::boundingRect):
Remove irrelevant reference to Snow Leopard.

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

5 years agoMiniBrowser window title is just "Window" when page has no <title>
simon.fraser@apple.com [Sun, 19 Jul 2015 03:37:47 +0000 (03:37 +0000)]
MiniBrowser window title is just "Window" when page has no <title>
https://bugs.webkit.org/show_bug.cgi?id=147076

Reviewed by Tim Horton.

Make MiniBrowser windows show the filename from the URL if we never get a title changed
notification.

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController updateTitle:]):
(-[WK1BrowserWindowController webView:didCommitLoadForFrame:]):
(-[WK1BrowserWindowController webView:didReceiveTitle:forFrame:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController updateTitle:]):
(-[WK2BrowserWindowController observeValueForKeyPath:ofObject:change:context:]):
(-[WK2BrowserWindowController webView:didCommitNavigation:]):

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

5 years agoMedia Session: Add support for 'Content' interruption types
mrajca@apple.com [Sun, 19 Jul 2015 02:14:14 +0000 (02:14 +0000)]
Media Session: Add support for 'Content' interruption types
https://bugs.webkit.org/show_bug.cgi?id=147042

Reviewed by Eric Carlson.

Tests: Added media/session/content-interruptions

* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::handleIndefinitePauseInterruption): Indefinitely pause the session by pausing media
 elements and removing them from the set of active participating elements.
* Modules/mediasession/MediaSession.h:
* Modules/mediasession/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification): Implemented support for 'Content'
 interruption types as described in 4.5.2.

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

5 years agoMedia Session: add support for telephony interruptions
mrajca@apple.com [Sun, 19 Jul 2015 01:36:50 +0000 (01:36 +0000)]
Media Session: add support for telephony interruptions
https://bugs.webkit.org/show_bug.cgi?id=147016

Reviewed by Eric Carlson.

* platform/audio/mac/MediaSessionInterruptionProviderMac.mm:
(WebCore::callDidBeginRinging): Forward this event to media sessions as a 'Transient' interruption.
(WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
(WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):

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

5 years agoMedia Session: add infrastructure for testing interruptions
mrajca@apple.com [Sun, 19 Jul 2015 01:30:44 +0000 (01:30 +0000)]
Media Session: add infrastructure for testing interruptions
https://bugs.webkit.org/show_bug.cgi?id=147060

Reviewed by Eric Carlson.

* Modules/mediasession/MediaSession.h: Export methods to be used with tests.
* Modules/mediasession/MediaSessionManager.h: Ditto.
* bindings/scripts/CodeGeneratorJS.pm: JSMediaSession needs to be marked with WEBCORE_EXPORT so it works with JSInternals.
* testing/Internals.cpp:
(WebCore::Internals::sendMediaSessionStartOfInterruptionNotification): Let tests send interruptions to MediaSessionManager.
(WebCore::Internals::sendMediaSessionEndOfInterruptionNotification): Ditto.
(WebCore::Internals::mediaSessionCurrentState): Expose the current state of media sessions to tests.
* testing/Internals.h:
* testing/Internals.idl: Add interfaces for sending interruptions from JS tests.

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

5 years agolexical scoping is broken with respect to "break" and "continue"
saambarati1@gmail.com [Sun, 19 Jul 2015 00:36:45 +0000 (00:36 +0000)]
lexical scoping is broken with respect to "break" and "continue"
https://bugs.webkit.org/show_bug.cgi?id=147063

Reviewed by Filip Pizlo.

Bug #142944 which introduced "let" and lexical scoping
didn't properly hook into the bytecode generator's machinery
for calculating scope depth deltas for "break" and "continue". This
resulted in the bytecode generator popping an incorrect number
of scopes when lexical scopes were involved.

This patch fixes this problem and generalizes this machinery a bit.
This patch also renames old functions in a sensible way that is more
coherent in a world with lexical scoping.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::newLabelScope):
(JSC::BytecodeGenerator::emitProfileType):
(JSC::BytecodeGenerator::pushLexicalScope):
(JSC::BytecodeGenerator::popLexicalScope):
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
(JSC::BytecodeGenerator::resolveType):
(JSC::BytecodeGenerator::emitResolveScope):
(JSC::BytecodeGenerator::emitGetFromScope):
(JSC::BytecodeGenerator::emitPutToScope):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitGetParentScope):
(JSC::BytecodeGenerator::emitPopScope):
(JSC::BytecodeGenerator::emitPopWithOrCatchScope):
(JSC::BytecodeGenerator::emitPopScopes):
(JSC::BytecodeGenerator::calculateTargetScopeDepthForExceptionHandler):
(JSC::BytecodeGenerator::localScopeDepth):
(JSC::BytecodeGenerator::labelScopeDepth):
(JSC::BytecodeGenerator::emitThrowReferenceError):
(JSC::BytecodeGenerator::emitPushFunctionNameScope):
(JSC::BytecodeGenerator::pushScopedControlFlowContext):
(JSC::BytecodeGenerator::popScopedControlFlowContext):
(JSC::BytecodeGenerator::emitPushCatchScope):
(JSC::BytecodeGenerator::currentScopeDepth): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::hasFinaliser):
(JSC::BytecodeGenerator::scopeDepth): Deleted.
* bytecompiler/NodesCodegen.cpp:
(JSC::ContinueNode::trivialTarget):
(JSC::BreakNode::trivialTarget):
(JSC::ReturnNode::emitBytecode):
(JSC::WithNode::emitBytecode):
(JSC::TryNode::emitBytecode):
* tests/stress/lexical-scoping-break-continue.js: Added.
(assert):
(.):

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

5 years agoReduce PassRefPtr in WebKit2 - 3
gyuyoung.kim@webkit.org [Sun, 19 Jul 2015 00:16:50 +0000 (00:16 +0000)]
Reduce PassRefPtr in WebKit2 - 3
https://bugs.webkit.org/show_bug.cgi?id=146995

Reviewed by Daniel Bates.

To remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
Because some uses depend on WebCore, WebCore, WK1 ports are modified as well.

Source/WebCore:

* loader/EmptyClients.cpp:
(WebCore::EmptyChromeClient::createPopupMenu):
(WebCore::EmptyChromeClient::createSearchPopupMenu):
(WebCore::EmptyFrameLoaderClient::createDocumentLoader):
(WebCore::EmptyFrameLoaderClient::createFrame):
(WebCore::EmptyFrameLoaderClient::createPlugin):
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::reloadWithOverrideEncoding):
(WebCore::FrameLoader::reload):
* loader/FrameLoaderClient.h:
* loader/ResourceLoadScheduler.cpp:
(WebCore::ResourceLoadScheduler::scheduleSubresourceLoad):
(WebCore::ResourceLoadScheduler::schedulePluginStreamLoad):
* loader/ResourceLoadScheduler.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::create):
* loader/SubresourceLoader.h:
* page/ChromeClient.h:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperLayer.h:
(WebCore::TextureMapperLayer::texture):
* platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp:
(WebCore::TextureMapperSurfaceBackingStore::texture):
* platform/graphics/texmap/TextureMapperSurfaceBackingStore.h:
* platform/graphics/texmap/TextureMapperTile.h:
(WebCore::TextureMapperTile::texture):
* platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
(WebCore::TextureMapperTiledBackingStore::texture):
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:
* storage/StorageNamespace.h:

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::createDocumentLoader):

Source/WebKit/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::createDocumentLoader):
* WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKit2:

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::getOrCreateUniqueIDBDatabase):
* DatabaseProcess/DatabaseProcess.h:
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::takeInitializationReply):
* PluginProcess/PluginControllerProxy.h:
* Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
(WebKit::CoordinatedBackingStore::texture):
* Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
(WebKit::CoordinatedBackingStore::create):
* Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
(WebKit::WebCoordinatedSurface::create):
(WebKit::WebCoordinatedSurface::createWithSurface):
* Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::webCryptoMasterKey):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::webCryptoMasterKey):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
(WKPageSetPageNavigationClient):
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createPopupMenuProxy):
(WebKit::PageClientImpl::createContextMenuProxy):
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/Authentication/WebCredential.h:
* UIProcess/Authentication/WebProtectionSpace.h:
* UIProcess/AutoCorrectionCallback.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::createPopupMenuProxy):
(WebKit::WebView::createContextMenuProxy):
(WebKit::WebView::createColorPicker):
* UIProcess/CoordinatedGraphics/WebView.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/efl/WebViewEfl.cpp:
(WebKit::WebViewEfl::createPopupMenuProxy):
(WebKit::WebViewEfl::createContextMenuProxy):
(WebKit::WebViewEfl::createColorPicker):
* UIProcess/efl/WebViewEfl.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createPopupMenuProxy):
(WebKit::PageClientImpl::createContextMenuProxy):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dataSelectionForPasteboard):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createPopupMenuProxy):
(WebKit::PageClientImpl::createContextMenuProxy):
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::dataSelectionForPasteboard):
* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleSubresourceLoad):
(WebKit::WebResourceLoadScheduler::schedulePluginStreamLoad):
* WebProcess/Network/WebResourceLoadScheduler.h:
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::fromNPP):
(WebKit::NetscapePlugin::snapshot):
(WebKit::NetscapePlugin::liveResourceData):
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Plugin.h:
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::snapshot):
(WebKit::PluginProxy::liveResourceData):
* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::storageArea):
(WebKit::StorageNamespaceImpl::copy):
* WebProcess/Storage/StorageNamespaceImpl.h:
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toHistoryItem):
* WebProcess/WebCoreSupport/SessionStateConversion.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createPopupMenu):
(WebKit::WebChromeClient::createSearchPopupMenu):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createDocumentLoader):
(WebKit::WebFrameLoaderClient::createFrame):
(WebKit::WebFrameLoaderClient::createPlugin):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::create):
(WebKit::WebPage::createDocumentLoader):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::lookupTextAtLocation):

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

5 years agoScroll position jumps when scrolling scaling pages down in split view
simon.fraser@apple.com [Sat, 18 Jul 2015 23:54:32 +0000 (23:54 +0000)]
Scroll position jumps when scrolling scaling pages down in split view
https://bugs.webkit.org/show_bug.cgi?id=147072
rdar://problem/21769577

Reviewed by Sam Weinig.

When apple.com/music is in Split View at a reduced scale, scrolling the page
can cause unwanted scroll jumps. This happened because we'd enter
TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() with a pending
layout, so run the autosizing logic. When scrolled near the bottom, the unconstrained
layout resulted in a shorter document, which truncated the scroll position. The
scaled layout then restored the longer document, but it also restored that
truncated scroll position.

Forcing a layout is sufficient to fix the bug for this page, and doing a single
layout (which will happen anyway) is preferable to running the autosize logic
if layout happens to be dirty.

I was not able to make a test to reproduce the problem. Entering
scaleViewToFitDocumentIfNeeded() with pending layout was triggerable
using a transform transition, but I was not able to reproduce incorrect
scroll position restoration.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):

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

5 years agoinspector/console/command-line-api.html is slow on Debug Yosemite WK2
ddkilzer@apple.com [Sat, 18 Jul 2015 23:41:20 +0000 (23:41 +0000)]
inspector/console/command-line-api.html is slow on Debug Yosemite WK2

<http://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=inspector%2Fconsole%2Fcommand-line-api.html>

* platform/mac-wk2/TestExpectations: Mark test as slow on Debug
Yosemite WK2:
- inspector/console/command-line-api.html

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

5 years agohttp/tests/cache/disk-cache/disk-cache-disable.html is flaky on Release Yosemite WK2
ddkilzer@apple.com [Sat, 18 Jul 2015 23:32:19 +0000 (23:32 +0000)]
http/tests/cache/disk-cache/disk-cache-disable.html is flaky on Release Yosemite WK2

<http://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2Fcache%2Fdisk-cache%2Fdisk-cache-disable.html>

* platform/mac-wk2/TestExpectations: Mark test as flaky on
Release Yosemite WK2:
- http/tests/cache/disk-cache/disk-cache-disable.html

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

5 years agomedia/restore-from-page-cache.html is flaky on Debug Mavericks
ddkilzer@apple.com [Sat, 18 Jul 2015 23:32:12 +0000 (23:32 +0000)]
media/restore-from-page-cache.html is flaky on Debug Mavericks

<https://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=media%2Frestore-from-page-cache.html>

When the test fails, the computed width and height is
300px × 150px instead of the expected 320px × 240px.

* platform/mac/TestExpectations: Mark test as flaky on Debug Mavericks:
- media/restore-from-page-cache.html

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

5 years agoUnreviewed, rolling out r186996.
commit-queue@webkit.org [Sat, 18 Jul 2015 21:21:48 +0000 (21:21 +0000)]
Unreviewed, rolling out r186996.
https://bugs.webkit.org/show_bug.cgi?id=147070

Broke JSC tests (Requested by smfr on #webkit).

Reverted changeset:

"lexical scoping is broken with respect to "break" and
"continue""
https://bugs.webkit.org/show_bug.cgi?id=147063
http://trac.webkit.org/changeset/186996

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

5 years agolexical scoping is broken with respect to "break" and "continue"
saambarati1@gmail.com [Sat, 18 Jul 2015 20:12:14 +0000 (20:12 +0000)]
lexical scoping is broken with respect to "break" and "continue"
https://bugs.webkit.org/show_bug.cgi?id=147063

Reviewed by Filip Pizlo.

Bug #142944 which introduced "let" and lexical scoping
didn't properly hook into the bytecode generator's machinery
for calculating scope depth deltas for "break" and "continue". This
resulted in the bytecode generator popping an incorrect number
of scopes when lexical scopes were involved.

This patch fixes this problem and generalizes this machinery a bit.
This patch also renames old functions in a sensible way that is more
coherent in a world with lexical scoping.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::newLabelScope):
(JSC::BytecodeGenerator::emitProfileType):
(JSC::BytecodeGenerator::pushLexicalScope):
(JSC::BytecodeGenerator::popLexicalScope):
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
(JSC::BytecodeGenerator::resolveType):
(JSC::BytecodeGenerator::emitResolveScope):
(JSC::BytecodeGenerator::emitGetFromScope):
(JSC::BytecodeGenerator::emitPutToScope):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitGetParentScope):
(JSC::BytecodeGenerator::emitPopScope):
(JSC::BytecodeGenerator::emitPopWithOrCatchScope):
(JSC::BytecodeGenerator::emitPopScopes):
(JSC::BytecodeGenerator::calculateTargetScopeDepthForExceptionHandler):
(JSC::BytecodeGenerator::localScopeDepth):
(JSC::BytecodeGenerator::labelScopeDepth):
(JSC::BytecodeGenerator::emitThrowReferenceError):
(JSC::BytecodeGenerator::emitPushFunctionNameScope):
(JSC::BytecodeGenerator::pushScopedControlFlowContext):
(JSC::BytecodeGenerator::popScopedControlFlowContext):
(JSC::BytecodeGenerator::emitPushCatchScope):
(JSC::BytecodeGenerator::currentScopeDepth): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::hasFinaliser):
(JSC::BytecodeGenerator::scopeDepth): Deleted.
* bytecompiler/NodesCodegen.cpp:
(JSC::ContinueNode::trivialTarget):
(JSC::BreakNode::trivialTarget):
(JSC::ReturnNode::emitBytecode):
(JSC::WithNode::emitBytecode):
(JSC::TryNode::emitBytecode):
* tests/stress/lexical-scoping-break-continue.js: Added.
(assert):
(.):

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

5 years ago[Win] Skip input range repaint test.
zalan@apple.com [Sat, 18 Jul 2015 19:48:59 +0000 (19:48 +0000)]
[Win] Skip input range repaint test.

* platform/win/TestExpectations:

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

5 years agoREGRESSION (r186981): fast/repaint/block-inputrange-repaint.html is starting out...
ddkilzer@apple.com [Sat, 18 Jul 2015 14:22:24 +0000 (14:22 +0000)]
REGRESSION (r186981): fast/repaint/block-inputrange-repaint.html is starting out life as flaky

<https://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=fast%2Frepaint%2Fblock-inputrange-repaint.html>

* fast/repaint/block-inputrange-repaint.html:
- Use setTimeout() to give WebKit time to repaint.

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

5 years agoREGRESSION (r186905,r186992): Incorrect results for platform/{gtk,efl,win}/fast/shrin...
ddkilzer@apple.com [Sat, 18 Jul 2015 13:54:38 +0000 (13:54 +0000)]
REGRESSION (r186905,r186992): Incorrect results for platform/{gtk,efl,win}/fast/shrink-wrap/rect-shrink-wrap-expected.txt

* platform/efl/fast/shrink-wrap/rect-shrink-wrap-expected.txt:
* platform/gtk/fast/shrink-wrap/rect-shrink-wrap-expected.txt:
* platform/win/fast/shrink-wrap/rect-shrink-wrap-expected.txt:
- Update to correct expected results.

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

5 years agoREGRESSION (r186858): GTK and EFL ports don't composite <canvas> elements
ddkilzer@apple.com [Sat, 18 Jul 2015 12:54:08 +0000 (12:54 +0000)]
REGRESSION (r186858): GTK and EFL ports don't composite <canvas> elements

See also r186905 for Windows.

* platform/efl/fast/shrink-wrap/rect-shrink-wrap-expected.txt: Added.
* platform/gtk/fast/shrink-wrap/rect-shrink-wrap-expected.txt: Added.

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

5 years agoREGRESSION (r186976): Use piFloat instead of M_PI
ddkilzer@apple.com [Sat, 18 Jul 2015 12:30:42 +0000 (12:30 +0000)]
REGRESSION (r186976): Use piFloat instead of M_PI

Attempt to fix the following build failure:

    PathUtilities.cpp(183): error C2065: 'M_PI' : undeclared identifier [...\Source\WebCore\WebCore.vcxproj\WebCore.vcxproj]

* platform/graphics/PathUtilities.cpp:
(WebCore::walkGraphAndExtractPolygon): Use piFloat since M_PI is
not defined on Windows.

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

5 years agoREGRESSION (r186976): Windows build broke due to missing definition of M_PI
ddkilzer@apple.com [Sat, 18 Jul 2015 12:20:25 +0000 (12:20 +0000)]
REGRESSION (r186976): Windows build broke due to missing definition of M_PI

Attempt to fix the following build failure:

    PathUtilities.cpp(182): error C2065: 'M_PI' : undeclared identifier [...\Source\WebCore\WebCore.vcxproj\WebCore.vcxproj]

* platform/graphics/PathUtilities.cpp: Include <wtf/MathExtras.h>.

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

5 years agoREGRESSION (r186982): http/tests/contentdispositionattachmentsandbox/form-submission...
ddkilzer@apple.com [Sat, 18 Jul 2015 12:07:09 +0000 (12:07 +0000)]
REGRESSION (r186982): http/tests/contentdispositionattachmentsandbox/form-submission-disabled.html and loader/meta-refresh-disabled.html fail

Part of:
<https://bugs.webkit.org/show_bug.cgi?id=147044>
<rdar://problem/21567820>

* http/tests/contentdispositionattachmentsandbox/form-submission-disabled-expected.txt:
- Fix line number of console message.
* loader/meta-refresh-disabled-expected.txt:
- Add newly expected console message.

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

5 years agoBring back the GNU ar check to create thin archives on non-Linux systems
commit-queue@webkit.org [Sat, 18 Jul 2015 06:32:42 +0000 (06:32 +0000)]
Bring back the GNU ar check to create thin archives on non-Linux systems
https://bugs.webkit.org/show_bug.cgi?id=146681

Patch by Ting-Wei Lan <lantw44@gmail.com> on 2015-07-17
Reviewed by Martin Robinson.

We already use GNU ar thin archive feature to save time and disk space
on creating static archives, but it is only enabled on Linux. Without
this feature, the debug build of WebCore can be larger than 4 GiB,
which can cause error because GNU ar format uses 32-bit integer to
store offsets in the symbol table. This patch is similar to
https://bugs.webkit.org/show_bug.cgi?id=128596.

* Source/cmake/OptionsCommon.cmake:

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

5 years agoDFG should have some obvious mitigations against watching structures that are unprofi...
fpizlo@apple.com [Sat, 18 Jul 2015 05:51:06 +0000 (05:51 +0000)]
DFG should have some obvious mitigations against watching structures that are unprofitable to watch
https://bugs.webkit.org/show_bug.cgi?id=147034

Reviewed by Mark Lam and Michael Saboff.

This implements two guards against the DFG watching structures that are likely to fire
their watchpoints:

- Don't watch dictionaries or any structure that had a dictionary in its past. Dictionaries
  can be flattened, and then they can transform back to dictionaries.

- Don't watch structures whose past structures were transitioned-away from while their
  transition watchpoints were being watched. This property gives us monotonicity: if we
  recompile because we watched structure S1 of object O, then we won't make the same mistake
  again when object O has structure S2, S3, and so on.

This is a 1.5% speed-up on Kraken. It does penalize some Octane tests, but it also seems to
help some of them, so on Octane it's basically neutral.

* bytecode/Watchpoint.h:
(JSC::WatchpointSet::invalidate):
(JSC::WatchpointSet::isBeingWatched):
(JSC::WatchpointSet::addressOfState):
(JSC::WatchpointSet::addressOfSetIsNotEmpty):
(JSC::InlineWatchpointSet::touch):
(JSC::InlineWatchpointSet::isBeingWatched):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::createStructure):
(JSC::JSGlobalObject::registerWeakMap):
* runtime/Structure.cpp:
(JSC::Structure::Structure):
(JSC::Structure::toDictionaryTransition):
(JSC::Structure::didTransitionFromThisStructure):
* runtime/Structure.h:

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

5 years agoRemove DFG::DesiredWriteBarriers because it's just a very difficult way of saying...
fpizlo@apple.com [Sat, 18 Jul 2015 05:49:32 +0000 (05:49 +0000)]
Remove DFG::DesiredWriteBarriers because it's just a very difficult way of saying "please barrier the machine code block owner"
https://bugs.webkit.org/show_bug.cgi?id=147030

Reviewed by Andreas Kling.

All of the users of DesiredWriteBarriers were just using it to request that Plan
finalization executes a barrier on codeBlock->ownerExecutable. Indeed, that's the only
owning cell in the heap that compilation affects. So, we might as well just have Plan
unconditionally execute that barrier and then we don't need DesiredWriteBarriers at
all.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
* dfg/DFGDesiredWriteBarriers.cpp: Removed.
* dfg/DFGDesiredWriteBarriers.h: Removed.
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::registerFrozenValues):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::reallyAdd):
(JSC::DFG::Plan::notifyCompiling):
(JSC::DFG::Plan::finalizeWithoutNotifyingCallback):
(JSC::DFG::Plan::checkLivenessAndVisitChildren):
(JSC::DFG::Plan::cancel):
* dfg/DFGPlan.h:

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

5 years agoREGRESSION (r169105): Do not assign a renderer to multiple selection subtrees.
zalan@apple.com [Sat, 18 Jul 2015 05:20:47 +0000 (05:20 +0000)]
REGRESSION (r169105): Do not assign a renderer to multiple selection subtrees.
https://bugs.webkit.org/show_bug.cgi?id=147038
rdar://problem/21819351

Reviewed by David Kilzer.

A renderer should never be assigned to multiple selection subtrees. (Currently RenderObject maintains the last selection state.)
RenderView::applySubtreeSelection() loops from the start to the end of the selection to find renderers that are inside the selection.
However, in case of regions (when multiple selection roots are present) traversing the renderer tree by calling RenderObject::nextInPreOrder() could
end up going across selection roots.
This patch ensures that we assign renderers to a specific selection only when the current selection root and the renderer's selection root match.

Source/WebCore:

Test: fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees2.html

* rendering/RenderView.cpp:
(WebCore::SelectionIterator::SelectionIterator):
(WebCore::SelectionIterator::current):
(WebCore::SelectionIterator::checkForSpanner):
(WebCore::RenderView::applySubtreeSelection):

LayoutTests:

* fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees2-expected.txt: Added.
* fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees2.html: Added.

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

5 years ago[iOS] Further tighten the sandbox around pages fetched with Content-Disposition:...
aestes@apple.com [Sat, 18 Jul 2015 03:47:28 +0000 (03:47 +0000)]
[iOS] Further tighten the sandbox around pages fetched with Content-Disposition: attachment
https://bugs.webkit.org/show_bug.cgi?id=147044
rdar://problem/21567820

Reviewed by Brady Eidson.

Source/WebCore:

In addition to placing resources fetched with 'Content-Disposition: attachment' in a unique origin,
this change does the following:

- Switches the sandbox type from SandboxOrigin to SandboxAll, which enforces the same restrictions as <iframe sandbox>.
- Disables processing of <meta http-equiv> elements.
- Disables loading of cross-origin subframes.

Tests: http/tests/contentdispositionattachmentsandbox/cross-origin-frames-disabled.html
       http/tests/contentdispositionattachmentsandbox/form-submission-disabled.html
       http/tests/contentdispositionattachmentsandbox/http-equiv-disabled.html
       http/tests/contentdispositionattachmentsandbox/plugins-disabled.html
       http/tests/contentdispositionattachmentsandbox/scripts-disabled.html

* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Switched to calling Document::httpEquivPolicy(). Logged an error to the console for policies other than Enabled.
(WebCore::Document::initSecurityContext): Switched sandbox enforcement from SandboxOrigin to SandboxAll.
(WebCore::Document::httpEquivPolicy): Returned a HttpEquivPolicy based on shouldEnforceContentDispositionAttachmentSandbox() and Settings::httpEquivEnabled().
(WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox): Returned true if Settings::contentDispositionAttachmentSandboxEnabled()
and the document was fetched as an attachment.
* dom/Document.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest): When requesting a subframe main resource when the parent frame enforces an attachment sandbox,
only continue if the parent frame's SecurityOrigin allows the request.
* page/Settings.in: Added contentDispositionAttachmentSandboxEnabled with an initial value of false.

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]): Enabled Content-Disposition: attachment sandbox on iOS.

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Enabled Content-Disposition: attachment sandbox on iOS.

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::decidePolicyForResponse): Only log the message about attachments if the custom policy delegate is enabled.
This matches the behavior of DumpRenderTree.

LayoutTests:

* http/tests/contentdispositionattachmentsandbox/cross-origin-frames-disabled-expected.txt: Added.
* http/tests/contentdispositionattachmentsandbox/cross-origin-frames-disabled.html: Added.
* http/tests/contentdispositionattachmentsandbox/form-submission-disabled-expected.txt: Added.
* http/tests/contentdispositionattachmentsandbox/form-submission-disabled.html: Added.
* http/tests/contentdispositionattachmentsandbox/http-equiv-disabled-expected.txt: Added.
* http/tests/contentdispositionattachmentsandbox/http-equiv-disabled.html: Added.
* http/tests/contentdispositionattachmentsandbox/plugins-disabled-expected.html: Added.
* http/tests/contentdispositionattachmentsandbox/plugins-disabled.html: Added.
* http/tests/contentdispositionattachmentsandbox/resources/cross-origin-frames-frame.php: Added.
* http/tests/contentdispositionattachmentsandbox/resources/form-submission-frame.php: Added.
* http/tests/contentdispositionattachmentsandbox/resources/http-equiv-frame.php: Added.
* http/tests/contentdispositionattachmentsandbox/resources/plugins-frame.php: Added.
* http/tests/contentdispositionattachmentsandbox/resources/scripts-frame.php: Added.
* http/tests/contentdispositionattachmentsandbox/scripts-disabled-expected.txt: Added.
* http/tests/contentdispositionattachmentsandbox/scripts-disabled.html: Added.

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

5 years ago(display: block)input range's thumb disappears when moved.
zalan@apple.com [Sat, 18 Jul 2015 03:46:22 +0000 (03:46 +0000)]
(display: block)input range's thumb disappears when moved.
https://bugs.webkit.org/show_bug.cgi?id=146896
<rdar://problem/21787807>

Reviewed by Simon Fraser.

Since the thumb is positioned after the layout for the input (shadow) subtree is finished, the repaint rects
issued during the layout will not cover the re-positioned thumb.
We need to issue a repaint soon after the thumb is re-positioned.

Source/WebCore:

Test: fast/repaint/block-inputrange-repaint.html

* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::layout):

LayoutTests:

* fast/repaint/block-inputrange-repaint-expected.txt: Added.
* fast/repaint/block-inputrange-repaint.html: Added.

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

5 years agoAttempt to fix the build.
simon.fraser@apple.com [Sat, 18 Jul 2015 03:16:32 +0000 (03:16 +0000)]
Attempt to fix the build.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless):
* html/HTMLMediaElement.h:

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

5 years agoPicture in Picture interacts poorly with AirPlay/HDMI
dino@apple.com [Sat, 18 Jul 2015 00:30:16 +0000 (00:30 +0000)]
Picture in Picture interacts poorly with AirPlay/HDMI
https://bugs.webkit.org/show_bug.cgi?id=147061
<rdar://problem/19192076>

Reviewed by Tim Horton.

When we are actively playing to an external target, the
picture in picture button should be hidden.

Also, the availability of picture in picture is also
dependent on AirPlay, so that we don't auto-pip when
we're displaying on a TV.

* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.configureInlineControls): Call the update function.
(ControllerIOS.prototype.updatePictureInPictureButton): Add or remove a hidden class.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::allowsPictureInPicture): Check Airplay status.

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

5 years ago[iOS] TextIndicator has a large forehead when line-height > 1
timothy_horton@apple.com [Sat, 18 Jul 2015 00:20:35 +0000 (00:20 +0000)]
[iOS] TextIndicator has a large forehead when line-height > 1
https://bugs.webkit.org/show_bug.cgi?id=147058
<rdar://problem/21643094>

Reviewed by Dean Jackson.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::getClippedVisibleTextRectangles):
* editing/FrameSelection.h:
Add a parameter controlling whether getClippedVisibleTextRectangles
returns selection-height rects (including extra line-height) or text-height
rects (including only the text height). Plumb it down.

* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
(WebCore::TextIndicator::createWithSelectionInFrame):
Use the tighter text-height rects on iOS, where there's no selection highlight to cover up.
Remove an assertion that is no longer always true, and which is mostly obsoleted by the
fact that we don't let FrameSnapshotting code arbitrarily decide the rect to snapshot anymore.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
Apply a review comment that I left myself and then forgot about.

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

5 years ago[iOS] Implement selectionInteractionAssistant accessor.
enrica@apple.com [Fri, 17 Jul 2015 23:59:12 +0000 (23:59 +0000)]
[iOS] Implement selectionInteractionAssistant accessor.
https://bugs.webkit.org/show_bug.cgi?id=147054
rdar://problem/20864286

Reviewed by Tim Horton.

One more change to adopt the new selection interaction
model on iOS.

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

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

5 years agoImprove rect shrink-wrapping algorithm
timothy_horton@apple.com [Fri, 17 Jul 2015 23:55:59 +0000 (23:55 +0000)]
Improve rect shrink-wrapping algorithm
https://bugs.webkit.org/show_bug.cgi?id=147037
<rdar://problem/21643094>

Reviewed by Simon Fraser.

* platform/graphics/FloatPoint.h:
(WebCore::areEssentiallyEqual):
Added; implementation is the same as FloatSize's.

* platform/graphics/PathUtilities.cpp:
(WebCore::FloatPointGraph::FloatPointGraph):
(WebCore::FloatPointGraph::~FloatPointGraph):
(WebCore::FloatPointGraph::Node::Node):
(WebCore::FloatPointGraph::Node::nextPoints):
(WebCore::FloatPointGraph::Node::addNextPoint):
(WebCore::FloatPointGraph::Node::isVisited):
(WebCore::FloatPointGraph::Node::visit):
(WebCore::FloatPointGraph::Node::reset):
(WebCore::FloatPointGraph::reset):
(WebCore::FloatPointGraph::findOrCreateNode):
(WebCore::findLineSegmentIntersection):
(WebCore::addIntersectionPoints):
(WebCore::walkGraphAndExtractPolygon):
(WebCore::findUnvisitedPolygonStartPoint):
(WebCore::unitePolygons):
(WebCore::edgesForRect):
(WebCore::PathUtilities::pathWithShrinkWrappedRects):
(WebCore::addShrinkWrapRightCorner): Deleted.
(WebCore::addShrinkWrapLeftCorner): Deleted.
(WebCore::addShrinkWrappedPathForRects): Deleted.
(WebCore::rectsIntersectOrTouch): Deleted.
(WebCore::findSetContainingRect): Deleted.
Add a new implementation of shrink-wrap, which is significantly more
generic than the old one, which assumed a top-down progression of rects.

This version uses polygon intersection to find the path around the
set of rects, and then follows said path and adds appropriately-sized
arcs for the corners.

The polygon intersection algorithm first finds all the intersection points
between all of the rects, then builds a graph of edges outward from one point.
It then traverses the graph, choosing at each point the next edge which
has not been visited and has the greatest interior angle, recording the polygon as it goes.

If at the end of the traversal we have not returned to the initial node,
we give up on shrink-wrapping and just use a bounding box around the rects.

If any of the original rects have not been visited at all, we repeat the traversal
starting with that rect, making an additional polygon (since we removed completely contained
rects before we started, having not visited the rect at all means that it's not connected
to the others).

Once we have a set of united polygons, we follow each one, determining the ideal (always
equal in width and height, never more than half the length of either edge, so that we always
have a smooth curve) arc radius and projecting it onto the edge, and then
adding an arc between the end of the previous path and beginning of the next.

Because the shrink-wrap algorithm is fairly expensive, if there are more than 20 rects,
we fall back to a bounding box. Given the current use cases, this is more than enough
rects, but can certainly be adjusted in the future if needed.

* testing/Internals.cpp:
(WebCore::Internals::pathWithShrinkWrappedRects):
* testing/Internals.h:
* testing/Internals.idl:
Add a radius parameter.

* fast/shrink-wrap/rect-shrink-wrap-expected.png:
* fast/shrink-wrap/rect-shrink-wrap.html:
Add a radius parameter to testRects, defaulting to 8.

Add an offset parameter to testRects, making it easier to slide
the rect sets around.

Add some more test cases.

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

5 years agoAX: iframe within table cell is inaccessible to VoiceOver
commit-queue@webkit.org [Fri, 17 Jul 2015 23:32:30 +0000 (23:32 +0000)]
AX: iframe within table cell is inaccessible to VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=147001
<rdar://problem/21106945>

Patch by Nan Wang <n_wang@apple.com> on 2015-07-17
Reviewed by Chris Fleizach.

Source/WebCore:

When a table cell is created before its parent table determines if it should be ignored or not,
the table cell may cache the wrong role. Fix that by allowing each table cell to update its role
after the table makes this determination.

Test: accessibility/iframe-within-cell.html

* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::addChildrenFromSection):

LayoutTests:

* accessibility/iframe-within-cell-expected.txt: Added.
* accessibility/iframe-within-cell.html: Added.

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

5 years agostyle.fontFamily accessor crashes on unstyled node created from DOMParser().parseFrom...
mmaxfield@apple.com [Fri, 17 Jul 2015 23:26:34 +0000 (23:26 +0000)]
style.fontFamily accessor crashes on unstyled node created from DOMParser().parseFromString()
https://bugs.webkit.org/show_bug.cgi?id=147026
<rdar://problem/21864487>

Reviewed by Andreas Kling.

Source/WebCore:

Font CSS properties are a little special because they are used as indices into caches.
Normally, StyleResolver gives all nodes a default font family, so our cache works correctly.
However, if the document doesn't have a Settings object, StyleResolver wasn't doing this.
Documents created from DOMParser().parseFromString() don't have a Settings object.

Test: fast/text/crash-font-family-parsed.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::defaultStyleForElement):
(WebCore::StyleResolver::initializeFontStyle): Set a font family even if we don't have a
Settings object.

LayoutTests:

* fast/text/crash-font-family-parsed-expected.txt: Added.
* fast/text/crash-font-family-parsed.html: Added.

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

5 years agoUnreviewed, rename test file from promise-resolve-non-dom.js to promise-resolve-in...
utatane.tea@gmail.com [Fri, 17 Jul 2015 23:18:44 +0000 (23:18 +0000)]
Unreviewed, rename test file from promise-resolve-non-dom.js to promise-resolve-in-non-dom.js
https://bugs.webkit.org/show_bug.cgi?id=146828

This is the simple follow up patch.
When executing the JSC stress tests, script-tests's file name and the expectation file name should be equal.

* js/promise-resolve-in-non-dom.html:
* js/script-tests/promise-resolve-in-non-dom.js: Renamed from LayoutTests/js/script-tests/promise-resolve-non-dom.js.
(value.then):
* js/script-tests/promise-resolve-non-dom.js:
(value.then): Deleted.

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

5 years agoREGRESSION (r186964): Crash in WebKit2.CloseFromWithinCreatePage
mitz@apple.com [Fri, 17 Jul 2015 23:05:27 +0000 (23:05 +0000)]
REGRESSION (r186964): Crash in WebKit2.CloseFromWithinCreatePage
https://bugs.webkit.org/show_bug.cgi?id=147055

Reviewed by Alex Christensen.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::createNewPage): Grab the main frame’s URL before calling out to the
client, who may destroy the frame.

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

5 years agoVideo posters disappear once media has loaded
mmaxfield@apple.com [Fri, 17 Jul 2015 23:01:08 +0000 (23:01 +0000)]
Video posters disappear once media has loaded
https://bugs.webkit.org/show_bug.cgi?id=147045

Reviewed by Simon Fraser.

Source/WebCore:

After r184932, all video elements are composited. However, there is logic in
RenderLayerBacking::updateConfiguration() which adds the video layer to the page
if the video is composited, without checking first to see if it should actually
do so.

Test: compositing/video/poster.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):

LayoutTests:

* compositing/video/poster-expected.html: Added.
* compositing/video/poster.html: Added.

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

5 years agoIntegrate automatic microtask draining into JSC framework and re-enable Promise
utatane.tea@gmail.com [Fri, 17 Jul 2015 22:40:40 +0000 (22:40 +0000)]
Integrate automatic microtask draining into JSC framework and re-enable Promise
https://bugs.webkit.org/show_bug.cgi?id=146828

Reviewed by Sam Weinig.

Source/JavaScriptCore:

Add automatic microtask draining system into JSC framework.
When the depth of VM lock becomes 0, before this, we drain the queued microtasks.
Enqueuing behavior can be injected by the JSGlobalObject's method table.
It is utilized in WebCore to post the microtask to WebCore's event loop.

In the case of JSC interactive shell, VM depth is always greater than 0.
So we manually drains the queued microtasks after evaluating the written line.

Since now JSC framework has the microtask queue, we can drain the queued microtasks.
So re-enable the Promise in the JSC framework context.

* API/JSContextRef.cpp:
(javaScriptRuntimeFlags): Deleted.
* API/tests/testapi.c:
(main):
* API/tests/testapi.mm:
(testObjectiveCAPIMain):
* jsc.cpp:
(runInteractive):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::queueMicrotask):
* runtime/JSLock.cpp:
(JSC::JSLock::willReleaseLock):
* runtime/VM.cpp:
(JSC::VM::queueMicrotask):
(JSC::VM::drainMicrotasks):
(JSC::QueuedTask::run):
* runtime/VM.h:
(JSC::QueuedTask::QueuedTask):

LayoutTests:

Add Promise tests mainly focusing on microtasks.
They can be executed in JSC shell. So they are locate in js/ directory (not js/dom).

* js/promise-nested-microtasks-expected.txt: Added.
* js/promise-nested-microtasks.html: Added.
* js/promise-resolve-in-non-dom-expected.txt: Added.
* js/promise-resolve-in-non-dom.html: Added.
* js/script-tests/promise-nested-microtasks.js: Added.
(Promise.resolve.then):
* js/script-tests/promise-resolve-non-dom.js: Added.
(value.then):
* resources/standalone-post.js:

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

5 years ago[Content Extensions] Term::isUniversalTransition() incorrectly expects the end-of...
commit-queue@webkit.org [Fri, 17 Jul 2015 21:47:05 +0000 (21:47 +0000)]
[Content Extensions] Term::isUniversalTransition() incorrectly expects the end-of-line assertion in character sets
https://bugs.webkit.org/show_bug.cgi?id=147032

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-07-17
Reviewed by Alex Christensen.

Source/WebCore:

* contentextensions/Term.h:
(WebCore::ContentExtensions::Term::isUniversalTransition):
The universal transition is not supposed to account for the end-of-line assertion,
it should be a transition matching any character.

Here, we were counting 128 transitions, the 127 characters plus the
transition on zero we are using for EOL.

The end result is Term::isUniversalTransition() was completely useless.
The only code using it is the pattern simplificaton phase. That part
was not working correclty and was allowing useless ".*" in the patterns.

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
Test that the useless terms are eliminated by counting
the number of NFA nodes generated.

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

5 years agoSource/WebCore:
mitz@apple.com [Fri, 17 Jul 2015 21:16:09 +0000 (21:16 +0000)]
Source/WebCore:
WebCore part of <rdar://problem/21803781> The external URL policy is not reported correctly in navigation actions that create new windows
https://bugs.webkit.org/show_bug.cgi?id=147040

Reviewed by Dean Jackson.

Test: TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm

* loader/FrameLoader.cpp:
(WebCore::shouldOpenExternalURLsPolicyToApply): Pulled the logic out of
applyShouldOpenExternalURLsPolicyToNewDocumentLoader into this new helper.
(WebCore::FrameLoader::loadURL): When targeting a new frame, apply the external URLs policy
to the action passed to checkNewWindowPolicy.
(WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader): Call the new
helper function.
(WebCore::createWindow): Include the external URL policy in the action passed to
createWindow.

Source/WebKit2:
WebKit2 part of <rdar://problem/21803781> The external URL policy is not reported correctly in navigation actions that create new windows
https://bugs.webkit.org/show_bug.cgi?id=147040

Reviewed by Dean Jackson.

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::UIClient::createNewPage): Disallow App Links if the new page is for the
same protocol, host and port as the main frame of this page.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Disallow App Links if
m_shouldSuppressAppLinksInNextNavigationPolicyDecision is set, and reset it. See below for
when we set it.
(WebKit::WebPageProxy::decidePolicyForNewWindowAction): Disallow App Links if the new window
is for the same protocol, host and port as the main frame of this page.
(WebKit::WebPageProxy::createNewPage): Make the new page disallow App Links in the first
policy decision if it is for the same protocol, host and port as the main frame of this
page.
* UIProcess/WebPageProxy.h: Added m_shouldSuppressAppLinksInNextNavigationPolicyDecision
member variable.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow): Pass the shouldOpenExternalURLsPolicy.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.

Tools:
Tests for <rdar://problem/21803781> The external URL policy is not reported correctly in navigation actions that create new windows
https://bugs.webkit.org/show_bug.cgi?id=147040

Reviewed by Dean Jackson.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm: Added.
(-[ShouldOpenExternalURLsInNewWindowActionsController webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[ShouldOpenExternalURLsInNewWindowActionsController webView:didFinishNavigation:]):
(-[ShouldOpenExternalURLsInNewWindowActionsController webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]):
(TEST):

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

5 years agoScrollView.h should be self-contained
andersca@apple.com [Fri, 17 Jul 2015 19:35:57 +0000 (19:35 +0000)]
ScrollView.h should be self-contained
https://bugs.webkit.org/show_bug.cgi?id=147004

Reviewed by Sam Weinig.

* platform/ScrollView.h:

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

5 years agoRolling r186895 back in, in its entirety.
beidson@apple.com [Fri, 17 Jul 2015 19:00:45 +0000 (19:00 +0000)]
Rolling r186895 back in, in its entirety.
https://bugs.webkit.org/show_bug.cgi?id=146976

Rubberstamped by Tim Horton.

* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::createCookies): Use new CFNetwork SPI.

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

5 years agoFunction parameters should be parsed in the same parser arena as the function body
saambarati1@gmail.com [Fri, 17 Jul 2015 18:48:30 +0000 (18:48 +0000)]
Function parameters should be parsed in the same parser arena as the function body
https://bugs.webkit.org/show_bug.cgi?id=145995

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

This patch changes how functions are parsed in JSC. A function's
parameters are now parsed in the same arena as the function itself.
This allows us to arena allocate all destructuring AST nodes and
the FunctionParameters node. This will help make implementing ES6
default parameter values sane.

A source code that represents a function now includes the text of the function's
parameters. The starting offset is at the opening parenthesis of the parameter
list or at the starting character of the identifier for arrow functions that
have single arguments and don't start with parenthesis.

For example:

"function (param1, param2) { ... }"
                           ^
                           | This offset used to be the starting offset of a function's SourceCode
          ^
          | This is the new starting offset for a function's SourceCode.

This requires us to change how some offsets are calculated
and also requires us to report some different line numbers for internal
metrics that use a SourceCode's starting line and column numbers.

This patch also does a bit of cleanup with regards to how
functions are parsed in general (especially arrow functions).
It removes some unnecessary #ifdefs and the likes for arrow
to make things clearer and more deliberate.

* API/JSScriptRef.cpp:
(parseScript):
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutableInternal):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::generateFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedFunctionExecutable::visitChildren):
(JSC::UnlinkedFunctionExecutable::parameterCount): Deleted.
* bytecode/UnlinkedCodeBlock.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::DestructuringAssignmentNode::emitBytecode):
(JSC::assignDefaultValueIfUndefined):
(JSC::ArrayPatternNode::collectBoundIdentifiers):
(JSC::DestructuringPatternNode::~DestructuringPatternNode): Deleted.
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createClassExpr):
(JSC::ASTBuilder::createFunctionExpr):
(JSC::ASTBuilder::createFunctionBody):
(JSC::ASTBuilder::createArrowFunctionExpr):
(JSC::ASTBuilder::createGetterOrSetterProperty):
(JSC::ASTBuilder::createElementList):
(JSC::ASTBuilder::createFormalParameterList):
(JSC::ASTBuilder::appendParameter):
(JSC::ASTBuilder::createClause):
(JSC::ASTBuilder::createClauseList):
(JSC::ASTBuilder::createFuncDeclStatement):
(JSC::ASTBuilder::createForInLoop):
(JSC::ASTBuilder::createForOfLoop):
(JSC::ASTBuilder::isResolve):
(JSC::ASTBuilder::createDestructuringAssignment):
(JSC::ASTBuilder::createArrayPattern):
(JSC::ASTBuilder::appendArrayPatternSkipEntry):
(JSC::ASTBuilder::appendArrayPatternEntry):
(JSC::ASTBuilder::appendArrayPatternRestEntry):
(JSC::ASTBuilder::finishArrayPattern):
(JSC::ASTBuilder::createObjectPattern):
(JSC::ASTBuilder::appendObjectPatternEntry):
(JSC::ASTBuilder::createBindingLocation):
(JSC::ASTBuilder::setEndOffset):
* parser/Lexer.cpp:
(JSC::Lexer<T>::Lexer):
(JSC::Lexer<T>::nextTokenIsColon):
(JSC::Lexer<T>::setTokenPosition):
(JSC::Lexer<T>::lex):
(JSC::Lexer<T>::clear):
* parser/Lexer.h:
(JSC::Lexer::setIsReparsingFunction):
(JSC::Lexer::isReparsingFunction):
(JSC::Lexer::lineNumber):
(JSC::Lexer::setIsReparsing): Deleted.
(JSC::Lexer::isReparsing): Deleted.
* parser/NodeConstructors.h:
(JSC::TryNode::TryNode):
(JSC::FunctionParameters::FunctionParameters):
(JSC::FuncExprNode::FuncExprNode):
(JSC::FuncDeclNode::FuncDeclNode):
(JSC::ArrayPatternNode::ArrayPatternNode):
(JSC::ObjectPatternNode::ObjectPatternNode):
(JSC::BindingNode::BindingNode):
(JSC::DestructuringAssignmentNode::DestructuringAssignmentNode):
(JSC::ParameterNode::ParameterNode): Deleted.
(JSC::ArrayPatternNode::create): Deleted.
(JSC::ObjectPatternNode::create): Deleted.
(JSC::BindingNode::create): Deleted.
* parser/Nodes.cpp:
(JSC::ProgramNode::ProgramNode):
(JSC::EvalNode::EvalNode):
(JSC::FunctionBodyNode::FunctionBodyNode):
(JSC::FunctionBodyNode::finishParsing):
(JSC::FunctionNode::FunctionNode):
(JSC::FunctionNode::finishParsing):
(JSC::FunctionParameters::create): Deleted.
(JSC::FunctionParameters::FunctionParameters): Deleted.
(JSC::FunctionParameters::~FunctionParameters): Deleted.
* parser/Nodes.h:
(JSC::ProgramNode::startColumn):
(JSC::ProgramNode::endColumn):
(JSC::EvalNode::startColumn):
(JSC::EvalNode::endColumn):
(JSC::FunctionParameters::size):
(JSC::FunctionParameters::at):
(JSC::FunctionParameters::append):
(JSC::FuncExprNode::body):
(JSC::DestructuringPatternNode::~DestructuringPatternNode):
(JSC::DestructuringPatternNode::isBindingNode):
(JSC::DestructuringPatternNode::emitDirectBinding):
(JSC::ArrayPatternNode::appendIndex):
(JSC::ObjectPatternNode::appendEntry):
(JSC::BindingNode::boundProperty):
(JSC::BindingNode::divotStart):
(JSC::BindingNode::divotEnd):
(JSC::DestructuringAssignmentNode::bindings):
(JSC::FuncDeclNode::body):
(JSC::ParameterNode::pattern): Deleted.
(JSC::ParameterNode::nextParam): Deleted.
(JSC::FunctionParameters::patterns): Deleted.
* parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::~Parser):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::allowAutomaticSemicolon):
(JSC::Parser<LexerType>::parseSourceElements):
(JSC::Parser<LexerType>::createBindingPattern):
(JSC::Parser<LexerType>::parseArrowFunctionSingleExpressionBodySourceElements):
(JSC::Parser<LexerType>::tryParseDestructuringPatternExpression):
(JSC::Parser<LexerType>::parseSwitchClauses):
(JSC::Parser<LexerType>::parseSwitchDefaultClause):
(JSC::Parser<LexerType>::parseBlockStatement):
(JSC::Parser<LexerType>::parseStatement):
(JSC::Parser<LexerType>::parseFormalParameters):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::stringForFunctionMode):
(JSC::Parser<LexerType>::parseFunctionParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseMemberExpression):
(JSC::Parser<LexerType>::parseArrowFunctionExpression):
(JSC::operatorString):
(JSC::Parser<LexerType>::parseArrowFunctionSingleExpressionBody): Deleted.
* parser/Parser.h:
(JSC::Parser::positionBeforeLastNewline):
(JSC::Parser::locationBeforeLastToken):
(JSC::Parser::findCachedFunctionInfo):
(JSC::Parser::isofToken):
(JSC::Parser::isEndOfArrowFunction):
(JSC::Parser::isArrowFunctionParamters):
(JSC::Parser::tokenStart):
(JSC::Parser::isLETMaskedAsIDENT):
(JSC::Parser::autoSemiColon):
(JSC::Parser::setEndOfStatement):
(JSC::Parser::canRecurse):
(JSC::Parser<LexerType>::parse):
(JSC::parse):
* parser/ParserFunctionInfo.h:
* parser/ParserModes.h:
(JSC::functionNameIsInScope):
* parser/SourceCode.h:
(JSC::makeSource):
(JSC::SourceCode::subExpression):
(JSC::SourceCode::subArrowExpression): Deleted.
* parser/SourceProviderCache.h:
(JSC::SourceProviderCache::get):
* parser/SourceProviderCacheItem.h:
(JSC::SourceProviderCacheItem::endFunctionToken):
(JSC::SourceProviderCacheItem::usedVariables):
(JSC::SourceProviderCacheItem::writtenVariables):
(JSC::SourceProviderCacheItem::SourceProviderCacheItem):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::SyntaxChecker):
(JSC::SyntaxChecker::createClassExpr):
(JSC::SyntaxChecker::createFunctionExpr):
(JSC::SyntaxChecker::createFunctionBody):
(JSC::SyntaxChecker::createArrowFunctionExpr):
(JSC::SyntaxChecker::setFunctionNameStart):
(JSC::SyntaxChecker::createArguments):
(JSC::SyntaxChecker::createPropertyList):
(JSC::SyntaxChecker::createElementList):
(JSC::SyntaxChecker::createFormalParameterList):
(JSC::SyntaxChecker::appendParameter):
(JSC::SyntaxChecker::createClause):
(JSC::SyntaxChecker::createClauseList):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
* runtime/Completion.cpp:
(JSC::checkSyntax):
* runtime/Executable.cpp:
(JSC::ProgramExecutable::checkSyntax):
* tests/controlFlowProfiler/conditional-expression.js:
(testConditionalFunctionCall):

LayoutTests:

* fast/profiler/anonymous-event-handler-expected.txt:
* fast/profiler/anonymous-function-called-from-different-contexts-expected.txt:
* fast/profiler/anonymous-function-calls-built-in-functions-expected.txt:
* fast/profiler/anonymous-function-calls-eval-expected.txt:
* fast/profiler/anonymous-functions-with-display-names-expected.txt:
* fast/profiler/apply-expected.txt:
* fast/profiler/built-in-function-calls-anonymous-expected.txt:
* fast/profiler/built-in-function-calls-user-defined-function-expected.txt:
* fast/profiler/call-expected.txt:
* fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt:
* fast/profiler/compare-multiple-profiles-expected.txt:
* fast/profiler/constructor-expected.txt:
* fast/profiler/dead-time-expected.txt:
* fast/profiler/document-dot-write-expected.txt:
* fast/profiler/event-handler-expected.txt:
* fast/profiler/execution-context-and-eval-on-same-line-expected.txt:
* fast/profiler/inline-event-handler-expected.txt:
* fast/profiler/many-calls-in-the-same-scope-expected.txt:
* fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt:
* fast/profiler/multiple-and-different-scoped-function-calls-expected.txt:
* fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt:
* fast/profiler/multiple-frames-expected.txt:
* fast/profiler/named-functions-with-display-names-expected.txt:
* fast/profiler/nested-anonymous-functon-expected.txt:
* fast/profiler/nested-start-and-stop-profiler-expected.txt:
* fast/profiler/one-execution-context-expected.txt:
* fast/profiler/profile-calls-in-included-file-expected.txt:
* fast/profiler/profile-with-no-title-expected.txt:
* fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt:
* fast/profiler/profiling-from-a-nested-location-expected.txt:
* fast/profiler/simple-event-call-expected.txt:
* fast/profiler/simple-no-level-change-expected.txt:
* fast/profiler/start-and-stop-profiler-multiple-times-expected.txt:
* fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt:
* fast/profiler/stop-profiling-after-setTimeout-expected.txt:
* fast/profiler/stop-then-function-call-expected.txt:
* fast/profiler/two-execution-contexts-expected.txt:
* fast/profiler/user-defined-function-calls-built-in-functions-expected.txt:
* fast/profiler/window-dot-eval-expected.txt:
* js/dom/script-start-end-locations-expected.txt:

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

5 years ago[Content Extensions] CSS-display-none rules are not working properly
commit-queue@webkit.org [Fri, 17 Jul 2015 18:28:01 +0000 (18:28 +0000)]
[Content Extensions] CSS-display-none rules are not working properly
https://bugs.webkit.org/show_bug.cgi?id=147024

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-07-17
Reviewed by Sam Weinig.

Source/WebCore:

There were 2 bugs prevening rules with css-display-none and a url-filter from working
correctly.

First, ContentExtensions::serializeActions() was merging selectors regardless of their
trigger. All the CSS Selectors would be grouped together and applied regardless of which
rule apply.

That problem was fixed by grouping CSS rules by trigger. We want all the undistinguishable
CSS rules to be merged. The trigger makes 2 rules dinstinguishable as one rule can apply
on a page while the next rule does not. The simplest approach is to group by trigger.

The second problem had to do with rules added before the document is created.
When accumulating those rules, we were only keeping the last one. The reason was that
DocumentLoader::addPendingContentExtensionDisplayNoneSelector() would only keep a single
selector list by extension.

This is fixed by keeping a vector of all the rules that apply.

Tests: http/tests/contentextensions/css-display-none-with-different-case-sensitivity-are-not-merged.html
       http/tests/contentextensions/css-display-none-with-different-triggers-are-not-merged.html
       http/tests/contentextensions/two-distinguishable-css-display-none-rules-on-main-resource.html

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::serializeActions):
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Trigger::isEmpty):
(WebCore::ContentExtensions::TriggerHash::hash):
(WebCore::ContentExtensions::TriggerHash::equal):
(WebCore::ContentExtensions::TriggerHashTraits::constructDeletedValue):
(WebCore::ContentExtensions::TriggerHashTraits::isDeletedValue):
(WebCore::ContentExtensions::TriggerHashTraits::emptyValue):
(WebCore::ContentExtensions::TriggerHashTraits::isEmptyValue):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): Deleted.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
* loader/DocumentLoader.h:

LayoutTests:

* http/tests/contentextensions/css-display-none-with-different-case-sensitivity-are-not-merged-expected.txt: Added.
* http/tests/contentextensions/css-display-none-with-different-case-sensitivity-are-not-merged.html: Added.
* http/tests/contentextensions/css-display-none-with-different-case-sensitivity-are-not-merged.html.json: Added.
* http/tests/contentextensions/css-display-none-with-different-triggers-are-not-merged-expected.txt: Added.
* http/tests/contentextensions/css-display-none-with-different-triggers-are-not-merged.html: Added.
* http/tests/contentextensions/css-display-none-with-different-triggers-are-not-merged.html.json: Added.
* http/tests/contentextensions/two-distinguishable-css-display-none-rules-on-main-resource-expected.txt: Added.
* http/tests/contentextensions/two-distinguishable-css-display-none-rules-on-main-resource.html: Added.
* http/tests/contentextensions/two-distinguishable-css-display-none-rules-on-main-resource.html.json: Added.

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

5 years agoiOS TextIndicators include text that is not supposed to be indicated
timothy_horton@apple.com [Fri, 17 Jul 2015 18:24:49 +0000 (18:24 +0000)]
iOS TextIndicators include text that is not supposed to be indicated
https://bugs.webkit.org/show_bug.cgi?id=147028
<rdar://problem/21643094>

Reviewed by Sam Weinig.

Paint the selection and background, but not other foregrounds, for iOS TextIndicators.

* page/FrameSnapshotting.cpp:
(WebCore::snapshotFrameRect):
* page/FrameSnapshotting.h:
Add a new snapshot option where we'll paint backgrounds and the selected
foreground and nothing else.
Pass the new snapshot option through as a paint behavior.

* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
Implement the incantations necessary to make a temporary selection
change not get sent to the UI process and actually have WebCore know about it
and accurately respond to questions about it.

(WebCore::TextIndicator::createWithSelectionInFrame):
Paint selection and backgrounds on iOS.

* rendering/PaintPhase.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionColor):
Add a new paint behavior, SelectionAndBackgroundsOnly, which behaves
the same as selection only except it allows backgrounds to paint.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::shouldCreateTransientPaintingSnapshot):

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

5 years agoRemove leak of objects between isolated worlds on custom events, message events,...
mark.lam@apple.com [Fri, 17 Jul 2015 18:11:40 +0000 (18:11 +0000)]
Remove leak of objects between isolated worlds on custom events, message events, and pop state events.
https://bugs.webkit.org/show_bug.cgi?id=118884

Reviewed by Filip Pizlo and Mark Lam.
Patch by Keith Miller  <keith_miller@apple.com>.

Source/WebCore:

Tests: fast/events/event-leak-objects.html
       fast/events/event-properties-gc.html

Fixes an issue where objects passed as certain properties of events could cross isolated worlds. This
was fixed by checking that any object passed by an event must be serializable or originate from the same
isolated world as the one it is currently being accessed in. In the case of MessageEvents and PopStateEvents we
cache the values of the data and state properties, respectively, as they may be a deserialized object. In case
an object was deserialized in a world with elevated privileges we also check the cached value is from the same
world, if it is from a different world we recompute it. For testing purposes, I added a new function to Internals
that determines whether a JSObject originated in the current world.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMWrapperWorld.h:
(WebCore::worldForDOMObject):
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSCustomEventCustom.cpp: Copied from Source/WebCore/dom/CustomEvent.cpp.
(WebCore::JSCustomEvent::detail):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::data):
* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state):
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::initCustomEvent):
(WebCore::CustomEvent::trySerializeDetail):
* dom/CustomEvent.h:
* dom/CustomEvent.idl:
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::initMessageEvent):
(WebCore::MessageEvent::trySerializeData):
* dom/MessageEvent.h:
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::trySerializeState):
* dom/PopStateEvent.h:
* testing/Internals.cpp:
(WebCore::Internals::isFromCurrentWorld):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

These tests ensure ensure objects are not leaked across isolated worlds and that those properties are not prematurely
garbage collected.

* fast/events/constructors/custom-event-constructor-expected.txt:
* fast/events/constructors/custom-event-constructor.html:
* fast/events/event-leak-objects-expected.txt: Added.
* fast/events/event-leak-objects.html: Added.
* fast/events/event-properties-gc-expected.txt: Added.
* fast/events/event-properties-gc.html: Added.

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

5 years ago[GTK] Cleanup PasteboardHelper
carlosgc@webkit.org [Fri, 17 Jul 2015 09:23:28 +0000 (09:23 +0000)]
[GTK] Cleanup PasteboardHelper
https://bugs.webkit.org/show_bug.cgi?id=147035

Reviewed by Žan Doberšek.

Source/WebCore:

It's actually a singleton, but the API suggests you can create
your own or use the default one, but the default one should be the
only one. Rename PasteboardHelper::defaultPasteboardHelper() as
PasteboardHelper::singleton() and make it non-copyable and never
destroyed.

* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writePlainText): Use PasteboardHelper::singleton().
(WebCore::Pasteboard::write): Ditto.
(WebCore::Pasteboard::writePasteboard): Ditto.
(WebCore::Pasteboard::clear): Ditto.
(WebCore::Pasteboard::canSmartReplace): Ditto.
(WebCore::Pasteboard::read): Ditto.
(WebCore::Pasteboard::hasData): Ditto.
(WebCore::Pasteboard::types): Ditto.
(WebCore::Pasteboard::readString): Ditto.
(WebCore::Pasteboard::readFilenames): Ditto.
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::singleton): Renamed as singleton, also
use NeverDestroyed and return a reference instead of a pointer.
(WebCore::PasteboardHelper::PasteboardHelper): Do all
initializations here and remove the initialization static flag,
since this is a real singleton now. Also use
gdk_atom_intern_static_string() to initialize the atoms instead of
gdk_atom_intern().
(WebCore::PasteboardHelper::targetList):
(WebCore::PasteboardHelper::targetListForDataObject):
(WebCore::getClipboardContentsCallback):
* platform/gtk/PasteboardHelper.h:

Source/WebKit2:

Use PasteboardHelper::singleton() instead of
PasteboardHelper::defaultPasteboardHelper().

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseConstructed):
* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::startDrag):
(WebKit::DragAndDropHandler::fillDragData):
(WebKit::DragAndDropHandler::dataObjectForDropData):
(WebKit::DragAndDropHandler::requestDragData):

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

5 years agowebkit-patch uses incorrect credentials from keychain to login until account lockout
commit-queue@webkit.org [Fri, 17 Jul 2015 03:59:31 +0000 (03:59 +0000)]
webkit-patch uses incorrect credentials from keychain to login until account lockout
https://bugs.webkit.org/show_bug.cgi?id=146923

Patch by Dean Johnson <dean_johnson@apple.com> on 2015-07-16
Reviewed by Daniel Bates.

When `webkit-patch upload` asks for login credentials for bugs.webkit.org, if you
provide incorrect credentials then ask for them to be saved to the keychain
webkit-patch will then use those incorrect credentials until 5 total attempts
have been made to log in. This will lock the user out of Bugzilla for a
half hour.

* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla.authenticate): Added argument to read_credentials() that
passes in whether or not to use stored credentials.
* Scripts/webkitpy/common/net/credentials.py:
(Credentials.read_credentials): Added optional argument 'use_stored_credentials'
that specifies whether or not to use credentials stored on the system. If it
does, we do not auto-fill credentials since either the credentials caused
the failure, or they weren't used in the first place so there is no reason
to try and use them again if a failure happened.
* Scripts/webkitpy/common/net/credentials_unittest.py: Added unit test for newly added
use_stored_credentials argument.
(test_do_not_use_stored_credentials): Added unit test to make sure functions that
retrieve username/password information from the local system (environment, Git, keychain,
keyring) are never called. It also tests that we get back our mocked username and password.
(test_do_not_use_stored_credentials.MockKeyring): Mock keyring
(test_do_not_use_stored_credentials.MockKeyring.get_password): Assert this is never called.
(test_do_not_use_stored_credentials.FakeCredentials): Mock credentials
(test_do_not_use_stored_credentials.FakeCredentials._credentials_from_keychain): Assert this
is never called.
(test_do_not_use_stored_credentials.FakeCredentials._credentials_from_environment): Ditto
(test_do_not_use_stored_credentials.FakeCredentials._offer_to_store_credentials_in_keyring): Ditto
(test_do_not_use_stored_credentials.FakeUser): Mock the User class
(test_do_not_use_stored_credentials.FakeUser.prompt): Returns a username to assert against.
(test_do_not_use_stored_credentials.FakeUser.prompt_password): Returns a password to assert
against.

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

5 years agoWeb Inspector: REGRESSION (r186218) ScriptTimelineRecord attempts to access null...
commit-queue@webkit.org [Fri, 17 Jul 2015 03:59:22 +0000 (03:59 +0000)]
Web Inspector: REGRESSION (r186218) ScriptTimelineRecord attempts to access null property
https://bugs.webkit.org/show_bug.cgi?id=147025

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

The issue here was two ScriptTimelineRecord's were created for the same
profile payload. When the first ScriptTimelineRecord processed the
payload to create a Profile we modified the payload, then when the
second ScriptTimelineRecord tries to process the payload the data is
in an unexpected state and it crashes.

The solution here is to stash the result on the payload, so when the
payload is shared we can just immediately jump to the resulting Profile.
The longer term solution will be to share higher level objects and not
attempt to process the payload multiple times. That is tracked by:
<https://webkit.org/b/147029> Web Inspector: Better share objects generated from timeline events (Records)

* UserInterface/Models/ScriptTimelineRecord.js:
(WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload):
When processing the profile payload, store the Profile on the payload
so if another ScriptTimelineRecord has that payload they can avoid
re-processing it.

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

5 years agoWeb Inspector: Total Size of Resources number in dashboard is wrong (does not update...
commit-queue@webkit.org [Fri, 17 Jul 2015 03:55:20 +0000 (03:55 +0000)]
Web Inspector: Total Size of Resources number in dashboard is wrong (does not update during load)
https://bugs.webkit.org/show_bug.cgi?id=147027

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

* UserInterface/Models/DefaultDashboard.js:
(WebInspector.DefaultDashboard.prototype._resourceSizeDidChange):
Restore implementation of callback from r183328 to update total resource
size as resources are downloaded.

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

5 years ago[Mac] Web Inspector toolbar can be covered by the Safari tab bar when docked to the...
mattbaker@apple.com [Fri, 17 Jul 2015 03:55:17 +0000 (03:55 +0000)]
[Mac] Web Inspector toolbar can be covered by the Safari tab bar when docked to the right
https://bugs.webkit.org/show_bug.cgi?id=146994

Reviewed by Timothy Hatcher.

WebInspectorProxy contained logic which ignored the next frame change notification from the inspected view,
whenever it updated the frames of both the Inspector view and inspected view. This patch removes that logic,
as it prevented the Inspector's frame from being adjusted after changes to the browser's top content inset.

* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter ignoreNextInspectedViewFrameDidChange]): Deleted.
(-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]): Deleted.
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Deleted.

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

5 years agoUnreviewed, fix build for newer LLVMs.
fpizlo@apple.com [Fri, 17 Jul 2015 03:33:19 +0000 (03:33 +0000)]
Unreviewed, fix build for newer LLVMs.

* llvm/LLVMHeaders.h:
* llvm/library/LLVMExports.cpp:

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

5 years agoUnreviewed, remove my redundant email information.
gyuyoung.kim@webkit.org [Fri, 17 Jul 2015 02:56:23 +0000 (02:56 +0000)]
Unreviewed, remove my redundant email information.

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

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

5 years agoUnreviewed. Add Hyungwook Lee as a committer.
hyungwook.lee@navercorp.com [Fri, 17 Jul 2015 02:45:17 +0000 (02:45 +0000)]
Unreviewed. Add Hyungwook Lee as a committer.

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

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

5 years agoRegExp::match() should set m_state to ByteCode if compilation fails.
mark.lam@apple.com [Fri, 17 Jul 2015 02:27:22 +0000 (02:27 +0000)]
RegExp::match() should set m_state to ByteCode if compilation fails.
https://bugs.webkit.org/show_bug.cgi?id=147023

Reviewed by Michael Saboff.

A RegExp has a YarrCodeBlock that has 4 MacroAssemblerCodeRefs for compiled code.
If one of these compilations succeeds, RegExp::m_state will be set to JITCode.
Subsequently, if RegExp tries to compile another one of these but fails, m_state
will be left untouched i.e. it still says JITCode.  As a result, when
RegExp::match() later tries to execute the non-existant compiled code, it will
crash.

The fix is to downgrade m_state to ByteCode if RegExp ever fails to compile.
This failure should be rare.  We'll do the minimal work here to fix the issue and
keep an eye on the perf bots.  If perf regresses, we can do some optimization work then.

This issue is difficult to test for since it either requires a low memory condition
to trigger a failed RegExp compilation at the right moment, or for the RegExp to
succeed compilation in the MatchedOnly mode but fail in IncludeSubpatterns mode.
Instead, I manually tested it by instrumenting RegExp::compile() to fail once in every
10 compilation attempts.

* runtime/RegExp.cpp:
(JSC::RegExp::compile):
(JSC::RegExp::compileMatchOnly):

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

5 years agoWeb Inspector: [Mac] Save dialog not working when inspector is docked
commit-queue@webkit.org [Fri, 17 Jul 2015 00:29:03 +0000 (00:29 +0000)]
Web Inspector: [Mac] Save dialog not working when inspector is docked
https://bugs.webkit.org/show_bug.cgi?id=146991

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-07-16
Reviewed by Sam Weinig.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::save):
(-[WebInspectorWindowController webView:runOpenPanelForFileButtonWithResultListener:allowMultipleFiles:]):
When the window is nil (docked) use a non-window version of running the dialog.

Source/WebKit2:

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::runOpenPanel):
(WebKit::WebInspectorProxy::platformSave):
When the window is nil (docked) use a non-window version of running the dialog.

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

5 years agoMedia Session: handle 'Transient' and 'Transient Solo' interruption events https...
mrajca@apple.com [Thu, 16 Jul 2015 23:36:13 +0000 (23:36 +0000)]
Media Session: handle 'Transient' and 'Transient Solo' interruption events https://bugs.webkit.org/show_bug.cgi?id=146840

Reviewed by Eric Carlson.

* Modules/mediasession/MediaSession.cpp:
(WebCore::MediaSession::handleDuckInterruption): Added stub.
(WebCore::MediaSession::handleUnduckInterruption): Added stub.
(WebCore::MediaSession::handlePauseInterruption): Pause active media elements. We use our helper method to do this
  "safely" since pausing a media element can change the collection we're iterating.
(WebCore::MediaSession::handleUnpauseInterruption): Unpause active media elements. We use our helper method to do this
  "safely" since unpausing a media element can change the collection we're iterating.
(WebCore::MediaSession::togglePlayback): Factored out "safe" iteration into a helper method elsewhere.
(WebCore::MediaSession::safelyIterateActiveMediaElements): Safely iterate through the collection of active media
  elements.
* Modules/mediasession/MediaSession.h:
* Modules/mediasession/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::MediaSessionManager): On Mac, register for platform-specific interruptions.
(WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification): Implemented section 4.5.2 of Media Session spec.
(WebCore::MediaSessionManager::didReceiveEndOfInterruptionNotification): Ditto.
* Modules/mediasession/MediaSessionManager.h:

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

5 years agoMedia Session: add support for platform-specific interruption providers
mrajca@apple.com [Thu, 16 Jul 2015 23:22:36 +0000 (23:22 +0000)]
Media Session: add support for platform-specific interruption providers
https://bugs.webkit.org/show_bug.cgi?id=147008

Reviewed by Eric Carlson.

* WebCore.xcodeproj/project.pbxproj: Include new source files.
* platform/mediasession/MediaSessionInterruptionProvider.cpp: Added base class to be used by MediaSessionManager
  to listen for interruption notifications.
(WebCore::MediaSessionInterruptionProvider::MediaSessionInterruptionProvider): Begin listening for interruptions
  upon construction.
(WebCore::MediaSessionInterruptionProvider::~MediaSessionInterruptionProvider): Stop listening for interruptions
  before destruction.
(WebCore::MediaSessionInterruptionProvider::beginListeningForInterruptions): To be overridden by subclasses.
(WebCore::MediaSessionInterruptionProvider::stopListeningForInterruptions): To be overridden by subclasses.
* platform/mediasession/MediaSessionInterruptionProvider.h: Added.
(WebCore::MediaSessionInterruptionProviderClient::~MediaSessionInterruptionProviderClient):
(WebCore::MediaSessionInterruptionProvider::client):
* platform/mediasession/mac/MediaSessionInterruptionProviderMac.h: Added for providing Mac-specific interruptions.
(WebCore::MediaSessionInterruptionProviderMac::~MediaSessionInterruptionProviderMac):
* platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm: Added stubs.
(WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
(WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):

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

5 years agoAdd shrink-wrapped link highlights
timothy_horton@apple.com [Thu, 16 Jul 2015 23:14:34 +0000 (23:14 +0000)]
Add shrink-wrapped link highlights
https://bugs.webkit.org/show_bug.cgi?id=147021
<rdar://problem/21643094>

Reviewed by Enrica Casucci.

* Shared/InteractionInformationAtPosition.cpp:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
* Shared/InteractionInformationAtPosition.h:
Add a TextIndicator to InteractionInformationAtPosition.
Make use of some new C++ features.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
(-[WKContentView didDismissPreviewViewController:committing:]):
Make use of the TextIndicator (if we have one) to show a shrink-wrapped
snapshot of the link.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
Build a TextIndicator for the link if possible.

* WebCore.xcodeproj/project.pbxproj:
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
(WebCore::TextIndicator::createWithSelectionInFrame):
* page/TextIndicator.h:
Add a margin parameter to TextIndicator; this inflates each text rect
by the given amount.

Use snapshotFrameRect instead of snapshotSelection because we really
want an image that exactly fits textBoundingRectInDocumentCoordinates,
and snapshotSelection comes up with selection rects in different ways,
especially on iOS (where it comes up with nothing!).

For now, avoid forcing black text or painting only the selection on iOS.
Eventually, we should have TextIndicator options for these things that
are then respected at the presentation layer.

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

5 years agoAdded myself to the list of contributors.
wenson_hsieh@apple.com [Thu, 16 Jul 2015 22:57:47 +0000 (22:57 +0000)]
Added myself to the list of contributors.

Reviewed by Brent Fulgham.

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

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

5 years agoMedia Session: remove plumbing for delivering start/end-of-interruption events
mrajca@apple.com [Thu, 16 Jul 2015 22:27:30 +0000 (22:27 +0000)]
Media Session: remove plumbing for delivering start/end-of-interruption events
https://bugs.webkit.org/show_bug.cgi?id=147005

Reviewed by Eric Carlson.

Instead of receiving interruptions through WebKit, we will provide platform-specific implementations in WebCore
so the same behavior is available to all clients.

WebCore:
* Modules/mediasession/MediaSessionEvents.h:
* page/Page.cpp:
* page/Page.h:

WebKit:
* UIProcess/API/C/WKPage.cpp:
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

5 years ago[Content Extensions] Cache domain actions
achristensen@apple.com [Thu, 16 Jul 2015 22:08:19 +0000 (22:08 +0000)]
[Content Extensions] Cache domain actions
https://bugs.webkit.org/show_bug.cgi?id=146817

Reviewed by Benjamin Poulain.

Source/WebCore:

Right now we run regular expressions on the domain every time we have any rules that match with if-domain or unless-domain.
This caches the results of running regular expressions on the domain of the main document's url so we only need to
run those regular expressions when the main document changes domain.  We also spend less time adding unused actions into HashSets.

All behavior is covered by existing api tests, but I added some to explicitly test if-domain and unless-domain with multiple load types.

* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
(WebCore::ContentExtensions::ContentExtension::cachedDomainActions):
* contentextensions/ContentExtension.h:
(WebCore::ContentExtensions::ContentExtension::identifier):
(WebCore::ContentExtensions::ContentExtension::compiledExtension):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::getJumpDistance):
(WebCore::ContentExtensions::matchesDomain):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
(WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithDomains):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
* contentextensions/DFABytecodeInterpreter.h:

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::TEST_F):
Test if-domain and unless-domain with multiple load types.

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

5 years agoFix disappearing position:fixed elements in fixed layout mode
simon.fraser@apple.com [Thu, 16 Jul 2015 21:54:06 +0000 (21:54 +0000)]
Fix disappearing position:fixed elements in fixed layout mode
https://bugs.webkit.org/show_bug.cgi?id=147019

Reviewed by Tim Horton.
Source/WebCore:

Test: compositing/fixed-with-fixed-layout.html

When in fixed layout mode, and being scaled down, viewportConstrainedVisibleContentRect() is
the wrong thing to use to determine if position:fixed elements are clipped out. In this case,
use the simpler document bounds (before scaling).

In the long term,  there needs to be an equivalent of viewportConstrainedVisibleContentRect()
that gives an appropriate rect that can be used here.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):

LayoutTests:

Test with four fixed elements in fixed layout mode.

* compositing/fixed-with-fixed-layout-expected.txt: Added.
* compositing/fixed-with-fixed-layout.html: Added.

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

5 years ago[Content extensions] Combine suffixes when generating NFAs
benjamin@webkit.org [Thu, 16 Jul 2015 21:51:08 +0000 (21:51 +0000)]
[Content extensions] Combine suffixes when generating NFAs
https://bugs.webkit.org/show_bug.cgi?id=146961

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-07-16
Reviewed by Alex Christensen.

Source/WebCore:

In this patch, I add a mechanism very similar to the prefix tree
but for the suffix (called a reverse suffix tree here).

The idea is here is to reuse the existing NFA nodes when generating
a chain of suffix Term that were already generated previously.
When generating a disjunction ending with the same suffix, we now
have the same trailing NFA nodes for both sides of the disjunction.

Mixing the prefix and suffix generation can be tricky, we do not want
transitions from a pattern to creep into the suffix of an other.

To avoid any conflict, the rules here are very simple:
-Only use the reverse suffix tree for terms without actions
 up to a leaf term with actions.

 This rule ensure that no action will accidentally make its way
 to an other rule by resuing a vertex of the reverse suffix tree.

-Only use the reverse suffix tree for chains of terms in which
 each term only has zero or one following term.

 With this condition, when taking any vertex of the reverse suffix
 tree, there is only one edge that move out of that vertex when reading
 from left to right.
 For any vertex, there is only one possible string generated
 left-to-right, a single suffix.

This is overly restrictive but it is fast, easier to verify, and it works
well in practice.
For all the more complicated cases, we can count on the Minimizer to
find a better solution.

With all the simple suffixes merged, our NFAs are smaller, which
let us combine more patterns.
The DFAs are also smaller and faster to produce since their size
is relative to the NFA sizes.

Overall, I get the following gains:
-Chris's test case:
    compile time -40%.
    bytecode size -14%.
-Armand's test case:
    compile time -53%.
    bytecode size -13%.

* WebCore.xcodeproj/project.pbxproj:
* contentextensions/CombinedURLFilters.cpp:
(WebCore::ContentExtensions::ActiveSubtree::ActiveSubtree):
(WebCore::ContentExtensions::generateInfixUnsuitableForReverseSuffixTree):
(WebCore::ContentExtensions::generateSuffixWithReverseSuffixTree):
(WebCore::ContentExtensions::clearReverseSuffixTree):
(WebCore::ContentExtensions::generateNFAForSubtree):
* contentextensions/DFA.cpp:
(WebCore::ContentExtensions::DFA::debugPrintDot):
Forgot to close a tag, dot was not happy.

* contentextensions/HashableActionList.h: Added.
(WebCore::ContentExtensions::HashableActionList::HashableActionList):
(WebCore::ContentExtensions::HashableActionList::isEmptyValue):
(WebCore::ContentExtensions::HashableActionList::isDeletedValue):
(WebCore::ContentExtensions::HashableActionList::operator==):
(WebCore::ContentExtensions::HashableActionList::operator!=):
(WebCore::ContentExtensions::HashableActionListHash::hash):
(WebCore::ContentExtensions::HashableActionListHash::equal):
We need a way to group reverse suffix tree by their terminal actions.
This new hash structure lets us find unique vertex for a list of actions
in any order.

* contentextensions/ImmutableNFANodeBuilder.h:
(WebCore::ContentExtensions::ImmutableNFANodeBuilder::isValid):
(WebCore::ContentExtensions::ImmutableNFANodeBuilder::nodeId):
(WebCore::ContentExtensions::ImmutableNFANodeBuilder::addTransition):
(WebCore::ContentExtensions::ImmutableNFANodeBuilder::addEpsilonTransition):
(WebCore::ContentExtensions::ImmutableNFANodeBuilder::ImmutableNFANodeBuilder): Deleted.
(WebCore::ContentExtensions::ImmutableNFANodeBuilder::~ImmutableNFANodeBuilder): Deleted.
(WebCore::ContentExtensions::ImmutableNFANodeBuilder::operator=): Deleted.
* contentextensions/Term.h:
(WebCore::ContentExtensions::Term::generateGraph):
(WebCore::ContentExtensions::Term::generateSubgraphForAtom):
Node building changes a bit.

Previously, it was assumed nodes are always built from left to right.
Getting the node on the right was done by providing the left node and the term
doing the transition.

Now we have both left to right and right to left generation.

The right-to-left has a specific property: no edge can be added after
it's initial term (rule 2 of our reverse suffix tree). This simplifies
things a bit since we can finalize all the nodes in the suffix tree.
All we need is to keep their ID to be able to link new nodes
to the reverse suffix tree.

Source/WTF:

* wtf/Vector.h:
(WTF::minCapacity>::Vector):
(WTF::=):
Copying a vector with a different inline capacity was broken due to
the addition of MinimumCapacity.

This feature was needed by this patch so I fixed WTF.

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::compareContents):
* TestWebKitAPI/Tests/WebCore/DFAMinimizer.cpp:

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

5 years ago[iOS] Expose contentsSizeRespectingOverflow() via WebView so UIWebView can use it
simon.fraser@apple.com [Thu, 16 Jul 2015 21:50:50 +0000 (21:50 +0000)]
[iOS] Expose contentsSizeRespectingOverflow() via WebView so UIWebView can use it
https://bugs.webkit.org/show_bug.cgi?id=146924
WebKit part of rdar://problem/21802456

Reviewed by Tim Horton.

Expose the FrameView's contentsSizeRespectingOverflow() via WebView, for use
by UIKit.

* WebView/WebView.mm:
(-[WebView _contentsSizeRespectingOverflow]):
* WebView/WebViewPrivate.h:

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

5 years ago[GTK] Web Inspector: Further optimize the weight and time icons taken back to the...
agomez@igalia.com [Thu, 16 Jul 2015 21:40:12 +0000 (21:40 +0000)]
[GTK] Web Inspector: Further optimize the weight and time icons taken back to the toolbar dashboard for the GTK+ port
https://bugs.webkit.org/show_bug.cgi?id=147010

SVG images optimized with a combination of sed replacements, the
usage of the scour tool (http://www.codedread.com/scour/) and a
forked version of the svgo tool (https://github.com/tanty/svgo).

Also, added the class attribute to the shape elements following
the convention used in Apple's images.

Reviewed by Martin Robinson.

* UserInterface/Images/gtk/Time.svg: Optimized.
* UserInterface/Images/gtk/Weight.svg: Optimized.

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

5 years agoRolling out part of r186895 until rdar://problem/21861167 is resolved.
beidson@apple.com [Thu, 16 Jul 2015 20:24:29 +0000 (20:24 +0000)]
Rolling out part of r186895 until rdar://problem/21861167 is resolved.
https://bugs.webkit.org/show_bug.cgi?id=146976

* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::createCookies): Don’t use this new SPI quite yet.

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

5 years agoUnreviewed, roll out http://trac.webkit.org/changeset/186903. It broke the build.
fpizlo@apple.com [Thu, 16 Jul 2015 20:19:25 +0000 (20:19 +0000)]
Unreviewed, roll out trac.webkit.org/changeset/186903. It broke the build.

Source/WebCore:

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMWrapperWorld.h:
(WebCore::currentWorld):
(WebCore::worldForDOMObject): Deleted.
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSCustomEventCustom.cpp:
(WebCore::JSCustomEvent::detail): Deleted.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::data):
* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state):
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::initCustomEvent):
(WebCore::CustomEvent::eventInterface):
(WebCore::CustomEvent::trySerializeDetail): Deleted.
* dom/CustomEvent.h:
* dom/CustomEvent.idl:
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::initMessageEvent):
(WebCore::MessageEvent::data):
(WebCore::MessageEvent::trySerializeData): Deleted.
* dom/MessageEvent.h:
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::create):
(WebCore::PopStateEvent::eventInterface):
(WebCore::PopStateEvent::trySerializeState): Deleted.
* dom/PopStateEvent.h:
* testing/Internals.cpp:
(WebCore::Internals::deserializeBuffer):
(WebCore::Internals::setUsesOverlayScrollbars):
(WebCore::Internals::isFromCurrentWorld): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* fast/events/constructors/custom-event-constructor-expected.txt:
* fast/events/constructors/custom-event-constructor.html:
* fast/events/event-leak-objects-expected.txt:
* fast/events/event-leak-objects.html:
* fast/events/event-properties-gc-expected.txt:
* fast/events/event-properties-gc.html:

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

5 years agoRebaseline test for Windows.
timothy_horton@apple.com [Thu, 16 Jul 2015 20:07:09 +0000 (20:07 +0000)]
Rebaseline test for Windows.

* platform/win/fast/shrink-wrap: Added.
* platform/win/fast/shrink-wrap/rect-shrink-wrap-expected.txt: Added.

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

5 years agoREGRESSION(r186464): [SOUP] ASSERTION FAILED: !m_messageReceiverMapCount when closing...
mcatanzaro@igalia.com [Thu, 16 Jul 2015 20:06:43 +0000 (20:06 +0000)]
REGRESSION(r186464): [SOUP] ASSERTION FAILED: !m_messageReceiverMapCount when closing any tab
https://bugs.webkit.org/show_bug.cgi?id=147006

Reviewed by Anders Carlsson.

Remove the message receiver before it is deallocated.

* UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
(WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):

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

5 years agoRemove leak of objects between isolated worlds on custom events, message events,...
fpizlo@apple.com [Thu, 16 Jul 2015 19:30:46 +0000 (19:30 +0000)]
Remove leak of objects between isolated worlds on custom events, message events, and pop state events.
https://bugs.webkit.org/show_bug.cgi?id=118884

Patch by Keith Miller <keith_miller@apple.com> on 2015-07-16
Reviewed by Filip Pizlo.

Source/WebCore:

Tests: fast/events/event-leak-objects.html
       fast/events/event-properties-gc.html

Fixes an issue where objects passed as certain properties of events could cross isolated worlds. This
was fixed by checking that any object passed by an event must be serializable or originate from the same
isolated world as the one it is currently being accessed in. In the case of MessageEvents and PopStateEvents we
cache the values of the data and state properties, respectively, as they may be a deserialized object. In case
an object was deserialized in a world with elevated privileges we also check the cached value is from the same
world, if it is from a different world we recompute it. For testing purposes, I added a new function to Internals
that determines whether a JSObject originated in the current world.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMWrapperWorld.h:
(WebCore::worldForDOMObject):
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSCustomEventCustom.cpp: Copied from Source/WebCore/dom/CustomEvent.cpp.
(WebCore::JSCustomEvent::detail):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::data):
* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state):
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::initCustomEvent):
(WebCore::CustomEvent::trySerializeDetail):
* dom/CustomEvent.h:
* dom/CustomEvent.idl:
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::initMessageEvent):
(WebCore::MessageEvent::trySerializeData):
* dom/MessageEvent.h:
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::trySerializeState):
* dom/PopStateEvent.h:
* testing/Internals.cpp:
(WebCore::Internals::isFromCurrentWorld):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

These tests ensure ensure objects are not leaked across isolated worlds and that those properties are not prematurely
garbage collected.

* fast/events/constructors/custom-event-constructor-expected.txt:
* fast/events/constructors/custom-event-constructor.html:
* fast/events/event-leak-objects-expected.txt: Added.
* fast/events/event-leak-objects.html: Added.
* fast/events/event-properties-gc-expected.txt: Added.
* fast/events/event-properties-gc.html: Added.

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

5 years ago[GTK] Web Inspector: Add new Network icon for the GTK+ port
agomez@igalia.com [Thu, 16 Jul 2015 18:31:21 +0000 (18:31 +0000)]
[GTK] Web Inspector: Add new Network icon for the GTK+ port
https://bugs.webkit.org/show_bug.cgi?id=147002

Reviewed by Martin Robinson.

* UserInterface/Images/gtk/Network.svg: Added.
Icon for the new Network tab.

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

5 years agoMark fast/canvas/canvas-too-large-to-draw.html as crashing on El Capitan
ddkilzer@apple.com [Thu, 16 Jul 2015 18:23:26 +0000 (18:23 +0000)]
Mark fast/canvas/canvas-too-large-to-draw.html as crashing on El Capitan

Fix is tracked by <rdar://problem/21857102>.

* platform/mac/TestExpectations: Mark test as crashing:
- fast/canvas/canvas-too-large-to-draw.html

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

5 years ago[Win] Unreviewed gardening.
bfulgham@apple.com [Thu, 16 Jul 2015 17:52:05 +0000 (17:52 +0000)]
[Win] Unreviewed gardening.

* WebKit.vcxproj/WebKit/WebKit.vcxproj.filters: Move file into the
appropriate category in the project.

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

5 years ago[Win] Gross workaround to fix build after r186858.
bfulgham@apple.com [Thu, 16 Jul 2015 17:42:05 +0000 (17:42 +0000)]
[Win] Gross workaround to fix build after r186858.

* WebView.cpp:
(WebView::unused5): Force export of WebCore symbol through
WebKit.dll.

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

5 years agoReview feedback followup for:
beidson@apple.com [Thu, 16 Jul 2015 17:39:05 +0000 (17:39 +0000)]
Review feedback followup for:
REGRESSION(r186088): Crash under WebKit::WebPageProxy::didFailLoadForFrame
<rdar://problem/21692212> and https://bugs.webkit.org/show_bug.cgi?id=146988

* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::refView): CFRetain instead of Obj-C retain.
(WebKit::PageClientImpl::derefView): CFRelease instead of Obj-C release.

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

5 years ago[GTK] Web Inspector: Add new composite record icon for the GTK+ port
agomez@igalia.com [Thu, 16 Jul 2015 17:26:55 +0000 (17:26 +0000)]
[GTK] Web Inspector: Add new composite record icon for the GTK+ port
https://bugs.webkit.org/show_bug.cgi?id=146998

Reviewed by Martin Robinson.

* UserInterface/Images/gtk/TimelineRecordComposite.svg: Added.
New composite record icon.

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

5 years agoWebKit document.cookie mis-parsing.
beidson@apple.com [Thu, 16 Jul 2015 17:25:07 +0000 (17:25 +0000)]
WebKit document.cookie mis-parsing.
rdar://problem/21715050 and https://bugs.webkit.org/show_bug.cgi?id=146976

Reviewed by Sam Weinig.

* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::createCookies): Use new SPI if available.
(WebCore::setCookiesFromDOM):
* platform/spi/cf/CFNetworkSPI.h:

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

5 years agoHeaders that use WEBCORE_EXPORT should include PlatformExportMacros.h
andersca@apple.com [Thu, 16 Jul 2015 17:21:40 +0000 (17:21 +0000)]
Headers that use WEBCORE_EXPORT should include PlatformExportMacros.h
https://bugs.webkit.org/show_bug.cgi?id=146984

Reviewed by Daniel Bates.

* contentextensions/DFA.h:
* dom/ContextDestructionObserver.h:
* dom/DeviceOrientationData.h:
* dom/ExceptionCodePlaceholder.h:
* editing/cocoa/HTMLConverter.h:
* html/track/AudioTrack.h:
* loader/FrameLoaderStateMachine.h:
* loader/appcache/ApplicationCacheHost.h:
* loader/cache/CachedResourceHandle.h:
* platform/URL.h:
* platform/animation/Animation.h:
* platform/audio/AudioHardwareListener.h:
* platform/audio/AudioSession.h:
* platform/graphics/transforms/AffineTransform.h:
* platform/network/Credential.h:
* platform/network/CredentialBase.h:
* platform/network/ResourceHandleClient.h:
* platform/network/mac/AuthenticationMac.h:

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

5 years ago[Linux] Seccomp: fix -Wmismatched-tags
mcatanzaro@igalia.com [Thu, 16 Jul 2015 15:34:03 +0000 (15:34 +0000)]
[Linux] Seccomp: fix -Wmismatched-tags
https://bugs.webkit.org/show_bug.cgi?id=146990

Reviewed by Žan Doberšek.

WebProcessCreationParameters is a struct nowadays, not a class, so declare it appropriately.

* Shared/linux/SeccompFilters/SyscallPolicy.h:

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

5 years agoREGRESSION(r185415): [GTK] Browsers crash when an input method is enabled
carlosgc@webkit.org [Thu, 16 Jul 2015 10:29:51 +0000 (10:29 +0000)]
REGRESSION(r185415): [GTK] Browsers crash when an input method is enabled
https://bugs.webkit.org/show_bug.cgi?id=146639

Reviewed by Žan Doberšek.

In r185415 I assumed that preedit signals were always emitted
after a keypress was handled by the WebView. However, some input
methods handle the keyboard events before the WebView, and preedit
signals are emitted but no key event has been handled by the
WebView. So, instead of asserting when filter key event completion
handler is nullptr, we should check whether the current event was
generated for a WebView filter request or not. In case the
completion handler is nullptr, we send the event directly to the
page, instead of going through the WebView, since there won't be
editing commands for those events anyway.

* UIProcess/gtk/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::handleKeyboardEvent):
(WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):

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

5 years agoWeb Inspector: update $$() to return an Array
commit-queue@webkit.org [Thu, 16 Jul 2015 08:57:12 +0000 (08:57 +0000)]
Web Inspector: update $$() to return an Array
https://bugs.webkit.org/show_bug.cgi?id=146964

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

Source/WebCore:

Test: inspector/console/command-line-api.html

* inspector/CommandLineAPIModuleSource.js:
Update $$(...) to return an array.
Also InjectedScriptHost.type was renamed to subtype
a while ago.

LayoutTests:

* inspector/console/command-line-api-expected.txt: Added.
* inspector/console/command-line-api.html: Added.
Add back a command line api test.

* platform/efl/inspector/console/command-line-api-expected.txt: Removed.
* platform/mac/inspector/console/command-line-api-expected.txt: Removed.
Remove old platform expected results for the old version of this test.

* platform/win/TestExpectations:
Speculatively skipping on Windows since other inspector/console tests are skipped.

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

5 years agoMove indicator rect uniting code to TextIndicatorWindow instead of TextIndicator
timothy_horton@apple.com [Thu, 16 Jul 2015 06:36:53 +0000 (06:36 +0000)]
Move indicator rect uniting code to TextIndicatorWindow instead of TextIndicator
https://bugs.webkit.org/show_bug.cgi?id=146992
<rdar://problem/21643094>

Reviewed by Daniel Bates.

Having to unite all the rects if any overlap is an implementation
detail of the Mac TextIndicatorWindow presentation, not a fundamental
property of TextIndicator.

Other TextIndicator presentations might be able to handle overlapping
rects more effectively, so we shouldn't lose information unless we need to.

This also avoids having a second copy of some constants!

* page/TextIndicator.cpp:
(WebCore::outsetIndicatorRectIncludingShadow): Deleted.
(WebCore::textIndicatorsForTextRectsOverlap): Deleted.
(WebCore::TextIndicator::TextIndicator): Deleted.
* page/mac/TextIndicatorWindow.mm:
(outsetIndicatorRectIncludingShadow):
(textIndicatorsForTextRectsOverlap):
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):

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

5 years agoUnreviewed. Follow up to r186887 for GTK+.
carlosgc@webkit.org [Thu, 16 Jul 2015 06:04:48 +0000 (06:04 +0000)]
Unreviewed. Follow up to r186887 for GTK+.

Add GTK+ implementation of PageClientImpl::refView/derefView.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::refView):
(WebKit::PageClientImpl::derefView):
* UIProcess/API/gtk/PageClientImpl.h:

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

5 years ago[GTK] Input method filter is always enabled when the view is focused
carlosgc@webkit.org [Thu, 16 Jul 2015 05:31:55 +0000 (05:31 +0000)]
[GTK] Input method filter is always enabled when the view is focused
https://bugs.webkit.org/show_bug.cgi?id=146965

Reviewed by Martin Robinson.

Source/WebKit2:

It should only be enabled when the view is focused and there's an
editable element focused. In r138544, when input methods were
implemented, the message SetInputMethodState was added, but it was
never used. Instead, the notifyFocusIn method of the IM filter
enables the input method unconditionally. We should actually use
the SetInputMethodState message to enable/disable input methods
when editable elements are focused/unfocused.

* UIProcess/gtk/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::setEnabled): Call notifyFocusedIn/Out
when inputs methods are enabled/disabled instead of notifying the
IM context directly.
(WebKit::InputMethodFilter::setCursorRect): Do not update the
cursor position if input methods are didabled.
(WebKit::InputMethodFilter::notifyFocusedIn): Do nothing when
input methods are disabled. Do not enable input methods
uncontionally here.
(WebKit::InputMethodFilter::notifyFocusedOut): Do not disable
input methods uncontionally here.
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::setInputMethodState): Call
WebPage::setInputMethodState() for GTK platform.
* WebProcess/WebPage/WebPage.h: Add setInputMethodState() for GTK platform.
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::setInputMethodState): Update input method state
and send SetInputMethodState message to the UI process if state changed.

Tools:

Use setEnabled() instead of notifyFocusedIn() to enable input methods.

* TestWebKitAPI/Tests/WebKit2/gtk/InputMethodFilter.cpp:
(TestWebKitAPI::TestInputMethodFilter::TestInputMethodFilter):

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

5 years agoREGRESSION(r186088): Crash under WebKit::WebPageProxy::didFailLoadForFrame
beidson@apple.com [Thu, 16 Jul 2015 04:03:11 +0000 (04:03 +0000)]
REGRESSION(r186088): Crash under WebKit::WebPageProxy::didFailLoadForFrame
<rdar://problem/21692212> and https://bugs.webkit.org/show_bug.cgi?id=146988

Reviewed by Sam Weinig.

When a loader delegate callback results in the WKView getting deallocated, then the PageClient
is also destroyed.

WebPageProxy then (often) turns around and uses the PageClient anyways.

Tried to write a TestWebKitAPI test for this, but only didFailLoadForFrame appears to obviously
be vulnerable, and there seems to be no way to reproduce that failure case under TestWebKitAPI.

* UIProcess/PageClient.h: Add ref/derefView.

* UIProcess/API/gtk/PageClientImpl.h: Stub them out.
    * UIProcess/efl/WebViewEfl.h: Stub them out.

* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::refView): [m_wkView retain]
(WebKit::PageClientImpl::derefView): [m_wkView release]

* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::refView): Retain all 3 views.
(WebKit::PageClientImpl::derefView): Release all 3 views.

* UIProcess/WebPageProxy.cpp:
(WebKit::PageClientProtector::PageClientProtector): Calls refView() on the PageClient.
(WebKit::PageClientProtector::~PageClientProtector): Calls derefView() on the PageClient.
(WebKit::WebPageProxy::didChangeBackForwardList): All methods that make m_loaderClient or
  m_pageClient callouts get a protector at their head.
(WebKit::WebPageProxy::willGoToBackForwardListItem):
(WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
(WebKit::WebPageProxy::findPlugin):
(WebKit::WebPageProxy::didCreateMainFrame):
(WebKit::WebPageProxy::didCreateSubframe):
(WebKit::WebPageProxy::didStartProgress):
(WebKit::WebPageProxy::didChangeProgress):
(WebKit::WebPageProxy::didFinishProgress):
(WebKit::WebPageProxy::didDestroyNavigation):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::didReceiveTitleForFrame):
(WebKit::WebPageProxy::didFirstLayoutForFrame):
(WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
(WebKit::WebPageProxy::didLayoutForCustomContentProvider):
(WebKit::WebPageProxy::didLayout):
(WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
(WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
(WebKit::WebPageProxy::didRunInsecureContentForFrame):
(WebKit::WebPageProxy::didDetectXSSForFrame):
(WebKit::WebPageProxy::frameDidBecomeFrameSet):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::decidePolicyForResponseSync):
(WebKit::WebPageProxy::unableToImplementPolicy):
(WebKit::WebPageProxy::didNavigateWithNavigationData):
(WebKit::WebPageProxy::didPerformClientRedirect):
(WebKit::WebPageProxy::didPerformServerRedirect):
(WebKit::WebPageProxy::didUpdateHistoryTitle):
(WebKit::WebPageProxy::wrapCryptoKey):
(WebKit::WebPageProxy::unwrapCryptoKey):
(WebKit::WebPageProxy::navigationGestureDidBegin):
(WebKit::WebPageProxy::navigationGestureWillEnd):
(WebKit::WebPageProxy::navigationGestureDidEnd):
(WebKit::WebPageProxy::willRecordNavigationSnapshot):

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

5 years ago[EFL] Bump libseccomp version to 2.2.3
mcatanzaro@igalia.com [Thu, 16 Jul 2015 02:42:51 +0000 (02:42 +0000)]
[EFL] Bump libseccomp version to 2.2.3
https://bugs.webkit.org/show_bug.cgi?id=146980

Reviewed by Gyuyoung Kim.

* efl/jhbuild.modules:

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