WebKit-https.git
4 years agoUnreviewed, fix cloop some more.
fpizlo@apple.com [Tue, 5 Apr 2016 22:57:26 +0000 (22:57 +0000)]
Unreviewed, fix cloop some more.

* runtime/RegExpInlines.h:
(JSC::RegExp::hasCodeFor):
(JSC::RegExp::hasMatchOnlyCodeFor):

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

4 years agoUnreviewed, fix cloop.
fpizlo@apple.com [Tue, 5 Apr 2016 22:55:55 +0000 (22:55 +0000)]
Unreviewed, fix cloop.

* jit/CCallHelpers.cpp:

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

4 years agoModern IDB: Get blob URLs/files all the way to the IDB backing store.
beidson@apple.com [Tue, 5 Apr 2016 22:55:33 +0000 (22:55 +0000)]
Modern IDB: Get blob URLs/files all the way to the IDB backing store.
https://bugs.webkit.org/show_bug.cgi?id=156248

Reviewed by Alex Christensen.

No new tests (No change in behavior).

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):

* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):
(WebCore::IDBValue::isolatedCopy):
* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::blobURLs):
(WebCore::IDBValue::blobFilePaths):
(WebCore::IDBValue::encode):
(WebCore::IDBValue::decode):

* Modules/indexeddb/server/IDBBackingStore.h:

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):

* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):

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

4 years agoWeb Inspector: Should not allow selecting no Timelines when editing in Timeline tab
mattbaker@apple.com [Tue, 5 Apr 2016 22:32:03 +0000 (22:32 +0000)]
Web Inspector: Should not allow selecting no Timelines when editing in Timeline tab
https://bugs.webkit.org/show_bug.cgi?id=156223
<rdar://problem/25552221>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview):
(WebInspector.TimelineOverview.prototype._startEditingInstruments):
Register EnabledDidChange event handler for all tree elements.

(WebInspector.TimelineOverview.prototype._stopEditingInstruments):
Unregister event handler for enabled tree elements. The rest are removed
from the tree outline once editing has completed.

(WebInspector.TimelineOverview.prototype._timelineTreeElementEnabledDidChange):
Enable "Done" button if at least one timeline is enabled.

* UserInterface/Views/TimelineTreeElement.js:
Dispatch a new event, EnabledDidChange, when the checkbox state changes.

(WebInspector.TimelineTreeElement.prototype._showCheckbox):
(WebInspector.TimelineTreeElement.prototype._clickHandler):
(WebInspector.TimelineTreeElement.prototype._dispatchEnabledDidChangeEvent):
(WebInspector.TimelineTreeElement):

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

4 years agoJSC should use a shadow stack version of CHICKEN so that debuggers have the option...
fpizlo@apple.com [Tue, 5 Apr 2016 22:17:35 +0000 (22:17 +0000)]
JSC should use a shadow stack version of CHICKEN so that debuggers have the option of retrieving tail-deleted frames
https://bugs.webkit.org/show_bug.cgi?id=155598

Reviewed by Saam Barati.
PerformanceTests/SunSpider:

* shadow-chicken.yaml: Added.

Source/JavaScriptCore:

JSC is the first JSVM to have proper tail calls. This means that error.stack and the
debugger will appear to "delete" strict mode stack frames, if the call that this frame made
was in tail position. This is exactly what functional programmers expect - they don't want
the VM to waste resources on tail-deleted frames to ensure that it's legal to loop forever
using tail calls. It's also something that non-functional programmers fear. It's not clear
that tail-deleted frames would actually degrade the debugging experience, but the fear is
real, so it's worthwhile to do something about it.

It turns out that there is at least one tail call implementation that doesn't suffer from
this problem. It implements proper tail calls in the sense that you won't run out of memory
by tail-looping. It also has the power to show you tail-deleted frames in a backtrace, so
long as you haven't yet run out of memory. It's called CHICKEN Scheme, and it's one of my
favorite hacks:

http://www.more-magic.net/posts/internals-gc.html

CHICKEN does many awesome things. The intuition from CHICKEN that we use here is a simple
one: what if a tail call still kept the tail-deleted frame, and the GC actually deleted that
frame only once we proved that there was insufficient memory to keep it around.

CHICKEN does this by reshaping the C stack with longjmp/setjmp. We can't do that because we
can have arbitrary native code, and that native code does not have relocatable stack frames.

But we can do something almost like CHICKEN on a shadow stack. It's a common trick to have a
VM maintain two stacks - the actual execution stack plus a shadow stack that has some extra
information. The shadow stack can be reshaped, moved, etc, since the VM tightly controls its
layout. The main stack can then continue to obey ABI rules.

This patch implements a mechanism for being able to display stack traces that include
tail-deleted frames. It uses a shadow stack that behaves like a CHICKEN stack: it has all
frames all the time, though we will collect the tail-deleted ones if the stack gets too big.
This new mechanism is called ShadowChicken, obviously: it's CHICKEN on a shadow stack.

ShadowChicken is always on, but individual CodeBlocks may make their own choices about
whether to opt into it. They will do that at bytecompile time based on the debugger mode on
their global object.

When no CodeBlock opts in, there is no overhead, since ShadowChicken ends up doing nothing
in that case. Well, except when exceptions are thrown. Then it might do some work, but it's
minor.

When all CodeBlocks opt in, there is about 6% overhead. That's too much overhead to enable
this all the time, but it's low enough to justify enabling in the Inspector. It's currently
enabled on all CodeBlocks only when you use an Option. Otherwise it will auto-enable if the
debugger is on.

Note that ShadowChicken attempts to gracefully handle the presence of stack frames that have
no logging. This is essential since we *can* have debugging enabled in one GlobalObject and
disabled in another. Also, some frames don't do ShadowChicken because they just haven't been
hacked to do it yet. Native frames fall into this category, as do the VM entry frames.

This doesn't yet wire ShadowChicken into DebuggerCallFrame. That will take more work. It
just makes a ShadowChicken stack walk function available to jsc. It's used from the
shadow-chicken tests.

* API/JSContextRef.cpp:
(BacktraceFunctor::BacktraceFunctor):
(BacktraceFunctor::operator()):
(JSContextCreateBacktrace):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::RecursionCheckFunctor::RecursionCheckFunctor):
(JSC::RecursionCheckFunctor::operator()):
(JSC::CodeBlock::noticeIncomingCall):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitEnter):
(JSC::BytecodeGenerator::emitCallInTailPosition):
(JSC::BytecodeGenerator::emitCallVarargsInTailPosition):
(JSC::BytecodeGenerator::emitCallVarargs):
(JSC::BytecodeGenerator::emitLogShadowChickenPrologueIfNecessary):
(JSC::BytecodeGenerator::emitLogShadowChickenTailIfNecessary):
(JSC::BytecodeGenerator::emitCallDefineProperty):
* bytecompiler/BytecodeGenerator.h:
* debugger/DebuggerCallFrame.cpp:
(JSC::LineAndColumnFunctor::operator()):
(JSC::LineAndColumnFunctor::column):
(JSC::FindCallerMidStackFunctor::FindCallerMidStackFunctor):
(JSC::FindCallerMidStackFunctor::operator()):
(JSC::DebuggerCallFrame::DebuggerCallFrame):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.cpp:
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileSetRegExpObjectLastIndex):
(JSC::FTL::DFG::LowerDFGToB3::compileLogShadowChickenPrologue):
(JSC::FTL::DFG::LowerDFGToB3::compileLogShadowChickenTail):
(JSC::FTL::DFG::LowerDFGToB3::didOverflowStack):
(JSC::FTL::DFG::LowerDFGToB3::allocateJSArray):
(JSC::FTL::DFG::LowerDFGToB3::setupShadowChickenPacket):
(JSC::FTL::DFG::LowerDFGToB3::boolify):
* heap/Heap.cpp:
(JSC::Heap::markRoots):
(JSC::Heap::visitSamplingProfiler):
(JSC::Heap::visitShadowChicken):
(JSC::Heap::traceCodeBlocksAndJITStubRoutines):
(JSC::Heap::collectImpl):
* heap/Heap.h:
* inspector/ScriptCallStackFactory.cpp:
(Inspector::CreateScriptCallStackFunctor::CreateScriptCallStackFunctor):
(Inspector::CreateScriptCallStackFunctor::operator()):
(Inspector::createScriptCallStack):
* interpreter/CallFrame.h:
(JSC::ExecState::iterate):
* interpreter/Interpreter.cpp:
(JSC::DumpRegisterFunctor::DumpRegisterFunctor):
(JSC::DumpRegisterFunctor::operator()):
(JSC::GetStackTraceFunctor::GetStackTraceFunctor):
(JSC::GetStackTraceFunctor::operator()):
(JSC::Interpreter::getStackTrace):
(JSC::GetCatchHandlerFunctor::handler):
(JSC::GetCatchHandlerFunctor::operator()):
(JSC::notifyDebuggerOfUnwinding):
(JSC::UnwindFunctor::UnwindFunctor):
(JSC::UnwindFunctor::operator()):
(JSC::UnwindFunctor::copyCalleeSavesToVMCalleeSavesBuffer):
* interpreter/ShadowChicken.cpp: Added.
(JSC::ShadowChicken::Packet::dump):
(JSC::ShadowChicken::Frame::dump):
(JSC::ShadowChicken::ShadowChicken):
(JSC::ShadowChicken::~ShadowChicken):
(JSC::ShadowChicken::log):
(JSC::ShadowChicken::update):
(JSC::ShadowChicken::visitChildren):
(JSC::ShadowChicken::reset):
(JSC::ShadowChicken::dump):
(JSC::ShadowChicken::functionsOnStack):
* interpreter/ShadowChicken.h: Added.
(JSC::ShadowChicken::Packet::Packet):
(JSC::ShadowChicken::Packet::tailMarker):
(JSC::ShadowChicken::Packet::throwMarker):
(JSC::ShadowChicken::Packet::prologue):
(JSC::ShadowChicken::Packet::tail):
(JSC::ShadowChicken::Packet::throwPacket):
(JSC::ShadowChicken::Packet::operator bool):
(JSC::ShadowChicken::Packet::isPrologue):
(JSC::ShadowChicken::Packet::isTail):
(JSC::ShadowChicken::Packet::isThrow):
(JSC::ShadowChicken::Frame::Frame):
(JSC::ShadowChicken::Frame::operator==):
(JSC::ShadowChicken::Frame::operator!=):
(JSC::ShadowChicken::log):
(JSC::ShadowChicken::logSize):
(JSC::ShadowChicken::addressOfLogCursor):
(JSC::ShadowChicken::logEnd):
* interpreter/ShadowChickenInlines.h: Added.
(JSC::ShadowChicken::iterate):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::callee):
(JSC::StackVisitor::Frame::codeBlock):
(JSC::StackVisitor::Frame::bytecodeOffset):
(JSC::StackVisitor::Frame::inlineCallFrame):
(JSC::StackVisitor::Frame::isJSFrame):
(JSC::StackVisitor::Frame::isInlinedFrame):
(JSC::StackVisitor::visit):
* jit/CCallHelpers.cpp: Added.
(JSC::CCallHelpers::logShadowChickenProloguePacket):
(JSC::CCallHelpers::logShadowChickenTailPacket):
(JSC::CCallHelpers::setupShadowChickenPacket):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::prepareForTailCallSlow):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_resume):
(JSC::JIT::emit_op_log_shadow_chicken_prologue):
(JSC::JIT::emit_op_log_shadow_chicken_tail):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jsc.cpp:
(GlobalObject::finishCreation):
(FunctionJSCStackFunctor::FunctionJSCStackFunctor):
(FunctionJSCStackFunctor::operator()):
(functionClearSamplingFlags):
(functionShadowChickenFunctionsOnStack):
(functionReadline):
* llint/LLIntOffsetsExtractor.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::llint_throw_stack_overflow_error):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* profiler/ProfileGenerator.cpp:
(JSC::AddParentForConsoleStartFunctor::foundParent):
(JSC::AddParentForConsoleStartFunctor::operator()):
* runtime/Error.cpp:
(JSC::FindFirstCallerFrameWithCodeblockFunctor::FindFirstCallerFrameWithCodeblockFunctor):
(JSC::FindFirstCallerFrameWithCodeblockFunctor::operator()):
(JSC::addErrorInfoAndGetBytecodeOffset):
* runtime/JSFunction.cpp:
(JSC::RetrieveArgumentsFunctor::result):
(JSC::RetrieveArgumentsFunctor::operator()):
(JSC::retrieveArguments):
(JSC::RetrieveCallerFunctionFunctor::result):
(JSC::RetrieveCallerFunctionFunctor::operator()):
(JSC::retrieveCallerFunction):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::GlobalFuncProtoGetterFunctor::result):
(JSC::GlobalFuncProtoGetterFunctor::operator()):
(JSC::globalFuncProtoGetter):
(JSC::GlobalFuncProtoSetterFunctor::allowsAccess):
(JSC::GlobalFuncProtoSetterFunctor::operator()):
* runtime/NullSetterFunction.cpp:
(JSC::GetCallerStrictnessFunctor::GetCallerStrictnessFunctor):
(JSC::GetCallerStrictnessFunctor::operator()):
(JSC::GetCallerStrictnessFunctor::callerIsStrict):
(JSC::callerIsStrict):
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructorGetPrototypeOfFunctor::result):
(JSC::ObjectConstructorGetPrototypeOfFunctor::operator()):
(JSC::objectConstructorGetPrototypeOf):
* runtime/Options.h:
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::SetEnabledProfilerFunctor::operator()):
* runtime/VM.h:
(JSC::VM::shouldBuilderPCToCodeOriginMapping):
(JSC::VM::bytecodeIntrinsicRegistry):
(JSC::VM::shadowChicken):
* tests/stress/resources/shadow-chicken-support.js: Added.
(describeFunction):
(describeArray):
(expectStack):
(initialize):
* tests/stress/shadow-chicken-disabled.js: Added.
(test1.foo):
(test1.bar):
(test1.baz):
(test1):
(test2.foo):
(test2.bar):
(test2.baz):
(test2):
(test3.foo):
(test3.bar):
(test3.baz):
(test3):
* tests/stress/shadow-chicken-enabled.js: Added.
(test1.foo):
(test1.bar):
(test1.baz):
(test1):
(test2.foo):
(test2.bar):
(test2.baz):
(test2):
(test3.bob):
(test3.thingy):
(test3.foo):
(test3.bar):
(test3.baz):
(test3):
(test4.bob):
(test4.thingy):
(test4.foo):
(test4.bar):
(test4.baz):
(test4):
(test5.foo):
(test5):
* tools/JSDollarVMPrototype.cpp:
(JSC::CallerFrameJITTypeFunctor::CallerFrameJITTypeFunctor):
(JSC::CallerFrameJITTypeFunctor::operator()):
(JSC::CallerFrameJITTypeFunctor::jitType):
(JSC::functionLLintTrue):
(JSC::CellAddressCheckFunctor::CellAddressCheckFunctor):
(JSC::CellAddressCheckFunctor::operator()):
(JSC::JSDollarVMPrototype::isValidCell):
(JSC::JSDollarVMPrototype::isValidCodeBlock):
(JSC::JSDollarVMPrototype::codeBlockForFrame):
(JSC::PrintFrameFunctor::PrintFrameFunctor):
(JSC::PrintFrameFunctor::operator()):
(JSC::printCallFrame):

Source/WebCore:

Fixed some uses of the stack walking functor to obey the new lambda-friendly API, which
requires that operator() is const.

No new tests because no change in behavior.

* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::SendFunctor::column):
(WebCore::SendFunctor::url):
(WebCore::SendFunctor::operator()):
(WebCore::JSXMLHttpRequest::send):
* testing/Internals.cpp:
(WebCore::GetCallerCodeBlockFunctor::GetCallerCodeBlockFunctor):
(WebCore::GetCallerCodeBlockFunctor::operator()):
(WebCore::GetCallerCodeBlockFunctor::codeBlock):
(WebCore::Internals::parserMetaData):

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

4 years agoSource/JavaScriptCore:
fpizlo@apple.com [Tue, 5 Apr 2016 22:13:16 +0000 (22:13 +0000)]
Source/JavaScriptCore:
DFG and FTL should constant-fold RegExpExec, RegExpTest, and StringReplace
https://bugs.webkit.org/show_bug.cgi?id=155270

Reviewed by Saam Barati.

This enables constant-folding of RegExpExec, RegExpTest, and StringReplace.

It's now possible to run Yarr on the JIT threads. Since previous work on constant-folding
strings gave the DFG an API for reasoning about JSString constants in terms of
JIT-thread-local WTF::Strings, it's now super easy to just pass strings to Yarr and build IR
based on the results.

But RegExpExec is hard: the folded version still must allocate a RegExpMatchesArray. We must
use the same Structure that the code would have used or else we'll pollute the program's
inline caches. Also, RegExpMatchesArray.h|cpp will allocate the array and its named
properties in one go - we don't want to lose that optimization. So, this patch enables
MaterializeNewObject to allocate objects or arrays with any number of indexed or named
properties. Previously it could only handle objects (but not arrays) and named properties
(but not indexed ones).

This also adds a few minor things for setting the RegExpConstructor cached result.

This is about a 2x speed-up on microbenchmarks when we fold a match success and about a
8x speed-up when we fold a match failure. It's a 10% speed-up on Octane/regexp.

* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGInsertionSet.cpp:
(JSC::DFG::InsertionSet::insertSlow):
(JSC::DFG::InsertionSet::execute):
* dfg/DFGInsertionSet.h:
(JSC::DFG::InsertionSet::insertCheck):
* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::tryGetString):
* dfg/DFGMayExit.cpp:
(JSC::DFG::mayExit):
* dfg/DFGNode.h:
(JSC::DFG::StackAccessData::flushedAt):
(JSC::DFG::OpInfo::OpInfo): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* dfg/DFGObjectMaterializationData.cpp:
(JSC::DFG::ObjectMaterializationData::dump):
(JSC::DFG::PhantomPropertyValue::dump): Deleted.
(JSC::DFG::ObjectMaterializationData::oneWaySimilarityScore): Deleted.
(JSC::DFG::ObjectMaterializationData::similarityScore): Deleted.
* dfg/DFGObjectMaterializationData.h:
(JSC::DFG::PhantomPropertyValue::PhantomPropertyValue): Deleted.
(JSC::DFG::PhantomPropertyValue::operator==): Deleted.
* dfg/DFGOpInfo.h: Added.
(JSC::DFG::OpInfo::OpInfo):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGPromotedHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGPromotedHeapLocation.h:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::~SpeculativeJIT):
(JSC::DFG::SpeculativeJIT::emitAllocateRawObject):
(JSC::DFG::SpeculativeJIT::emitGetLength):
(JSC::DFG::SpeculativeJIT::compileLazyJSConstant):
(JSC::DFG::SpeculativeJIT::compileMaterializeNewObject):
(JSC::DFG::SpeculativeJIT::compileRecordRegExpCachedResult):
(JSC::DFG::SpeculativeJIT::emitAllocateJSArray): Deleted.
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::emitAllocateDestructibleObject):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStoreBarrierInsertionPhase.cpp:
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::StrengthReductionPhase):
(JSC::DFG::StrengthReductionPhase::handleNode):
(JSC::DFG::StrengthReductionPhase::handleCommutativity):
(JSC::DFG::StrengthReductionPhase::executeInsertionSet):
* dfg/DFGValidate.cpp:
(JSC::DFG::Validate::validate):
(JSC::DFG::Validate::validateCPS):
* ftl/FTLAbstractHeapRepository.cpp:
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileNewArrayWithSize):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeCreateActivation):
(JSC::FTL::DFG::LowerDFGToB3::compileSetRegExpObjectLastIndex):
(JSC::FTL::DFG::LowerDFGToB3::compileRecordRegExpCachedResult):
(JSC::FTL::DFG::LowerDFGToB3::didOverflowStack):
(JSC::FTL::DFG::LowerDFGToB3::storageForTransition):
(JSC::FTL::DFG::LowerDFGToB3::initializeArrayElements):
(JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::isNotCellOrMisc):
(JSC::FTL::DFG::LowerDFGToB3::unboxDouble):
* ftl/FTLOperations.cpp:
(JSC::FTL::operationPopulateObjectInOSR):
(JSC::FTL::operationNewObjectWithButterfly): Deleted.
* ftl/FTLOperations.h:
* inspector/ContentSearchUtilities.cpp:
* runtime/JSObject.h:
(JSC::JSObject::createRawObject):
(JSC::JSFinalObject::create):
* runtime/RegExp.cpp:
(JSC::RegExp::compile):
(JSC::RegExp::match):
(JSC::RegExp::matchConcurrently):
(JSC::RegExp::compileMatchOnly):
(JSC::RegExp::deleteCode):
* runtime/RegExp.h:
* runtime/RegExpCachedResult.h:
(JSC::RegExpCachedResult::offsetOfLastRegExp):
(JSC::RegExpCachedResult::offsetOfLastInput):
(JSC::RegExpCachedResult::offsetOfResult):
(JSC::RegExpCachedResult::offsetOfReified):
* runtime/RegExpConstructor.h:
(JSC::RegExpConstructor::offsetOfCachedResult):
* runtime/RegExpInlines.h:
(JSC::RegExp::hasCodeFor):
(JSC::RegExp::compileIfNecessary):
(JSC::RegExp::matchInline):
(JSC::RegExp::hasMatchOnlyCodeFor):
(JSC::RegExp::compileIfNecessaryMatchOnly):
* runtime/RegExpObjectInlines.h:
(JSC::RegExpObject::execInline):
* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow):
(JSC::substituteBackreferencesInline):
(JSC::substituteBackreferences):
(JSC::StringRange::StringRange):
* runtime/StringPrototype.h:
* runtime/VM.h:
* tests/stress/simple-regexp-exec-folding-fail.js: Added.
(foo):
* tests/stress/simple-regexp-exec-folding.js: Added.
(foo):
* tests/stress/simple-regexp-test-folding-fail.js: Added.
(foo):
* tests/stress/simple-regexp-test-folding.js: Added.
(foo):
* yarr/RegularExpression.cpp:
* yarr/Yarr.h:
* yarr/YarrInterpreter.cpp:
(JSC::Yarr::Interpreter::interpret):
(JSC::Yarr::ByteCompiler::ByteCompiler):
(JSC::Yarr::ByteCompiler::compile):
(JSC::Yarr::ByteCompiler::checkInput):
(JSC::Yarr::byteCompile):
(JSC::Yarr::interpret):
* yarr/YarrInterpreter.h:
(JSC::Yarr::BytecodePattern::BytecodePattern):

Source/WTF:
DFG and FTL should constant-fold RegExpExec
https://bugs.webkit.org/show_bug.cgi?id=155270

Reviewed by Saam Barati.

Make executeInsertions() return the amount by which the vector increased in size. This is a
convenient feature that I use in DFG::InsertionSet.

* wtf/Insertion.h:
(WTF::executeInsertions):

LayoutTests:
DFG and FTL should constant-fold RegExpExec
https://bugs.webkit.org/show_bug.cgi?id=155270

Reviewed by Saam Barati.

* js/regress/script-tests/simple-regexp-exec-folding-fail.js: Added.
* js/regress/script-tests/simple-regexp-exec-folding.js: Added.
* js/regress/script-tests/simple-regexp-test-folding-fail.js: Added.
* js/regress/script-tests/simple-regexp-test-folding.js: Added.
* js/regress/simple-regexp-exec-folding-expected.txt: Added.
* js/regress/simple-regexp-exec-folding-fail-expected.txt: Added.
* js/regress/simple-regexp-exec-folding-fail.html: Added.
* js/regress/simple-regexp-exec-folding.html: Added.
* js/regress/simple-regexp-test-folding-expected.txt: Added.
* js/regress/simple-regexp-test-folding-fail-expected.txt: Added.
* js/regress/simple-regexp-test-folding-fail.html: Added.
* js/regress/simple-regexp-test-folding.html: Added.

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

4 years agoMake the @webkit link on the front page link to the feed
jond@apple.com [Tue, 5 Apr 2016 22:12:39 +0000 (22:12 +0000)]
Make the @webkit link on the front page link to the feed
https://bugs.webkit.org/show_bug.cgi?id=156244

Reviewed by Timothy Hatcher.

* wp-content/themes/webkit/widgets/twitter.php:

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

4 years agoWe should support the ability to do a non-effectful getById
keith_miller@apple.com [Tue, 5 Apr 2016 21:36:25 +0000 (21:36 +0000)]
We should support the ability to do a non-effectful getById
https://bugs.webkit.org/show_bug.cgi?id=156116

Reviewed by Benjamin Poulain.

Currently, there is no way in JS to do a non-effectful getById. A non-effectful getById is
useful because it enables us to take different code paths based on values that we would
otherwise not be able to have knowledge of. This patch adds this new feature called
try_get_by_id that will attempt to do as much of a get_by_id as possible without performing
an effectful behavior. Thus, try_get_by_id will return the value if the slot is a value, the
GetterSetter object if the slot is a normal accessor (not a CustomGetterSetter) and
undefined if the slot is unset.  If the slot is proxied or any other cases then the result
is null. In theory, if we ever wanted to check for null we could add a sentinal object to
the global object that indicates we could not get the result.

In order to implement this feature we add a new enum GetByIdKind that indicates what to do
for accessor properties in PolymorphicAccess. If the GetByIdKind is pure then we treat the
get_by_id the same way we would for load and return the value at the appropriate offset.
Additionally, in order to make sure the we can properly compare the GetterSetter object
with === GetterSetters are now JSObjects. This comes at the cost of eight extra bytes on the
GetterSetter object but it vastly simplifies the patch. Additionally, the extra bytes are
likely to have little to no impact on memory usage as normal accessors are generally rare.

* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createDefaultConstructor):
(JSC::BuiltinExecutables::createBuiltinExecutable):
(JSC::createBuiltinExecutable):
(JSC::BuiltinExecutables::createExecutable):
(JSC::createExecutableInternal): Deleted.
* builtins/BuiltinExecutables.h:
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::tryGet):
(JSC::AccessCase::generate):
(WTF::printInternal):
* bytecode/PolymorphicAccess.h:
(JSC::AccessCase::isGet): Deleted.
(JSC::AccessCase::isPut): Deleted.
(JSC::AccessCase::isIn): Deleted.
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::reset):
* bytecode/StructureStubInfo.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitTryGetById):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_tryGetById):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::getById):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITInlineCacheGenerator.cpp:
(JSC::JITGetByIdGenerator::JITGetByIdGenerator):
* jit/JITInlineCacheGenerator.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitGetByValWithCachedId):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitGetByValWithCachedId):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id):
* jit/Repatch.cpp:
(JSC::repatchByIdSelfAccess):
(JSC::appropriateOptimizingGetByIdFunction):
(JSC::appropriateGenericGetByIdFunction):
(JSC::tryCacheGetByID):
(JSC::repatchGetByID):
(JSC::resetGetByID):
* jit/Repatch.h:
* jsc.cpp:
(GlobalObject::finishCreation):
(functionGetGetterSetter):
(functionCreateBuiltin):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* runtime/GetterSetter.cpp:
* runtime/GetterSetter.h:
* runtime/JSType.h:
* runtime/PropertySlot.cpp:
(JSC::PropertySlot::getPureResult):
* runtime/PropertySlot.h:
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::getOwnPropertySlotCommon):
* tests/stress/try-get-by-id.js: Added.
(tryGetByIdText):
(getCaller.obj.1.throw.new.Error.let.func):
(getCaller.obj.1.throw.new.Error):
(throw.new.Error.get let):
(throw.new.Error.):
(throw.new.Error.let.get createBuiltin):
(get let):
(let.get createBuiltin):
(let.func):
(get let.func):
(get throw):

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

4 years agoModern IDB: Replace use of SerializedScriptValue with IDBValue.
beidson@apple.com [Tue, 5 Apr 2016 21:27:05 +0000 (21:27 +0000)]
Modern IDB: Replace use of SerializedScriptValue with IDBValue.
https://bugs.webkit.org/show_bug.cgi?id=156242

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No change in behavior).

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):

* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):
(WebCore::IDBValue::isolatedCopy):
* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::data):
(WebCore::IDBValue::encode):
(WebCore::IDBValue::decode):

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

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::putOrAdd):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

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

* WebCore.xcodeproj/project.pbxproj:

* platform/CrossThreadCopier.cpp:
(WebCore::IDBValue>::copy):
* platform/CrossThreadCopier.h:

* platform/ThreadSafeDataBuffer.h:
(WebCore::ThreadSafeDataBuffer::encode):
(WebCore::ThreadSafeDataBuffer::decode):

Source/WebKit2:

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

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::putOrAdd):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:

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

4 years agoAvoid context save/restore in GraphicsContext::drawNativeImage
commit-queue@webkit.org [Tue, 5 Apr 2016 20:24:01 +0000 (20:24 +0000)]
Avoid context save/restore in GraphicsContext::drawNativeImage
https://bugs.webkit.org/show_bug.cgi?id=156173

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-04-05
Reviewed by Simon Fraser.

CG save/restore is a costly operation. Try to avoid it, if possible, in
GraphicsContext::drawNativeImage. If no clipping is involved, don't save/
save/restore the GraphicsContext.

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawNativeImage):
* platform/graphics/cg/GraphicsContextCG.h:
(WebCore::CGContextStateSaver::didSave):
* platform/spi/cg/CoreGraphicsSPI.h:

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

4 years agojsc-layout-tests.yaml/js/script-tests/regress-141098.js failing on Yosemite Debug...
sbarati@apple.com [Tue, 5 Apr 2016 20:05:02 +0000 (20:05 +0000)]
jsc-layout-tests.yaml/js/script-tests/regress-141098.js failing on Yosemite Debug after r198989
https://bugs.webkit.org/show_bug.cgi?id=156187

Reviewed by Filip Pizlo.

This is a speculative fix. Lets see if the prevents the timeout.

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

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

4 years agoPolymorphicAccess should have a MegamorphicLoad case
fpizlo@apple.com [Tue, 5 Apr 2016 19:58:04 +0000 (19:58 +0000)]
PolymorphicAccess should have a MegamorphicLoad case
https://bugs.webkit.org/show_bug.cgi?id=156182

Reviewed by Geoffrey Garen and Keith Miller.

Source/JavaScriptCore:

This introduces a new case to PolymorphicAccess called MegamorphicLoad. This inlines the lookup in
the PropertyTable. It's cheaper than switching on a huge number of cases and it's cheaper than
calling into C++ to do the same job - particularly since inlining the lookup into an access means
that we can precompute the hash code.

When writing the inline code for the hashtable lookup, I found that our hashing algorithm was not
optimal. It used a double-hashing method for reducing collision pathologies. This is great for
improving the performance of some worst-case scenarios. But this misses the point of a hashtable: we
want to optimize the average-case performance. When optimizing for average-case, we can choose to
either focus on maximizing the likelihood of the fast case happening, or to minimize the cost of the
worst-case, or to minimize the cost of the fast case. Even a very basic hashtable will achieve a high
probability of hitting the fast case. So, doing work to reduce the likelihood of a worst-case
pathology only makes sense if it also preserves the good performance of the fast case, or reduces the
likelihood of the worst-case by so much that it's a win for the average case even with a slow-down in
the fast case.

I don't believe, based on looking at how the double-hashing is implemented, that it's possible that
this preserves the good performance of the fast case. It requires at least one more value to be live
around the loop, and dramatically increases the register pressure at key points inside the loop. The
biggest offender is the doubleHash() method itself. There is no getting around how bad this is: if
the compiler live-range-splits that method to death to avoid degrading register pressure elsewhere
then we will pay a steep price anytime we take the second iteration around the loop; but if the
compiler doesn't split around the call then the hashtable lookup fast path will be full of spills on
some architectures (I performed biological register allocation and found that I needed 9 registers
for complete lookup, while x86-64 has only 6 callee-saves; OTOH ARM64 has 10 callee-saves so it might
be better off).

Hence, this patch changes the hashtable lookup to use simple linear probing. This was not a slow-down
on anything, and it made MegamorphicLoad much more sensible since it is less likely to have to spill.

There are some other small changes in this patch, like rationalizing the IC's choice between giving
up after a repatch (i.e. never trying again) and just pretending that nothing happened (so we can
try to repatch again in the future). It looked like the code in Repatch.cpp was set up to be able to
choose between those options, but we weren't fully taking advantage of it because the
regenerateWithCase() method just returned null for any failure, and didn't say whether it was the
sort of failure that renders the inline cache unrepatchable (like memory allocation failure). Now
this is all made explicit. I wanted to make sure this change happened in this patch since the
MegamorphicLoad code automagically generates a MegamorphicLoad case by coalescing other cases. Since
this is intended to avoid blowing out the cache and making it unrepatchable, I wanted to make sure
that the rules for giving up were something that made sense to me.

This is a big win on microbenchmarks. It's neutral on traditional JS benchmarks. It's a slight
speed-up for page loading, because many real websites like to have megamorphic property accesses.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationResult::dump):
(JSC::AccessGenerationState::addWatchpoint):
(JSC::AccessCase::get):
(JSC::AccessCase::megamorphicLoad):
(JSC::AccessCase::replace):
(JSC::AccessCase::guardedByStructureCheck):
(JSC::AccessCase::couldStillSucceed):
(JSC::AccessCase::canBeReplacedByMegamorphicLoad):
(JSC::AccessCase::canReplace):
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generate):
(JSC::PolymorphicAccess::PolymorphicAccess):
(JSC::PolymorphicAccess::~PolymorphicAccess):
(JSC::PolymorphicAccess::regenerateWithCases):
(JSC::PolymorphicAccess::regenerateWithCase):
(WTF::printInternal):
* bytecode/PolymorphicAccess.h:
(JSC::AccessCase::isGet):
(JSC::AccessCase::isPut):
(JSC::AccessCase::isIn):
(JSC::AccessGenerationResult::AccessGenerationResult):
(JSC::AccessGenerationResult::operator==):
(JSC::AccessGenerationResult::operator!=):
(JSC::AccessGenerationResult::operator bool):
(JSC::AccessGenerationResult::kind):
(JSC::AccessGenerationResult::code):
(JSC::AccessGenerationResult::madeNoChanges):
(JSC::AccessGenerationResult::gaveUp):
(JSC::AccessGenerationResult::generatedNewCode):
(JSC::PolymorphicAccess::isEmpty):
(JSC::AccessGenerationState::AccessGenerationState):
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::aboutToDie):
(JSC::StructureStubInfo::addAccessCase):
* bytecode/StructureStubInfo.h:
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo):
(JSC::AssemblyHelpers::loadProperty):
(JSC::emitRandomThunkImpl):
(JSC::AssemblyHelpers::emitRandomThunk):
(JSC::AssemblyHelpers::emitLoadStructure):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::loadValue):
(JSC::AssemblyHelpers::moveValueRegs):
(JSC::AssemblyHelpers::argumentsStart):
(JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo):
(JSC::AssemblyHelpers::emitLoadStructure): Deleted.
* jit/GPRInfo.cpp:
(JSC::JSValueRegs::dump):
* jit/GPRInfo.h:
(JSC::JSValueRegs::uses):
* jit/Repatch.cpp:
(JSC::replaceWithJump):
(JSC::tryCacheGetByID):
(JSC::tryCachePutByID):
(JSC::tryRepatchIn):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
* runtime/Options.h:
* runtime/PropertyMapHashTable.h:
(JSC::PropertyTable::begin):
(JSC::PropertyTable::find):
(JSC::PropertyTable::get):
* runtime/Structure.h:

LayoutTests:

* js/regress/megamorphic-load-expected.txt: Added.
* js/regress/megamorphic-load.html: Added.
* js/regress/script-tests/megamorphic-load.js: Added.
* js/regress/string-repeat-not-resolving-no-inline-expected.txt: Added.
* js/regress/string-repeat-not-resolving-no-inline.html: Added.

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

4 years agoAdd a "notifyutil" callback for dumping the RenderLayer tree, and move the registrati...
simon.fraser@apple.com [Tue, 5 Apr 2016 19:40:07 +0000 (19:40 +0000)]
Add a "notifyutil" callback for dumping the RenderLayer tree, and move the registration to Page code
https://bugs.webkit.org/show_bug.cgi?id=156224

Reviewed by Zalan Bujtas.

Make it possible to run:
    notifyutil -p com.apple.WebKit.showLayerTree
on the command line and have it dump out layer trees for all live documents, in
debug builds.

Move callback registration from RenderObject's constructor to Page.

* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
* rendering/RenderObject.cpp:
(WebCore::printLayerTreeForLiveDocuments):
(WebCore::RenderObject::RenderObject): Deleted.
* rendering/RenderObject.h:

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

4 years agoMake Keith a reviewer!
keith_miller@apple.com [Tue, 5 Apr 2016 19:29:16 +0000 (19:29 +0000)]
Make Keith a reviewer!
https://bugs.webkit.org/show_bug.cgi?id=156246

Reviewed by Mark Lam.

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

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

4 years agoUn-marking plugins/focus.html as flaky on mac
antti@apple.com [Tue, 5 Apr 2016 17:53:54 +0000 (17:53 +0000)]
Un-marking plugins/focus.html as flaky on mac

It hasn't flaked after https://trac.webkit.org/r199054

* platform/mac/TestExpectations:

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

4 years agoUpdated Brazilian Portuguese translation
mcatanzaro@igalia.com [Tue, 5 Apr 2016 17:51:38 +0000 (17:51 +0000)]
Updated Brazilian Portuguese translation
https://bugs.webkit.org/show_bug.cgi?id=156236

Patch by Rafael Fontenelle <rafaelff@gnome.org> on 2016-04-05
Rubber-stamped by Michael Catanzaro.

* pt_BR.po:

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

4 years ago[WebGL2] Turn the ENABLE_WEBGL2 flag on
commit-queue@webkit.org [Tue, 5 Apr 2016 16:54:07 +0000 (16:54 +0000)]
[WebGL2] Turn the ENABLE_WEBGL2 flag on
https://bugs.webkit.org/show_bug.cgi?id=156061
<rdar://problem/25463193>

Patch by Antoine Quint <graouts@apple.com> on 2016-04-05
Reviewed by Alex Christensen.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
* runtime/CommonIdentifiers.h:

Define the conditionalized classes WebGL2RenderingContext and WebGLVertexArrayObject.

Source/WebCore:

Conditionalize the definition of the WebGL2RenderingContext and WebGLVertexArrayObject globals
based on the new WebGL2 runtime flag we introduced in https://webkit.org/b/156166.

Turning the ENABLE_WEBGL2 flag on caused a host of build errors which we fix here. A non-obvious
error was in code generated from the html/canvas/WebGL2RenderingContext.idl file which was solved
by updating the getBufferSubData() method to the current signature as of the March 29 Editor's
Draft of the WebGL 2 Specification (https://www.khronos.org/registry/webgl/specs/latest/2.0/).
Missing JSC headers in WebGL2RenderingContext.cpp also caused some linking errors in Release builds.

Tests: webgl/webgl-vertex-array-object-defined.html
       webgl/webgl2-rendering-context-defined.html
       webgl/webgl2-rendering-context-obtain.html

* Configurations/FeatureDefines.xcconfig:
* bindings/js/JSWebGL2RenderingContextCustom.cpp:
(WebCore::JSWebGL2RenderingContext::getInternalformatParameter):
(WebCore::JSWebGL2RenderingContext::getQueryParameter):
(WebCore::JSWebGL2RenderingContext::getSamplerParameter):
(WebCore::JSWebGL2RenderingContext::getSyncParameter):
(WebCore::JSWebGL2RenderingContext::getIndexedParameter):
(WebCore::JSWebGL2RenderingContext::getActiveUniformBlockParameter):
(WebCore::JSWebGL2RenderingContext::getActiveUniformBlockName):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::is3dType):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getBufferSubData): Deleted.
* html/canvas/WebGL2RenderingContext.idl:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* html/canvas/WebGLVertexArrayObject.idl:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

LayoutTests:

* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

The WebGL2RenderingContext and WebGLVertexArrayObject classes are now defined
so expectations for this test which lists the configuration of global constructors
needed to be updated.

* webgl/webgl-vertex-array-object-defined-expected.txt: Added.
* webgl/webgl-vertex-array-object-defined.html: Added.

Test checking that WebGLVertexArrayObject is defined.

* webgl/webgl2-rendering-context-defined-expected.txt: Added.
* webgl/webgl2-rendering-context-defined.html: Added.

Test checking that WebGL2RenderingContext is defined.

* webgl/webgl2-rendering-context-obtain-expected.txt: Added.
* webgl/webgl2-rendering-context-obtain.html: Added.

Test checking that asking for a "webgl2" context returns a WebGL2RenderingContext.

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

4 years agoWe sometimes fail to remove outdated entry from the disk cache after revalidation...
cdumez@apple.com [Tue, 5 Apr 2016 16:50:29 +0000 (16:50 +0000)]
We sometimes fail to remove outdated entry from the disk cache after revalidation and when the resource is no longer cacheable
https://bugs.webkit.org/show_bug.cgi?id=156048
<rdar://problem/25514480>

Reviewed by Antti Koivisto.

Source/WebKit2:

We would sometimes fail to remove outdated entry from the disk cache
after revalidation and when the resource is no longer cacheable. This
was due to Storage::removeFromPendingWriteOperations() only removing
the first pending write operation with a given key instead of actually
removing all of the operations with this key.

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

LayoutTests:

Add test coverage for the bug.

* http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes.html: Added.
* http/tests/cache/disk-cache/resources/json.php: Added.

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

4 years agoShadow DOM: :host() From The First Shadow Context Should Not Style All Shadow Context
antti@apple.com [Tue, 5 Apr 2016 16:45:51 +0000 (16:45 +0000)]
Shadow DOM: :host() From The First Shadow Context Should Not Style All Shadow Context
https://bugs.webkit.org/show_bug.cgi?id=156235
<rdar://problem/24668206>

Reviewed by Andreas Kling.

Source/WebCore:

Test: fast/shadow-dom/host-style-sharing.html

* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::canShareStyleWithElement):

    Disallow style sharing for shadow hosts affected by :host pseudo class rules.

LayoutTests:

* fast/shadow-dom/host-style-sharing-expected.html: Added.
* fast/shadow-dom/host-style-sharing.html: Added.

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

4 years agoSpeculative build fix after r199043
achristensen@apple.com [Tue, 5 Apr 2016 16:22:39 +0000 (16:22 +0000)]
Speculative build fix after r199043

* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::wireFormatVersion):
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
* bindings/js/SerializedScriptValue.h:
(WebCore::SerializedScriptValue::data):
(WebCore::SerializedScriptValue::hasBlobURLs):
(WebCore::SerializedScriptValue::createFromWireBytes):
Initializer lists weren't the problem.  Missing precompiler macros was.

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

4 years agoSpeculative build fix after r199043
achristensen@apple.com [Tue, 5 Apr 2016 16:15:39 +0000 (16:15 +0000)]
Speculative build fix after r199043

* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
Explicitly call constructor instead of using an initializer list.

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

4 years agoUnreviewed build fix with GSTREAMER_GL active.
calvaris@igalia.com [Tue, 5 Apr 2016 15:48:18 +0000 (15:48 +0000)]
Unreviewed build fix with GSTREAMER_GL active.

Caused by r198655.

(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: Changed return type.

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

4 years agoRender tree teardown should be iterative
antti@apple.com [Tue, 5 Apr 2016 15:04:02 +0000 (15:04 +0000)]
Render tree teardown should be iterative
https://bugs.webkit.org/show_bug.cgi?id=156233

Reviewed by Andreas Kling.

* dom/ContainerNode.cpp:
(WebCore::destroyRenderTreeIfNeeded):
(WebCore::ContainerNode::takeAllChildrenFrom):
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
* dom/Element.cpp:
(WebCore::disconnectPseudoElement):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension):
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::updateSelectedChild):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::RenderTreeUpdater::updateTextRenderer):
(WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):
(WebCore::RenderTreeUpdater::tearDownRenderers):

    Tear down render tree using ComposedTreeIterator for traversal.

(WebCore::RenderTreeUpdater::tearDownRenderer):

* style/RenderTreeUpdater.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::ensurePlaceholderStyle):
(WebCore::Style::TreeResolver::styleForElement):
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::affectsRenderedSubtree):
(WebCore::Style::SelectorFilterPusher::SelectorFilterPusher): Deleted.
(WebCore::Style::SelectorFilterPusher::push): Deleted.
(WebCore::Style::SelectorFilterPusher::~SelectorFilterPusher): Deleted.

    Unused class.

(WebCore::Style::detachTextRenderer): Deleted.
(WebCore::Style::detachChildren): Deleted.
(WebCore::Style::detachShadowRoot): Deleted.
(WebCore::Style::detachSlotAssignees): Deleted.
(WebCore::Style::detachRenderTree): Deleted.

    Remove the old recursive code.

* style/StyleTreeResolver.h:

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

4 years ago[WebGL2] Allow enabling WebGL2 with a runtime flag
commit-queue@webkit.org [Tue, 5 Apr 2016 11:22:17 +0000 (11:22 +0000)]
[WebGL2] Allow enabling WebGL2 with a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=156166
<rdar://problem/25526929>

Source/WebCore:

Added new runtime flags for WebGL2.

Patch by Antoine Quint <graouts@apple.com> on 2016-04-05
Reviewed by Dean Jackson.

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebGL2Enabled):
(WebCore::RuntimeEnabledFeatures::webGL2Enabled):

Source/WebKit/mac:

Set the WebGL2 runtime flag based on preferences, disabled by default.

Patch by Antoine Quint <graouts@apple.com> on 2016-04-05
Reviewed by Dean Jackson.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences webGL2Enabled]):
(-[WebPreferences setWebGL2Enabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Set the WebGL2 runtime flag based on preferences, disabled by default.

Patch by Antoine Quint <graouts@apple.com> on 2016-04-05
Reviewed by Dean Jackson.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetWebGL2Enabled):
(WKPreferencesGetWebGL2Enabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WTF:

Removed the manual overrides of ENABLE_WEBGL2.

Patch by Antoine Quint <graouts@apple.com> on 2016-04-05
Reviewed by Dean Jackson.

* wtf/FeatureDefines.h:

Tools:

Always enable WebGL2 during testing.

Patch by Antoine Quint <graouts@apple.com> on 2016-04-05
Reviewed by Dean Jackson.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setWebGL2Enabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

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

4 years agoUse RenderTreeUpdater for text node mutations
antti@apple.com [Tue, 5 Apr 2016 10:29:31 +0000 (10:29 +0000)]
Use RenderTreeUpdater for text node mutations
https://bugs.webkit.org/show_bug.cgi?id=156107

Reviewed by Andreas Kling.

Source/WebCore:

Use the new mechanism for updating render tree after text node content changes.

* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
* dom/Text.cpp:
(WebCore::Text::createWithLengthLimit):
(WebCore::Text::updateRendererAfterContentChange):

    Update using RenderTreeUpdater.

(WebCore::Text::formatForDebugger):
* dom/Text.h:
(WebCore::Text::Text):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForElement):
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::elementImplicitVisibility):
(WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): Deleted.
(WebCore::Style::textRendererIsNeeded): Deleted.
(WebCore::Style::createTextRendererIfNeeded): Deleted.
(WebCore::Style::attachTextRenderer): Deleted.
(WebCore::Style::detachTextRenderer): Deleted.
(WebCore::Style::updateTextRendererAfterContentChange): Deleted.
(WebCore::Style::resolveTextNode): Deleted.

    Kill the old code paths.

* style/StyleTreeResolver.h:

LayoutTests:

Mostly just revert non-rendered whitespace related changes from the earlier patches.

* editing/style/remove-underline-from-stylesheet-expected.txt:
* editing/style/typing-style-003-expected.txt:
* platform/ios-simulator/editing/style/typing-style-003-expected.txt: Removed.
* platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt:
* platform/mac/editing/inserting/editable-html-element-expected.txt:
* platform/mac/editing/inserting/editing-empty-divs-expected.txt:
* platform/mac/editing/inserting/insert-at-end-02-expected.txt:
* platform/mac/editing/pasteboard/4989774-expected.txt:
* platform/mac/editing/selection/4983858-expected.txt:

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

4 years ago[Curl][Soup] Fix the build after r199039
hs85.jeong@samsung.com [Tue, 5 Apr 2016 07:04:27 +0000 (07:04 +0000)]
[Curl][Soup] Fix the build after r199039
https://bugs.webkit.org/show_bug.cgi?id=156229

Reviewed by Žan Doberšek.

* platform/network/curl/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
* platform/network/soup/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):

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

4 years agoAdd missing EABI_32BIT_DUMMY_ARG arguments for some callOperation(J_JITOperation_EGRe...
zandobersek@gmail.com [Tue, 5 Apr 2016 06:30:02 +0000 (06:30 +0000)]
Add missing EABI_32BIT_DUMMY_ARG arguments for some callOperation(J_JITOperation_EGReoJ, ...) overloads
https://bugs.webkit.org/show_bug.cgi?id=156161

Reviewed by Yusuke Suzuki.

r197641 added a couple of callOperation(J_JITOperation_EGReoJ, ...) overloads
that handle arguments split into the tag and the payload. The two were split
between the last argument register and the stack on 32-bit ARM EABI systems,
causing incorrect behavior.

Adding EABI_32BIT_DUMMY_ARG pushes the tag and payload together onto the
stack, removing the issue.

* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):

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

4 years ago[ThreadedCompositor] Move CompositingRunLoop class into a separate file
zandobersek@gmail.com [Tue, 5 Apr 2016 06:15:43 +0000 (06:15 +0000)]
[ThreadedCompositor] Move CompositingRunLoop class into a separate file
https://bugs.webkit.org/show_bug.cgi?id=156170

Reviewed by Michael Catanzaro.

Move the CompositingRunLoop class from the ThreadedCompositor.cpp file
into its own implementation file, with the class declaration placed
into the accompanying header file. This follows the general rule of
keeping different class implementations in separate files.

No change in behavior, just refactoring.

* PlatformGTK.cmake:
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: Added.
(WebKit::CompositingRunLoop::CompositingRunLoop):
(WebKit::CompositingRunLoop::callOnCompositingRunLoop):
(WebKit::CompositingRunLoop::setUpdateTimer):
(WebKit::CompositingRunLoop::stopUpdateTimer):
(WebKit::CompositingRunLoop::updateTimerFired):
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: Added.
(WebKit::CompositingRunLoop::runLoop):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::CompositingRunLoop::CompositingRunLoop): Deleted.
(WebKit::CompositingRunLoop::callOnCompositingRunLoop): Deleted.
(WebKit::CompositingRunLoop::setUpdateTimer): Deleted.
(WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
(WebKit::CompositingRunLoop::runLoop): Deleted.
(WebKit::CompositingRunLoop::updateTimerFired): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:

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

4 years agoGuard showGraphicsLayerTree() with ENABLE(TREE_DEBUGGING)
zandobersek@gmail.com [Tue, 5 Apr 2016 06:13:55 +0000 (06:13 +0000)]
Guard showGraphicsLayerTree() with ENABLE(TREE_DEBUGGING)
https://bugs.webkit.org/show_bug.cgi?id=156157

Reviewed by Simon Fraser.

Mimic r181166 and guard the showGraphicsLayerTree() function with
ENABLE(TREE_DEBUGGING) guards, instead of !defined(NDEBUG). This
would enable invoking the function in release builds when the
ENABLE_TREE_DEBUGGING option is enabled, not limiting the function
to only debug builds.

* platform/graphics/GraphicsLayer.cpp:
* platform/graphics/GraphicsLayer.h:

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

4 years ago[TexMap] Improve viewport array access in TextureMapperGL::bindDefaultSurface()
zandobersek@gmail.com [Tue, 5 Apr 2016 06:11:22 +0000 (06:11 +0000)]
[TexMap] Improve viewport array access in TextureMapperGL::bindDefaultSurface()
https://bugs.webkit.org/show_bug.cgi?id=156159

Reviewed by Antonio Gomes.

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::bindDefaultSurface): Create a reference to the
viewport array in the TextureMapperGLData object. Inline the IntSize constructor
for the object that's passed to createProjectionMatrix(), and use the reference
to access all four elements of the array as necessary.

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

4 years ago[TexMap] resolveOverlaps() should be passed-in the first Region parameter via a reference
zandobersek@gmail.com [Tue, 5 Apr 2016 06:09:01 +0000 (06:09 +0000)]
[TexMap] resolveOverlaps() should be passed-in the first Region parameter via a reference
https://bugs.webkit.org/show_bug.cgi?id=156158

Reviewed by Antonio Gomes.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::resolveOverlaps): Don't copy the Region object that's passed through
the first parameter by accepting a reference to the object instead. This does
modify the passed-in object, but these modifications don't have any effect on
any state via the call sites in TextureMapperLayer::computeOverlapRegions().

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

4 years agoModern IDB: Dump blobs to disk before storing them in an object store.
beidson@apple.com [Tue, 5 Apr 2016 05:47:32 +0000 (05:47 +0000)]
Modern IDB: Dump blobs to disk before storing them in an object store.
https://bugs.webkit.org/show_bug.cgi?id=156068
Source/WebCore:

Reviewed by Alex Christensen.

No new tests (Under development, no observable change in behavior yet).

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

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):

* Modules/indexeddb/IDBValue.cpp: Copied from Source/WebCore/platform/ScopeGuard.h.
(WebCore::IDBValue::IDBValue):
* Modules/indexeddb/IDBValue.h: Copied from Source/WebCore/platform/ScopeGuard.h.

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
* Modules/indexeddb/client/IDBConnectionToServer.h:

* Modules/indexeddb/client/TransactionOperation.h:

* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
(WebCore::SerializedScriptValue::addBlobURL): Deleted.
* bindings/js/SerializedScriptValue.h:

* platform/FileSystem.cpp:
(WebCore::appendFileContentsToFileHandle):
* platform/FileSystem.h:

* platform/ScopeGuard.h:

* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::blobUtilityQueue):
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
* platform/network/BlobRegistryImpl.h:

Source/WebKit2:

Reviewed by Alex Christensen.

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:

* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
* WebProcess/FileAPI/BlobRegistryProxy.h:

* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didClose):
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
(WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.messages.in:

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

4 years ago[iOS] Crash when playing <video> after playing Web Audio
jer.noble@apple.com [Tue, 5 Apr 2016 05:39:18 +0000 (05:39 +0000)]
[iOS] Crash when playing <video> after playing Web Audio
https://bugs.webkit.org/show_bug.cgi?id=156185
<rdar://problem/10177005>

Reviewed by Eric Carlson.

Off-by-one error in AudioDestinationIOS::render. The ivars m_firstSpareFrame and m_lastSpareFrame imply that
the sample range is inclusive, i.e. [m_firstSpareFrame .. m_lastSpareFrame], but the length of the range was
being calculated as if m_lastSpareFrame was exclusive; when the two were equal, the length was calculated as
0, rather than 1. This was caught by an ASSERT (and would have been caught by a downstream ASSERT had that one
not been present).

Fix the off-by-one by treating them as inclusive/exclusive--similar to C++ iterators--and renaming them to reflect
this: [m_startSpareFrame .. m_endSpareFrame). This corrects the "length" math which caused the crash.

* platform/audio/ios/AudioDestinationIOS.cpp:
(WebCore::AudioDestinationIOS::render):
* platform/audio/ios/AudioDestinationIOS.h:

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

4 years agoUncaught Exception: Error: Can't make a ContentView for an unknown representedObject...
commit-queue@webkit.org [Tue, 5 Apr 2016 05:20:33 +0000 (05:20 +0000)]
Uncaught Exception: Error: Can't make a ContentView for an unknown representedObject (ApplicationCacheManifest)
https://bugs.webkit.org/show_bug.cgi?id=156139
<rdar://problem/25511926>

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

* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.createFromRepresentedObject):
Improve the error message to get the name of the represented object.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype._isTreeElementWithoutRepresentedObject):
Treat ApplicationCacheManifestTreeElement like other Host elements. Nothing to save/show.

* UserInterface/Views/ApplicationCacheManifestTreeElement.js:
(WebInspector.ApplicationCacheManifestTreeElement):
* UserInterface/Views/DatabaseHostTreeElement.js:
(WebInspector.DatabaseHostTreeElement):
* UserInterface/Views/IndexedDatabaseHostTreeElement.js:
(WebInspector.IndexedDatabaseHostTreeElement):
Auto-expand these folders, as they are not useful when collapsed.

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

4 years ago[iOS] Allow clients in the bundle to know whether a field was focused by user interaction
commit-queue@webkit.org [Tue, 5 Apr 2016 04:22:54 +0000 (04:22 +0000)]
[iOS] Allow clients in the bundle to know whether a field was focused by user interaction
https://bugs.webkit.org/show_bug.cgi?id=156118

Patch by Chelsea Pugh <cpugh@apple.com> on 2016-04-04
Reviewed by Dan Bernstein.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Add delegate method that takes userIsInteracting bool so that bundle clients get this information.
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: Call API with userIsInteracting property if delegate implements it, otherwise call existing API if
userIsInteracting is true, as we previously did in WebKit::WebPage::elementDidFocus. Move FIXME from WebKit::WebPage::elementDidFocus to here, since we are checking userIsInteracting.
* WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
(API::InjectedBundle::FormClient::willBeginInputSession): Add userIsInteracting bool to arguments so we can use it for call to the new API as well as preserving behavior of the old API.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::elementDidFocus): Remove check if user is interacting and call willBeginInputSession unconditionally. Move FIXME to where we check
userIsInteracting. Pass m_userIsInteracting to willBeginInputSession so we can use it there.

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

4 years agoBlock plaintext WebSocket requests to domains under HSTS.
bfulgham@apple.com [Tue, 5 Apr 2016 04:12:48 +0000 (04:12 +0000)]
Block plaintext WebSocket requests to domains under HSTS.
https://bugs.webkit.org/show_bug.cgi?id=156049
<rdar://problem/13820000>

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

No new tests because the way TLS is setup for layout tests doesn't allow the server to set HSTS for 127.0.0.1 nor localhost. This is tracked in <rdar://problem/25467825>.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
    - Now sends usesEphemeralSession to SocketStreamHandle::create.
* platform/network/cf/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
    - Added parameter usesEphemeralSession which it passes on to the SocketStreamHandle constructor.
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
    - Now blocks plaintext WebSocket connections for domains under HSTS if not in an ephemeral session.

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

4 years agoMake FrameView's exposedRect an Optional<>
simon.fraser@apple.com [Tue, 5 Apr 2016 04:04:35 +0000 (04:04 +0000)]
Make FrameView's exposedRect an Optional<>
https://bugs.webkit.org/show_bug.cgi?id=156189

Reviewed by Tim Horton.

Instead of testing against isInfinite(), make FrameView::exposedRect() and the
member variable an Optional<FloatRect>.

* page/FrameView.cpp:
(WebCore::FrameView::setExposedRect):
* page/FrameView.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::computeTileCoverage):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):

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

4 years agoDon't crash when rendering form controls with Display List Drawing enabled
simon.fraser@apple.com [Tue, 5 Apr 2016 03:56:46 +0000 (03:56 +0000)]
Don't crash when rendering form controls with Display List Drawing enabled
https://bugs.webkit.org/show_bug.cgi?id=156122

Reviewed by Sam Weinig.

Don't attempt to paint form controls if display-list drawing is enabled, since
doing so attempts to get at a CGContextRef that doens't exist.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):

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

4 years ago[win] run-webkit-tests failed to launch DumpRenderTree
commit-queue@webkit.org [Tue, 5 Apr 2016 03:54:49 +0000 (03:54 +0000)]
[win] run-webkit-tests failed to launch DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=156150

Patch by Bill Ming <mbbill@gmail.com> on 2016-04-04
Reviewed by Alex Christensen.

* Tools/Scripts/webkitpy/port/base.py:

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

4 years agoAvoid copying ModuleLoaderObject.js to resources bundle
commit-queue@webkit.org [Tue, 5 Apr 2016 03:52:49 +0000 (03:52 +0000)]
Avoid copying ModuleLoaderObject.js to resources bundle
https://bugs.webkit.org/show_bug.cgi?id=156188
<rdar://problem/25534383>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-04
Reviewed by Alexey Proskuryakov.

* JavaScriptCore.xcodeproj/project.pbxproj:

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

4 years agoCSS Triangles Rendering Regression affecting CSS Ribbons.
zalan@apple.com [Tue, 5 Apr 2016 03:50:43 +0000 (03:50 +0000)]
CSS Triangles Rendering Regression affecting CSS Ribbons.
https://bugs.webkit.org/show_bug.cgi?id=156121

Reviewed by Simon Fraser.

Source/WebCore:

We use floored border width values for painting (see BorderEdge).
However border-box sizing is based on rounded border values. This mismatch could result in a 2 device pixel
gap when both top and bottom (or left and right) borders are present.

This patch applies flooring on the computed border width value.

It matches FireFox (44.0.2) behaviour (both by inspecting box-sizing visually and through getComputedStyle() values on border-width).

Covered by existing tests.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLineWidth):

LayoutTests:

Rebeaseline to match current behaviour.

* fast/inline/hidpi-inline-text-decoration-with-subpixel-value-expected.html:
* platform/mac/css1/units/length_units-expected.txt:
* platform/mac/fast/css/bidi-override-in-anonymous-block-expected.txt:
* platform/mac/fast/multicol/span/anonymous-style-inheritance-expected.txt:
* platform/mac/fast/repaint/repaint-during-scroll-with-zoom-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-initial-value-001-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-style-001-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-style-002-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-style-004-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-with-three-values-001-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-radius-with-two-values-001-expected.txt:
* platform/mac/ietestcenter/css3/bordersbackgrounds/border-top-left-radius-values-003-expected.txt:
* platform/mac/media/video-zoom-expected.txt:
* platform/mac/svg/custom/svg-fonts-in-html-expected.txt:
* platform/mac/svg/zoom/page/zoom-background-image-tiled-expected.txt:
* platform/mac/svg/zoom/page/zoom-background-images-expected.txt:
* platform/mac/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt:
* platform/mac/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-float-border-padding-expected.txt:
* platform/mac/svg/zoom/page/zoom-svg-through-object-with-auto-size-expected.txt:
* platform/mac/tables/mozilla_expected_failures/bugs/bug1055-2-expected.txt:

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

4 years agoUnreviewed GTK build fix after r199020
mcatanzaro@igalia.com [Tue, 5 Apr 2016 00:19:28 +0000 (00:19 +0000)]
Unreviewed GTK build fix after r199020

* UIProcess/API/gtk/WebKitUserContentManager.cpp:
(webkit_user_content_manager_register_script_message_handler):
(webkit_user_content_manager_unregister_script_message_handler):

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

4 years ago2016-04-04 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Tue, 5 Apr 2016 00:14:30 +0000 (00:14 +0000)]
2016-04-04  Geoffrey Garen  <ggaren@apple.com>

        Unreviewed, rolling out r199016.
        https://bugs.webkit.org/show_bug.cgi?id=156140

        "Regressed Octane and Kraken on the perf bots."

        Reverted changeset:

        CopiedBlock should be 16kB
        https://bugs.webkit.org/show_bug.cgi?id=156168
        http://trac.webkit.org/changeset/199016

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

4 years agoWeb Inspector: Uncaught exception in CSS with string "constructor" (WebInspector...
commit-queue@webkit.org [Tue, 5 Apr 2016 00:12:35 +0000 (00:12 +0000)]
Web Inspector: Uncaught exception in CSS with string "constructor" (WebInspector.Color.fromString())
https://bugs.webkit.org/show_bug.cgi?id=156183
<rdar://problem/25539279>

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

* UserInterface/Models/Color.js:
(WebInspector.Color.fromString):
Fix the uncaught exception issue. Only look at own properties of
our keyword map to avoid values like "toString" and "constructor".

* UserInterface/Debug/UncaughtExceptionReporter.js:
(handleError):
(handleUncaughtException):
(handleUncaughtExceptionRecord):
Generalize uncaught exception handler error sheet to get
exception records from both uncaught exceptions (window.onerror)
and general Runtime Error objects (TypeError, etc).

* UserInterface/Base/Utilities.js:
(window.promiseLogError.window.promiseLogError):
Add a fallback log exception helper.

* UserInterface/Controllers/AnalyzerManager.js:
(WebInspector.AnalyzerManager.prototype.getAnalyzerMessagesForSourceCode):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor):
Add catch handlers to Promises to log exceptions.

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

4 years agoAX: new lines in content editable elements don't notify accessibility
d_russell@apple.com [Mon, 4 Apr 2016 23:17:59 +0000 (23:17 +0000)]
AX: new lines in content editable elements don't notify accessibility
https://bugs.webkit.org/show_bug.cgi?id=153361

Reviewed by Ryosuke Niwa.

Relocate accessibility edit notification logic into higher level logic.
Typing notifications relocated into TypingCommand.
Cut & Paste notifications relocated into Editor.
Undo relocated into EditCommandComposition.

Tests: accessibility/mac/value-change/value-change-user-info-contenteditable.html
       accessibility/mac/value-change/value-change-user-info-textarea.html
       accessibility/mac/value-change/value-change-user-info-textfield.html

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
(WebCore::AccessibilityReplacedText::postTextStateChangeNotification):
(WebCore::AXObjectCache::postTextStateChangeNotification):
(WebCore::AXObjectCache::postTextReplacementNotification):
* accessibility/AXObjectCache.h:
(WebCore::VisiblePositionIndexRange::isNull):
(WebCore::AccessibilityReplacedText::AccessibilityReplacedText):
(WebCore::AccessibilityReplacedText::replacedRange):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
(WebCore::AccessibilityObject::stringForVisiblePositionRange):
* accessibility/AccessibilityObject.h:
(WebCore::VisiblePositionRange::VisiblePositionRange):
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postTextStateChangePlatformNotification):
(WebCore::AXObjectCache::postTextReplacementPlatformNotification):
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::doApply): Deleted.
(WebCore::AppendNodeCommand::doUnapply): Deleted.
* editing/CompositeEditCommand.cpp:
(WebCore::AccessibilityUndoReplacedText::indexForVisiblePosition):
(WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyIndexesWithEditCommandEndingSelection):
(WebCore::AccessibilityUndoReplacedText::confgureTextToBeDeletedByUnapplyStartIndexWithEditCommandStartingSelection):
(WebCore::AccessibilityUndoReplacedText::setTextInsertedByUnapplyRange):
(WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByUnapply):
(WebCore::AccessibilityUndoReplacedText::captureTextToBeDeletedByReapply):
(WebCore::stringForVisiblePositionIndexRange):
(WebCore::AccessibilityUndoReplacedText::textInsertedByUnapply):
(WebCore::AccessibilityUndoReplacedText::textInsertedByReapply):
(WebCore::postTextStateChangeNotification):
(WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForUnapply):
(WebCore::AccessibilityUndoReplacedText::postTextStateChangeNotificationForReapply):
(WebCore::EditCommandComposition::EditCommandComposition):
(WebCore::EditCommandComposition::unapply):
(WebCore::EditCommandComposition::reapply):
(WebCore::EditCommandComposition::setStartingSelection):
(WebCore::EditCommandComposition::setEndingSelection):
(WebCore::EditCommandComposition::setTextInsertedByUnapplyRange):
(WebCore::CompositeEditCommand::removeNode):
(WebCore::CompositeEditCommand::replaceTextInNode):
(WebCore::deleteSelectionEditingActionForEditingAction):
(WebCore::CompositeEditCommand::deleteSelection):
(WebCore::CompositeEditCommand::applyStyle): Deleted.
(WebCore::CompositeEditCommand::updatePositionForNodeRemovalPreservingChildren): Deleted.
(WebCore::CompositeEditCommand::inputText): Deleted.
* editing/CompositeEditCommand.h:
(WebCore::AccessibilityUndoReplacedText::AccessibilityUndoReplacedText):
* editing/DeleteFromTextNodeCommand.cpp:
(WebCore::DeleteFromTextNodeCommand::doApply): Deleted.
(WebCore::DeleteFromTextNodeCommand::getNodesInCommand): Deleted.
* editing/DeleteFromTextNodeCommand.h:
* editing/DictationCommand.cpp:
(WebCore::DictationCommand::doApply):
* editing/EditCommand.cpp:
(WebCore::EditCommand::postTextStateChangeNotification):
(WebCore::SimpleEditCommand::SimpleEditCommand): Deleted.
(WebCore::SimpleEditCommand::doReapply): Deleted.
(WebCore::SimpleEditCommand::addNodeAndDescendants): Deleted.
* editing/EditCommand.h:
* editing/EditingAllInOne.cpp:
* editing/Editor.cpp:
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::unappliedEditing):
(WebCore::Editor::postTextStateChangeNotificationForCut):
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::changeSelectionAfterCommand):
(WebCore::dispatchEditableContentChangedEvents): Deleted.
(WebCore::Editor::addTextToKillRing): Deleted.
* editing/Editor.h:
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doApply): Deleted.
(WebCore::InsertIntoTextNodeCommand::getNodesInCommand): Deleted.
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::doApply): Deleted.
(WebCore::InsertNodeBeforeCommand::doUnapply): Deleted.
(WebCore::InsertNodeBeforeCommand::getNodesInCommand): Deleted.
* editing/RemoveNodeCommand.cpp:
(WebCore::RemoveNodeCommand::RemoveNodeCommand):
* editing/RemoveNodeCommand.h:
(WebCore::RemoveNodeCommand::create):
* editing/ReplaceDeleteFromTextNodeCommand.cpp: Removed.
* editing/ReplaceDeleteFromTextNodeCommand.h: Removed.
* editing/ReplaceInsertIntoTextNodeCommand.cpp: Removed.
* editing/ReplaceInsertIntoTextNodeCommand.h: Removed.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
(WebCore::ReplaceSelectionCommand::performTrivialReplace):
* editing/ReplaceSelectionCommand.h:
(WebCore::ReplaceSelectionCommand::visibleSelectionForInsertedText):
* editing/TextInsertionBaseCommand.cpp:
(WebCore::TextInsertionBaseCommand::TextInsertionBaseCommand):
* editing/TextInsertionBaseCommand.h:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::TypingCommand):
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::postTextStateChangeNotificationForDeletion):
(WebCore::TypingCommand::doApply):
(WebCore::TypingCommand::insertTextAndNotifyAccessibility):
(WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
* editing/TypingCommand.h:

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

4 years agoprepare-ChangeLog set endl incorrectly.
commit-queue@webkit.org [Mon, 4 Apr 2016 22:54:31 +0000 (22:54 +0000)]
prepare-ChangeLog set endl incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=156151

Patch by Bill Ming <mbbill@gmail.com> on 2016-04-04
Reviewed by Alex Christensen.

* Tools/Scripts/prepare-ChangeLog:

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

4 years agoCMake build fix.
achristensen@apple.com [Mon, 4 Apr 2016 22:47:34 +0000 (22:47 +0000)]
CMake build fix.

* PlatformMac.cmake:

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

4 years agoTapping on tabs in webpages caused WK crash at WebKit: WebKit::WebFrame::didReceivePo...
jiewen_tan@apple.com [Mon, 4 Apr 2016 22:28:05 +0000 (22:28 +0000)]
Tapping on tabs in webpages caused WK crash at WebKit: WebKit::WebFrame::didReceivePolicyDecision
https://bugs.webkit.org/show_bug.cgi?id=156119
<rdar://problem/20732167>

Reviewed by Andy Estes.

Protect the m_frame so that it is present for completion handlers.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

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

4 years agoUnreviewed: Add Doug Russell as a commiter.
d_russell@apple.com [Mon, 4 Apr 2016 22:17:22 +0000 (22:17 +0000)]
Unreviewed: Add Doug Russell as a commiter.

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

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

4 years ago[JSC][x86] Fix an assertion in MacroAssembler::branch8()
commit-queue@webkit.org [Mon, 4 Apr 2016 22:12:23 +0000 (22:12 +0000)]
[JSC][x86] Fix an assertion in MacroAssembler::branch8()
https://bugs.webkit.org/show_bug.cgi?id=156181

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

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::branch8):
The test was wrong because valid negative numbers have ones
in the top bits.

I replaced the assertion to be explicit about the valid range.

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

4 years agoAdd color-gamut media query support
dino@apple.com [Mon, 4 Apr 2016 22:10:50 +0000 (22:10 +0000)]
Add color-gamut media query support
https://bugs.webkit.org/show_bug.cgi?id=155994
<rdar://problem/23282326>

Reviewed by Darin Adler.

Source/WebCore:

Add the new CSS media query: color-gamut
https://drafts.csswg.org/mediaqueries-4/#color-gamut

This ultimately calls into screenSupportsExtendedColor,
which has only been implemented on iOS at the moment.
All displays will match the "srgb" keyword, but only
iOS devices with an extended color screen will
match against "p3" (e.g. the iPad Pro 9.7").
Nothing will match against "rec2020".

Test: fast/media/mq-color-gamut.html

* css/CSSValueKeywords.in: Add "p3" and "rec2020".
* css/MediaFeatureNames.h: Add "color-gamut"
* css/MediaQueryEvaluator.cpp:
(WebCore::color_gamutMediaFeatureEval): Call
screenSupportsExtendedColor to see if we're srgb or p3.
* css/MediaQueryExp.cpp:
(WebCore::featureWithCSSValueID):
* platform/efl/PlatformScreenEfl.cpp: Add empty implementation.
(WebCore::screenSupportsExtendedColor):
* platform/gtk/PlatformScreenGtk.cpp: Ditto.
(WebCore::screenSupportsExtendedColor):
* platform/win/PlatformScreenWin.cpp: Ditto.
(WebCore::screenSupportsExtendedColor):

LayoutTests:

New test for color-gamut.

* fast/media/mq-color-gamut-expected.html: Added.
* fast/media/mq-color-gamut.html: Added.

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

4 years agoUpdate feature status on anchor download attribute.
bfulgham@apple.com [Mon, 4 Apr 2016 21:22:29 +0000 (21:22 +0000)]
Update feature status on anchor download attribute.

* features.json:

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

4 years agoAdd some logic to decide when a video can control the videoControlsManager
bdakin@apple.com [Mon, 4 Apr 2016 21:18:57 +0000 (21:18 +0000)]
Add some logic to decide when a video can control the videoControlsManager
https://bugs.webkit.org/show_bug.cgi?id=156089
-and corresponding-
rdar://problem/23833752

Reviewed by Eric Carlson and Tim Horton.

Source/WebCore:

With this patch, a video can take over the videoControlsManager if all of
these conditions are met:
-Playback is permitted
-The video has a renderer
-The video is 400x300 or larger
AND
-The video has both audio and video

If those criteria are not met the video will still be allowed to take over
the videoControlsManager if:
-Playback is permitted
-The video has a renderer
-The video started playing because of a user gesture.

If multiple videos meet this criteria, then the video that most recently
started playing will take over the videoControlsManager.

We might consider more restrictions in the future, but this seems like a good
place to start.

Move all decisions about the videoControlsManager to updatePlayState()
instead of playInternal().
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):

If the video will play after updatePlayState, then invoke
setUpVideoControlsManager() if canControlControlsManager() is true. If the
video will not be playing after updatePlayState, then check to see if
endedPlayback() is true. If it is, then invoke clearVideoControlsManager().
(WebCore::HTMLMediaElement::updatePlayState):

The logic for the heuristic is here:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canControlControlsManager):
* html/MediaElementSession.h:

New ChromeClient function clearVideoControlsManager().
* page/ChromeClient.h:

Source/WebKit2:

The biggest change in WebKit2 is to push all of the logic for the
videoControlsManager into WebCore. With this change, WebCore will invoke
setUpVideoControlsManager() when there is a video to control the manager, and
it will call clearVideoControlsManager() when there is not.

Add clearVideoControlsManager().
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::clearVideoControlsManager):

Re-name isPlayingMediaDidChange() to videoControlsManagerDidChange(). This
ties the logic to the lifetime of the videoControlsManager instead of
figuring it out in the UIProcess based on the media state.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::videoControlsManagerDidChange):
(WebKit::WebViewImpl::isPlayingMediaDidChange): Deleted.
* UIProcess/PageClient.h:

Also change isPlayingVideoWithAudio() into hasActiveVideoForControlsManager()
Again, this ties the logic to the lifetime of the videoControlsManager
instead of figuring it out in the UIProcess based on the media state.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange):
(WebKit::WebPageProxy::videoControlsManagerDidChange):
(WebKit::WebPageProxy::hasActiveVideoForControlsManager):
(WebKit::WebPageProxy::isPlayingVideoWithAudio): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::videoControlsManagerDidChange):
(WebKit::PageClientImpl::isPlayingMediaDidChange): Deleted.

New WebChromeClient function clearVideoControlsManager().
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::clearVideoControlsManager):
* WebProcess/WebCoreSupport/WebChromeClient.h:

Do the work to clear the videoControlsManager.
* WebProcess/cocoa/WebVideoFullscreenManager.h:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::clearVideoControlsManager):
(WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):

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

4 years agoREGRESSION(r198955): com.apple.WebKit.Networking.Development crashed in WebKit::Netwo...
bfulgham@apple.com [Mon, 4 Apr 2016 21:09:35 +0000 (21:09 +0000)]
REGRESSION(r198955): com.apple.WebKit.Networking.Development crashed in WebKit::NetworkLoad::setPendingDownloadID + 11
https://bugs.webkit.org/show_bug.cgi?id=156177
<rdar://problem/25508037>

Reviewed by Alex Christensen.

We do not currently create a NetworkDataTask when we encounter a BLOB URL when building with
NETWORK_SESSION enabled. This causes us to crash when the download system attempts to work
with a BLOB URL.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::setPendingDownloadID): Add null check for m_task.
(WebKit::NetworkLoad::setPendingDownload): Ditto.

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

4 years agoAdd SPI to allow install script message handlers in isolated worlds
weinig@apple.com [Mon, 4 Apr 2016 21:03:28 +0000 (21:03 +0000)]
Add SPI to allow install script message handlers in isolated worlds
https://bugs.webkit.org/show_bug.cgi?id=156153

Reviewed by Anders Carlsson.

Source/WebCore:

Added API Test: WKUserContentController.ScriptMessageHandlerBasicPostIsolatedWorld

- Changes the signature of the method in UserContentProvider to get UserMessageHandlerDescriptors
  to match that of UserScripts and UserStyleSheets.
- Removes the need for UserMessageHandlerDescriptor::Client by making UserMessageHandlerDescriptor
  directly subclassable.
- Changes invalidation model of UserMessageHandlersNamespace to be more direct by allowing it to
  register for invalidation notifications, rather than always checking if handler has been removed
  on each invocation.

* loader/EmptyClients.cpp:
Update for new signature.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
Switch to using forEachUserMessageHandler.

(WebCore::DOMWindow::webkitNamespace):
Pass the UserContentProvider to the namespace on creation, so the UserMessageHandlersNamespace
can use it to register to listen for UserMessageHandler changes.

* page/UserContentController.h:
* page/UserContentController.cpp:
(WebCore::UserContentController::forEachUserStyleSheet):
(WebCore::UserContentController::forEachUserMessageHandler):
(WebCore::UserContentController::addUserScript):
(WebCore::UserContentController::removeUserStyleSheets):
(WebCore::UserContentController::removeAllUserContent):
(WebCore::UserContentController::addUserMessageHandlerDescriptor): Deleted.
(WebCore::UserContentController::removeUserMessageHandlerDescriptor): Deleted.
(WebCore::UserContentController::addUserContentExtension): Deleted.
(WebCore::UserContentController::removeUserContentExtension): Deleted.
(WebCore::UserContentController::removeAllUserContentExtensions): Deleted.
Removed unused functions, all the UserMessageHandler and UserContentExtension ones. UserContentController
is only used for Legacy WebKit where those features are not exposed.

* page/UserContentProvider.h:
* page/UserContentProvider.cpp:
(WebCore::UserContentProvider::registerForUserMessageHandlerInvalidation):
(WebCore::UserContentProvider::unregisterForUserMessageHandlerInvalidation):
(WebCore::UserContentProvider::invalidateAllRegisteredUserMessageHandlerInvalidationClients):
(WebCore::UserContentProviderInvalidationClient::~UserContentProviderInvalidationClient):
Update signature for UserMessageHandlerDescriptor access to match UserScript and UserStyleSheet.
Adds explicit invalidation for UserMessageHandlers.

* page/UserMessageHandler.cpp:
(WebCore::UserMessageHandler::UserMessageHandler):
(WebCore::UserMessageHandler::postMessage):
(WebCore::UserMessageHandler::name): Deleted.
(WebCore::UserMessageHandler::world): Deleted.
* page/UserMessageHandler.h:
(WebCore::UserMessageHandler::descriptor):
(WebCore::UserMessageHandler::invalidateDescriptor):
* page/UserMessageHandlerDescriptor.cpp:
(WebCore::UserMessageHandlerDescriptor::UserMessageHandlerDescriptor):
(WebCore::UserMessageHandlerDescriptor::~UserMessageHandlerDescriptor):
(WebCore::UserMessageHandlerDescriptor::name):
(WebCore::UserMessageHandlerDescriptor::world):
* page/UserMessageHandlerDescriptor.h:
(WebCore::UserMessageHandlerDescriptor::Client::~Client): Deleted.
(WebCore::UserMessageHandlerDescriptor::create): Deleted.
(WebCore::UserMessageHandlerDescriptor::client): Deleted.
(WebCore::UserMessageHandlerDescriptor::invalidateClient): Deleted.
Simplify by removing the Client. Now, when the UserMessageHandlerDescriptor is no longer
active, it gets nulled out in the UserMessageHandler.

* page/UserMessageHandlersNamespace.cpp:
(WebCore::UserMessageHandlersNamespace::UserMessageHandlersNamespace):
(WebCore::UserMessageHandlersNamespace::~UserMessageHandlersNamespace):
(WebCore::UserMessageHandlersNamespace::didInvalidate):
(WebCore::UserMessageHandlersNamespace::handler):
* page/UserMessageHandlersNamespace.h:
Change the logic to listen for invalidations of the UserMessageHandlerDescriptor map. When it
is invalidated, re-build the map of cached UserMessageHandlers from the UserContentProvider,
and invalidate any remaining UserMessageHandlers that no longer exist in the UserContentProvider.

* page/WebKitNamespace.cpp:
(WebCore::WebKitNamespace::WebKitNamespace):
* page/WebKitNamespace.h:
(WebCore::WebKitNamespace::create):
Pass through the UserContentProvider.

Source/WebKit2:

* Scripts/webkit/messages.py:
(headers_for_type):
* Shared/WebUserContentControllerDataTypes.cpp:
(WebKit::WebScriptMessageHandlerData::encode):
(WebKit::WebScriptMessageHandlerData::decode):
* Shared/WebUserContentControllerDataTypes.h:
Add WebKit::WebScriptMessageHandlerData, matching WebKit::WebUserScriptData and
WebKit::WebUserStyleSheetData.

* UIProcess/API/Cocoa/WKUserContentController.mm:
(-[WKUserContentController addScriptMessageHandler:name:]):
(-[WKUserContentController removeScriptMessageHandlerForName:]):
(-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithUserContentWorld:]):
(-[WKUserContentController _addScriptMessageHandler:name:userContentWorld:]):
(-[WKUserContentController _removeScriptMessageHandlerForName:userContentWorld:]):
(-[WKUserContentController _removeAllScriptMessageHandlersAssociatedWithUserContentWorld:]):
* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
Add SPI for adding and removing ScriptMessageHandlers associated with a world.

* UIProcess/UserContent/WebScriptMessageHandler.cpp:
(WebKit::WebScriptMessageHandler::create):
(WebKit::WebScriptMessageHandler::WebScriptMessageHandler):
(WebKit::WebScriptMessageHandlerHandle::encode): Deleted.
(WebKit::WebScriptMessageHandlerHandle::decode): Deleted.
* UIProcess/UserContent/WebScriptMessageHandler.h:
(WebKit::WebScriptMessageHandler::identifier):
(WebKit::WebScriptMessageHandler::name):
(WebKit::WebScriptMessageHandler::userContentWorld):
(WebKit::WebScriptMessageHandler::client):
(WebKit::WebScriptMessageHandler::handle): Deleted.
Add the world and move the data object to WebUserContentControllerDataTypes.h

* UIProcess/UserContent/WebUserContentControllerProxy.cpp:
(WebKit::WebUserContentControllerProxy::addProcess):
(WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
(WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
(WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
* UIProcess/UserContent/WebUserContentControllerProxy.h:
Update for worlds, matching UserScript/UserStyleSheet model.

* WebProcess/UserContent/WebUserContentController.h:
* WebProcess/UserContent/WebUserContentController.cpp:
(WebKit::WebUserMessageHandlerDescriptorProxy::WebUserMessageHandlerDescriptorProxy):
Change to inherit directly from WebCore::UserMessageHandlerDescriptor.

(WebKit::WebUserContentController::addUserScriptMessageHandlers):
(WebKit::WebUserContentController::removeUserScriptMessageHandler):
(WebKit::WebUserContentController::removeAllUserScriptMessageHandlers):
(WebKit::WebUserContentController::addUserScriptMessageHandlerInternal):
(WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
Add support for worlds, matching UserScript/UserStyleSheet model.

(WebKit::WebUserContentController::addUserStyleSheets):
Add missing call to invalidateInjectedStyleSheetCacheInAllFramesInAllPages()

(WebKit::WebUserContentController::removeAllUserStyleSheets):
Switch to only calling invalidateInjectedStyleSheetCacheInAllFramesInAllPages() once
after the loop and only if any stylesheets were removed.

(WebKit::WebUserContentController::addUserStyleSheetInternal):
Remove call to invalidateInjectedStyleSheetCacheInAllFramesInAllPages(), make
callers call it. This allows us to avoid calling it repeatedly in removeAllUserStyleSheets().

(WebKit::WebUserContentController::addUserStyleSheet):
Call invalidateInjectedStyleSheetCacheInAllFramesInAllPages() explicitly since it
is no longer called in addUserStyleSheetInternal().

(WebKit::WebUserContentController::forEachUserMessageHandler):
Implement by iterating the m_userMessageHandlers map.

* WebProcess/UserContent/WebUserContentController.messages.in:
Update for worlds, matching UserScript/UserStyleSheet model.

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/UserContentController.mm:
Add new test, WKUserContentController.ScriptMessageHandlerBasicPostIsolatedWorld

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

4 years agoSkipping crashing test fast/loader/opaque-base-url.html on Debug
ryanhaddad@apple.com [Mon, 4 Apr 2016 20:45:01 +0000 (20:45 +0000)]
Skipping crashing test fast/loader/opaque-base-url.html on Debug
https://bugs.webkit.org/show_bug.cgi?id=156179

Unreviewed test gardening.

* TestExpectations:

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

4 years agoBuild fix for r198956.
jiewen_tan@apple.com [Mon, 4 Apr 2016 20:16:50 +0000 (20:16 +0000)]
Build fix for r198956.

Unreviewed.

* TestWebKitAPI/Tests/WebKit2Cocoa/LoadInvalidURLRequest.mm:
(-[LoadInvalidURLNavigationActionDelegate webView:didFailProvisionalNavigation:withError:]):
* TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm:
(-[LoadInvalidURLWebFrameLoadDelegate webView:didFailProvisionalLoadWithError:forFrame:]):

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

4 years agoRegression(r196145): Crash in getOwnPropertyDescriptor on http://www.history.com...
cdumez@apple.com [Mon, 4 Apr 2016 20:01:38 +0000 (20:01 +0000)]
Regression(r196145): Crash in getOwnPropertyDescriptor on history.com/shows/vikings
https://bugs.webkit.org/show_bug.cgi?id=156136
<rdar://problem/25410767>

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

Add a few more identifiers for using in the generated bindings.

* runtime/CommonIdentifiers.h:

Source/WebCore:

The page was crashing when doing the following:
Object.getOwnPropertyDescriptor(window, "indexedDB")

getOwnPropertyDescriptor() expected getDirect() to return a CustomGetterSetter for
CustomAccessors but it was not the case for window.indexedDB. The reason was that
window.indexedDB was a special property, which is not part of the static table but
returned by GetOwnPropertySlot() if IndexedDB feature is enabled. This weirdness
was due to our bindings generator not having proper support for [EnabledAtRuntime]
properties on Window.

This patch adds support for [EnabledAtRuntime] properties on Window by omitting
these properties from the static property table and then setting them at runtime
in JSDOMWindow::finishCreation() if the corresponding feature is enabled.
window.indexedDB now looks like a regular property when IndexedDB is enabled
and getOwnPropertyDescriptor() works as expected for this property.

Test: storage/indexeddb/indexeddb-getownpropertyDescriptor.html

* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::indexedDB):
* Modules/indexeddb/DOMWindowIndexedDatabase.h:
The generated bindings pass DOMWindow by reference instead of pointer so update
the implementation accordingly.

* Modules/indexeddb/DOMWindowIndexedDatabase.idl:
Add 'indexedDB' and 'webkitIndexedDB' properties and mark them as
[EnabledAtRuntime]. Now that the bindings generator correctly handles
[EnabledAtRuntime] properties on the Window, there is no need to
custom-handle them in JSDOMWindowCustom.

* bindings/js/JSDOMWindowCustom.cpp:
Drop custom handling for 'indexedDB' and 'webkitIndexedDB' properties
in getOwnPropertySlot(). The generated bindings code now makes sure to
only set those properties on the Window if IndexedDB is enabled so we
can let the regular code path look up those properties.

* bindings/scripts/CodeGeneratorJS.pm:
(GetJSCAttributesForAttribute):
(GenerateHeader):
(GeneratePropertiesHashTable):
(GenerateImplementation):
Add support for [EnabledAtRuntime] properties on DOMWindow. For such
properties, we do the following:
1. Omit them from the static property table
2. In JSDOMWindow::finishCreation(), dynamically add those properties
   at runtime if the corresponding feature is enabled.

Note that this works for constructors as well.

* inspector/InspectorIndexedDBAgent.cpp:
(WebCore::assertIDBFactory):
Pass Window by reference instead of pointer.

LayoutTests:

Add a layout test to confirm that calling Object.getOwnPropertyDescriptor(window, "indexedDB")
does not crash and works as expected.

* storage/indexeddb/indexeddb-getownpropertyDescriptor-expected.txt: Added.
* storage/indexeddb/indexeddb-getownpropertyDescriptor.html: Added.

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

4 years agoCopiedBlock should be 16kB
ggaren@apple.com [Mon, 4 Apr 2016 19:41:34 +0000 (19:41 +0000)]
CopiedBlock should be 16kB
https://bugs.webkit.org/show_bug.cgi?id=156168

Reviewed by Mark Lam.

MarkedBlock is 16kB, and bmalloc's largest fast-path allocation is 16kB,
and the largest page size on Apple devices is 16kB -- so this change
should improve sharing and recycling and keep us on the fast path more.

32kB is also super aggro. At 16kB, we support allocations up to 8kB,
which covers 99.3% of allocations on facebook.com. The 32kB block size
only covered an additional 0.2% of allocations.

* heap/CopiedBlock.h:

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

4 years agoAddressing post-review feedback on r198970
mmaxfield@apple.com [Mon, 4 Apr 2016 19:41:29 +0000 (19:41 +0000)]
Addressing post-review feedback on r198970
https://bugs.webkit.org/show_bug.cgi?id=156123

Unreviewed.

* platform/text/BidiResolver.h:
(WebCore::BidiCharacterRun::~BidiCharacterRun):

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

4 years ago[SVG -> OTF Converter] Crash when trying to re-convert a previously-failed font conve...
mmaxfield@apple.com [Mon, 4 Apr 2016 19:39:10 +0000 (19:39 +0000)]
[SVG -> OTF Converter] Crash when trying to re-convert a previously-failed font conversion
https://bugs.webkit.org/show_bug.cgi?id=156175
<rdar://problem/25130547>

Reviewed by David Kilzer.

m_externalSVGFontElement points inside the document owned by m_externalSVGDocument.
However, when the m_externalSVGDocument is destroyed (due to a failed conversion),
we weren't resetting m_externalSVGFontElement. Then, when trying to re-convert, we
were using the fact that m_externalSVGFontElement is non-null to mean it's valid.

Test: fast/text/svg-font-invalid-glyph-path-failure.html (Under GuardMalloc)

* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData):

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

4 years agoMarking plugins/focus.html as flaky on mac
ryanhaddad@apple.com [Mon, 4 Apr 2016 18:35:11 +0000 (18:35 +0000)]
Marking plugins/focus.html as flaky on mac
https://bugs.webkit.org/show_bug.cgi?id=156174

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoProperly generate static functions that return Promises
andersca@apple.com [Mon, 4 Apr 2016 18:30:28 +0000 (18:30 +0000)]
Properly generate static functions that return Promises
https://bugs.webkit.org/show_bug.cgi?id=156169

Reviewed by Sam Weinig.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateReturnParameters):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
* bindings/scripts/test/TestObj.idl:

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

4 years ago[EFL] Fix build break since r198800
jh718.park@samsung.com [Mon, 4 Apr 2016 18:20:37 +0000 (18:20 +0000)]
[EFL] Fix build break since r198800
https://bugs.webkit.org/show_bug.cgi?id=156011

Reviewed by Alex Christensen.

Source/WebCore:

* PlatformEfl.cmake: Remove temorary statement which was applied to avoid build failure of Efl port.

Source/WebKit2:

* CMakeLists.txt: Currently circular dependency state exists between WebCoreDerivedSources and WebCore targets.
By adding -Wl,--start-group -Wl,--end-group linker option, we can resolve this problem.
In case there is no such circular dependency, this linker option does nothing.

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

4 years agoRebaseline fast/scrolling/rtl-scrollbars-animation-property.html for Windows
ryanhaddad@apple.com [Mon, 4 Apr 2016 18:02:55 +0000 (18:02 +0000)]
Rebaseline fast/scrolling/rtl-scrollbars-animation-property.html for Windows

Unreviewed test gardening

* platform/win/fast/scrolling/rtl-scrollbars-animation-property-expected.txt:

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

4 years ago[win] prepare-ChangeLog should treat windows path differently.
commit-queue@webkit.org [Mon, 4 Apr 2016 17:44:01 +0000 (17:44 +0000)]
[win] prepare-ChangeLog should treat windows path differently.
https://bugs.webkit.org/show_bug.cgi?id=156120

Patch by Bill Ming <mbbill@gmail.com> on 2016-04-04
Reviewed by Brent Fulgham.

* Scripts/prepare-ChangeLog:

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

4 years agoRe-disable event dispatch assertions in RenderTreeUpdater::updateRenderTree
antti@apple.com [Mon, 4 Apr 2016 17:40:20 +0000 (17:40 +0000)]
Re-disable event dispatch assertions in RenderTreeUpdater::updateRenderTree
https://bugs.webkit.org/show_bug.cgi?id=156172

Some ruby tests on iOS hit these.

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):

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

4 years agoREGRESSION(r198492): [GTK] The WEB_RTC flag was not correctly added in some situations
commit-queue@webkit.org [Mon, 4 Apr 2016 16:12:43 +0000 (16:12 +0000)]
REGRESSION(r198492): [GTK] The WEB_RTC flag was not correctly added in some situations
https://bugs.webkit.org/show_bug.cgi?id=156164

Patch by Alejandro G. Castro <alex@igalia.com> on 2016-04-04
Reviewed by Philippe Normand.

.:

Remove double space in the error message when openwebrtc is not present.

* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

Replace WEBRTC with WEB_RTC, in the idls add the new option
UsePointersEvenForNonNullableObjectArguments to fix compilation.

* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpReceiver.cpp:
* Modules/mediastream/RTCRtpReceiver.h:
* Modules/mediastream/RTCRtpSender.cpp:
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCRtpSenderReceiverBase.h:
* Modules/mediastream/RTCSessionDescription.cpp:
* Modules/mediastream/RTCSessionDescription.h:
* Modules/mediastream/RTCStatsReport.cpp:
* Modules/mediastream/RTCStatsResponse.cpp:
* Modules/mediastream/RTCTrackEvent.cpp:
* Modules/mediastream/RTCTrackEvent.h:
* Modules/mediastream/SDPProcessor.cpp:
* Modules/mediastream/SDPProcessor.h:
* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
* bindings/generic/RuntimeEnabledFeatures.h:
* bindings/js/WebCoreJSBuiltinInternals.cpp:
(WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
(WebCore::JSBuiltinInternalFunctions::visit):
(WebCore::JSBuiltinInternalFunctions::initialize):
* bindings/js/WebCoreJSBuiltinInternals.h:
* bindings/js/WebCoreJSBuiltins.h:
(WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
* platform/mediastream/RTCSessionDescriptionDescriptor.cpp:
* platform/mediastream/RTCSessionDescriptionDescriptor.h:
* platform/mediastream/RTCSessionDescriptionRequest.h:
* platform/mediastream/RTCStatsRequest.h:
* platform/mediastream/RTCStatsResponseBase.h:
* platform/mediastream/RTCVoidRequest.h:
* platform/mediastream/SDPProcessorScriptResource.cpp:
* platform/mediastream/SDPProcessorScriptResource.h:
* platform/mock/TimerEventBasedMock.h:

Tools:

Enable the new WEB_RTC option by default for Gtk+.

* Scripts/webkitperl/FeatureList.pm:

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

4 years ago[GTK] Added missing inspector files under UserInterface/Proxies.
commit-queue@webkit.org [Mon, 4 Apr 2016 15:46:17 +0000 (15:46 +0000)]
[GTK] Added missing inspector files under UserInterface/Proxies.
https://bugs.webkit.org/show_bug.cgi?id=156165

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-04-04
Reviewed by Michael Catanzaro.

* PlatformGTK.cmake:

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

4 years agoREGRESSION(r198792): [GTK] Inspector crashes in Inspector::Protocol::getEnumConstantV...
commit-queue@webkit.org [Mon, 4 Apr 2016 14:30:35 +0000 (14:30 +0000)]
REGRESSION(r198792): [GTK] Inspector crashes in Inspector::Protocol::getEnumConstantValue since r198792
https://bugs.webkit.org/show_bug.cgi?id=155745
<rdar://problem/25289456>

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2016-04-04
Reviewed by Brian Burg.

Source/JavaScriptCore:

The problem is that we are generating the Inspector::Protocol::getEnumConstantValue() method and the
enum_constant_values array for every framework that has enum values. So, in case of GTK port we have two
implementations, one for the inspector in JavaScriptCore and another one for Web Automation in WebKit2, but when
using the inspector in WebKit2 we always end up using the one in WebKit2. Since the enum_constant_values array
is smaller in WebKit2 than the one in JavaScriptCore, we crash every time we receive an enum value higher than
the array size. We need to disambiguate the getEnumConstantValue() generated and used for every framework, so we
can use a specific namespace for the enum conversion methods.

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::breakpointActionTypeForString): Use Inspector::Protocol::InspectorHelpers.
* inspector/scripts/codegen/cpp_generator.py:
(CppGenerator.helpers_namespace): Return the namespace name that should be used for the helper methods.
* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
(CppBackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain): Use
CppGenerator.helpers_namespace() to use the right namespace when using getEnumConstantValue().
(CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command): Ditto.
* inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py:
(CppFrontendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_event): Ditto.
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
(CppProtocolTypesHeaderGenerator.generate_output): Move declaration of getEnumConstantValue to a helper function.
(_generate_enum_constant_value_conversion_methods): Do not emit any code if there aren't enums and ensure all
conversion methods are declared inside the helpers namespace.
(_generate_builder_setter_for_member): Use CppGenerator.helpers_namespace() to use the right namespace when
using getEnumConstantValue().
(_generate_unchecked_setter_for_member): Ditto.
(_generate_declarations_for_enum_conversion_methods): Return a list instead of a string so that we can return an
empty list in case of not emitting any code. The caller will use extend() that has no effect when an empty list
is passed.
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator.generate_output): Use the new helper function to generate both the enum
mapping and conversion methods inside the helpers namespace.
(CppProtocolTypesImplementationGenerator._generate_enum_mapping): Return a list instead of a string so that we
can return an empty list in case of not emitting any code.
(CppProtocolTypesImplementationGenerator._generate_enum_mapping_and_conversion_methods): Ensure we only emit
code when there are enum values, and it's generated inside the helpers namespace.
* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:

Source/WebCore:

Use Inspector::Protocol::AutomationEnums namespace for getEnumConstantValue().

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::addRecordToTimeline):

Source/WebKit2:

Use Inspector::Protocol::AutomationEnums namespace for getEnumConstantValue().

* UIProcess/Automation/WebAutomationSession.cpp:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
(WebKit::WebAutomationSessionProxy::resolveParentFrame):
(WebKit::WebAutomationSessionProxy::computeElementLayout):

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

4 years agoAvoid double traversal in RenderTreeUpdater for slot roots
antti@apple.com [Mon, 4 Apr 2016 13:40:10 +0000 (13:40 +0000)]
Avoid double traversal in RenderTreeUpdater for slot roots
https://bugs.webkit.org/show_bug.cgi?id=156110

Reviewed by Andreas Kling.

* style/RenderTreeUpdater.cpp:
(WebCore::hasDisplayContents):
(WebCore::findRenderingRoot):
(WebCore::findRenderingRoots):
(WebCore::RenderTreeUpdater::commit):

    If there are multiple roots that are slots we may end up updating the same rendering root multiple times.
    Fix by deduplicating the roots.

(WebCore::RenderTreeUpdater::updateRenderTree):

    Some cleanups.

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

4 years agoEnable assertions against DOM mutations in RenderTreeUpdater
antti@apple.com [Mon, 4 Apr 2016 12:56:33 +0000 (12:56 +0000)]
Enable assertions against DOM mutations in RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=156156

Reviewed by Andreas Kling.

Ensure we don't mutate DOM or dispatch events during render tree updates.

* WebCore.xcodeproj/project.pbxproj:
* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
(WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Deleted.
(WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Deleted.
(WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Deleted.

    Move NoEventDispatchAssertion to a header of its own.

* dom/NoEventDispatchAssertion.h: Added.
(WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion):
(WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion):
(WebCore::NoEventDispatchAssertion::isEventDispatchForbidden):
(WebCore::NoEventDispatchAssertion::dropTemporarily):
(WebCore::NoEventDispatchAssertion::restoreDropped):

    Add a way to disable event assertions temporarily.

* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData):

    Temporary SVG font document may get constructed during render tree update. These can't run scripts or generally
    affect anything outside the font document as it does not have a frame. Disable event assertions temporarily.

    Tested by svg/W3C-SVG-1.1/fonts-elem-07-b.svg

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):

    Enable assertions.

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

4 years agoFix WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX after r196500
commit-queue@webkit.org [Mon, 4 Apr 2016 10:26:28 +0000 (10:26 +0000)]
Fix WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX after r196500
https://bugs.webkit.org/show_bug.cgi?id=156060

Patch by Emanuele Aina <emanuele.aina@collabora.com> on 2016-04-04
Reviewed by Darin Adler.

Commit r196500 was a bit too eager in removing the
platformGetLaunchOptions() callsites as non-mac platform still use
that in debug builds to attach debugging tools to spawned
subprocesses (eg. gdbserver).

Instead of reinstating them and relying on each subprocess type to
implement its own platformGetLaunchOptions() version (all alike),
avoid duplication and check the *_PROCESS_CMD_PREFIX environment
variables in a single place, ChildProcessProxy::getLaunchOptions().

Doing so also improves consistency in *_PROCESS_CMD_PREFIX support:
only WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX worked with
both the GTK and EFL ports while PLUGIN_PROCESS_CMD_PREFIX only
worked for EFL and there was no corresponding
DATABASE_PROCESS_CMD_PREFIX implementation.

* UIProcess/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::getLaunchOptions): Check the
appropriate *_PROCESS_CMD_PREFIX environment variable.
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::platformGetLaunchOptions): Drop
check for PLUGIN_PROCESS_COMMAND_PREFIX, now handled by
ChildProcessProxy::getLaunchOptions().
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebProcessProxy.h: Drop platformGetLaunchOptions()
prototypes.
* UIProcess/Network/soup/NetworkProcessProxySoup.cpp:
* UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp:
* UIProcess/Databases/gtk/DatabaseProcessProxyGtk.cpp:
* UIProcess/efl/WebProcessProxyEfl.cpp:
* UIProcess/gtk/WebProcessProxyGtk.cpp: Removed, they only contained
platformGetLaunchOptions() implementations.
* PlatformEfl.cmake:
* PlatformGTK.cmake: Drop removed files.

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

4 years ago[TexMap] Trim redundant guards
commit-queue@webkit.org [Mon, 4 Apr 2016 10:26:23 +0000 (10:26 +0000)]
[TexMap] Trim redundant guards
https://bugs.webkit.org/show_bug.cgi?id=155927

Patch by Emanuele Aina <emanuele.aina@collabora.com> on 2016-04-04
Reviewed by Žan Doberšek.

* platform/graphics/GraphicsContext3DPrivate.cpp: Drop some redundant
checks in preprocessor guards.

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

4 years agoRely on PlatformLayer to choose the TextureMapperPlatformLayer impl
commit-queue@webkit.org [Mon, 4 Apr 2016 10:21:35 +0000 (10:21 +0000)]
Rely on PlatformLayer to choose the TextureMapperPlatformLayer impl
https://bugs.webkit.org/show_bug.cgi?id=155926

Patch by Emanuele Aina <emanuele.aina@collabora.com> on 2016-04-04
Reviewed by Žan Doberšek.

Use PlatformLayer to replace a bunch of subtly different #ifdef
scattered over the codebase to choose between TextureMapperPlatformLayer
and TextureMapperPlatformLayerProxyProvider.

* platform/graphics/GraphicsContext3DPrivate.h:
* platform/graphics/cairo/ImageBufferDataCairo.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Use
PlatformLayer.h an inherit from PlatformLayer instead of choosing the
right implementation every time.
* platform/graphics/texmap/TextureMapperPlatformLayer.h: Add
TEXTURE_MAPPER guards to make it unconditionally usable.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h: Add
COORDINATED_GRAPHICS_THREADED guards to make it unconditionally
usable.

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

4 years agoUnreviewed ARM buildfix after r198981.
ossy@webkit.org [Mon, 4 Apr 2016 08:51:30 +0000 (08:51 +0000)]
Unreviewed ARM buildfix after r198981.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::roundTowardZeroDouble):

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

4 years agoRefactor RenderMathMLRow layout functions to avoid using flexbox
fred.wang@free.fr [Mon, 4 Apr 2016 08:25:37 +0000 (08:25 +0000)]
Refactor RenderMathMLRow layout functions to avoid using flexbox
https://bugs.webkit.org/show_bug.cgi?id=153208

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

Source/WebCore:

This is the first patch to rewrite MathML layout without relying on
flexboxes or anonymous renderers.
We have done some temporary changes to allow overriding of
layoutBlock and to implement paintChildren, but this will be remove in a
follow-up patch. We also implement firstLineBaseline,
computePreferredLogicalWidths and layoutBlock of RenderMathMLRow without
using any flexbox functions. We adjust a bit the MathML CSS to take into
account these changes. Finally, we delete the unused helper function to
create anonymous RenderMathMLRow.

* css/mathml.css:
(ms, mtext, mi, mn, mo, annotation, mtd): Prevent linebreaking inside token elements and table cells, otherwise this cause test failures with the new implementation of RenderMathMLRow.
(math, mrow, mfenced, merror, mphantom, mstyle, menclose): Deleted. We no longer rely on flexbox for baseline alignment of RenderMathMLRow.
* rendering/RenderFlexibleBox.h: Allow overrider of the LayoutBlock for the moment.
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderMathMLMenclose): Add helper function.
* rendering/mathml/RenderMathMLMenclose.h: ditto.
* rendering/mathml/RenderMathMLBlock.h:
(WebCore::ascentForChild): Add helper function to easily compute the ascent of a child.
* rendering/mathml/RenderMathMLRow.cpp: Reimplement the class without using the flexbox layout.
(WebCore::RenderMathMLRow::firstLineBaseline): Implement the function to determine the baseline.
(WebCore::RenderMathMLRow::computeLineVerticalStretch): Add a function that browses non-stretchy children to determine the desired vertical stretch metrics.
(WebCore::RenderMathMLRow::computePreferredLogicalWidths): Implement the function to determine the preferred widths of the RenderMathMLRow.
(WebCore::RenderMathMLRow::layoutRowItems): Helper function that layouts children (stretching vertical operators if needed), calculate the exact logical width and position children.
(WebCore::RenderMathMLRow::layoutBlock): Implement the function to do the actual layout, which essentially calls layoutRowItems.
(WebCore::RenderMathMLRow::paintChildren): Temporarily implement this function, which just calls paintChild on each child.
(WebCore::RenderMathMLRow::createAnonymousWithParentRenderer): Deleted. We actually don't create anonymous RenderMathMLRow at the moment.
(WebCore::RenderMathMLRow::layout): Deleted.
* rendering/mathml/RenderMathMLRow.h: Update declarations of functions.

LayoutTests:

Apply some small adjustments to MathML tests after the refactoring of RenderMathMLRow.

* TestExpectations: Skip fractions-positions reftest for now. The small difference will be fixed after refactoring completely RenderMathMLFraction.
  We also ignore a test for margin/padding on MathML renderers.
* platform/gtk/mathml/opentype/opentype-stretchy-horizontal-expected.png: Update reference to take into account small changes in stretch size.
The intended test behavior (reading variants and construction from the MATH table) is preserved.
* platform/gtk/mathml/opentype/opentype-stretchy-horizontal-expected.txt: ditto.
* platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.png: ditto.
* platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt: ditto.

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

4 years agoAX: Consolidate radio button group member code with that in HTMLElement derivatives
cfleizach@apple.com [Mon, 4 Apr 2016 07:53:40 +0000 (07:53 +0000)]
AX: Consolidate radio button group member code with that in HTMLElement derivatives
https://bugs.webkit.org/show_bug.cgi?id=155696
<rdar://problem/25260379>

Reviewed by Darin Adler.

Behavior covered by existing tests.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
* dom/CheckedRadioButtons.cpp:
(WebCore::RadioButtonGroup::isValid):
(WebCore::RadioButtonGroup::members):
(WebCore::RadioButtonGroup::setCheckedButton):
(WebCore::CheckedRadioButtons::addButton):
(WebCore::CheckedRadioButtons::groupMembers):
(WebCore::CheckedRadioButtons::updateCheckedState):
* dom/CheckedRadioButtons.h:
* dom/Range.h:
(WebCore::documentOrderComparator):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isInRequiredRadioButtonGroup):
(WebCore::HTMLInputElement::radioButtonGroup):
(WebCore::HTMLInputElement::checkedRadioButtonForGroup):
* html/HTMLInputElement.h:

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

4 years ago[EFL] Unreviewed EFL Gardening on 4th Apr.
hs85.jeong@samsung.com [Mon, 4 Apr 2016 07:42:31 +0000 (07:42 +0000)]
[EFL] Unreviewed EFL Gardening on 4th Apr.

Rebaseline some unexpected failures.

* platform/efl/editing/execCommand/5481523-expected.txt: Rebaseline after r195740
* platform/efl/fast/css/layerZOrderCrash-expected.txt: Rebaseline after r195740
* platform/efl/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt: Rebaseline after r187380
* platform/efl/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt: Rebaseline after r187380
* platform/efl/fast/css/word-space-extra-expected.txt: Rebaseline after r192660
* platform/efl/fast/table/click-near-anonymous-table-expected.txt: Rebaseline after r195740
* platform/efl/fast/text/svg-font-face-with-kerning-expected.txt: Added. Rebaseline after r182620
* platform/efl/fast/text/textIteratorNilRenderer-expected.txt: Rebaseline after r195740
* platform/efl/fast/text/trak-optimizeLegibility-expected.txt: Added. Rebaseline after r191623
* platform/efl/fast/transforms/bounding-rect-zoom-expected.txt: Rebaseline after r191623
* platform/efl/svg/wicd/test-rightsizing-b-expected.txt: Rebaseline after r182620

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

4 years agobmalloc: segregate small and large objects again, and allocate more objects on the...
ggaren@apple.com [Mon, 4 Apr 2016 05:26:43 +0000 (05:26 +0000)]
bmalloc: segregate small and large objects again, and allocate more objects on the small path
https://bugs.webkit.org/show_bug.cgi?id=156152

Reviewed by Sam Weinig.

Microbenchmark data suggested that it was a good idea for small and large
objects to share memory. But r198675 did not improve memory use in
full browser benchmarks.

This patch reverts to segregating small and large objects -- but without
going back to doubled VM usage -- in order to capture a few benefits:

(*) Small pages fragment the large heap. Separating them out saves a lot
of memory in our worst case fragmentation recording:

    nimlang                                          276,076kB                      209,636kB                ^ 1.32x smaller

(*) Small objects are common enough that even their slow paths benefit
from simpler code:

Execution Time:
    ...
    facebook                                             234ms                          216ms                 ^ 1.08x faster
    reddit                                               114ms                          108ms                 ^ 1.06x faster
    flickr                                               118ms                          111ms                 ^ 1.06x faster
    theverge                                             146ms                          140ms                 ^ 1.04x faster
    ...
    <arithmetic mean>                                    107ms                          102ms                 ^ 1.04x faster

(*) We can use less metadata:

Memory at End:
    ...
    list_allocate                                        460kB                          384kB                 ^ 1.2x smaller
    tree_allocate                                        492kB                          424kB                ^ 1.16x smaller
    tree_churn                                           480kB                          404kB                ^ 1.19x smaller
    fragment                                             532kB                          452kB                ^ 1.18x smaller
    fragment_iterate                                     712kB                          588kB                ^ 1.21x smaller
    medium                                            15,152kB                       11,796kB                ^ 1.28x smaller
    big                                               15,044kB                       10,976kB                ^ 1.37x smaller
    ...
    <arithmetic mean>                                  7,724kB                        7,190kB                ^ 1.07x smaller

This patch also takes advantage of our support for varying the page size
at runtime by allocating more objects on the small object path:

    medium                                               178ms                          150ms                 ^ 1.19x faster

Some microbenchmarks report memory use increases from this change -- like
they reported memory use decreases from r198675 -- but I'm ignoring them
for now because I expect our full browser memory benchmarks to confirm
that this patch is fine.

* bmalloc/BumpAllocator.h:
(bmalloc::BumpAllocator::BumpAllocator): Use a full unsigned because we
can allocate objects larger than 16kB - 1, and a full unsigned does not
make BumpAllocator any larger on 64bit systems.

* bmalloc/Chunk.h:
(bmalloc::Chunk::begin):
(bmalloc::Chunk::end):
(bmalloc::Chunk::size):
(bmalloc::Chunk::objectType): Store ObjectType in the Chunk, since it only
varies by Chunk now, and not from page to page within a Chunk. Also,
union together small and large object metadata, since we will only use
one or the other. This saves memory.

(bmalloc::Chunk::Chunk): Conditionalize initialization based on object
type, since only one kind of metadata or the other can be used at runtime.

(bmalloc::Object::Object):
(bmalloc::Object::begin):
(bmalloc::SmallPage::end): Deleted.

* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
(bmalloc::Heap::initializeLineMetadata): Save a little space, since we
know that lines are only 256 bytes long.

(bmalloc::Heap::initializePageMetadata): Store a dynamic page size for
each size class. We used to use only one page size (the system page size)
but that limited our ability to allocate objects larger than 1kB on the
small object path. Now we can handle any object size we want by storing
objects of that size in a custom page size.

(bmalloc::Heap::concurrentScavenge):
(bmalloc::Heap::scavenge):
(bmalloc::Heap::scavengeSmallPages): Revert to our old linked list
strategy for storing small pages.

(bmalloc::Heap::splitAndAllocate): Object type is per Chunk now.

(bmalloc::Heap::allocateLarge): Don't nuke the small page list when
allocating a large object because the two don't share memory anymore.

(bmalloc::Heap::allocateSmallPage): Revert to our old linked list
strategy for storing small pages.

(bmalloc::Heap::deallocateSmallLine): Don't return early in the case
where this is the first free object in the page. In the case of large-ish
objects, the first free object might also be the last free object,
since there's one object per page.

(bmalloc::Heap::allocateSmallBumpRangesByMetadata): Split out some helper
lambdas to make this code clearer.

(bmalloc::Heap::allocateSmallBumpRangesByObject): Added a fast scan
for objects larger than the line size. When multiple objects fit in
a single line, it's an optimization to scan a line at a time. But when
it's one object per line, or one object per 64 lines, it's better just
to scan an object at a time.

* bmalloc/Heap.h:
(bmalloc::Heap::allocateSmallBumpRanges):
(bmalloc::Heap::derefSmallLine): Match the changes above.

* bmalloc/LineMetadata.h: We weren't using all those bits.

* bmalloc/List.h:
(bmalloc::List::remove): Put a removed Node fully back into the default
(empty) state it was in before it entered the list. This change is not
observable, but it makes things clearer when you're debugging.

* bmalloc/Object.h:
(bmalloc::Object::Object):
(bmalloc::Object::chunk):
(bmalloc::Object::offset):
(bmalloc::Object::operator+):
(bmalloc::Object::operator<=): Added some helpers for iterating by object.

* bmalloc/ObjectType.cpp:
(bmalloc::objectType): Updated for API change.

* bmalloc/Sizes.h:
(bmalloc::Sizes::maskObjectSize):
(bmalloc::Sizes::objectSize):
(bmalloc::Sizes::pageSize): Support more page sizes.

* bmalloc/SmallPage.h:
(bmalloc::SmallPage::SmallPage):
(bmalloc::SmallPage::objectType): Deleted.
(bmalloc::SmallPage::setObjectType): Deleted.
(bmalloc::SmallPage::smallPageCount): Deleted.
(bmalloc::SmallPage::setSmallPageCount): Deleted. Object type is per
Chunk now, and we can infer page count from size class.

* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::allocateChunk):
(bmalloc::VMHeap::allocateSmallChunk):
* bmalloc/VMHeap.h:
(bmalloc::VMHeap::allocateSmallPage):
(bmalloc::VMHeap::deallocateSmallPage):
(bmalloc::VMHeap::allocateLargeObject): Support our old behavior of
storing free pages in linked lists.

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

4 years agoRemove unneeded UsePointersEvenForNonNullableObjectArguments in WebKitCSSMatrix.idl
darin@apple.com [Sun, 3 Apr 2016 23:01:47 +0000 (23:01 +0000)]
Remove unneeded UsePointersEvenForNonNullableObjectArguments in WebKitCSSMatrix.idl
https://bugs.webkit.org/show_bug.cgi?id=156142

Reviewed by Sam Weinig.

* css/WebKitCSSMatrix.idl: Removed UsePointersEvenForNonNullableObjectArguments.
It was having no effect, I think because there were no non-nullable object arguments.

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

4 years ago[GTK] Unreviewed GTK gardening.
clopez@igalia.com [Sun, 3 Apr 2016 22:00:32 +0000 (22:00 +0000)]
[GTK] Unreviewed GTK gardening.

Rebaseline many SVG tests after r197814 and mark new reported failures.

* platform/gtk/TestExpectations:
* platform/gtk/svg/W3C-SVG-1.1-SE/color-prop-05-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/color-prop-05-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/coords-dom-01-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/coords-dom-03-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/coords-dom-04-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/coords-units-03-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/filters-felem-01-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/filters-felem-01-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/filters-image-03-f-expected.txt:
* platform/gtk/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/interact-pointer-03-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/painting-control-04-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/painting-control-04-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/painting-marker-07-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/painting-marker-07-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/paths-dom-02-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/pservers-grad-17-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/pservers-grad-17-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/pservers-grad-20-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/pservers-grad-20-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/pservers-pattern-03-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/pservers-pattern-03-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/styling-css-04-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/styling-css-04-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/styling-pres-02-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/styling-pres-02-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/svgdom-over-01-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/svgdom-over-01-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/text-intro-02-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/text-intro-02-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/text-intro-05-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/text-intro-05-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/text-intro-09-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/text-intro-09-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/text-tref-03-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/text-tref-03-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/text-tspan-02-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/text-tspan-02-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-01-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-01-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-02-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-03-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-04-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-05-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-05-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-07-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/animate-elem-24-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/animate-elem-24-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/filters-light-04-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/filters-light-04-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/filters-turb-02-f-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-05-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-05-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-06-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-06-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/fonts-glyph-02-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/fonts-glyph-02-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/fonts-kern-01-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/masking-mask-01-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/masking-mask-01-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/pservers-grad-08-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/render-elems-06-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/render-elems-06-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/render-elems-07-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/render-elems-07-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/render-elems-08-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/render-elems-08-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/render-groups-01-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/render-groups-01-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/render-groups-03-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/render-groups-03-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/text-align-08-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/text-align-08-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/text-fonts-03-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/text-fonts-03-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/text-intro-01-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/text-intro-01-t-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/text-intro-02-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/text-intro-02-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/text-intro-03-b-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/text-intro-03-b-expected.txt: Added.
* platform/gtk/svg/W3C-SVG-1.1/text-intro-04-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/text-intro-04-t-expected.txt: Added.
* platform/gtk/svg/batik/text/textEffect-expected.png:
* platform/gtk/svg/batik/text/textEffect-expected.txt: Added.
* platform/gtk/svg/batik/text/textEffect3-expected.png:
* platform/gtk/svg/batik/text/textEffect3-expected.txt: Added.
* platform/gtk/svg/batik/text/textPosition2-expected.png:
* platform/gtk/svg/batik/text/textPosition2-expected.txt:
* platform/gtk/svg/custom/glyph-selection-arabic-forms-expected.png:
* platform/gtk/svg/custom/glyph-selection-arabic-forms-expected.txt:
* platform/gtk/svg/custom/glyph-selection-non-bmp-expected.png:
* platform/gtk/svg/custom/glyph-selection-non-bmp-expected.txt:
* platform/gtk/svg/custom/glyph-setting-d-attribute-expected.txt: Added.
* platform/gtk/svg/custom/glyph-transformation-with-hkern-expected.png:
* platform/gtk/svg/custom/glyph-transformation-with-hkern-expected.txt: Added.
* platform/gtk/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.png:
* platform/gtk/svg/custom/scrolling-embedded-svg-file-image-repaint-problem-expected.txt:
* platform/gtk/svg/custom/svg-fonts-in-text-controls-expected.txt: Added.
* platform/gtk/svg/custom/svg-fonts-no-latin-glyph-expected.txt: Added.
* platform/gtk/svg/custom/svg-fonts-segmented-expected.png:
* platform/gtk/svg/custom/svg-fonts-segmented-expected.txt:
* platform/gtk/svg/custom/svg-fonts-with-no-element-reference-expected.png:
* platform/gtk/svg/custom/svg-fonts-with-no-element-reference-expected.txt: Added.
* platform/gtk/svg/custom/svg-fonts-without-missing-glyph-expected.png:
* platform/gtk/svg/custom/svg-fonts-without-missing-glyph-expected.txt:
* platform/gtk/svg/custom/svg-fonts-word-spacing-expected.png:
* platform/gtk/svg/custom/svg-fonts-word-spacing-expected.txt:
* platform/gtk/svg/foreignObject/text-tref-02-b-expected.png:
* platform/gtk/svg/foreignObject/text-tref-02-b-expected.txt: Added.
* platform/gtk/svg/text/text-overflow-ellipsis-svgfont-expected.png:
* platform/gtk/svg/text/text-overflow-ellipsis-svgfont-expected.txt:
* platform/gtk/svg/text/text-text-05-t-expected.png:
* platform/gtk/svg/text/text-text-05-t-expected.txt: Added.
* platform/gtk/svg/transforms/text-with-mask-with-svg-transform-expected.png:
* platform/gtk/svg/transforms/text-with-mask-with-svg-transform-expected.txt: Added.
* platform/gtk/svg/wicd/test-rightsizing-b-expected.png:
* platform/gtk/svg/wicd/test-rightsizing-b-expected.txt:

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

4 years agoTighten ComposedTreeAncestorIterator to return Elements
antti@apple.com [Sun, 3 Apr 2016 22:00:20 +0000 (22:00 +0000)]
Tighten ComposedTreeAncestorIterator to return Elements
https://bugs.webkit.org/show_bug.cgi?id=150324

Reviewed by Andreas Kling.

Only other thing it could credibly return was Document. We can exclude it from the composed tree and avoid some casting.

* dom/ComposedTreeAncestorIterator.h:
(WebCore::ComposedTreeAncestorIterator::operator*):
(WebCore::ComposedTreeAncestorIterator::operator->):
(WebCore::ComposedTreeAncestorIterator::operator==):
(WebCore::ComposedTreeAncestorIterator::operator!=):
(WebCore::ComposedTreeAncestorIterator::operator++):
(WebCore::ComposedTreeAncestorIterator::get):
(WebCore::ComposedTreeAncestorIterator::ComposedTreeAncestorIterator):
(WebCore::ComposedTreeAncestorIterator::traverseParent):
(WebCore::ComposedTreeAncestorAdapter::begin):
(WebCore::ComposedTreeAncestorAdapter::end):
(WebCore::ComposedTreeAncestorAdapter::first):
* dom/Element.cpp:
(WebCore::Element::resolveComputedStyle):
* dom/Node.cpp:
(WebCore::Node::updateAncestorsForStyleRecalc):
(WebCore::Node::setNeedsStyleRecalc):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::isChildAllowed):
(WebCore::RenderNamedFlowThread::dispatchRegionOversetChangeEventIfNeeded):
* style/RenderTreeUpdater.cpp:
(WebCore::findRenderingRoot):
(WebCore::RenderTreeUpdater::commit):

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

4 years agoShadow DOM: Slot style is not computed
antti@apple.com [Sun, 3 Apr 2016 20:19:47 +0000 (20:19 +0000)]
Shadow DOM: Slot style is not computed
https://bugs.webkit.org/show_bug.cgi?id=156144

Reviewed by Darin Adler.

Source/WebCore:

We don’t currently compute style for active slots. While slots have have implicit display:contents and don’t create
boxes themselves the style should still inherit to slotted children.

Basically

<slot style=“color:red”></slot>

should work as expected.

The implementation falls out from the new style resolve architecture and this patch mostly just removes the special
case code that prevented this from working.

Test: fast/shadow-dom/css-scoping-shadow-slot-style.html

* html/HTMLSlotElement.h:
(WebCore::hasImplicitDisplayContents):

    Move to a shared location.

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::RenderTreeUpdater):
(WebCore::findRenderingRoot):
(WebCore::RenderTreeUpdater::updateRenderTree):

    Remove the special case code. What remains is a display:contents test for rendererless elements.

(WebCore::RenderTreeUpdater::updateElementRenderer):

    Don't create renderers for (implicit) display:contents.

(WebCore::hasDisplayContents): Deleted.
* style/StyleTreeResolver.cpp:
(WebCore::Style::detachRenderTree):
(WebCore::Style::affectsRenderedSubtree):

    Factor into a function.

(WebCore::Style::TreeResolver::resolveElement):

    Remove the special case code.

(WebCore::Style::TreeResolver::resolveComposedTree):

    Always resolve slots as we don't currently save their style.

LayoutTests:

* fast/shadow-dom/css-scoping-shadow-slot-style-expected.html: Added.
* fast/shadow-dom/css-scoping-shadow-slot-style.html: Added.

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

4 years agoImplement Annex B.3.3 function hoisting rules for function code
sbarati@apple.com [Sun, 3 Apr 2016 19:45:05 +0000 (19:45 +0000)]
Implement Annex B.3.3 function hoisting rules for function code
https://bugs.webkit.org/show_bug.cgi?id=155672

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

The spec states that functions declared inside a function
inside a block scope are subject to the rules of Annex B.3.3:
https://tc39.github.io/ecma262/#sec-block-level-function-declarations-web-legacy-compatibility-semantics

The rule states that functions declared in such blocks should
be local bindings of the block. If declaring the function's name
as a "var" in the function would not lead to a syntax error (i.e,
if we don't have a let/const/class variable with the same name)
and if we don't have a parameter with the same name, then we
implictly also declare the funcion name as a "var". When evaluating
the block statement we bind the hoisted "var" to be the value
of the local function binding.

There is one more thing we do for web compatibility. We allow
function declarations inside if/else statements that aren't
blocks. For such statements, we transform the code as if the
function were declared inside a block statement. For example:
``` function foo() { if (cond) function baz() { } }```
is transformed into:
``` function foo() { if (cond) { function baz() { } } }```

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::initializeDefaultParameterValuesAndSetupFunctionScopeStack):
(JSC::BytecodeGenerator::initializeBlockScopedFunctions):
* bytecompiler/BytecodeGenerator.h:
* parser/Nodes.cpp:
(JSC::ScopeNode::ScopeNode):
(JSC::ProgramNode::ProgramNode):
(JSC::ModuleProgramNode::ModuleProgramNode):
(JSC::EvalNode::EvalNode):
(JSC::FunctionNode::FunctionNode):
* parser/Nodes.h:
(JSC::ScopeNode::hasCapturedVariables):
(JSC::ScopeNode::captures):
(JSC::ScopeNode::hasSloppyModeHoistedFunction):
(JSC::ScopeNode::varDeclarations):
(JSC::ProgramNode::startColumn):
(JSC::ProgramNode::endColumn):
(JSC::EvalNode::startColumn):
(JSC::EvalNode::endColumn):
(JSC::ModuleProgramNode::startColumn):
(JSC::ModuleProgramNode::endColumn):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::didFinishParsing):
(JSC::Parser<LexerType>::parseStatement):
(JSC::Parser<LexerType>::parseIfStatement):
* parser/Parser.h:
(JSC::Scope::declareVariable):
(JSC::Scope::declareFunction):
(JSC::Scope::addSloppyModeHoistableFunctionCandidate):
(JSC::Scope::appendFunction):
(JSC::Scope::declareParameter):
(JSC::Scope::mergeInnerArrowFunctionFeatures):
(JSC::Scope::getSloppyModeHoistedFunctions):
(JSC::Scope::getCapturedVars):
(JSC::ScopeRef::containingScope):
(JSC::ScopeRef::operator==):
(JSC::ScopeRef::operator!=):
(JSC::Parser::declareFunction):
(JSC::Parser::hasDeclaredVariable):
(JSC::Parser::isFunctionMetadataNode):
(JSC::Parser::DepthManager::DepthManager):
(JSC::Parser<LexerType>::parse):
* parser/VariableEnvironment.h:
(JSC::VariableEnvironmentEntry::isImported):
(JSC::VariableEnvironmentEntry::isImportedNamespace):
(JSC::VariableEnvironmentEntry::isFunction):
(JSC::VariableEnvironmentEntry::isParameter):
(JSC::VariableEnvironmentEntry::isSloppyModeHoistingCandidate):
(JSC::VariableEnvironmentEntry::setIsCaptured):
(JSC::VariableEnvironmentEntry::setIsConst):
(JSC::VariableEnvironmentEntry::setIsImported):
(JSC::VariableEnvironmentEntry::setIsImportedNamespace):
(JSC::VariableEnvironmentEntry::setIsFunction):
(JSC::VariableEnvironmentEntry::setIsParameter):
(JSC::VariableEnvironmentEntry::setIsSloppyModeHoistingCandidate):
(JSC::VariableEnvironmentEntry::clearIsVar):
* runtime/CodeCache.h:
(JSC::SourceCodeValue::SourceCodeValue):
* runtime/JSScope.cpp:
* runtime/JSScope.h:
* tests/es6.yaml:
* tests/stress/sloppy-mode-function-hoisting.js: Added.
(assert):
(test):
(falsey):
(truthy):
(test.):
(test.a):
(test.f):
(test.let.funcs.f):
(test.catch.f):
(test.foo):
(test.bar):
(test.switch.case.0):
(test.else.f):
(test.b):
(test.c):
(test.d):
(test.e):
(test.g):
(test.h):
(test.i):
(test.j):
(test.k):
(test.l):
(test.m):
(test.n):
(test.o):
(test.p):
(test.q):
(test.r):
(test.s):
(test.t):
(test.u):
(test.v):
(test.w):
(test.x):
(test.y):
(test.z):
(foo):
(bar):
(falsey.bar):
(baz):
(falsey.baz):

LayoutTests:

* js/kde/func-decl-expected.txt:
* js/kde/script-tests/func-decl.js:
* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:
(valid):
(onlyValidGlobally):
(onlyInvalidGlobally):
(invalid):

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

4 years agoUse the correct value for the first nightly build with frameworks built for OS X...
mitz@apple.com [Sun, 3 Apr 2016 19:38:54 +0000 (19:38 +0000)]
Use the correct value for the first nightly build with frameworks built for OS X 10.11.

* Scripts/bisect-builds:
(makeNightlyList):

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

4 years agoMade bisect-builds work again.
mitz@apple.com [Sun, 3 Apr 2016 19:14:10 +0000 (19:14 +0000)]
Made bisect-builds work again.

Rubber-stamped by Sam Weinig.

* Scripts/bisect-builds:
Changed to use HTTPS to access nightly.webkit.org, and added a minimum revision for OS X 10.11.

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

4 years agoREGRESSION (r198653, r198864): http/tests/contentdispositionattachmentsandbox/referer...
ddkilzer@apple.com [Sun, 3 Apr 2016 18:56:30 +0000 (18:56 +0000)]
REGRESSION (r198653, r198864): http/tests/contentdispositionattachmentsandbox/referer-header-stripped*.html tests crashing due to unavailable SPI
<http://webkit.org/b/156145>

Reviewed by Tim Horton.

Covered by existing tests under GuardMalloc:

    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-always.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-default.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-never.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer-when-downgrade.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-no-referrer.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-origin.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped-with-meta-referer-unsafe-url.html
    http/tests/contentdispositionattachmentsandbox/referer-header-stripped.html

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::isDataDetectorLink):
(WebCore::DataDetection::shouldCancelDefaultAction):
- Restore iOS 9.x code.
(WebCore::DataDetection::detectContentInRange):
- Guard new SPI with version macros.

* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
- Guard new SPI with version macros.

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

4 years agoUnreviewed, turn ES6 for-in loop test success
utatane.tea@gmail.com [Sun, 3 Apr 2016 16:50:59 +0000 (16:50 +0000)]
Unreviewed, turn ES6 for-in loop test success
https://bugs.webkit.org/show_bug.cgi?id=155451

* tests/es6.yaml:

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

4 years agoUnreviewed. Bump GTK+ versions numbers.
carlosgc@webkit.org [Sun, 3 Apr 2016 10:56:31 +0000 (10:56 +0000)]
Unreviewed. Bump GTK+ versions numbers.

* Source/cmake/OptionsGTK.cmake:

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

4 years agoReplace all RenderTheme::popupInternalPadding methods with a single one returning...
carlosgc@webkit.org [Sun, 3 Apr 2016 10:50:11 +0000 (10:50 +0000)]
Replace all RenderTheme::popupInternalPadding methods with a single one returning a LengthBox
https://bugs.webkit.org/show_bug.cgi?id=156098

Reviewed by Darin Adler.

The caller always wants all padding sides, so we can simplify both the caller and the implementations by using a
single method. It's also more efficient for the GTK+ port that creates and destroys the same style contexts on
every call.

* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::adjustInnerStyle):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::popupInternalPaddingBox):
(WebCore::RenderTheme::popupInternalPaddingLeft): Deleted.
(WebCore::RenderTheme::popupInternalPaddingRight): Deleted.
(WebCore::RenderTheme::popupInternalPaddingTop): Deleted.
(WebCore::RenderTheme::popupInternalPaddingBottom): Deleted.
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::popupInternalPaddingBox):
(WebCore::getComboBoxMetrics): Deleted.
(WebCore::RenderThemeGtk::popupInternalPaddingLeft): Deleted.
(WebCore::RenderThemeGtk::popupInternalPaddingRight): Deleted.
(WebCore::RenderThemeGtk::popupInternalPaddingTop): Deleted.
(WebCore::RenderThemeGtk::popupInternalPaddingBottom): Deleted.
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::popupInternalPaddingBox):
(WebCore::RenderThemeIOS::popupInternalPaddingRight): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::popupInternalPaddingBox):
(WebCore::RenderThemeMac::popupInternalPaddingLeft): Deleted.
(WebCore::RenderThemeMac::popupInternalPaddingRight): Deleted.
(WebCore::RenderThemeMac::popupInternalPaddingTop): Deleted.
(WebCore::RenderThemeMac::popupInternalPaddingBottom): Deleted.

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

4 years agoREGRESSION (r198859): fast/scrolling/rtl-scrollbars-animation-property.html fails...
ddkilzer@apple.com [Sun, 3 Apr 2016 09:56:44 +0000 (09:56 +0000)]
REGRESSION (r198859): fast/scrolling/rtl-scrollbars-animation-property.html fails on non-Mac platforms
<http://webkit.org/b/155962>

Unreviewed; land platform-specific test results.

* platform/gtk/fast/scrolling/rtl-scrollbars-animation-property-expected.txt: Added.
* platform/ios-simulator/fast/scrolling/rtl-scrollbars-animation-property-expected.txt: Added.
* platform/win/fast/scrolling/rtl-scrollbars-animation-property-expected.txt: Added.

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

4 years ago[JSC] Add truncate operation (rounding to zero)
utatane.tea@gmail.com [Sun, 3 Apr 2016 08:37:26 +0000 (08:37 +0000)]
[JSC] Add truncate operation (rounding to zero)
https://bugs.webkit.org/show_bug.cgi?id=156072

Reviewed by Saam Barati.

Source/JavaScriptCore:

Add TruncIntrinsic for Math.trunc. DFG handles it as ArithTrunc.
In DFG, ArithTrunc behaves similar to ArithRound, ArithCeil, and ArithFloor.
ArithTrunc rounds the value towards zero.

And we rewrite @toInteger to use @trunc instead of @abs, @floor, negation and branch.
This is completely the same to what we do in JSValue::toInteger.

Since DFG recognize it, DFG can convert ArithTrunc to Identity if the given argument is Int32.
This is useful because almost all the argument is Int32 in @toLength -> @toInteger -> @trunc case.
In such cases, we can eliminate trunc() call.

As a bonus, to speed up Math.trunc operation, we use x86 SSE round and frintz in ARM64 for ArithRound.
In DFG, we emit these instructions. In FTL, we use Patchpoint to emit these instructions to avoid adding a new B3 IR.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::roundTowardZeroDouble):
(JSC::MacroAssemblerARM64::roundTowardZeroFloat):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::roundTowardZeroDouble):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::roundTowardZeroDouble):
* assembler/MacroAssemblerSH4.h:
(JSC::MacroAssemblerSH4::roundTowardZeroDouble):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::roundTowardZeroDouble):
(JSC::MacroAssemblerX86Common::roundTowardZeroFloat):
* builtins/GlobalObject.js:
(toInteger):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::roundShouldSpeculateInt32):
* dfg/DFGNode.h:
(JSC::DFG::Node::arithNodeFlags):
(JSC::DFG::Node::hasHeapPrediction):
(JSC::DFG::Node::hasArithRoundingMode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithRounding):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileArithTrunc):
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::doubleTrunc):
* ftl/FTLOutput.h:
* jit/ThunkGenerators.cpp:
(JSC::truncThunkGenerator):
* jit/ThunkGenerators.h:
* runtime/CommonIdentifiers.h:
* runtime/Intrinsic.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/MathObject.cpp:
(JSC::MathObject::finishCreation):
* runtime/MathObject.h:
* runtime/VM.cpp:
(JSC::thunkGeneratorForIntrinsic):
* tests/stress/math-rounding-infinity.js:
(testTrunc):
* tests/stress/math-rounding-nan.js:
(testTrunc):
* tests/stress/math-rounding-negative-zero.js:
(testTrunc):
* tests/stress/math-trunc-arith-rounding-mode.js: Added.
(firstCareAboutZeroSecondDoesNot):
(firstDoNotCareAboutZeroSecondDoes):
(warmup):
(verifyNegativeZeroIsPreserved):
* tests/stress/math-trunc-basics.js: Added.
(mathTruncOnIntegers):
(mathTruncOnDoubles):
(mathTruncOnBooleans):
(uselessMathTrunc):
(mathTruncWithOverflow):
(mathTruncConsumedAsDouble):
(mathTruncDoesNotCareAboutMinusZero):
(mathTruncNoArguments):
(mathTruncTooManyArguments):
(testMathTruncOnConstants):
(mathTruncStructTransition):
(Math.trunc):
* tests/stress/math-trunc-should-be-truncate.js: Added.
(mathTrunc):

LayoutTests:

* js/regress/many-foreach-calls-expected.txt: Added.
* js/regress/many-foreach-calls.html: Added.
* js/regress/math-trunc-expected.txt: Added.
* js/regress/math-trunc.html: Added.
* js/regress/script-tests/many-foreach-calls.js: Added.
forEach calls @toInteger. It includes @trunc now.
(i.array.forEach):
* js/regress/script-tests/math-trunc.js: Added.
Call Math.trunc repeatedly.
(mathTruncInt):
(mathTruncDouble):
(mathTruncMixed):
(mathTruncDoubleDoesNotCareNegativeZero):

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

4 years ago[ES6] Class syntax. Access to new.target inside of the eval should not lead to Syntax...
gskachkov@gmail.com [Sun, 3 Apr 2016 07:59:19 +0000 (07:59 +0000)]
[ES6] Class syntax. Access to new.target inside of the eval should not lead to SyntaxError
https://bugs.webkit.org/show_bug.cgi?id=155545

Reviewed by Saam Barati.

Current patch allow to invoke new.target in eval if this eval is executed within function,
otherwise this will lead to Syntax error

* bytecode/EvalCodeCache.h:
(JSC::EvalCodeCache::getSlow):
* bytecode/ExecutableInfo.h:
(JSC::ExecutableInfo::ExecutableInfo):
(JSC::ExecutableInfo::evalContextType):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::evalContextType):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::evaluate):
* interpreter/Interpreter.cpp:
(JSC::eval):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::setEvalContextType):
(JSC::Scope::evalContextType):
(JSC::parse):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getProgramCodeBlock):
(JSC::CodeCache::getEvalCodeBlock):
(JSC::CodeCache::getModuleProgramCodeBlock):
* runtime/CodeCache.h:
* runtime/Executable.cpp:
(JSC::ScriptExecutable::ScriptExecutable):
(JSC::EvalExecutable::create):
(JSC::EvalExecutable::EvalExecutable):
(JSC::ProgramExecutable::ProgramExecutable):
(JSC::ModuleProgramExecutable::ModuleProgramExecutable):
(JSC::FunctionExecutable::FunctionExecutable):
* runtime/Executable.h:
(JSC::ScriptExecutable::evalContextType):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::createEvalCodeBlock):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval):
* tests/stress/arrowfunction-lexical-bind-newtarget.js:
* tests/stress/new-target.js:

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

4 years agoUnreviewed, rolling out r198976.
commit-queue@webkit.org [Sun, 3 Apr 2016 01:55:26 +0000 (01:55 +0000)]
Unreviewed, rolling out r198976.
https://bugs.webkit.org/show_bug.cgi?id=156140

"Causes js/regress/array-nonarray-polymorhpic-access.html to
crash." (Requested by ddkilzer on #webkit).

Reverted changeset:

"[JSC] Initialize SSA's live values at tail lazily"
https://bugs.webkit.org/show_bug.cgi?id=156126
http://trac.webkit.org/changeset/198976

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

4 years ago[ES6] Arrow function syntax. Add missed test for using 'with' and 'this' in arrow...
gskachkov@gmail.com [Sun, 3 Apr 2016 01:22:25 +0000 (01:22 +0000)]
[ES6] Arrow function syntax. Add missed test for using 'with' and 'this' in arrow function.
https://bugs.webkit.org/show_bug.cgi?id=156059

Reviewed by Saam Barati.

Added test case that cover using 'with' with lexically bound 'this' in arrow function, this case was not
covered by tests for arrow function.

* js/arrowfunction-lexical-bind-this-expected.txt:
* js/script-tests/arrowfunction-lexical-bind-this.js:

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

4 years agoREGRESSION (r198933): Web Inspector and inspected page hang in local builds
dbates@webkit.org [Sat, 2 Apr 2016 22:04:47 +0000 (22:04 +0000)]
REGRESSION (r198933): Web Inspector and inspected page hang in local builds
https://bugs.webkit.org/show_bug.cgi?id=156138
<rdar://problem/25507724>

Reviewed by Alexey Proskuryakov.

Similar to the sandbox policy for WebProcess and NetworkProcess, grant a Database process
read-only filesystem access and mach lookup capability to various Security framework files
and SecurityServer, respectively.

* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:

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

4 years ago[JSC] Initialize SSA's live values at tail lazily
commit-queue@webkit.org [Sat, 2 Apr 2016 21:16:01 +0000 (21:16 +0000)]
[JSC] Initialize SSA's live values at tail lazily
https://bugs.webkit.org/show_bug.cgi?id=156126

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

Setting up the clean state early looks harmless but it is
actually quite expensive.

The problem is AbstractValue is gigantic, you really want
to minimize how much you touch that memory.

By removing the initialization, most blocks only
get 2 or 3 accesses. Once to setup the value, and a few
queries for merging the current block with the successors.

* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::endBasicBlock):
(JSC::DFG::setLiveValues): Deleted.
(JSC::DFG::InPlaceAbstractState::initialize): Deleted.

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

4 years ago[JSC] Add an option to avoid disassembling baseline code for the JSC Profiler
commit-queue@webkit.org [Sat, 2 Apr 2016 21:14:08 +0000 (21:14 +0000)]
[JSC] Add an option to avoid disassembling baseline code for the JSC Profiler
https://bugs.webkit.org/show_bug.cgi?id=156127

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

The profiler run out of memory on big programs if you dump
the baseline disassembly.

* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* runtime/Options.h:

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

4 years agoCleanup DataDetection.mm a little bit
commit-queue@webkit.org [Sat, 2 Apr 2016 20:01:34 +0000 (20:01 +0000)]
Cleanup DataDetection.mm a little bit
https://bugs.webkit.org/show_bug.cgi?id=156128

Patch by Sam Weinig <sam@webkit.org> on 2016-04-02
Reviewed by Dan Bernstein.

* html/HTMLAttributeNames.in:
Add x-apple-data-detectors, x-apple-data-detectors-type, x-apple-data-detectors-result

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::requiresExtendedContext):
(WebCore::DataDetection::dataDetectorIdentifier):
(WebCore::DataDetection::shouldCancelDefaultAction):
(WebCore::removeResultLinksFromAnchor):
(WebCore::searchForLinkRemovingExistingDDLinks):
Use new generated qualified name attributes, switch to using fastGetAttribute and
equalIgnoringASCIICase, and fix the position of some *s.

(WebCore::dataDetectorStringForPath):
Fix some *s and switch to using StringBuilder.

(WebCore::buildQuery):
Fix some *s.

(WebCore::DataDetection::detectContentInRange):
Use new generated qualified name attributes.

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