WebKit-https.git
2 years agoRuntime disable gigacage on iOS because it broke WasmBench
sbarati@apple.com [Fri, 20 Oct 2017 03:08:26 +0000 (03:08 +0000)]
Runtime disable gigacage on iOS because it broke WasmBench
https://bugs.webkit.org/show_bug.cgi?id=178556

Reviewed by Keith Miller.

* bmalloc/Gigacage.cpp:
(Gigacage::shouldBeEnabled):

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

2 years agoIntroduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSu...
achristensen@apple.com [Fri, 20 Oct 2017 02:41:22 +0000 (02:41 +0000)]
Introduce completionHandler-based SPI for _WKDownloadDelegate.decideDestinationWithSuggestedFilename
https://bugs.webkit.org/show_bug.cgi?id=178560

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/_WKDownloadDelegate.h:
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::DownloadClient):
(WebKit::DownloadClient::didStart):
(WebKit::DownloadClient::didReceiveResponse):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
(WebKit::DownloadClient::didFinish):
(WebKit::DownloadClient::didFail):
(WebKit::DownloadClient::didCancel):
(WebKit::DownloadClient::willSendRequest):

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

2 years agoServiceWorkerContextManager should be an IPC::MessageReceiver
cdumez@apple.com [Fri, 20 Oct 2017 02:39:58 +0000 (02:39 +0000)]
ServiceWorkerContextManager should be an IPC::MessageReceiver
https://bugs.webkit.org/show_bug.cgi?id=178552

Reviewed by Youenn Fablet.

ServiceWorkerContextManager should be an IPC::MessageReceiver, to avoid putting too many
ServiceWorker related methods on WebProcess class.

* DerivedSources.make:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startServiceWorkerContext):
(WebKit::WebSWServerConnection::startFetch):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/ServiceWorkerContextManager.cpp:
(WebKit::ServiceWorkerContextManager::startFetchInServiceWorker):
(WebKit::ServiceWorkerContextManager::startFetch): Deleted.
* WebProcess/Storage/ServiceWorkerContextManager.h:
* WebProcess/Storage/ServiceWorkerContextManager.messages.in: Added.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage):
(WebKit::WebProcess::getWorkerContextConnection):
(WebKit::WebProcess::startServiceWorkerContext): Deleted.
(WebKit::WebProcess::startFetchInServiceWorker): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

2 years agoWebAssembly: no VM / JS version of everything but Instance
jfbastien@apple.com [Fri, 20 Oct 2017 02:23:29 +0000 (02:23 +0000)]
WebAssembly: no VM / JS version of everything but Instance
https://bugs.webkit.org/show_bug.cgi?id=177473

Reviewed by Filip Pizlo, Saam Barati.

JSTests:

- Exceeding max on memory growth now returns a range error as per
spec. This is a (very minor) breaking change: it used to throw OOM
error. Update the corresponding test.

* wasm/js-api/memory-grow.js:
(assertEq):
* wasm/js-api/table.js:
(assert.throws):

Source/JavaScriptCore:

This change entails cleaning up and splitting a bunch of code which we had
intertwined between C++ classes which represent JS objects, and pure C++
implementation objects. This specific change goes most of the way towards
allowing JSC's WebAssembly to work without VM / JS, up to but excluding
JSWebAssemblyInstance (there's Wasm::Instance, but it's not *the* thing
yet). Because of this we still have a few FIXME identifying places that need to
change. A follow-up change will go the rest of the way.

I went about this change in the simplest way possible: grep the
JavaScriptCore/wasm directory for "JS[^C_]" as well as "VM" and exclude the /js/
sub-directory (which contains the JS implementation of WebAssembly).

None of this change removes the need for a JIT entitlement to be able to use
WebAssembly. We don't have an interpreter, the process therefore still needs to
be allowed to JIT to use these pure-C++ APIs.

Interesting things to note:

  - Remove VM from Plan and associated places. It can just live as a capture in
    the callback lambda if it's needed.
  - Wasm::Memory shouldn't require a VM. It was only used to ask the GC to
    collect. We now instead pass two lambdas at construction time for this
    purpose: one to notify of memory pressure, and the other to ask for
    syncrhonous memory reclamation. This allows whoever creates the memory to
    dictate how to react to both these cases, and for a JS embedding that's to
    call the GC (async or sync, respectively).
  - Move grow logic from JSWebAssemblyMemory to Wasm::Memory::grow. Use Expected
    there, with an enum class for failure types.
  - Exceeding max on memory growth now returns a range error as per spec. This
    is a (very minor) breaking change: it used to throw OOM error. Update the
    corresponding test.
  - When generating the grow_memory opcode, no need to get the VM. Instead,
    reach directly for Wasm::Memory and grow it.
  - JSWebAssemblyMemory::grow can now always throw on failure, because it's only
    ever called from JS (not from grow_memory as before).
  - Wasm::Memory now takes a callback for successful growth. This allows JS
    wrappers to register themselves when growth succeeds without Wasm::Memory
    knowning anything about JS. It'll also allow creating a list of callbacks
    for when we add thread support (we'll want to notify many wrappers, all
    under a lock).
  - Wasm::Memory is now back to being the source of truth about address / size,
    used directly by generated code instead of JSWebAssemblyMemory.
  - Move wasmToJS from the general WasmBinding header to its own header under
    wasm/js. It's only used by wasm/js/JSWebAssemblyCodeBlock.cpp, and uses VM,
    and therefore isn't general WebAssembly.
  - Make Wasm::Context an actual type (just a struct holding a
    JSWebAssemlyInstance for now) instead of an alias for that. Notably this
    doesn't add anything to the Context and doesn't change what actually gets
    passed around in JIT code (fast TLS or registers) because these changes
    potentially impact performance. The entire purpose of this change is to
    allow passing Wasm::Context around without having to know about VM. Since VM
    contains a Wasm::Context the JS embedding is effectively the same, but with
    this setup a non-JS embedding is much better off.
  - Move JSWebAssembly into the JS folder.
  - OMGPlan: use Wasm::CodeBlock directly instead of JSWebAssemblyCodeBlock.
  - wasm->JS stubs are now on the instance's tail as raw pointers, instead of
    being on JSWebAssemblyCodeBlock, and are now called wasm->Embedder
    stubs. The owned reference is still on JSWebAssemblyCodeBlock, and is still
    called wasm->JS stub. This move means that the embedder must, after creating
    a Wasm::CodeBlock, somehow create the stubs to call back into the
    embedder. This removes an indirection in the generated code because
    the B3 IR generator now reaches into the instance instead of
    JSWebAssemblyCodeBlock.
  - Move more CodeBlock things. Compilation completion is now marked by its own
    atomic<bool> flag instead of a nullptr plan: that required using a lock, and
    was causing a deadlock in stack-trace.js because before my changes
    JSWebAssemblyCodeBlock did its own completion checking separately from
    Wasm::CodeBlock, without getting the lock. Now that everything points to
    Wasm::CodeBlock and there's no cached completion marker, the lock was being
    acquired in a sanity-check assertion.
  - Embedder -> Wasm wrappers are now generated through a function that's passed
    in at compilation time, instead of being hard-coded as a JS -> Wasm wrapper.
  - WasmMemory doens't need to know about fault handling thunks. Only the IR
    generator should know, and should make sure that the exception throwing
    thunk is generated if any memory is present (note: with signal handling not
    all of them generate an exception check).
  - Make exception throwing pluggable: instead of having a hard-coded
    JS-specific lambda we now have a regular C++ function being called from JIT
    code when a WebAssembly exception is thrown. This allows any embedder to get
    called as they wish. For now a process can only have a single of these
    functions (i.e. only one embedder per process) because the trap handler is a
    singleton. That can be fixed in in #177475.
  - Create WasmEmbedder.h where all embedder plugging will live.
  - Split up JSWebAssemblyTable into Wasm::Table which is
    refcounted. JSWebAssemblyTable now only contains the JS functions in the
    table, and Wasm::Table is what's used by the JIT code to lookup where to
    call and do the instance check (for context switch). Note that this creates
    an extra allocation for all the instances in Wasm::Table, and in exchange
    removes an indirection in JIT code because the instance used to be obtained
    off of the JS function. Also note that it's the embedder than keeps the
    instances alive, not Wasm::Table (which holds a dumb pointer to the
    instance), because doing otherwise would cause reference cycles.
   - Add WasmInstance. It doesn't do much for now, owns globals.
   - JSWebAssembly instance now doesn't just contain the imported functions as
     JSObjects, it also has the corresponding import's instance and wasm
     entrypoint. This triples the space allocated per instance's imported
     function, but there shouldn't be that many imports. This has two upsides: it
     creates smaller and faster code, and makes is easier to disassociate
     embedder-specific things from embedder-neutral things. The small / faster
     win is in two places: B3 IR generator only needs offsetOfImportFunction for
     the call opcode (when the called index is an import) to know whether the
     import is wasm->wasm or wasm->embedder (this isn't known at compile-time
     because it's dependent on the import object), this is now done by seeing if
     that import function has an associated target instance (only wasm->wasm
     does); the other place is wasmBinding which uses offsetOfImportFunction to
     figure out the wasm->wasm target instance, and then gets
     WebAssemblyFunction::offsetOfWasmEntrypointLoadLocation to do a tail
     call. The disassociation comes because the target instance can be
     Wasm::Instance once we change what the Context is, and
     WasmEntrypointLoadLocation is already embedder-independent. As a next step I
     can move this tail allocation from JSWebAssemblyInstance to Wasm::Instance,
     and leave importFunction in as an opaque pointer which is embedder-specific,
     and in JS will remain WriteBarrier<JSObject>.
   - Rename VMEntryFrame to EntryFrame, and in many places pass a pointer to it
     around instead of VM. This is a first step in allowing entry frames which
     aren't stored on VM, but which are instead stored in an embedder-specific
     location. That change won't really affect JS except through code churn, but
     will allow WebAssembly to use some machinery in a generic manner without
     having a VM.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::emitExplicitExceptionHandler):
* debugger/Debugger.cpp:
(JSC::Debugger::stepOutOfFunction):
(JSC::Debugger::returnEvent):
(JSC::Debugger::unwindEvent):
(JSC::Debugger::didExecuteProgram):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileExceptionHandlers):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::compileOSRExit):
(JSC::DFG::OSRExit::compileExit):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrEntryThunkGenerator):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::wasmAwareLexicalGlobalObject):
(JSC::CallFrame::callerFrame):
(JSC::CallFrame::unsafeCallerFrame):
* interpreter/CallFrame.h:
(JSC::ExecState::callerFrame const):
(JSC::ExecState::callerFrameOrEntryFrame const):
(JSC::ExecState::unsafeCallerFrameOrEntryFrame const):
* interpreter/FrameTracers.h:
(JSC::NativeCallFrameTracer::NativeCallFrameTracer):
(JSC::NativeCallFrameTracerWithRestore::NativeCallFrameTracerWithRestore):
(JSC::NativeCallFrameTracerWithRestore::~NativeCallFrameTracerWithRestore):
* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::operator() const):
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
(JSC::Interpreter::unwind):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::StackVisitor):
(JSC::StackVisitor::gotoNextFrame):
(JSC::StackVisitor::readNonInlinedFrame):
(JSC::StackVisitor::Frame::dump const):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::callerIsEntryFrame const):
* interpreter/VMEntryRecord.h:
(JSC::VMEntryRecord::prevTopEntryFrame):
(JSC::VMEntryRecord::unsafePrevTopEntryFrame):
(JSC::EntryFrame::vmEntryRecordOffset):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::restoreCalleeSavesFromEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::loadWasmContextInstance):
(JSC::AssemblyHelpers::storeWasmContextInstance):
(JSC::AssemblyHelpers::loadWasmContextInstanceNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::storeWasmContextInstanceNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBufferImpl):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesFromFrameOrRegisterToEntryFrameCalleeSavesBuffer):
* jit/JIT.cpp:
(JSC::JIT::emitEnterOptimizationCheck):
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emitSlow_op_loop_hint):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
* jit/JITOperations.cpp:
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::nativeForGenerator):
* jsc.cpp:
(functionDumpCallFrame):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntThunks.cpp:
(JSC::vmEntryRecord):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:
* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::FrameWalker):
(JSC::FrameWalker::advanceToParentFrame):
(JSC::SamplingProfiler::processUnverifiedStackTraces):
* runtime/ThrowScope.cpp:
(JSC::ThrowScope::~ThrowScope):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::~VM):
* runtime/VM.h:
(JSC::VM::topEntryFrameOffset):
* runtime/VMTraps.cpp:
(JSC::isSaneFrame):
(JSC::VMTraps::tryInstallTrapBreakpoints):
(JSC::VMTraps::invalidateCodeBlocksOnStack):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::restoreWasmContextInstance):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::addGrowMemory):
(JSC::Wasm::B3IRGenerator::addCurrentMemory):
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::BBQPlan):
(JSC::Wasm::BBQPlan::compileFunctions):
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmBBQPlan.h:
* wasm/WasmBBQPlanInlines.h:
(JSC::Wasm::BBQPlan::initializeCallees):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmBinding.h:
* wasm/WasmCodeBlock.cpp:
(JSC::Wasm::CodeBlock::create):
(JSC::Wasm::CodeBlock::CodeBlock):
(JSC::Wasm::CodeBlock::compileAsync):
(JSC::Wasm::CodeBlock::setCompilationFinished):
* wasm/WasmCodeBlock.h:
(JSC::Wasm::CodeBlock::offsetOfImportStubs):
(JSC::Wasm::CodeBlock::allocationSize):
(JSC::Wasm::CodeBlock::importWasmToEmbedderStub):
(JSC::Wasm::CodeBlock::offsetOfImportWasmToEmbedderStub):
(JSC::Wasm::CodeBlock::wasmToJSCallStubForImport):
(JSC::Wasm::CodeBlock::compilationFinished):
(JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace):
(JSC::Wasm::CodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace):
* wasm/WasmContext.cpp:
(JSC::Wasm::Context::useFastTLS):
(JSC::Wasm::Context::load const):
(JSC::Wasm::Context::store):
* wasm/WasmContext.h:
* wasm/WasmEmbedder.h: Copied from Source/JavaScriptCore/wasm/WasmContext.h.
* wasm/WasmFaultSignalHandler.cpp:
* wasm/WasmFaultSignalHandler.h:
* wasm/WasmFormat.h:
* wasm/WasmInstance.cpp: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
(JSC::Wasm::Instance::Instance):
(JSC::Wasm::Instance::~Instance):
(JSC::Wasm::Instance::extraMemoryAllocated const):
* wasm/WasmInstance.h: Added.
(JSC::Wasm::Instance::create):
(JSC::Wasm::Instance::finalizeCreation):
(JSC::Wasm::Instance::module):
(JSC::Wasm::Instance::codeBlock):
(JSC::Wasm::Instance::memory):
(JSC::Wasm::Instance::table):
(JSC::Wasm::Instance::loadI32Global const):
(JSC::Wasm::Instance::loadI64Global const):
(JSC::Wasm::Instance::loadF32Global const):
(JSC::Wasm::Instance::loadF64Global const):
(JSC::Wasm::Instance::setGlobal):
(JSC::Wasm::Instance::offsetOfCachedStackLimit):
(JSC::Wasm::Instance::cachedStackLimit const):
(JSC::Wasm::Instance::setCachedStackLimit):
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::Memory):
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::~Memory):
(JSC::Wasm::Memory::grow):
* wasm/WasmMemory.h:
(JSC::Wasm::Memory::offsetOfMemory):
(JSC::Wasm::Memory::offsetOfSize):
* wasm/WasmMemoryInformation.cpp:
(JSC::Wasm::PinnedRegisterInfo::get):
(JSC::Wasm::PinnedRegisterInfo::PinnedRegisterInfo):
* wasm/WasmMemoryInformation.h:
(JSC::Wasm::PinnedRegisterInfo::toSave const):
* wasm/WasmMemoryMode.cpp: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
(JSC::Wasm::makeString):
* wasm/WasmMemoryMode.h: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
* wasm/WasmModule.cpp:
(JSC::Wasm::makeValidationCallback):
(JSC::Wasm::Module::validateSync):
(JSC::Wasm::Module::validateAsync):
(JSC::Wasm::Module::getOrCreateCodeBlock):
(JSC::Wasm::Module::compileSync):
(JSC::Wasm::Module::compileAsync):
* wasm/WasmModule.h:
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseTableHelper):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::OMGPlan):
(JSC::Wasm::OMGPlan::runForIndex):
* wasm/WasmOMGPlan.h:
* wasm/WasmPageCount.h:
(JSC::Wasm::PageCount::isValid const):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):
(JSC::Wasm::Plan::runCompletionTasks):
(JSC::Wasm::Plan::addCompletionTask):
(JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast):
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::dontFinalize):
* wasm/WasmSignature.cpp:
* wasm/WasmSignature.h:
* wasm/WasmTable.cpp: Added.
(JSC::Wasm::Table::create):
(JSC::Wasm::Table::~Table):
(JSC::Wasm::Table::Table):
(JSC::Wasm::Table::grow):
(JSC::Wasm::Table::clearFunction):
(JSC::Wasm::Table::setFunction):
* wasm/WasmTable.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h.
(JSC::Wasm::Table::maximum const):
(JSC::Wasm::Table::size const):
(JSC::Wasm::Table::offsetOfSize):
(JSC::Wasm::Table::offsetOfFunctions):
(JSC::Wasm::Table::offsetOfInstances):
(JSC::Wasm::Table::isValidSize):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
(JSC::Wasm::Thunks::setThrowWasmException):
(JSC::Wasm::Thunks::throwWasmException):
* wasm/WasmThunks.h:
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::stopAllPlansForContext):
* wasm/WasmWorklist.h:
* wasm/js/JSToWasm.cpp: Added.
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/JSToWasm.h: Copied from Source/JavaScriptCore/wasm/WasmBinding.h.
* wasm/js/JSWebAssembly.cpp: Renamed from Source/JavaScriptCore/wasm/JSWebAssembly.cpp.
* wasm/js/JSWebAssembly.h: Renamed from Source/JavaScriptCore/wasm/JSWebAssembly.h.
* wasm/js/JSWebAssemblyCodeBlock.cpp:
(JSC::JSWebAssemblyCodeBlock::create):
(JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock):
* wasm/js/JSWebAssemblyCodeBlock.h:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::visitChildren):
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::create):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::instance):
(JSC::JSWebAssemblyInstance::context const):
(JSC::JSWebAssemblyInstance::table):
(JSC::JSWebAssemblyInstance::webAssemblyToJSCallee):
(JSC::JSWebAssemblyInstance::setMemory):
(JSC::JSWebAssemblyInstance::offsetOfTail):
(JSC::JSWebAssemblyInstance::importFunctionInfo):
(JSC::JSWebAssemblyInstance::offsetOfTargetInstance):
(JSC::JSWebAssemblyInstance::offsetOfWasmEntrypoint):
(JSC::JSWebAssemblyInstance::offsetOfImportFunction):
(JSC::JSWebAssemblyInstance::importFunction):
(JSC::JSWebAssemblyInstance::internalMemory):
(JSC::JSWebAssemblyInstance::wasmCodeBlock const):
(JSC::JSWebAssemblyInstance::offsetOfWasmTable):
(JSC::JSWebAssemblyInstance::offsetOfCallee):
(JSC::JSWebAssemblyInstance::offsetOfGlobals):
(JSC::JSWebAssemblyInstance::offsetOfWasmCodeBlock):
(JSC::JSWebAssemblyInstance::offsetOfWasmMemory):
(JSC::JSWebAssemblyInstance::cachedStackLimit const):
(JSC::JSWebAssemblyInstance::setCachedStackLimit):
(JSC::JSWebAssemblyInstance::wasmMemory):
(JSC::JSWebAssemblyInstance::wasmModule):
(JSC::JSWebAssemblyInstance::allocationSize):
(JSC::JSWebAssemblyInstance::module const):
* wasm/js/JSWebAssemblyMemory.cpp:
(JSC::JSWebAssemblyMemory::create):
(JSC::JSWebAssemblyMemory::adopt):
(JSC::JSWebAssemblyMemory::JSWebAssemblyMemory):
(JSC::JSWebAssemblyMemory::grow):
(JSC::JSWebAssemblyMemory::growSuccessCallback):
* wasm/js/JSWebAssemblyMemory.h:
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::moduleInformation const):
(JSC::JSWebAssemblyModule::exportSymbolTable const):
(JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace const):
(JSC::JSWebAssemblyModule::callee const):
(JSC::JSWebAssemblyModule::codeBlock):
(JSC::JSWebAssemblyModule::module):
* wasm/js/JSWebAssemblyModule.h:
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::create):
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::visitChildren):
(JSC::JSWebAssemblyTable::grow):
(JSC::JSWebAssemblyTable::getFunction):
(JSC::JSWebAssemblyTable::clearFunction):
(JSC::JSWebAssemblyTable::setFunction):
* wasm/js/JSWebAssemblyTable.h:
(JSC::JSWebAssemblyTable::isValidSize):
(JSC::JSWebAssemblyTable::maximum const):
(JSC::JSWebAssemblyTable::size const):
(JSC::JSWebAssemblyTable::table):
* wasm/js/WasmToJS.cpp: Copied from Source/JavaScriptCore/wasm/WasmBinding.cpp.
(JSC::Wasm::materializeImportJSCell):
(JSC::Wasm::wasmToJS):
(JSC::Wasm::wasmToJSException):
* wasm/js/WasmToJS.h: Copied from Source/JavaScriptCore/wasm/WasmBinding.h.
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::constructJSWebAssemblyMemory):
* wasm/js/WebAssemblyMemoryPrototype.cpp:
(JSC::webAssemblyMemoryProtoFuncGrow):
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule):
(JSC::WebAssemblyModuleConstructor::createModule):
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyCompileFunc):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::webAssemblyValidateFunc):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::constructJSWebAssemblyTable):
* wasm/js/WebAssemblyWrapperFunction.cpp:
(JSC::WebAssemblyWrapperFunction::create):

Source/WebCore:

* ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
included in JSWebAssemblyModule.h.
* bindings/js/SerializedScriptValue.cpp: Update postMessage code
according to C++ API changes.

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

2 years agoModernize authentication challenge handling in WebKit
achristensen@apple.com [Fri, 20 Oct 2017 02:17:46 +0000 (02:17 +0000)]
Modernize authentication challenge handling in WebKit
https://bugs.webkit.org/show_bug.cgi?id=178555

Reviewed by Tim Horton.

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::didReceiveAuthenticationChallengeInFrame):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didReceiveAuthenticationChallenge):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
(WKPageSetPageNavigationClient):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace):
(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):

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

2 years agoUnreviewed localized strings update.
joepeck@webkit.org [Fri, 20 Oct 2017 02:12:44 +0000 (02:12 +0000)]
Unreviewed localized strings update.

* Localizations/en.lproj/localizedStrings.js:
Add missing string after r223735.

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

2 years agoWeb Inspector: Network Tab: Metrics Detail View
joepeck@webkit.org [Fri, 20 Oct 2017 02:11:31 +0000 (02:11 +0000)]
Web Inspector: Network Tab: Metrics Detail View
https://bugs.webkit.org/show_bug.cgi?id=178323
<rdar://problem/34071929>

Reviewed by Devin Rousso.

Provide a Metrics detail view for resources in the Network tab.
This detail view shows:

  - Transfer Size information (Header + Body bytes)
  - Resource Size information (Compression, MIME)
  - Timing information (ResourceTiming, Waterfall breakdown)

The display of timing information isn't quite final. But this
is a good starting point for all the information.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New resources and strings.

* UserInterface/Base/MIMETypeUtilities.js:
(WI.shouldTreatMIMETypeAsText):
Helper for detecting text resources.

* UserInterface/Images/Receiving.svg: Added.
* UserInterface/Images/Sending.svg: Added.
* UserInterface/Images/gtk/Receiving.svg: Added.
* UserInterface/Images/gtk/Sending.svg: Added.
Same images for main and linux ports with different licenses.

* UserInterface/Views/NetworkResourceDetailView.js:
(WI.NetworkResourceDetailView):
(WI.NetworkResourceDetailView.prototype.metricsContentViewGoToHeaders):
(WI.NetworkResourceDetailView.prototype.metricsContentViewGoToRequestBody):
(WI.NetworkResourceDetailView.prototype.metricsContentViewGoToResponseBody):
(WI.NetworkResourceDetailView.prototype.initialLayout):
(WI.NetworkResourceDetailView.prototype._showPreferredContentView):
(WI.NetworkResourceDetailView.prototype._showContentViewForNavigationItem):
Replace "Timing" and "Details" stubs with a single "Metrics" section.
Handle delegate cases from the Metrics content view.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.displayNameForResource):
(WI.NetworkTableContentView.prototype._displayType): Deleted.
(WI.NetworkTableContentView.prototype._entryForResource):
Promote this to a static helper in case anyone else wants it.

(WI.NetworkTableContentView.prototype.closed):
(WI.NetworkTableContentView.prototype.reset):
(WI.NetworkTableContentView.prototype.networkResourceDetailViewClose):
Reorder code a bit to reduce work since hiding the detail view currently
forces a layout.

* UserInterface/Views/ResourceHeadersContentView.js:
(WI.ResourceHeadersContentView):
(WI.ResourceHeadersContentView.prototype._refreshRequestDataSection):
(WI.ResourceHeadersContentView.prototype._resourceResponseReceived):
(WI.ResourceHeadersContentView.prototype._goToRequestDataClicked): Deleted.
Simplify by making the delegate required.

* UserInterface/Views/ResourceMetricsContentView.css: Added.
(.resource-metrics):
(.resource-metrics > .content):
(.resource-metrics > .content .label):
General metrics styles.

(.resource-metrics > .content > section):
(.resource-metrics > .content > section .subtitle):
(.resource-metrics > .content > section:not(:last-of-type)):
(.resource-metrics > .content > section.split):
(.resource-metrics > .content > section.split > .subsection):
(.resource-metrics > .content > section.split > .subsection > table):
(.resource-metrics > .content > section.split > .divider):
(.resource-metrics > .content > section.network > .subsection > .container):
(.resource-metrics > .content > section.network .bytes-group):
(.resource-metrics > .content > section.network .bytes):
(body[dir=ltr] .resource-metrics > .content > section.network table > tr > td.label):
(body[dir=rtl] .resource-metrics > .content > section.network table > tr > td.label):
(.resource-metrics > .content > section.network .suffix):
(.resource-metrics > .content > section.network img):
(.resource-metrics > .content > section.network .go-to-arrow):
(.resource-metrics > .content > section.network .warning):
Styles for Sizes sections.

(.resource-metrics > .content > section.timing):
(.resource-metrics > .content > section.timing .subtitle):
(.resource-metrics > .content > section.timing > ul):
(.resource-metrics > .content > section.timing > ul > li):
(.resource-metrics > .content > section.timing > .waterfall):
(.resource-metrics > .content > section.timing > .waterfall .block):
(.resource-metrics > .content > section.timing > ul > li > .row-label):
(body[dir=ltr] .resource-metrics > .content > section.timing > ul > li > .row-label):
(body[dir=rtl] .resource-metrics > .content > section.timing > ul > li > .row-label):
(.resource-metrics > .content > section.timing > ul > li > .time-label):
(.resource-metrics > .content > section.timing > ul > li.total .block):
(.resource-metrics > .content > section.timing > ul > li.total .time-label):
(.resource-metrics > .content > section.timing .indeterminate-progress-spinner):
(.resource-metrics > .content > section.timing .empty):
Styles for Timing section.

* UserInterface/Views/ResourceMetricsContentView.js: Added.
(WI.ResourceMetricsContentView):
(WI.ResourceMetricsContentView.prototype.initialLayout.createSizeComponents):
(WI.ResourceMetricsContentView.prototype.initialLayout):
(WI.ResourceMetricsContentView.prototype.layout):
(WI.ResourceMetricsContentView.prototype.closed):
(WI.ResourceMetricsContentView.prototype._sizeComponents):
(WI.ResourceMetricsContentView.prototype._refreshTransferSizeSections.appendGoToArrow):
(WI.ResourceMetricsContentView.prototype._refreshTransferSizeSections):
(WI.ResourceMetricsContentView.prototype._refreshResourceSizeSection):
(WI.ResourceMetricsContentView.prototype._refreshTimingSection.createBlock):
(WI.ResourceMetricsContentView.prototype._refreshTimingSection.createTimeLabel):
(WI.ResourceMetricsContentView.prototype._refreshTimingSection.createRow):
(WI.ResourceMetricsContentView.prototype._refreshTimingSection):
(WI.ResourceMetricsContentView.prototype._resourceSizeDidChange):
(WI.ResourceMetricsContentView.prototype._resourceTransferSizeDidChange):
(WI.ResourceMetricsContentView.prototype._resourceMetricsDidChange):
(WI.ResourceMetricsContentView.prototype._resourceTimestampsDidChange):
Metrics content. This just creates all of the elements, and saves a
few to get populated with data later on.

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

2 years agoWeb Inspector: Network Tab - Improve graphical representation of network waterfall
joepeck@webkit.org [Fri, 20 Oct 2017 02:11:27 +0000 (02:11 +0000)]
Web Inspector: Network Tab - Improve graphical representation of network waterfall
https://bugs.webkit.org/show_bug.cgi?id=147897
<rdar://problem/27482198>

Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
New strings and resources.

* UserInterface/Views/Variables.css:
(:root):
Global styles.

* UserInterface/Views/NetworkTableContentView.css:
(.network-table .header .cell.waterfall):
(.network-table .timeline-ruler):
(.network-table .timeline-ruler > .header):
Styles for having a TimelineRuler in the Waterfall's table header.

(.network-table :not(.header) .cell.waterfall):
(.network-table :not(.header) .cell.waterfall .waterfall-container):
(.waterfall .block):
(.waterfall .block.request,):
(.waterfall .block.mouse):
(.waterfall .block.queue):
(.waterfall .block.dns):
(.waterfall .block.connect):
(.waterfall .block.secure):
(.waterfall .block.request):
(.waterfall .block.response):
Waterfall styles inside the Network Table.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype.reset):
(WI.NetworkTableContentView.prototype.tablePopulateCell):
(WI.NetworkTableContentView.prototype.initialLayout):
(WI.NetworkTableContentView.prototype._updateWaterfallTimelineRuler):
(WI.NetworkTableContentView.prototype._updateEntryForResource):
(WI.NetworkTableContentView.prototype._resourceLoadingDidFinish):
(WI.NetworkTableContentView.prototype._resourceLoadingDidFail):
(WI.NetworkTableContentView.prototype._networkTimelineRecordAdded):
(WI.NetworkTableContentView.prototype._tableWaterfallColumnDidChangeWidth):
Update the TimelineRuler and Waterfall column when the column's
size changes or the time bounds change. The time bounds right now
are the earliest and latest time of resources. Later we hope to
bound this by a timeline selection.

(WI.NetworkTableContentView.prototype._waterfallPopoverContentForResource):
(WI.NetworkTableContentView.prototype._handleMousedownWaterfall):
(WI.NetworkTableContentView.prototype._populateWaterfallGraph.appendBlock):
(WI.NetworkTableContentView.prototype._populateWaterfallGraph):
(WI.NetworkTableContentView.prototype._hidePopover):
Create and manage a popover for the waterfall column.

* UserInterface/Views/Popover.js:
(WI.Popover):
(WI.Popover.prototype.get element):
(WI.Popover.prototype.get visible):
(WI.Popover.prototype.get backgroundStyle):
(WI.Popover.prototype.set backgroundStyle):
(WI.Popover.prototype._drawBackground):
Provide an option to have a white background popover.

* UserInterface/Views/ResourceTimingBreakdownView.css: Added.
(.resource-timing-breakdown):
(.resource-timing-breakdown .waterfall):
(.resource-timing-breakdown .waterfall .block):
(.resource-timing-breakdown .waterfall .block.request):
(body[dir=ltr] .resource-timing-breakdown .waterfall .block.queue,):
(body[dir=ltr] .resource-timing-breakdown .waterfall .block.response):
(body[dir=rtl] .resource-timing-breakdown .waterfall .block.queue,):
(body[dir=rtl] .resource-timing-breakdown .waterfall .block.response):
(.resource-timing-breakdown .numbers):
(body[dir=ltr] .resource-timing-breakdown .numbers):
(body[dir=rtl] .resource-timing-breakdown .numbers):
Waterfall styles and sizes in the popover's breakdown view.

(.resource-timing-breakdown .numbers > p):
(.resource-timing-breakdown .numbers > p > .swatch):
(.resource-timing-breakdown .numbers .swatch.queue):
(.resource-timing-breakdown .numbers .swatch.dns):
(.resource-timing-breakdown .numbers .swatch.connect):
(.resource-timing-breakdown .numbers .swatch.secure):
(.resource-timing-breakdown .numbers .swatch.request):
(.resource-timing-breakdown .numbers .swatch.response):
(.resource-timing-breakdown .numbers > p > .label):
(.resource-timing-breakdown .numbers > p.total):
Number and label styles in the popover's breakdown view.

* UserInterface/Views/ResourceTimingBreakdownView.js: Added.
(WI.ResourceTimingBreakdownView):
(WI.ResourceTimingBreakdownView.prototype.initialLayout):
(WI.ResourceTimingBreakdownView.prototype.initialLayout.appendBlock):
(WI.ResourceTimingBreakdownView.prototype.initialLayout.appendRow):
Show a section for a waterfall visualization and a section for the numbers.

* UserInterface/Views/Table.js:
(WI.Table.prototype.reloadVisibleColumnCells):
(WI.Table.prototype.cellForRowAndColumn):
(WI.Table.prototype.addColumn):
(WI.Table.prototype.showColumn):
(WI.Table.prototype.hideColumn):
(WI.Table.prototype.resizerDragging):
(WI.Table.prototype.resizerDragEnded):
(WI.Table.prototype._resizeColumnsAndFiller):
(WI.Table.prototype._applyColumnWidths):
(WI.Table.prototype._positionHeaderViews):
* UserInterface/Views/TableColumn.js:
(WI.TableColumn.prototype.get headerView):
Provide a way to include a WI.View with a TableColumn Header. This
matches what we do with DataGrid, and ends up being pretty concise.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .header):
Make the height a variable so that other code can work off of it.

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

2 years ago-Wsign-compare triggered by MallocBench
mcatanzaro@igalia.com [Fri, 20 Oct 2017 01:47:57 +0000 (01:47 +0000)]
-Wsign-compare triggered by MallocBench
https://bugs.webkit.org/show_bug.cgi?id=178544

Reviewed by Ryosuke Niwa.

* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::Interpreter):

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

2 years agoSerializedScriptValue passed to postMessage() cannot be null
cdumez@apple.com [Fri, 20 Oct 2017 01:34:03 +0000 (01:34 +0000)]
SerializedScriptValue passed to postMessage() cannot be null
https://bugs.webkit.org/show_bug.cgi?id=178550

Reviewed by Youenn Fablet.

SerializedScriptValue passed to postMessage() cannot be null. Therefore, we
should use Ref<> type, not RefPtr<>.

* dom/MessagePortChannel.h:
* dom/default/PlatformMessagePortChannel.cpp:
(WebCore::MessagePortChannel::postMessageToRemote):
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerObjectProxy.h:
* workers/service/context/ServiceWorkerThread.cpp:

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

2 years agoStringifier::appendStringifiedValue() is missing an exception check.
mark.lam@apple.com [Fri, 20 Oct 2017 00:47:04 +0000 (00:47 +0000)]
Stringifier::appendStringifiedValue() is missing an exception check.
https://bugs.webkit.org/show_bug.cgi?id=178386
<rdar://problem/35027610>

Reviewed by Saam Barati.

JSTests:

* stress/regress-178386.js: Added.

Source/JavaScriptCore:

* runtime/JSONObject.cpp:
(JSC::Stringifier::appendStringifiedValue):

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

2 years agoModernize API::DownloadClient
achristensen@apple.com [Fri, 20 Oct 2017 00:09:38 +0000 (00:09 +0000)]
Modernize API::DownloadClient
https://bugs.webkit.org/show_bug.cgi?id=178547

Reviewed by Andy Estes.

Use more C++ references instead of pointers because they're never null.

Remove canAuthenticateAgainstProtectionSpace because there are no implementations
except the default implementation which always returns true and we don't intend to
add this to the SPI because that's just a legacy call anyways from when NSURLConnection
hadn't fully evolved, and we're moving away from NSURLConnection, especially in our API design.

Separate the NetworkSession-only and pre-NetworkSession-only callbacks.  All the synchronous
IPC messages are only used in the pre-NetworkSession code, so once we remove it we can remove them!

Make API::DownloadClient calls that NetworkSession uses use a completion handler so we will be able to
design an asynchronous API.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace): Deleted.
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
(WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace): Deleted.
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpaceDownload): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/APIDownloadClient.h:
(API::DownloadClient::didStart):
(API::DownloadClient::didReceiveAuthenticationChallenge):
(API::DownloadClient::didReceiveResponse):
(API::DownloadClient::didReceiveData):
(API::DownloadClient::shouldDecodeSourceDataOfMIMEType):
(API::DownloadClient::decideDestinationWithSuggestedFilename):
(API::DownloadClient::didCreateDestination):
(API::DownloadClient::didFinish):
(API::DownloadClient::didFail):
(API::DownloadClient::didCancel):
(API::DownloadClient::processDidCrash):
(API::DownloadClient::willSendRequest):
(API::DownloadClient::canAuthenticateAgainstProtectionSpace): Deleted.
* UIProcess/API/C/WKContext.cpp:
(WKContextSetDownloadClient):
* UIProcess/API/glib/WebKitDownloadClient.cpp:
* UIProcess/Cocoa/DownloadClient.h:
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didStart):
(WebKit::DownloadClient::didReceiveResponse):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::decideDestinationWithSuggestedFilename):
(WebKit::DownloadClient::didFinish):
(WebKit::DownloadClient::didFail):
(WebKit::DownloadClient::didCancel):
(WebKit::DownloadClient::willSendRequest):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::processDidClose):
(WebKit::DownloadProxy::didStart):
(WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
(WebKit::DownloadProxy::willSendRequest):
(WebKit::DownloadProxy::didReceiveResponse):
(WebKit::DownloadProxy::didReceiveData):
(WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
(WebKit::DownloadProxy::didCreateDestination):
(WebKit::DownloadProxy::didFinish):
(WebKit::DownloadProxy::didFail):
(WebKit::DownloadProxy::didCancel):
(WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace): Deleted.
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxy.messages.in:

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

2 years agoREGRESSION(r223691): DFGByteCodeParser.cpp:1483:83: warning: comparison is always...
sbarati@apple.com [Thu, 19 Oct 2017 23:49:23 +0000 (23:49 +0000)]
REGRESSION(r223691): DFGByteCodeParser.cpp:1483:83: warning: comparison is always false due to limited range of data type [-Wtype-limits]
https://bugs.webkit.org/show_bug.cgi?id=178543

Reviewed by Filip Pizlo.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):

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

2 years agoUse "= default" to denote default constructor or destructor
dbates@webkit.org [Thu, 19 Oct 2017 23:48:45 +0000 (23:48 +0000)]
Use "= default" to denote default constructor or destructor
https://bugs.webkit.org/show_bug.cgi?id=178528

Rubber-stamped by Andy Estes.

Source/WebCore:

* Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
* Modules/applepay/ApplePayError.cpp:
* Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
* Modules/applepay/ApplePaySession.cpp:
* Modules/applepay/ApplePaySessionPaymentRequest.cpp:
* Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
* Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
* Modules/applepay/ApplePayValidateMerchantEvent.cpp:
* Modules/applepay/Payment.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/credentials/BasicCredential.cpp:
* Modules/credentials/FederatedCredential.cpp:
* Modules/credentials/NavigatorCredentials.cpp:
* Modules/credentials/PasswordCredential.cpp:
* Modules/encryptedmedia/CDMClient.h:
* Modules/encryptedmedia/legacy/LegacyCDM.cpp:
* Modules/encryptedmedia/legacy/LegacyCDM.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivate.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h:
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
* Modules/entriesapi/DOMFileSystem.cpp:
* Modules/entriesapi/FileSystemDirectoryReader.cpp:
* Modules/entriesapi/FileSystemEntry.cpp:
* Modules/fetch/FetchLoaderClient.h:
* Modules/gamepad/Gamepad.cpp:
* Modules/gamepad/GamepadEvent.h:
* Modules/gamepad/deprecated/Gamepad.cpp:
[ truncated ]

Source/WebCore/PAL:

* pal/Logger.h:
(PAL::Logger::Observer::~Observer): Deleted.
* pal/crypto/gcrypt/CryptoDigestGCrypt.cpp:
* pal/system/SleepDisabler.cpp:
* pal/system/SystemSleepListener.h:

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

2 years agore-inline ObjectAllocationProfile::initializeProfile
sbarati@apple.com [Thu, 19 Oct 2017 23:34:20 +0000 (23:34 +0000)]
re-inline ObjectAllocationProfile::initializeProfile
https://bugs.webkit.org/show_bug.cgi?id=178532

Rubber stamped by Michael Saboff.

I un-inlined this function when implementing poly proto.
This patch re-inlines it. In my testing, it looks like it
might be a 0.5% speedometer progression to inline it.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/CodeBlock.cpp:
* bytecode/ObjectAllocationProfile.cpp: Removed.
* bytecode/ObjectAllocationProfileInlines.h: Copied from Source/JavaScriptCore/bytecode/ObjectAllocationProfile.cpp.
(JSC::ObjectAllocationProfile::initializeProfile):
(JSC::ObjectAllocationProfile::possibleDefaultPropertyCount):
* runtime/FunctionRareData.cpp:

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

2 years agoAX: Provide a way for Accessibility to cache the selection while retrieving rects...
n_wang@apple.com [Thu, 19 Oct 2017 23:34:16 +0000 (23:34 +0000)]
AX: Provide a way for Accessibility to cache the selection while retrieving rects for speak selection
https://bugs.webkit.org/show_bug.cgi?id=176247
<rdar://problem/34217143>

Reviewed by Ryosuke Niwa.

Source/WebKit:

When getting the rects for highlighting the spoken text within a selection range on iOS, we can get a
list of totally wrong rects if the user changed the selection to some other text. This is because the
calculation is based on the current selection range. Therefore, we need to provide a way for accessibility
codepath to store the selection during a speaking session.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _accessibilityStoreSelection]):
(-[WKWebView _accessibilityClearSelection]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _accessibilityStoreSelection]):
(-[WKContentView _accessibilityClearSelection]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::storeSelectionForAccessibility):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
(WebKit::WebPage::storeSelectionForAccessibility):
(WebKit::WebPage::getRectsAtSelectionOffsetWithText):

Tools:

* TestWebKitAPI/Tests/ios/AccessibilityTestsIOS.mm:
(TestWebKitAPI::TEST):

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

2 years ago[Bindings] Standardize on DOMPromise as the way to store passed in promises
weinig@apple.com [Thu, 19 Oct 2017 23:31:03 +0000 (23:31 +0000)]
[Bindings] Standardize on DOMPromise as the way to store passed in promises
https://bugs.webkit.org/show_bug.cgi?id=178533

Reviewed by Youenn Fablet.

This standardizes on RefPtr<DOMPromise> as the canonical way to store a promise
that has been passed in from JS. This does not change promises that start off in
WebCore and are passed to JS; they remain using DOMPromiseDeferred and DOMPromiseProxy.

* Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
* Modules/paymentrequest/PaymentRequestUpdateEvent.h:
* dom/PromiseRejectionEvent.cpp:
* dom/PromiseRejectionEvent.h:
* dom/RejectedPromiseTracker.cpp:

    Use a RefPtr<DOMPromise> rather than a JSPromise* to hold onto the promise.

* bindings/IDLTypes.h:

    Use IDLWrapper to get better defaults, since DOMPromise is refcounted.

* bindings/js/JSDOMConvertPromise.h:
(WebCore::Converter<IDLPromise<T>>::convert):

    Switch default conversion to return a RefPtr<DOMPromise> rather than a JSPromise*

(WebCore::JSConverter<IDLPromise<T>>::convert):

    Add support for converting from a DOMPromise to a JSValue.

* bindings/js/JSDOMPromise.cpp:
* bindings/js/JSDOMPromise.h:
(WebCore::DOMPromise::create): Deleted.

    Remove now unused constructor.

* workers/service/ExtendableEvent.cpp:
(WebCore::ExtendableEvent::waitUntil):
* workers/service/ExtendableEvent.h:
* workers/service/ExtendableEvent.idl:
* workers/service/FetchEvent.cpp:
(WebCore::FetchEvent::respondWith):
(WebCore::FetchEvent::promiseIsSettled):
* workers/service/FetchEvent.h:
* workers/service/FetchEvent.idl:

    Address FIXMEs and remove need for passing an ExecState to ExtendableEvent
    and FetchEvent by using the new default conversion to DOMPromise.

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

2 years agoTest262: RegExp/property-escapes/generated/Emoji_Component.js fails with current...
msaboff@apple.com [Thu, 19 Oct 2017 23:26:06 +0000 (23:26 +0000)]
Test262: RegExp/property-escapes/generated/Emoji_Component.js fails with current RegExp Unicode Properties implementation
https://bugs.webkit.org/show_bug.cgi?id=178521

Reviewed by JF Bastien.

JSTests:

* test262.yaml: Enabled test262/test/built-ins/RegExp/property-escapes/generated/Emoji_Component.js as it
now passes with the current version (5.0) of the Emoji spec.

Source/JavaScriptCore:

* ucd/emoji-data.txt: Replaced with the Unicode Emoji 5.0 version of the file as that is the most recent
standard version.  The prior version was the draft 6.0 version.

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

2 years ago[Settings] Move global settings into their own file
commit-queue@webkit.org [Thu, 19 Oct 2017 23:02:56 +0000 (23:02 +0000)]
[Settings] Move global settings into their own file
https://bugs.webkit.org/show_bug.cgi?id=178512

Patch by Sam Weinig <sam@webkit.org> on 2017-10-19
Reviewed by Darin Adler.

Source/WebCore:

Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.
It's called DeprecatedGlobalSettings to indicate that this is an anti-pattern we would
like to discourage, as WebCore can operate in a process with multiple clients, each of
which should be able to set their own preferences.

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

    Add new files.

* page/DeprecatedGlobalSettings.cpp: Copied from Source/WebCore/page/SettingsBase.cpp.
* page/DeprecatedGlobalSettings.h: Copied from Source/WebCore/page/SettingsBase.h.
* page/SettingsBase.cpp:
* page/SettingsBase.h:

    Move all global settings out of SettingsBase and into the new DeprecatedGlobalSettings.

* Modules/mediastream/UserMediaRequest.cpp:
* bindings/js/CommonVM.cpp:
* css/CSSStyleDeclaration.cpp:
* dom/DataTransfer.cpp:
* dom/DataTransferItemList.cpp:
* editing/Editor.cpp:
* loader/ResourceLoadObserver.cpp:
* page/FrameView.cpp:
* page/PerformanceMonitor.cpp:
* platform/ScrollbarTheme.cpp:
(WebCore::ScrollbarTheme::theme):
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/mac/NSScrollerImpDetails.mm:
* platform/mock/ScrollbarThemeMock.cpp:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
* platform/network/ios/NetworkStateNotifierIOS.mm:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
* platform/win/MainThreadSharedTimerWin.cpp:
* rendering/RenderLayer.cpp:
* rendering/RenderListBox.cpp:
* testing/InternalSettings.cpp:
* testing/Internals.cpp:

    Update users of global settings to reference the new class name.

Source/WebKit:

Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setAllowsAnySSLCertificateForWebSocket):
* Shared/WebPreferencesDefinitions.h:
* Shared/WebPreferencesStore.cpp:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):
(WebKit::WebPage::updatePreferences):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setResourceLoadStatisticsEnabled):
* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::VideoFullscreenManager::supportsVideoFullscreen const):

Source/WebKitLegacy/mac:

Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.

* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::supportsVideoFullscreen):
* WebView/WebDynamicScrollBarsView.mm:
(+[WebDynamicScrollBarsView _horizontalScrollerClass]):
(+[WebDynamicScrollBarsView _verticalScrollerClass]):
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _preferencesChanged:]):
(+[WebView _doNotStartObservingNetworkReachability]):

Source/WebKitLegacy/win:

Moves all global settigns out of SettingsBase and into the new DeprecatedGlobalSettings.

* WebView.cpp:
(WebView::initWithFrame):

Tools:

* TestWebKitAPI/Tests/WebKitLegacy/ios/AudioSessionCategoryIOS.mm:
(TestWebKitAPI::TEST):

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

2 years ago[iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS...
aestes@apple.com [Thu, 19 Oct 2017 22:47:49 +0000 (22:47 +0000)]
[iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
https://bugs.webkit.org/show_bug.cgi?id=178181
<rdar://problem/33660282>

Reviewed by Dan Bernstein.

Source/WebKit:

* Configurations/BaseTarget.xcconfig:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
* WebKit.xcodeproj/project.pbxproj:

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::databaseProcessName):

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

2 years agoAdd preliminary support for ServiceWorker Handle Fetch
cdumez@apple.com [Thu, 19 Oct 2017 22:44:57 +0000 (22:44 +0000)]
Add preliminary support for ServiceWorker Handle Fetch
https://bugs.webkit.org/show_bug.cgi?id=178475
<rdar://problem/35066424>

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-19
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/workers/service/basic-fetch.https.html

Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
A script context is now storing its selected service worker identifier. This should be fully implemented later on.
This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.

* WebCore.xcodeproj/project.pbxproj:
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
(WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* loader/FetchOptions.h:
(WebCore::isPotentialNavigationOrSubresourceRequest):
(WebCore::isNonSubresourceRequest):
* loader/ResourceLoaderOptions.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
* loader/WorkerThreadableLoader.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* workers/WorkerThread.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/context/SWContextManager.cpp: Removed.
* workers/service/context/ServiceWorkerThread.h:

Source/WebKit:

Relanding now that underlying issue is fixed in https://bugs.webkit.org/show_bug.cgi?id=178527.

Preliminary support of Handle Fetch algorithm and integration with fetch spec.
Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
It is similar to WebResourceLoader that do the load through NetworkProcess.
In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
it will fallback to WebResourceLoader through a fallback callback.

Loading through Service Worker is done currently if:
- There is a service worker registered for that origin
- Request is a subresource
- service workers mode is all
There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
Future work should try to reduce the cases where the IPC dance is done unnecessarily.

ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
In particular, it is calling ResourceLoader error callback if response is of type error.
It should call ResourceLoader redirection callback if response is a redirection response.
This will be done as a follow-up.

Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.

Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.

* CMakeLists.txt:
* DerivedSources.make:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::didReceiveFetchResponse):
(WebKit::WebSWServerConnection::didReceiveFetchData):
(WebKit::WebSWServerConnection::didFinishFetch):
(WebKit::WebSWServerConnection::didFailFetch):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didFailFetch):
(WebKit::StorageProcess::didReceiveFetchResponse):
(WebKit::StorageProcess::didReceiveFetchData):
(WebKit::StorageProcess::didFinishFetch):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::remove):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added.
(WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch):
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):
(WebKit::ServiceWorkerClientFetch::didReceiveData):
(WebKit::ServiceWorkerClientFetch::didFinish):
(WebKit::ServiceWorkerClientFetch::didFail):
(WebKit::ServiceWorkerClientFetch::cancel):
* WebProcess/Storage/ServiceWorkerClientFetch.h: Copied from Source/WebKit/WebProcess/Storage/WebSWClientConnection.h.
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Copied from Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in.
* WebProcess/Storage/ServiceWorkerContextManager.cpp: Added.
(WebKit::ServiceWorkerContextManager::startServiceWorkerContext):
(WebKit::ServiceWorkerContextManager::startFetch):
* WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h.
(WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::startFetch):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::shouldHandleFetch):
(WebKit::WebServiceWorkerProvider::handleFetch):
(WebKit::WebServiceWorkerProvider::cancelFetch):
(WebKit::WebServiceWorkerProvider::fetchFinished):
(WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage):
* WebProcess/Storage/WebServiceWorkerProvider.h:
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWorkerContextConnection):
(WebKit::WebProcess::startServiceWorkerContext):
(WebKit::WebProcess::startFetchInServiceWorker):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

LayoutTests:

* http/tests/workers/service/basic-fetch.https-expected.txt: Added.
* http/tests/workers/service/basic-fetch.https.html: Added.
* http/tests/workers/service/resources/basic-fetch-worker.js: Added.
* http/tests/workers/service/resources/basic-fetch.js: Added.

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

2 years ago[FrameView::layout cleanup] Move post layout task scheduling logic to a separate...
zalan@apple.com [Thu, 19 Oct 2017 22:31:29 +0000 (22:31 +0000)]
[FrameView::layout cleanup] Move post layout task scheduling logic to a separate function
https://bugs.webkit.org/show_bug.cgi?id=178538
<rdar://problem/35080743>

Reviewed by Simon Fraser.

Move and reorganize post layout task scheduling code.

Covered by existing tests.

* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::runOrSchedulePostLayoutTasks):
* page/FrameView.h:

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

2 years agoWe should hard code the poly proto offset
sbarati@apple.com [Thu, 19 Oct 2017 22:23:58 +0000 (22:23 +0000)]
We should hard code the poly proto offset
https://bugs.webkit.org/show_bug.cgi?id=178531

Reviewed by Filip Pizlo.

This patch embraces that the poly proto offset is always zero. It's already
the case that we would always get the inline offset zero for poly proto just
by construction. This just hardcodes this assumption throughout the codebase.
This appears to be a 1% speedometer progression in my testing.

The downside of this patch is that it may require changing how we do
things when we implement poly proto when inheriting from builtin
types. I think we can face this problem when we decide to implement
that.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateWithGuard):
* dfg/DFGOperations.cpp:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileInstanceOfForObject):
(JSC::DFG::SpeculativeJIT::compileGetPrototypeOf):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetPrototypeOf):
(JSC::FTL::DFG::LowerDFGToB3::compileInstanceOf):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_instanceof):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_instanceof):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSObject.cpp:
(JSC::JSObject::setPrototypeDirect):
* runtime/JSObject.h:
(JSC::JSObject::locationForOffset const):
(JSC::JSObject::locationForOffset):
(JSC::JSObject::getDirect const):
* runtime/PropertyOffset.h:
* runtime/Structure.cpp:
(JSC::Structure::create):
(JSC::Structure::dump const):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::storedPrototype const):
(JSC::Structure::storedPrototypeObject const):

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

2 years agoAttempt to fix Legacy WebKit test failure following r223704
dbates@webkit.org [Thu, 19 Oct 2017 21:58:48 +0000 (21:58 +0000)]
Attempt to fix Legacy WebKit test failure following r223704
(https://bugs.webkit.org/show_bug.cgi?id=178403)

Call testRunner.setCanOpenWindows() to tell DumpRenderTree to allow the test to open a new window.

* http/tests/security/referrer-policy-subframe-window-open.html:

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

2 years agoService Worker process should not be selected to open WebView on it
cdumez@apple.com [Thu, 19 Oct 2017 21:31:17 +0000 (21:31 +0000)]
Service Worker process should not be selected to open WebView on it
https://bugs.webkit.org/show_bug.cgi?id=178527

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-19
Reviewed by Chris Dumez.

Selection of process to open a page will no longer use an existing web process if it is the service worker process.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):

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

2 years ago[FrameView::layout cleanup] Move scrollbars setup logic to a separate function
zalan@apple.com [Thu, 19 Oct 2017 21:23:13 +0000 (21:23 +0000)]
[FrameView::layout cleanup] Move scrollbars setup logic to a separate function
https://bugs.webkit.org/show_bug.cgi?id=178394
<rdar://problem/35031066>

Reviewed by Antti Koivisto.

Decouple scrollbars setup and the unrelated first-layout logic.
FIXME: find out why m_firstLayout depends on the subtree flag (I'd assume we issue full layout the very first time).

Covered by existing test cases.

* page/FrameView.cpp:
(WebCore::FrameView::adjustScrollbarsForLayout):
(WebCore::FrameView::layout):
* page/FrameView.h:

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

2 years agoAvoid duplicate multisample resolve before WebGL compositing
dino@apple.com [Thu, 19 Oct 2017 21:15:34 +0000 (21:15 +0000)]
Avoid duplicate multisample resolve before WebGL compositing
https://bugs.webkit.org/show_bug.cgi?id=178537
<rdar://problem/35080724>

Fix iOS build.

* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):

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

2 years agoDisplay link bringup can block the main thread for ~150ms during WKWebView init
timothy_horton@apple.com [Thu, 19 Oct 2017 20:51:02 +0000 (20:51 +0000)]
Display link bringup can block the main thread for ~150ms during WKWebView init
https://bugs.webkit.org/show_bug.cgi?id=178524

Reviewed by Dean Jackson.

* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::displayLinkHandler):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
Lazily initialize the display link at first use.

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

2 years agoTurn various poly proto RELEASE_ASSERTs into ASSERTs because they're on the hot path...
sbarati@apple.com [Thu, 19 Oct 2017 20:45:54 +0000 (20:45 +0000)]
Turn various poly proto RELEASE_ASSERTs into ASSERTs because they're on the hot path in speedometer
https://bugs.webkit.org/show_bug.cgi?id=178529

Reviewed by Mark Lam.

* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::storedPrototypeObject const):
(JSC::Structure::storedPrototypeStructure const):
(JSC::Structure::storedPrototype const):
(JSC::Structure::prototypeForLookup const):
(JSC::Structure::prototypeChain const):

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

2 years agoExpand r209943 to suppress paste during provisional navigation as well
timothy_horton@apple.com [Thu, 19 Oct 2017 20:43:41 +0000 (20:43 +0000)]
Expand r209943 to suppress paste during provisional navigation as well
https://bugs.webkit.org/show_bug.cgi?id=178429
<rdar://problem/33952830>

Reviewed by Dean Jackson.

Source/WebCore:

No new tests; adjusted an existing test to cover this case.

* editing/Editor.cpp:
(WebCore::Editor::canPaste const):
Disable pasting during provisional navigation, like r209943 did for
various other forms of text input.

(WebCore::Editor::shouldInsertText const):
* dom/EventDispatcher.cpp:
(WebCore::shouldSuppressEventDispatchInDOM):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldSuppressTextInputFromEditing const):
(WebCore::FrameLoader::shouldSuppressKeyboardInput const): Deleted.
* loader/FrameLoader.h:
* page/Settings.in:
Rename the setting to be about editing-related text input, not "keyboard" input.

* editing/EditorCommand.cpp:
(WebCore::allowExecutionWhenDisabled):
(WebCore::doNotAllowExecutionWhenDisabled):
(WebCore::allowExecutionWhenDisabledCopyCut):
(WebCore::allowExecutionWhenDisabledPaste):
(WebCore::createCommandMap):
(WebCore::Editor::Command::allowExecutionWhenDisabled const):
Completely disable execution of paste events when in no-text-input-from-editing mode.
Otherwise, even though canPaste was false and we wouldn't do a default paste action,
we would still dispatch the paste event to the DOM.

Source/WebKit:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation):
(WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation):
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]):
(-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Adjust to the changed preference name, except at the SPI level.

LayoutTests:

* http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt:
* http/tests/navigation/keyboard-events-during-provisional-navigation.html:
* http/tests/navigation/keyboard-events-during-provisional-subframe-navigation-expected.txt:
* http/tests/navigation/keyboard-events-during-provisional-subframe-navigation.html:
* http/tests/navigation/resources/keyboard-events-after-navigation.html:
* http/tests/navigation/resources/keyboard-events-test.js:
(runBeforeTest):
(runTest):
Copy a "d" to the clipboard before running the test, and paste it while running.
I put the copy before running the test so that if someone comes along and
blacklists copy during provisional load as well, the test for this behavior
still actually tests the paste portion.
Also ensure that paste events are not triggered during provisional navigation.

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

2 years agoAvoid duplicate multisample resolve before WebGL compositing
dino@apple.com [Thu, 19 Oct 2017 20:32:10 +0000 (20:32 +0000)]
Avoid duplicate multisample resolve before WebGL compositing
https://bugs.webkit.org/show_bug.cgi?id=178537
<rdar://problem/35080724>

Reviewed by Jer Noble.

Both endPaint and prepareTexture were doing the MSAA resolve
into the renderbuffer, and being called on macOS before compositing.
Without that step, endPaint became unnecessary on iOS so I renamed
it presentRenderbuffer.

Covered by existing tests.

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::presentRenderbuffer):
(WebCore::GraphicsContext3D::endPaint): Deleted.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer display]):

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

2 years agoReferrer policy should be inherited from creator
dbates@webkit.org [Thu, 19 Oct 2017 20:17:42 +0000 (20:17 +0000)]
Referrer policy should be inherited from creator
https://bugs.webkit.org/show_bug.cgi?id=178403
<rdar://problem/31546136>

Add missing file that I inadvertently forgot to commit in r223697. The tests depend on this file.

* http/tests/security/resources/nested-referrer-policy-postmessage.html: Added.

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

2 years agoTurn poly proto back on by default and remove the option
sbarati@apple.com [Thu, 19 Oct 2017 20:16:19 +0000 (20:16 +0000)]
Turn poly proto back on by default and remove the option
https://bugs.webkit.org/show_bug.cgi?id=178525

Reviewed by Mark Lam.

Source/JavaScriptCore:

I added this option because I thought it'd speed speedometer up because the
original poly proto patch slowed speedometer down. It turns out that
allocating poly proto objects is not what slows speedometer down. It's
other code I added in the runtime that needs to be poly proto aware. I'll
be addressing these in follow up patches.

* runtime/Options.h:
* runtime/StructureInlines.h:
(JSC::Structure::shouldConvertToPolyProto):

Tools:

* Scripts/run-jsc-stress-tests:

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

2 years agoAdd API to clean CacheStorage data
commit-queue@webkit.org [Thu, 19 Oct 2017 20:15:42 +0000 (20:15 +0000)]
Add API to clean CacheStorage data
https://bugs.webkit.org/show_bug.cgi?id=178034

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-19

* UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Using WK_IOS_TBA instead of WK_MAC_TBA for iOS.

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

2 years ago[Payment Request] Only process shipping options if shipping is requested, and throw...
aestes@apple.com [Thu, 19 Oct 2017 20:02:29 +0000 (20:02 +0000)]
[Payment Request] Only process shipping options if shipping is requested, and throw an exception on duplicate shipping option IDs
https://bugs.webkit.org/show_bug.cgi?id=178535

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/payment-request/payment-request-constructor.https-expected.txt:

Source/WebCore:

Progresses four tests in web-platform-tests/payment-request/payment-request-constructor.https.html.

* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::create):

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

2 years agoMarked http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html...
jlewis3@apple.com [Thu, 19 Oct 2017 19:57:00 +0000 (19:57 +0000)]
Marked http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=178472

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoShare logic in InlineTextBox to compute selection rect
dbates@webkit.org [Thu, 19 Oct 2017 18:55:16 +0000 (18:55 +0000)]
Share logic in InlineTextBox to compute selection rect
https://bugs.webkit.org/show_bug.cgi?id=178232
<rdar://problem/34963452>

Reviewed by Zalan Bujtas.

Currently each paint routine in InlineTextBox duplicates similar code to compute the selection
rect it will paint. This change consolidates all the duplication into localSelectionRectWithClampedPositions()
and writes all of the paint operations, except for paintCompositionUnderline(), in terms of it.
We will write paintCompositionUnderline() in terms of localSelectionRectWithClampedPositions()
in a subsequent patch.

We also write localSelectionRect() in terms of localSelectionRectWithClampedPositions(). Ideally
we would have one way to compute the selection rect. However, localSelectionRect() and paintDocumentMarker()
currently expect the enclosing integral rectangle of the selection rectangle. The function
paintDocumentMarker() needs the enclosing integral rectangle to avoid truncating the dot pattern
drawn under marked words (e.g. a spelling error) on Cocoa platforms. With regards to localSelectionRect()
we should look to have it return the actual selection rectangle. See <https://bugs.webkit.org/show_bug.cgi?id=138913>
for more details.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect const): Move logic in common with paintSelection() into
localSelectionRectWithClampedPositions() and modified code to use it.
(WebCore::InlineTextBox::localSelectionRectWithClampedPositions const): Added.
(WebCore::InlineTextBox::paint): Store the local paint offset as a LayoutPoint as it is the canonical
data type for representing an offset when painting. Pass the local paint offset instead of the analagous boxOrigin value.
(WebCore::InlineTextBox::paintSelection): Write in terms of localSelectionRectWithClampedPositions().
(WebCore::InlineTextBox::paintTextSubrangeBackground): Ditto.
(WebCore::InlineTextBox::paintCompositionBackground): Ditto.
(WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
(WebCore::InlineTextBox::paintDocumentMarker): Ditto.
(WebCore::InlineTextBox::paintDocumentMarkers): Pass paint offset instead of the analogous boxOrigin value.
* rendering/InlineTextBox.h:

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

2 years agoWeb Inspector: Remove superfluous file External/.eslintrc
commit-queue@webkit.org [Thu, 19 Oct 2017 18:54:47 +0000 (18:54 +0000)]
Web Inspector: Remove superfluous file External/.eslintrc
https://bugs.webkit.org/show_bug.cgi?id=178474

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-10-19
Reviewed by Joseph Pecoraro.

* UserInterface/External/.eslintrc: Removed.

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

2 years agoReferrer policy should be inherited from creator
dbates@webkit.org [Thu, 19 Oct 2017 18:46:22 +0000 (18:46 +0000)]
Referrer policy should be inherited from creator
https://bugs.webkit.org/show_bug.cgi?id=178403
<rdar://problem/31546136>

Reviewed by Andy Estes.

Source/WebCore:

As per section Browsing contexts of the the HTML standard, <https://html.spec.whatwg.org/multipage/browsers.html>
(17 October 2017), the referrer policy of a document should initially be inherited from its
creator.

Tests: http/tests/security/referrer-policy-nested-subframe.html
       http/tests/security/referrer-policy-nested-window-open.html
       http/tests/security/referrer-policy-subframe-window-open.html
       http/tests/security/referrer-policy-window-open-subframe.html

* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Ask the loader for the effective referrer policy.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::effectiveReferrerPolicy const): Added. Returns the referrer policy
of the creator document. The creator document is document of the parent frame or the document
of the opener for a subframe or child window, respectively. If we do not have a creator frame
then we return the default referrer policy, non-referrer-when-downgrade, by <https://www.w3.org/TR/2017/CR-referrer-policy-20170126/#referrer-policy-empty-string>.
* loader/FrameLoader.h:

LayoutTests:

Add tests to ensure that the referrer policy of a document is initially inherited from its creator.

* http/tests/security/referrer-policy-nested-subframe-expected.txt: Added.
* http/tests/security/referrer-policy-nested-subframe.html: Added.
* http/tests/security/referrer-policy-nested-window-open-expected.txt: Added.
* http/tests/security/referrer-policy-nested-window-open.html: Added.
* http/tests/security/referrer-policy-subframe-window-open-expected.txt: Added.
* http/tests/security/referrer-policy-subframe-window-open.html: Added.
* http/tests/security/referrer-policy-window-open-subframe-expected.txt: Added.
* http/tests/security/referrer-policy-window-open-subframe.html: Added.
* http/tests/security/resources/referrer-policy-postmessage.php:

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

2 years ago[FrameView::layout cleanup] Do not reenter FrameView::performPostLayoutTasks
zalan@apple.com [Thu, 19 Oct 2017 18:39:39 +0000 (18:39 +0000)]
[FrameView::layout cleanup] Do not reenter FrameView::performPostLayoutTasks
https://bugs.webkit.org/show_bug.cgi?id=178518
<rdar://problem/35075409>

Reviewed by Antti Koivisto.

This patch tightens existing reentrancy policy on performPostLayoutTasks.

Covered by existing test cases.

* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::reset):
(WebCore::FrameView::layout):
(WebCore::FrameView::performPostLayoutTasks):
* page/FrameView.h:

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

2 years agoUnreviewed build fix after r223692.
cdumez@apple.com [Thu, 19 Oct 2017 18:37:23 +0000 (18:37 +0000)]
Unreviewed build fix after r223692.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:

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

2 years ago[GTK] Inspector UI does not use system font despite -webkit-system-font being supported
aperez@igalia.com [Thu, 19 Oct 2017 18:33:10 +0000 (18:33 +0000)]
[GTK] Inspector UI does not use system font despite -webkit-system-font being supported
https://bugs.webkit.org/show_bug.cgi?id=178388

Reviewed by Joseph Pecoraro.

Change ocurrences of the "-apple-system" generic font name to
"-webkit-system-font", which is also implemented by the GTK+ port.

* UserInterface/Views/CodeMirrorOverrides.css:
(.CodeMirror .CodeMirror-linenumber):
(.CodeMirror .CodeMirror-placeholder):
* UserInterface/Views/ConsoleMessageView.css:
(.console-user-command.special-user-log > .console-message-text):
(.console-message .console-message-extra-parameters-container > li::before):
(.console-message .console-message-location):
* UserInterface/Views/DataGrid.css:
(.data-grid td):
* UserInterface/Views/DefaultDashboardView.css:
(.toolbar .dashboard.default > .item):
* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot-instance-popover-content > .title):
* UserInterface/Views/HierarchicalPathComponent.css:
(.hierarchical-path-component):
* UserInterface/Views/LogContentView.css:
(.console-messages):
* UserInterface/Views/Main.css:
(body):
* UserInterface/Views/ObjectTreeArrayIndexTreeElement.css:
(.object-tree-array-index .index-name):
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property .property-name,):
* UserInterface/Views/ObjectTreeView.css:
(.tree-outline.object li .empty-message):
* UserInterface/Views/RecordingActionTreeElement.css:
(.item.action:not(.initial-state)::before):
* UserInterface/Views/SourceCodeTextEditor.css:
(.source-code.text-editor > .CodeMirror .line-indicator-widget > .text):
(.popover .debugger-popover-content > .title):
* UserInterface/Views/TypeTreeView.css:
(.type-tree):
* UserInterface/Views/VisualStyleFontFamilyTreeElement.js:

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

2 years agoREGRESSION (r223476): WebCore exports symbols with names belonging to other frameworks
keith_miller@apple.com [Thu, 19 Oct 2017 18:18:32 +0000 (18:18 +0000)]
REGRESSION (r223476): WebCore exports symbols with names belonging to other frameworks
https://bugs.webkit.org/show_bug.cgi?id=178424

Reviewed by David Kilzer.

This patch moves the wrapper function sharing the name of the externed function
to the source file and marks it as always inline. Marking it as inline prevents
the framework from exporting it.

* wtf/cocoa/SoftLinking.h:

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

2 years agoUnreviewed, revert r223650 as it caused crashes on the bots.
cdumez@apple.com [Thu, 19 Oct 2017 17:58:21 +0000 (17:58 +0000)]
Unreviewed, revert r223650 as it caused crashes on the bots.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* dom/ScriptExecutionContext.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* loader/FetchOptions.h:
* loader/ResourceLoaderOptions.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
* loader/WorkerThreadableLoader.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* workers/WorkerThread.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/context/SWContextManager.cpp: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
(WebCore::SWContextManager::singleton):
(WebCore::SWContextManager::SWContextManager):
(WebCore::SWContextManager::startServiceWorkerContext):
* workers/service/context/SWContextManager.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
* workers/service/context/ServiceWorkerThread.h:

Source/WebKit:

* CMakeLists.txt:
* DerivedSources.make:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::remove):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed.
* WebProcess/Storage/ServiceWorkerClientFetch.h: Removed.
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed.
* WebProcess/Storage/ServiceWorkerContextManager.cpp: Removed.
* WebProcess/Storage/WebSWClientConnection.cpp:
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
* WebProcess/Storage/WebServiceWorkerProvider.h:
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWorkerContextConnection):
(WebKit::WebProcess::startServiceWorkerContext):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

LayoutTests:

* http/tests/workers/service/basic-fetch.https-expected.txt: Removed.
* http/tests/workers/service/basic-fetch.https.html: Removed.
* http/tests/workers/service/resources/basic-fetch-worker.js: Removed.
* http/tests/workers/service/resources/basic-fetch.js: Removed.

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

2 years agoTurn recursive tail calls into loops
rmorisset@apple.com [Thu, 19 Oct 2017 16:27:44 +0000 (16:27 +0000)]
Turn recursive tail calls into loops
https://bugs.webkit.org/show_bug.cgi?id=176601

Reviewed by Saam Barati.

JSTests:

Add some simple test that computes factorial in several ways, and other trivial computations.
They all tests the case where foo calls bar (in an inlineable way) that then does a tail call.
Depending on the nature of both calls, it is possible or not to turn the tail call into a loop.
I have no clear way of checking that the call was indeed transformed, but I can check that the code computes the right result
(which it doesn't if that tail call is transformed into a loop in the unsound cases).

* stress/inline-call-to-recursive-tail-call.js: Added.
(factorial.aux):
(factorial):
(factorial2.aux):
(factorial2.id):
(factorial2):
(factorial3.aux):
(factorial3):
(aux):
(factorial4):
(test):

Source/JavaScriptCore:

We want to turn recursive tail calls into loops early in the pipeline, so that the loops can then be optimized.
One difficulty is that we need to split the entry block of the function we are jumping to in order to have somewhere to jump to.
Worse: it is not necessarily the first block of the codeBlock, because of inlining! So we must do the splitting in the DFGByteCodeParser, at the same time as inlining.
We do this part through modifying the computation of the jump targets.
Importantly, we only do this splitting for functions that have tail calls.
It is the only case where the optimisation is sound, and doing the splitting unconditionnaly destroys performance on Octane/raytrace.

We must then do the actual transformation also in DFGByteCodeParser, to avoid code motion moving code out of the body of what will become a loop.
The transformation is entirely contained in handleRecursiveTailCall, which is hooked to the inlining machinery.

* bytecode/CodeBlock.h:
(JSC::CodeBlock::hasTailCalls const):
* bytecode/PreciseJumpTargets.cpp:
(JSC::getJumpTargetsForBytecodeOffset):
(JSC::computePreciseJumpTargetsInternal):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::hasTailCalls const):
(JSC::UnlinkedCodeBlock::setHasTailCalls):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitEnter):
(JSC::BytecodeGenerator::emitCallInTailPosition):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::allocateTargetableBlock):
(JSC::DFG::ByteCodeParser::makeBlockTargetable):
(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::parse):

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

2 years agohttp/tests/workers/service/basic-register.html is a flaky failure.
cdumez@apple.com [Thu, 19 Oct 2017 16:10:47 +0000 (16:10 +0000)]
http/tests/workers/service/basic-register.html is a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=178494
<rdar://problem/35065315>

Reviewed by Youenn Fablet.

In WebSWServerConnection::resolveJobInClient(), when a service worker is
registered, we:
1. Add the origin to the WebSWOriginStore
2. Send the IPC to the WebProcess to notify it that the registration succeeded.

The assumption was that step 1 would be synchronous and would therefore send
the shared memory handle to the WebProcess (if the SharedMemory was invalidated)
*before* step 2.

The issue is that step 1 was scheduling a zero-timer to schedule the addition.
As a result, there was a race and the WebContent process could check the
the WebSWOriginTable *after* being notified that a service worker was registered
but *before* it received the SharedMemory handle for the WebSWOriginTable. This
could lead to false negatives and was causing the layout test to be flaky.

To address the issue, step 1 is now synchronous.

* Shared/SharedStringHashStore.cpp:
(WebKit::SharedStringHashStore::SharedStringHashStore):
(WebKit::SharedStringHashStore::scheduleAddition):
(WebKit::SharedStringHashStore::scheduleRemoval):
(WebKit::SharedStringHashStore::contains):
(WebKit::SharedStringHashStore::flushPendingChanges):
(WebKit::SharedStringHashStore::processPendingOperations):
* Shared/SharedStringHashStore.h:
* StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
(WebKit::WebSWOriginStore::add):
(WebKit::WebSWOriginStore::addAll):
(WebKit::WebSWOriginStore::remove):
* StorageProcess/ServiceWorker/WebSWOriginStore.h:
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::addVisitedLinkHash):
(WebKit::VisitedLinkStore::removeVisitedLinkHash):

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

2 years ago[FrameView::layout cleanup] Replace m_nestedLayoutCount with isLayoutNested()
zalan@apple.com [Thu, 19 Oct 2017 15:52:37 +0000 (15:52 +0000)]
[FrameView::layout cleanup] Replace m_nestedLayoutCount with isLayoutNested()
https://bugs.webkit.org/show_bug.cgi?id=178503
<rdar://problem/35066561>

Reviewed by Antti Koivisto.

Covered by existing tests.

* page/FrameView.cpp:
(WebCore::FrameView::reset):
(WebCore::FrameView::layout):
(WebCore::FrameView::updateLayerPositionsAfterScrolling):
(WebCore::FrameView::updateCompositingLayersAfterScrolling):
(WebCore::FrameView::updateEmbeddedObjects):
(WebCore::FrameView::flushPostLayoutTasksQueue):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
* page/FrameView.h:

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

2 years agoOverlapping text on all CSS fonts specs
antti@apple.com [Thu, 19 Oct 2017 13:11:05 +0000 (13:11 +0000)]
Overlapping text on all CSS fonts specs
https://bugs.webkit.org/show_bug.cgi?id=177585
<rdar://problem/34704078>

Reviewed by Daniel Bates.

Source/WebCore:

We were resetting StyleResolver::overrideDocumentElementStyle too early when resolving slot elements.
This resulted in 'rem' units being miscomputed.

Reduction by Zalan.

Test: fast/html/details-line-height-overlap.html

* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Scope::Scope):
(WebCore::Style::TreeResolver::Scope::~Scope):

    Only reset overrideDocumentElementStyle when destroying the scope.

(WebCore::Style::TreeResolver::pushScope):
(WebCore::Style::TreeResolver::pushEnclosingScope):
(WebCore::Style::TreeResolver::popScope):

    A scope can show up multiple times in scope stack.

* style/StyleTreeResolver.h:

LayoutTests:

* fast/html/details-line-height-overlap-expected.html: Added.
* fast/html/details-line-height-overlap.html: Added.
* platform/ios/fast/shadow-dom/copy-shadow-tree-expected.txt:

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

2 years agoConsolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
rniwa@webkit.org [Thu, 19 Oct 2017 10:34:31 +0000 (10:34 +0000)]
Consolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
https://bugs.webkit.org/show_bug.cgi?id=178504

Reviewed by Antti Koivisto.

Consolidated calls to notifyChildNodeInserted, childrenChanged, didFinishInsertingNode, and
dispatchChildInsertionEvents for inserting a node by executeNodeInsertionWithScriptAssertion,
a new templatefunction which takes a closure to do the node insertion to make exactly when
the script becomes runnable clear.

Added an exception to SVGTRefElement::updateReferencedText since this code mutates user agent
shadow root during insertedInto, and turned ChildChangeSource into an enum class.

* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
* dom/ContainerNode.cpp:
(WebCore::executeNodeInsertionWithScriptAssertion): Extracted.
(WebCore::ContainerNode::takeAllChildrenFrom): Deployed executeNodeInsertionWithScriptAssertion.
(WebCore::ContainerNode::insertBefore): Ditto.
(WebCore::ContainerNode::changeForChildInsertion): Deleted.
(WebCore::ContainerNode::notifyChildInserted): Deleted.
(WebCore::ContainerNode::parserInsertBefore): Deployed executeNodeInsertionWithScriptAssertion.
(WebCore::ContainerNode::replaceChild): Ditto.
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::parserRemoveChild):
(WebCore::ContainerNode::replaceAllChildren): Ditto.
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
(WebCore::ContainerNode::parserAppendChild): Ditto.
(WebCore::ContainerNode::childrenChanged):
(WebCore::ContainerNode::updateTreeAfterInsertion): Deleted.
* dom/ContainerNode.h:
* dom/Element.cpp:
(WebCore::Element::childrenChanged):
* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::childrenChanged):
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::childrenChanged):
* svg/SVGElement.cpp:
(WebCore::SVGElement::childrenChanged):
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::childrenChanged):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::childrenChanged):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::childrenChanged):
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::childrenChanged):
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::childrenChanged):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::childrenChanged):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::updateReferencedText): Allow DOM mutations inside the user agent shadow tree here.

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

2 years agoImport W3C Web Platform Tests for createImageBitmap
dino@apple.com [Thu, 19 Oct 2017 10:07:26 +0000 (10:07 +0000)]
Import W3C Web Platform Tests for createImageBitmap
https://bugs.webkit.org/show_bug.cgi?id=178509
<rdar://problem/35070583>

Reviewed by Antoine Quint.

* resources/import-expectations.json:
* web-platform-tests/2dcontext/imagebitmap/common.js: Added.
(testCanvasDisplayingPattern):
(testDrawImageBitmap):
(initializeImageData):
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-sizeOverflow-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-sizeOverflow.html: Added.
* web-platform-tests/2dcontext/imagebitmap/w3c-import.log: Added.

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

2 years agoAdd an argument indicating the type of removal to Node::removedFrom
rniwa@webkit.org [Thu, 19 Oct 2017 10:05:21 +0000 (10:05 +0000)]
Add an argument indicating the type of removal to Node::removedFrom
https://bugs.webkit.org/show_bug.cgi?id=178505

Reviewed by Antti Koivisto.

Like r223628, added RemovalType as the first argument to Node::removedFrom, which contains two booleans indicating
whether the node just become disconnected from a document, and whether node's tree scope had changed or not.

These boolean flags simplifies the logic in removedFrom implementations, and are required to have a better
guarantee about the correctness of node flags during calls to removedFrom. Right now, Node::isConnected() and
Node::isInShadowTree() are both outdated until Node::removedFrom is called.

Also renamed the second argument of removedFrom to parentOfRemovedTree to make the semantics clear.

Note that in some implementations of removedFrom, we check whether isConnected() was true to decide whether
the node had already been disconnected from a document prior to calls to this particular call of removedFrom.
This extra check is no longer necessary since no node will be removed from a document without first being inserted
completely somewhere after r223458.

No new tests since there should be no behavioral changes.

* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyNodeInsertedIntoDocument): Replaced RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
(WebCore::notifyNodeRemovedFromDocument): Replaced the check that the node had not been re-connected by scripts
by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
Also moved the code to call setCSSTarget to Element::removedFrom. This random call to setCSSTarget predates r114351,
as well as r40475. It was originally introduced by r29311 into Node::removedFromDocument() ten years ago.
(WebCore::notifyNodeRemovedFromTree): Moved NoEventDispatchAssertion to notifyChildNodeRemoved.
(WebCore::notifyChildNodeRemoved): Added NoEventDispatchAssertion.
* dom/ContainerNodeAlgorithms.h:
* dom/Element.cpp:
(WebCore::Element::removedFrom): Replaced the complicated code to detect when this element is removed from a document
and its tree scope had changed by removalType.disconnectedFromDocument and removalType.treeScopeChanged.
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::removedFrom):
* dom/Node.h: Replaced a long block of comments above insertedInto by two lines of concise comments now that
the semantics of insertedInto and didFinishInsertingNode are more clear, and enforced by assertions.
(WebCore::Node::RemovalType::RemovalType): Addedl
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::removedFrom):
* dom/ProcessingInstruction.h:
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::removedFrom): The extra !isConnected() check is no longer needed. See the description above.
* dom/ShadowRoot.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::removedFrom):
* html/FormAssociatedElement.h:
* html/HTMLBaseElement.cpp:
(WebCore::HTMLBaseElement::removedFrom):
* html/HTMLBaseElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::removedFrom):
* html/HTMLFormControlElement.h:
* html/HTMLFormControlElementWithState.cpp:
(WebCore::HTMLFormControlElementWithState::removedFrom):
* html/HTMLFormControlElementWithState.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::removedFrom):
* html/HTMLFormElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::removedFrom):
* html/HTMLFrameSetElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::removedFrom):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::removedFrom):
* html/HTMLInputElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
* html/HTMLLinkElement.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::removedFrom):
* html/HTMLMapElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removedFrom):
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::removedFrom):
* html/HTMLObjectElement.h:
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::removedFrom): Simplifies the logic to detect when this slot element is being
removed from a shadow tree using removalType.treeScopeChanged.
* html/HTMLSlotElement.h:
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto): Added a FIXME for an obvious bug.
(WebCore::HTMLSourceElement::removedFrom): Ditto.
* html/HTMLSourceElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::removedFrom):
* html/HTMLStyleElement.h:
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::removedFrom):
* html/HTMLTitleElement.h:
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::removedFrom): Ditto.
* html/HTMLTrackElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::removedFrom): Replaced isConnected() check before calling Node::removedFrom by the check of
removalType.disconnectedFromDocument.
* svg/SVGElement.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::removedFrom):
* svg/SVGFEImageElement.h:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::removedFrom):
* svg/SVGFontFaceElement.h:
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::removedFrom):
* svg/SVGMPathElement.h:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::removedFrom):
* svg/SVGPathElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::removedFrom):
* svg/SVGSVGElement.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
* svg/SVGStyleElement.h:
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::removedFrom):
* svg/SVGTRefElement.h:
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::removedFrom):
* svg/SVGTextPathElement.h:
* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::removedFrom):
* svg/SVGTitleElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::removedFrom):
* svg/SVGUseElement.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::removedFrom):
* svg/animation/SVGSMILElement.h:

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

2 years agoUpdate the signatures of compressedTexSubImage3D.
Ms2ger@igalia.com [Thu, 19 Oct 2017 08:27:10 +0000 (08:27 +0000)]
Update the signatures of compressedTexSubImage3D.
https://bugs.webkit.org/show_bug.cgi?id=178507

Reviewed by Ryosuke Niwa.

No new tests: not much point in adding tests now; this method doesn't
do anything anyway.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:

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

2 years ago[curl] Segfault in WebCore::CurlRequest::setupPOST
commit-queue@webkit.org [Thu, 19 Oct 2017 07:41:41 +0000 (07:41 +0000)]
[curl] Segfault in WebCore::CurlRequest::setupPOST
https://bugs.webkit.org/show_bug.cgi?id=178434

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-19
Reviewed by Ryosuke Niwa.

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::resolveBlobReferences):
(WebCore::CurlRequest::setupPOST):

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

2 years agoDon't expose raw HTML in pasteboard to the web content
rniwa@webkit.org [Thu, 19 Oct 2017 05:44:33 +0000 (05:44 +0000)]
Don't expose raw HTML in pasteboard to the web content
https://bugs.webkit.org/show_bug.cgi?id=178422
Source/WebCore:

<rdar://problem/34567052>

Reviewed by Wenson Hsieh.

This patch enables HTML sanitization added in r223440 when WebKit pastes & concludes edit drag as opposed to
just when dataTransfer.get is used. This is important to avoid leaking privacy sensitive information such as
local file paths and pasting potentially harmful content such as scripts in event handler serialized by
WebKit prior to r223462. In addition, we start using blob URLs in the pasted content instead of retaining
the original URL and overriding the document loader like r222839 for RTFD and r222119 for image files.

To do this, a new superclass FrameWebContentReader of PasteboardWebContentReader and WebContentMarkupReader
is introduced, and helper functions are extracted out of WebContentMarkupReader in WebContentReaderCocoa.mm
to be also used in WebContentReader.

Tests: http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html
       http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin.html
       http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html
       PasteWebArchive.SanitizesHTML

* editing/WebContentReader.cpp:
(WebCore::FrameWebContentReader::shouldSanitize const): Moved from WebContentMarkupReader.
* editing/WebContentReader.h:
(WebCore::FrameWebContentReader): Added to share code between WebContentReader and WebContentMarkupReader.
(WebCore::FrameWebContentReader::FrameWebContentReader): Added.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelectionToPasteboard): Store the content's origin in the pasteboard so that we can
avoid sanitizing the content when pasting into the same document. This is important since converting all URLs
into blob URLs would break editors on the Web which tracks images, etc... in the content using URLs.
(WebCore::Editor::writeSelection): Ditto.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::MarkupAndArchive): Replaced FragmentAndArchive. Now returns the markup string in the archive
instead of the parsed fragment.
(WebCore::extractMarkupAndArchive): Renamed from createFragmentFromWebArchive. Now returns the markup string.
(WebCore::sanitizeMarkupWithArchive): Extracted out of WebContentMarkupReader::readWebArchive to share code
between WebContentReader and WebContentMarkupReader, and added the code to handle subframes recursively.
As inefficient as this code is, we can't delay the conversion of subframes' marksup until later time since
the main frame's markup would contain blob URLs to refer to those subframes.
(WebCore::WebContentReader::readWebArchive): Use sanitizeMarkupWithArchive when shouldSanitize() is true.
Don't add the subresources to the document loader when the content will be loaded into the same origin since
subresouces are mostly likely available in the document anyway.
(WebCore::WebContentMarkupReader::readWebArchive):
* platform/Pasteboard.h:
(WebCore::PasteboardWebContent): Added contentOrigin.
* platform/PasteboardWriterData.h:
(WebCore::PasteboardWriterData): Ditto.
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::read): Read the origin before branching out to readRespectingUTIFidelities.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write): Record the content origin into the pasteboard.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write): Ditto.
* platform/mac/PasteboardWriter.mm:
(WebCore::createPasteboardWriter): Ditto.

Source/WebKit:

Reviewed by Wenson Hsieh.

Encode & decode the origin string of the copied content written into the system pasteboard.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PasteboardWebContent>::encode):
(IPC::ArgumentCoder<PasteboardWebContent>::decode):

Tools:

Reviewed by Wenson Hsieh.

Added a test case for sanitizing web archive in the system pasteboard to strip privacy sensitive information
such as local file paths and potentially harmful scripts like event handlers serialized by WebKit prior to r223462.

* TestWebKitAPI/Tests/WebKitCocoa/PasteWebArchive.mm:
(PasteWebArchive.SanitizesHTML):

LayoutTests:

Reviewed by Wenson Hsieh.

Added tests to copy & paste web contents within the same origin as well as cross origin.

* TestExpectations:
* editing/pasteboard/data-transfer-get-data-on-drop-rich-text-expected.txt: Now contains DOCTYPE.
* editing/pasteboard/data-transfer-get-data-on-paste-rich-text-expected.txt: Ditto.
* editing/pasteboard/onpaste-text-html-expected.txt: Rebaselined as now inline styles are stripped.
* editing/pasteboard/onpaste-text-html.html: Strip away the inline style data since they differ on each platform.
* http/tests/misc/copy-resolves-urls-expected.txt:
* http/tests/misc/copy-resolves-urls.html: Now uses blob URL for the pasted image as expected.
* http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin-expected.txt: Added.
* http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html: Added.
* http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin-expected.txt: Added.
* http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin.html: Added.
* http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin-expected.txt: Added.
* http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html: Added.
* http/tests/security/clipboard/resources/content-to-copy.html: Added.
* http/tests/security/clipboard/resources/subdirectory/paste-html.html: Added.
* platform/ios/TestExpectations: Unskip tests that have started passing.
* platform/mac-wk1/TestExpectations: Unskip the drag & drop test which only works in Mac WK1.
* platform/win/TestExpectations: Skip the newly added tests since we don't support custom pasteboard
data on Windows port.

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

2 years agoAnother attempt to fix the windows build.
weinig@apple.com [Thu, 19 Oct 2017 05:02:01 +0000 (05:02 +0000)]
Another attempt to fix the windows build.

* page/SettingsBase.cpp:
(WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
* page/SettingsBase.h:

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

2 years agoAttempt to fix the windows build.
weinig@apple.com [Thu, 19 Oct 2017 04:42:25 +0000 (04:42 +0000)]
Attempt to fix the windows build.

* page/SettingsBase.cpp:
(WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
* page/SettingsBase.h:

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

2 years ago[Settings] Convert more settings to be generated
commit-queue@webkit.org [Thu, 19 Oct 2017 04:08:39 +0000 (04:08 +0000)]
[Settings] Convert more settings to be generated
https://bugs.webkit.org/show_bug.cgi?id=177766

Patch by Sam Weinig <sam@webkit.org> on 2017-10-18
Reviewed by Dean Jackson.

- Replaces setNeedsStyleRecalcInAllFrames option in Settings.in
  with a more generic, onChange, which allows you to specify a function
  in SettingsBase that will be called when the setting changes.
  setNeedsStyleRecalcInAllFrames is then reimplemented in terms of
  onChange.
- Moves most (all but two) of the remaining non-static settings from
  SettingsBase to Settings.in

* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
(printSetterBody):
* Scripts/GenerateSettings/Settings.py:
(Setting.__init__):
(Setting.__str__):
(Setting.typeIsValueType):
(Setting.setterFunctionName):
(Setting.setterChangeFunctionName):
(Setting.hasComplexSetter):
(parseInput):

    Add support for the onChange option.

* page/Settings.in:

    Migrate most of the remaining non-static settings to Settings.in.
    Adopt onChange option.

* page/SettingsBase.cpp:
* page/SettingsBase.h:

    Add helper functions for use by the onChange option.

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

2 years agoImplement ServiceWorkerRegistration.scope / updateViaCache
cdumez@apple.com [Thu, 19 Oct 2017 03:29:51 +0000 (03:29 +0000)]
Implement ServiceWorkerRegistration.scope / updateViaCache
https://bugs.webkit.org/show_bug.cgi?id=178497

Reviewed by Youenn Fablet.

Source/WebCore:

Implement ServiceWorkerRegistration.scope / updateViaCache.

No new tests, updated existing test.

* WebCore.xcodeproj/project.pbxproj:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::resolvedWithRegistration):
* workers/service/ServiceWorkerJob.h:
* workers/service/ServiceWorkerJobClient.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::scope const):
(WebCore::ServiceWorkerRegistration::updateViaCache const):
(WebCore::ServiceWorkerRegistration::update):
(WebCore::ServiceWorkerRegistration::unregister):
(WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
(WebCore::ServiceWorkerRegistration::activeDOMObjectName const):
(WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/ServiceWorkerRegistration.idl:
* workers/service/ServiceWorkerRegistrationData.cpp:
(WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
* workers/service/ServiceWorkerRegistrationData.h:
(WebCore::ServiceWorkerRegistrationData::encode const):
(WebCore::ServiceWorkerRegistrationData::decode):
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::jobResolvedInServer):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::scriptContextStarted):
(WebCore::SWServerRegistration::data const):

Source/WebKit:

* Shared/WebCoreArgumentCoders.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:

LayoutTests:

Extend layout test coverage.

* http/tests/workers/service/basic-register-expected.txt:
* http/tests/workers/service/resources/basic-register.js:
(then):

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

2 years agoAdd preliminary support for ServiceWorker Handle Fetch
commit-queue@webkit.org [Thu, 19 Oct 2017 02:26:00 +0000 (02:26 +0000)]
Add preliminary support for ServiceWorker Handle Fetch
https://bugs.webkit.org/show_bug.cgi?id=178475

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-18
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/workers/service/basic-fetch.https.html

Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
A script context is now storing its selected service worker identifier. This should be fully implemented later on.
This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.

* WebCore.xcodeproj/project.pbxproj:
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
(WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* loader/FetchOptions.h:
(WebCore::isPotentialNavigationOrSubresourceRequest):
(WebCore::isNonSubresourceRequest):
* loader/ResourceLoaderOptions.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
* loader/WorkerThreadableLoader.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* workers/WorkerThread.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerProvider.h:
* workers/service/context/SWContextManager.cpp: Removed.
* workers/service/context/ServiceWorkerThread.h:
* workers/service/server/SWServer.h:

Source/WebKit:

Preliminary support of Handle Fetch algorithm and integration with fetch spec.
Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
It is similar to WebResourceLoader that do the load through NetworkProcess.
In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
it will fallback to WebResourceLoader through a fallback callback.

Loading through Service Worker is done currently if:
- There is a service worker registered for that origin
- Request is a subresource
- service workers mode is all
There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
Future work should try to reduce the cases where the IPC dance is done unnecessarily.

ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
In particular, it is calling ResourceLoader error callback if response is of type error.
It should call ResourceLoader redirection callback if response is a redirection response.
This will be done as a follow-up.

Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.

Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.

* DerivedSources.make:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::didReceiveFetchResponse):
(WebKit::WebSWServerConnection::didReceiveFetchData):
(WebKit::WebSWServerConnection::didFinishFetch):
(WebKit::WebSWServerConnection::failedFetch):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::failedFetch):
(WebKit::StorageProcess::didReceiveFetchResponse):
(WebKit::StorageProcess::didReceiveFetchData):
(WebKit::StorageProcess::didFinishFetch):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added.
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):
(WebKit::ServiceWorkerClientFetch::didReceiveData):
(WebKit::ServiceWorkerClientFetch::didFinishFetch):
(WebKit::ServiceWorkerClientFetch::didFail):
* WebProcess/Storage/ServiceWorkerClientFetch.h: Added.
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Added.
* WebProcess/Storage/ServiceWorkerContextManager.cpp: Renamed from Source/WebCore/workers/service/context/SWContextManager.cpp.
(WebKit::ServiceWorkerContextManager::startServiceWorkerContext):
(WebKit::ServiceWorkerContextManager::startFetch):
* WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h.
(WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::startFetch):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::shouldHandleFetch):
(WebKit::WebServiceWorkerProvider::handleFetch):
(WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage):
* WebProcess/Storage/WebServiceWorkerProvider.h:
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWorkerContextConnection):
(WebKit::WebProcess::startServiceWorkerContext):
(WebKit::WebProcess::startFetchInServiceWorker):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

LayoutTests:

* http/tests/workers/service/basic-fetch.https-expected.txt: Added.
* http/tests/workers/service/basic-fetch.https.html: Added.
* http/tests/workers/service/resources/basic-fetch-worker.js: Added.
* http/tests/workers/service/resources/basic-fetch.js: Added.

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

2 years ago[FrameView::layout cleanup] Group related pre-layout code to improve readability
zalan@apple.com [Thu, 19 Oct 2017 02:22:45 +0000 (02:22 +0000)]
[FrameView::layout cleanup] Group related pre-layout code to improve readability
https://bugs.webkit.org/show_bug.cgi?id=178496
<rdar://problem/35065718>

Reviewed by Simon Fraser.

Early returns/asserts/member variable resets etc.

Covered by existing tests.

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

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

2 years agoTestController should clear all fetch caches when resetting its state
commit-queue@webkit.org [Thu, 19 Oct 2017 02:14:55 +0000 (02:14 +0000)]
TestController should clear all fetch caches when resetting its state
https://bugs.webkit.org/show_bug.cgi?id=178486

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-18
Reviewed by Chris Dumez.

Tools:

Adding clearDOMCaches test runner method.
Using that method when resetting state.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::clearDOMCaches):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/cache-storage/cache-clearing-all.https.html:

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

2 years ago[iOS] Use new class name from UIKit when checking UITextSuggestion type
cpugh@apple.com [Thu, 19 Oct 2017 01:39:14 +0000 (01:39 +0000)]
[iOS] Use new class name from UIKit when checking UITextSuggestion type
https://bugs.webkit.org/show_bug.cgi?id=178416
Source/WebKit:

<rdar://problem/35010840>

Reviewed by Tim Horton.

Here we start using UITextAutofillSuggestion instead of the old name that was being used for
AutoFill text suggestions.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView insertTextSuggestion:]): Use UITextAutofillSuggestion when checking the class
and when casting instead of UIKeyboardLoginCredentialsSuggestion.

Tools:

Reviewed by Tim Horton.

This updates our test using/mocking out UITextAutofillSuggestion instead of UIKeyboardLoginCredentialsSuggestion.

* TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm:
(-[UITextAutofillSuggestion initWithUsername:password:]): Copied from UIKit's implementation. This will serve as
a mock of this method for builds not containingit.
(+[UITextAutofillSuggestion autofillSuggestionWithUsername:password:]): Ditto.
(TestWebKitAPI::TEST): Use +[UITextAutofillSuggestion autofillSuggestionWithUsername:password:] inline instead of
helper function for creating a new suggestion.
(newUIKeyboardLoginCredentialsSuggestion): Deleted.

* TestWebKitAPI/ios/UIKitSPI.h:

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

2 years agoWeb Inspector: Layers sidebar footer should not have white background with full-width...
commit-queue@webkit.org [Thu, 19 Oct 2017 01:22:57 +0000 (01:22 +0000)]
Web Inspector: Layers sidebar footer should not have white background with full-width quick console
https://bugs.webkit.org/show_bug.cgi?id=178493

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-10-18
Reviewed by Matt Baker.

* UserInterface/Views/LayerDetailsSidebarPanel.css:
Update CSS for new sidebar.

* UserInterface/Views/LayerTreeDetailsSidebarPanel.css:
Update CSS for legacy sidebar.

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

2 years agoRegExpObject::defineOwnProperty() does not need to compare values if no descriptor...
mark.lam@apple.com [Thu, 19 Oct 2017 01:12:56 +0000 (01:12 +0000)]
RegExpObject::defineOwnProperty() does not need to compare values if no descriptor value is specified.
https://bugs.webkit.org/show_bug.cgi?id=177600
<rdar://problem/34710985>

Reviewed by Saam Barati.

JSTests:

* stress/regress-177600.js: Added.

Source/JavaScriptCore:

According to http://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor,
section 9.1.6.3-7.a.ii, we should only check if the value is the same if the
descriptor value is present.

* runtime/RegExpObject.cpp:
(JSC::RegExpObject::defineOwnProperty):

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

2 years agoReplace some stack raw pointers with RefPtrs within WebCore/html
jiewen_tan@apple.com [Thu, 19 Oct 2017 01:01:21 +0000 (01:01 +0000)]
Replace some stack raw pointers with RefPtrs within WebCore/html
https://bugs.webkit.org/show_bug.cgi?id=178201
<rdar://problem/34841692>

Reviewed by Ryosuke Niwa.

Source/WebCore:

This is an effort to reduce raw pointer usage in DOM code. In this patch, raw pointers
that are ref countable are blindly selected to be replaced with RefPtrs with one exception
which is auto*.

Also, this patch occasionally modifies the return type of some methods, and therefore callers
of those methods are modified accordingly.

* Modules/encryptedmedia/legacy/LegacyCDM.cpp:
(WebCore::LegacyCDM::mediaPlayer const):
* Modules/encryptedmedia/legacy/LegacyCDM.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
(WebCore::CDMPrivateMediaPlayer::createSession):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::cdmMediaPlayer const):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::externalDeviceDisplayName const):
(WebCore::MediaControlsHost::externalDeviceType const):
* dom/Element.cpp:
(WebCore::Element::focusDelegate):
(WebCore::Element::userAgentShadowRoot const):
(WebCore::Element::ensureUserAgentShadowRoot):
* dom/Element.h:
* dom/EventContext.cpp:
(WebCore::TouchEventContext::checkReachability const):
* dom/EventPath.cpp:
(WebCore::shouldEventCrossShadowBoundary):
(WebCore::EventPath::setRelatedTarget):
(WebCore::EventPath::retargetTouch):
(WebCore:: const):
* dom/EventTarget.cpp:
(WebCore::EventTarget::toNode):
(WebCore::EventTarget::addEventListener):
* dom/EventTarget.h:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::toElement const):
(WebCore::MouseEvent::fromElement const):
* dom/MouseEvent.h:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::computeRelativePosition):
* dom/Node.cpp:
(WebCore::Node::toNode):
* dom/Node.h:
* dom/ScopedEventQueue.cpp:
* editing/Editor.cpp:
(WebCore::Editor::selectionForCommand):
* editing/EditorCommand.cpp:
(WebCore::targetFrame):
* editing/TextIterator.cpp:
(WebCore::TextIterator::handleReplacedElement):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::updateColorSwatch):
(WebCore::ColorInputType::shadowColorSwatch const):
* html/FileInputType.cpp:
(WebCore::FileInputType::disabledAttributeChanged):
(WebCore::FileInputType::multipleAttributeChanged):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::findAssociatedForm):
(WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
(WebCore::FormAssociatedElement::resetFormOwner):
(WebCore::FormAssociatedElement::formAttributeChanged):
* html/FormController.cpp:
(WebCore::recordFormStructure):
(WebCore::FormKeyGenerator::formKey):
(WebCore::FormController::restoreControlStateIn):
* html/HTMLAnchorElement.cpp:
(WebCore::appendServerMapMousePosition):
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::updateWidget):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::imageElement const):
(WebCore::HTMLAreaElement::isFocusable const):
(WebCore::HTMLAreaElement::setFocus):
(WebCore::HTMLAreaElement::updateFocusAppearance):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollLeft):
(WebCore::HTMLBodyElement::setScrollLeft):
(WebCore::HTMLBodyElement::scrollTop):
(WebCore::HTMLBodyElement::setScrollTop):
(WebCore::HTMLBodyElement::scrollHeight):
(WebCore::HTMLBodyElement::scrollWidth):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createElementRenderer):
(WebCore:: const):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::width):
(WebCore::HTMLDocument::height):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::rendererIsNeeded):
(WebCore::setHasDirAutoFlagRecursively):
(WebCore::HTMLElement::directionality const):
(WebCore::HTMLElement::dirAttributeChanged):
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
(WebCore::HTMLEmbedElement::rendererIsNeeded):
* html/HTMLFieldSetElement.cpp:
(WebCore::updateFromControlElementsAncestorDisabledStateUnder):
(WebCore::HTMLFieldSetElement::disabledStateChanged):
(WebCore::HTMLFieldSetElement::childrenChanged):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
(WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
(WebCore::HTMLFormControlElement::didChangeForm):
(WebCore::HTMLFormControlElement::shouldAutocorrect const):
(WebCore::HTMLFormControlElement::autocapitalizeType const):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::handleLocalEvents):
(WebCore::submitElementFromEvent):
(WebCore::HTMLFormElement::prepareForSubmission):
(WebCore::HTMLFormElement::submit):
(WebCore::HTMLFormElement::reset):
(WebCore::HTMLFormElement::shouldAutocorrect const):
(WebCore::HTMLFormElement::parseAttribute):
(WebCore::HTMLFormElement::resetDefaultButton):
(WebCore::HTMLFormElement::elementFromPastNamesMap const):
(WebCore::HTMLFormElement::namedElements):
* html/HTMLFormElement.h:
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::didAttachRenderers):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::isURLAllowed const):
(WebCore::HTMLFrameElementBase::openURL):
(WebCore::HTMLFrameElementBase::didAttachRenderers):
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::setContentFrame):
(WebCore::HTMLFrameOwnerElement::clearContentFrame):
(WebCore::HTMLFrameOwnerElement::disconnectContentFrame):
(WebCore::SubframeLoadingDisabler::canLoadFrame):
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::findContaining):
(WebCore::HTMLFrameSetElement::willAttachRenderers):
(WebCore::HTMLFrameSetElement::insertedInto):
(WebCore::HTMLFrameSetElement::removedFrom):
* html/HTMLFrameSetElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
(WebCore::HTMLImageElement::pictureElement const):
(WebCore::HTMLImageElement::destroyImageControls):
(WebCore::HTMLImageElement::hasImageControls const):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::innerTextElement const):
(WebCore::HTMLInputElement::endEditing):
(WebCore::HTMLInputElement::dataList const):
(WebCore::HTMLInputElement::resetListAttributeTargetObserver): Deleted.
(WebCore::HTMLInputElement::listAttributeTargetChanged): Deleted.
(WebCore::HTMLInputElement::isSteppable const): Deleted.
(WebCore::HTMLInputElement::dateType const): Deleted.
(WebCore::HTMLInputElement::isTextButton const): Deleted.
(WebCore::HTMLInputElement::isRadioButton const): Deleted.
(WebCore::HTMLInputElement::isSearchField const): Deleted.
(WebCore::HTMLInputElement::isInputTypeHidden const): Deleted.
(WebCore::HTMLInputElement::isPasswordField const): Deleted.
(WebCore::HTMLInputElement::isCheckbox const): Deleted.
(WebCore::HTMLInputElement::isRangeControl const): Deleted.
(WebCore::HTMLInputElement::isColorControl const): Deleted.
(WebCore::HTMLInputElement::isText const): Deleted.
(WebCore::HTMLInputElement::isEmailField const): Deleted.
(WebCore::HTMLInputElement::isFileUpload const): Deleted.
(WebCore::HTMLInputElement::isImageButton const): Deleted.
(WebCore::HTMLInputElement::isNumberField const): Deleted.
(WebCore::HTMLInputElement::isSubmitButton const): Deleted.
(WebCore::HTMLInputElement::isTelephoneField const): Deleted.
(WebCore::HTMLInputElement::isURLField const): Deleted.
(WebCore::HTMLInputElement::isDateField const): Deleted.
(WebCore::HTMLInputElement::isDateTimeField const): Deleted.
(WebCore::HTMLInputElement::isDateTimeLocalField const): Deleted.
(WebCore::HTMLInputElement::isMonthField const): Deleted.
(WebCore::HTMLInputElement::isTimeField const): Deleted.
(WebCore::HTMLInputElement::isWeekField const): Deleted.
(WebCore::HTMLInputElement::isEnumeratable const): Deleted.
(WebCore::HTMLInputElement::supportLabels const): Deleted.
(WebCore::HTMLInputElement::shouldAppearChecked const): Deleted.
(WebCore::HTMLInputElement::supportsPlaceholder const): Deleted.
(WebCore::HTMLInputElement::updatePlaceholderText): Deleted.
(WebCore::HTMLInputElement::isEmptyValue const): Deleted.
(WebCore::HTMLInputElement::maxLengthAttributeChanged): Deleted.
(WebCore::HTMLInputElement::minLengthAttributeChanged): Deleted.
(WebCore::HTMLInputElement::updateValueIfNeeded): Deleted.
(WebCore::HTMLInputElement::defaultToolTip const): Deleted.
(WebCore::HTMLInputElement::matchesIndeterminatePseudoClass const): Deleted.
(WebCore::HTMLInputElement::shouldAppearIndeterminate const): Deleted.
(WebCore::HTMLInputElement::mediaCaptureType const): Deleted.
(WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Deleted.
(WebCore:: const): Deleted.
(WebCore::HTMLInputElement::checkedRadioButtonForGroup const): Deleted.
(WebCore::HTMLInputElement::radioButtonGroups const): Deleted.
(WebCore::HTMLInputElement::addToRadioButtonGroup): Deleted.
(WebCore::HTMLInputElement::removeFromRadioButtonGroup): Deleted.
(WebCore::HTMLInputElement::height const): Deleted.
(WebCore::HTMLInputElement::width const): Deleted.
(WebCore::HTMLInputElement::setHeight): Deleted.
(WebCore::HTMLInputElement::setWidth): Deleted.
(WebCore::ListAttributeTargetObserver::ListAttributeTargetObserver): Deleted.
(WebCore::ListAttributeTargetObserver::idTargetChanged): Deleted.
(WebCore::HTMLInputElement::setRangeText): Deleted.
(WebCore::HTMLInputElement::shouldTruncateText const): Deleted.
(WebCore::HTMLInputElement::selectionStartForBindings const): Deleted.
(WebCore::HTMLInputElement::setSelectionStartForBindings): Deleted.
(WebCore::HTMLInputElement::selectionEndForBindings const): Deleted.
(WebCore::HTMLInputElement::setSelectionEndForBindings): Deleted.
(WebCore::HTMLInputElement::selectionDirectionForBindings const): Deleted.
(WebCore::HTMLInputElement::setSelectionDirectionForBindings): Deleted.
(WebCore::HTMLInputElement::setSelectionRangeForBindings): Deleted.
(WebCore::HTMLInputElement::createInnerTextStyle const): Deleted.
(WebCore::HTMLInputElement::setupDateTimeChooserParameters): Deleted.
(WebCore::HTMLInputElement::capsLockStateMayHaveChanged): Deleted.
* html/HTMLInputElement.h:
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::shadowSelect const):
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::defaultEventHandler):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::handleClick):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::mapMouseEvent):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::isSafeToLoadURL):
(WebCore::HTMLMediaElement::controls const):
(WebCore::HTMLMediaElement::layoutSizeChanged):
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::mediaControls const):
(WebCore::HTMLMediaElement::hasMediaControls const):
(WebCore::HTMLMediaElement::mediaPlayerReferrer const):
(WebCore::HTMLMediaElement::mediaPlayerUserAgent const):
(WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge):
(WebCore::HTMLMediaElement::sourceApplicationIdentifier const):
(WebCore::HTMLMediaElement::getVideoPlaybackQuality):
(WebCore::HTMLMediaElement::session const):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::player const):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::hasFallbackContent const):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::ownerSelectElement const):
(WebCore::HTMLOptGroupElement::accessKeyAction):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::setText):
(WebCore::HTMLOptionElement::accessKeyAction):
(WebCore::HTMLOptionElement::index const):
(WebCore::HTMLOptionElement::parseAttribute):
(WebCore::HTMLOptionElement::selected):
(WebCore::HTMLOptionElement::setSelected):
(WebCore::HTMLOptionElement::setSelectedState):
(WebCore::HTMLOptionElement::childrenChanged):
(WebCore::HTMLOptionElement::ownerDataListElement const):
(WebCore::HTMLOptionElement::ownerSelectElement const):
(WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
(WebCore::HTMLOptionElement::insertedInto):
(WebCore::HTMLOptionElement::collectOptionInnerText const):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::willDetachRenderers):
(WebCore::HTMLPlugInElement::isKeyboardFocusable const):
(WebCore::HTMLPlugInElement::isUserObservable const):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
(WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
(WebCore::HTMLSelectElement::recalcListItems const):
(WebCore::HTMLSelectElement::selectOption):
(WebCore::HTMLSelectElement::reset):
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
* html/HTMLSlotElement.cpp:
(WebCore::flattenAssignedNodes):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::removedFrom):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::isActiveSummary const):
(WebCore::isClickableControl):
(WebCore::HTMLSummaryElement::defaultEventHandler):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle const):
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::additionalPresentationAttributeStyle const):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::tHead const):
(WebCore::HTMLTableElement::setTHead):
(WebCore::HTMLTableElement::tFoot const):
(WebCore::HTMLTableElement::createTBody):
(WebCore::HTMLTableElement::lastBody const):
(WebCore::HTMLTableElement::deleteRow):
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::findParentTable const):
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::rowAfter):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::subtreeHasChanged):
(WebCore::HTMLTextAreaElement::innerTextElement const):
* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange):
(WebCore::HTMLTextFormControlElement::indexForVisiblePosition const):
(WebCore::HTMLTextFormControlElement::visiblePositionForIndex const):
(WebCore::HTMLTextFormControlElement::computeSelectionStart const):
(WebCore::HTMLTextFormControlElement::computeSelectionEnd const):
(WebCore::HTMLTextFormControlElement::computeSelectionDirection const):
(WebCore::HTMLTextFormControlElement::selection const):
(WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
(WebCore::innerTextValueFrom):
(WebCore::HTMLTextFormControlElement::setInnerTextValue):
(WebCore::HTMLTextFormControlElement::innerTextValue const):
(WebCore::positionForIndex):
(WebCore::HTMLTextFormControlElement::indexForPosition const):
(WebCore::HTMLTextFormControlElement::hidePlaceholder):
(WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary):
(WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
(WebCore::enclosingTextFormControl):
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* html/HTMLTextFormControlElement.h:
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::canLoadURL):
(WebCore::HTMLTrackElement::setReadyState):
(WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute const):
(WebCore::HTMLTrackElement::textTrackKindChanged):
(WebCore::HTMLTrackElement::textTrackModeChanged):
(WebCore::HTMLTrackElement::textTrackAddCues):
(WebCore::HTMLTrackElement::textTrackRemoveCues):
(WebCore::HTMLTrackElement::textTrackAddCue):
(WebCore::HTMLTrackElement::textTrackRemoveCue):
(WebCore::HTMLTrackElement::mediaElement const):
* html/HTMLTrackElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::setDisplayMode):
(WebCore::HTMLVideoElement::paintCurrentFrameInContext):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):
(WebCore::ImageDocument::scale):
(WebCore::ImageDocument::imageFitsInWindow):
* html/InputType.cpp:
(WebCore::InputType::destroyShadowSubtree):
* html/InputType.h:
(WebCore::InputType::innerTextElement const):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
(WebCore::MediaDocument::defaultEventHandler):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
(WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
(WebCore::isMainContentForPurposesOfAutoplay):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::decorationWidth const):
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::appendBytes):
* html/RadioInputType.cpp:
(WebCore::RadioInputType::handleKeydownEvent):
(WebCore::RadioInputType::isKeyboardFocusable const):
(WebCore::RadioInputType::didDispatchClick):
* html/RadioNodeList.cpp:
(WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter const):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::handleTouchEvent):
(WebCore::RangeInputType::sliderTrackElement const):
(WebCore::RangeInputType::listAttributeTargetChanged):
(WebCore::RangeInputType::updateTickMarkValues):
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtree):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isEmptyValue const):
(WebCore::TextFieldInputType::handleKeydownEvent):
(WebCore::TextFieldInputType::handleFocusEvent):
(WebCore::TextFieldInputType::innerTextElement const):
(WebCore::TextFieldInputType::updatePlaceholderText):
(WebCore::TextFieldInputType::didSetValueByUserEdit):
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
* html/TextFieldInputType.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::size):
(WebCore::CanvasRenderingContext2D::drawImage):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::copyBufferSubData):
(WebCore::WebGL2RenderingContext::getBufferSubData):
* html/canvas/WebGLFramebuffer.cpp:
(WebCore::WebGLFramebuffer::attach):
(WebCore::WebGLFramebuffer::getAttachmentObject const):
(WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
(WebCore::WebGLFramebuffer::getColorBufferWidth const):
(WebCore::WebGLFramebuffer::getColorBufferHeight const):
(WebCore::WebGLFramebuffer::getColorBufferFormat const):
(WebCore::WebGLFramebuffer::checkStatus const):
(WebCore::WebGLFramebuffer::hasStencilBuffer const):
(WebCore::WebGLFramebuffer::initializeAttachments):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
(WebCore::WebGLRenderingContextBase::compressedTexImage2D):
(WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::generateMipmap):
(WebCore::WebGLRenderingContextBase::getAttachedShaders):
(WebCore::WebGLRenderingContextBase::getTexParameter):
(WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
(WebCore::WebGLRenderingContextBase::texImage2DBase):
(WebCore::WebGLRenderingContextBase::validateTexFunc):
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::texSubImage2DBase):
(WebCore::WebGLRenderingContextBase::copyTexImage2D):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::texParameter):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::checkTextureCompleteness):
(WebCore::WebGLRenderingContextBase::validateTextureBinding):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
* html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const):
(WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor):
* html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const):
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::executeInsertAlreadyParsedChildTask):
(WebCore::HTMLConstructionSite::insertTextNode):
* html/parser/HTMLFormattingElementList.cpp:
(WebCore::HTMLFormattingElementList::tryToEnsureNoahsArkConditionQuickly):
* html/parser/HTMLParserOptions.cpp:
(WebCore::HTMLParserOptions::HTMLParserOptions):
* html/parser/HTMLParserScheduler.cpp:
(WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
(WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init):
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::parentMediaElement):
* html/shadow/MediaControlElementTypes.h:
(WebCore::parentMediaElement):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::startDrag):
(WebCore::MediaControlPanelElement::endDrag):
(WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
(WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
(WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
(WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
(WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
(WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
(WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
(WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
(WebCore::MediaControlTextTrackContainerElement::updateSizes):
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::containsRelatedTarget):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::isDisabledFormControl const):
(WebCore::SliderThumbElement::matchesReadWritePseudoClass const):
(WebCore::SliderThumbElement::focusDelegate):
(WebCore::SliderThumbElement::setPositionFromPoint):
(WebCore::SliderThumbElement::startDragging):
(WebCore::SliderThumbElement::stopDragging):
(WebCore::SliderThumbElement::defaultEventHandler):
(WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
(WebCore::SliderThumbElement::willRespondToMouseClickEvents):
(WebCore::SliderThumbElement::willDetachRenderers):
(WebCore::findTouchWithIdentifier):
(WebCore::SliderThumbElement::handleTouchStart):
(WebCore::SliderThumbElement::handleTouchMove):
(WebCore::SliderThumbElement::handleTouchEndAndCancel):
(WebCore::SliderThumbElement::handleTouchEvent):
(WebCore::SliderThumbElement::hostInput const):
* html/shadow/SliderThumbElement.h:
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::defaultEventHandler):
(WebCore::SpinButtonElement::releaseCapture):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerTextElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents):
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::defaultEventHandler):
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::trackElementIndex):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::setMode):
(WebCore::TextTrack::hasCue):
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::copyWebVTTNodeToDOMTree):
(WebCore::VTTCue::determineTextDirection):
(WebCore::VTTCue::markFutureAndPastNodes):
(WebCore::VTTCue::removeDisplayTree):
(WebCore::VTTCue::cueContentsMatch const):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::didAddEventListener):
(WebCore::InspectorDOMAgent::willRemoveEventListener):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::maybeCreateContextMenu):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::handleEvent):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::innerTextElement const):
(WebCore::RenderTextControl::styleDidChange):
(WebCore::RenderTextControl::textBlockLogicalWidth const):
(WebCore::RenderTextControl::computeLogicalHeight const):
(WebCore::RenderTextControl::hitInnerTextElement):
(WebCore::RenderTextControl::canScroll const):
(WebCore::RenderTextControl::innerLineHeight const):
* rendering/RenderTextControl.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::nodeAtPoint):
(WebCore::RenderTextControlSingleLine::styleDidChange):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isFocused const):
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::paintMediaSliderTrack):
(WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSliderThumb):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::willBeDestroyed):
(WebCore::RenderVideo::calculateIntrinsicSize):
(WebCore::RenderVideo::paintReplaced):
(WebCore::RenderVideo::updatePlayer):
(WebCore::RenderVideo::supportsAcceleratedRendering const):
(WebCore::RenderVideo::acceleratedRenderingStateChanged):
(WebCore::RenderVideo::requiresImmediateCompositing const):
(WebCore::RenderVideo::foregroundIsKnownToBeOpaqueInRect const):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::clearShadowTree):
(WebCore::SVGUseElement::targetClone const):

Source/WebKit:

Change the type of node as toNode() is changed to return RefPtr.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent):
* WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::handleEditingKeyboardEvent):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::frameForEvent):

Source/WebKitLegacy/mac:

* DOM/DOM.mm:
(kit):
Change the type of node as toNode() is changed to return RefPtr.

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::handleEditingKeyboardEvent):
Change the type of node as toNode() is changed to return RefPtr.

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

2 years agoupdate-webkit-auxiliary-libs can't download WebKitAuxiliaryLibrary.zip due to 403...
commit-queue@webkit.org [Thu, 19 Oct 2017 00:46:15 +0000 (00:46 +0000)]
update-webkit-auxiliary-libs can't download WebKitAuxiliaryLibrary.zip due to 403 Forbidden
https://bugs.webkit.org/show_bug.cgi?id=178381

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-18
Reviewed by Alexey Proskuryakov.

The web server developer.apple.com seems to reject HTTP requests
without Accept header field.

* Scripts/update-webkit-dependency: Add 'Accept' header field to requests.

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

2 years agoSome older hardware can't actually use renderbuffers at the size they advertise
dino@apple.com [Wed, 18 Oct 2017 23:41:44 +0000 (23:41 +0000)]
Some older hardware can't actually use renderbuffers at the size they advertise
https://bugs.webkit.org/show_bug.cgi?id=178417
<rdar://problem/35042291>

Reviewed by Tim Horton.

Source/WebCore:

The change in r223567 caused some older hardware to fail, because even though
they claimed to support a maximum renderbuffer and viewport of 16K, they were
unable to actually handle one. Rather than trying to identify such hardware,
clamp all buffers to a maximum of 8192. This is bigger than the previous value
of 4096, and large enough to have a full-screen buffer on a Retina 5K iMac.

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::getIntegerv):

LayoutTests:

Unskip webgl/1.0.2/conformance/canvas/drawingbuffer-static-canvas-test.html.

* TestExpectations:

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

2 years agoAdd test to ensure that text-overflow: ellipsis text is scrollable
dbates@webkit.org [Wed, 18 Oct 2017 23:14:34 +0000 (23:14 +0000)]
Add test to ensure that text-overflow: ellipsis text is scrollable
https://bugs.webkit.org/show_bug.cgi?id=178395

Reviewed by Zalan Bujtas.

* fast/text/scroll-text-overflow-ellipsis-expected.html: Added.
* fast/text/scroll-text-overflow-ellipsis.html: Added.
* platform/ios-wk1/TestExpectations: For now, skip the test in legacy WebKit on iOS
as eventSender.keyDown() does not seem to be dispatching a keyboard event to the
focused field. See <https://bugs.webkit.org/show_bug.cgi?id=178490>.
* resources/ui-helper.js:
(window.UIHelper.keyDown.return.new.Promise):
(window.UIHelper.keyDown):

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

2 years ago[Service Worker] Add stubs for Client / WindowClient / Clients
cdumez@apple.com [Wed, 18 Oct 2017 22:31:55 +0000 (22:31 +0000)]
[Service Worker] Add stubs for Client / WindowClient / Clients
https://bugs.webkit.org/show_bug.cgi?id=178469

Reviewed by Youenn Fablet.

Source/WebCore:

Add stubs for Client / WindowClient / Clients:
- https://w3c.github.io/ServiceWorker/v1/#clients
- https://w3c.github.io/ServiceWorker/v1/#client-interface

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::visibilityState const):
* dom/Document.h:
* dom/Document.idl:
* dom/VisibilityState.h: Renamed from Source/WebCore/page/PageVisibilityState.h.
* dom/VisibilityState.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* page/Page.cpp:
(WebCore::Page::visibilityState const):
* page/Page.h:
* workers/service/ServiceWorkerClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
(WebCore::ServiceWorkerClient::ServiceWorkerClient):
(WebCore::ServiceWorkerClient::activeDOMObjectName const):
(WebCore::ServiceWorkerClient::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorkerClient::url const):
(WebCore::ServiceWorkerClient::frameType const):
(WebCore::ServiceWorkerClient::id const):
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerClients.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
(WebCore::ServiceWorkerClients::ServiceWorkerClients):
(WebCore::ServiceWorkerClients::activeDOMObjectName const):
(WebCore::ServiceWorkerClients::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorkerClients::get):
(WebCore::ServiceWorkerClients::matchAll):
(WebCore::ServiceWorkerClients::openWindow):
(WebCore::ServiceWorkerClients::claim):
* workers/service/ServiceWorkerClients.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
(WebCore::ServiceWorkerClients::create):
* workers/service/ServiceWorkerClients.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
* workers/service/ServiceWorkerGlobalScope.h:
(WebCore::ServiceWorkerGlobalScope::clients):
* workers/service/ServiceWorkerGlobalScope.idl:
* workers/service/ServiceWorkerWindowClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
(WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
(WebCore::ServiceWorkerWindowClient::visibilityState const):
(WebCore::ServiceWorkerWindowClient::isFocused const):
(WebCore::ServiceWorkerWindowClient::focus):
(WebCore::ServiceWorkerWindowClient::navigate):
* workers/service/ServiceWorkerWindowClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerWindowClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.

Source/WebKit:

Rename PageVisibilityState to VisibilityState.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toVisibilityState):
* WebProcess/WebPage/WebPage.h:

Source/WebKitLegacy/mac:

Rename PageVisiblityState to VisibilityState.

* WebView/WebView.mm:
(kit):

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

2 years ago[FrameView::layout cleanup] Use SetForScope to protect m_needsFullRepaint's value...
zalan@apple.com [Wed, 18 Oct 2017 22:27:55 +0000 (22:27 +0000)]
[FrameView::layout cleanup] Use SetForScope to protect m_needsFullRepaint's value on reentrancy
https://bugs.webkit.org/show_bug.cgi?id=178479
<rdar://problem/35056950>

Reviewed by Simon Fraser.

No change in functionality.

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

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

2 years agoMake failing WebGL tests produce debug output
dino@apple.com [Wed, 18 Oct 2017 22:01:49 +0000 (22:01 +0000)]
Make failing WebGL tests produce debug output
https://bugs.webkit.org/show_bug.cgi?id=178421

Reviewed by Jon Lee.

If a WebGL conformance test fails, we just get the word "FAIL". Instead,
have it log the actual output of the test, so we can see what happens
on bots.

Drive-by fix where I noticed a test file was missing, that causes
two tests to timeout. They may still timeout, but now because they
take a long time to run rather than they have a JS error.

* platform/mac/TestExpectations:
* webgl/1.0.2/resources/webgl_test_files/conformance/resources/iterable-test.js: Added.
* webgl/1.0.2/resources/webkit-webgl-test-harness.js:
(window.webglTestHarness.notifyFinished):
* webgl/resources/webkit-webgl-test-harness.js:
(window.webglTestHarness.notifyFinished):

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

2 years ago[FrameView::layout cleanup] Remove InPreLayoutStyleUpdate.
zalan@apple.com [Wed, 18 Oct 2017 21:54:28 +0000 (21:54 +0000)]
[FrameView::layout cleanup] Remove InPreLayoutStyleUpdate.
https://bugs.webkit.org/show_bug.cgi?id=178483
<rdar://problem/35058800>

Reviewed by Simon Fraser.

Its client, updateCompositingLayersAfterStyleChange only needs to know if there's a upcoming
layer update (part of FrameView::layout()).

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::updateCompositingLayersAfterStyleChange):
(WebCore::FrameView::layout):
* page/FrameView.h:

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

2 years agowebkitpy tests should have --json-output option
aakash_jain@apple.com [Wed, 18 Oct 2017 21:52:09 +0000 (21:52 +0000)]
webkitpy tests should have --json-output option
https://bugs.webkit.org/show_bug.cgi?id=178481

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/test/main.py:
(Tester._parse_args): Added json-output argument.
(Tester._run_tests): Write output to json file.

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

2 years agoGlobal constructors exposed to service workers should go on ServiceWorkerGlobalScope...
cdumez@apple.com [Wed, 18 Oct 2017 21:37:33 +0000 (21:37 +0000)]
Global constructors exposed to service workers should go on ServiceWorkerGlobalScope interface
https://bugs.webkit.org/show_bug.cgi?id=178482

Reviewed by Sam Weinig.

Global constructors exposed to service workers should go on ServiceWorkerGlobalScope interface,
not the ServiceWorker interface.

* bindings/scripts/preprocess-idls.pl:

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

2 years agoAdd an argument indicating the type of insertion to Node::insertedInto
rniwa@webkit.org [Wed, 18 Oct 2017 21:34:25 +0000 (21:34 +0000)]
Add an argument indicating the type of insertion to Node::insertedInto
https://bugs.webkit.org/show_bug.cgi?id=178431

Reviewed by Antti Koivisto.

Added InsertionType as the first argument to Node::insertedInto, which contains two booleans indicating
whether the node just become newly connected to a document, and whether node's tree scope had changed or not.

These boolean flags simplifie the logic in insertedInto implementations, and are required to have a better
guarantee about the correctness of node flags during calls to insertedInto. Right now, isConnected() and
isInShadowTree() are both outdated until Node::insertedInto is called.

Also renamed the second argument from insertionPoint to parentOfInsertedTree to make the semantics clear,
and renamed finishedInsertingSubtree to didFinishInsertingNode, and renamed InsertionNotificationRequest
to InsertedIntoResult using enum class.

Note that in some implementations of insertedInto, we check whether isConnected() was false to decide whether
the node is newly connected to a document. This extra check is no longer necessary since no node will be inserted
into a document without first being completely removed after r223458.

No new tests since there should be no behavioral changes.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::notifyChildInserted):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyNodeInsertedIntoDocument): Replaced the check that the node had not been disconnected by scripts
by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
(WebCore::notifyNodeInsertedIntoTree): Removed NoEventDispatchAssertion since notifyChildNodeInserted has it
already since r223458.
(WebCore::notifyChildNodeInserted): Made this function return NodeVector (copy elision).
* dom/ContainerNodeAlgorithms.h:
* dom/Element.cpp:
(WebCore::Element::insertedInto): Use insertionType.connectedToDocument to detect when this element had become
connected to some document. Similarly, use insertionType.treeScopeChanged to detect when this element had been
inserted into a new tree scope. Removed the comment which became obsolete due to this cleanup.
(WebCore::Element::addShadowRoot): Simplified the code here since we never attach a ShadowRoot with children.
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::insertedInto):
* dom/Node.h:
(WebCore::Node::InsertedIntoResult): Renamed from InsertionNotificationRequest, and turned into an enum class.
(WebCore::Node::InsertionType): Added. We pass this object by value to insertedInto as a performance optimization
as passing two booleans by value is faster than passing a pointer and then de-referencing it in a virtual callee.
(WebCore::Node::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* dom/ProcessingInstruction.h:
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::shouldCallFinishedInsertingSubtree): Deleted.
(WebCore::ScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* dom/ScriptElement.h:
(WebCore::ScriptElement::insertedInto const): Added. Extracted from shouldCallFinishedInsertingSubtree.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::insertedInto): The extra isConnected() check is no longer needed. See the description above.
* dom/ShadowRoot.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::insertedInto):
* html/FormAssociatedElement.h:
* html/HTMLBaseElement.cpp:
(WebCore::HTMLBaseElement::insertedInto):
* html/HTMLBaseElement.h:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedInto):
(WebCore::HTMLBodyElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLBodyElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::insertedInto):
(WebCore::HTMLFormControlElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLFormControlElement.h:
* html/HTMLFormControlElementWithState.cpp:
(WebCore::HTMLFormControlElementWithState::insertedInto):
* html/HTMLFormControlElementWithState.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::insertedInto):
* html/HTMLFormElement.h:
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::insertedInto):
(WebCore::HTMLFrameElementBase::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLFrameElementBase.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::insertedInto):
* html/HTMLFrameSetElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::insertedInto):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::insertedInto):
(WebCore::HTMLInputElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLInputElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::insertedInto): The extra isConnected() check is no longer needed. See above.
(WebCore::HTMLLinkElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLLinkElement.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::insertedInto):
* html/HTMLMapElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::insertedInto):
(WebCore::HTMLMediaElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLMediaElement.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::insertedInto):
* html/HTMLMetaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::insertedInto):
(WebCore::HTMLObjectElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLObjectElement.h:
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::insertedInto):
* html/HTMLOptionElement.h:
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::insertedInto):
(WebCore::HTMLScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLScriptElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::insertedInto):
* html/HTMLSelectElement.h:
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::insertedInto): Replaced a cumbersome condition by a boolean check on insertionType's
treeScopeChanged and removed the accompanying comment which is no longer needed.
* html/HTMLSlotElement.h:
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
* html/HTMLSourceElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above.
* html/HTMLStyleElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::insertedInto):
* html/HTMLTextFormControlElement.h:
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::insertedInto):
* html/HTMLTitleElement.h:
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::insertedInto): Added a FIXME since this code is clearly wrong.
* html/HTMLTrackElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::insertedInto):
* svg/SVGElement.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::insertedInto):
(WebCore::SVGFEImageElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/SVGFEImageElement.h:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::insertedInto):
* svg/SVGFontFaceElement.h:
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::insertedInto):
* svg/SVGFontFaceUriElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::insertedInto):
* svg/SVGImageElement.h:
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::insertedInto):
(WebCore::SVGMPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/SVGMPathElement.h:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::insertedInto):
* svg/SVGPathElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::insertedInto):
* svg/SVGSVGElement.h:
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::insertedInto):
(WebCore::SVGScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/SVGScriptElement.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above description.
* svg/SVGStyleElement.h:
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::insertedInto):
(WebCore::SVGTRefElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/SVGTRefElement.h:
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::insertedInto):
(WebCore::SVGTextPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/SVGTextPathElement.h:
* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::insertedInto):
* svg/SVGTitleElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::insertedInto):
* svg/SVGUseElement.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::insertedInto):
(WebCore::SVGSMILElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/animation/SVGSMILElement.h:

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

2 years agoKey events should not update Document.lastHandledUserGestureTimestamp unless key...
eric.carlson@apple.com [Wed, 18 Oct 2017 20:26:38 +0000 (20:26 +0000)]
Key events should not update Document.lastHandledUserGestureTimestamp unless key event is handled
https://bugs.webkit.org/show_bug.cgi?id=178473
<rdar://problem/34869935>

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests, updated media/restricted-audio-playback-with-document-gesture.html for this change.

* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent): Restore the current Document's "lastHandledUserGestureTimestamp"
if the key event was not handled.

LayoutTests:

* media/restricted-audio-playback-with-document-gesture.html: Pass true to runWithKeyDown so
it consumes the keydown event.
* media/video-test.js:
(runWithKeyDown): Take optional parameter which causes event handler to call preventDefault.

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

2 years agoUnreviewed, rolling out r223291.
wenson_hsieh@apple.com [Wed, 18 Oct 2017 20:20:37 +0000 (20:20 +0000)]
Unreviewed, rolling out r223291.

Source/WebCore:

After further investigation, this removed codepath is
something Mail may want to re-adopt. Additionally, the
original breaking change was rolled out in r223408, so
this test once again passes on ToT.

Reverted changeset:

"Remove Editor::simplifyMarkup"
https://bugs.webkit.org/show_bug.cgi?id=178271
https://trac.webkit.org/changeset/223291

Source/WebKitLegacy/mac:

See WebCore ChangeLog for more detail.

Reverted changeset:

"Remove Editor::simplifyMarkup"
https://bugs.webkit.org/show_bug.cgi?id=178271
https://trac.webkit.org/changeset/223291

Tools:

See WebCore ChangeLog for more detail.

Reverted changeset:

"Remove Editor::simplifyMarkup"
https://bugs.webkit.org/show_bug.cgi?id=178271
https://trac.webkit.org/changeset/223291

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

2 years ago[Settings] Move remaining simple settings to Settings.in
commit-queue@webkit.org [Wed, 18 Oct 2017 20:18:38 +0000 (20:18 +0000)]
[Settings] Move remaining simple settings to Settings.in
https://bugs.webkit.org/show_bug.cgi?id=177730
<rdar://problem/34763346>

Patch by Sam Weinig <sam@webkit.org> on 2017-10-18
Reviewed by Daniel Bates.

* Scripts/GenerateSettings/Settings.py:
(Setting.__init__):
(Setting.__str__):
(Setting.getterFunctionName):
(parseInput):

    Add support for parsing the 'getter' option.

* page/Settings.in:

    Migrate simple settings from SettingsBase to here.

* page/SettingsBase.cpp:
(WebCore::SettingsBase::SettingsBase):
(WebCore::SettingsBase::setJavaEnabled): Deleted.
(WebCore::SettingsBase::setJavaEnabledForLocalFiles): Deleted.
(WebCore::SettingsBase::setPreferMIMETypeForImages): Deleted.
(WebCore::SettingsBase::setForcePendingWebGLPolicy): Deleted.
(WebCore::SettingsBase::setNeedsAdobeFrameReloadingQuirk): Deleted.
(WebCore::SettingsBase::setFontRenderingMode): Deleted.
(WebCore::SettingsBase::fontRenderingMode const): Deleted.
(WebCore::SettingsBase::setShowTiledScrollingIndicator): Deleted.
(WebCore::SettingsBase::setFontFallbackPrefersPictographs): Deleted.
* page/SettingsBase.h:
(WebCore::SettingsBase::isJavaEnabled const): Deleted.
(WebCore::SettingsBase::isJavaEnabledForLocalFiles const): Deleted.
(WebCore::SettingsBase::preferMIMETypeForImages const): Deleted.
(WebCore::SettingsBase::needsAcrobatFrameReloadingQuirk const): Deleted.
(WebCore::SettingsBase::showTiledScrollingIndicator const): Deleted.
(WebCore::SettingsBase::setTouchEventEmulationEnabled): Deleted.
(WebCore::SettingsBase::isTouchEventEmulationEnabled const): Deleted.
(WebCore::SettingsBase::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
(WebCore::SettingsBase::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
(WebCore::SettingsBase::fontFallbackPrefersPictographs const): Deleted.
(WebCore::SettingsBase::setMediaKeysStorageDirectory): Deleted.
(WebCore::SettingsBase::mediaKeysStorageDirectory const): Deleted.
(WebCore::SettingsBase::setMediaDeviceIdentifierStorageDirectory): Deleted.
(WebCore::SettingsBase::mediaDeviceIdentifierStorageDirectory const): Deleted.
(WebCore::SettingsBase::applePayEnabled const): Deleted.
(WebCore::SettingsBase::setApplePayEnabled): Deleted.
(WebCore::SettingsBase::applePayCapabilityDisclosureAllowed const): Deleted.
(WebCore::SettingsBase::setApplePayCapabilityDisclosureAllowed): Deleted.
(WebCore::SettingsBase::isForcePendingWebGLPolicy const): Deleted.

    Remove simple settings.

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

2 years agoediting/deleting/delete-emoji-9.html is failing consistently.
mmaxfield@apple.com [Wed, 18 Oct 2017 19:30:28 +0000 (19:30 +0000)]
editing/deleting/delete-emoji-9.html is failing consistently.
https://bugs.webkit.org/show_bug.cgi?id=178478

Unreviewed.

* platform/mac/editing/deleting/delete-emoji-9-expected.txt:

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

2 years ago[FrameView::layout cleanup] Move root/body marking dirty logic to a separate function
zalan@apple.com [Wed, 18 Oct 2017 19:19:38 +0000 (19:19 +0000)]
[FrameView::layout cleanup] Move root/body marking dirty logic to a separate function
https://bugs.webkit.org/show_bug.cgi?id=178477
<rdar://problem/35056478>

Reviewed by Simon Fraser.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::markRootOrBodyRendererDirty const):
(WebCore::FrameView::layout):
* page/FrameView.h:

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

2 years agoSetup WebCore build to start using unified sources.
keith_miller@apple.com [Wed, 18 Oct 2017 19:14:51 +0000 (19:14 +0000)]
Setup WebCore build to start using unified sources.
https://bugs.webkit.org/show_bug.cgi?id=178362

Reviewed by Tim Horton.

.:

Pass features to the unified source bundler script.

* Source/cmake/WebKitCommon.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

Change comments in source list files. Also, pass explicit names for build files.

* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* Sources.txt:
* SourcesGTK.txt:
* SourcesMac.txt:

Source/WebCore:

This patch adds all the long tooling needed to start adding
unified sources to WebCore. Most of the source list files
are empty to start but will be filled over the next few days.

I started by moving all the non-derived bindings code to
unified sources to make sure everything worked correctly.

* CMakeLists.txt:
* Configurations/GenerateUnifiedSources.xcconfig: Added.
* Configurations/WebCore.xcconfig:
* PlatformMac.cmake:
* Sources.txt: Added.
* SourcesCocoa.txt: Added.
* SourcesIOS.txt: Added.
* SourcesMac.txt: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMediaStreamCapabilitiesCustom.cpp: Removed. No one seems to use this...

Source/WTF:

There are a number of changes to the bundler script. First, it is
now possible to enable or disable building files based on if the
associated feature flag is enabled or not. The syntax for this is
similar to how we do #ifs in C++ code. e.g.

#if ENABLE_APPLE_PAY
    myApplePayFile.cpp
#endif

would enable myApplePayFile.cpp if and only if the APPLE_PAY
feature define is set.

I also changed comments from # to // to make it less likely they
would be confused with a #if.

Finally, this patch enables bundling files in the same relative
directory across source list files. Previously, if
SourcesCocoa.txt had platform/cf/foo.cpp and SourcesMac.txt had
platform/cf/bar.cpp those files would not be put in the same
unified source bundle. Now, those files will be put into the same
bundle but bar.cpp will always follow foo.cpp. The idea is that by
putting more specific files after more general files we can avoid
random build failures.

* Scripts/generate-unified-source-bundles.rb:

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

2 years ago[GTK] Web Inspector: Add Layers.svg
commit-queue@webkit.org [Wed, 18 Oct 2017 18:39:04 +0000 (18:39 +0000)]
[GTK] Web Inspector: Add Layers.svg
https://bugs.webkit.org/show_bug.cgi?id=178430

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-18
Reviewed by Michael Catanzaro.

* UserInterface/Images/gtk/Layers.svg: Added.

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

2 years agoUnreviewed, rolling out r223321.
commit-queue@webkit.org [Wed, 18 Oct 2017 18:28:20 +0000 (18:28 +0000)]
Unreviewed, rolling out r223321.
https://bugs.webkit.org/show_bug.cgi?id=178476

This protocol change broke some internal builds (Requested by
brrian__ on #webkit).

Reverted changeset:

"Web Inspector: provide a way to enable/disable event
listeners"
https://bugs.webkit.org/show_bug.cgi?id=177451
https://trac.webkit.org/changeset/223321

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

2 years agoRoll out r223316.
aestes@apple.com [Wed, 18 Oct 2017 18:23:09 +0000 (18:23 +0000)]
Roll out r223316.

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

2 years agoCheck notifyPagesWhenTelemetryWasCaptured before notifying pages if there is no WebPa...
wilander@apple.com [Wed, 18 Oct 2017 18:21:16 +0000 (18:21 +0000)]
Check notifyPagesWhenTelemetryWasCaptured before notifying pages if there is no WebPageProxy
https://bugs.webkit.org/show_bug.cgi?id=178470
<rdar://problem/34417518>

Reviewed by Brian Burg.

* UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
    Add a missing check of notifyPagesWhenTelemetryWasCaptured.
    The page notification is only for testing purposes.

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

2 years agoThe compiler should always register a structure when it adds its transitionWatchPointSet.
mark.lam@apple.com [Wed, 18 Oct 2017 17:41:55 +0000 (17:41 +0000)]
The compiler should always register a structure when it adds its transitionWatchPointSet.
https://bugs.webkit.org/show_bug.cgi?id=178420
<rdar://problem/34814024>

Reviewed by Saam Barati and Filip Pizlo.

JSTests:

* stress/regress-178420.js: Added.
(new.Array.10000.map):

Source/JavaScriptCore:

Instead of invoking addLazily() to add a structure's transitionWatchpointSet, we
now invoke Graph::registerAndWatchStructureTransition() on the structure.
registerAndWatchStructureTransition() both registers the structure and add its
transitionWatchpointSet to the plan desired watchpoints.

Graph::registerAndWatchStructureTransition() is based on Graph::registerStructure()
except registerAndWatchStructureTransition() adds the structure's
transitionWatchpointSet unconditionally.

* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::refine const):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):

* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::registerAndWatchStructureTransition):
* dfg/DFGGraph.h:

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
- The second set of addLazily()s is redundant.  This set is executed only when
  prototypeChainIsSane is true, and prototypeChainIsSane can only be true if and
  only if we've executed the if statement above it.  That preceding if statement
  already registerAndWatchStructureTransition() the same 2 structures.  Hence,
  this second set can be deleted.

* dfg/DFGWatchpointCollectionPhase.cpp:
(JSC::DFG::WatchpointCollectionPhase::addLazily):
- Deleted an unused function.

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

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

2 years agohttp/tests/loading/basic-auth-resend-wrong-credentials.html is still a flaky failure...
achristensen@apple.com [Wed, 18 Oct 2017 17:16:41 +0000 (17:16 +0000)]
http/tests/loading/basic-auth-resend-wrong-credentials.html is still a flaky failure after proposed fix.
https://bugs.webkit.org/show_bug.cgi?id=178467

Reviewed by Andy Estes.

* http/tests/loading/basic-auth-resend-wrong-credentials-expected.txt:
* http/tests/loading/basic-auth-resend-wrong-credentials.html:
* platform/wk2/http/tests/loading/basic-auth-resend-wrong-credentials-expected.txt:
Use setTimeout to make the loading order deterministic.
The important part of this test is that the passwords shown in the delegate callbacks are correct,
and this doesn't change that.

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

2 years ago[Settings] Miscellaneous cleanup of the settings generation scripts
commit-queue@webkit.org [Wed, 18 Oct 2017 17:10:16 +0000 (17:10 +0000)]
[Settings] Miscellaneous cleanup of the settings generation scripts
https://bugs.webkit.org/show_bug.cgi?id=178462

Patch by Sam Weinig <sam@webkit.org> on 2017-10-18
Reviewed by Daniel Bates.

- Stop generating and remove now unused SettingsMacros.h
- Make functions operating on the python Setting object member functions
- Add predicate to determine if a Setting's type is a value type, allowing
  us to exclude those from using const references.

* CMakeLists.txt:
* DerivedSources.make:
* Scripts/GenerateSettings.py:
* Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py:
* Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py:
* Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py:
* Scripts/GenerateSettings/GenerateSettings.py:
* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
* Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
* Scripts/GenerateSettings/Settings.py:
* WebCoreMacros.cmake:
* WebCore.xcodeproj/project.pbxproj:

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

2 years agoAlign ImageData constructor with the specification
cdumez@apple.com [Wed, 18 Oct 2017 16:59:52 +0000 (16:59 +0000)]
Align ImageData constructor with the specification
https://bugs.webkit.org/show_bug.cgi?id=178406

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline test now that one more check is passing.

* web-platform-tests/html/semantics/embedded-content/the-canvas-element/imagedata-expected.txt:

Source/WebCore:

Align ImageData constructor with the specification:
- https://html.spec.whatwg.org/multipage/canvas.html#dom-imagedata

It sometimes throws the wrong exception.

No new tests, rebaselined existing test.

* html/ImageData.cpp:
(WebCore::ImageData::create):
* html/ImageData.h:
* html/ImageData.idl:

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

2 years agoUnreviewed, fix build error after r223608 with some SDKs.
cdumez@apple.com [Wed, 18 Oct 2017 16:54:36 +0000 (16:54 +0000)]
Unreviewed, fix build error after r223608 with some SDKs.

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::ensureSWOriginStoreForSession):

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

2 years ago[GTK] Test gardening.
Ms2ger@igalia.com [Wed, 18 Oct 2017 16:20:19 +0000 (16:20 +0000)]
[GTK] Test gardening.
https://bugs.webkit.org/show_bug.cgi?id=178461

Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

2 years agoAdd an efficient data structure for WebCore to query if there is a Service Worker...
cdumez@apple.com [Wed, 18 Oct 2017 16:12:11 +0000 (16:12 +0000)]
Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin
https://bugs.webkit.org/show_bug.cgi?id=177876
<rdar://problem/34813129>

Reviewed by Ryosuke Niwa.

Source/WebCore:

No new tests, updatdd existing test.

* dom/Document.h:
* testing/Internals.cpp:
(WebCore::Internals::hasServiceWorkerRegisteredForOrigin):
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/ServiceWorkerProvider.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::startServiceWorkerContext):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::scriptContextStarted):
(WebCore::SWServer::scriptContextStarted):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::scriptContextFailedToStart):
(WebCore::SWServerRegistration::scriptContextStarted):
* workers/service/server/SWServerRegistration.h:

Source/WebKit:

Introduce a Service Worker origin store which gets populated / updated on the StorageProcess side
and queried on the WebContent process side via the WebSWOriginTable so that the WebProcess can
efficiently check if there is a ServiceWorker registered for a given origin without actually doing
an IPC to the StorageProcess.

For efficiency, the hash table is backed by SharedMemory so we only pass shared memory handles
between the StorageProcess and the WebProcesses.

We currently add entries to the WebSWOriginStore whenever a service worker registration succeeds
on the StorageProcess side. We also clear this store whenever the API to clear service worker
registrations is called. Code to query the WebSWOriginTable from the WebContent process side is
there but currently only used by Internals for testing. We will later leverage this code when
integrating with Fetch API.

* CMakeLists.txt:
* Shared/SharedStringHashStore.h:
(WebKit::SharedStringHashStore::Client::didUpdateSharedStringHashes):
* Shared/SharedStringHashTable.cpp:
(WebKit::SharedStringHashTable::clear):
* StorageProcess/ServiceWorker/WebSWOriginStore.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
(WebKit::WebSWOriginStore::WebSWOriginStore):
(WebKit::WebSWOriginStore::add):
(WebKit::WebSWOriginStore::remove):
(WebKit::WebSWOriginStore::clear):
(WebKit::WebSWOriginStore::registerSWServerConnection):
(WebKit::WebSWOriginStore::unregisterSWServerConnection):
(WebKit::WebSWOriginStore::sendStoreHandle):
(WebKit::WebSWOriginStore::didInvalidateSharedMemory):
* StorageProcess/ServiceWorker/WebSWOriginStore.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::WebSWServerConnection):
(WebKit::WebSWServerConnection::resolveJobInClient):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
(WebKit::WebSWServerConnection::sessionID const):
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::deleteWebsiteData):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::ensureSWOriginStoreForSession):
(WebKit::StorageProcess::swOriginStoreForSession const):
(WebKit::StorageProcess::serviceWorkerContextStarted):
(WebKit::StorageProcess::registerSWServerConnection):
(WebKit::StorageProcess::unregisterSWServerConnection):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
(WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const):
(WebKit::WebSWClientConnection::setSWOriginTableSharedMemory):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:
* WebProcess/Storage/WebSWOriginTable.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
(WebKit::WebSWOriginTable::contains const):
(WebKit::WebSWOriginTable::setSharedMemory):
* WebProcess/Storage/WebSWOriginTable.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
* WebProcess/Storage/WebServiceWorkerProvider.h:
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
* WebProcess/Storage/WebToStorageProcessConnection.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::startServiceWorkerContext):

Tools:

Clear service worker registrations between test runs to avoid flakiness.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):

LayoutTests:

Add layout test coverage. Also rebaseline a few tests now that registration succeeds.

* http/tests/workers/service/basic-register-exceptions-expected.txt:
* http/tests/workers/service/basic-register-expected.txt:
* http/tests/workers/service/registration-task-queue-scheduling-1-expected.txt:
* http/tests/workers/service/resources/basic-register.js:
* http/tests/workers/service/resources/registration-task-queue-scheduling-1.js:

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

2 years ago[Settings] Replace macros in Settings.h/cpp with generated code
commit-queue@webkit.org [Wed, 18 Oct 2017 15:16:35 +0000 (15:16 +0000)]
[Settings] Replace macros in Settings.h/cpp with generated code
https://bugs.webkit.org/show_bug.cgi?id=178419

Patch by Sam Weinig <sam@webkit.org> on 2017-10-18
Reviewed by Antti Koivisto.

* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:

    Rather than use macros in the generated Settings class, generate the code the macros
    would expand to.

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

2 years agoREGRESSION(r217771): nullTerminatedWCharToString loses last character of input string
annulen@yandex.ru [Wed, 18 Oct 2017 14:57:13 +0000 (14:57 +0000)]
REGRESSION(r217771): nullTerminatedWCharToString loses last character of input string
https://bugs.webkit.org/show_bug.cgi?id=178444

Reviewed by Per Arne Vollan.

* wtf/text/win/WCharStringExtras.h:
(WTF::nullTerminatedWCharToString):

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

2 years ago[FrameView::layout cleanup] Move frame flattening layout logic to a separate function
zalan@apple.com [Wed, 18 Oct 2017 14:18:24 +0000 (14:18 +0000)]
[FrameView::layout cleanup] Move frame flattening layout logic to a separate function
https://bugs.webkit.org/show_bug.cgi?id=178425
<rdar://problem/35045836>

Reviewed by Antti Koivisto.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
(WebCore::FrameView::layout):
(WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
* page/FrameView.h:

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

2 years agoResolve ::before and ::after pseudo elements during style resolution
antti@apple.com [Wed, 18 Oct 2017 13:41:04 +0000 (13:41 +0000)]
Resolve ::before and ::after pseudo elements during style resolution
https://bugs.webkit.org/show_bug.cgi?id=178339
Source/WebCore:

Reviewed by Ryosuke Niwa.

They are currently resolved during render tree building which creates problems with display:contents and animations.

* dom/PseudoElement.cpp:
(WebCore::PseudoElement::PseudoElement):

    Call InspectorInstrumentation from constructor.

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

    Push the full update to the parent stack.

(WebCore::RenderTreeUpdater::popParent):
(WebCore::RenderTreeUpdater::updateBeforeDescendants):
(WebCore::RenderTreeUpdater::updateAfterDescendants):
(WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
* style/RenderTreeUpdater.h:
* style/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):

    No need to resolve pseudo style, we have it already.

(WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
(WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted.
(WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted.
* style/RenderTreeUpdaterGeneratedContent.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::resolvePseudoStyle):

    Resolve pseudos.

(WebCore::Style::TreeResolver::createAnimatedElementUpdate):

    Make a private member function.

(WebCore::Style::TreeResolver::resolveComposedTree):
* style/StyleTreeResolver.h:
* style/StyleUpdate.cpp:
(WebCore::Style::Update::elementUpdates const):
(WebCore::Style::Update::elementUpdates):

    Bundle the style update for an element and the associated before/after pseudos.

(WebCore::Style::Update::elementStyle const):
(WebCore::Style::Update::elementStyle):
(WebCore::Style::Update::addElement):
(WebCore::Style::Update::elementUpdate const): Deleted.
(WebCore::Style::Update::elementUpdate): Deleted.
* style/StyleUpdate.h:

LayoutTests:

<rdar://problem/35025601>

Reviewed by Ryosuke Niwa.

Add a test verifying a crash noticed with earlier version of this patch.

* fast/css-generated-content/svg-use-crash-expected.html: Added.
* fast/css-generated-content/svg-use-crash.html: Added.

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

2 years ago[JSC] Remove unused private name structure
utatane.tea@gmail.com [Wed, 18 Oct 2017 12:53:30 +0000 (12:53 +0000)]
[JSC] Remove unused private name structure
https://bugs.webkit.org/show_bug.cgi?id=178436

Reviewed by Sam Weinig.

It is no longer used. This patch just removes it.

* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::numberObjectStructure const):
(JSC::JSGlobalObject::privateNameStructure const): Deleted.

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

2 years agoUpdate the signatures of texSubImage3D.
Ms2ger@igalia.com [Wed, 18 Oct 2017 12:47:17 +0000 (12:47 +0000)]
Update the signatures of texSubImage3D.
https://bugs.webkit.org/show_bug.cgi?id=178435

Reviewed by Sam Weinig.

Update the signatures of texSubImage3D.

No new tests: not much point in adding tests now; this method doesn't
do anything anyway.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texSubImage3D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:

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

2 years agoRemove remnants of OpenWebRTC
zandobersek@gmail.com [Wed, 18 Oct 2017 12:04:10 +0000 (12:04 +0000)]
Remove remnants of OpenWebRTC
https://bugs.webkit.org/show_bug.cgi?id=178437

Reviewed by Alejandro G. Castro.

.:

Remove the FindOpenWebRTC.cmake file and the searches for it in both
OptionsGTK and OptionsWPE.

* Source/cmake/FindOpenWebRTC.cmake: Removed.
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Tools:

Drop OpenWebRTC packages from the GTK's Jhbuild modules file. Relevant
patches are also removed.

* gtk/jhbuild.modules:
* gtk/patches/libnice-0001-TURN-allow-REALM-to-be-empty.patch: Removed.
* gtk/patches/libnice-0001-nicesrc-spin-the-agent-mainloop-in-a-separate-thread.patch: Removed.
* gtk/patches/rtspsrc-timeout-on-udpsrc-is-in-nanoseconds.patch: Removed.
* gtk/patches/udpsrc-improve-timeouts.patch: Removed.

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

2 years agoUse LazyNeverDestroyed instead of DEFINE_GLOBAL for WebKitFontFamilyNames
commit-queue@webkit.org [Wed, 18 Oct 2017 11:05:40 +0000 (11:05 +0000)]
Use LazyNeverDestroyed instead of DEFINE_GLOBAL for WebKitFontFamilyNames
https://bugs.webkit.org/show_bug.cgi?id=175106

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-18
Reviewed by Yusuke Suzuki.

No new tests because there is no behavior change.

* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::familyNameFromPrimitive): Call get() method of LazyNeverDestroyed.
* dom/make_names.pl: Use LazyNeverDestroyed for font names.

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